/* Zuri Platform Admin. Same tokens and components as the tenant ERP (frontend/wwwroot/css/site.css),
   so both apps read as one product; the admin portal adds a gold "Platform" accent in the sidebar. */

:root {
    --green-950: #03231a;
    --green-900: #042c18;
    --green-800: #063a21;
    --green-700: #0b4d2e;
    --green-600: #13653d;
    --green-500: #1f7f4f;
    --green-100: #e3efe6;
    --green-50: #f1f7f2;
    --gold-600: #a77a30;
    --gold-500: #c5964a;
    --gold-300: #e2c48c;
    --gold-100: #f7eedb;

    --canvas: #f6f5f0;
    --surface: #ffffff;
    --surface-2: #faf9f5;
    --ink: #17231c;
    --ink-2: #3c4a42;
    --muted: #6c776f;
    --subtle: #98a199;
    --line: #e8e6de;
    --line-soft: #f0eee8;

    --sky: #3d7aa8;
    --sky-bg: #e8f1f8;
    --rose: #b9444f;
    --rose-bg: #fbecec;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgb(23 35 28 / 4%);
    --shadow: 0 1px 2px rgb(23 35 28 / 4%), 0 4px 16px rgb(23 35 28 / 4%);
    --shadow-lg: 0 24px 64px rgb(3 35 26 / 22%);
    --ring: 0 0 0 3px rgb(197 150 74 / 35%);
    --input-border: #5c9e78;
    --input-ring: rgb(19 101 61 / 14%);

    --font-display: 'Outfit', system-ui, sans-serif;
    --font-body: 'DM Sans', system-ui, sans-serif;
    --sidebar-w: 256px;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; }
body {
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font: 400 14px/1.5 var(--font-body);
    -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--green-600); }
h1, h2, h3 { font-family: var(--font-display); color: var(--ink); }
:focus-visible { outline: none; box-shadow: var(--ring); }
code { padding: 1px 6px; border-radius: 5px; background: rgb(6 58 33 / 8%); font-size: .9em; }

.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--green-800); color: #fff; text-decoration: none; }
.skip-link:focus { top: 12px; }
.muted { color: var(--muted); }
.subtle { color: var(--subtle); }
.nowrap { white-space: nowrap; }

/* ---------- Shell ---------- */

.main-shell { min-width: 0; min-height: 100vh; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    padding: 20px 14px 14px;
    color: #fff;
    background:
        radial-gradient(120% 60% at 0% 0%, rgb(197 150 74 / 14%), transparent 60%),
        linear-gradient(180deg, var(--green-900) 0%, var(--green-950) 100%);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgb(255 255 255 / 15%) transparent;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; margin-bottom: 6px; border-bottom: 1px solid rgb(255 255 255 / 8%); color: #fff; text-decoration: none; }
.brand-emblem { width: 48px; height: 48px; flex: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { display: flex; align-items: center; gap: 7px; font: 600 19px/1.1 var(--font-display); letter-spacing: -.3px; color: #f7f3e8; }
.brand-chip { padding: 2px 6px 1px; border-radius: 5px; background: var(--gold-500); color: var(--green-900); font: 700 10px/1.3 var(--font-display); letter-spacing: .6px; }
.brand small { margin-top: 4px; color: rgb(226 196 140 / 75%); font-size: 10px; font-weight: 600; letter-spacing: 1.6px; text-transform: uppercase; }

.side-nav { display: flex; flex-direction: column; gap: 2px; padding-bottom: 24px; }
.nav-section { padding: 20px 12px 8px; color: rgb(255 255 255 / 55%); font-size: 10.5px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; }
.nav-link {
    position: relative;
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color .15s;
}
.nav-link .icon { opacity: .85; }
.nav-link:hover { background: rgb(255 255 255 / 6%); }
.nav-link.active { background: linear-gradient(90deg, rgb(197 150 74 / 22%), rgb(197 150 74 / 6%)); font-weight: 600; }
.nav-link.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold-500); }
.nav-link.active .icon { color: var(--gold-300); opacity: 1; }
.nav-count { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: rgb(197 150 74 / 25%); color: var(--gold-300); font-size: 11.5px; font-weight: 700; text-align: center; }

.side-card { margin-top: auto; padding: 14px; border: 1px solid rgb(255 255 255 / 9%); border-radius: var(--radius); background: rgb(255 255 255 / 4%); }
.side-card strong { display: block; font-size: 13px; }
.side-card p { margin: 4px 0 10px; color: rgb(255 255 255 / 72%); font-size: 12.5px; }
.side-card a { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border: 1px solid rgb(255 255 255 / 14%); border-radius: var(--radius-sm); color: #f7f3e8; font-size: 12.5px; font-weight: 500; text-decoration: none; }
.side-card a:hover { background: rgb(255 255 255 / 7%); border-color: rgb(226 196 140 / 40%); }
.side-card a .icon { width: 15px; height: 15px; }

.sidebar-profile { display: flex; align-items: center; gap: 4px; margin-top: 14px; padding-top: 10px; border-top: 1px solid rgb(255 255 255 / 8%); }
.profile-link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 6px; border-radius: var(--radius-sm); color: inherit; text-decoration: none; }
.profile-link:hover, .profile-link.active { background: rgb(255 255 255 / 6%); }
.profile-text { min-width: 0; }
.profile-text strong, .profile-text small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-text strong { font-size: 13.5px; font-weight: 600; }
.profile-text small { color: rgb(255 255 255 / 68%); font-size: 12px; }
.sidebar-profile .icon-button { color: rgb(223 233 226 / 60%); }
.sidebar-profile .icon-button:hover { background: rgb(240 138 148 / 16%); color: #ffd5d9; }
.sidebar-backdrop { position: fixed; inset: 0; z-index: 25; background: rgb(3 35 26 / 45%); backdrop-filter: blur(2px); }

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 32px;
    border-bottom: 1px solid var(--line);
    background: rgb(255 255 255 / 85%);
    backdrop-filter: saturate(180%) blur(10px);
}
.breadcrumb { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted); font-size: 13px; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb .icon { width: 14px; height: 14px; color: var(--subtle); }
.breadcrumb strong { overflow: hidden; color: var(--ink); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.env-chip { padding: 3px 9px; border: 1px solid #ecdcb9; border-radius: 999px; background: #fcf7ec; color: #8a6424; font-size: 11.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; }
.icon-button.mobile-menu { display: none; margin-left: -8px; }

.icon-button { position: relative; width: 38px; height: 38px; display: inline-grid; place-items: center; flex: none; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--muted); }
.icon-button:hover { background: var(--line-soft); color: var(--ink); }

.avatar { width: 36px; height: 36px; display: inline-grid; place-items: center; flex: none; border-radius: 50%; background: var(--green-100); color: var(--green-700); font: 600 12.5px var(--font-display); letter-spacing: .3px; }
.avatar-gold { background: linear-gradient(145deg, var(--gold-300), var(--gold-500)); color: var(--green-900); }
.avatar-sm { width: 30px; height: 30px; font-size: 11px; }

.main-content { width: 100%; min-width: 0; max-width: 1400px; flex: 1; margin: 0 auto; padding: 32px 32px 40px; }
.app-footer { display: flex; justify-content: space-between; gap: 12px; padding: 18px 32px; border-top: 1px solid var(--line); color: var(--subtle); font-size: 12.5px; }

/* ---------- Page heading ---------- */

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.eyebrow { margin-bottom: 6px; color: var(--gold-600); font-size: 12px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; }
.page-heading h1 { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0; font-size: 30px; font-weight: 600; letter-spacing: -.6px; line-height: 1.15; }
.page-heading p { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; }
.heading-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 10px; color: var(--muted); font-size: 13px; font-weight: 500; text-decoration: none; }
.back-link:hover { color: var(--ink); }
.back-link .icon { width: 15px; height: 15px; }

/* ---------- Buttons ---------- */

.button {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .15s, border-color .15s;
}
.button:active { transform: translateY(1px); }
.button .icon { width: 17px; height: 17px; }
.button.is-loading { cursor: progress; opacity: .85; pointer-events: none; }
.button .spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .button .spinner { animation-duration: 1.6s; } }
.button-primary { background: var(--green-800); color: #fff; box-shadow: 0 1px 2px rgb(6 58 33 / 20%), inset 0 1px 0 rgb(255 255 255 / 8%); }
.button-primary:hover { background: var(--green-700); }
.button-secondary { border-color: var(--line); background: #fff; color: var(--ink-2); box-shadow: var(--shadow-sm); }
.button-secondary:hover { border-color: #d8d5ca; background: var(--surface-2); }
.button-danger { border-color: #ecc9cc; background: #fff; color: var(--rose); }
.button-danger:hover { background: var(--rose-bg); }
.button-danger-solid { background: var(--rose); color: #fff; }
.button-danger-solid:hover { background: #a23a44; }
.button-sm { min-height: 32px; padding: 0 12px; border-radius: var(--radius-sm); font-size: 12.5px; }
.button-sm .icon { width: 15px; height: 15px; }
.button-block { width: 100%; }
.text-link { display: inline-flex; align-items: center; gap: 2px; color: var(--green-600); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.text-link::after { content: "→"; transition: transform .15s; }
.text-link:hover { color: var(--green-800); }
.text-link:hover::after { transform: translateX(2px); }
.link-button { padding: 0; border: 0; background: none; color: var(--green-600); font-size: 12.5px; font-weight: 600; }
.link-button:hover { color: var(--green-800); text-decoration: underline; }

/* ---------- Notices and toasts ---------- */

.notice { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 20px; padding: 12px 14px; border: 1px solid #ecdcb9; border-radius: var(--radius); background: #fcf7ec; color: #6b5222; font-size: 13.5px; }
.notice .icon { margin-top: 1px; color: var(--gold-600); }
.notice > div { min-width: 0; flex: 1; }
.notice strong { display: block; color: #4f3c18; }
.notice-success { border-color: #c9e0cf; background: var(--green-50); color: var(--green-700); }
.notice-success .icon { color: var(--green-600); }
.notice-success strong { color: var(--green-800); }
.notice-danger { border-color: #ecc9cc; background: var(--rose-bg); color: #8c2f39; }
.notice-danger .icon { color: var(--rose); }

.copy-field { display: flex; gap: 8px; margin-top: 10px; }
.copy-field input { min-width: 0; flex: 1; height: 38px; padding: 0 12px; border: 1px solid #c9e0cf; border-radius: var(--radius-sm); background: #fff; color: var(--ink); font: 500 12.5px ui-monospace, Consolas, monospace; }

.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: min(440px, calc(100vw - 32px));
    padding: 12px 16px;
    border-radius: var(--radius);
    background: var(--green-900);
    color: #fff;
    box-shadow: var(--shadow-lg);
    font-size: 13.5px;
    animation: toast-in .25s ease-out;
}
.toast .icon { color: var(--gold-300); }
.toast-error { background: #7a2a33; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Badges ---------- */

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--b-bg); color: var(--b-ink); font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge-success { --b-bg: var(--green-100); --b-ink: var(--green-600); }
.badge-info    { --b-bg: var(--sky-bg);    --b-ink: #2f6690; }
.badge-warning { --b-bg: var(--gold-100);  --b-ink: #8a6424; }
.badge-danger  { --b-bg: var(--rose-bg);   --b-ink: var(--rose); }
.badge-neutral { --b-bg: var(--line-soft); --b-ink: var(--muted); }
.page-heading h1 .badge { font-family: var(--font-body); letter-spacing: 0; }

/* ---------- Metrics ---------- */

.tone-green { --tone: var(--green-600); --tone-bg: var(--green-100); }
.tone-gold  { --tone: var(--gold-600);  --tone-bg: var(--gold-100); }
.tone-sky   { --tone: var(--sky);       --tone-bg: var(--sky-bg); }
.tone-rose  { --tone: var(--rose);      --tone-bg: var(--rose-bg); }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.metric-card, .panel { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.metric-card { display: block; padding: 18px 20px; color: inherit; text-decoration: none; transition: box-shadow .2s, transform .2s; }
a.metric-card:hover { box-shadow: 0 2px 4px rgb(23 35 28 / 4%), 0 12px 28px rgb(23 35 28 / 7%); transform: translateY(-1px); }
.metric-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 13.5px; font-weight: 500; }
.metric-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--tone-bg); color: var(--tone); }
.metric-value { display: block; margin-top: 8px; font: 600 28px/1.15 var(--font-display); letter-spacing: -.8px; font-variant-numeric: tabular-nums; }
.metric-value small { margin-left: 4px; color: var(--muted); font: 500 13px var(--font-body); letter-spacing: 0; }
.metric-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 8px; color: var(--subtle); font-size: 12.5px; }
.metric-foot b { color: var(--ink-2); font-weight: 600; }

/* ---------- Panels ---------- */

.content-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); gap: 20px; margin-bottom: 20px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.panel { min-width: 0; padding: 20px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-heading h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.2px; }
.panel-heading p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.panel-danger { border-color: #f0d5d8; }

.facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 16px; margin: 0; font-size: 13.5px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; color: var(--ink); font-weight: 500; text-align: right; overflow-wrap: anywhere; }

.usage-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--line-soft); }
.usage-grid div { padding: 12px 14px; background: #fff; }
.usage-grid strong { display: block; font: 600 20px/1.2 var(--font-display); font-variant-numeric: tabular-nums; }
.usage-grid span { color: var(--muted); font-size: 12.5px; }

.bars { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; font-size: 13px; }
.bars strong { font-weight: 600; }
.bars span { color: var(--muted); font-variant-numeric: tabular-nums; }
.bar { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green-600), var(--green-500)); }

.list { margin: 0; padding: 0; list-style: none; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); color: inherit; text-decoration: none; }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover strong { color: var(--green-700); }
.list-item > div { min-width: 0; flex: 1; }
.list-item strong { display: block; overflow: hidden; color: var(--ink); font-size: 13.5px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.list-item p { margin: 1px 0 0; color: var(--muted); font-size: 12.5px; }
.list-item time, .list-item .aside { color: var(--subtle); font-size: 12px; white-space: nowrap; }

.timeline { margin: 0; padding: 0; list-style: none; }
.timeline li { position: relative; padding: 0 0 16px 22px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold-500); box-shadow: 0 0 0 3px var(--gold-100); }
.timeline li:not(:last-child)::after { content: ""; position: absolute; left: 7.5px; top: 18px; bottom: 2px; width: 1px; background: var(--line); }
.timeline li:last-child { padding-bottom: 0; }
.timeline strong { display: block; font-size: 13.5px; font-weight: 600; }
.timeline p { margin: 2px 0 0; color: var(--ink-2); font-size: 13px; overflow-wrap: anywhere; }
.timeline small { color: var(--subtle); font-size: 12px; }

.empty-state { display: grid; place-items: center; gap: 10px; padding: 36px 16px; color: var(--muted); text-align: center; }
.empty-state .icon { width: 28px; height: 28px; color: var(--gold-500); }
.empty-state strong { color: var(--ink); font-size: 15px; }
.empty-state p { max-width: 380px; margin: 0; }

/* ---------- Toolbar and table ---------- */

.toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.search-box { position: relative; display: flex; align-items: center; width: min(340px, 100%); }
.search-box .icon { position: absolute; left: 12px; width: 17px; height: 17px; color: var(--subtle); pointer-events: none; }
.search-box input { width: 100%; height: 40px; padding: 0 12px 0 38px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 13.5px; }
.search-box input:focus { outline: none; border-color: var(--gold-500); box-shadow: var(--ring); }
.segmented { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.segmented a { padding: 6px 12px; border-radius: 7px; color: var(--muted); font-size: 13px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.segmented a:hover { color: var(--ink); }
.segmented a.active { background: #fff; color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm); }
.segmented a span { margin-left: 4px; color: var(--subtle); font-variant-numeric: tabular-nums; }

.table-wrap { margin: 0 -20px; overflow-x: auto; }
.table-wrap.flush { margin: -20px; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 10px; border-bottom: 1px solid var(--line-soft); background: var(--surface-2); color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; white-space: nowrap; }
.table-wrap:not(.flush) th { border-top: 1px solid var(--line-soft); }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
td { padding: 12px 10px; border-bottom: 1px solid var(--line-soft); color: var(--ink-2); font-size: 13.5px; vertical-align: middle; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
td small { display: block; margin-top: 1px; color: var(--subtle); font-size: 12px; }
td.wrap { white-space: normal; min-width: 240px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-link { color: var(--ink); font-weight: 600; text-decoration: none; }
.row-link:hover { color: var(--green-700); text-decoration: underline; }
.who { display: flex; align-items: center; gap: 10px; }
.who > span:last-child { min-width: 0; }
.table-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; color: var(--muted); font-size: 13px; }

/* ---------- Plans ---------- */

.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.plan-card { display: flex; flex-direction: column; padding: 22px; }
.plan-card.retired { background: var(--surface-2); }
.plan-card header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan-card h2 { margin: 0; font-size: 19px; font-weight: 600; }
.plan-price { margin: 14px 0 2px; font: 600 clamp(22px, 2.2vw, 30px)/1.1 var(--font-display); letter-spacing: -.8px; white-space: nowrap; }
.plan-price small { color: var(--muted); font: 500 13px var(--font-body); letter-spacing: 0; }
.plan-card > p { min-height: 40px; margin: 8px 0 14px; color: var(--muted); font-size: 13px; }
.plan-card ul { display: flex; flex-direction: column; gap: 8px; margin: 0 0 18px; padding: 14px 0 0; border-top: 1px solid var(--line-soft); list-style: none; font-size: 13px; }
.plan-card li { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.plan-card li .icon { width: 16px; height: 16px; color: var(--green-600); }
.plan-card footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 12.5px; }

/* ---------- Forms ---------- */

.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.form-narrow { max-width: 720px; }
.form-section { padding: 24px; }
.form-section + .form-section { margin-top: 20px; }
.form-section-head { display: flex; gap: 14px; margin-bottom: 4px; }
.form-section-head h2 { margin: 0; font-size: 17px; font-weight: 600; }
.form-section-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.step { width: 30px; height: 30px; display: grid; place-items: center; flex: none; border-radius: 50%; background: var(--green-800); color: #fff; font: 600 13px var(--font-display); }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.field { margin: 18px 0 0; min-width: 0; }
.field-full { grid-column: 1 / -1; }
.label { display: block; margin-bottom: 7px; color: var(--ink); font-size: 13.5px; font-weight: 600; }
.req { color: var(--rose); }
.input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1.5px solid var(--input-border);
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    font-size: 14.5px;
    box-shadow: inset 0 1px 2px rgb(27 38 32 / 5%);
    transition: border-color .15s, box-shadow .15s;
}
.input:hover:not(:disabled) { border-color: var(--green-500); }
.input:focus { outline: none; border-color: var(--green-600); box-shadow: 0 0 0 4px var(--input-ring); }
.input:disabled { border-color: var(--line); background: var(--surface-2); }
textarea.input { height: auto; min-height: 88px; padding: 10px 14px; resize: vertical; }
select.input { appearance: none; padding-right: 40px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236c776f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center; }
.input-sm { height: 38px; font-size: 13.5px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .prefix { position: absolute; left: 1.5px; top: 1.5px; bottom: 1.5px; display: grid; place-items: center; padding: 0 12px; border-right: 1px solid var(--line); border-radius: 9px 0 0 9px; background: var(--surface-2); color: var(--muted); font-size: 12.5px; font-weight: 600; }
.input-wrap .prefix + .input { padding-left: calc(var(--prefix-w, 150px) + 12px); }
.hint { display: block; margin-top: 6px; color: var(--muted); font-size: 12.5px; }
.field-error { display: block; margin-top: 6px; color: var(--rose); font-size: 12.5px; font-weight: 500; }
.field-error:empty { display: none; }
.input-validation-error { border-color: var(--rose) !important; }
.validation-summary-errors, .form-error { margin-bottom: 18px; padding: 12px 14px; border: 1px solid #ecc9cc; border-radius: var(--radius); background: var(--rose-bg); color: #8c2f39; font-size: 13.5px; }
.validation-summary-errors ul { margin: 0; padding-left: 18px; }
.validation-summary-valid { display: none; }
.check { display: flex; align-items: flex-start; gap: 10px; margin-top: 18px; font-size: 13.5px; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--green-700); }
.check strong { display: block; }
.check span { color: var(--muted); font-size: 12.5px; }
.radio-cards { display: grid; gap: 10px; }
.radio-card { display: flex; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.radio-card:hover { border-color: var(--input-border); }
.radio-card:has(input:checked) { border-color: var(--green-600); background: var(--green-50); }
.radio-card input { margin-top: 3px; accent-color: var(--green-700); }
.radio-card strong { display: block; font-size: 13.5px; }
.radio-card span { color: var(--muted); font-size: 12.5px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.side-note { padding: 20px; }
.side-note h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.side-note h3 .icon { color: var(--gold-600); }
.side-note p, .side-note li { color: var(--ink-2); font-size: 13px; }
.side-note ol, .side-note ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }

/* ---------- Dialog ---------- */

dialog { width: min(480px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgb(3 35 26 / 45%); backdrop-filter: blur(2px); }
.dialog-body { padding: 24px; }
.dialog-body h2 { margin: 0 0 6px; font-size: 19px; font-weight: 600; }
.dialog-body > p { margin: 0 0 4px; color: var(--muted); font-size: 13.5px; }

/* ---------- Sign in ---------- */

.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr); background: var(--surface); }
.auth-story {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 44px clamp(32px, 5vw, 72px);
    overflow: hidden;
    color: #fff;
    background: linear-gradient(180deg, rgb(3 35 26 / 30%) 0%, rgb(3 35 26 / 55%) 55%, rgb(3 35 26 / 92%) 100%), url("../img/login-bg.webp") center / cover, var(--green-900);
}
.auth-brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.auth-brand img { width: 48px; height: 48px; }
.auth-brand span { display: flex; flex-direction: column; font: 600 19px/1.1 var(--font-display); }
.auth-brand small { margin-top: 4px; color: var(--gold-300); font: 600 10px var(--font-body); letter-spacing: 1.6px; text-transform: uppercase; }
.auth-copy { max-width: 520px; }
.auth-copy .eyebrow { color: var(--gold-300); }
.auth-copy h2 { margin: 0; color: #fff; font-size: clamp(32px, 3.6vw, 46px); font-weight: 600; letter-spacing: -1px; line-height: 1.08; }
.auth-copy p { margin: 14px 0 0; color: rgb(255 255 255 / 82%); font-size: 15px; }
.auth-points { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 22px 0 0; padding: 0; list-style: none; color: rgb(255 255 255 / 85%); font-size: 13px; }
.auth-points li { display: flex; align-items: center; gap: 7px; }
.auth-points .icon { width: 16px; height: 16px; color: var(--gold-300); }
.auth-side { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(24px, 6vw, 88px); }
.auth-card { width: 100%; max-width: 400px; margin: 0 auto; }
.auth-card h1 { margin: 0; font-size: 30px; font-weight: 600; letter-spacing: -.6px; }
.auth-card > p { margin: 6px 0 24px; color: var(--muted); font-size: 14.5px; }
.auth-card .field:first-of-type { margin-top: 0; }
.password-wrap { position: relative; }
.password-wrap .input { padding-right: 70px; }
.password-toggle { position: absolute; right: 6px; top: 6px; height: 32px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--green-600); font-size: 12.5px; font-weight: 600; }
.password-toggle:hover { background: var(--green-50); }
.auth-card .button { width: 100%; min-height: 46px; margin-top: 24px; font-size: 14.5px; }
.auth-foot { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 12.5px; }

.error-page { display: grid; place-items: center; min-height: 60vh; text-align: center; }
.error-page .code { color: var(--gold-500); font: 600 56px/1 var(--font-display); }
.error-page h1 { margin: 10px 0 6px; font-size: 24px; }
.error-page p { margin: 0 0 20px; color: var(--muted); }

/* ---------- Plans, limits and features ---------- */

.plan-card.recommended { border-color: var(--gold-500); box-shadow: 0 0 0 1px var(--gold-500), var(--shadow); }
.plan-card header .badge { margin-left: auto; }
.plan-card header .badge + .badge { margin-left: 4px; }
.compare td { white-space: normal; }
.compare td:first-child { color: var(--ink); font-weight: 500; }
.compare td:first-child small { display: block; color: var(--subtle); font-weight: 400; }
.compare .col-recommended { background: rgb(197 150 74 / 7%); }
.compare th.col-recommended { color: var(--gold-600); }
.icon.tick { width: 18px; height: 18px; color: var(--green-600); stroke-width: 2.4; }
.feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.mini-heading { margin: 18px 0 10px; color: var(--muted); font: 600 11.5px var(--font-body); letter-spacing: .5px; text-transform: uppercase; }
.meters { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.meters li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 12px; font-size: 13px; }
.meters span:first-child { color: var(--muted); }
.meters small { color: var(--subtle); }
.meters strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.bar i.over { background: linear-gradient(90deg, var(--rose), #d0646e); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.chip .icon { width: 13px; height: 13px; stroke-width: 2.4; }
.chip.on { background: var(--green-100); color: var(--green-700); }
.chip.off { background: var(--line-soft); color: var(--subtle); text-decoration: line-through; }
@media (max-width: 640px) { .feature-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Showcase: heroes, pricing, journey, add-ons ---------- */

.button-gold { background: linear-gradient(135deg, var(--gold-300), var(--gold-500)); color: var(--green-950); box-shadow: 0 6px 18px rgb(197 150 74 / 30%); }
.button-gold:hover { background: linear-gradient(135deg, #ecd3a4, #cfa35a); }
.button-ghost { border-color: rgb(255 255 255 / 28%); background: rgb(255 255 255 / 8%); color: #fff; backdrop-filter: blur(4px); }
.button-ghost:hover { background: rgb(255 255 255 / 16%); border-color: rgb(255 255 255 / 45%); }

.hero, .pricing-hero {
    position: relative;
    overflow: hidden;
    margin-bottom: 22px;
    border-radius: 20px;
    color: #fff;
    background:
        linear-gradient(100deg, rgb(3 35 26 / 96%) 0%, rgb(4 44 24 / 88%) 45%, rgb(4 44 24 / 40%) 100%),
        url("../img/login-bg.webp") center 62% / cover,
        var(--green-900);
    box-shadow: 0 18px 40px rgb(3 35 26 / 18%);
}
.hero::after, .pricing-hero::after { content: ""; position: absolute; inset: auto -60px -120px auto; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgb(226 196 140 / 28%), transparent 65%); pointer-events: none; }
.hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: 28px; align-items: end; padding: 34px 36px; }
.hero .eyebrow, .pricing-hero .eyebrow { color: var(--gold-300); }
.hero h1, .pricing-hero h1 { margin: 0; color: #fff; font-size: 34px; font-weight: 600; letter-spacing: -.8px; line-height: 1.1; }
.hero p, .pricing-hero p { max-width: 560px; margin: 10px 0 0; color: rgb(255 255 255 / 80%); font-size: 15px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.hero-stats { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid rgb(255 255 255 / 14%); border-radius: 14px; background: rgb(255 255 255 / 12%); backdrop-filter: blur(8px); }
.hero-stats div { padding: 14px 16px; background: rgb(3 35 26 / 45%); }
.hero-stats strong { display: block; font: 600 20px/1.2 var(--font-display); letter-spacing: -.4px; white-space: nowrap; }
.hero-stats span { color: rgb(255 255 255 / 70%); font-size: 12px; }
.pricing-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 34px 36px 40px; }
.pricing-hero .heading-actions { position: relative; z-index: 1; }

.metric-card { position: relative; overflow: hidden; }
.metric-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--tone); opacity: .85; }

/* Pricing cards */
.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; align-items: stretch; margin: 8px 0 26px; }
.price-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 26px 24px 20px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow);
    transition: transform .2s, box-shadow .2s;
}
.price-card:hover { transform: translateY(-3px); box-shadow: 0 4px 8px rgb(23 35 28 / 5%), 0 22px 44px rgb(23 35 28 / 10%); }
.price-card.retired { opacity: .7; }
.price-card header { display: flex; align-items: center; gap: 8px; }
.price-card h2 { margin: 0; font-size: 21px; font-weight: 600; letter-spacing: -.3px; }
.price-tagline { min-height: 42px; margin: 6px 0 18px; color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.price-amount { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.price-amount .from { color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.price-amount .currency { color: var(--muted); font: 600 15px var(--font-display); }
.price-amount strong { font: 600 40px/1 var(--font-display); letter-spacing: -1.4px; font-variant-numeric: tabular-nums; }
.price-amount .per { color: var(--muted); font-size: 13.5px; }
.price-yearly { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; color: var(--muted); font-size: 13px; }
.save { padding: 2px 8px; border-radius: 999px; background: var(--green-100); color: var(--green-700); font-size: 11.5px; font-weight: 700; }
.price-limits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 20px 0 18px; }
.price-limits span { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 6px; border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: 12px; text-align: center; }
.price-limits b { color: var(--ink); font: 600 15px var(--font-display); }
.price-limits .icon { width: 17px; height: 17px; color: var(--green-600); }
.price-features { display: flex; flex-direction: column; gap: 9px; margin: 0 0 20px; padding: 0; list-style: none; font-size: 13.5px; }
.price-features li { display: flex; align-items: flex-start; gap: 9px; color: var(--ink-2); }
.price-features .icon { width: 17px; height: 17px; margin-top: 1px; padding: 2px; border-radius: 50%; background: var(--green-100); color: var(--green-700); stroke-width: 2.6; }
.price-features li.off { color: var(--subtle); text-decoration: line-through; text-decoration-color: rgb(152 161 153 / 50%); }
.price-features li.off .icon { background: var(--line-soft); color: var(--subtle); }
.price-features li.muted-item { color: var(--muted); }
.price-card footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.price-usage { color: var(--muted); font-size: 12.5px; }
.price-usage b { color: var(--ink); }
.price-actions { display: flex; align-items: center; gap: 4px; }

.price-card.featured {
    border-color: transparent;
    color: #fff;
    background:
        radial-gradient(120% 70% at 100% 0%, rgb(197 150 74 / 26%), transparent 55%),
        linear-gradient(165deg, var(--green-800), var(--green-950));
    box-shadow: 0 0 0 1px rgb(197 150 74 / 55%), 0 24px 50px rgb(3 35 26 / 30%);
}
@media (min-width: 1181px) { .price-card.featured { transform: translateY(-10px); } .price-card.featured:hover { transform: translateY(-13px); } }
.price-card.featured h2, .price-card.featured .price-amount strong { color: #fff; }
.price-card.featured .price-tagline, .price-card.featured .price-yearly, .price-card.featured .price-amount .currency,
.price-card.featured .price-amount .per, .price-card.featured .price-amount .from, .price-card.featured .price-usage { color: rgb(255 255 255 / 72%); }
.price-card.featured .price-usage b { color: #fff; }
.price-card.featured .save { background: rgb(226 196 140 / 22%); color: var(--gold-300); }
.price-card.featured .price-limits span { background: rgb(255 255 255 / 7%); color: rgb(255 255 255 / 70%); }
.price-card.featured .price-limits b { color: #fff; }
.price-card.featured .price-limits .icon { color: var(--gold-300); }
.price-card.featured .price-features li { color: rgb(255 255 255 / 88%); }
.price-card.featured .price-features .icon { background: rgb(226 196 140 / 22%); color: var(--gold-300); }
.price-card.featured .price-features li.off { color: rgb(255 255 255 / 40%); }
.price-card.featured footer { border-top-color: rgb(255 255 255 / 12%); }
.price-card.featured .icon-button { color: rgb(255 255 255 / 70%); }
.price-card.featured .icon-button:hover { background: rgb(255 255 255 / 10%); color: #fff; }
.ribbon { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); padding: 5px 14px; border-radius: 999px; background: linear-gradient(135deg, var(--gold-300), var(--gold-500)); color: var(--green-950); font: 700 11px var(--font-display); letter-spacing: 1px; text-transform: uppercase; white-space: nowrap; box-shadow: 0 6px 16px rgb(197 150 74 / 40%); }

/* Trial journey */
.trial-journey { margin-bottom: 26px; padding: 24px 26px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(180deg, #fff, var(--surface-2)); box-shadow: var(--shadow); }
.trial-journey-head, .section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.trial-journey h2, .section-head h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.3px; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.journey { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.journey::before { content: ""; position: absolute; top: 21px; left: 10%; right: 10%; height: 2px; background: linear-gradient(90deg, var(--sky), var(--gold-500) 40%, var(--green-500) 55%, var(--gold-500) 70%, var(--rose)); opacity: .35; }
.journey li { position: relative; text-align: center; }
.journey-dot { position: relative; z-index: 1; width: 44px; height: 44px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 50%; background: var(--dot-bg); color: var(--dot); box-shadow: 0 0 0 5px #fff, 0 4px 12px rgb(23 35 28 / 10%); }
.journey strong { display: block; font: 600 14.5px var(--font-display); }
.journey p { margin: 4px auto 0; max-width: 200px; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.step-trial { --dot: var(--sky); --dot-bg: var(--sky-bg); }
.step-remind { --dot: var(--gold-600); --dot-bg: var(--gold-100); }
.step-pay { --dot: #fff; --dot-bg: var(--green-600); }
.step-readonly { --dot: var(--gold-600); --dot-bg: var(--gold-100); }
.step-ended { --dot: var(--rose); --dot-bg: var(--rose-bg); }

/* Add-on cards */
.addon-section { margin-bottom: 26px; }
.addon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.addon-card { position: relative; display: flex; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s; }
.addon-card:hover { border-color: rgb(197 150 74 / 50%); box-shadow: var(--shadow); }
.addon-card.retired { opacity: .65; }
.addon-icon { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(145deg, var(--gold-100), #fbf3e3); color: var(--gold-600); }
.addon-body { min-width: 0; flex: 1; }
.addon-body strong { display: flex; align-items: center; gap: 6px; font-size: 14.5px; }
.addon-body p { margin: 3px 0 10px; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.addon-price { display: flex; align-items: baseline; gap: 5px; }
.addon-price b { font: 600 16px var(--font-display); color: var(--green-700); }
.addon-price span { color: var(--muted); font-size: 12.5px; }
.addon-body small { display: block; margin-top: 6px; color: var(--subtle); font-size: 12px; }
.addon-actions { position: absolute; top: 10px; right: 10px; display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.addon-card:hover .addon-actions, .addon-card:focus-within .addon-actions { opacity: 1; }
.addon-actions .icon-button { width: 32px; height: 32px; }

.compare-panel { padding: 0; overflow: hidden; }
.compare-panel summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; cursor: pointer; list-style: none; }
.compare-panel summary::-webkit-details-marker { display: none; }
.compare-panel summary strong { display: block; font: 600 16px var(--font-display); }
.compare-panel summary small { color: var(--muted); font-size: 13px; }
.compare-panel summary .icon { flex: none; color: var(--muted); transition: transform .2s; }
.compare-panel[open] summary .icon { transform: rotate(180deg); }
.compare-panel .table-wrap { margin: 0; }

/* Company header */
.company-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; padding: 22px 24px; border: 1px solid var(--line); border-radius: 20px; background: radial-gradient(90% 140% at 100% 0%, rgb(197 150 74 / 12%), transparent 60%), #fff; box-shadow: var(--shadow); }
.company-id { display: flex; align-items: center; gap: 16px; min-width: 0; }
.company-mark { width: 60px; height: 60px; flex: none; display: grid; place-items: center; border-radius: 16px; background: linear-gradient(145deg, var(--green-700), var(--green-900)); color: var(--gold-300); font: 600 21px var(--font-display); letter-spacing: .5px; box-shadow: 0 8px 18px rgb(6 58 33 / 25%); }
.company-id h1 { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -.5px; }
.company-id h1 .badge { font-family: var(--font-body); letter-spacing: 0; }
.company-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; color: var(--muted); font-size: 13px; }
.company-meta span { display: inline-flex; align-items: center; gap: 5px; }
.company-meta .icon { width: 15px; height: 15px; color: var(--gold-600); }

@media (max-width: 1180px) {
    .hero { grid-template-columns: minmax(0, 1fr); }
    .journey { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 22px; }
    .journey::before { display: none; }
}
@media (max-width: 640px) {
    .hero, .pricing-hero { padding: 24px 20px; }
    .pricing-hero { flex-direction: column; align-items: flex-start; }
    .hero h1, .pricing-hero h1 { font-size: 26px; }
    .hero-stats { grid-template-columns: minmax(0, 1fr); }
    .journey { grid-template-columns: minmax(0, 1fr); }
    .company-hero { flex-direction: column; align-items: flex-start; }
    .addon-actions { opacity: 1; }
}

/* ---------- Company page ---------- */

.co-cover {
    position: relative;
    overflow: hidden;
    margin-bottom: 22px;
    border-radius: 22px;
    color: #fff;
    background:
        radial-gradient(60% 120% at 100% 0%, rgb(226 196 140 / 26%), transparent 60%),
        linear-gradient(100deg, rgb(3 35 26 / 97%) 0%, rgb(4 44 24 / 90%) 50%, rgb(4 44 24 / 55%) 100%),
        url("../img/login-bg.webp") center 70% / cover,
        var(--green-900);
    box-shadow: 0 18px 40px rgb(3 35 26 / 18%);
}
.co-cover-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 28px 30px 24px; }
.co-cover .company-mark { width: 68px; height: 68px; border: 1px solid rgb(226 196 140 / 40%); background: linear-gradient(145deg, rgb(255 255 255 / 14%), rgb(255 255 255 / 4%)); color: var(--gold-300); font-size: 24px; backdrop-filter: blur(6px); box-shadow: 0 10px 24px rgb(0 0 0 / 22%); }
.co-cover .company-id h1 { color: #fff; font-size: 30px; }
.co-cover .company-meta { color: rgb(255 255 255 / 75%); }
.co-cover .company-meta .icon { color: var(--gold-300); }
.co-cover .badge-success { --b-bg: rgb(122 216 160 / 18%); --b-ink: #9be7b9; }
.co-cover .badge-danger { --b-bg: rgb(240 138 148 / 20%); --b-ink: #ffc2c8; }
.button-ghost-danger:hover { border-color: rgb(255 180 188 / 60%); background: rgb(185 68 79 / 30%); }

.co-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid rgb(255 255 255 / 12%); background: rgb(3 35 26 / 40%); backdrop-filter: blur(8px); }
.co-kpis > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 16px 22px 18px; }
.co-kpis > div + div { border-left: 1px solid rgb(255 255 255 / 10%); }
.co-kpi-label { display: inline-flex; align-items: center; gap: 6px; color: rgb(255 255 255 / 62%); font-size: 11.5px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; }
.co-kpi-label .icon { width: 14px; height: 14px; color: var(--gold-300); }
.co-kpis strong { overflow: hidden; font: 600 21px/1.2 var(--font-display); letter-spacing: -.4px; text-overflow: ellipsis; white-space: nowrap; }
.co-kpis strong em { color: rgb(255 255 255 / 55%); font: 500 13px var(--font-body); font-style: normal; letter-spacing: 0; }
.co-kpis small { color: rgb(255 255 255 / 70%); font-size: 12.5px; }
.co-meter { display: block; height: 6px; margin-top: 6px; overflow: hidden; border-radius: 999px; background: rgb(255 255 255 / 14%); }
.co-meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold-300), var(--gold-500)); }
.co-meter i.over { background: linear-gradient(90deg, #f08a94, var(--rose)); }

/* Team */
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.member-card { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--surface-2); transition: border-color .15s, background-color .15s, box-shadow .15s; }
.member-card:hover { border-color: var(--line); background: #fff; box-shadow: var(--shadow-sm); }
.member-card.inactive { opacity: .6; }
.member-card .avatar { width: 42px; height: 42px; font-size: 14px; }
.member-body { min-width: 0; flex: 1; }
.member-body > strong { display: block; overflow: hidden; color: var(--ink); font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.member-body > small { display: block; overflow: hidden; color: var(--muted); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.member-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 8px; }
.role-pill { padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.role-owner { background: linear-gradient(135deg, var(--gold-100), #f2e2c2); color: #7d5a20; }
.role-admin { background: var(--green-100); color: var(--green-700); }
.role-finance { background: var(--sky-bg); color: #2f6690; }
.role-default { background: var(--line-soft); color: var(--ink-2); }
.role-pending { background: var(--gold-100); color: #8a6424; }
.role-off { background: var(--rose-bg); color: var(--rose); }
.member-seen { display: inline-flex; align-items: center; gap: 4px; color: var(--subtle); font-size: 12px; }
.member-seen .icon { width: 13px; height: 13px; }
.member-card .icon-button { width: 34px; height: 34px; margin: -4px -4px 0 0; }

/* Usage */
.usage-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.usage-tile { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line-soft); border-radius: 14px; background: linear-gradient(135deg, #fff, var(--surface-2)); }
.usage-tile .metric-icon { flex: none; }
.usage-tile strong { display: block; font: 600 22px/1.1 var(--font-display); letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.usage-tile span:not(.metric-icon) { color: var(--muted); font-size: 12.5px; }

/* History */
.timeline-toned li::before { background: var(--t, var(--subtle)); box-shadow: 0 0 0 3px var(--t-bg, var(--line-soft)); }
.t-green { --t: var(--green-500); --t-bg: var(--green-100); }
.t-gold { --t: var(--gold-500); --t-bg: var(--gold-100); }
.t-rose { --t: var(--rose); --t-bg: var(--rose-bg); }
.t-sky { --t: var(--sky); --t-bg: var(--sky-bg); }
.t-neutral { --t: var(--subtle); --t-bg: var(--line-soft); }

/* Subscription ticket */
.plan-ticket {
    position: relative;
    overflow: hidden;
    padding: 22px;
    border-radius: 20px;
    color: #fff;
    background:
        radial-gradient(90% 80% at 100% 0%, rgb(226 196 140 / 30%), transparent 60%),
        linear-gradient(160deg, var(--green-700), var(--green-950));
    box-shadow: 0 18px 38px rgb(3 35 26 / 25%);
}
.plan-ticket.tone-gold { background: radial-gradient(90% 80% at 100% 0%, rgb(255 230 180 / 30%), transparent 60%), linear-gradient(160deg, #8a6424, #3f2c0c); }
.plan-ticket.tone-rose { background: radial-gradient(90% 80% at 100% 0%, rgb(255 190 196 / 25%), transparent 60%), linear-gradient(160deg, #8c2f39, #3d1116); }
.plan-ticket.tone-sky { background: radial-gradient(90% 80% at 100% 0%, rgb(226 196 140 / 28%), transparent 60%), linear-gradient(160deg, #1f5a86, #0b2a42); }
.plan-ticket.empty { background: radial-gradient(90% 80% at 100% 0%, rgb(226 196 140 / 22%), transparent 60%), linear-gradient(160deg, #3c4a42, #17231c); }
.ticket-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ticket-label { color: rgb(255 255 255 / 60%); font-size: 11.5px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; }
.plan-ticket h2 { margin: 2px 0 0; color: #fff; font-size: 24px; font-weight: 600; letter-spacing: -.4px; }
.plan-ticket .badge { --b-bg: rgb(255 255 255 / 16%); --b-ink: #fff; }
.ticket-price { display: flex; align-items: baseline; gap: 6px; margin-top: 14px; }
.ticket-price span { color: rgb(255 255 255 / 70%); font: 600 14px var(--font-display); }
.ticket-price strong { font: 600 36px/1 var(--font-display); letter-spacing: -1.2px; font-variant-numeric: tabular-nums; }
.ticket-price em { color: rgb(255 255 255 / 65%); font-size: 13.5px; font-style: normal; }
.ticket-note { margin: 8px 0 0; color: rgb(255 255 255 / 75%); font-size: 13px; }
.ticket-period { margin: 18px 0 4px; padding: 14px; border: 1px solid rgb(255 255 255 / 12%); border-radius: 14px; background: rgb(0 0 0 / 16%); }
.ticket-period-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.ticket-period-row b { color: var(--gold-300); }
.ticket-period-row.subtle-row { margin-top: 8px; color: rgb(255 255 255 / 55%); font-size: 12px; }
.ticket-bar { display: block; height: 8px; margin-top: 10px; overflow: hidden; border-radius: 999px; background: rgb(255 255 255 / 14%); }
.ticket-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold-300), var(--gold-500)); }
.ticket-notes { display: flex; gap: 8px; margin: 12px 0 0; color: rgb(255 255 255 / 80%); font-size: 12.5px; }
.ticket-notes .icon { width: 15px; height: 15px; margin-top: 1px; color: var(--gold-300); }
.plan-ticket .button-block { margin-top: 18px; }

.module-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.module-list li { display: flex; align-items: center; gap: 9px; color: var(--ink-2); }
.module-list .icon { width: 18px; height: 18px; padding: 3px; border-radius: 50%; background: var(--green-100); color: var(--green-700); stroke-width: 2.6; }
.module-list li.off { color: var(--subtle); }
.module-list li.off .icon { background: var(--line-soft); color: var(--subtle); }
.limit-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.limit-row span { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: 12px; background: var(--surface-2); color: var(--ink-2); font-size: 12.5px; font-weight: 500; text-align: center; }
.limit-row .icon { width: 17px; height: 17px; color: var(--gold-600); }

.addon-empty { display: flex; align-items: center; gap: 10px; padding: 14px; border: 1.5px dashed var(--line); border-radius: 14px; color: var(--muted); font-size: 13px; }
.addon-empty .icon { flex: none; color: var(--gold-500); }
.addon-lines { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.addon-lines li { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--surface-2); }
.addon-qty { min-width: 38px; padding: 6px 0; border-radius: 9px; background: var(--gold-100); color: #7d5a20; font: 700 13px var(--font-display); text-align: center; }
.addon-lines li > div { min-width: 0; flex: 1; }
.addon-lines strong { display: block; font-size: 13.5px; }
.addon-lines small { color: var(--muted); font-size: 12px; }
.addon-lines b { color: var(--green-700); font: 600 14px var(--font-display); white-space: nowrap; }
.addon-lines .icon-button { width: 30px; height: 30px; }

dialog.dialog-wide { width: min(640px, calc(100vw - 32px)); }
.plan-picker { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

@media (max-width: 1180px) { .co-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .co-kpis > div:nth-child(3) { border-left: 0; } .co-kpis > div:nth-child(n+3) { border-top: 1px solid rgb(255 255 255 / 10%); } }
@media (max-width: 640px) {
    .co-cover-top { flex-direction: column; align-items: flex-start; padding: 22px 20px; }
    .co-cover .company-id h1 { font-size: 24px; }
    .co-kpis { grid-template-columns: minmax(0, 1fr); }
    .co-kpis > div + div { border-left: 0; border-top: 1px solid rgb(255 255 255 / 10%); }
    .usage-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Companies list ---------- */

.companies-hero h1 { font-size: 36px; }
.hero-pills { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.hero-pills span { padding: 6px 12px; border: 1px solid rgb(255 255 255 / 16%); border-radius: 999px; background: rgb(255 255 255 / 8%); color: rgb(255 255 255 / 80%); font-size: 12.5px; backdrop-filter: blur(4px); }
.hero-pills b { color: #fff; font: 600 14px var(--font-display); margin-right: 3px; }
.hero-pills .warn { border-color: rgb(226 196 140 / 45%); background: rgb(197 150 74 / 22%); }
.hero-pills .danger { border-color: rgb(240 138 148 / 45%); background: rgb(185 68 79 / 25%); }

.co-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 20px; }
.search-lg { width: min(380px, 100%); }
.search-lg input { height: 46px; border-radius: 14px; box-shadow: var(--shadow-sm); font-size: 14px; }
.filter-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-pills a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink-2); font-size: 13px; font-weight: 500; text-decoration: none; box-shadow: var(--shadow-sm); transition: border-color .15s, background-color .15s, color .15s; }
.filter-pills a .icon { width: 15px; height: 15px; color: var(--subtle); }
.filter-pills a span { min-width: 22px; padding: 0 6px; border-radius: 999px; background: var(--line-soft); color: var(--muted); font-size: 11.5px; font-weight: 700; text-align: center; }
.filter-pills a:hover { border-color: var(--gold-500); color: var(--ink); }
.filter-pills a.active { border-color: var(--green-800); background: var(--green-800); color: #fff; }
.filter-pills a.active .icon { color: var(--gold-300); }
.filter-pills a.active span { background: rgb(255 255 255 / 16%); color: #fff; }

.co-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.co-card {
    --band: linear-gradient(90deg, var(--green-600), var(--green-500));
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow: hidden;
    padding: 22px 20px 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    color: inherit;
    text-decoration: none;
    box-shadow: var(--shadow);
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
.co-card:hover { transform: translateY(-3px); border-color: rgb(197 150 74 / 45%); box-shadow: 0 4px 8px rgb(23 35 28 / 5%), 0 22px 44px rgb(23 35 28 / 10%); }
.co-card-band { position: absolute; inset: 0 0 auto; height: 4px; background: var(--band); }
.co-trial { --band: linear-gradient(90deg, var(--sky), #6aa6d1); }
.co-pastdue { --band: linear-gradient(90deg, var(--gold-600), var(--gold-300)); }
.co-suspended, .co-cancelled { --band: linear-gradient(90deg, var(--rose), #e0838c); }
.co-noplan { --band: linear-gradient(90deg, var(--subtle), var(--line)); }
.co-card-head { display: flex; align-items: center; gap: 12px; }
.co-card-head > div { min-width: 0; flex: 1; }
.co-card-head strong { display: block; overflow: hidden; color: var(--ink); font: 600 16.5px/1.25 var(--font-display); letter-spacing: -.2px; text-overflow: ellipsis; white-space: nowrap; }
.co-card-head small { color: var(--subtle); font-size: 12.5px; }
.co-card-mark { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 14px; background: linear-gradient(145deg, var(--green-700), var(--green-900)); color: var(--gold-300); font: 600 16px var(--font-display); box-shadow: 0 6px 14px rgb(6 58 33 / 22%); }
.co-trial .co-card-mark { background: linear-gradient(145deg, #2f6690, #143a57); }
.co-suspended .co-card-mark, .co-cancelled .co-card-mark { background: linear-gradient(145deg, #8c2f39, #4a161c); color: #ffd5d9; }
.co-noplan .co-card-mark { background: linear-gradient(145deg, #5c6a62, #2c3832); color: #f1ede2; }
.co-card-plan { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.plan-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 10px; background: linear-gradient(135deg, var(--gold-100), #f6ead2); color: #6b4c18; font: 600 13px var(--font-display); }
.plan-chip .icon { width: 14px; height: 14px; }
.plan-chip.none { background: var(--line-soft); color: var(--muted); }
.co-card-note { color: var(--subtle); font-size: 12.5px; }
.co-card-trial { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: var(--sky-bg); color: #24557d; font-size: 12.5px; font-weight: 600; }
.co-card-trial .icon { width: 15px; height: 15px; }
.co-card-trial.urgent { background: var(--gold-100); color: #7d5a20; }
.co-card-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.co-card-facts div { min-width: 0; padding: 9px 10px; border-radius: 10px; background: var(--surface-2); }
.co-card-facts dt { color: var(--subtle); font-size: 10.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; }
.co-card-facts dd { overflow: hidden; margin: 2px 0 0; color: var(--ink); font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.co-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.co-card-email { overflow: hidden; color: var(--muted); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.co-card-open { display: inline-flex; align-items: center; gap: 4px; flex: none; color: var(--green-600); font-size: 13px; font-weight: 600; }
.co-card-open .icon { width: 15px; height: 15px; transition: transform .15s; }
.co-card:hover .co-card-open .icon { transform: translateX(3px); }

.co-card-add { align-items: center; justify-content: center; gap: 8px; min-height: 260px; border: 2px dashed rgb(197 150 74 / 45%); background: linear-gradient(160deg, #fffdf8, var(--gold-100)); box-shadow: none; text-align: center; }
.co-card-add:hover { border-color: var(--gold-500); }
.co-add-icon { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg, var(--gold-300), var(--gold-500)); color: var(--green-950); box-shadow: 0 8px 20px rgb(197 150 74 / 35%); }
.co-add-icon .icon { width: 24px; height: 24px; stroke-width: 2.4; }
.co-card-add strong { color: var(--ink); font: 600 17px var(--font-display); }
.co-card-add small { max-width: 220px; color: var(--muted); font-size: 13px; }

@media (max-width: 640px) {
    .co-toolbar { flex-direction: column; align-items: stretch; }
    .co-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Subscriptions ---------- */

.subs-hero .hero-stats strong em { color: rgb(255 255 255 / 55%); font: 500 13px var(--font-body); font-style: normal; }
.attention-list { margin: 0; padding: 0; list-style: none; }
.attention-list a { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); color: inherit; text-decoration: none; }
.attention-list li:last-child a { border-bottom: 0; }
.attention-list a:hover strong { color: var(--green-700); }
.attention-mark { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 11px; background: linear-gradient(145deg, var(--green-700), var(--green-900)); color: var(--gold-300); font: 600 13px var(--font-display); }
.attention-mark.co-trial { background: linear-gradient(145deg, #2f6690, #143a57); }
.attention-mark.co-pastdue { background: linear-gradient(145deg, var(--gold-600), #6b4c18); color: #fff6e6; }
.attention-mark.co-cancelled { background: linear-gradient(145deg, #8c2f39, #4a161c); color: #ffd5d9; }
.attention-body { min-width: 0; flex: 1; }
.attention-body strong { display: block; font-size: 13.5px; }
.attention-body small { color: var(--muted); font-size: 12.5px; }
.all-clear { display: flex; align-items: center; gap: 10px; padding: 18px; border-radius: 14px; background: var(--green-50); color: var(--green-700); font-weight: 600; }
.all-clear .icon { padding: 3px; border-radius: 50%; background: var(--green-600); color: #fff; stroke-width: 2.6; }
.split-bar { display: flex; height: 14px; overflow: hidden; border-radius: 999px; background: var(--line-soft); }
.split-bar i { display: block; height: 100%; }
.split-bar i + i { box-shadow: inset 2px 0 0 #fff; }
.split-legend { display: flex; flex-direction: column; gap: 10px; margin: 16px 0 0; padding: 0; list-style: none; font-size: 13px; }
.split-legend li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; }
.swatch { width: 12px; height: 12px; border-radius: 4px; }
.split-legend span:not(.swatch) { color: var(--muted); }
.split-legend b { font: 600 14px var(--font-display); }
.subs-filters { margin: 4px 0 16px; }

.sub-list { display: flex; flex-direction: column; gap: 10px; }
.sub-row {
    --band: var(--green-500);
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(220px, 1.4fr) minmax(200px, 1fr) minmax(130px, auto) auto;
    align-items: center;
    gap: 18px;
    padding: 16px 20px 16px 22px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.sub-row::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--band); }
.sub-row:hover { transform: translateY(-2px); border-color: rgb(197 150 74 / 45%); box-shadow: var(--shadow); }
.sub-row.co-trial { --band: var(--sky); }
.sub-row.co-pastdue { --band: var(--gold-500); }
.sub-row.co-cancelled { --band: var(--rose); }
.sub-row .co-card-mark { width: 44px; height: 44px; font-size: 15px; }
.sub-row.co-trial .co-card-mark { background: linear-gradient(145deg, #2f6690, #143a57); }
.sub-row.co-pastdue .co-card-mark { background: linear-gradient(145deg, var(--gold-600), #6b4c18); color: #fff6e6; }
.sub-row.co-cancelled .co-card-mark { background: linear-gradient(145deg, #8c2f39, #4a161c); color: #ffd5d9; }
.sub-company { min-width: 0; }
.sub-company > strong { display: block; overflow: hidden; color: var(--ink); font: 600 15.5px var(--font-display); text-overflow: ellipsis; white-space: nowrap; }
.sub-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 5px; font-size: 12.5px; }
.sub-tags .plan-chip { padding: 2px 9px; font-size: 12px; }
.sub-period { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.sub-period-label { display: flex; justify-content: space-between; gap: 8px; color: var(--ink-2); font-size: 12.5px; }
.sub-period-label b { color: var(--green-700); font-weight: 700; white-space: nowrap; }
.sub-period-label b.soon { color: var(--gold-600); }
.sub-period-label b.late { color: var(--rose); }
.sub-bar { display: block; height: 7px; overflow: hidden; border-radius: 999px; background: var(--line-soft); }
.sub-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--band), color-mix(in srgb, var(--band) 60%, #fff)); }
.sub-price { text-align: right; }
.sub-price strong { display: block; font: 600 17px var(--font-display); letter-spacing: -.3px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sub-price small { color: var(--muted); font-size: 12px; }

/* ---------- Settings ---------- */

.settings-hero { position: relative; overflow: hidden; margin-bottom: 0; padding: 28px 32px 56px; border-radius: 20px 20px 0 0; color: #fff; background: radial-gradient(70% 140% at 100% 0%, rgb(226 196 140 / 28%), transparent 60%), linear-gradient(110deg, var(--green-900), var(--green-700)); }
.settings-hero .eyebrow { color: var(--gold-300); }
.settings-hero h1 { margin: 0; color: #fff; font-size: 30px; font-weight: 600; letter-spacing: -.6px; }
.settings-hero p { margin: 6px 0 0; color: rgb(255 255 255 / 78%); }
.settings-tabs { position: relative; display: flex; flex-wrap: wrap; gap: 6px; margin: -30px 20px 24px; padding: 6px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.settings-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 11px; color: var(--ink-2); font-size: 13.5px; font-weight: 600; text-decoration: none; transition: background-color .15s, color .15s; }
.settings-tabs a .icon { width: 17px; height: 17px; color: var(--subtle); }
.settings-tabs a:hover { background: var(--surface-2); color: var(--ink); }
.settings-tabs a.active { background: var(--green-800); color: #fff; box-shadow: 0 4px 12px rgb(6 58 33 / 25%); }
.settings-tabs a.active .icon { color: var(--gold-300); }

.channel-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.channel-head > div { min-width: 0; flex: 1; }
.channel-head h2 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.4px; }
.channel-head p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; max-width: 760px; }
.channel-icon { width: 52px; height: 52px; flex: none; display: grid; place-items: center; border-radius: 15px; color: #fff; box-shadow: 0 8px 18px rgb(23 35 28 / 15%); }
.channel-icon .icon { width: 24px; height: 24px; }
.channel-icon.mail { background: linear-gradient(145deg, #3d7aa8, #1f4f75); }
.channel-icon.wa { background: linear-gradient(145deg, #25d366, #128c4f); }
.channel-icon.sm { width: 36px; height: 36px; border-radius: 11px; box-shadow: none; }
.channel-icon.sm .icon { width: 18px; height: 18px; }
.channel-state { flex: none; padding: 6px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.channel-state.ok { background: var(--green-100); color: var(--green-700); }
.channel-state.warn { background: var(--gold-100); color: #8a6424; }
.channel-state.off { background: var(--line-soft); color: var(--muted); }
.plain-fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.preset-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.preset { padding: 8px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--ink-2); font-size: 12.5px; font-weight: 600; transition: border-color .15s, background-color .15s; }
.preset:hover { border-color: var(--gold-500); background: #fff; }
.preset.active { border-color: var(--green-600); background: var(--green-50); color: var(--green-700); }
.check-sm { margin-top: 8px; font-size: 12.5px; }
.check-sm input { width: 15px; height: 15px; }
.test-card h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.test-card h3 .icon { padding: 3px; border-radius: 50%; background: var(--green-600); color: #fff; stroke-width: 2.6; }
.test-card > p { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.test-result { margin-bottom: 12px; padding: 12px; border-radius: 12px; font-size: 13px; }
.test-result.ok { background: var(--green-50); color: var(--green-700); }
.test-result.bad { background: var(--rose-bg); color: #8c2f39; }
.test-result strong { display: block; }
.test-result small { opacity: .8; }
.test-result p { margin: 6px 0 0; }
.test-form { display: flex; gap: 8px; }
.test-form .input { min-width: 0; flex: 1; }

.channel-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.channel-summary > div { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); }
.channel-summary strong { display: block; font: 600 22px var(--font-display); letter-spacing: -.4px; }
.channel-summary span:not(.channel-icon) { color: var(--muted); font-size: 13px; }
.channel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.channel-card { padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
.channel-card header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.channel-card header > div { min-width: 0; flex: 1; }
.channel-card header strong { display: block; overflow: hidden; font: 600 15.5px var(--font-display); text-overflow: ellipsis; white-space: nowrap; }
.channel-card header small { color: var(--subtle); font-size: 12.5px; }
.channel-card .co-card-mark { width: 42px; height: 42px; font-size: 14px; }
.channel-line { display: flex; align-items: center; gap: 12px; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 13px; background: var(--surface-2); color: inherit; text-decoration: none; transition: border-color .15s, background-color .15s; }
.channel-line:hover { border-color: var(--gold-500); background: #fff; }
.channel-line-body { min-width: 0; flex: 1; }
.channel-line-body b { display: block; font-size: 13.5px; }
.channel-line-body small { display: block; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.channel-line .chevron { width: 16px; height: 16px; color: var(--subtle); }
.dot-state { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.dot-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.dot-state.ok { color: var(--green-600); }
.dot-state.on { color: var(--sky); }
.dot-state.warn { color: var(--gold-600); }
.dot-state.off { color: var(--subtle); }

@media (max-width: 1180px) {
    .sub-row { grid-template-columns: auto minmax(0, 1fr) auto; }
    .sub-period { grid-column: 2 / -1; order: 5; }
    .sub-row > .badge { display: none; }
}
@media (max-width: 640px) {
    .sub-row { grid-template-columns: auto minmax(0, 1fr); }
    .sub-price { grid-column: 2; text-align: left; }
    .channel-summary { grid-template-columns: minmax(0, 1fr); }
    .settings-hero { padding: 22px 20px 52px; }
    .settings-tabs { margin: -30px 10px 20px; }
    .channel-head { flex-wrap: wrap; }
}

/* ---------- Onboarding ---------- */

.kanban { display: grid; grid-auto-columns: minmax(250px, 1fr); grid-auto-flow: column; gap: 14px; overflow-x: auto; padding-bottom: 10px; }
.kanban-col { display: flex; flex-direction: column; min-width: 250px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(180deg, var(--surface-2), #f2f0e9); }
.kanban-col header { display: flex; align-items: center; gap: 9px; padding: 14px 14px 10px; }
.kanban-col header strong { flex: 1; font: 600 14px var(--font-display); }
.kanban-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: #fff; color: var(--green-600); box-shadow: var(--shadow-sm); }
.kanban-icon .icon { width: 16px; height: 16px; }
.kanban-count { min-width: 24px; padding: 1px 8px; border-radius: 999px; background: #fff; color: var(--muted); font-size: 12px; font-weight: 700; text-align: center; }
.col-live .kanban-icon { background: var(--green-600); color: #fff; }
.col-new .kanban-icon { color: var(--subtle); }
.kanban-cards { display: flex; flex-direction: column; gap: 10px; padding: 0 10px 12px; }
.kanban-empty { margin: 6px 4px; color: var(--subtle); font-size: 12.5px; }
.kanban-card { display: flex; flex-direction: column; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: inherit; text-decoration: none; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s, border-color .15s; }
.kanban-card:hover { transform: translateY(-2px); border-color: rgb(197 150 74 / 50%); box-shadow: var(--shadow); }
.kanban-card.on-hold { border-style: dashed; }
.kanban-card-head { display: flex; align-items: center; gap: 10px; }
.kanban-card-head > div { min-width: 0; }
.kanban-card-head strong { display: block; overflow: hidden; font: 600 14px var(--font-display); text-overflow: ellipsis; white-space: nowrap; }
.kanban-card-head small { color: var(--subtle); font-size: 12px; }
.kanban-card .co-card-mark { width: 38px; height: 38px; font-size: 13px; border-radius: 11px; }
.ring-row { display: flex; align-items: center; gap: 12px; }
.ring-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.mini-ring, .big-ring, .step-dot { --p: 0; position: relative; display: grid; place-items: center; flex: none; border-radius: 50%; background: conic-gradient(var(--ring-fill, var(--green-500)) calc(var(--p) * 1%), var(--ring-track, var(--line-soft)) 0); }
.mini-ring { width: 46px; height: 46px; }
.mini-ring::before, .big-ring::before, .step-dot::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--ring-hole, #fff); }
.mini-ring b { position: relative; font: 700 11.5px var(--font-display); }
.target { display: inline-flex; align-items: center; gap: 5px; color: var(--green-700); font-size: 12.5px; font-weight: 600; }
.target .icon { width: 14px; height: 14px; }
.target.late { color: var(--rose); }
.next-session { display: flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 9px; background: var(--sky-bg); color: #24557d; font-size: 12px; font-weight: 600; }
.next-session .icon { width: 14px; height: 14px; }
.start-link { display: inline-flex; align-items: center; gap: 5px; color: var(--green-600); font-size: 13px; font-weight: 600; }
.start-link .icon { width: 15px; height: 15px; }

.onb-cover .big-ring { --ring-fill: var(--gold-300); --ring-track: rgb(255 255 255 / 15%); --ring-hole: #0a3322; width: 82px; height: 82px; }
.onb-cover .big-ring::before { inset: 7px; }
.big-ring b { position: relative; margin-top: -4px; color: #fff; font: 700 19px var(--font-display); }
.big-ring small { position: absolute; bottom: 19px; color: rgb(255 255 255 / 60%); font-size: 10px; text-transform: uppercase; letter-spacing: .6px; }

.stepper { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin-bottom: 22px; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
.step-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px; color: inherit; text-align: center; text-decoration: none; }
.step-item:not(:last-child)::after { content: ""; position: absolute; top: 22px; left: calc(50% + 26px); right: calc(-50% + 26px); height: 2px; background: var(--line); }
.step-item.done:not(:last-child)::after { background: var(--green-500); }
.step-dot { width: 44px; height: 44px; }
.step-dot b { position: relative; color: var(--muted); font: 700 14px var(--font-display); }
.step-dot .icon { position: relative; width: 20px; height: 20px; color: #fff; stroke-width: 2.6; }
.step-item.done .step-dot { background: var(--green-600); }
.step-item.done .step-dot::before { display: none; }
.step-item.current .step-dot { --ring-fill: var(--gold-500); box-shadow: 0 0 0 4px var(--gold-100); }
.step-item.current .step-dot b { color: var(--gold-600); }
.step-item strong { font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.step-item small { color: var(--subtle); font-size: 11.5px; }
.step-item:hover strong { color: var(--green-700); }

.stage-card { scroll-margin-top: 80px; }
.stage-card.current { border-color: rgb(197 150 74 / 55%); box-shadow: 0 0 0 1px rgb(197 150 74 / 35%), var(--shadow); }
.stage-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.stage-head > div { min-width: 0; flex: 1; }
.stage-head h2 { margin: 0; font-size: 17px; font-weight: 600; }
.stage-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.stage-icon { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--gold-100); color: var(--gold-600); }
.stage-card.complete .stage-icon { background: var(--green-100); color: var(--green-700); }
.stage-progress { display: flex; align-items: center; gap: 10px; flex: none; width: 140px; }
.stage-progress .bar { flex: 1; }
.stage-progress b { color: var(--muted); font-size: 12.5px; }
.checklist { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.check-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 4px; border-top: 1px solid var(--line-soft); scroll-margin-top: 90px; }
.check-item form { margin: 0; }
.check-box { width: 24px; height: 24px; flex: none; display: grid; place-items: center; padding: 0; margin-top: 1px; border: 2px solid #c9d3cb; border-radius: 7px; background: #fff; color: #fff; transition: border-color .15s, background-color .15s; }
button.check-box:hover { border-color: var(--green-500); }
.check-item.done .check-box { border-color: var(--green-600); background: var(--green-600); }
.check-box.auto { border-color: var(--sky); }
.check-item.done .check-box.auto { border-color: var(--sky); background: var(--sky); }
.check-item.skipped .check-box { border-color: var(--line); background: var(--line); }
.check-box .icon { width: 15px; height: 15px; stroke-width: 3; }
.check-body { min-width: 0; flex: 1; }
.check-body strong { font-size: 14px; font-weight: 600; }
.check-item.done .check-body strong { color: var(--muted); }
.check-item.skipped .check-body strong { color: var(--subtle); text-decoration: line-through; }
.check-body > small { display: block; margin-top: 3px; color: var(--muted); font-size: 12.5px; }
.check-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.check-meta:empty { display: none; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--line-soft); color: var(--muted); font-size: 11.5px; font-weight: 600; }
.tag .icon { width: 12px; height: 12px; stroke-width: 2.6; }
.tag-auto { background: var(--sky-bg); color: #24557d; }
.tag-done { background: var(--green-100); color: var(--green-700); }
.tag-hint { background: var(--gold-100); color: #7d5a20; }
.tag-late { background: var(--rose-bg); color: var(--rose); }
.check-note { margin: 6px 0 0; padding: 8px 10px; border-left: 3px solid var(--gold-300); border-radius: 0 8px 8px 0; background: var(--surface-2); color: var(--ink-2); font-size: 12.5px; }
.check-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.muted-link { color: var(--muted); }
.check-actions .icon-button { width: 30px; height: 30px; }
.add-item { display: grid; grid-template-columns: minmax(0, 1fr) 150px auto; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }

.session-list { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.session { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--surface-2); }
.session.cancelled { opacity: .6; }
.session-date { width: 48px; flex: none; display: flex; flex-direction: column; align-items: center; padding: 6px 0; border-radius: 11px; background: linear-gradient(145deg, var(--green-700), var(--green-900)); color: #fff; }
.session.done .session-date { background: linear-gradient(145deg, var(--green-500), var(--green-700)); }
.session-date b { font: 700 18px/1 var(--font-display); }
.session-date small { color: var(--gold-300); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.session-body { min-width: 0; flex: 1; }
.session-body strong { display: block; font-size: 13.5px; }
.session-body small { display: block; color: var(--muted); font-size: 12px; }
.session-body .text-link { margin-top: 4px; font-size: 12.5px; }
.session-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.signal-list { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.signal-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--muted); }
.signal-list li b { color: var(--ink-2); }
.signal-list li.on { background: var(--green-50); color: var(--green-700); }
.signal-list li.on b { color: var(--green-700); }
.signal-list li::before { content: ""; width: 8px; height: 8px; margin: 6px -2px 0 0; border-radius: 50%; background: var(--line); }
.signal-list li.on::before { background: var(--green-500); }
.signal-list li span { flex: 1; }
.onb-notes { margin: 0; color: var(--ink-2); font-size: 13.5px; white-space: pre-line; }

@media (max-width: 1180px) { .stepper { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 14px; } .step-item::after { display: none; } }
@media (max-width: 640px) {
    .stepper { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stage-head { flex-wrap: wrap; }
    .stage-progress { width: 100%; }
    .add-item { grid-template-columns: minmax(0, 1fr); }
}

.onboarding-link { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.onboarding-link:hover { border-color: rgb(197 150 74 / 55%); }
.onboarding-link-body { min-width: 0; flex: 1; }
.onboarding-link-body strong { display: block; font: 600 15px var(--font-display); }
.onboarding-link-body small { color: var(--muted); font-size: 12.5px; }
.onboarding-link > .icon { color: var(--subtle); }

/* ---------- Support desk ---------- */

.hero-stats strong.hot { color: #ffb3bb; }
.filter-pills a.hot:not(.active) { border-color: #f0c5ca; color: var(--rose); }
.filter-pills a.hot:not(.active) span { background: var(--rose-bg); color: var(--rose); }

.prio-urgent { --prio: #c0392b; --prio-bg: #fde8e6; }
.prio-high { --prio: #d9822b; --prio-bg: #fdf0e1; }
.prio-normal { --prio: var(--sky); --prio-bg: var(--sky-bg); }
.prio-low { --prio: var(--subtle); --prio-bg: var(--line-soft); }
.ticket-prio { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--prio-bg); color: var(--prio); font-size: 12px; font-weight: 700; white-space: nowrap; }
.ticket-prio i { width: 8px; height: 8px; border-radius: 50%; background: var(--prio); }
.prio-urgent .ticket-prio i { box-shadow: 0 0 0 3px rgb(192 57 43 / 20%); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgb(192 57 43 / 5%); } }

.ticket-list { display: flex; flex-direction: column; gap: 8px; }
.ticket-row { position: relative; display: grid; grid-template-columns: 96px minmax(0, 1fr) 170px 40px 150px; align-items: center; gap: 16px; padding: 14px 18px 14px 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: inherit; text-decoration: none; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s, border-color .15s; }
.ticket-row::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--prio); }
.ticket-row:hover { transform: translateY(-1px); border-color: rgb(197 150 74 / 45%); box-shadow: var(--shadow); }
.ticket-row.closed { opacity: .72; }
.ticket-row > .badge { justify-self: end; }
.ticket-main { min-width: 0; }
.ticket-subject { display: block; overflow: hidden; color: var(--ink); font: 600 15px var(--font-display); text-overflow: ellipsis; white-space: nowrap; }
.ticket-subject b { margin-right: 8px; color: var(--muted); font-weight: 600; }
.ticket-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; color: var(--muted); font-size: 12.5px; }
.ticket-meta span { display: inline-flex; align-items: center; gap: 4px; }
.ticket-meta .icon { width: 13px; height: 13px; color: var(--subtle); }
.ticket-sla { display: flex; align-items: center; gap: 8px; color: var(--green-700); font-size: 12.5px; }
.ticket-sla .icon { width: 17px; height: 17px; flex: none; }
.ticket-sla b { display: block; font-weight: 700; }
.ticket-sla small { color: var(--muted); font-size: 11.5px; }
.ticket-sla.soon { color: var(--gold-600); }
.ticket-sla.late { color: var(--rose); }
.avatar.unassigned { border: 1.5px dashed var(--subtle); background: transparent; color: var(--subtle); }

.ticket-head { position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; padding: 22px 24px 22px 28px; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: radial-gradient(80% 140% at 100% 0%, var(--prio-bg), transparent 60%), #fff; box-shadow: var(--shadow); }
.ticket-head::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--prio); }
.ticket-head-main { min-width: 0; }
.ticket-head-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ticket-number { color: var(--muted); font: 700 14px var(--font-display); }
.ticket-head h1 { margin: 10px 0 8px; font-size: 26px; font-weight: 600; letter-spacing: -.5px; }
.ticket-head .company-meta a { display: inline-flex; align-items: center; gap: 5px; color: var(--green-700); font-weight: 600; text-decoration: none; }
.rating { display: block; margin-top: 4px; color: var(--gold-600); letter-spacing: 2px; }

.conversation { padding: 22px; }
.thread { display: flex; flex-direction: column; gap: 16px; margin: 0 0 20px; padding: 0; list-style: none; }
.msg { display: flex; align-items: flex-start; gap: 12px; scroll-margin-top: 90px; }
.msg.staff { flex-direction: row-reverse; }
.msg-bubble { max-width: min(78%, 640px); padding: 12px 16px; border: 1px solid var(--line); border-radius: 4px 16px 16px 16px; background: var(--surface-2); }
.msg.staff .msg-bubble { border-color: #cfe0d4; border-radius: 16px 4px 16px 16px; background: var(--green-50); }
.msg.internal .msg-bubble { border: 1.5px dashed #e3c98d; background: #fffaf0; }
.msg-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.msg-head strong { font-size: 13.5px; }
.msg-head time { margin-left: auto; color: var(--subtle); font-size: 12px; }
.msg-body { color: var(--ink-2); font-size: 14px; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.msg-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.file-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 260px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink-2); font-size: 12.5px; text-decoration: none; }
.file-chip:hover { border-color: var(--gold-500); }
.file-chip .icon { width: 16px; height: 16px; flex: none; color: var(--gold-600); }
.file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.file-chip small { flex: none; color: var(--subtle); }
.thread-system { align-self: center; scroll-margin-top: 90px; }
.thread-system span { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--line-soft); color: var(--muted); font-size: 12px; }

.composer { padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); }
.composer.internal-mode { border-color: #e3c98d; background: #fffaf0; }
.composer textarea { margin: 10px 0; min-height: 110px; }
.composer-tabs { display: flex; gap: 6px; }
.composer-tabs label { cursor: pointer; }
.composer-tabs input { position: absolute; opacity: 0; pointer-events: none; }
.composer-tabs span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 9px; color: var(--muted); font-size: 13px; font-weight: 600; }
.composer-tabs .icon { width: 15px; height: 15px; }
.composer-tabs input:checked + span { background: var(--green-800); color: #fff; }
.composer-tabs label:nth-child(2) input:checked + span { background: var(--gold-500); color: var(--green-950); }
.composer-tabs input:focus-visible + span { box-shadow: var(--ring); }
.composer-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.composer-foot select { width: auto; flex: 1; min-width: 200px; }
.file-pick { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1.5px dashed var(--line); border-radius: 10px; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.file-pick:hover { border-color: var(--gold-500); color: var(--ink); }
.file-pick .icon { width: 16px; height: 16px; color: var(--gold-600); }
.file-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.composer .hint { margin-top: 8px; }

.sla-item { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 12px; border: 1px solid var(--line-soft); border-radius: 13px; background: var(--surface-2); }
.sla-item > div { min-width: 0; flex: 1; }
.sla-item strong { display: block; font-size: 13.5px; }
.sla-item small { color: var(--muted); font-size: 12px; }
.sla-item b { color: var(--green-700); font-size: 12.5px; text-align: right; }
.sla-icon { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 11px; background: var(--green-100); color: var(--green-700); }
.sla-icon .icon { width: 17px; height: 17px; }
.sla-item.soon b { color: var(--gold-600); }
.sla-item.soon .sla-icon { background: var(--gold-100); color: var(--gold-600); }
.sla-item.late { border-color: #f0c5ca; background: var(--rose-bg); }
.sla-item.late b { color: var(--rose); }
.sla-item.late .sla-icon { background: #f7d4d8; color: var(--rose); }
.sla-item.ok b { color: var(--green-600); }

.prio-picker { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.prio-option { cursor: pointer; }
.prio-option input { position: absolute; opacity: 0; pointer-events: none; }
.prio-option > span { display: flex; flex-direction: column; gap: 3px; height: 100%; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 12px; transition: border-color .15s, background-color .15s; }
.prio-option i { width: 10px; height: 10px; border-radius: 50%; background: var(--prio); }
.prio-option strong { font-size: 13.5px; }
.prio-option small { color: var(--muted); font-size: 11.5px; }
.prio-option input:checked + span { border-color: var(--prio); background: var(--prio-bg); }
.prio-option input:focus-visible + span { box-shadow: var(--ring); }

@media (max-width: 1180px) {
    .ticket-row { grid-template-columns: 90px minmax(0, 1fr) auto; }
    .ticket-sla { grid-column: 2; }
    .ticket-assignee { display: none; }
}
@media (max-width: 640px) {
    .ticket-row { grid-template-columns: minmax(0, 1fr) auto; }
    .ticket-prio { grid-column: 1 / -1; justify-self: start; }
    .msg-bubble { max-width: 100%; }
    .prio-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ticket-head { flex-direction: column; }
}

/* ---------- Company form ---------- */

.company-form { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 22px; align-items: start; }
.company-form-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.company-form-main .form-section + .form-section { margin-top: 0; }
.company-form .form-section { scroll-margin-top: 84px; }
.company-form .step { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(145deg, var(--green-700), var(--green-900)); }
.company-form .step .icon { width: 18px; height: 18px; color: var(--gold-300); }
.company-form-aside { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 16px; }
.form-outline { display: flex; flex-direction: column; gap: 2px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); }
.form-outline strong { margin: 0 6px 6px; color: var(--muted); font-size: 11.5px; letter-spacing: .6px; text-transform: uppercase; }
.form-outline a { display: flex; align-items: center; gap: 9px; padding: 8px 8px; border-radius: 9px; color: var(--ink-2); font-size: 13.5px; font-weight: 500; text-decoration: none; }
.form-outline a .icon { width: 16px; height: 16px; color: var(--subtle); }
.form-outline a:hover { background: var(--surface-2); }
.form-outline a.current { background: var(--green-50); color: var(--green-800); font-weight: 600; }
.form-outline a.current .icon { color: var(--green-600); }
.outline-dot { width: 8px; height: 8px; margin-left: auto; border-radius: 50%; background: var(--line); }
.form-outline a.filled .outline-dot { background: var(--green-500); }
.sticky-actions { position: sticky; bottom: 0; z-index: 5; margin: 0; padding: 14px 18px; border: 1px solid var(--line); border-radius: 16px; background: rgb(255 255 255 / 92%); backdrop-filter: blur(8px); box-shadow: 0 -6px 20px rgb(23 35 28 / 6%); }
.field-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.input-wrap .suffix { position: absolute; right: 1.5px; top: 1.5px; bottom: 1.5px; display: grid; place-items: center; padding: 0 12px; border-left: 1px solid var(--line); border-radius: 0 9px 9px 0; background: var(--surface-2); color: var(--muted); font-weight: 600; }

.seg-choice { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.seg-choice label { cursor: pointer; }
.seg-choice input { position: absolute; opacity: 0; pointer-events: none; }
.seg-choice span { display: block; padding: 7px 12px; border-radius: 9px; color: var(--muted); font-size: 13px; font-weight: 600; }
.seg-choice input:checked + span { background: #fff; color: var(--green-800); box-shadow: var(--shadow-sm); }
.seg-choice input:focus-visible + span { box-shadow: var(--ring); }

.toggle-row { display: flex; align-items: flex-start; gap: 12px; margin-top: 18px; padding: 14px; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--surface-2); cursor: pointer; }
.toggle-row input[type=checkbox] { position: absolute; opacity: 0; pointer-events: none; }
.toggle { position: relative; width: 40px; height: 23px; flex: none; margin-top: 1px; border-radius: 999px; background: #cfd6d0; transition: background-color .15s; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 20%); transition: transform .15s; }
.toggle-row input:checked + input + .toggle, .toggle-row input:checked + .toggle { background: var(--green-600); }
.toggle-row input:checked + input + .toggle::after, .toggle-row input:checked + .toggle::after { transform: translateX(17px); }
.toggle-row input:focus-visible ~ .toggle { box-shadow: var(--ring); }
.toggle-row strong { display: block; font-size: 13.5px; }
.toggle-row small { color: var(--muted); font-size: 12.5px; }

.plan-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 16px; }
.plan-choice { cursor: pointer; }
.plan-choice input { position: absolute; opacity: 0; pointer-events: none; }
.plan-choice > span { position: relative; display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 16px 14px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; transition: border-color .15s, box-shadow .15s, background-color .15s; }
.plan-choice em { position: absolute; top: -9px; left: 12px; padding: 2px 8px; border-radius: 999px; background: linear-gradient(135deg, var(--gold-300), var(--gold-500)); color: var(--green-950); font-size: 10.5px; font-style: normal; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.plan-choice strong { font: 600 15px var(--font-display); }
.plan-choice b { font: 600 17px var(--font-display); color: var(--green-700); }
.plan-choice b small { color: var(--muted); font: 500 12px var(--font-body); }
.plan-choice > span > small { color: var(--muted); font-size: 12px; }
.plan-choice input:checked + span { border-color: var(--green-600); background: var(--green-50); box-shadow: 0 0 0 3px rgb(31 127 79 / 12%); }
.plan-choice input:focus-visible + span { box-shadow: var(--ring); }

/* Company page: profile panel */
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; margin: 0; }
.profile-grid div { min-width: 0; }
.profile-grid dt { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; }
.profile-grid dt .icon { width: 13px; height: 13px; color: var(--gold-600); }
.profile-grid dd { margin: 3px 0 0; color: var(--ink); font-size: 13.5px; font-weight: 500; overflow-wrap: anywhere; }
.profile-grid dd a { color: var(--green-700); text-decoration: none; }
.profile-grid dd.empty { color: var(--subtle); font-weight: 400; }

@media (max-width: 1180px) {
    .company-form { grid-template-columns: minmax(0, 1fr); }
    .company-form-aside { position: static; order: -1; }
    .form-outline { flex-direction: row; flex-wrap: wrap; }
    .form-outline strong { width: 100%; }
}
@media (max-width: 640px) { .field-grid.three, .profile-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Team ---------- */

.role-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.role-card { padding: 18px 20px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
.role-card.tone-gold { background: radial-gradient(90% 120% at 100% 0%, var(--gold-100), transparent 60%), #fff; }
.role-card.tone-sky { background: radial-gradient(90% 120% at 100% 0%, var(--sky-bg), transparent 60%), #fff; }
.role-card.tone-green { background: radial-gradient(90% 120% at 100% 0%, var(--green-100), transparent 60%), #fff; }
.role-card header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.role-card strong { display: block; font: 600 16px var(--font-display); }
.role-card small { color: var(--muted); font-size: 12.5px; }
.role-card ul { display: flex; flex-direction: column; gap: 7px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--ink-2); }
.role-card li { display: flex; align-items: center; gap: 8px; }
.role-card li .icon { width: 15px; height: 15px; padding: 2px; border-radius: 50%; background: var(--tone-bg); color: var(--tone); stroke-width: 2.6; }

.member-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.person-card { position: relative; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
.person-card:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgb(23 35 28 / 5%), 0 18px 36px rgb(23 35 28 / 9%); }
.person-card.off { opacity: .65; }
.person-card.you { border-color: rgb(197 150 74 / 60%); }
.person-top { position: relative; height: 74px; background: linear-gradient(120deg, var(--green-800), var(--green-600)); }
.person-top.role-administrator { background: radial-gradient(80% 160% at 100% 0%, rgb(226 196 140 / 45%), transparent 60%), linear-gradient(120deg, var(--green-900), var(--green-700)); }
.person-top.role-billing { background: linear-gradient(120deg, #1f4f75, #3d7aa8); }
.person-top.role-support { background: linear-gradient(120deg, var(--green-700), var(--green-500)); }
.person-avatar { position: absolute; left: 20px; bottom: -28px; width: 60px; height: 60px; display: grid; place-items: center; border: 4px solid #fff; border-radius: 18px; background: linear-gradient(145deg, var(--gold-300), var(--gold-500)); color: var(--green-950); font: 700 19px var(--font-display); box-shadow: 0 6px 16px rgb(23 35 28 / 15%); }
.person-avatar i { position: absolute; right: -4px; bottom: -4px; width: 14px; height: 14px; border: 3px solid #fff; border-radius: 50%; background: #2ecc71; }
.you-tag { position: absolute; top: 12px; right: 12px; padding: 3px 10px; border-radius: 999px; background: rgb(255 255 255 / 18%); color: #fff; font-size: 11.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; backdrop-filter: blur(4px); }
.person-body { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 38px 20px 12px; }
.person-body strong { font: 600 16.5px var(--font-display); letter-spacing: -.2px; }
.person-email { max-width: 100%; overflow: hidden; color: var(--muted); font-size: 12.5px; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.person-email:hover { color: var(--green-700); }
.person-body .badge { margin-top: 6px; }
.person-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 20px 14px; }
.person-facts div { padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.person-facts dt { color: var(--subtle); font-size: 10.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.person-facts dd { margin: 2px 0 0; font-size: 12.5px; font-weight: 600; }
.person-card footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding: 12px 16px 14px 20px; border-top: 1px solid var(--line-soft); }
.person-state { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; }
.person-state .icon { width: 14px; height: 14px; }
.person-state.ok { color: var(--green-600); }
.person-state.warn { color: var(--gold-600); }
.person-state.off { color: var(--subtle); }
.person-card.add { align-items: center; justify-content: center; gap: 8px; min-height: 280px; padding: 20px; border: 2px dashed rgb(197 150 74 / 45%); background: linear-gradient(160deg, #fffdf8, var(--gold-100)); box-shadow: none; color: inherit; text-align: center; text-decoration: none; }
.person-card.add strong { font: 600 16px var(--font-display); }
.person-card.add small { max-width: 200px; color: var(--muted); font-size: 13px; }

/* ---------- Audit log ---------- */

.audit-type { width: auto; min-width: 210px; height: 46px; border-radius: 14px; }
.audit-groups { margin: -4px 0 20px; }
.audit-days { display: flex; flex-direction: column; gap: 18px; }
.audit-day { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
.audit-day > header { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; border-bottom: 1px solid var(--line-soft); background: rgb(250 249 245 / 95%); backdrop-filter: blur(6px); }
.audit-day > header span { font: 600 14px var(--font-display); }
.audit-day > header small { color: var(--muted); font-size: 12px; }
.audit-feed { margin: 0; padding: 6px 20px; list-style: none; }
.audit-item { position: relative; display: flex; align-items: flex-start; gap: 14px; padding: 12px 0; }
.audit-item + .audit-item { border-top: 1px solid var(--line-soft); }
.audit-icon { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 11px; background: var(--t-bg); color: var(--t); }
.audit-icon .icon { width: 17px; height: 17px; }
.t-gold { --t: var(--gold-600); }
.t-green { --t: var(--green-600); }
.t-sky { --t: var(--sky); }
.audit-body { min-width: 0; flex: 1; }
.audit-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.audit-line strong { font-size: 13.5px; font-weight: 600; }
.audit-target { overflow: hidden; color: var(--green-700); font-size: 13.5px; font-weight: 500; text-decoration: none; text-overflow: ellipsis; }
.audit-target:hover { text-decoration: underline; }
.audit-target.plain { color: var(--ink-2); }
.audit-body p { margin: 3px 0 0; color: var(--ink-2); font-size: 13px; overflow-wrap: anywhere; }
.audit-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 6px; color: var(--muted); font-size: 12px; }
.avatar-xs { width: 20px; height: 20px; font-size: 9px; }
.audit-ip { display: inline-flex; align-items: center; gap: 4px; color: var(--subtle); }
.audit-ip .icon { width: 12px; height: 12px; }
.audit-item time { flex: none; padding-top: 2px; color: var(--subtle); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.audit-item.t-rose .audit-line strong { color: var(--rose); }

@media (max-width: 1180px) { .role-cards { grid-template-columns: minmax(0, 1fr); } }

.catalogue-body { display: flex; gap: 12px; margin-bottom: 14px; }
.catalogue-icon { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--gold-100); color: var(--gold-600); }
.catalogue-body p { margin: 0; color: var(--ink-2); font-size: 13px; }
.catalogue-body p strong { display: block; margin-bottom: 2px; color: var(--ink); font-size: 13.5px; }
.catalogue-toggle b { color: var(--ink); }

/* ---------- Templates ---------- */

.sync-bar { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; padding: 16px 20px; border: 1px solid #c9e0cf; border-radius: 18px; background: linear-gradient(110deg, var(--green-50), #fff); box-shadow: var(--shadow-sm); }
.sync-bar > div { min-width: 0; flex: 1; }
.sync-bar strong { display: block; font-size: 14px; }
.sync-bar > div > span { color: var(--ink-2); font-size: 13px; }
.sync-bar small { display: block; margin-top: 4px; color: var(--muted); font-size: 12.5px; }
.sync-bar small b { color: var(--green-700); }
.sync-bar small b.pending { color: var(--sky); }
.sync-bar .failed { color: var(--rose); }
.sync-icon { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 13px; background: var(--green-600); color: #fff; }
.sync-bar form { flex: none; }

.place-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.place-card { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s; }
.place-card:hover { border-color: rgb(197 150 74 / 50%); box-shadow: var(--shadow); }
.place-card.off { opacity: .6; }
.place-icon { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--green-100); color: var(--green-700); }
.kind-airport .place-icon, .kind-airstrip .place-icon { background: var(--sky-bg); color: var(--sky); }
.kind-beach .place-icon, .kind-lake .place-icon { background: #e2f4f1; color: #1d6f65; }
.kind-border .place-icon { background: var(--rose-bg); color: var(--rose); }
.kind-park .place-icon, .kind-landmark .place-icon { background: var(--gold-100); color: var(--gold-600); }
.place-body { min-width: 0; flex: 1; }
.place-body strong { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.place-body small { display: block; color: var(--muted); font-size: 12.5px; }
.place-aliases { display: block; margin-top: 3px; overflow: hidden; color: var(--subtle); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.place-coords { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; color: var(--green-700); font-size: 12px; font-variant-numeric: tabular-nums; text-decoration: none; }
.place-coords .icon { width: 13px; height: 13px; }
.place-coords:hover { text-decoration: underline; }
.place-card .icon-button { width: 32px; height: 32px; }
.map-preview { margin-top: 16px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; }
.map-preview iframe { display: block; width: 100%; height: 280px; border: 0; }

.tone-plum { --tone: #6b4f8a; --tone-bg: #efe8f6; }
.coa-overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.coa-type { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-items: center; gap: 2px 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: radial-gradient(120% 140% at 100% 0%, var(--tone-bg), transparent 55%), #fff; box-shadow: var(--shadow-sm); color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s, border-color .15s; }
.coa-type:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--tone) 40%, transparent); box-shadow: var(--shadow); }
.coa-type .metric-icon { grid-row: 1 / 3; width: 40px; height: 40px; border-radius: 12px; }
.coa-type-label { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.coa-type strong { grid-column: 2; font: 600 24px/1.1 var(--font-display); }
.coa-type small { grid-column: 1 / -1; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); color: var(--subtle); font-size: 12px; font-variant-numeric: tabular-nums; }

.coa-toolbar { position: sticky; top: 64px; z-index: 5; padding: 10px; margin-left: -10px; margin-right: -10px; border-radius: 18px; background: rgb(255 255 255 / 0%); transition: background .2s, box-shadow .2s; }
.coa-toolbar.stuck { background: rgb(255 255 255 / 92%); box-shadow: var(--shadow); backdrop-filter: blur(8px); }
.coa-fold { display: flex; gap: 14px; margin-left: auto; }
.coa-fold .link-button { display: inline-flex; align-items: center; gap: 4px; }
.coa-fold .icon { width: 14px; height: 14px; }

.coa-section { margin-bottom: 16px; padding: 0; overflow: hidden; scroll-margin-top: 140px; }
.coa-section[hidden] { display: none; }
.coa-head { display: flex; align-items: center; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--line-soft); background: linear-gradient(90deg, var(--tone-bg), transparent 75%); }
.coa-head .metric-icon { width: 40px; height: 40px; border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); }
.coa-head h2 { margin: 0; font-size: 17px; font-weight: 600; }
.coa-head p { margin: 1px 0 0; color: var(--muted); font-size: 12.5px; }
.coa-head small { margin-left: auto; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.coa-tree { margin: 0; padding: 6px 0; list-style: none; }
.coa-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 180px 72px; align-items: center; gap: 12px; min-height: 46px; padding: 6px 22px; }
.coa-row[hidden] { display: none; }
.coa-row + .coa-row { border-top: 1px solid var(--line-soft); }
.coa-row:hover { background: var(--surface-2); }
.coa-row.header { background: linear-gradient(90deg, color-mix(in srgb, var(--tone-bg) 45%, transparent), transparent 60%); }
.coa-row.header + .coa-row:not(.header) { border-top-color: transparent; }
.coa-row.off { opacity: .55; }
/* One faint guide line per level, then the account itself. */
.coa-name { display: flex; align-items: flex-start; gap: 10px; min-width: 0; padding-left: calc(var(--depth) * 26px); background: repeating-linear-gradient(90deg, transparent 0 11px, var(--line) 11px 12px, transparent 12px 26px) left / calc(var(--depth) * 26px) 100% no-repeat; margin: -6px 0; padding-top: 8px; padding-bottom: 8px; }
.coa-toggle { display: grid; place-items: center; flex: none; width: 24px; height: 24px; margin-top: -1px; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--tone); cursor: pointer; transition: transform .15s, border-color .15s; }
.coa-toggle:hover { border-color: var(--tone); }
.coa-toggle .icon { width: 14px; height: 14px; stroke-width: 2.4; transition: transform .15s; }
.coa-toggle[aria-expanded="false"] .icon { transform: rotate(-90deg); }
.coa-dot { flex: none; width: 24px; height: 22px; background: radial-gradient(circle, var(--line) 0 3px, transparent 3.5px); }
.coa-code { flex: none; min-width: 48px; padding: 2px 8px; border-radius: 7px; background: var(--surface-2); color: var(--ink-2); font: 600 12.5px/18px var(--font-display); font-variant-numeric: tabular-nums; text-align: center; }
.coa-row.header .coa-code { background: var(--tone-bg); color: var(--tone); }
.coa-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; padding-top: 1px; }
.coa-title strong { font-size: 13.5px; font-weight: 500; }
.coa-row.header .coa-title strong { font-weight: 700; }
.coa-count { padding: 0 7px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 700; line-height: 17px; }
.coa-title small { flex-basis: 100%; color: var(--subtle); font-size: 12px; line-height: 1.45; }
.coa-title mark { padding: 0 1px; border-radius: 3px; background: var(--gold-100); color: inherit; }
.coa-cat { justify-self: start; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; white-space: nowrap; }
.coa-actions { display: flex; justify-content: flex-end; gap: 2px; opacity: 0; transition: opacity .15s; }
.coa-row:hover .coa-actions, .coa-row:focus-within .coa-actions { opacity: 1; }
@media (hover: none) { .coa-actions { opacity: 1; } }
.coa-actions .icon-button { width: 30px; height: 30px; }
.coa-none { padding: 18px 22px; color: var(--subtle); font-size: 13px; }
.coa-legend { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.coa-legend span { display: inline-flex; align-items: center; gap: 6px; }
.coa-legend .icon { width: 14px; height: 14px; color: var(--gold-600); }

@media (max-width: 640px) {
    .sync-bar { flex-wrap: wrap; }
    .coa-row { grid-template-columns: minmax(0, 1fr) auto; padding: 6px 14px; }
    .coa-cat { display: none; }
    .coa-name { padding-left: calc(var(--depth) * 14px); background-size: calc(var(--depth) * 14px) 100%; background-image: repeating-linear-gradient(90deg, transparent 0 6px, var(--line) 6px 7px, transparent 7px 14px); }
    .coa-head small { display: none; }
    .coa-fold { margin-left: 0; }
}

/* ---------- Hotel templates ---------- */

.hotel-toolbar { flex-wrap: wrap; }
.area-select { width: auto; min-width: 180px; }
.result-count { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.hotel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.hotel-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s, border-color .15s; }
a.hotel-card[href]:hover { transform: translateY(-2px); border-color: rgb(197 150 74 / 50%); box-shadow: var(--shadow); }
.hotel-card.off { opacity: .6; }
.hotel-cover { position: relative; aspect-ratio: 16 / 10; background: linear-gradient(135deg, var(--green-50), var(--sand-bg, #f4ece0)); }
.hotel-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hotel-nophoto { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; color: var(--subtle); font-size: 12.5px; }
.hotel-nophoto .icon { width: 28px; height: 28px; }
.hotel-type { position: absolute; left: 10px; top: 10px; display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px; background: rgb(3 35 26 / 72%); color: #fff; font-size: 11.5px; font-weight: 600; backdrop-filter: blur(4px); }
.hotel-type .icon { width: 13px; height: 13px; }
.hotel-off { position: absolute; right: 10px; top: 10px; padding: 4px 9px; border-radius: 999px; background: #fff; color: var(--muted); font-size: 11.5px; font-weight: 700; }
.hotel-body { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px 14px; }
.hotel-body strong { font-size: 14.5px; line-height: 1.3; }
.hotel-stars { color: var(--gold-500); font-size: 12px; letter-spacing: 1px; }
.hotel-body small { overflow: hidden; color: var(--muted); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.hotel-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; color: var(--muted); font-size: 12px; }
.hotel-meta span { display: inline-flex; align-items: center; gap: 4px; }
.hotel-meta .icon { width: 13px; height: 13px; }
.hotel-meta .warn { color: var(--gold-600); }

.pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px; margin-top: 24px; }
.pager a, .pager span { display: inline-flex; align-items: center; gap: 4px; min-width: 38px; height: 38px; justify-content: center; padding: 0 10px; border-radius: 10px; color: var(--ink-2); font-size: 13.5px; font-weight: 600; text-decoration: none; }
.pager a { border: 1px solid var(--line); background: #fff; }
.pager a:hover { border-color: var(--gold-300); }
.pager a.active { border-color: var(--green-700); background: var(--green-700); color: #fff; }
.pager .icon { width: 14px; height: 14px; }

.star-choice { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.star-choice input { position: absolute; opacity: 0; pointer-events: none; }
.star-choice span { display: block; padding: 6px 10px; border-radius: 9px; color: var(--subtle); font-size: 13px; font-weight: 600; cursor: pointer; }
.star-choice input:checked + span { background: #fff; color: var(--gold-600); box-shadow: var(--shadow-sm); }
.star-choice input:focus-visible + span { box-shadow: var(--ring); }
.meal-choice { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 8px; }
.meal-choice input { position: absolute; opacity: 0; pointer-events: none; }
.meal-choice span { display: flex; flex-direction: column; gap: 1px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--muted); font-size: 12.5px; cursor: pointer; transition: border-color .15s, background .15s; }
.meal-choice b { color: var(--ink); font: 600 15px var(--font-display); }
.meal-choice input:checked + span { border-color: var(--green-600); background: var(--green-50); color: var(--green-700); box-shadow: inset 0 0 0 1px var(--green-600); }
.meal-choice input:focus-visible + span { box-shadow: var(--ring); }

.room-editor { display: grid; gap: 8px; }
.room-head, .room-row { display: grid; grid-template-columns: minmax(140px, 2fr) repeat(5, minmax(56px, .6fr)) minmax(110px, 1.3fr) 74px 36px; align-items: center; gap: 8px; }
.room-head span { color: var(--muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.room-row .input { min-width: 0; padding-left: 10px; padding-right: 8px; }
.room-single { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 13px; cursor: pointer; }
.room-add { justify-self: start; margin-top: 4px; }

.photo-panel { margin-top: 24px; scroll-margin-top: 80px; transition: box-shadow .15s, border-color .15s; }
.photo-panel.dragging { border-color: var(--green-600); box-shadow: 0 0 0 4px rgb(19 101 61 / 15%); }
.photo-panel.uploading { opacity: .7; pointer-events: none; }
.photo-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.photo-head h2 { margin: 0; font-size: 18px; }
.photo-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.photo-upload label { cursor: pointer; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.photo-tile { position: relative; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.photo-tile.cover { border-color: var(--gold-500); box-shadow: 0 0 0 2px rgb(197 150 74 / 30%); }
.photo-tile img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.photo-cover-badge { position: absolute; left: 8px; top: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; background: var(--gold-500); color: #fff; font-size: 11.5px; font-weight: 700; }
.photo-cover-badge .icon { width: 12px; height: 12px; }
.photo-tile figcaption { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 8px 6px 10px; color: var(--muted); font-size: 11.5px; }
.photo-actions { display: inline-flex; align-items: center; gap: 4px; }
.photo-actions .icon-button { width: 30px; height: 30px; }
.photo-drop { display: grid; justify-items: center; gap: 6px; padding: 36px 16px; border: 2px dashed var(--line); border-radius: 16px; background: var(--surface-2); color: var(--muted); font-size: 13px; text-align: center; cursor: pointer; }
.photo-drop:hover { border-color: var(--gold-300); }
.photo-drop .icon { width: 30px; height: 30px; color: var(--gold-500); }
.photo-drop strong { color: var(--ink); font-size: 14.5px; }

@media (max-width: 900px) {
    .room-head { display: none; }
    .room-row { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 12px; border: 1px solid var(--line-soft); border-radius: 12px; }
    .room-row > :first-child { grid-column: 1 / -1; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1180px) {
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .content-grid, .form-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
    .main-shell { margin-left: 0; }
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
    .menu-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
    .icon-button.mobile-menu { display: inline-grid; }
    .topbar { padding: 0 16px; }
    .main-content { padding: 24px 16px 32px; }
    .app-footer { padding: 16px; }
    .auth-page { grid-template-columns: minmax(0, 1fr); }
    .auth-story { min-height: 260px; }
    .auth-copy p, .auth-points { display: none; }
}
@media (max-width: 640px) {
    .metric-grid, .field-grid, .usage-grid { grid-template-columns: minmax(0, 1fr); }
    .usage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .page-heading { flex-direction: column; align-items: stretch; }
    .page-heading h1 { font-size: 25px; }
    .env-chip { display: none; }
    .toolbar { align-items: stretch; flex-direction: column; }
    .search-box { width: 100%; }
    .app-footer { flex-direction: column; }
}
