/* DomainLink dashboard styles — matches the client's design (light surface, deep green accents). */

:root {
  --bg: #f5f6f3;
  --surface: #ffffff;
  --surface-2: #f9faf8;
  --border: #e6e8e3;
  --border-strong: #d6d9d3;
  --text: #16201b;
  --text-2: #3d4842;
  --muted: #727c76;
  --primary: #2c6a55;
  --primary-hover: #245946;
  --primary-soft: #e8f1ed;
  --hero: #1b3a30;
  --hero-2: #234a3d;
  --ok: #1f7a4f;
  --ok-bg: #e6f4ec;
  --warn: #9a6a13;
  --warn-bg: #fff6e6;
  --warn-border: #f1d9a6;
  --bad: #b2362b;
  --bad-bg: #fdecea;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(22, 32, 27, .04), 0 2px 8px rgba(22, 32, 27, .04);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sidebar-w: 264px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 30px; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; }
h1.mono { font-size: 26px; letter-spacing: -.01em; }
h3 { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
h4 { font-size: 13px; font-weight: 600; margin: 20px 0 10px; color: var(--text-2); }
p { margin: 0 0 10px; }
code { font-family: var(--mono); font-size: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; }
.icon { width: 18px; height: 18px; flex-shrink: 0; vertical-align: middle; }
.flip { transform: rotate(180deg); }
.mono { font-family: var(--mono); font-size: .93em; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.strong { font-weight: 600; color: var(--text); }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.text-ok { color: var(--ok) !important; }
.text-warn { color: var(--warn) !important; }
.text-bad { color: var(--bad) !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

/* ------------------------------------------------------------ shell */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border);
  padding: 24px 16px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { font-size: 25px; font-weight: 700; color: var(--text); letter-spacing: -.03em; padding: 2px 10px 16px; }
.brand:hover { text-decoration: none; }
.brand span, .guest-brand span { color: var(--primary); }
.ws-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; background: var(--surface-2); margin-bottom: 14px; }
.ws-label, .nav-label, .eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.ws-switch { position: relative; margin: 6px 0 2px; }
.ws-switch select { width: 100%; appearance: none; border: 0; background: transparent; font: 600 15px var(--font); color: var(--text); padding: 2px 24px 2px 0; cursor: pointer; }
.ws-switch select:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.ws-chevron { position: absolute; right: 0; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--muted); width: 16px; }
.ws-name { font-weight: 600; font-size: 15px; margin: 6px 0 2px; }
.ws-sub { font-size: 12.5px; color: var(--muted); }
.nav-label { padding: 4px 10px 6px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: var(--text-2); font-weight: 500; }
.nav a .icon { color: var(--muted); }
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav a.active .icon { color: var(--primary); }
.validity-card { margin-top: auto; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; background: var(--surface-2); }
.validity-card.is-locked { background: var(--warn-bg); border-color: var(--warn-border); }
.validity-title { font-weight: 700; }
.validity-sub { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.validity-link { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 500; color: var(--text-2); }
.validity-link .icon { width: 15px; }
.sidebar-backdrop { display: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 66px; display: flex; align-items: center; gap: 14px; padding: 0 32px; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 20; }
.crumbs { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--muted); }
.crumbs .icon { color: var(--muted); }
.crumb-sep { width: 15px; }
.crumb-ws { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb-page { color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.role-pill { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); font-weight: 500; padding-right: 16px; border-right: 1px solid var(--border); }
.role-pill .icon { width: 16px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface-2); font: 600 12px var(--font); color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.avatar-sm { width: 32px; height: 32px; font-size: 11px; cursor: default; }
.user-menu { position: relative; }
.menu { position: absolute; right: 0; top: 46px; width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.12); padding: 6px; z-index: 50; }
.menu-head { padding: 10px 10px 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; display: flex; flex-direction: column; }
.menu-head span { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.menu a, .menu button { display: flex; width: 100%; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 8px; color: var(--text-2); border: 0; background: none; font: inherit; cursor: pointer; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--surface-2); text-decoration: none; }
.content { padding: 32px; max-width: 1360px; width: 100%; }

/* ------------------------------------------------------------ page parts */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head .eyebrow { margin-bottom: 10px; }
.page-head p { margin: 8px 0 0; max-width: 680px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.back-link .icon { width: 15px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 20px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h3 { margin: 0; }
.card-head-sub { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.card-narrow { max-width: 760px; }
.card-danger { border-color: #f1cdc9; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.grid-2 > .card { margin-bottom: 0; }
.grid-2 + .card, .grid-2 + .grid-2 { margin-top: 20px; }
.grid-form { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.grid-form > .card:only-child, .grid-form > form:only-child { grid-column: 1 / -1; max-width: 820px; }
.side > .card:last-child { margin-bottom: 0; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.stat-top { display: flex; justify-content: space-between; align-items: flex-start; color: var(--text-2); font-weight: 500; }
.stat-top .icon { width: 34px; height: 34px; padding: 8px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); color: var(--primary); }
.stat-num { font-size: 34px; font-weight: 600; letter-spacing: -.02em; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.stat-num-sm { font-size: 22px; margin: 14px 0 6px; }
.stat-sub { color: var(--muted); font-size: 13px; }
.stats-compact .stat { padding: 16px 20px; }
.stats-compact .stat-num { font-size: 26px; margin-bottom: 0; }

.hero { background: radial-gradient(120% 140% at 100% 0%, var(--hero-2) 0%, var(--hero) 55%); color: #eaf3ef; border-radius: 18px; padding: 44px 48px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 36px; align-items: center; margin-bottom: 22px; overflow: hidden; }
.eyebrow-light { color: #a9c6ba; }
.hero h2 { font-size: 34px; font-weight: 500; letter-spacing: -.03em; line-height: 1.15; margin: 16px 0 16px; color: #fff; }
.hero p { color: #bcd3ca; max-width: 520px; line-height: 1.7; }
.hero-link { color: #fff; display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; font-weight: 500; }
.hero-link .icon { width: 16px; }
.hero-roles { display: flex; flex-direction: column; gap: 12px; }
.role-card { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04); border-radius: 12px; }
.role-card:nth-child(2) { margin-left: 28px; }
.role-card:nth-child(3) { margin-left: 56px; }
.role-card div { flex: 1; display: flex; flex-direction: column; }
.role-card strong { color: #fff; font-weight: 600; }
.role-card small { color: #a9c6ba; font-size: 12.5px; }
.role-card em { font-style: normal; color: #a9c6ba; font-size: 12px; font-family: var(--mono); }
.role-ic { width: 40px; height: 40px; border-radius: 10px; background: rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center; color: #d8e8e1; }

.setup-list { display: flex; flex-direction: column; gap: 8px; border-color: var(--warn-border); background: var(--warn-bg); }
.setup-list a { display: flex; align-items: center; gap: 10px; color: var(--text-2); }
.setup-list a .icon:last-child { width: 15px; }

/* ------------------------------------------------------------ banners & flashes */
.banner { display: flex; align-items: center; gap: 16px; padding: 20px 24px; border-radius: var(--radius); margin-bottom: 24px; }
.banner > .icon { width: 22px; height: 22px; }
.banner div { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.banner-warn { background: var(--warn-bg); border: 1px solid var(--warn-border); color: var(--warn); }
.banner-warn strong { font-weight: 600; }
.banner-warn span { color: #a47a33; }
.flash { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; border: 1px solid; }
.flash span { flex: 1; word-break: break-word; }
.flash-success { background: var(--ok-bg); border-color: #bfe3cf; color: #165c3b; }
.flash-error { background: var(--bad-bg); border-color: #f3c5c0; color: #8f2a21; }
.flash-info { background: #eef3f8; border-color: #cfdceb; color: #29486b; }
.flash-close { background: none; border: 0; color: inherit; cursor: pointer; padding: 0; opacity: .6; }
.flash-close .icon { width: 16px; }
.notice { background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: 10px; padding: 12px 14px; color: var(--text-2); display: flex; gap: 8px; align-items: center; }

/* ------------------------------------------------------------ buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 10px; border: 1px solid transparent; font: 500 14px var(--font); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s; text-decoration: none !important; line-height: 1.2; }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-light { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-light:hover { background: var(--surface-2); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger:hover { background: #962c23; }
.btn-danger-light { background: var(--surface); color: var(--bad); border-color: #f1cdc9; }
.btn-danger-light:hover { background: var(--bad-bg); }
.btn-sm { padding: 7px 11px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-loading { opacity: .65; pointer-events: none; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.icon-btn .icon { width: 16px; }
.menu-btn { display: none; }
.icon-btn-danger:hover { color: var(--bad); background: var(--bad-bg); border-color: #f3c5c0; }
.link { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; font-weight: 500; }
.link .icon { width: 15px; }
.link-danger { color: var(--bad); margin-top: 10px; }

/* ------------------------------------------------------------ badges & tags */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-muted { background: #eef0ed; color: var(--muted); }
.tag { display: inline-block; padding: 2px 7px; border-radius: 6px; font-size: 11.5px; font-weight: 600; background: #eef0ed; color: var(--text-2); font-family: var(--mono); }
.tag-admin { background: #e5eefb; color: #2a5291; }
.tag-agent { background: var(--primary-soft); color: var(--primary); }
.tag-warn { background: var(--warn-bg); color: var(--warn); }

/* ------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table th:first-child, .table td:first-child { padding-left: 0; }
.table th:last-child, .table td:last-child { padding-right: 0; }
.cell-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.actions { white-space: nowrap; text-align: right; }
.actions form { display: inline; }
.actions-col { width: 1%; }
.person { display: flex; align-items: center; gap: 10px; }
.table-log td { vertical-align: top; }
.log-details summary { cursor: pointer; color: var(--muted); font-size: 12px; margin-top: 4px; }
.log-details pre { background: var(--surface-2); border: 1px solid var(--border); padding: 10px; border-radius: 8px; font-size: 12px; overflow-x: auto; max-width: 640px; margin: 6px 0 0; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.search { position: relative; flex: 1 1 260px; display: flex; align-items: center; }
.search .icon { position: absolute; left: 12px; color: var(--muted); width: 16px; }
.search input { padding-left: 36px; }
.date-field { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.date-field input { width: auto; }
.toolbar { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 0 14px; border-top: 1px solid var(--border); }
.toolbar-left, .toolbar-right { display: flex; gap: 8px; flex-wrap: wrap; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 14px; flex-wrap: wrap; }
.pager-links { display: flex; gap: 8px; }
.empty { color: var(--muted); padding: 18px 0; }
.empty-lg { text-align: center; padding: 48px 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-icon { width: 40px; height: 40px; color: var(--border-strong); }

/* ------------------------------------------------------------ forms */
input, select, textarea { width: 100%; font: 14px var(--font); color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; padding: 10px 12px; min-height: 42px; }
select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23727c76' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.filters select { width: auto; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(44, 106, 85, .15); }
input[readonly] { background: var(--surface-2); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.form fieldset { display: flex; flex-direction: column; gap: 16px; }
fieldset[disabled] input, fieldset[disabled] select { background: var(--surface-2); color: var(--muted); }
.form { display: flex; flex-direction: column; gap: 16px; }
.form-tight { gap: 12px; margin-top: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-weight: 500; color: var(--text-2); font-size: 13.5px; }
.field > span em, .field > span small { font-style: normal; color: var(--muted); font-weight: 400; }
.field small { color: var(--muted); font-size: 12.5px; }
.field-error { color: var(--bad); font-size: 12.5px; font-weight: 500; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-row .field-sm { max-width: 140px; }
.form-inline { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 10px; }
.form-inline .field { flex: 1 1 180px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 4px; }
.input-group { display: flex; gap: 8px; }
.input-group input { flex: 1; min-width: 0; }
.check { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; cursor: pointer; }
.check input { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--primary); }
.check small { grid-column: 2; color: var(--muted); font-size: 12.5px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.check-grid .check { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.check-grid .check:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.inline-edit { display: flex; gap: 8px; align-items: center; }
.inline-edit input, .inline-edit select { min-height: 36px; padding: 7px 10px; }
.inline-edit select { padding-right: 30px; max-width: 220px; }
.seg { display: flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.seg label { flex: 1; text-align: center; padding: 7px; border-radius: 8px; cursor: pointer; font-weight: 500; color: var(--muted); font-size: 13px; }
.seg input { display: none; }
.seg label:has(input:checked) { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.copy-box { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }

/* ------------------------------------------------------------ details */
.dl { display: grid; grid-template-columns: 120px 1fr; gap: 10px 12px; margin: 0 0 16px; }
.dl dt { color: var(--muted); font-size: 13px; }
.dl dd { margin: 0; word-break: break-word; }
.side-actions { display: flex; flex-direction: column; gap: 8px; }
.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.feed li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.feed li:last-child { border-bottom: 0; }
.feed-text { color: var(--text); word-break: break-word; }
.feed-meta { color: var(--muted); font-size: 12.5px; }
.feed-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); margin-top: 7px; flex-shrink: 0; display: inline-block; }
td .feed-dot { margin: 0 8px 1px 0; vertical-align: middle; }
.feed-binding { background: var(--primary); }
.feed-billing { background: #c48a1d; }
.feed-agent, .feed-team { background: #3c6cb4; }
.feed-ip { background: #7a5bc0; }
.feed-settings, .feed-system { background: #727c76; }
.ip-list { list-style: none; margin: 0 0 4px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ip-list li { display: flex; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); flex-wrap: wrap; }
.people { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.people li div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.people small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }

/* billing */
.validity-big { display: flex; align-items: center; gap: 18px; margin-bottom: 16px; }
.validity-big div:last-child { display: flex; flex-direction: column; }
.validity-num { font-size: 54px; font-weight: 700; letter-spacing: -.04em; line-height: 1; color: var(--primary); font-variant-numeric: tabular-nums; }
.validity.is-due .validity-num { color: var(--warn); }
.validity.is-locked .validity-num { color: var(--bad); }
.progress { height: 8px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; margin-bottom: 16px; }
.progress span { display: block; height: 100%; background: var(--primary); }
.validity.is-due .progress span { background: #d39a2d; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; color: var(--text-2); }
.checks li { display: flex; gap: 8px; align-items: flex-start; }
.checks .icon { width: 16px; margin-top: 2px; color: var(--primary); }
.pay-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 12px; }
.pay-option { border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.pay-option > div:first-of-type { display: flex; flex-direction: column; gap: 3px; }
.pay-price { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.pay-price small { font-size: 13px; color: var(--muted); font-weight: 500; }
.autorenew-form { margin-top: 10px; }

/* steps (guide) */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 22px; }
.steps li { display: flex; gap: 16px; }
.steps strong { display: block; margin-bottom: 4px; }
.steps p { color: var(--muted); margin: 0 0 6px; line-height: 1.6; }
.step-n { width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%; border: 1px solid #cfe2da; color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; background: #f3f8f6; }
.steps-compact { gap: 16px; }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(15, 25, 20, .45); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-box { background: #fdfefc; border-radius: 18px; width: 100%; max-width: 620px; max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: 0 24px 60px rgba(0,0,0,.25); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 26px 28px 18px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 21px; font-weight: 700; margin-bottom: 6px; }
.modal-head p { margin: 0; font-size: 13px; }
.modal-close { border: 2px solid #8fc3b0; width: 38px; height: 38px; border-radius: 10px; }
.modal-body { padding: 22px 28px 28px; }
.guide-visual { background: var(--hero); color: #e4efea; border-radius: 12px; padding: 26px 18px; display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; text-align: center; }
.guide-visual .icon { width: 26px; height: 26px; color: #d8e8e1; }
.guide-visual .icon:nth-of-type(2) { width: 20px; }
.guide-visual span { font-size: 13px; word-break: break-all; }

/* guest pages */
.guest { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 24px 16px; }
.guest-wrap { width: 100%; max-width: 420px; }
.guest-brand { font-size: 30px; font-weight: 700; letter-spacing: -.03em; text-align: center; margin-bottom: 22px; }
.login-card h1 { font-size: 24px; margin-bottom: 6px; }
.login-card .form { margin-top: 18px; }
.error-card { text-align: center; padding: 48px 28px; max-width: 520px; margin: 40px auto; }
.error-code { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: .1em; margin-bottom: 8px; }
.error-card h1 { font-size: 26px; margin-bottom: 10px; }
.error-card .btn { margin-top: 12px; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: minmax(0, 1fr); padding: 32px; }
  .grid-form { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 60; transform: translateX(-100%); transition: transform .2s ease; }
  body.sidebar-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.15); }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 55; }
  .menu-btn { display: inline-flex; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .grid-2 > .card { margin-bottom: 0; }
}
@media (max-width: 640px) {
  .topbar { padding: 0 16px; height: 58px; gap: 8px; }
  .role-pill { display: none; }
  .crumb-ws, .crumb-sep, .crumbs > .icon:first-child { display: none; }
  .main { width: 100%; }
  .content { padding: 20px 16px; }
  h1 { font-size: 24px; }
  .card { padding: 18px 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .stats, .stats-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 14px; }
  .stat-num { font-size: 26px; }
  .stat-top .icon { width: 28px; height: 28px; padding: 6px; }
  .hero { padding: 24px 20px; }
  .hero h2 { font-size: 26px; }
  .role-card:nth-child(2), .role-card:nth-child(3) { margin-left: 0; }
  .field-row, .field-row-3 { grid-template-columns: 1fr; }
  .field-row .field-sm { max-width: none; }
  .filters select, .date-field { flex: 1 1 calc(50% - 5px); }
  .date-field input { flex: 1; }
  .banner { flex-direction: column; align-items: flex-start; }
  .inline-edit { flex-wrap: wrap; }
  .inline-edit select { max-width: none; }
  .page-head .head-actions, .page-head > .btn { width: 100%; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 8px; }
  .modal-head, .modal-body { padding-left: 18px; padding-right: 18px; }
}
