/* MEDIA SYSTEM CLOUD MANAGER — feuille de style unique, mobile-first (§38). */
:root {
  --brand: #0b5fff;
  --brand-dark: #0847c2;
  --brand-soft: #e8f0ff;
  --ink: #111827;
  --ink-2: #374151;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f4f6fa;
  --card: #ffffff;
  --green: #047857; --green-bg: #d1fae5;
  --amber: #92400e; --amber-bg: #fef3c7;
  --red: #b91c1c; --red-bg: #fee2e2;
  --blue: #1d4ed8; --blue-bg: #dbeafe;
  --gray: #4b5563; --gray-bg: #f3f4f6;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.08);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--ink); background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .6em; color: var(--ink); }
h1 { font-size: 1.6rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
code, .mono { font-family: Consolas, "Courier New", monospace; font-size: .92em; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); } .small { font-size: .86rem; } .nowrap { white-space: nowrap; }
.text-right { text-align: right; } .text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 1rem; }
.flex { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; }
.hidden { display: none !important; }

/* Grilles */
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-2-1 { grid-template-columns: 2fr 1fr; } }
@media (min-width: 1024px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } }

/* Cartes */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 16px; }
.grid > .card + .card { margin-top: 0; }
.card-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: -4px 0 14px; font-size: 1.02rem; font-weight: 600; }
.card-flush { padding: 0; overflow: hidden; }
.card-flush .card-title { padding: 16px 20px 0; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 8px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: .94rem; cursor: pointer; text-decoration: none !important; line-height: 1.2; white-space: nowrap; background: var(--gray-bg); color: var(--ink); }
.btn:hover { filter: brightness(.96); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-outline { background: #fff; border-color: var(--line); color: var(--ink-2); }
.btn-danger { background: var(--red-bg); color: var(--red); }
.btn-success { background: var(--green); color: #fff; }
.btn-sm { padding: 6px 10px; font-size: .84rem; }
.btn-lg { padding: 13px 22px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; cursor: pointer; }

/* Formulaires */
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 5px; color: var(--ink-2); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=tel], input[type=url], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 8px; font: inherit; background: #fff; color: var(--ink); min-height: 42px; }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.field { margin-bottom: 14px; }
.field .hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.form-grid { display: grid; gap: 0 16px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .full { grid-column: 1 / -1; } .form-grid-3 { grid-template-columns: repeat(3, 1fr); } }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; }
.check input { margin-top: 3px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.inline-form { display: inline; }

/* Alertes */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; border: 1px solid transparent; }
.alert-success { background: var(--green-bg); color: var(--green); border-color: #a7f3d0; }
.alert-error { background: var(--red-bg); color: var(--red); border-color: #fecaca; }
.alert-info { background: var(--blue-bg); color: var(--blue); border-color: #bfdbfe; }
.alert-warning { background: var(--amber-bg); color: var(--amber); border-color: #fde68a; }

/* Badges */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 600; white-space: nowrap; }
.badge-green { background: var(--green-bg); color: var(--green); } .badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-red { background: var(--red-bg); color: var(--red); } .badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-gray { background: var(--gray-bg); color: var(--gray); }

/* Tableaux (défilement horizontal sur mobile) */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafbfc; white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafbff; }
.table .num { text-align: right; white-space: nowrap; }
.table tfoot td { font-weight: 600; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }

/* KPI */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); margin-bottom: 16px; }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(5, 1fr); } }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .label { font-size: .78rem; color: var(--muted); font-weight: 600; }
.kpi .value { font-size: 1.35rem; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: .78rem; color: var(--muted); }
.kpi.warn .value { color: var(--red); }

/* Graphiques SVG */
.chart { width: 100%; height: auto; display: block; }
.chart text { font-size: 10px; fill: var(--muted); font-family: var(--font); }
.bar-list { list-style: none; margin: 0; padding: 0; }
.bar-list li { margin-bottom: 10px; font-size: .88rem; }
.bar-list .bar { height: 8px; background: var(--brand-soft); border-radius: 4px; margin-top: 4px; overflow: hidden; }
.bar-list .bar span { display: block; height: 100%; background: var(--brand); border-radius: 4px; }

/* Définitions */
dl.props { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: 8px 14px; margin: 0; font-size: .93rem; }
dl.props dt { color: var(--muted); } dl.props dd { margin: 0; word-break: break-word; }

/* En-tête de page */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters input, .filters select { width: auto; min-width: 150px; flex: 1 1 150px; max-width: 280px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 9px 14px; font-weight: 600; font-size: .9rem; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
.pagination { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 14px; }
.pagination a, .pagination span { padding: 6px 11px; border-radius: 6px; border: 1px solid var(--line); background: #fff; font-size: .88rem; }
.pagination .current { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Messages ticket */
.thread { display: flex; flex-direction: column; gap: 12px; }
.msg { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fff; }
.msg.staff { background: var(--brand-soft); border-color: #c7d7fe; }
.msg.internal { background: var(--amber-bg); border-color: #fde68a; }
.msg .meta { font-size: .8rem; color: var(--muted); margin-bottom: 6px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.msg .body { white-space: pre-wrap; word-break: break-word; }

/* ───────── Portail public ───────── */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.05rem; color: var(--ink); text-decoration: none !important; }
.brand img { max-height: 38px; }
.brand .logo-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; }
.site-nav { display: none; gap: 4px; align-items: center; }
.site-nav a { padding: 8px 12px; color: var(--ink-2); font-weight: 600; border-radius: 8px; font-size: .93rem; text-decoration: none; }
.site-nav a:hover { background: var(--gray-bg); }
.nav-toggle { background: none; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 1.1rem; cursor: pointer; }
.site-nav.open { display: flex; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: #fff; padding: 10px 16px 16px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
@media (min-width: 960px) { .site-nav { display: flex; } .nav-toggle { display: none; } }
.cart-count { background: var(--brand); color: #fff; border-radius: 999px; font-size: .72rem; padding: 1px 7px; margin-left: 4px; }

.hero { background: linear-gradient(135deg, var(--brand) 0%, #0a2e7a 100%); color: #fff; padding: 56px 0 64px; }
.hero h1 { color: #fff; font-size: 1.9rem; margin-bottom: .4em; }
.hero p.lead { font-size: 1.08rem; opacity: .92; max-width: 640px; }
@media (min-width: 720px) { .hero h1 { font-size: 2.5rem; } }
.domain-search { display: flex; gap: 8px; background: #fff; padding: 8px; border-radius: 12px; max-width: 720px; box-shadow: 0 10px 30px rgba(0,0,0,.18); margin-top: 22px; flex-wrap: wrap; }
.domain-search input { border: 0; font-size: 1.05rem; flex: 1 1 220px; min-width: 0; }
.domain-search input:focus { outline: none; }
.tld-strip { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 14px; font-size: .9rem; opacity: .95; }
.tld-strip b { font-size: 1rem; }
.section { padding: 52px 0; }
.section-alt { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-title { text-align: center; margin-bottom: 30px; }
.section-title p { color: var(--muted); max-width: 640px; margin: 0 auto; }

.plans { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .plans { grid-template-columns: repeat(3, 1fr); } }
.plan { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 26px 22px; display: flex; flex-direction: column; box-shadow: var(--shadow); position: relative; }
.plan.featured { border: 2px solid var(--brand); box-shadow: 0 12px 30px rgba(11,95,255,.14); }
.plan .ribbon { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--brand); color: #fff; font-size: .75rem; font-weight: 700; padding: 3px 12px; border-radius: 999px; }
.plan h3 { margin-bottom: 2px; }
.plan .price { font-size: 1.9rem; font-weight: 800; margin: 12px 0 2px; }
.plan .price small { font-size: .9rem; font-weight: 500; color: var(--muted); }
.plan ul { list-style: none; padding: 0; margin: 16px 0 20px; flex: 1; }
.plan li { padding: 6px 0 6px 24px; position: relative; font-size: .93rem; border-bottom: 1px dashed var(--line); }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 700; }

.compare th, .compare td { text-align: center; }
.compare th:first-child, .compare td:first-child { text-align: left; }

.features { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .features { grid-template-columns: repeat(3, 1fr); } }
.feature { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.feature .icon { width: 42px; height: 42px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: 1.3rem; margin-bottom: 10px; }
.testimonial { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; font-size: .95rem; }
.testimonial .who { margin-top: 10px; font-weight: 600; font-size: .88rem; }
details.faq { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; }
details.faq summary { cursor: pointer; font-weight: 600; }
details.faq p { margin: 10px 0 0; color: var(--ink-2); }
.site-footer { background: #0b1324; color: #cbd5e1; padding: 40px 0 24px; font-size: .9rem; }
.site-footer a { color: #e2e8f0; }
.site-footer h4 { color: #fff; font-size: .95rem; }
.site-footer .copy { border-top: 1px solid #1e293b; margin-top: 24px; padding-top: 16px; font-size: .82rem; color: #94a3b8; }

.result-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.result-row:last-child { border-bottom: 0; }
.result-row .dn { font-weight: 700; font-size: 1.02rem; word-break: break-all; }
.result-row.requested { background: #f8fbff; }
.result-row .price { font-weight: 700; }

.summary-line { display: flex; justify-content: space-between; padding: 6px 0; gap: 10px; }
.summary-total { font-size: 1.2rem; font-weight: 800; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; }
.auth-box { max-width: 440px; margin: 40px auto; }

/* ───────── Back-office & espace client ───────── */
.shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 250px; background: #0f172a; color: #cbd5e1; overflow-y: auto; transform: translateX(-100%); transition: transform .2s; z-index: 50; }
.sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
.sidebar .brand { color: #fff; padding: 16px 18px; border-bottom: 1px solid #1e293b; }
.sidebar nav { padding: 10px 8px 30px; }
.sidebar .nav-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #64748b; padding: 14px 12px 6px; font-weight: 700; }
.sidebar a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; color: #cbd5e1; font-size: .92rem; text-decoration: none; }
.sidebar a:hover { background: #1e293b; color: #fff; }
.sidebar a.active { background: var(--brand); color: #fff; }
.sidebar a .count { margin-left: auto; background: #ef4444; color: #fff; font-size: .7rem; border-radius: 999px; padding: 0 7px; }
.main { min-width: 0; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; gap: 10px; position: sticky; top: 0; z-index: 20; }
.topbar .who { font-size: .88rem; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.content { padding: 20px 16px 40px; max-width: 1280px; }
.overlay { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 40; }
.overlay.open { display: block; }
@media (min-width: 1024px) {
  .sidebar { transform: none; }
  .main { margin-left: 250px; }
  .topbar .nav-toggle { display: none; }
  .content { padding: 24px 28px 48px; }
}
.client-nav { display: flex; gap: 4px; overflow-x: auto; padding: 0 16px; background: #fff; border-bottom: 1px solid var(--line); }
.client-nav a { padding: 12px 12px; font-weight: 600; font-size: .9rem; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; }
.client-nav a.active { color: var(--brand); border-bottom-color: var(--brand); }

/* Impression facture */
.invoice-doc { background: #fff; max-width: 860px; margin: 0 auto; padding: 32px; border: 1px solid var(--line); border-radius: var(--radius); }
.invoice-doc .head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.invoice-doc h1 { font-size: 1.5rem; }
.stamp { display: inline-block; border: 2px solid; padding: 4px 12px; border-radius: 6px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.stamp.paid { color: var(--green); } .stamp.unpaid { color: var(--red); }
@media print {
  body { background: #fff; }
  .no-print, .sidebar, .topbar, .site-header, .site-footer, .client-nav { display: none !important; }
  .main { margin: 0 !important; } .content { padding: 0 !important; }
  .invoice-doc { border: 0; padding: 0; }
}

/* Petits écrans : en-têtes allégés */
@media (max-width: 560px) {
  .hide-sm { display: none !important; }
  .site-header .brand span:last-child { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .who { gap: 6px; }
  .page-head h1 { font-size: 1.3rem; }
  .content { padding: 16px 12px 32px; }
}
