:root
{
    --bg: #0e0b12;
    --bg-sunk: #09070c;
    --surface: #16121b;
    --surface-2: #1d1823;
    --surface-3: #26202d;
    --border: #2a2332;
    --border-strong: #3a3144;
    --text: #ece6f2;
    --text-2: #b9afc4;
    --muted: #8a7f97;
    --accent: #c44bea;
    --accent-hover: #d36ff0;
    --accent-soft: rgba(196, 75, 234, 0.14);
    --on-accent: #ffffff;
    --primary-bg: #8902b4;
    --primary-fg: #ffffff;
    --primary-hover: #9d14c9;
    --success: #5bb974;
    --success-soft: rgba(91, 185, 116, 0.12);
    --warning: #d9a441;
    --warning-soft: rgba(217, 164, 65, 0.13);
    --danger: #e5625a;
    --danger-soft: rgba(229, 98, 90, 0.12);
    --info: #6ea8dc;
    --info-soft: rgba(110, 168, 220, 0.12);
    --chart: #3e3448;
    --chart-hi: #c44bea;
    --scrim: rgba(6, 4, 9, 0.66);
    --shadow: 0 12px 28px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.35);
    --r-sm: 4px;
    --r: 6px;
    --r-lg: 8px;
    --sidebar-width: 236px;
    --font: "IBM Plex Sans", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    color-scheme: dark;
}

[data-theme="light"]
{
    --bg: #f7f5f9;
    --bg-sunk: #f0edf4;
    --surface: #ffffff;
    --surface-2: #faf8fc;
    --surface-3: #f0ecf4;
    --border: #e6e0ec;
    --border-strong: #d6cde0;
    --text: #1a1420;
    --text-2: #433a4d;
    --muted: #6c627a;
    --accent: #8a12b8;
    --accent-hover: #74019a;
    --accent-soft: rgba(137, 2, 180, 0.08);
    --on-accent: #ffffff;
    --primary-bg: #8902b4;
    --primary-fg: #ffffff;
    --primary-hover: #74019a;
    --success: #2f7d47;
    --success-soft: rgba(47, 125, 71, 0.1);
    --warning: #8e6b12;
    --warning-soft: rgba(178, 134, 22, 0.12);
    --danger: #c23b34;
    --danger-soft: rgba(194, 59, 52, 0.09);
    --info: #2f6da8;
    --info-soft: rgba(47, 109, 168, 0.09);
    --chart: #d9cfe3;
    --chart-hi: #8902b4;
    --scrim: rgba(26, 20, 32, 0.38);
    --shadow: 0 12px 28px rgba(40, 20, 50, 0.14), 0 2px 6px rgba(40, 20, 50, 0.08);
    color-scheme: light;
}

*
{
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body
{
    min-height: 100%;
}

body
{
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    font-variant-numeric: tabular-nums;
}

a
{
    color: inherit;
    text-decoration: none;
}

p a,
.link,
.auth-foot a,
.hint a,
.muted a
{
    color: var(--accent);
}

p a:hover,
.link:hover,
.auth-foot a:hover
{
    text-decoration: underline;
    text-underline-offset: 3px;
}

::selection
{
    background: var(--accent-soft);
    color: var(--text);
}

input,
select,
textarea,
button
{
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

:focus-visible
{
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

h1, h2, h3, h4
{
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.005em;
}

code,
.mono,
kbd
{
    font-family: var(--mono);
    font-size: 0.92em;
}

code
{
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 1px 5px;
}

hr
{
    border: none;
    border-top: 1px solid var(--border);
}

.app-shell
{
    display: flex;
    min-height: 100vh;
}

.sidebar
{
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--bg-sunk);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
}

.sidebar__brand
{
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 18px 14px;
}

.brand-mark
{
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    display: block;
}

.brand-mark img
{
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 7px;
    object-fit: cover;
}

.brand-lockup
{
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-weight: 600;
    font-size: 15px;
}

.brand-lockup .brand-mark
{
    width: 26px;
    height: 26px;
}

.brand-text
{
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    min-width: 0;
}

.brand-text strong
{
    font-size: 14.5px;
    font-weight: 600;
}

.brand-text span
{
    font-size: 12px;
    color: var(--muted);
}

.sidebar__nav
{
    flex: 1;
    overflow-y: auto;
    padding: 4px 10px 20px;
}

.nav-group + .nav-group
{
    margin-top: 16px;
}

.nav-group__label
{
    font-size: 11.5px;
    color: var(--muted);
    padding: 0 10px 5px;
}

.nav-item
{
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: var(--r);
    color: var(--text-2);
    font-size: 13.5px;
}

.nav-item svg
{
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.8;
}

.nav-item:hover
{
    background: var(--surface);
    color: var(--text);
}

.nav-item.is-active
{
    background: var(--surface-2);
    color: var(--text);
    font-weight: 500;
}

.nav-item.is-active::before
{
    content: "";
    position: absolute;
    left: -10px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: var(--accent);
}

.nav-item.is-active svg
{
    opacity: 1;
    color: var(--accent);
}

.sidebar__foot
{
    border-top: 1px solid var(--border);
    padding: 10px 18px 14px;
    font-size: 12px;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.main
{
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar
{
    height: 56px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 28px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 30;
}

.topbar__title
{
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.topbar__title h1
{
    font-size: 16px;
    white-space: nowrap;
}

.topbar__title p
{
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar__spacer
{
    flex: 1;
}

.icon-btn
{
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--r);
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    cursor: pointer;
    color: var(--muted);
    flex: none;
}

.icon-btn:hover
{
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

.icon-btn svg
{
    width: 16px;
    height: 16px;
}

.search
{
    position: relative;
    display: flex;
    align-items: center;
}

.search svg
{
    position: absolute;
    left: 10px;
    width: 15px;
    height: 15px;
    color: var(--muted);
    pointer-events: none;
}

.search input
{
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 6px 10px 6px 31px;
    width: 230px;
    height: 32px;
}

.search input:focus
{
    outline: none;
    border-color: var(--accent);
}

.account
{
    position: relative;
}

.account__btn
{
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--r);
    padding: 3px 6px 3px 3px;
    cursor: pointer;
}

.account__btn:hover
{
    background: var(--surface);
    border-color: var(--border);
}

.account__btn svg
{
    width: 14px;
    height: 14px;
    color: var(--muted);
}

.avatar
{
    width: 26px;
    height: 26px;
    border-radius: var(--r-sm);
    background: var(--surface-3);
    color: var(--text);
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 600;
    overflow: hidden;
}

.avatar img
{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.account__name
{
    font-size: 13px;
    font-weight: 500;
}

.menu
{
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow);
    min-width: 210px;
    padding: 5px;
    display: none;
    z-index: 60;
}

.menu.is-open
{
    display: block;
}

.menu__who
{
    padding: 8px 10px 9px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 5px;
}

.menu__who strong
{
    display: block;
    font-size: 13px;
    font-weight: 600;
}

.menu__who span
{
    display: block;
    font-size: 12px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu a,
.menu button
{
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 7px 10px;
    border-radius: var(--r-sm);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text);
    font-size: 13px;
    text-align: left;
}

.menu a svg,
.menu button svg
{
    width: 15px;
    height: 15px;
    color: var(--muted);
}

.menu a:hover,
.menu button:hover
{
    background: var(--surface-2);
}

.menu hr
{
    margin: 5px 4px;
}

.content
{
    padding: 26px 28px 60px;
    max-width: 1280px;
    width: 100%;
}

.page-head
{
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.page-head h2
{
    font-size: 18px;
}

.page-head p
{
    color: var(--muted);
    font-size: 13px;
    margin-top: 2px;
}

.section-title
{
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 28px 0 10px;
}

.section-title:first-child
{
    margin-top: 0;
}

.section-title h2,
.section-title h3
{
    font-size: 14px;
    font-weight: 600;
}

.section-title p,
.section-title a
{
    font-size: 12.5px;
    color: var(--muted);
}

.section-title a:hover
{
    color: var(--text);
}

.grid
{
    display: grid;
    gap: 16px;
}

.grid--stats
{
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.span-2 { grid-column: span 2; }

.card
{
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 18px;
}

.card--pad-lg
{
    padding: 20px 22px;
}

.card--flush
{
    padding: 0;
}

.card--warn
{
    border-color: var(--warning);
    background: var(--warning-soft);
}

.card--danger
{
    border-color: var(--danger);
}

.card__head
{
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.card__head h3
{
    font-size: 14px;
}

.card__head p
{
    font-size: 12.5px;
    color: var(--muted);
}

.card__head a
{
    font-size: 12.5px;
    color: var(--muted);
}

.card__head a:hover
{
    color: var(--text);
}

.summary
{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    background: var(--surface);
    overflow: hidden;
}

.summary__cell
{
    padding: 14px 18px 15px;
    border-right: 1px solid var(--border);
    margin-right: -1px;
    border-bottom: 1px solid var(--border);
    margin-bottom: -1px;
    min-width: 0;
}

.summary__label
{
    display: block;
    font-size: 12.5px;
    color: var(--muted);
}

.summary__value
{
    display: block;
    font-size: 24px;
    font-weight: 500;
    letter-spacing: -0.01em;
    margin-top: 3px;
    white-space: nowrap;
}

.summary__sub
{
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

.summary__sub.is-good { color: var(--success); }
.summary__sub.is-bad { color: var(--danger); }

.stat
{
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat__label
{
    font-size: 12.5px;
    color: var(--muted);
}

.stat__value
{
    font-size: 24px;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.stat__trend
{
    font-size: 12px;
    color: var(--muted);
}

.stat__trend.up { color: var(--success); }
.stat__trend.down { color: var(--danger); }

.spark
{
    width: 100%;
    height: 28px;
    display: block;
    margin-top: 8px;
}

.btn
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 32px;
    padding: 0 12px;
    border-radius: var(--r);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.btn svg
{
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.btn:hover
{
    background: var(--surface-2);
    border-color: var(--muted);
}

.btn--primary
{
    background: var(--primary-bg);
    border-color: var(--primary-bg);
    color: var(--primary-fg);
}

.btn--primary:hover
{
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn--accent
{
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
}

.btn--accent:hover
{
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn--ghost
{
    background: transparent;
    border-color: transparent;
    color: var(--text-2);
}

.btn--ghost:hover
{
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--text);
}

.btn--danger
{
    background: transparent;
    border-color: var(--danger);
    color: var(--danger);
}

.btn--danger:hover
{
    background: var(--danger-soft);
    border-color: var(--danger);
}

.btn--sm
{
    height: 27px;
    padding: 0 9px;
    font-size: 12.5px;
}

.btn--lg
{
    height: 40px;
    padding: 0 18px;
    font-size: 14px;
}

.btn--block
{
    width: 100%;
}

.btn:disabled,
.btn[aria-disabled="true"]
{
    opacity: 0.45;
    cursor: not-allowed;
}

.toolbar
{
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.toolbar__spacer { flex: 1; }

.toolbar__label
{
    font-size: 12.5px;
    color: var(--muted);
}

.field
{
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.field label,
.field .label
{
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.hint,
.field .hint
{
    font-size: 12px;
    font-weight: 400;
    color: var(--muted);
}

.field .err
{
    font-size: 12px;
    color: var(--danger);
    display: none;
}

.field.has-error .err { display: block; }

.field.has-error .input,
.field.has-error select
{
    border-color: var(--danger);
}

.input,
select,
textarea
{
    background: var(--bg-sunk);
    border: 1px solid var(--border-strong);
    border-radius: var(--r);
    padding: 0 10px;
    height: 34px;
    width: 100%;
}

[data-theme="light"] .input,
[data-theme="light"] select,
[data-theme="light"] textarea
{
    background: var(--surface);
}

textarea
{
    resize: vertical;
    min-height: 96px;
    height: auto;
    padding: 8px 10px;
    line-height: 1.5;
}

select
{
    appearance: none;
    padding-right: 28px;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.toolbar .input,
.toolbar select
{
    height: 32px;
    width: auto;
}

.input:focus,
select:focus,
textarea:focus
{
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.input[readonly]
{
    color: var(--text-2);
}

.input:disabled
{
    opacity: 0.6;
}

.field-row
{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.field-row--3
{
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.checkbox
{
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
}

.checkbox input
{
    width: 15px;
    height: 15px;
    accent-color: var(--accent);
    flex-shrink: 0;
}

.switch-list
{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px 14px;
}

.fieldset
{
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 12px 14px;
    margin-bottom: 14px;
}

.fieldset > .label
{
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 10px;
}

.table-wrap
{
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    background: var(--surface);
}

.table-scroll
{
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

table.data
{
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

table.data thead th
{
    text-align: left;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    padding: 9px 14px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    background: var(--surface);
}

table.data tbody td
{
    padding: 9px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

table.data tbody tr:last-child td { border-bottom: none; }

table.data tbody tr:hover
{
    background: var(--surface-2);
}

table.data td.right,
table.data th.right
{
    text-align: right;
}

table.data th input[type="checkbox"],
table.data td input[type="checkbox"]
{
    width: 14px;
    height: 14px;
    accent-color: var(--accent);
    vertical-align: middle;
}

.th-sort
{
    color: inherit;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.th-sort:hover
{
    color: var(--text);
}

.th-sort svg
{
    width: 12px;
    height: 12px;
}

.cell-key
{
    font-family: var(--mono);
    font-size: 12.5px;
    letter-spacing: 0.01em;
}

.cell-sub
{
    font-size: 12px;
    color: var(--muted);
    margin-top: 1px;
}

.empty
{
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
    font-size: 13px;
}

.empty strong
{
    display: block;
    color: var(--text);
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 4px;
}

.empty .btn
{
    margin-top: 14px;
}

.pill,
.status
{
    display: inline-flex;
    align-items: center;
    height: 21px;
    padding: 0 7px;
    border-radius: var(--r-sm);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    color: var(--text-2);
    background: var(--surface-3);
}

.pill--active,
.status--active,
.status--ok { color: var(--success); background: var(--success-soft); }
.pill--frozen,
.status--frozen,
.status--info { color: var(--info); background: var(--info-soft); }
.pill--banned,
.status--banned,
.status--bad { color: var(--danger); background: var(--danger-soft); }
.pill--expired,
.status--expired { color: var(--muted); background: var(--surface-3); }
.pill--unused,
.status--unused { color: var(--text-2); background: transparent; box-shadow: inset 0 0 0 1px var(--border-strong); }
.pill--suspended,
.pill--disabled,
.pill--paused,
.status--suspended,
.status--disabled,
.status--paused,
.status--warn { color: var(--warning); background: var(--warning-soft); }

.tag
{
    display: inline-flex;
    align-items: center;
    height: 21px;
    padding: 0 7px;
    border-radius: var(--r-sm);
    font-size: 12px;
    color: var(--text-2);
    box-shadow: inset 0 0 0 1px var(--border-strong);
    white-space: nowrap;
}

.tag--accent
{
    color: var(--accent);
    box-shadow: inset 0 0 0 1px var(--accent);
}

.row-actions
{
    position: relative;
    display: inline-block;
}

.row-actions__btn
{
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--r);
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    cursor: pointer;
    color: var(--muted);
}

.row-actions__btn:hover,
.row-actions.is-open .row-actions__btn
{
    background: var(--surface-3);
    border-color: var(--border-strong);
    color: var(--text);
}

.row-actions__menu
{
    position: fixed;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow);
    min-width: 180px;
    padding: 5px;
    display: none;
    z-index: 1000;
    text-align: left;
}

.row-actions.is-open .row-actions__menu { display: block; }

.row-actions__menu button
{
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    background: none;
    border: none;
    color: var(--text);
    padding: 6px 9px;
    border-radius: var(--r-sm);
    cursor: pointer;
    font-size: 13px;
    text-align: left;
}

.row-actions__menu button svg
{
    width: 15px;
    height: 15px;
    color: var(--muted);
}

.row-actions__menu button:hover { background: var(--surface-2); }

.row-actions__menu button.danger,
.row-actions__menu button.danger svg { color: var(--danger); }

.row-actions__menu hr
{
    margin: 4px 3px;
}

.bulk-bar
{
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px 10px 8px 14px;
    margin-bottom: 12px;
    border: 1px solid var(--accent);
    border-radius: var(--r-lg);
    background: var(--accent-soft);
    font-size: 13px;
}

.pagination
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 2px 0;
    flex-wrap: wrap;
}

.pagination__info { font-size: 12.5px; color: var(--muted); }

.pagination__pages { display: flex; gap: 4px; }

.pagination__pages a,
.pagination__pages span
{
    min-width: 28px;
    height: 28px;
    padding: 0 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r);
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 12.5px;
    color: var(--text-2);
}

.pagination__pages a svg
{
    width: 14px;
    height: 14px;
}

.pagination__pages a:hover { border-color: var(--muted); color: var(--text); }

.pagination__pages .is-current
{
    background: var(--primary-bg);
    border-color: var(--primary-bg);
    color: var(--primary-fg);
}

.pagination__pages .is-disabled { opacity: 0.4; pointer-events: none; }

.modal-overlay
{
    position: fixed;
    inset: 0;
    background: var(--scrim);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 8vh 20px 40px;
    z-index: 80;
    overflow-y: auto;
}

.modal-overlay.is-open { display: flex; }

.modal
{
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 500px;
}

.modal--wide { max-width: 720px; }

.modal__head
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}

.modal__head h3 { font-size: 15px; }

.modal__close
{
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: var(--r);
    display: grid;
    place-items: center;
}

.modal__close:hover { background: var(--surface-2); color: var(--text); }

.modal__body { padding: 18px; }

.modal__foot
{
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    background: var(--surface);
    border-radius: 0 0 10px 10px;
}

.modal__body .modal__foot
{
    margin: 18px -18px -18px;
}

.toast-stack
{
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 120;
    width: min(360px, calc(100vw - 40px));
}

.toast
{
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-lg);
    padding: 11px 13px;
    box-shadow: var(--shadow);
    animation: toast-in 160ms ease-out;
}

.toast.is-leaving { opacity: 0; transition: opacity 180ms ease; }

.toast__icon { margin-top: 1px; flex-shrink: 0; }
.toast__icon svg { width: 16px; height: 16px; display: block; }
.toast--success .toast__icon { color: var(--success); }
.toast--error .toast__icon { color: var(--danger); }
.toast--info .toast__icon { color: var(--info); }

.toast__body strong { display: block; font-size: 13px; font-weight: 600; }
.toast__body span { font-size: 12.5px; color: var(--text-2); }

.auth-body
{
    background: var(--bg);
}

.auth
{
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
    padding: 12vh 20px 60px;
}

.auth__logo
{
    display: block;
    width: 44px;
    height: 44px;
    margin: 0 auto 22px;
}

.auth__logo img
{
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 10px;
}

.auth__title
{
    font-size: 21px;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-align: center;
}

.auth__sub
{
    color: var(--muted);
    font-size: 14px;
    text-align: center;
    margin-top: 6px;
}

.auth form
{
    margin-top: 26px;
}

.auth .field
{
    margin-bottom: 14px;
}

.auth .input
{
    height: 38px;
}

.auth .btn--block
{
    height: 38px;
    margin-top: 6px;
}

.auth .captcha-field
{
    margin: 4px 0 12px;
}

.field__row
{
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
}

.field__row a
{
    font-size: 12.5px;
    color: var(--muted);
}

.field__row a:hover
{
    color: var(--text);
}

.auth-row
{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.auth-alert
{
    border: 1px solid var(--danger);
    background: var(--danger-soft);
    color: var(--danger);
    border-radius: var(--r);
    padding: 9px 12px;
    font-size: 13px;
    margin-top: 20px;
    text-align: left;
}

.auth-alert--ok
{
    border-color: var(--success);
    background: var(--success-soft);
    color: var(--success);
}

.auth__foot
{
    margin-top: 22px;
    text-align: center;
    font-size: 13.5px;
    color: var(--muted);
}

.auth__foot a
{
    color: var(--accent);
    font-weight: 500;
}

.auth__foot a:hover
{
    text-decoration: underline;
    text-underline-offset: 3px;
}

.captcha-field
{
    margin: 0 0 16px;
    min-height: 78px;
}

.oauth-sep
{
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 14px;
    color: var(--muted);
    font-size: 12.5px;
}

.oauth-sep::before,
.oauth-sep::after
{
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.oauth-btns
{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
}

.btn--oauth
{
    width: 100%;
    height: 38px;
}

.totp-input
{
    letter-spacing: 0.4em;
    text-align: center;
    font-family: var(--mono);
    font-size: 20px;
}

.auth .totp-input
{
    height: 46px;
}

.code-panel
{
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    font-family: var(--mono);
    font-size: 12.5px;
    line-height: 1.65;
    overflow: hidden;
}

.code-panel__bar
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-size: 12px;
}

.code-panel pre
{
    margin: 0;
    padding: 14px;
    overflow-x: auto;
    white-space: pre;
    color: var(--text-2);
}

.code-panel .c-key { color: var(--text); }
.code-panel .c-str { color: var(--success); }
.code-panel .c-num { color: var(--info); }
.code-panel .c-dim { color: var(--muted); }
.code-panel .c-acc { color: var(--accent); }

.kv
{
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 9px 18px;
    font-size: 13px;
}

.kv dt { color: var(--muted); }
.kv dd { text-align: right; min-width: 0; overflow-wrap: anywhere; }

.kv--left dd { text-align: left; }

.countdown
{
    font-family: var(--mono);
    font-size: 28px;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.meter
{
    height: 6px;
    border-radius: 3px;
    background: var(--surface-3);
    overflow: hidden;
}

.meter__bar
{
    height: 100%;
    background: var(--text-2);
}

.meter__bar.is-warn { background: var(--warning); }
.meter__bar.is-full { background: var(--danger); }

.meter-row
{
    display: flex;
    justify-content: space-between;
    font-size: 12.5px;
    color: var(--muted);
    margin-bottom: 6px;
}

.meter-row span:last-child
{
    font-family: var(--mono);
    color: var(--text-2);
}

.progress
{
    height: 6px;
    border-radius: 3px;
    background: var(--surface-3);
    overflow: hidden;
}

.progress__bar
{
    height: 100%;
    background: var(--accent);
}

.feed
{
    display: flex;
    flex-direction: column;
}

.feed__item
{
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.feed__item:first-child { padding-top: 0; }
.feed__item:last-child { border-bottom: none; padding-bottom: 0; }

.feed__what { min-width: 0; }

.feed__what .mono
{
    color: var(--text-2);
    font-size: 12px;
}

.feed__who
{
    grid-column: 1;
    font-size: 12px;
    color: var(--muted);
}

.feed__when
{
    grid-column: 2;
    grid-row: 1;
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
}

.bars
{
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 150px;
    padding-top: 6px;
}

.bars__col
{
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    height: 100%;
    justify-content: flex-end;
    min-width: 0;
}

.bars__bar
{
    width: 100%;
    border-radius: 2px 2px 0 0;
    background: var(--chart);
    min-height: 2px;
}

.bars__col:last-child .bars__bar { background: var(--chart-hi); }
.bars__col:hover .bars__bar { background: var(--text-2); }

.bars__label
{
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
    height: 14px;
    font-family: var(--mono);
    overflow: visible;
}

.split-bar
{
    display: flex;
    height: 10px;
    border-radius: 3px;
    overflow: hidden;
    background: var(--surface-3);
    gap: 2px;
}

.split-bar span
{
    display: block;
    height: 100%;
}

.legend
{
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 14px;
    font-size: 13px;
}

.legend div
{
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}

.legend div:last-child { border-bottom: none; }

.legend i
{
    width: 8px;
    height: 8px;
    border-radius: 2px;
    display: inline-block;
    flex-shrink: 0;
}

.legend b
{
    margin-left: auto;
    font-weight: 500;
    font-family: var(--mono);
    font-size: 12.5px;
}

.legend em
{
    font-style: normal;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 12px;
    width: 42px;
    text-align: right;
}

.mobile-toggle
{
    display: none;
}

.scrim
{
    display: none;
    position: fixed;
    inset: 0;
    background: var(--scrim);
    z-index: 35;
}

.copy-field
{
    display: flex;
    gap: 6px;
}

.copy-field .input
{
    font-family: var(--mono);
    font-size: 12.5px;
    min-width: 0;
}

.copy-field .btn
{
    height: 34px;
    flex-shrink: 0;
}

.copy-field .pw-field
{
    flex: 1;
    min-width: 0;
}

.keys-output
{
    font-family: var(--mono);
    font-size: 12.5px;
    background: var(--bg-sunk);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 12px 14px;
    max-height: 280px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.7;
}

.notice
{
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 11px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-lg);
    background: var(--surface);
    font-size: 13px;
    margin-bottom: 16px;
}

.notice svg
{
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}

.notice strong
{
    display: block;
    font-weight: 600;
}

.notice--warn
{
    border-color: var(--warning);
    background: var(--warning-soft);
}

.notice--warn svg { color: var(--warning); }

.notice--info svg { color: var(--info); }

.notice--danger
{
    border-color: var(--danger);
    background: var(--danger-soft);
}

.notice--danger svg { color: var(--danger); }

.steps
{
    list-style: none;
    counter-reset: step;
}

.steps li
{
    counter-increment: step;
    position: relative;
    padding: 0 0 18px 36px;
    font-size: 13.5px;
    color: var(--text-2);
}

.steps li::before
{
    content: counter(step);
    position: absolute;
    left: 0;
    top: -1px;
    width: 22px;
    height: 22px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border-strong);
    display: grid;
    place-items: center;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text);
}

.steps li strong
{
    display: block;
    color: var(--text);
    font-weight: 600;
    margin-bottom: 2px;
}

.steps li:last-child { padding-bottom: 0; }

.announcement
{
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.announcement:first-child { padding-top: 0; }
.announcement:last-child { border-bottom: none; padding-bottom: 0; }

.announcement__meta
{
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.announcement__body
{
    margin-top: 8px;
    white-space: pre-wrap;
    color: var(--text-2);
    font-size: 13.5px;
    max-width: 72ch;
}

.list
{
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    background: var(--surface);
}

.list__row
{
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.list__row:last-child { border-bottom: none; }

.list__main { flex: 1; min-width: 0; }

.list__main strong
{
    display: block;
    font-weight: 500;
}

.list__main span
{
    display: block;
    font-size: 12.5px;
    color: var(--muted);
}

.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-accent { color: var(--accent); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 18px; }
.mt-3 { margin-top: 26px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 18px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.hidden { display: none !important; }
.max-560 { max-width: 560px; }
.max-720 { max-width: 720px; }

@keyframes toast-in
{
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce)
{
    .toast { animation: none; }
}

@media (max-width: 1100px)
{
    .grid--3,
    .grid--main { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
}

@media (max-width: 1024px)
{
    .grid--2 { grid-template-columns: 1fr; }
    .field-row,
    .field-row--3 { grid-template-columns: 1fr; }
}

@media (max-width: 860px)
{
    .sidebar
    {
        transform: translateX(-100%);
        transition: transform 180ms ease;
    }

    .sidebar.is-open { transform: translateX(0); box-shadow: var(--shadow); }

    .main { margin-left: 0; }

    .mobile-toggle { display: grid; }

    .scrim.is-open { display: block; }

    .search input { width: 150px; }

    .account__name { display: none; }

    .content { padding: 18px 16px 48px; }

    .topbar { padding: 0 12px; gap: 8px; }

    .topbar__title p { display: none; }

}

@media (max-width: 560px)
{
    .topbar .search { display: none; }

    .countdown { font-size: 22px; }

    .page-head { flex-direction: column; align-items: flex-start; gap: 10px; }

    .modal-overlay { padding: 16px 10px; }

    .pagination { justify-content: center; }
    .pagination__info { width: 100%; text-align: center; }

    .card { padding: 14px; }
    .card--pad-lg { padding: 16px; }

    .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .auth-row { grid-template-columns: 1fr; }

    .toolbar .search,
    .toolbar .search input { width: 100%; }
}

@media (max-width: 640px)
{
    table.data.table--stack thead { display: none; }

    table.data.table--stack,
    table.data.table--stack tbody,
    table.data.table--stack tr,
    table.data.table--stack td { display: block; width: 100%; }

    table.data.table--stack tr
    {
        border-bottom: 1px solid var(--border);
        padding: 6px 0;
    }

    table.data.table--stack tr:last-child { border-bottom: none; }

    table.data.table--stack td
    {
        position: relative;
        border: none;
        padding: 6px 14px 6px 120px;
        min-height: 32px;
        text-align: right;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    table.data.table--stack td::before
    {
        content: attr(data-label);
        position: absolute;
        left: 14px;
        top: 7px;
        width: 100px;
        text-align: left;
        font-size: 12px;
        color: var(--muted);
        white-space: nowrap;
    }
}

a.summary__cell:hover
{
    background: var(--surface-2);
}
