/* ==========================================================================
   SourceGuard admin UI
   ========================================================================== */

:root {
    --ink: #0f172a;
    --ink-soft: #344054;
    --muted: #667085;
    --soft: #98a2b3;
    --line: #e7eaf0;
    --line-strong: #d4d9e3;
    --bg: #f5f7fb;
    --bg-deep: #eef2f8;
    --surface: #ffffff;
    --primary: #3158ff;
    --primary-hover: #2446dc;
    --primary-soft: #eef1ff;
    --primary-ink: #1d39b8;
    --success: #079455;
    --success-soft: #e9f9f1;
    --success-line: #b7ebd2;
    --danger: #d92d20;
    --danger-soft: #fef3f2;
    --danger-line: #fecdca;
    --warning: #b54708;
    --warning-soft: #fffaeb;
    --warning-line: #fedf89;
    --info: #175cd3;
    --info-soft: #eff8ff;
    --info-line: #b2ddff;
    --sidebar: #0a1120;
    --sidebar-2: #0e192c;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 7px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow-md: 0 4px 16px -4px rgba(16, 24, 40, .08), 0 2px 4px -2px rgba(16, 24, 40, .04);
    --shadow-lg: 0 20px 40px -16px rgba(16, 24, 40, .18);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    --sidebar-w: 256px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, dl, dd, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img, svg { display: block; }
code, pre, .mono { font-family: var(--mono); }
code { font-size: .92em; }

.icon { width: 20px; height: 20px; flex: 0 0 auto; }
.icon.flip { transform: rotate(180deg); }

::selection { background: #c7d2fe; color: #111827; }

.skip-link {
    position: fixed;
    left: 16px;
    top: -60px;
    z-index: 9999;
    padding: 10px 16px;
    background: var(--ink);
    color: #fff;
    border-radius: 8px;
    transition: top .15s ease;
}
.skip-link:focus { top: 16px; }

.text-muted { color: var(--muted) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); }
.break-all { word-break: break-all; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.align-right { text-align: right !important; }
.text-link { color: var(--primary); font-weight: 600; }
.text-link:hover { color: var(--primary-hover); text-decoration: underline; }
.strong-link { color: var(--ink); font-weight: 650; }
.strong-link:hover { color: var(--primary); }

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 650;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.btn .icon { width: 17px; height: 17px; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.is-disabled { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(49, 88, 255, .25); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: #fff; border-color: var(--line-strong); color: var(--ink-soft); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: #f9fafb; border-color: #b9c0cd; color: var(--ink); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: #f2f4f7; color: var(--ink); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #057a46; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b42318; }
.btn-danger-ghost { background: #fff; border-color: var(--danger-line); color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-soft); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { height: 48px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: all .15s ease;
}
.icon-btn .icon { width: 18px; height: 18px; }
.icon-btn:hover { background: #f2f4f7; color: var(--ink); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--primary);
    font-size: 12.5px;
    font-weight: 650;
    white-space: nowrap;
}
.link-arrow .icon { width: 15px; height: 15px; transition: transform .15s ease; }
.link-arrow:hover .icon { transform: translateX(2px); }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 600;
    margin-bottom: 10px;
}
.back-link .icon { width: 14px; height: 14px; transform: rotate(180deg); }
.back-link:hover { color: var(--primary); }

/* --------------------------------------------------------------------------
   Badges, pills, chips
   -------------------------------------------------------------------------- */

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 24px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
}
.pill-success { background: var(--success-soft); color: var(--success); }
.pill-danger { background: var(--danger-soft); color: var(--danger); }
.pill-warning { background: var(--warning-soft); color: var(--warning); }
.pill-neutral { background: #f2f4f7; color: var(--muted); }
.pill-info { background: var(--info-soft); color: var(--info); }
.pill-lg { min-height: 32px; padding: 4px 14px; font-size: 12.5px; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
}
.badge .icon { width: 14px; height: 14px; }
.badge-success-soft { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-neutral { background: #f2f4f7; color: var(--muted); }

.code-chip {
    display: inline-block;
    padding: 3px 8px;
    background: #f2f4f7;
    border: 1px solid #eaecf0;
    border-radius: 6px;
    color: var(--ink-soft);
    font-size: 11.5px;
    font-weight: 600;
}
.code-inline {
    color: var(--ink-soft);
    font-size: 11.5px;
    background: #f8fafc;
    padding: 1px 5px;
    border-radius: 4px;
}
.chip-btn {
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    font-size: 11.5px;
    cursor: pointer;
}
.chip-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, .13);
    flex: 0 0 auto;
}

/* --------------------------------------------------------------------------
   Alerts, banners, toasts
   -------------------------------------------------------------------------- */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: 11px;
    font-size: 13px;
    line-height: 1.6;
}
.alert .icon { width: 18px; height: 18px; margin-top: 1px; }
.alert strong { display: block; font-weight: 700; }
.alert span { display: block; }
.alert code { background: rgba(15, 23, 42, .06); padding: 1px 5px; border-radius: 4px; }
.alert-danger { background: var(--danger-soft); border-color: var(--danger-line); color: #912018; }
.alert-success { background: var(--success-soft); border-color: var(--success-line); color: #05603a; }
.alert-warning { background: var(--warning-soft); border-color: var(--warning-line); color: #93370d; }
.alert-info { background: var(--info-soft); border-color: var(--info-line); color: #194185; }
.compact-alert { padding: 10px 12px; font-size: 12.5px; margin-top: 14px; }

.banner {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 13px 16px;
    border-radius: 12px;
    border: 1px solid var(--line);
    margin-bottom: 22px;
    font-size: 13px;
}
.banner > .icon { width: 19px; height: 19px; margin-top: 1px; }
.banner strong { display: block; font-weight: 700; }
.banner span { display: block; color: inherit; opacity: .82; font-size: 12.5px; }
.banner-warning { background: var(--warning-soft); border-color: var(--warning-line); color: #93370d; }
.banner-danger { background: var(--danger-soft); border-color: var(--danger-line); color: #912018; }

.toast-stack {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(420px, calc(100vw - 32px));
}
.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--ink-soft);
    box-shadow: var(--shadow-lg);
    font-size: 13px;
    animation: toast-in .25s ease both;
}
.toast .toast-icon .icon { width: 19px; height: 19px; }
.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--danger); }
.toast-info .toast-icon { color: var(--info); }
.toast-close { margin-left: auto; border: 0; background: transparent; color: var(--soft); cursor: pointer; padding: 0 0 0 8px; }
.toast-close .icon { width: 15px; height: 15px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------------------
   Auth screens
   -------------------------------------------------------------------------- */

.auth-body {
    min-height: 100vh;
    background: #eef2f8;
}
.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
    min-height: 100vh;
}
.auth-visual {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 48px 56px 40px;
    color: #e6ecff;
    background:
        radial-gradient(800px 600px at 14% 18%, rgba(79, 112, 255, .32), transparent 62%),
        radial-gradient(700px 520px at 92% 90%, rgba(14, 147, 132, .18), transparent 60%),
        linear-gradient(150deg, #070e1c 0%, #0b172b 55%, #08111f 100%);
}
.auth-visual::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
    background-size: 54px 54px;
    mask-image: radial-gradient(circle at 50% 40%, #000 30%, transparent 80%);
    pointer-events: none;
}
.auth-visual::after {
    content: "";
    position: absolute;
    width: 460px;
    height: 460px;
    border: 1px solid rgba(122, 150, 255, .15);
    border-radius: 50%;
    right: -160px;
    bottom: 8%;
    box-shadow: 0 0 0 70px rgba(122, 150, 255, .035), 0 0 0 140px rgba(122, 150, 255, .02);
    pointer-events: none;
}
.auth-brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.auth-brand-text { font-size: 15px; font-weight: 700; letter-spacing: .01em; }
.auth-visual-copy { position: relative; z-index: 1; margin-top: auto; padding-top: 60px; max-width: 560px; }
.auth-visual-copy h1 { margin-top: 18px; font-size: clamp(34px, 4vw, 50px); line-height: 1.18; letter-spacing: -.035em; font-weight: 760; color: #f6f8ff; }
.auth-visual-copy p { margin-top: 20px; max-width: 470px; color: #a9b8d6; font-size: 14.5px; line-height: 1.8; }
.auth-feature-list { position: relative; z-index: 1; display: grid; gap: 12px; margin: 36px 0 auto; max-width: 520px; }
.auth-feature { display: flex; gap: 14px; align-items: flex-start; padding: 13px 15px; border: 1px solid rgba(130, 156, 220, .16); border-radius: 13px; background: rgba(255, 255, 255, .035); backdrop-filter: blur(6px); }
.auth-feature-icon { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px; background: rgba(91, 124, 255, .16); color: #a8b9ff; flex: 0 0 auto; }
.auth-feature-icon .icon { width: 17px; height: 17px; }
.auth-feature strong { display: block; font-size: 13px; font-weight: 680; color: #edf2ff; }
.auth-feature span { display: block; margin-top: 2px; color: #93a5c8; font-size: 12px; line-height: 1.6; }
.auth-visual-foot { position: relative; z-index: 1; margin-top: 30px; color: #697a9c; font-size: 11.5px; letter-spacing: .02em; }
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 32px; background: #fbfcfe; }
.auth-card { width: 100%; max-width: 430px; padding: 38px 40px; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 24px 60px -32px rgba(15, 23, 42, .24); }
.auth-mobile-brand { display: none; align-items: center; gap: 10px; margin-bottom: 22px; font-weight: 700; }
.auth-copyright { margin-top: 24px; color: var(--soft); font-size: 11.5px; text-align: center; }
.auth-form-head { margin-bottom: 26px; }
.auth-form-head h2 { margin-top: 8px; font-size: 26px; letter-spacing: -.03em; font-weight: 760; }
.auth-form-head p { margin-top: 7px; color: var(--muted); font-size: 13px; }
.eyebrow { display: inline-block; font-size: 10.5px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; color: var(--primary); }
.eyebrow.light { color: #8fa7ff; }
.auth-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 22px; padding: 12px 13px; background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.auth-note .icon { width: 17px; height: 17px; color: var(--soft); margin-top: 1px; }
.auth-help { margin-top: 20px; text-align: center; color: var(--soft); font-size: 11.5px; line-height: 1.7; }
.auth-help code { display: inline-block; color: var(--muted); background: #f2f4f7; padding: 2px 5px; border-radius: 4px; white-space: nowrap; font-size: 10.5px; }
.setup-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.setup-step { display: flex; align-items: center; gap: 8px; padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfe; }
.setup-step > span { display: flex; align-items: center; justify-content: center; width: 21px; height: 21px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: 10.5px; font-weight: 750; flex: 0 0 auto; }
.setup-step p { color: var(--muted); font-size: 10.5px; line-height: 1.4; }
.auth-card .alert { margin-bottom: 18px; }
.auth-card .alert code { margin: 4px 0; word-break: break-all; }
.inline-code { display: block; margin: 4px 0; font-family: var(--mono); font-size: 11px; word-break: break-all; }

/* --------------------------------------------------------------------------
   App shell / sidebar
   -------------------------------------------------------------------------- */

.app-body { background: var(--bg); }
.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-w);
    padding: 22px 16px 18px;
    color: #c4cee2;
    background:
        radial-gradient(500px 300px at 0% 0%, rgba(49, 88, 255, .22), transparent 70%),
        linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
    border-right: 1px solid rgba(255, 255, 255, .05);
}
.sidebar::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, .022) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .022) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(#000, transparent 75%);
    pointer-events: none;
}
.sidebar > * { position: relative; z-index: 1; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 24px; }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    color: #fff;
    background: linear-gradient(145deg, #4c6fff, #2a48db);
    box-shadow: 0 6px 16px -6px rgba(49, 88, 255, .7), inset 0 1px 0 rgba(255, 255, 255, .25);
    flex: 0 0 auto;
}
.brand-mark .icon { width: 21px; height: 21px; }
.brand-mark-light { width: 42px; height: 42px; border-radius: 12px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { color: #f5f8ff; font-size: 14.5px; font-weight: 750; letter-spacing: -.01em; }
.brand-text small { margin-top: 3px; color: #7c8cab; font-size: 10px; letter-spacing: .04em; }
.sidebar-close { display: none; color: #8b9ab7; }
.sidebar-close:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item { display: flex; align-items: center; gap: 11px; height: 42px; padding: 0 12px; border-radius: 9px; color: #96a4bf; font-size: 13px; font-weight: 560; transition: all .15s ease; }
.nav-item:hover { background: rgba(255, 255, 255, .05); color: #e7edf9; }
.nav-item.is-active { background: linear-gradient(90deg, rgba(71, 105, 255, .22), rgba(71, 105, 255, .09)); color: #fff; box-shadow: inset 0 0 0 1px rgba(123, 150, 255, .13); }
.nav-item.is-active .nav-icon { color: #a9bbff; }
.nav-icon { display: flex; width: 19px; height: 19px; color: #6d7c99; }
.nav-icon .icon { width: 18px; height: 18px; }
.nav-label { margin: 22px 12px 7px; color: #5d6b87; font-size: 9.5px; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.sidebar-foot { margin-top: auto; padding-top: 20px; }
.sidebar-server { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid rgba(255, 255, 255, .06); border-radius: 10px; background: rgba(255, 255, 255, .025); }
.sidebar-server .status-dot { margin-top: 5px; }
.sidebar-server strong { display: block; color: #d8e2f5; font-size: 11.5px; font-weight: 600; }
.sidebar-server span { display: block; margin-top: 1px; color: #6c7d9d; font-size: 10px; }
.sidebar-version { margin-top: 14px; color: #54627d; font-size: 10px; text-align: center; }
.sidebar-scrim { display: none; }
.app-main { min-height: 100vh; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }

.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; height: 70px; padding: 0 30px; background: rgba(255, 255, 255, .86); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.menu-btn { display: none; }
.topbar-title { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.topbar-kicker { color: var(--soft); font-size: 10px; letter-spacing: .03em; }
.topbar-title strong { margin-top: 2px; font-size: 14.5px; font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.user-menu { display: flex; align-items: center; gap: 9px; padding-left: 14px; border-left: 1px solid var(--line); }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(145deg, #eef1ff, #dfe6ff); color: var(--primary-ink); font-size: 12.5px; font-weight: 750; flex: 0 0 auto; }
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-meta strong { font-size: 12.5px; font-weight: 650; }
.user-meta small { margin-top: 2px; color: var(--soft); font-size: 10px; }
.logout-form { display: flex; }
.app-footer { display: flex; justify-content: space-between; gap: 16px; margin-top: auto; padding: 18px 30px 24px; color: var(--soft); font-size: 10.5px; }

.page { width: 100%; max-width: 1440px; margin: 0 auto; padding: 28px 30px 10px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-head h1 { margin-top: 5px; font-size: 27px; line-height: 1.25; letter-spacing: -.035em; font-weight: 760; }
.page-head p { margin-top: 7px; color: var(--muted); font-size: 13px; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; flex-wrap: wrap; }
.page-footnote { display: flex; align-items: center; gap: 6px; margin-top: 14px; color: var(--soft); font-size: 11.5px; }
.page-footnote .icon { width: 14px; height: 14px; }
.page-footnote code { color: var(--muted); background: #eef1f6; padding: 2px 5px; border-radius: 4px; }

/* --------------------------------------------------------------------------
   Cards & layout
   -------------------------------------------------------------------------- */

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px; margin-bottom: 20px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.card-head h2 { font-size: 15px; font-weight: 720; letter-spacing: -.01em; }
.card-head p { margin-top: 3px; color: var(--muted); font-size: 11.5px; }
.card-head .link-arrow { margin-top: 2px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card { position: relative; overflow: hidden; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.stat-card::after { content: ""; position: absolute; right: -26px; top: -34px; width: 96px; height: 96px; border-radius: 50%; background: var(--primary-soft); opacity: .55; }
.stat-head { display: flex; align-items: center; gap: 8px; position: relative; z-index: 1; }
.stat-icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); }
.stat-icon .icon { width: 16px; height: 16px; }
.stat-icon-green { background: var(--success-soft); color: var(--success); }
.stat-icon-amber { background: var(--warning-soft); color: var(--warning); }
.stat-label { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.stat-value { position: relative; z-index: 1; margin-top: 12px; font-size: 30px; line-height: 1; letter-spacing: -.04em; font-weight: 760; font-variant-numeric: tabular-nums; }
.stat-foot { position: relative; z-index: 1; display: flex; align-items: center; gap: 6px; margin-top: 10px; color: var(--soft); font-size: 11px; }
.stat-foot strong { color: var(--ink-soft); font-weight: 650; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(300px, .9fr); gap: 20px; align-items: stretch; }
.dashboard-grid.lower { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.chart-card { min-height: 330px; }
.chart-legend { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 11px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 7px; height: 7px; border-radius: 2px; display: inline-block; }
.legend-dot.blue { background: #758bfd; }
.legend-dot.red { background: #f97066; }
.chart-total { color: var(--ink-soft); font-weight: 650; }
.chart-wrap { position: relative; }
.bar-chart { width: 100%; height: auto; overflow: visible; }
.chart-grid-line { stroke: #eef1f6; stroke-width: 1; }
.chart-bar-total { fill: #6e86fd; }
.chart-bar-denied { fill: #f97066; }
.chart-label { fill: #667085; font-size: 10px; font-family: var(--font); }
.chart-sublabel { fill: #98a2b3; font-size: 9px; font-family: var(--font); }
.chart-empty { position: absolute; inset: 0 0 34px; display: flex; align-items: center; justify-content: center; color: var(--soft); font-size: 12px; background: rgba(255, 255, 255, .6); }
.system-card { display: flex; flex-direction: column; }
.system-list { display: flex; flex-direction: column; gap: 0; margin-bottom: 16px; }
.system-list > div { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px dashed #edf0f5; font-size: 11.5px; }
.system-list > div:last-child { border-bottom: 0; }
.system-list dt { color: var(--soft); flex: 0 0 auto; }
.system-list dd { color: var(--ink-soft); font-weight: 550; text-align: right; min-width: 0; }
.system-list dd.mono { font-size: 10.5px; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px; background: var(--success-soft); color: var(--success); font-size: 10.5px; font-weight: 650; }
.system-card .btn { margin-top: auto; }

.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 44px 20px; text-align: center; color: var(--muted); }
.empty.compact { padding: 28px 16px; }
.empty-icon { display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; margin-bottom: 10px; border-radius: 13px; background: #f4f6fa; color: var(--soft); }
.empty-icon .icon { width: 22px; height: 22px; }
.empty p { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.empty-hint { margin-top: 4px; color: var(--soft); font-size: 11.5px; }
.empty .btn { margin-top: 12px; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 64px 24px; }
.empty-state.small { padding: 42px 20px; }
.empty-illustration { display: flex; align-items: center; justify-content: center; width: 72px; height: 72px; margin-bottom: 18px; border-radius: 22px; background: linear-gradient(145deg, #f0f3ff, #e6ebff); color: var(--primary); }
.empty-illustration .icon { width: 32px; height: 32px; }
.empty-state h2 { font-size: 19px; font-weight: 720; letter-spacing: -.02em; }
.empty-state p { max-width: 480px; margin: 8px auto 20px; color: var(--muted); font-size: 12.5px; line-height: 1.75; }

.onboarding { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.45fr); gap: 26px; align-items: center; margin-bottom: 20px; padding: 28px; border-radius: var(--radius); color: #e7edff; background: linear-gradient(120deg, #101b33, #17284b 55%, #0d1a31); box-shadow: var(--shadow-md); }
.onboarding-glow { position: absolute; width: 320px; height: 320px; right: 18%; top: -160px; border-radius: 50%; background: radial-gradient(circle, rgba(86, 119, 255, .38), transparent 68%); pointer-events: none; }
.onboarding-copy { position: relative; z-index: 1; }
.onboarding-copy h2 { margin-top: 8px; font-size: 22px; letter-spacing: -.025em; font-weight: 740; }
.onboarding-copy p { margin-top: 8px; max-width: 380px; color: #9fb0d1; font-size: 12.5px; line-height: 1.7; }
.onboarding-steps { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.onboarding-step { display: flex; flex-direction: column; min-height: 150px; padding: 15px; border: 1px solid rgba(157, 180, 255, .16); border-radius: 12px; background: rgba(255, 255, 255, .035); transition: all .18s ease; }
.onboarding-step:hover { background: rgba(255, 255, 255, .07); border-color: rgba(157, 180, 255, .34); transform: translateY(-2px); }
.step-num { color: #6d84ff; font-size: 10.5px; font-weight: 750; letter-spacing: .06em; }
.onboarding-step strong { margin-top: 9px; color: #f0f4ff; font-size: 13px; }
.onboarding-step small { margin-top: 5px; color: #8fa1c2; font-size: 10.5px; line-height: 1.5; }
.onboarding-step .icon { width: 15px; height: 15px; margin-top: auto; color: #8fa6ff; }

.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.data-table th { padding: 10px 12px; text-align: left; color: var(--soft); font-size: 10px; font-weight: 700; letter-spacing: .055em; text-transform: uppercase; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 13px 12px; border-bottom: 1px solid #f0f2f6; vertical-align: middle; color: var(--ink-soft); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfcfe; }
.data-table td.nowrap { white-space: nowrap; }
.compact-table th { padding: 9px 10px; }
.compact-table td { padding: 11px 10px; }
.cell-stack { display: flex; flex-direction: column; min-width: 0; }
.cell-stack strong { color: var(--ink); font-size: 12.5px; font-weight: 620; }
.cell-stack span { margin-top: 2px; color: var(--soft); font-size: 11px; }
.cell-inline { display: flex; align-items: baseline; gap: 5px; }
.cell-inline strong { font-size: 13px; color: var(--ink); }
.cell-inline span { font-size: 11px; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.key-cell { display: flex; align-items: center; gap: 5px; }
.copy-mini { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: #b0b8c6; cursor: pointer; opacity: .5; transition: all .15s ease; }
.copy-mini .icon { width: 13px; height: 13px; }
.key-cell:hover .copy-mini { opacity: 1; }
.copy-mini:hover { background: var(--primary-soft); color: var(--primary); }
.domain-count { display: inline-flex; align-items: baseline; gap: 3px; color: var(--soft); font-size: 11.5px; }
.domain-count strong { color: var(--ink-soft); font-size: 13px; }
.local-hint { padding: 1px 5px; border-radius: 4px; background: #f2f4f7; color: var(--soft); font-size: 8.5px; font-style: normal; font-weight: 600; white-space: nowrap; }
.domain-code { padding: 3px 7px; border-radius: 5px; background: #f7f9fc; color: var(--ink-soft); font-size: 11px; word-break: break-all; }
.ua-cell { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--soft) !important; font-size: 10.5px; }

.expiry-list { display: flex; flex-direction: column; }
.expiry-list li { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px dashed #edf0f5; }
.expiry-list li:last-child { border-bottom: 0; }
.expiry-icon { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 9px; background: var(--warning-soft); color: var(--warning); flex: 0 0 auto; }
.expiry-icon .icon { width: 16px; height: 16px; }
.expiry-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.expiry-main a { color: var(--ink); font-size: 12.5px; font-weight: 620; }
.expiry-main a:hover { color: var(--primary); }
.expiry-main span { color: var(--soft); font-size: 10.5px; margin-top: 1px; }

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

.form-stack { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field > label, .field-label { color: var(--ink-soft); font-size: 12px; font-weight: 650; }
.required { color: var(--danger); }
.field input, .field select, .field textarea, .filter-form select, .inline-form input {
    width: 100%;
    min-height: 40px;
    padding: 9px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    background: #fff;
    color: var(--ink);
    font-family: inherit;
    font-size: 13px;
    line-height: 1.5;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea { resize: vertical; min-height: 76px; }
.field input::placeholder, .field textarea::placeholder, .filter-search input::placeholder, .inline-form input::placeholder { color: #aeb6c4; }
.field input:focus, .field select:focus, .field textarea:focus, .filter-form select:focus, .inline-form input:focus {
    border-color: #8da0ff;
    box-shadow: 0 0 0 3px rgba(49, 88, 255, .12);
}
.field-hint { color: var(--soft); font-size: 10.5px; line-height: 1.6; }
.field-hint code { color: var(--muted); background: #f2f4f7; padding: 1px 4px; border-radius: 3px; }
.field-grid .field-hint { min-height: 16px; }
.input-wrap { position: relative; }
.input-wrap input { padding-left: 40px; }
.input-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); display: flex; color: #98a2b3; pointer-events: none; }
.input-icon .icon { width: 17px; height: 17px; }
.input-action { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; border-radius: 7px; background: transparent; color: #98a2b3; cursor: pointer; }
.input-action:hover { background: #f2f4f7; color: var(--ink); }
.input-action .icon { width: 17px; height: 17px; }
.mono-input { font-family: var(--mono) !important; letter-spacing: .01em; }
.filter-search { position: relative; flex: 1; min-width: 220px; }
.filter-search input { width: 100%; height: 40px; padding: 0 12px 0 40px; border: 1px solid var(--line-strong); border-radius: 9px; font-family: inherit; font-size: 13px; outline: none; background: #fff; }
.filter-search input:focus { border-color: #8da0ff; box-shadow: 0 0 0 3px rgba(49, 88, 255, .12); }
.filter-search .input-icon { top: 50%; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 0; cursor: pointer; }
.switch-row.compact { padding: 0; }
.switch-row > span:first-child { display: flex; flex-direction: column; gap: 2px; }
.switch-row strong { color: var(--ink-soft); font-size: 12.5px; font-weight: 620; }
.switch-row small { color: var(--soft); font-size: 10.5px; line-height: 1.5; }
.switch { position: relative; display: inline-flex; width: 40px; height: 23px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.switch-track { position: absolute; inset: 0; border-radius: 999px; background: #d0d5dd; transition: background .18s ease; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(16, 24, 40, .2); transition: transform .18s ease; }
.switch input:checked + .switch-track { background: var(--primary); }
.switch input:checked + .switch-track::after { transform: translateX(17px); }
.switch input:focus-visible + .switch-track { outline: 2px solid #8da0ff; outline-offset: 2px; }
.radio-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.radio-card { display: flex; align-items: flex-start; gap: 9px; padding: 13px; border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer; }
.radio-card input { margin-top: 3px; accent-color: var(--primary); }
.radio-card:has(input:checked) { border-color: #8da0ff; background: #f8faff; box-shadow: 0 0 0 3px rgba(49, 88, 255, .07); }
.radio-card span { display: flex; flex-direction: column; }
.radio-card strong { font-size: 12.5px; font-weight: 650; }
.radio-card small { color: var(--soft); font-size: 10.5px; margin-top: 2px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 4px 0 16px; }
.inline-actions { justify-content: flex-start; padding-top: 0; }
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.form-main { min-width: 0; }
.form-aside { display: flex; flex-direction: column; gap: 0; }
.form-card { padding: 22px; }
.form-card .card-head { margin-bottom: 18px; }
.form-card > .field + .field { margin-top: 14px; }
.form-card .field-grid + .field { margin-top: 14px; }
.form-card .field-grid + .field-grid { margin-top: 14px; }
.form-card .switch-row { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 15px; }
.aside-card { padding: 18px; }
.aside-card h3 { display: flex; align-items: center; gap: 7px; margin-bottom: 12px; font-size: 12.5px; font-weight: 700; }
.aside-card h3 .icon { width: 16px; height: 16px; color: var(--primary); }
.aside-card.accent { background: linear-gradient(150deg, #f8faff, #f2f5ff); border-color: #e1e7ff; }
.aside-hint { color: var(--muted); font-size: 11px; line-height: 1.7; }
.tip-list { display: flex; flex-direction: column; gap: 8px; }
.tip-list li { position: relative; padding-left: 14px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.tip-list li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 4px; height: 4px; border-radius: 50%; background: #b9c4d8; }
.tip-list code { color: var(--ink-soft); background: #eef1f6; padding: 1px 4px; border-radius: 3px; }
.mini-steps { display: flex; flex-direction: column; gap: 10px; }
.mini-steps li { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.mini-steps li span { display: flex; align-items: center; justify-content: center; width: 19px; height: 19px; border-radius: 50%; background: #e9edff; color: var(--primary); font-size: 9.5px; font-weight: 750; flex: 0 0 auto; }
.message-preview { margin-top: 6px; padding: 15px; border: 1px dashed var(--line-strong); border-radius: 11px; background: #fbfcfe; }
.preview-label { display: inline-block; margin-bottom: 7px; color: var(--soft); font-size: 9.5px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.message-preview p { color: var(--ink-soft); font-size: 12.5px; line-height: 1.7; }
.placeholder-row { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.placeholder-row > span { color: var(--soft); font-size: 10px; margin-right: 2px; }
.message-editor .switch-row { border-top: 1px dashed var(--line); margin-top: 14px; }

/* --------------------------------------------------------------------------
   Products
   -------------------------------------------------------------------------- */

.product-cell { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.product-avatar { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px; background: #f0f3ff; color: var(--primary); flex: 0 0 auto; }
.product-avatar .icon { width: 17px; height: 17px; }
.mini-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.mini-stat { flex: 1; min-width: 130px; display: flex; flex-direction: column; gap: 4px; padding: 13px 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); }
.mini-stat span { color: var(--soft); font-size: 10.5px; }
.mini-stat strong { font-size: 18px; font-weight: 720; letter-spacing: -.02em; }
.product-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.integration-card { padding: 24px; }
.integration-box { padding: 15px; border: 1px solid #dbe3f5; border-radius: 12px; background: #f8faff; }
.integration-code { display: block; max-height: 82px; overflow: auto; color: #263b76; font-size: 11px; line-height: 1.65; word-break: break-all; }
.integration-actions { display: flex; align-items: center; gap: 8px; margin-top: 11px; }
.section-subtitle { margin: 23px 0 13px; font-size: 12.5px; font-weight: 700; }
.integration-steps { display: flex; flex-direction: column; gap: 13px; }
.integration-steps li { display: flex; gap: 11px; }
.step-index { display: flex; align-items: center; justify-content: center; width: 23px; height: 23px; border-radius: 7px; background: var(--primary-soft); color: var(--primary); font-size: 10.5px; font-weight: 750; flex: 0 0 auto; }
.integration-steps strong { display: block; font-size: 12px; font-weight: 650; }
.integration-steps p { margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.integration-steps code { color: var(--ink-soft); background: #f2f4f7; padding: 1px 4px; border-radius: 3px; }
.code-panel { margin-top: 18px; border-radius: 11px; overflow: hidden; background: #0d1526; border: 1px solid #1c2942; }
.code-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 9px 13px; border-bottom: 1px solid #1c2942; color: #7f91b4; font-size: 10.5px; letter-spacing: .04em; }
.code-copy { display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; color: #9db0d4; font-size: 10px; cursor: pointer; }
.code-copy .icon { width: 13px; height: 13px; }
.code-copy:hover { color: #fff; }
.code-panel pre { margin: 0; padding: 15px; overflow-x: auto; color: #c6d4f2; font-size: 11px; line-height: 1.7; }
.product-aside { display: flex; flex-direction: column; gap: 0; }
.meta-list { display: flex; flex-direction: column; }
.meta-list > div { padding: 8px 0; border-bottom: 1px dashed #edf0f5; }
.meta-list > div:last-child { border-bottom: 0; }
.meta-list dt { color: var(--soft); font-size: 10px; }
.meta-list dd { margin-top: 2px; color: var(--ink-soft); font-size: 11.5px; font-weight: 550; }
.public-key { display: block; margin-bottom: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; color: var(--ink-soft); font-size: 10px; line-height: 1.6; word-break: break-all; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-color: var(--danger-line); }
.danger-zone h2 { color: var(--danger); font-size: 14px; }
.danger-zone p { margin-top: 3px; color: var(--muted); font-size: 11.5px; }

/* --------------------------------------------------------------------------
   Licenses
   -------------------------------------------------------------------------- */

.filter-card { padding: 12px; }
.filter-form { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.filter-form select { width: auto; min-width: 130px; height: 40px; padding: 0 32px 0 11px; font-size: 12px; background-color: #fff; }
.filter-form .btn { flex: 0 0 auto; }
.license-grid { display: grid; grid-template-columns: minmax(0, 1fr) 318px; gap: 20px; align-items: start; }
.license-main { min-width: 0; }
.license-aside { display: flex; flex-direction: column; gap: 0; }
.key-card { padding: 22px; background: linear-gradient(135deg, #fff, #fbfcff); }
.key-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.big-key { display: block; margin-top: 6px; font-size: clamp(18px, 2.3vw, 26px); line-height: 1.35; letter-spacing: .01em; color: var(--ink); word-break: break-all; }
.key-meta-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 20px; padding-top: 17px; border-top: 1px dashed var(--line-strong); }
.key-meta-grid > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.key-meta-grid span { color: var(--soft); font-size: 10px; }
.key-meta-grid strong { color: var(--ink-soft); font-size: 12px; font-weight: 620; overflow-wrap: anywhere; }
.inline-form-block { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.inline-form-block h3 { margin-bottom: 8px; font-size: 12px; font-weight: 650; }
.inline-form { display: flex; gap: 8px; }
.inline-form input { flex: 1; }
.inline-form .btn { flex: 0 0 auto; }
.status-card { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 24px 20px; }
.status-orbit { display: flex; align-items: center; justify-content: center; width: 58px; height: 58px; border-radius: 50%; margin-bottom: 11px; }
.status-orbit .icon { width: 26px; height: 26px; }
.status-orbit.success { background: var(--success-soft); color: var(--success); box-shadow: 0 0 0 7px rgba(7, 148, 85, .06); }
.status-orbit.danger { background: var(--danger-soft); color: var(--danger); box-shadow: 0 0 0 7px rgba(217, 45, 32, .06); }
.status-orbit.warning { background: var(--warning-soft); color: var(--warning); box-shadow: 0 0 0 7px rgba(181, 71, 8, .06); }
.status-orbit.neutral { background: #f2f4f7; color: var(--muted); box-shadow: 0 0 0 7px rgba(102, 112, 133, .05); }
.status-card h2 { font-size: 17px; font-weight: 730; }
.status-card > p { margin: 4px 0 14px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.status-meta { display: flex; justify-content: space-between; width: 100%; padding: 7px 0; border-top: 1px dashed var(--line); font-size: 11px; }
.status-meta span { color: var(--soft); }
.status-meta strong { color: var(--ink-soft); font-weight: 620; }
.side-product { display: flex; align-items: center; gap: 9px; padding: 9px; border: 1px solid var(--line); border-radius: 9px; }
.side-product > span:nth-child(2) { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.side-product strong { font-size: 11.5px; font-weight: 620; }
.side-product small { color: var(--soft); font-size: 10px; }
.side-product > .icon { width: 15px; height: 15px; color: var(--soft); }
.side-product:hover { border-color: #b9c8ff; background: #fbfcff; }
.danger-card { border-color: #f5d5d2; }
.danger-card h3 { color: var(--danger); }
.danger-card h3 .icon { color: var(--danger); }
.field-switch { justify-content: flex-end; }
.field-switch > label:first-child { margin-bottom: 6px; }
.field-switch .switch-row { border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; }
.field-switch .switch-row strong { font-size: 11.5px; }
.field-switch .switch-row small { font-size: 9.5px; }

/* --------------------------------------------------------------------------
   Logs / tabs
   -------------------------------------------------------------------------- */

.tabs { display: flex; align-items: center; gap: 4px; margin-bottom: 16px; padding: 4px; width: fit-content; background: #eef1f6; border-radius: 10px; }
.tab { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 7px; color: var(--muted); font-size: 12px; font-weight: 600; }
.tab:hover { color: var(--ink); }
.tab.is-active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

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

.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.settings-main { min-width: 0; }
.settings-aside { display: flex; flex-direction: column; gap: 0; }
.settings-main > .form-stack > .form-card:last-of-type { margin-bottom: 20px; }
.message-editor .message-preview.large { margin-top: 18px; }
.denied-preview { display: flex; flex-direction: column; align-items: center; padding: 22px 16px; border-radius: 12px; background: linear-gradient(160deg, #0d172b, #12203a); color: #e8efff; text-align: center; }
.denied-preview-icon { display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; margin-bottom: 9px; border-radius: 12px; background: rgba(255, 255, 255, .08); color: #93aaff; }
.denied-preview-icon .icon { width: 21px; height: 21px; }
.denied-preview strong { color: #aab9d8; font-size: 10px; font-weight: 600; letter-spacing: .04em; }
.denied-preview p { max-width: 380px; margin-top: 8px; color: #fff; font-size: 15px; font-weight: 620; line-height: 1.65; white-space: pre-line; }
.preview-support { margin-top: 8px; color: #8598bd; font-size: 10px; }

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 16px; }
.pagination-info { color: var(--soft); font-size: 11px; }
.pagination-controls { display: flex; align-items: center; gap: 4px; }
.page-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 31px; height: 31px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.page-btn .icon { width: 14px; height: 14px; }
.page-btn:hover { border-color: #b9c8ff; color: var(--primary); }
.page-btn.is-current { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-btn.is-disabled { opacity: .4; pointer-events: none; }
.page-ellipsis { color: var(--soft); padding: 0 2px; }
.col-index { width: 56px; }
.is-copied { color: var(--success) !important; }

/* --------------------------------------------------------------------------
   Dialog / empty / error
   -------------------------------------------------------------------------- */

.confirm-dialog { width: min(420px, calc(100vw - 32px)); padding: 26px; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); color: var(--ink); }
.confirm-dialog::backdrop { background: rgba(10, 17, 32, .55); backdrop-filter: blur(2px); }
.confirm-icon { display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; margin-bottom: 12px; border-radius: 12px; background: var(--danger-soft); color: var(--danger); }
.confirm-icon .icon { width: 21px; height: 21px; }
.confirm-dialog h2 { font-size: 17px; font-weight: 720; }
.confirm-dialog p { margin-top: 6px; color: var(--muted); font-size: 12.5px; line-height: 1.65; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }

.minimal-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 18px; background: radial-gradient(900px 500px at 50% -10%, #e8edff, transparent 65%), var(--bg); }
.minimal-shell { width: 100%; max-width: 660px; display: flex; flex-direction: column; align-items: center; }
.minimal-brand { margin-bottom: 20px; }
.minimal-brand .brand-text strong { color: var(--ink); }
.minimal-brand .brand-text small { color: var(--muted); }
.minimal-card { width: 100%; padding: 0; overflow: hidden; }
.minimal-foot { margin-top: 18px; color: var(--soft); font-size: 10.5px; }
.error-page { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 72px 26px; }
.error-code { font-size: 64px; line-height: 1; font-weight: 800; letter-spacing: -.06em; color: #dbe2ff; }
.error-page h1 { margin-top: 10px; font-size: 22px; letter-spacing: -.02em; }
.error-page p { max-width: 440px; margin-top: 8px; color: var(--muted); font-size: 12.5px; }
.error-actions { display: flex; gap: 9px; margin-top: 20px; }
.error-trace { max-width: 100%; margin-top: 16px; padding: 14px; overflow: auto; border-radius: 9px; background: #0f172a; color: #cbd5e1; font-size: 10.5px; text-align: left; }

.tip-card { background: #fbfcff; }
.tip-card h3 { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; font-size: 12.5px; }
.tip-card h3 .icon { width: 16px; height: 16px; color: var(--primary); }
.tip-card p { color: var(--muted); font-size: 11.5px; line-height: 1.75; }

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

@media (max-width: 1240px) {
    .product-grid, .license-grid, .settings-grid { grid-template-columns: minmax(0, 1fr) 300px; }
    .dashboard-grid { grid-template-columns: minmax(0, 1.5fr) minmax(280px, .9fr); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1080px) {
    .form-layout, .product-grid, .license-grid, .settings-grid { grid-template-columns: 1fr; }
    .product-aside, .license-aside, .settings-aside, .form-aside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; align-items: start; }
    .form-aside .aside-card, .product-aside .card, .license-aside .card, .settings-aside .card { margin-bottom: 16px; }
    .dashboard-grid, .dashboard-grid.lower { grid-template-columns: 1fr; }
    .system-card { min-height: 0; }
    .onboarding { grid-template-columns: 1fr; gap: 18px; }
    .license-aside .status-card { grid-column: span 2; }
}

@media (max-width: 980px) {
    .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
    .sidebar-open .sidebar { transform: none; }
    .sidebar-close { display: inline-flex; }
    .sidebar-scrim { position: fixed; inset: 0; z-index: 90; display: none; background: rgba(10, 17, 32, .5); backdrop-filter: blur(1px); }
    .sidebar-open .sidebar-scrim { display: block; }
    .app-main { margin-left: 0; }
    .menu-btn { display: inline-flex; }
    .page { padding: 22px 20px 8px; }
    .topbar { padding: 0 20px; }
    .app-footer { padding: 16px 20px 22px; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-visual { display: none; }
    .auth-main { min-height: 100vh; padding: 28px 18px; background: #f6f8fc; }
    .auth-mobile-brand { display: flex; }
    .auth-card { padding: 30px 26px; }
}

@media (max-width: 760px) {
    .page-head { flex-direction: column; gap: 14px; }
    .page-actions { width: 100%; }
    .page-actions .btn { flex: 1; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { padding: 15px; }
    .stat-value { font-size: 25px; }
    .field-grid { grid-template-columns: 1fr; }
    .key-meta-grid { grid-template-columns: 1fr 1fr; }
    .big-key { font-size: 18px; }
    .key-card-top { flex-direction: column; }
    .key-card-top .btn { width: 100%; }
    .topbar-right .badge { display: none; }
    .user-meta { display: none; }
    .user-menu { padding-left: 8px; border-left: 0; }
    .onboarding { padding: 22px; }
    .onboarding-steps { grid-template-columns: 1fr; }
    .onboarding-step { min-height: 0; flex-direction: row; align-items: center; gap: 10px; flex-wrap: wrap; }
    .onboarding-step strong { margin-top: 0; }
    .onboarding-step small { flex: 1 0 100%; margin-top: 0; }
    .onboarding-step .icon { margin-top: 0; margin-left: auto; }
    .product-aside, .license-aside, .settings-aside, .form-aside { grid-template-columns: 1fr; }
    .license-aside .status-card { grid-column: auto; }
    .mini-stats { display: grid; grid-template-columns: 1fr 1fr; }
    .mini-stat { min-width: 0; }
    .danger-zone { flex-direction: column; align-items: flex-start; }
    .filter-form { align-items: stretch; }
    .filter-search { flex: 1 0 100%; }
    .filter-form select { flex: 1; min-width: 0; }
    .filter-form .btn { flex: 1; }
    .integration-actions { flex-wrap: wrap; }
    .pagination { flex-direction: column; align-items: flex-start; }
    .page-footnote { align-items: flex-start; }
    .toast-stack { right: 14px; bottom: 14px; left: 14px; max-width: none; }
    .setup-steps { grid-template-columns: 1fr; }
    .setup-step { padding: 8px 10px; }
    .minimal-card { border-radius: 14px; }
}

@media (max-width: 540px) {
    .topbar { height: 62px; padding: 0 14px; }
    .topbar-kicker { display: none; }
    .topbar-title strong { font-size: 13.5px; }
    .page { padding: 18px 14px 6px; }
    .page-head h1 { font-size: 23px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat-head { align-items: flex-start; }
    .stat-value { font-size: 23px; }
    .card { padding: 16px; border-radius: 13px; }
    .form-card { padding: 17px; }
    .key-meta-grid { grid-template-columns: 1fr; gap: 11px; }
    .auth-card { padding: 26px 20px; border-radius: 16px; }
    .auth-form-head h2 { font-size: 23px; }
    .radio-row { grid-template-columns: 1fr; }
    .page-actions { flex-wrap: wrap; }
    .inline-form { flex-direction: column; }
    .inline-form .btn { width: 100%; }
    .chart-legend .chart-total { display: none; }
    .data-table { font-size: 12px; }
    .data-table th, .data-table td { padding: 10px 8px; }
    .ua-cell { max-width: 110px; }
}

/* --------------------------------------------------------------------------
   Releases & plugins
   -------------------------------------------------------------------------- */

.banner-info { background: var(--info-soft); border-color: var(--info-line); color: #194185; }
.product-feature-banner { align-items: center; }
.product-feature-banner > div { flex: 1; }
.product-feature-banner .btn { flex: 0 0 auto; }
.text-xxs { font-size: 10px !important; }

.release-latest-card {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding: 17px 20px;
    border: 1px solid #c7ead9;
    border-radius: var(--radius);
    background: linear-gradient(120deg, #f2fdf8, #e9f9f1);
    box-shadow: var(--shadow-sm);
}
.release-latest-icon { display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 12px; background: #fff; color: var(--success); box-shadow: 0 4px 12px -8px rgba(7, 148, 85, .5); flex: 0 0 auto; }
.release-latest-icon .icon { width: 22px; height: 22px; }
.release-latest-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.release-latest-main span { color: #3f7c63; font-size: 10px; font-weight: 650; }
.release-latest-main strong { margin-top: 1px; color: #065f46; font-size: 20px; letter-spacing: -.03em; font-weight: 750; }
.release-latest-main small { margin-top: 2px; color: #5f8d79; font-size: 10.5px; }
.release-latest-actions { flex: 0 0 auto; }

.plugin-list { display: flex; flex-direction: column; }
.plugin-row { display: flex; align-items: flex-start; gap: 12px; padding: 15px 0; border-bottom: 1px solid #f0f2f6; }
.plugin-row:last-child { border-bottom: 0; padding-bottom: 2px; }
.plugin-icon { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 11px; background: #f0f3ff; color: var(--primary); flex: 0 0 auto; }
.plugin-icon .icon { width: 19px; height: 19px; }
.plugin-main { flex: 1; min-width: 0; }
.plugin-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plugin-title a { color: var(--ink); font-size: 13.5px; font-weight: 650; }
.plugin-title a:hover { color: var(--primary); }
.plugin-title .mono { font-size: 10px; }
.plugin-main p { margin-top: 3px; color: var(--muted); font-size: 11.5px; line-height: 1.6; }
.plugin-meta { display: block; margin-top: 5px; color: var(--soft); font-size: 10px; }
.plugin-actions { display: flex; align-items: center; gap: 5px; flex: 0 0 auto; }

.plugin-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.plugin-detail-main { min-width: 0; }
.plugin-detail-aside { display: flex; flex-direction: column; gap: 0; }
.aside-code { margin: 0 0 10px; padding: 11px; overflow-x: auto; border-radius: 8px; background: #0d1526; color: #c6d4f2; font-size: 9.5px; line-height: 1.65; }
input[type="file"] { padding: 8px 10px; font-size: 12px; color: var(--muted); background: #fbfcfe; }
input[type="file"]::file-selector-button { height: 28px; margin-right: 10px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; color: var(--ink-soft); font-family: var(--font); font-size: 11px; cursor: pointer; }

@media (max-width: 1080px) {
    .plugin-detail-grid { grid-template-columns: 1fr; }
    .plugin-detail-aside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
}
@media (max-width: 760px) {
    .plugin-detail-aside { grid-template-columns: 1fr; }
    .plugin-row { flex-wrap: wrap; }
    .plugin-actions { width: 100%; padding-left: 50px; }
    .product-feature-banner { flex-wrap: wrap; }
    .release-latest-card { flex-wrap: wrap; }
    .release-latest-actions { width: 100%; }
    .release-latest-actions .btn { width: 100%; }
}

/* --------------------------------------------------------------------------
   Customer download portal
   -------------------------------------------------------------------------- */

.portal-body { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(900px 520px at 100% 0%, #e7f8f2, transparent 55%), radial-gradient(800px 500px at 0% 100%, #eef2ff, transparent 55%), #f7f8fb; }
.portal-nav { display: flex; align-items: center; justify-content: space-between; gap: 20px; width: 100%; max-width: 1240px; margin: 0 auto; padding: 22px 28px; }
.portal-brand .brand-text strong { color: var(--ink); }
.portal-brand .brand-text small { color: var(--muted); }
.portal-nav-actions { display: flex; align-items: center; gap: 10px; }
.portal-nav-link { color: var(--muted); font-size: 12px; font-weight: 600; padding: 7px 9px; border-radius: 7px; }
.portal-nav-link:hover { background: #fff; color: var(--ink); }
.portal-main { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 20px 28px 50px; }
.portal-footer { display: flex; justify-content: space-between; gap: 16px; width: 100%; max-width: 1240px; margin: 0 auto; padding: 18px 28px 26px; color: var(--soft); font-size: 10px; }

.portal-login-shell { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 60px; align-items: center; max-width: 1040px; min-height: calc(100vh - 190px); margin: 0 auto; padding: 30px 0; }
.portal-login-copy h1 { margin-top: 12px; font-size: clamp(34px, 4.6vw, 48px); line-height: 1.18; letter-spacing: -.045em; font-weight: 760; }
.portal-login-copy > p { max-width: 470px; margin-top: 16px; color: var(--muted); font-size: 13px; line-height: 1.85; }
.portal-login-points { display: flex; flex-direction: column; gap: 14px; margin-top: 28px; }
.portal-login-points li { display: flex; align-items: flex-start; gap: 11px; }
.portal-login-points li > span { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px; border: 1px solid #dfe7f5; background: rgba(255, 255, 255, .7); color: var(--primary); flex: 0 0 auto; }
.portal-login-points .icon { width: 17px; height: 17px; }
.portal-login-points strong { display: block; font-size: 12px; font-weight: 650; }
.portal-login-points small { display: block; margin-top: 2px; color: var(--soft); font-size: 10.5px; line-height: 1.6; }
.portal-login-card { padding: 32px; border-radius: 20px; box-shadow: var(--shadow-lg); }
.portal-login-card h2 { margin-top: 13px; font-size: 25px; letter-spacing: -.035em; }
.portal-login-sub { margin: 5px 0 20px; color: var(--muted); font-size: 12px; }
.portal-login-card .alert { margin-bottom: 16px; }
.portal-login-note { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 16px; color: var(--soft); font-size: 10px; }
.portal-login-note .icon { width: 13px; height: 13px; }

.portal-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.portal-head h1 { margin-top: 5px; font-size: clamp(26px, 3.4vw, 34px); letter-spacing: -.04em; font-weight: 760; }
.portal-head p { margin-top: 5px; color: var(--muted); font-size: 12px; }
.portal-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) 330px; gap: 20px; align-items: start; }
.portal-main-col { min-width: 0; }
.portal-aside { display: flex; flex-direction: column; gap: 0; }
.portal-release-card { overflow: hidden; margin-bottom: 20px; padding: 26px; border-radius: 20px; color: #dcebe5; background: radial-gradient(360px 220px at 100% 0%, rgba(45, 212, 191, .2), transparent 65%), linear-gradient(145deg, #0e1d1a, #15302a); box-shadow: var(--shadow-md); }
.portal-release-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; }
.portal-release-top h2 { margin-top: 7px; color: #f2fbf7; font-size: clamp(27px, 4vw, 38px); letter-spacing: -.05em; font-weight: 760; }
.portal-release-top p { margin-top: 5px; color: #91aaa2; font-size: 10.5px; }
.portal-release-top .btn-primary { background: #2dd4bf; color: #06231f; box-shadow: 0 12px 24px -14px rgba(45, 212, 191, .8); }
.portal-release-top .btn-primary:hover { background: #5eead4; }
.portal-changelog { margin-top: 20px; padding: 15px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 11px; background: rgba(255, 255, 255, .035); }
.portal-changelog > span { display: block; margin-bottom: 4px; color: #6f8e84; font-size: 9px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.portal-changelog p { color: #b7ccc5; font-size: 11.5px; line-height: 1.75; }
.portal-release-foot { display: flex; justify-content: space-between; gap: 16px; margin-top: 14px; color: #708c83; font-size: 9.5px; }
.portal-release-foot span:first-child { display: inline-flex; align-items: center; gap: 4px; }
.portal-release-foot .icon { width: 12px; height: 12px; }
.portal-release-list { display: flex; flex-direction: column; }
.portal-release-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px dashed #edf0f5; }
.portal-release-row:last-child { border-bottom: 0; }
.portal-release-version { min-width: 64px; color: var(--primary); font-family: var(--mono); font-size: 12px; font-weight: 700; }
.portal-release-row > div { display: flex; flex-direction: column; flex: 1; }
.portal-release-row strong { font-size: 11.5px; font-weight: 620; }
.portal-release-row small { margin-top: 1px; color: var(--soft); font-size: 9.5px; }
.portal-plugin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.portal-plugin-card { display: flex; flex-direction: column; min-height: 175px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: #fbfcff; }
.portal-plugin-head { display: flex; align-items: flex-start; gap: 9px; }
.portal-plugin-head .plugin-icon { width: 32px; height: 32px; border-radius: 9px; }
.portal-plugin-head .plugin-icon .icon { width: 16px; height: 16px; }
.portal-plugin-head > div { flex: 1; min-width: 0; }
.portal-plugin-head h3 { font-size: 12px; font-weight: 650; }
.portal-plugin-head > div span { display: block; margin-top: 2px; color: var(--soft); font-size: 9px; }
.portal-plugin-head .pill { font-size: 9px; min-height: 20px; padding: 1px 7px; }
.portal-plugin-card > p { flex: 1; margin: 10px 0 12px; color: var(--muted); font-size: 10.5px; line-height: 1.65; }
.portal-plugin-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px dashed var(--line); }
.portal-plugin-price { color: var(--ink-soft); font-size: 11px; font-weight: 650; }
.portal-plugin-contact { display: inline-flex; align-items: center; gap: 4px; max-width: 58%; color: var(--primary); font-size: 9px; line-height: 1.45; text-align: right; }
.portal-plugin-contact .icon { width: 12px; height: 12px; flex: 0 0 auto; }
.portal-license-note { display: flex; align-items: flex-start; gap: 6px; margin-top: 13px; padding-top: 12px; border-top: 1px dashed var(--line); color: var(--soft); font-size: 9.5px; line-height: 1.6; }
.portal-license-note .icon { width: 13px; height: 13px; margin-top: 1px; flex: 0 0 auto; }
.portal-license-card .meta-list dd code { font-size: 10px; }
.portal-aside .mini-steps li { font-size: 10.5px; }
.portal-aside .mini-steps li span { width: 18px; height: 18px; font-size: 9px; }
.portal-aside .mini-steps code { color: var(--ink-soft); background: #f2f4f7; padding: 1px 3px; border-radius: 3px; }

@media (max-width: 1050px) {
    .portal-grid { grid-template-columns: 1fr; }
    .portal-aside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
    .portal-aside .card { margin-bottom: 16px; }
}
@media (max-width: 900px) {
    .portal-login-shell { grid-template-columns: 1fr; gap: 26px; min-height: 0; max-width: 600px; }
    .portal-login-points { display: none; }
    .portal-login-copy h1 { font-size: 34px; }
}
@media (max-width: 760px) {
    .portal-nav { padding: 16px 18px; }
    .portal-main { padding: 14px 16px 36px; }
    .portal-footer { flex-direction: column; gap: 4px; padding: 0 18px 22px; }
    .portal-head { flex-direction: column; align-items: flex-start; }
    .portal-release-top { flex-direction: column; }
    .portal-release-top .btn { width: 100%; }
    .portal-plugin-grid { grid-template-columns: 1fr; }
    .portal-aside { grid-template-columns: 1fr; }
    .portal-release-foot { flex-direction: column; gap: 4px; }
}
@media (max-width: 520px) {
    .portal-login-card { padding: 24px 20px; }
    .portal-login-copy h1 { font-size: 30px; }
    .portal-nav-link { display: none; }
    .portal-release-card { padding: 20px; border-radius: 16px; }
}
