/* ============================================================
   Service Monitor - Stylesheet v2
   Tema dark (default) & light lewat [data-theme]
   ============================================================ */

:root {
    --bg: #0b1120;
    --bg-2: #0f172a;
    --surface: #111a2e;
    --surface-2: #162238;
    --surface-3: #1b2a45;
    --border: #1f2c45;
    --border-strong: #2b3b5c;
    --text: #e8eefc;
    --text-2: #9fb0cc;
    --text-3: #6b7a99;

    --primary: #4f8cff;
    --primary-2: #7c5cff;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #38bdf8;

    --success-bg: rgba(34, 197, 94, 0.14);
    --danger-bg: rgba(239, 68, 68, 0.14);
    --warning-bg: rgba(245, 158, 11, 0.14);
    --primary-bg: rgba(79, 140, 255, 0.14);
    --muted-bg: rgba(148, 163, 184, 0.12);

    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.25);
    --glow-primary: 0 0 0 3px rgba(79, 140, 255, 0.25);

    /* nama lama, masih dipakai beberapa elemen */
    --dark: var(--surface);
    --darker: var(--bg);
    --light: var(--text);
    --gray: var(--text-2);
    --gray-light: var(--text-2);
}

[data-theme="light"] {
    --bg: #f3f6fb;
    --bg-2: #e9eef7;
    --surface: #ffffff;
    --surface-2: #f6f8fc;
    --surface-3: #eef2f9;
    --border: #e3e8f2;
    --border-strong: #cfd8e8;
    --text: #0f172a;
    --text-2: #475569;
    --text-3: #7c8aa5;

    --success-bg: rgba(34, 197, 94, 0.16);
    --danger-bg: rgba(239, 68, 68, 0.14);
    --warning-bg: rgba(245, 158, 11, 0.18);
    --primary-bg: rgba(79, 140, 255, 0.14);
    --muted-bg: rgba(100, 116, 139, 0.12);

    --shadow: 0 10px 30px rgba(15, 23, 42, 0.10);
    --shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body.modal-open { overflow: hidden; }

a { color: var(--primary); }

::selection { background: rgba(79, 140, 255, 0.35); }

/* ============================================================
   Layout
   ============================================================ */
.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(900px 400px at 10% -10%, rgba(79, 140, 255, 0.12), transparent 60%),
        radial-gradient(700px 300px at 100% 0%, rgba(124, 92, 255, 0.10), transparent 60%),
        var(--bg);
}

.container {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px;
    min-width: 0;
}

.app, .main { min-width: 0; overflow-x: hidden; }

.main { flex: 1; }

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.page-sub {
    color: var(--text-2);
    font-size: 13px;
    margin-top: 2px;
}

.page-meta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-3);
}

.page-meta b { color: var(--text-2); font-weight: 600; }

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-3);
    margin-bottom: 6px;
}

.breadcrumb a { color: var(--text-2); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }

/* ============================================================
   Topbar
   ============================================================ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}

@supports not (background: color-mix(in srgb, red 50%, blue)) {
    .topbar { background: var(--surface); }
}

.topbar-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-width: 0;
}

.topbar-left, .topbar-right { min-width: 0; }

.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; }

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
}

.brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    box-shadow: 0 6px 18px rgba(79, 140, 255, 0.35);
}

.brand-text { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.brand-text span { color: var(--primary); }

.nav { display: flex; align-items: center; gap: 4px; margin-left: 12px; }

.nav-link {
    padding: 8px 12px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
    text-decoration: none;
    transition: all 0.15s;
}

.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--primary-bg); color: var(--primary); }

.icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: var(--text-2);
    text-decoration: none;
    transition: all 0.15s;
    border: 1px solid transparent;
}

.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.icon-btn.active { color: var(--primary); background: var(--primary-bg); }

/* refresh widget */
.refresh-widget {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 8px 5px 6px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-2);
}

.refresh-ring { width: 34px; height: 34px; transform: rotate(-90deg); flex-shrink: 0; }
.refresh-ring circle { fill: none; stroke-width: 3.5; }
.refresh-ring .ring-bg { stroke: var(--border-strong); }
.refresh-ring .ring-fg { stroke: var(--primary); stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.refresh-widget.loading .ring-fg { stroke: var(--success); }

.refresh-text { display: flex; flex-direction: column; line-height: 1.15; }
.refresh-count { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.refresh-last { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }

.refresh-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.refresh-btn:hover { background: var(--surface-3); color: var(--primary); }
.refresh-widget.loading .refresh-btn svg { animation: spin 1s linear infinite; }

@keyframes spin { 100% { transform: rotate(360deg); } }

/* user dropdown */
.user-dropdown { position: relative; }

.user-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 10px 5px 5px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.user-dropdown-btn:hover { border-color: var(--border-strong); }

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: #fff;
}

.user-name { font-size: 13px; font-weight: 600; }
.dropdown-arrow { color: var(--text-3); transition: transform 0.2s; }

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.18s;
    z-index: 200;
}

.dropdown-menu.show { opacity: 1; visibility: visible; transform: translateY(0); }

.dropdown-user { padding: 8px 12px; display: flex; flex-direction: column; }
.dropdown-user strong { font-size: 13px; }
.dropdown-user span { font-size: 11px; color: var(--text-3); }

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    transition: background 0.15s;
}

.dropdown-item:hover, .dropdown-item.active { background: var(--surface-2); }
.dropdown-item.active { color: var(--primary); }
.dropdown-item.logout { color: var(--danger); }
.dropdown-item.logout:hover { background: var(--danger-bg); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ============================================================
   Stat cards
   ============================================================ */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.stat-card {
    grid-column: span 3;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    min-width: 0;
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: var(--border-strong); }

.stat-card.span-2 { grid-column: span 2; }
.stat-card.span-4 { grid-column: span 4; }
.stat-card.span-6 { grid-column: span 6; }

.stat-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-2));
    opacity: 0.9;
}

.stat-card.is-down::before { background: linear-gradient(90deg, var(--danger), #f97316); }
.stat-card.is-ok::before { background: linear-gradient(90deg, var(--success), #14b8a6); }
.stat-card.is-warn::before { background: linear-gradient(90deg, var(--warning), #f97316); }

.stat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-bg);
    color: var(--primary);
    flex-shrink: 0;
}

.stat-card.is-down .stat-icon { background: var(--danger-bg); color: var(--danger); }
.stat-card.is-ok .stat-icon { background: var(--success-bg); color: var(--success); }
.stat-card.is-warn .stat-icon { background: var(--warning-bg); color: var(--warning); }

.stat-numbers { display: flex; gap: 18px; align-items: flex-end; flex-wrap: wrap; }

.stat-num { display: flex; flex-direction: column; }

.stat-num b {
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.stat-num span { font-size: 11px; color: var(--text-3); margin-top: 4px; }

.stat-num.online b { color: var(--success); }
.stat-num.offline b { color: var(--danger); }
.stat-num.warn b { color: var(--warning); }
.stat-num.total b { color: var(--text); }
.stat-num.big b { font-size: 32px; }

.stat-meter {
    height: 6px;
    border-radius: 6px;
    background: var(--surface-3);
    margin-top: 12px;
    overflow: hidden;
    display: flex;
}

.stat-meter i { display: block; height: 100%; transition: width 0.6s ease; }
.stat-meter .m-ok { background: var(--success); }
.stat-meter .m-down { background: var(--danger); }
.stat-meter .m-warn { background: var(--warning); }
.stat-meter .m-muted { background: var(--border-strong); }

.stat-foot { font-size: 11px; color: var(--text-3); margin-top: 8px; display: flex; justify-content: space-between; }

.stat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 3px var(--success-bg);
}

.stat-dot.red { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg); animation: pulse-dot 1.5s infinite; }

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

/* ============================================================
   Panel & table
   ============================================================ */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 22px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 700;
}

.count {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--primary-bg);
    color: var(--primary);
    vertical-align: middle;
}

.count.red { background: var(--danger-bg); color: var(--danger); }

.panel-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.panel-body { padding: 18px; }

.chips { display: flex; gap: 4px; background: var(--surface-3); padding: 3px; border-radius: 9px; }

.chip {
    padding: 5px 11px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-2);
    cursor: pointer;
    border: none;
    background: transparent;
    font-family: inherit;
    transition: all 0.15s;
    white-space: nowrap;
}

.chip:hover { color: var(--text); }
.chip.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.chip.active.red { color: var(--danger); }
.chip.active.green { color: var(--success); }

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 0 10px;
    height: 34px;
    color: var(--text-3);
    transition: all 0.15s;
}

.search-box:focus-within { border-color: var(--primary); box-shadow: var(--glow-primary); }

.search-box input {
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 13px;
    outline: none;
    width: 190px;
    font-family: inherit;
}

.search-box input::placeholder { color: var(--text-3); }

.table-wrap { overflow-x: auto; }

table.table { width: 100%; border-collapse: collapse; }

.table thead th {
    position: sticky;
    top: 0;
    background: var(--surface);
    padding: 11px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
    z-index: 1;
}

.table td {
    padding: 11px 14px;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background 0.12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr.row-down { background: color-mix(in srgb, var(--danger) 5%, transparent); }
.table tbody tr.row-down:hover { background: color-mix(in srgb, var(--danger) 9%, transparent); }
.table tbody tr.clickable { cursor: pointer; }

.table .num { color: var(--text-3); font-size: 12px; width: 40px; }
.table .muted { color: var(--text-3); font-size: 12px; }
.table .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.table .t-right { text-align: right; }

.host-link {
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px dashed transparent;
}

.host-link:hover { color: var(--primary); border-bottom-color: var(--primary); }
.host-link svg { opacity: 0; transition: opacity 0.15s; color: var(--primary); }
.host-link:hover svg { opacity: 1; }

.host-sub { display: block; font-size: 11px; color: var(--text-3); font-weight: 400; }

.empty-state {
    text-align: center;
    padding: 44px 20px !important;
    color: var(--text-3);
    font-size: 13px;
    white-space: normal !important;
}

.empty-state.ok { color: var(--success); font-weight: 600; }

/* skeleton */
.skeleton {
    display: block;
    height: 14px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.2s infinite;
}

.skeleton-row td { padding: 14px; }

@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ============================================================
   Pills / chips / badges
   ============================================================ */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-up { background: var(--success-bg); color: var(--success); }
.pill-down { background: var(--danger-bg); color: var(--danger); }
.pill-down i { animation: pulse-dot 1.2s infinite; }
.pill-warn { background: var(--warning-bg); color: var(--warning); }
.pill-muted { background: var(--muted-bg); color: var(--text-2); }
.pill-primary { background: var(--primary-bg); color: var(--primary); }

.svc-group { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.table .svc-group { flex-wrap: nowrap; }

.svc {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.svc i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.svc-on { background: var(--success-bg); color: var(--success); }
.svc-off { background: var(--danger-bg); color: var(--danger); }

.ping { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ping-bars { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
.ping-bars i { width: 4px; border-radius: 2px; background: var(--border-strong); height: 100%; }
.ping-bars i:nth-child(1) { height: 40%; }
.ping-bars i:nth-child(2) { height: 55%; }
.ping-bars i:nth-child(3) { height: 70%; }
.ping-bars i:nth-child(4) { height: 85%; }
.ping-up .ping-bars i.on { background: var(--success); }
.ping-mid .ping-bars i.on { background: var(--warning); }
.ping-down .ping-bars i.on { background: var(--danger); }
.ping-up { color: var(--success); }
.ping-mid { color: var(--warning); }
.ping-down { color: var(--danger); }

.lic {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid transparent;
}

.lic b { font-weight: 800; letter-spacing: 0.02em; }
.lic-active { background: var(--success-bg); color: var(--success); }
.lic-warn { background: var(--warning-bg); color: var(--warning); }
.lic-expired { background: var(--danger-bg); color: var(--danger); }
.lic-unknown { background: var(--muted-bg); color: var(--text-3); }

.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    background: var(--primary-bg);
    color: var(--primary);
}

.tag.purple { background: rgba(124, 92, 255, 0.16); color: #a78bfa; }
.tag.muted { background: var(--muted-bg); color: var(--text-2); }
.tag.warn { background: var(--warning-bg); color: var(--warning); }
.tag.provider { background: var(--muted-bg); color: var(--text-2); font-weight: 500; }

.last-down { color: var(--danger); font-weight: 600; }
.last-check { color: var(--text-2); }

/* ============================================================
   Buttons & forms
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 9px;
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; box-shadow: 0 6px 18px rgba(79, 140, 255, 0.28); }
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(79, 140, 255, 0.38); }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { border-color: var(--border-strong); }
.btn-sm { padding: 7px 12px; font-size: 12px; }
.btn-block { width: 100%; }

.form-group { margin-bottom: 18px; }

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 7px;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 11px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.form-group input:focus, .form-group select:focus { outline: none; border-color: var(--primary); box-shadow: var(--glow-primary); }
.form-group input::placeholder { color: var(--text-3); }
.form-group input:disabled { opacity: 0.6; cursor: not-allowed; }

.alert {
    padding: 11px 14px;
    border-radius: 9px;
    margin-bottom: 18px;
    font-size: 13px;
    border: 1px solid transparent;
}

.alert-error { background: var(--danger-bg); border-color: rgba(239, 68, 68, 0.3); color: var(--danger); }
.alert-success { background: var(--success-bg); border-color: rgba(34, 197, 94, 0.3); color: var(--success); }
.alert-info { background: var(--primary-bg); border-color: rgba(79, 140, 255, 0.3); color: var(--primary); }

/* ============================================================
   Login
   ============================================================ */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background:
        radial-gradient(800px 500px at 20% 10%, rgba(79, 140, 255, 0.22), transparent 60%),
        radial-gradient(700px 500px at 90% 90%, rgba(124, 92, 255, 0.20), transparent 60%),
        #0b1120;
}

.login-box {
    background: rgba(17, 26, 46, 0.92);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.login-header { text-align: center; margin-bottom: 28px; }

.login-header .logo {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    box-shadow: 0 10px 28px rgba(79, 140, 255, 0.4);
}

.login-header h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 6px; }
.login-header p { color: var(--text-2); font-size: 13px; }

.login-footer { text-align: center; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.login-footer p { color: var(--text-3); font-size: 12px; }
.login-footer a { color: var(--text-2); text-decoration: none; }

/* ============================================================
   Settings & profile
   ============================================================ */
.settings-container { margin: 0 auto; }

.settings-card, .profile-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
}

.settings-header { margin-bottom: 22px; }
.settings-header h2 { font-size: 18px; margin-bottom: 4px; }
.settings-header p { color: var(--text-2); font-size: 13px; }

.filter-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.filter-option { cursor: pointer; }
.filter-option input[type="radio"] { display: none; }

.filter-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--surface-2);
    border: 2px solid var(--border);
    border-radius: 12px;
    transition: all 0.15s;
}

.filter-option:hover .filter-card { border-color: var(--border-strong); }
.filter-option.selected .filter-card { border-color: var(--primary); background: var(--primary-bg); }

.filter-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-3);
    font-size: 18px;
    flex-shrink: 0;
}

.filter-info { flex: 1; }
.filter-info h3 { font-size: 14px; margin-bottom: 2px; }
.filter-info p { font-size: 12px; color: var(--text-2); }

.filter-check {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    opacity: 0;
    transform: scale(0.6);
    transition: all 0.15s;
}

.filter-option.selected .filter-check { opacity: 1; transform: scale(1); }

.form-actions { display: flex; justify-content: flex-end; gap: 10px; }

.theme-options { display: flex; gap: 14px; margin-bottom: 22px; }
.theme-option { flex: 1; cursor: pointer; }
.theme-option input[type="radio"] { display: none; }

.theme-card {
    background: var(--surface-2);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    text-align: center;
    transition: all 0.15s;
}

.theme-option.selected .theme-card { border-color: var(--primary); background: var(--primary-bg); }

.theme-preview { width: 100%; height: 72px; border-radius: 8px; overflow: hidden; margin-bottom: 10px; border: 1px solid var(--border); }
.dark-preview { background: #0b1120; }
.light-preview { background: #f3f6fb; }
.theme-preview-header { height: 16px; background: rgba(255, 255, 255, 0.08); }
.light-preview .theme-preview-header { background: rgba(0, 0, 0, 0.06); }
.theme-preview-body { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.theme-preview-line { height: 6px; background: rgba(255, 255, 255, 0.15); border-radius: 3px; }
.light-preview .theme-preview-line { background: rgba(0, 0, 0, 0.12); }
.theme-preview-line.short { width: 60%; }
.theme-name { font-size: 13px; font-weight: 600; }

.profile-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 22px;
    max-width: 960px;
    margin: 0 auto;
}

.profile-info-card { text-align: center; }

.profile-avatar-large {
    width: 84px;
    height: 84px;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    font-weight: 800;
    color: #fff;
    margin: 0 auto 14px;
    box-shadow: 0 10px 28px rgba(79, 140, 255, 0.35);
}

.profile-info-card h2 { font-size: 18px; margin-bottom: 2px; }
.profile-role { color: var(--text-2); font-size: 13px; margin-bottom: 20px; }
.profile-meta { text-align: left; display: flex; flex-direction: column; gap: 12px; }
.meta-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: var(--surface-2); border-radius: 9px; }
.meta-label { font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; }
.meta-value { font-size: 13px; font-weight: 600; }

.profile-forms { display: flex; flex-direction: column; gap: 18px; }
.profile-forms .profile-card h3 { font-size: 15px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }

/* ============================================================
   Host detail page
   ============================================================ */
.host-hero {
    display: grid;
    grid-template-columns: 1.35fr 1fr 1.1fr 0.8fr 0.8fr;
    gap: 14px;
    margin-bottom: 22px;
}

.host-hero .stat-card { grid-column: auto; }

/* kartu jaringan / provider */
.net-provider { font-size: 15px; font-weight: 700; line-height: 1.3; margin-top: 6px; word-break: break-word; }
.net-provider small { display: block; font-size: 11px; font-weight: 500; color: var(--text-3); margin-top: 2px; }
.net-actions { margin-top: 10px; display: flex; justify-content: flex-end; }
.host-detail-list b.wrap { text-align: right; word-break: break-word; }
.host-detail-list .note { font-size: 11px; color: var(--text-3); display: block; }

.host-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.host-title h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }

.host-detail-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; font-size: 12px; }
.host-detail-list div { display: flex; justify-content: space-between; gap: 12px; }
.host-detail-list span:first-child { color: var(--text-3); }

.incident-row td { cursor: pointer; }

.affected { display: inline-flex; gap: 4px; flex-wrap: wrap; }

.load-more { display: flex; justify-content: center; padding: 14px; border-top: 1px solid var(--border); }

/* ============================================================
   Modal
   ============================================================ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(2, 6, 23, 0.65);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.18s;
}

.modal.open { opacity: 1; visibility: visible; }

.modal-box {
    width: 100%;
    max-width: 960px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    transform: translateY(12px) scale(0.98);
    transition: transform 0.2s;
}

.modal.open .modal-box { transform: none; }

.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-head h3 { font-size: 16px; font-weight: 700; }
.modal-head p { font-size: 12px; color: var(--text-2); margin-top: 2px; }

.modal-close {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-2);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
}

.modal-close:hover { color: var(--text); border-color: var(--border-strong); }

.modal-body { overflow: auto; flex: 1; }

.modal-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}

.modal-summary div { display: flex; flex-direction: column; }
.modal-summary span { font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; }
.modal-summary b { font-size: 14px; margin-top: 2px; }

/* ============================================================
   Toast
   ============================================================ */
.toast-wrap {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    font-size: 13px;
    min-width: 240px;
    max-width: 380px;
    transform: translateY(10px);
    opacity: 0;
    transition: all 0.25s;
}

.toast.show { transform: none; opacity: 1; }

.toast-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    background: var(--primary-bg);
    color: var(--primary);
}

.toast-success .toast-icon { background: var(--success-bg); color: var(--success); }
.toast-error .toast-icon { background: var(--danger-bg); color: var(--danger); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1200px) {
    .stat-card { grid-column: span 4; }
    .stat-card.span-2 { grid-column: span 3; }
    .host-hero { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
    .stat-card, .stat-card.span-2, .stat-card.span-4 { grid-column: span 6; }
    .nav { display: none; }
    .refresh-last { display: none; }
}

@media (max-width: 640px) {
    .container { padding: 14px; }
    .topbar-inner { padding: 0 14px; gap: 8px; }
    .user-name { display: none; }
    .stat-grid { gap: 10px; }
    .stat-card, .stat-card.span-4, .stat-card.span-6 { grid-column: span 12; padding: 14px; }
    .stat-card.span-2 { grid-column: span 6; }
    .refresh-widget { padding: 4px 6px; gap: 6px; }
    .page-meta { flex-direction: column; gap: 2px; }
    .stat-num b { font-size: 22px; }
    .search-box input { width: 120px; }
    .host-hero { grid-template-columns: 1fr; }
    .modal-summary { grid-template-columns: repeat(2, 1fr); }
    .profile-container { grid-template-columns: 1fr; }
    .theme-options { flex-direction: column; }
    .page-head { align-items: flex-start; }
}

@media (max-width: 480px) {
    .brand-text { display: none; }
    .refresh-count { font-size: 12px; }
    .stat-card.span-2 { grid-column: span 12; }
}

/* ============================================================
   Host detail page v2 (hero, KPI, service tiles, timeline, info)
   ============================================================ */
.hero {
    display: flex; justify-content: space-between; align-items: flex-end; gap: 18px;
    padding: 20px 22px; margin-bottom: 16px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    position: relative; overflow: hidden;
}
.hero::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--border-strong); }
.hero.is-ok::before { background: linear-gradient(180deg, var(--success), #14b8a6); }
.hero.is-down::before { background: linear-gradient(180deg, var(--danger), #f97316); }
.hero .breadcrumb { margin-bottom: 6px; }
.hero .host-title h1 { font-size: 24px; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.hero-tags .tag.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.hero-right { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex-shrink: 0; }
.hero-right .page-meta { flex-direction: column; align-items: flex-end; gap: 2px; font-size: 12px; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.kpi {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px 18px; position: relative; overflow: hidden; min-height: 112px;
}
.kpi::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--border-strong); }
.kpi.is-ok::before { background: linear-gradient(90deg, var(--success), #14b8a6); }
.kpi.is-down::before { background: linear-gradient(90deg, var(--danger), #f97316); }
.kpi.is-warn::before { background: linear-gradient(90deg, var(--warning), #f97316); }
.kpi-label { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.kpi-value { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; margin-top: 6px; line-height: 1.1; }
.kpi-value-sm { font-size: 18px; margin-top: 12px; }
.kpi-value.ok, .ok { color: var(--success); }
.kpi-value.bad, .bad { color: var(--danger); }
.kpi-value.warn, .warn { color: var(--warning); }
.kpi-sub { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.kpi-sub b { color: var(--text-2); font-weight: 600; }
.kpi-meter { height: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; margin-top: 10px; }
.kpi-meter i { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--border-strong); transition: width 0.6s ease; }
.kpi-meter i.ok { background: var(--success); }
.kpi-meter i.warn { background: var(--warning); }
.kpi-meter i.bad { background: var(--danger); }

.legend { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-3); }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--border-strong); display: inline-block; }
.legend .lg-up { background: var(--success); }
.legend .lg-partial { background: var(--warning); }
.legend .lg-down { background: var(--danger); }
.legend .lg-nodata { background: var(--surface-3); border: 1px solid var(--border-strong); }
.legend .lg-live { background: var(--info); }
.muted-note { font-size: 12px; color: var(--text-3); }

.svc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 16px 18px; }
.svc-tile {
    background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 14px; position: relative; overflow: hidden; min-height: 132px;
}
.svc-tile::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--border-strong); }
.svc-tile.is-ok::before { background: var(--success); }
.svc-tile.is-down::before { background: var(--danger); }
.svc-tile.is-down { background: linear-gradient(180deg, rgba(239, 68, 68, 0.07), var(--surface-2)); }
.svc-tile-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.svc-name { font-size: 15px; font-weight: 800; letter-spacing: 0.02em; }
.svc-desc { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.svc-desc .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--text-2); }
.svc-tile-status { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.svc-live { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--text-3); }
.svc-live .dot-live { width: 7px; height: 7px; border-radius: 50%; background: var(--info); animation: pulse-dot 1.4s infinite; }
.svc-live.ok { color: var(--success); } .svc-live.ok .dot-live { background: var(--success); animation: none; }
.svc-live.bad { color: var(--danger); } .svc-live.bad .dot-live { background: var(--danger); animation: none; }
.svc-live.warn { color: var(--warning); } .svc-live.warn .dot-live { background: var(--warning); animation: none; }
.svc-live.muted .dot-live { background: var(--border-strong); animation: none; }
.spark { display: flex; align-items: center; gap: 2px; margin-top: 12px; height: 14px; }
.spark i { flex: 1; height: 100%; border-radius: 2px; background: var(--surface-3); min-width: 2px; }
.spark i.ok { background: var(--success); opacity: 0.85; }
.spark i.warn { background: var(--warning); }
.spark i.bad { background: var(--danger); }
.spark .spark-label { font-size: 10px; color: var(--text-3); margin-left: 6px; white-space: nowrap; }
.skeleton-tile { min-height: 132px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border: 1px solid var(--border); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.two-col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; margin-bottom: 16px; }
.two-col .panel { margin-bottom: 0; }
.tl-grid { display: grid; grid-template-columns: repeat(24, 1fr); gap: 4px; }
.tl-grid i { display: block; height: 44px; border-radius: 5px; background: var(--surface-3); position: relative; border: 1px solid transparent; }
.tl-grid i span { display: none; position: absolute; left: 0; right: 0; bottom: -18px; text-align: center; font-size: 9px; color: var(--text-3); }
.tl-grid i:nth-child(3n+1) span { display: block; }
.tl-grid .tl-up { background: var(--success); opacity: 0.85; }
.tl-grid .tl-partial { background: var(--warning); }
.tl-grid .tl-down { background: var(--danger); }
.tl-grid .tl-nodata { background: var(--surface-3); border-color: var(--border-strong); }
.tl-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); margin-top: 22px; }
.tl-summary { font-size: 13px; color: var(--text-2); margin-top: 10px; }

.kv { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.kv-group { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); margin-top: 6px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.kv-group:first-child { margin-top: 0; }
.kv-row { display: flex; justify-content: space-between; gap: 12px; }
.kv-row span:first-child { color: var(--text-3); flex-shrink: 0; }
.kv-row b { font-weight: 600; text-align: right; }
.kv-row b.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.kv-row b.wrap { word-break: break-word; }
.kv-row .muted { color: var(--text-3); font-weight: 500; }

@media (max-width: 1200px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .svc-grid { grid-template-columns: repeat(2, 1fr); }
    .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .hero { flex-direction: column; align-items: stretch; }
    .hero-right { align-items: flex-start; }
    .hero-right .page-meta { align-items: flex-start; }
    .kpi-grid { grid-template-columns: 1fr; }
    .svc-grid { grid-template-columns: 1fr; }
    .tl-grid i { height: 28px; }
    .tl-grid i span { display: none !important; }
}

/* ringkasan di bawah timeline */
.two-col { align-items: start; }
.tl-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.tl-stats > div { display: flex; flex-direction: column; gap: 2px; }
.tl-stats span { font-size: 11px; color: var(--text-3); font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; }
.tl-stats b { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.2; }
.tl-stats b.sm { font-size: 14px; }
.tl-stats small { font-size: 11px; color: var(--text-3); }
@media (max-width: 640px) { .tl-stats { grid-template-columns: repeat(2, 1fr); } }

/* layar kecil: kartu service & timeline jangan melebar */
.svc-tile, .kpi, .hero, .panel { min-width: 0; }
.svc-grid > * { min-width: 0; }
@media (max-width: 640px) {
    .svc-tile-status { flex-direction: column; align-items: flex-start; gap: 6px; }
    .spark .spark-label { display: none; }
    .spark i { min-width: 1px; }
    .tl-grid { gap: 2px; }
    .hero-tags .tag { max-width: 100%; white-space: normal; }
}

/* badge "realtime" biru di kartu service, hasilnya diwarnai sesuai status */
.live-badge {
    display: inline-block; padding: 1px 6px; border-radius: 5px;
    font-size: 9px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
    background: rgba(56, 189, 248, 0.16); color: var(--info); border: 1px solid rgba(56, 189, 248, 0.35);
}
.svc-live .live-res { font-weight: 700; }
.svc-live.ok .live-res { color: var(--success); }
.svc-live.bad .live-res { color: var(--danger); }
.svc-live.warn .live-res { color: var(--warning); }
.svc-live.muted .live-res { color: var(--text-3); }
.kv-row b { color: var(--text); }
.kv-row .ok { color: var(--success); }
.kv-row .bad { color: var(--danger); }
.kv-row .warn { color: var(--warning); }

/* angka kecil di dalam chip filter (panel license CHR dashboard) */
.chip .chip-num { display: inline-block; min-width: 16px; margin-left: 4px; padding: 0 5px; border-radius: 6px; font-size: 10px; font-weight: 700; background: var(--muted-bg); color: var(--text-2); vertical-align: 1px; }
.chip .chip-num:empty { display: none; }
.chip.active.red .chip-num { background: var(--danger-bg); color: var(--danger); }
.chip.active.green .chip-num { background: var(--success-bg); color: var(--success); }

/* ============================================================
   Settings v2: menu kiri (General / Tampilan / Alert) + alert
   ============================================================ */
.settings-layout {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.settings-menu {
    position: sticky;
    top: 24px; /* .main punya overflow-x hidden -> sticky dihitung dari .main, sejajarkan dengan padding container */
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.settings-menu-title {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-3);
    padding: 8px 12px 6px;
}

.settings-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text-2);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: all 0.15s;
    border: 1px solid transparent;
}

.settings-menu-item svg { flex-shrink: 0; opacity: 0.85; }
.settings-menu-item:hover { background: var(--surface-2); color: var(--text); }
.settings-menu-item.active { background: var(--primary-bg); color: var(--primary); border-color: rgba(79, 140, 255, 0.25); font-weight: 600; }

.settings-menu-badge {
    margin-left: auto;
    font-style: normal;
    font-size: 10.5px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--success-bg);
    color: var(--success);
}

.settings-menu-foot { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--border); }

.settings-content { min-width: 0; }
.settings-section { display: none; flex-direction: column; gap: 18px; }
.settings-section.active { display: flex; animation: fade-in 0.18s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.settings-header-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.settings-header code, .form-hint code, .cron-note code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    background: var(--surface-3);
    padding: 1px 6px;
    border-radius: 5px;
}

.form-hint { display: block; margin-top: 6px; font-size: 12px; color: var(--text-3); line-height: 1.45; }
.form-hint b { color: var(--text-2); }

/* switch */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i {
    position: absolute;
    inset: 0;
    background: var(--surface-3);
    border: 1px solid var(--border-strong);
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.18s;
}
.switch i::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 2px;
    top: 2px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    transition: transform 0.18s;
}
.switch input:checked + i { background: var(--success); border-color: var(--success); }
.switch input:checked + i::before { transform: translateX(18px); }
.switch input:focus-visible + i { box-shadow: var(--glow-primary); }
.switch input:disabled + i { opacity: 0.5; cursor: not-allowed; }

/* baris opsi (label + switch / checkbox) */
.opt-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }

.opt-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.15s;
}
.opt-row:hover { border-color: var(--border-strong); }
.opt-row-col { flex-direction: column; align-items: stretch; cursor: default; gap: 12px; }

.opt-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.opt-text b { font-size: 13.5px; font-weight: 600; }
.opt-text span { font-size: 12px; color: var(--text-2); line-height: 1.45; }

.opt-check { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.opt-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}
.opt-check-plain { padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 18px; }

.opt-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding-left: 30px;
    font-size: 13px;
    color: var(--text-2);
    transition: opacity 0.15s;
}
.opt-inline.disabled { opacity: 0.45; }
.opt-inline input[type="number"] {
    width: 84px;
    padding: 8px 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}
.opt-inline input[type="number"]:focus { outline: none; border-color: var(--primary); box-shadow: var(--glow-primary); }
.opt-presets { display: flex; gap: 4px; margin-left: 4px; background: var(--surface-3); padding: 3px; border-radius: 9px; }
.opt-presets .chip { padding: 4px 9px; font-size: 12px; }

/* catatan cron */
.cron-note {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 12px 14px;
    border: 1px dashed var(--border-strong);
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: 12.5px;
    color: var(--text-2);
}
.cron-note > div { display: flex; flex-direction: column; gap: 3px; }
.cron-note b { color: var(--text); font-size: 13px; }
.cron-note code { align-self: flex-start; }
.cron-last { text-align: right; align-items: flex-end; }
.cron-last span { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); }
.cron-last small { color: var(--text-3); }
.cron-note.stale { border-color: rgba(245, 158, 11, 0.5); background: var(--warning-bg); }
.cron-note.stale .cron-last b { color: var(--warning); }

/* daftar akun alert */
.channel-list { display: flex; flex-direction: column; gap: 10px; }
.channel-list .empty-state { padding: 22px; text-align: center; color: var(--text-3); font-size: 13px; background: var(--surface-2); border-radius: 12px; }

.channel-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: border-color 0.15s;
}
.channel-item:hover { border-color: var(--border-strong); }
.channel-item.off { opacity: 0.6; }

.type-icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.type-telegram { background: rgba(41, 168, 234, 0.16); color: #29a8ea; }
.type-webhook { background: rgba(124, 92, 255, 0.16); color: var(--primary-2); }

.ch-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ch-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ch-title b { font-size: 14px; }
.ch-type { font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; background: var(--muted-bg); color: var(--text-2); }
.ch-type.ch-off { background: var(--warning-bg); color: var(--warning); }
.ch-type.ch-repeat { background: var(--primary-bg); color: var(--primary); text-transform: none; letter-spacing: 0; }
.ch-detail { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; }
.ch-detail .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.ch-detail .wrap { word-break: break-all; }
.ch-meta { font-size: 12px; }
.ch-ok { color: var(--success); }
.ch-err { color: var(--danger); display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.ch-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* pilihan tipe di modal */
.type-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.type-option { cursor: pointer; }
.type-option input { display: none; }
.type-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--surface-2);
    border: 2px solid var(--border);
    border-radius: 12px;
    transition: all 0.15s;
}
.type-card > div { display: flex; flex-direction: column; }
.type-card b { font-size: 13.5px; }
.type-card span { font-size: 11.5px; color: var(--text-2); }
.type-option:hover .type-card { border-color: var(--border-strong); }
.type-option.selected .type-card { border-color: var(--primary); background: var(--primary-bg); }
.type-options.locked .type-option:not(.selected) { opacity: 0.4; pointer-events: none; }

.modal-box.modal-sm { max-width: 540px; }
.modal-body-pad { padding: 20px; }

.table-compact th, .table-compact td { padding: 9px 12px; font-size: 12.5px; }
.table td .ok { color: var(--success); font-weight: 600; }
.table td .warn { color: var(--warning); font-weight: 600; }
.table td .bad { color: var(--danger); font-weight: 600; }

@media (max-width: 860px) {
    .settings-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .settings-menu { position: static; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 8px; }
    .settings-menu-title, .settings-menu-foot { display: none; }
    .settings-menu-item { flex: 1; justify-content: center; padding: 9px 10px; }
    .settings-menu-badge { margin-left: 2px; }
}

@media (max-width: 640px) {
    .settings-card { padding: 18px; }
    .channel-item { flex-wrap: wrap; }
    .ch-actions { width: 100%; justify-content: flex-end; }
    .type-options { grid-template-columns: 1fr; }
    .cron-last { text-align: left; align-items: flex-start; }
    .opt-inline { padding-left: 0; }
}
