/* Medyado panel — tek stil dosyası */

:root {
  --bg: #F4F6FB;
  --surface: #FFFFFF;
  --surface-2: #F8FAFD;
  --ink: #0E1A36;
  --ink-2: #4B5878;
  --ink-3: #7A86A3;
  --line: #E3E8F2;
  --line-2: #EEF2F8;
  --brand: #1E6BEA;
  --brand-ink: #1554C4;
  --brand-soft: #E8F0FE;
  --navy: #0B1F4D;
  --navy-2: #13295F;
  --navy-line: #22396F;
  --cyan: #7FD8F7;
  --ok: #157F4A;   --ok-bg: #E2F5EA;
  --warn: #8A5300; --warn-bg: #FFF1D6;
  --danger: #B4232F; --danger-bg: #FDE6E8;
  --info: #1554C4; --info-bg: #E6EEFE;
  --muted: #5E6A86; --muted-bg: #EDF0F6;
  --shadow-sm: 0 1px 2px rgba(14, 26, 54, .05);
  --shadow: 0 1px 2px rgba(14, 26, 54, .04), 0 8px 24px -12px rgba(14, 26, 54, .14);
  --shadow-lg: 0 24px 48px -16px rgba(11, 31, 77, .28);
  --r: 14px;
  --r-sm: 10px;
  --font: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: Sora, Manrope, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A1226; --surface: #111B33; --surface-2: #0E172D; --ink: #E8EDF7; --ink-2: #A9B4CD; --ink-3: #7D89A6;
    --line: #22304F; --line-2: #1A2642; --brand: #4C8DF6; --brand-ink: #7DAEFF; --brand-soft: #16284F;
    --navy: #070E1F; --navy-2: #0F1A35; --navy-line: #1E2C4E;
    --ok: #5BD195; --ok-bg: #12301F; --warn: #F2C46D; --warn-bg: #33270F; --danger: #FF8A94; --danger-bg: #3A1519;
    --info: #8DB6FF; --info-bg: #15264A; --muted: #A9B4CD; --muted-bg: #1B2643;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0A1226; --surface: #111B33; --surface-2: #0E172D; --ink: #E8EDF7; --ink-2: #A9B4CD; --ink-3: #7D89A6;
  --line: #22304F; --line-2: #1A2642; --brand: #4C8DF6; --brand-ink: #7DAEFF; --brand-soft: #16284F;
  --navy: #070E1F; --navy-2: #0F1A35; --navy-line: #1E2C4E;
  --ok: #5BD195; --ok-bg: #12301F; --warn: #F2C46D; --warn-bg: #33270F; --danger: #FF8A94; --danger-bg: #3A1519;
  --info: #8DB6FF; --info-bg: #15264A; --muted: #A9B4CD; --muted-bg: #1B2643;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.5);
  color-scheme: dark;
}

*, *::before, *::after { 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); -webkit-font-smoothing: antialiased; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
img { max-width: 100%; }
.ic { flex: none; }
.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid transparent; font: 700 14px/1 var(--font); cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 6px 16px -8px rgba(30,107,234,.7); }
.btn-primary:hover { background: var(--brand-ink); color: #fff; }
.btn-dark { background: var(--navy); color: #fff; }
.btn-dark:hover { background: var(--navy-2); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink-3); color: var(--ink); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.btn-danger:hover { border-color: var(--danger); color: var(--danger); }
.btn-ok { background: var(--ok-bg); color: var(--ok); }
.btn-ok:hover { border-color: var(--ok); color: var(--ok); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn-lg { min-height: 50px; padding: 0 22px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { width: 42px; padding: 0; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--brand-ink); cursor: pointer; }

/* ---------- pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-danger { background: var(--danger-bg); color: var(--danger); }
.pill-info { background: var(--info-bg); color: var(--info); }
.pill-muted { background: var(--muted-bg); color: var(--muted); }
.tag { display: inline-flex; padding: 2px 8px; border-radius: 6px; background: var(--muted-bg); color: var(--ink-2); font-size: 12px; font-weight: 700; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 20px 0; }
.card-head h2 { font-size: 17px; }
.card-head .sub { color: var(--ink-2); font-size: 13px; }
.card-body { padding: 18px 20px 20px; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--line-2); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
@media (max-width: 1100px) { .grid-main { grid-template-columns: minmax(0, 1fr); } }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 16px; }
.stat { position: relative; padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; text-decoration: none !important; color: inherit; overflow: hidden; }
.stat:hover { border-color: var(--ink-3); }
.stat .label { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-weight: 600; font-size: 13px; }
.stat .value { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.stat .hint { font-size: 13px; color: var(--ink-3); }
.stat .badge { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; }
.tone-ok .badge { background: var(--ok-bg); color: var(--ok); }
.tone-warn .badge { background: var(--warn-bg); color: var(--warn); }
.tone-danger .badge { background: var(--danger-bg); color: var(--danger); }
.tone-info .badge { background: var(--info-bg); color: var(--info); }
.tone-danger .value { color: var(--danger); }

/* ---------- tables (stack into cards on phones) ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .1s; }
.table tbody tr[data-href] { cursor: pointer; }
.table tbody tr[data-href]:hover { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .act { text-align: right; width: 1%; white-space: nowrap; }
.cell-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cell-main strong { font-weight: 700; color: var(--ink); }
.cell-main span { font-size: 13px; color: var(--ink-2); }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }

@media (max-width: 760px) {
  .table.stackable thead { display: none; }
  .table.stackable, .table.stackable tbody, .table.stackable tr, .table.stackable td { display: block; width: 100%; }
  .table.stackable tr { padding: 14px 16px; border-bottom: 1px solid var(--line-2); display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; }
  .table.stackable tr:last-child { border-bottom: 0; }
  .table.stackable td { padding: 0; border: 0; }
  .table.stackable td[data-label]:not(.lead)::before { content: attr(data-label); display: block; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
  .table.stackable td.lead { grid-column: 1 / -1; }
  .table.stackable td.num, .table.stackable td.act { text-align: left; width: auto; }
  .table.stackable td.hide-m { display: none; }
}

/* ---------- avatar ---------- */
.avatar { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; font: 700 13px var(--display); color: var(--brand-ink); background: var(--brand-soft); }
.avatar-lg { width: 56px; height: 56px; border-radius: 16px; font-size: 18px; }

/* ---------- expiry meter ---------- */
.expiry { display: flex; flex-direction: column; gap: 6px; min-width: 130px; }
.expiry .meta { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.expiry .meta b { font-weight: 700; }
.meter { height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: inherit; background: var(--ok); }
.expiry.warn .meter i { background: #E59A0B; } .expiry.warn b { color: var(--warn); }
.expiry.danger .meter i { background: var(--danger); } .expiry.danger b { color: var(--danger); }
.expiry.muted .meter i { background: var(--ink-3); } .expiry.muted b { color: var(--ink-3); }
.expiry.ok b { color: var(--ok); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-weight: 700; font-size: 13.5px; }
.field .help { font-size: 12.5px; color: var(--ink-3); }
.input, .select, .textarea { width: 100%; min-height: 44px; padding: 10px 13px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 500 15px var(--font); transition: border-color .15s, box-shadow .15s; }
.textarea { min-height: 130px; resize: vertical; line-height: 1.55; }
.input:focus, .select:focus, .textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%237A86A3' stroke-width='2'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--brand); }
.input-icon { position: relative; }
.input-icon .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.input-icon .input { padding-left: 40px; }

/* ---------- toolbar / filters ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.toolbar .input-icon { flex: 1 1 240px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--muted-bg); overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.seg a { padding: 7px 12px; border-radius: 8px; font-weight: 700; font-size: 13px; color: var(--ink-2); white-space: nowrap; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.seg a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.seg a .n { font-size: 11.5px; padding: 0 6px; border-radius: 99px; background: var(--line); color: var(--ink-2); }
.seg a.on .n { background: var(--brand-soft); color: var(--brand-ink); }

/* ---------- page heading ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; }
.page-head .lede { color: var(--ink-2); margin-top: 4px; }
.crumbs { display: flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 600; color: var(--ink-3); margin-bottom: 8px; }
.crumbs a { color: var(--ink-2); }

/* ---------- definition list ---------- */
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; font-size: 14.5px; }
.dl dt { color: var(--ink-2); }
.dl dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }

/* ---------- alerts / flash ---------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-sm); font-weight: 600; font-size: 14px; }
.alert .ic { margin-top: 1px; }
.alert-ok { background: var(--ok-bg); color: var(--ok); }
.alert-error { background: var(--danger-bg); color: var(--danger); }
.alert-warn { background: var(--warn-bg); color: var(--warn); }
.alert-info { background: var(--info-bg); color: var(--info); }
.banner { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 16px 18px; border-radius: var(--r); border: 1px solid; }
.banner.warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 30%, transparent); color: var(--warn); }
.banner.danger { background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: var(--danger); }
.banner .txt { display: flex; gap: 12px; align-items: center; font-weight: 600; }
.demo-ribbon { background: repeating-linear-gradient(-45deg, #FFE7A3, #FFE7A3 10px, #FFEFC2 10px, #FFEFC2 20px); color: #5C3800; font-size: 12.5px; font-weight: 700; text-align: center; padding: 6px 12px; }

/* ---------- empty ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--ink-2); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .ic { color: var(--ink-3); }
.empty strong { color: var(--ink); font-size: 16px; }

/* ---------- list rows (dashboard) ---------- */
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-top: 1px solid var(--line-2); color: inherit; text-decoration: none !important; }
.list-row:first-child { border-top: 0; }
a.list-row:hover { background: var(--surface-2); }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .sub { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dayblock { width: 52px; flex: none; border-radius: 11px; text-align: center; padding: 6px 0; font-family: var(--display); }
.dayblock b { display: block; font-size: 18px; line-height: 1.1; }
.dayblock span { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-family: var(--font); }
.dayblock.ok { background: var(--ok-bg); color: var(--ok); }
.dayblock.warn { background: var(--warn-bg); color: var(--warn); }
.dayblock.danger { background: var(--danger-bg); color: var(--danger); }
.dayblock.muted { background: var(--muted-bg); color: var(--muted); }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { position: relative; padding: 0 0 18px 24px; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.timeline li::after { content: ""; position: absolute; left: 8px; top: 18px; bottom: 2px; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline .when { font-size: 12.5px; color: var(--ink-3); }

/* ---------- ticket thread ---------- */
.thread { display: flex; flex-direction: column; gap: 16px; }
.msg { display: flex; gap: 12px; max-width: 760px; }
.msg .bubble { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; padding: 14px 16px; }
.msg .bubble .who-line { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 6px; color: var(--ink-2); }
.msg .bubble .who-line b { color: var(--ink); }
.msg .bubble .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.staff { align-self: flex-end; flex-direction: row-reverse; }
.msg.staff .bubble { background: var(--brand-soft); border-color: transparent; border-radius: 14px 4px 14px 14px; }
.msg.staff .avatar { background: var(--navy); color: #fff; }

/* ---------- invoice paper ---------- */
.paper { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 32px; box-shadow: var(--shadow); }
.paper .top { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.paper .parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 24px; padding: 24px 0; }
.paper .totals { margin-left: auto; width: min(100%, 320px); display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; padding-top: 16px; }
.paper .totals .grand { font-family: var(--display); font-size: 20px; font-weight: 700; padding-top: 10px; border-top: 1px solid var(--line); }
@media (max-width: 600px) { .paper { padding: 20px; } }

/* ============================================================
   ADMIN SHELL
   ============================================================ */
.admin { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: var(--navy); color: #C9D6F2; display: flex; flex-direction: column; padding: 20px 14px; gap: 22px; overflow-y: auto; }
.side .brand { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px; }
.side .brand img { height: 26px; width: auto; display: block; }
.side .brand .chip { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--cyan); border: 1px solid var(--navy-line); padding: 3px 7px; border-radius: 6px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side .group { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #6F82AE; padding: 14px 12px 6px; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #C9D6F2; font-weight: 600; font-size: 14.5px; text-decoration: none; }
.side nav a:hover { background: var(--navy-2); color: #fff; }
.side nav a.on { background: linear-gradient(90deg, rgba(30,107,234,.28), rgba(30,107,234,.08)); color: #fff; box-shadow: inset 2px 0 0 var(--cyan); }
.side nav a .count { margin-left: auto; font-size: 11.5px; font-weight: 800; padding: 1px 7px; border-radius: 99px; background: #E04B57; color: #fff; }
.side nav a .count.soft { background: var(--navy-line); color: #C9D6F2; }
.side .me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: var(--navy-2); }
.side .me .avatar { background: var(--navy-line); color: #fff; }
.side .me .grow { flex: 1; min-width: 0; font-size: 13px; }
.side .me b { display: block; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side .me a { color: #9FB2DA; }
.side .close { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.topbar .burger { display: none; }
.topbar form { flex: 1; max-width: 480px; }
.topbar .spacer { flex: 1; }
.content { padding: 28px; display: flex; flex-direction: column; gap: 24px; width: 100%; max-width: 1360px; }

@media (max-width: 980px) {
  .admin { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: min(86vw, 300px); z-index: 50; transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .side.open { transform: none; }
  .side .close { display: inline-flex; background: none; border: 0; color: #C9D6F2; cursor: pointer; padding: 6px; }
  .scrim { position: fixed; inset: 0; background: rgba(5, 12, 30, .5); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .scrim.open { opacity: 1; pointer-events: auto; }
  .topbar { padding: 10px 16px; }
  .topbar .burger { display: inline-flex; }
  .topbar .logo-m { display: block; height: 22px; }
  .content { padding: 20px 16px 32px; }
}
@media (min-width: 981px) { .topbar .logo-m { display: none; } .scrim { display: none; } }
@media (max-width: 600px) { .topbar form { display: none; } .topbar .spacer { display: block; } }

/* ============================================================
   CLIENT SHELL
   ============================================================ */
.cl-top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.cl-top .in { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 24px; padding: 12px 24px; }
.cl-top .logo img { height: 28px; display: block; }
.cl-nav { display: flex; gap: 4px; flex: 1; }
.cl-nav a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 700; font-size: 14px; text-decoration: none; }
.cl-nav a:hover { color: var(--ink); background: var(--surface-2); }
.cl-nav a.on { color: var(--brand-ink); background: var(--brand-soft); }
.cl-user { display: flex; align-items: center; gap: 10px; }
.cl-user .name { font-weight: 700; font-size: 14px; }
.cl-content { max-width: 1200px; margin: 0 auto; padding: 32px 24px 64px; display: flex; flex-direction: column; gap: 24px; }
.tabbar { display: none; }
@media (max-width: 860px) {
  .cl-nav { display: none; }
  .cl-top .in { padding: 10px 16px; justify-content: space-between; }
  .cl-user .name { display: none; }
  .cl-content { padding: 20px 16px calc(96px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 24px -16px rgba(14, 26, 54, .25); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; font-size: 11px; font-weight: 700; color: var(--ink-3); text-decoration: none; }
  .tabbar a.on { color: var(--brand-ink); }
}

.hello { position: relative; overflow: hidden; border-radius: 18px; padding: 28px; color: #fff; background: radial-gradient(120% 140% at 100% 0%, #2A66E0 0%, #0B1F4D 55%); box-shadow: var(--shadow-lg); }
.hello::after { content: ""; position: absolute; right: -60px; bottom: -80px; width: 260px; height: 260px; border-radius: 50%; border: 40px solid rgba(127, 216, 247, .12); }
.hello h1 { font-size: 26px; }
.hello p { color: #C9D6F2; margin-top: 6px; max-width: 560px; }
.hello .row { margin-top: 18px; position: relative; z-index: 1; }

.svc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.svc { display: flex; flex-direction: column; gap: 14px; padding: 18px; color: inherit; text-decoration: none !important; transition: border-color .15s, box-shadow .15s, transform .15s; }
.svc:hover { border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-1px); }
.svc .top { display: flex; align-items: flex-start; gap: 12px; }
.svc .kind { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); flex: none; }
.svc .kind.domain { background: #E9F8FD; color: #0E7490; }
.svc .grow { flex: 1; min-width: 0; }
.svc .name { font-weight: 800; font-family: var(--display); font-size: 16px; overflow-wrap: anywhere; }
.svc .sub { font-size: 13px; color: var(--ink-2); }

/* ============================================================
   AUTH + SITE
   ============================================================ */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth .art { position: relative; overflow: hidden; background: radial-gradient(110% 90% at 0% 0%, #1E4DB0 0%, #0B1F4D 52%, #071433 100%); color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.auth .art::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(80% 70% at 30% 40%, #000 30%, transparent 75%); }
.auth .art > * { position: relative; }
.auth .art img { height: 32px; width: auto; }
.auth .art h1 { font-size: clamp(28px, 3.2vw, 42px); max-width: 520px; }
.auth .art ul { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; color: #C9D6F2; }
.auth .art li { display: flex; gap: 10px; align-items: center; }
.auth .art li .ic { color: var(--cyan); }
.auth .mock { margin-top: 28px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: 16px; padding: 16px; max-width: 420px; backdrop-filter: blur(6px); display: flex; flex-direction: column; gap: 10px; }
.auth .mock .r { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; }
.auth .mock .r span:first-child { font-weight: 700; color: #fff; }
.auth .mock .d { font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 99px; }
.auth .form-side { display: flex; align-items: center; justify-content: center; padding: 48px 20px; }
.auth .box { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 22px; }
.auth .box h2 { font-size: 26px; }
.auth .switch { text-align: center; color: var(--ink-2); font-size: 14px; }
.auth.admin-auth .art { background: radial-gradient(110% 90% at 100% 0%, #18306A 0%, #0B1F4D 45%, #050D22 100%); }
@media (max-width: 900px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth .art { padding: 22px 20px 28px; gap: 16px; }
  .auth .art h1 { font-size: 24px; }
  .auth .art ul, .auth .mock { display: none; }
  .auth .form-side { padding: 28px 16px 48px; align-items: flex-start; }
}

.site-top { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-top .in { max-width: 1200px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.site-top img { height: 30px; display: block; }
.hero { background: radial-gradient(90% 120% at 85% 0%, #2257C9 0%, #0B1F4D 50%, #071433 100%); color: #fff; padding: 72px 24px 80px; }
.hero .in { max-width: 860px; margin: 0 auto; text-align: center; display: flex; flex-direction: column; gap: 18px; align-items: center; }
.hero .eyebrow { font-size: 12.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--cyan); }
.hero h1 { font-size: clamp(30px, 5vw, 52px); }
.hero p { color: #C9D6F2; font-size: 17px; max-width: 620px; }
.searchbox { width: 100%; max-width: 640px; display: flex; gap: 8px; background: #fff; border-radius: 16px; padding: 8px; box-shadow: var(--shadow-lg); }
.searchbox input { flex: 1; min-width: 0; border: 0; font: 600 17px var(--font); padding: 0 14px; color: #0E1A36; background: transparent; }
.searchbox input:focus { outline: 0; }
@media (max-width: 560px) { .searchbox { flex-direction: column; } .searchbox input { min-height: 48px; } .hero { padding: 48px 16px 56px; } }
.tlds { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.tlds span { padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); font-size: 14px; }
.section { max-width: 1200px; margin: 0 auto; padding: 56px 24px; }
@media (max-width: 560px) { .section { padding: 40px 16px; } }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 20px; margin-top: 28px; }
.plan { padding: 26px; display: flex; flex-direction: column; gap: 16px; }
.plan.featured { border: 2px solid var(--brand); box-shadow: var(--shadow); }
.plan .price { font-family: var(--display); font-size: 34px; font-weight: 700; }
.plan .price small { font-size: 15px; color: var(--ink-2); font-family: var(--font); font-weight: 600; }
.plan ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.plan li { display: flex; gap: 10px; align-items: center; }
.plan li .ic { color: var(--brand); }
.site-foot { background: var(--navy); color: #9FB2DA; padding: 32px 24px; font-size: 14px; }
.site-foot .in { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
.site-foot img { height: 24px; }

.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 32px)); }
.toast-stack .alert { box-shadow: var(--shadow-lg); animation: toast-in .25s ease; }
@media (max-width: 860px) { .toast-stack { left: 16px; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); max-width: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

dialog.modal { border: 0; padding: 0; border-radius: 18px; width: min(480px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
dialog.modal::backdrop { background: rgba(5, 12, 30, .5); }
dialog.modal form { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
dialog.modal h3 { font-size: 19px; }

@media print {
  .side, .topbar, .cl-top, .tabbar, .no-print, .demo-ribbon { display: none !important; }
  .admin { display: block; } .content, .cl-content { padding: 0; }
  .paper { box-shadow: none; border: 0; }
}

/* expiry calendar */
.cal { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; align-items: end; }
.cal-m { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; min-width: 0; }
.cal-m b { font-family: var(--display); font-size: 14px; }
.cal-m span { color: var(--ink-3); font-weight: 700; }
.cal-bar { width: 100%; max-width: 34px; height: 110px; border-radius: 8px; background: var(--line-2); display: flex; align-items: flex-end; overflow: hidden; }
.cal-bar i { display: block; width: 100%; background: linear-gradient(180deg, var(--brand), #5A95F5); border-radius: 8px 8px 0 0; }
.cal-m:first-child .cal-bar i { background: linear-gradient(180deg, #E59A0B, #F2C46D); }
@media (max-width: 560px) { .cal { grid-template-columns: repeat(6, minmax(0, 1fr)); row-gap: 16px; } .cal-bar { height: 70px; } }
@media (max-width: 760px) { .hide-m { display: none !important; } }
.list-row .title, .list-row .sub { display: block; }
.list-row > .stack-sm { flex: none; }
@media (min-width: 981px) { .admin { background: linear-gradient(90deg, var(--navy) 252px, var(--bg) 252px); } }
@media (max-width: 560px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stat { padding: 14px; }
  .stat .value { font-size: 22px; }
  .stat .label { font-size: 12.5px; align-items: flex-start; flex-direction: column; gap: 8px; }
  .page-head h1 { font-size: 23px; }
}
@media (max-width: 560px) { .stats > :last-child:nth-child(odd) { grid-column: 1 / -1; } }
