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

:root {
    --bg-body: #0c0e12;
    --bg-sidebar: #0f1117;
    --bg-card: #141720;
    --bg-input: #0c0e12;
    --bg-hover: #1a1d28;
    --bg-active: #1e2230;
    --bg-elevated: #181b24;

    --border: #1e2230;
    --border-subtle: #262a38;
    --border-focus: #4a7dfc;

    --text: #d4d8e4;
    --text-secondary: #8890a4;
    --text-muted: #555d74;
    --text-heading: #eaecf2;

    --accent: #4a7dfc;
    --accent-hover: #3b6de8;
    --accent-subtle: rgba(74, 125, 252, 0.1);
    --accent-glow: rgba(74, 125, 252, 0.25);

    --green: #3ecf8e;
    --green-bg: rgba(62, 207, 142, 0.1);
    --green-border: rgba(62, 207, 142, 0.25);
    --yellow: #f0b429;
    --yellow-bg: rgba(240, 180, 41, 0.1);
    --yellow-border: rgba(240, 180, 41, 0.25);
    --red: #e5484d;
    --red-bg: rgba(229, 72, 77, 0.1);
    --red-border: rgba(229, 72, 77, 0.25);
    --blue: #4a7dfc;
    --blue-bg: rgba(74, 125, 252, 0.1);
    --blue-border: rgba(74, 125, 252, 0.25);

    --sidebar-w: 240px;
    --radius: 6px;
    --radius-lg: 10px;

    --font: "Menlo", "Cascadia Code", "Consolas", "Liberation Mono", monospace;
    --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

    --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
    --shadow: 0 2px 8px rgba(0,0,0,0.35);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.45);
}

html, body {
    height: 100%;
    font-family: var(--font-ui);
    font-size: 13px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ============================================================
   SIDEBAR
   ============================================================ */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 200;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-brand {
    padding: 20px 18px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none !important;
}

.sidebar-brand-icon {
    width: 28px;
    height: 28px;
    background: var(--accent);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-brand-icon svg {
    width: 16px;
    height: 16px;
    fill: #fff;
}

.sidebar-brand-text {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-heading);
    letter-spacing: -0.03em;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 8px;
}

.sidebar-section-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 16px 12px 6px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 450;
    text-decoration: none !important;
    transition: background 0.12s var(--ease), color 0.12s var(--ease);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: var(--font-ui);
}

.sidebar-link:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.sidebar-link.active {
    background: var(--accent-subtle);
    color: var(--accent);
}

.sidebar-link svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    flex-shrink: 0;
    opacity: 0.7;
}

.sidebar-link.active svg {
    opacity: 1;
}

.sidebar-footer {
    border-top: 1px solid var(--border);
    padding: 12px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.12s var(--ease);
    position: relative;
}

.sidebar-user:hover {
    background: var(--bg-hover);
}

.sidebar-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent-subtle);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    flex-shrink: 0;
    text-transform: uppercase;
}

.sidebar-user-info {
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.sidebar-user-email {
    font-size: 12px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-label {
    font-size: 10px;
    color: var(--text-muted);
}

/* User dropdown */
.user-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 300;
    display: none;
}

.user-dropdown.open { display: block; }

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius);
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.1s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: var(--font-ui);
}

.user-dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.user-dropdown-item svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    opacity: 0.6;
}

.user-dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

.user-dropdown-item.danger { color: var(--red); }

.api-token-row {
    padding: 8px 10px;
    font-size: 11px;
}

.api-token-label {
    color: var(--text-muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}

.api-token-value {
    font-family: var(--font);
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--bg-input);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--border);
    word-break: break-all;
    cursor: pointer;
    transition: border-color 0.15s;
}

.api-token-value:hover {
    border-color: var(--accent);
}

/* ============================================================
   SHELL & LAYOUT
   ============================================================ */

.shell {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
}

.shell.no-sidebar {
    margin-left: 0;
}

.page {
    max-width: 1080px;
    margin: 0 auto;
    padding: 28px 32px;
}

.page-narrow { max-width: 640px; }

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}

.page-header h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-heading);
    letter-spacing: -0.02em;
}

.page-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============================================================
   BREADCRUMBS
   ============================================================ */

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

.breadcrumb a {
    color: var(--text-secondary);
    transition: color 0.1s;
}

.breadcrumb a:hover { color: var(--text); }

.breadcrumb-sep {
    display: inline-block;
}

.breadcrumb-sep svg {
    width: 12px;
    height: 12px;
    fill: var(--text-muted);
    vertical-align: middle;
    opacity: 0.5;
}

/* ============================================================
   INFO BANNERS (inline docs)
   ============================================================ */

.info-banner {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    background: var(--blue-bg);
    border: 1px solid var(--blue-border);
    border-radius: var(--radius);
    font-size: 12px;
    line-height: 1.55;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.info-banner svg {
    width: 16px;
    height: 16px;
    fill: var(--accent);
    flex-shrink: 0;
    margin-top: 1px;
}

.info-banner a { color: var(--accent); }

/* ============================================================
   SECTION TITLES
   ============================================================ */

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-heading);
    margin: 24px 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin: -6px 0 12px;
    line-height: 1.5;
}

/* ============================================================
   CARDS
   ============================================================ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-body { padding: 16px 18px; }

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 500;
    font-family: var(--font-ui);
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s var(--ease);
    white-space: nowrap;
    line-height: 1.4;
}

.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text);
    border-color: var(--border-subtle);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

.btn-danger {
    background: var(--red-bg);
    color: var(--red);
    border-color: var(--red-border);
}
.btn-danger:hover:not(:disabled) {
    background: rgba(229, 72, 77, 0.18);
}

.btn-warning {
    background: var(--yellow-bg);
    color: var(--yellow);
    border-color: var(--yellow-border);
}
.btn-warning:hover:not(:disabled) {
    background: rgba(240, 180, 41, 0.18);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}
.btn-ghost:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text);
}

.btn-sm { padding: 4px 10px; font-size: 11px; }
.btn-block { width: 100%; }
.btn-icon-only { padding: 6px; }

/* ============================================================
   FORMS
   ============================================================ */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 8px 10px;
    font-size: 13px;
    font-family: var(--font-ui);
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

input:focus, select:focus, textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

input::placeholder, textarea::placeholder { color: var(--text-muted); }

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%23555d74' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

.form-group { margin-bottom: 14px; }
.form-group label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-hint {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.input-half { flex: 1; }
.zone-replica-row select { flex: 2; }
.zone-replica-row input[type=number] { flex: 1; }
.zone-remove-btn { flex: 0 0 auto; padding: 4px !important; min-width: 28px; }
.zone-remove-btn svg { width: 14px; height: 14px; }
.form-actions { display: flex; gap: 8px; margin-top: 20px; justify-content: flex-end; }

.toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text);
    text-transform: none;
    letter-spacing: normal;
    cursor: pointer;
}

.toggle-label input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--accent);
}

/* ============================================================
   AUTH
   ============================================================ */

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(74,125,252,0.04) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 80%, rgba(62,207,142,0.03) 0%, transparent 60%),
        var(--bg-body);
}

.auth-card {
    width: 100%;
    max-width: 380px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    box-shadow: var(--shadow-lg);
}

.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 4px;
}

.auth-brand-icon {
    width: 32px;
    height: 32px;
    background: var(--accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-brand-icon svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

.auth-title {
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    color: var(--text-heading);
    letter-spacing: -0.03em;
}

.auth-card h2 {
    font-size: 14px;
    font-weight: 400;
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.auth-form .btn { margin-top: 6px; }

.auth-switch {
    text-align: center;
    margin-top: 16px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================================
   TABLES
   ============================================================ */

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.table th {
    text-align: left;
    padding: 10px 14px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border);
    background: transparent;
}

.table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--bg-hover); }

.clickable-row { cursor: pointer; }
.mono { font-family: var(--font); font-size: 11px; letter-spacing: -0.02em; }

/* ============================================================
   DETAIL GRID
   ============================================================ */

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 2px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 18px;
}

.detail-item { padding: 8px 0; }

.detail-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.detail-value {
    font-size: 13px;
    color: var(--text);
    word-break: break-all;
}

/* ============================================================
   STATE INDICATORS
   ============================================================ */

.state-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
}

.state-running { background: var(--green); box-shadow: 0 0 5px var(--green); }
.state-pending { background: var(--yellow); box-shadow: 0 0 5px var(--yellow); }
.state-error { background: var(--red); box-shadow: 0 0 5px var(--red); }
.state-sleeping { background: var(--blue); }
.state-exited { background: var(--text-muted); }
.state-success { background: var(--green); box-shadow: 0 0 5px var(--green); }

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    text-transform: capitalize;
}

.build-status { composes: status-badge; display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 500; text-transform: capitalize; }
.build-status-pending { background: var(--yellow-bg); color: var(--yellow); }
.build-status-running { background: var(--blue-bg); color: var(--blue); animation: pulse 2s ease-in-out infinite; }
.build-status-success { background: var(--green-bg); color: var(--green); }
.build-status-failed { background: var(--red-bg); color: var(--red); }
.build-status-cancelled { background: var(--bg-hover); color: var(--text-muted); }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

/* ============================================================
   PILLS
   ============================================================ */

.replica-pills { display: flex; flex-wrap: wrap; gap: 6px; }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
}

.pill-label {
    color: var(--text-muted);
}

/* ============================================================
   ACTION ROW
   ============================================================ */

.action-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* ============================================================
   EMPTY & ERROR STATES
   ============================================================ */

.empty-state {
    text-align: center;
    padding: 56px 24px;
    color: var(--text-muted);
}

.empty-icon {
    margin-bottom: 12px;
}

.empty-icon svg {
    width: 40px;
    height: 40px;
    fill: var(--text-muted);
    opacity: 0.35;
}

.empty-state h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.empty-state p {
    margin-bottom: 16px;
    font-size: 12px;
    line-height: 1.5;
}

.empty-state-sm {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
}

.error-box {
    background: var(--red-bg);
    color: var(--red);
    padding: 12px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--red-border);
    font-size: 12px;
    line-height: 1.5;
}

/* ============================================================
   LOADING
   ============================================================ */

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 80px 0;
    color: var(--text-muted);
    font-size: 12px;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ============================================================
   TOASTS
   ============================================================ */

.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px 16px;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
    box-shadow: var(--shadow-lg);
    max-width: 360px;
}

.toast.show { opacity: 1; transform: translateY(0); }
.toast-error { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-border); }
.toast-success { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }
.toast-info { background: var(--blue-bg); color: var(--blue); border: 1px solid var(--blue-border); }

/* ============================================================
   MODALS
   ============================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0,0,0,0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeIn 0.15s var(--ease);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 100%;
    max-width: 460px;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.2s var(--ease);
}

@keyframes modalIn {
    from { transform: translateY(12px) scale(0.97); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 4px;
}

.modal-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.5;
}

.modal-form .form-group { margin-bottom: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ============================================================
   SERVICE FORM CARD
   ============================================================ */

.service-form-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin-bottom: 10px;
}

.service-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.service-form-header h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-heading);
}

/* ============================================================
   LOG VIEWER
   ============================================================ */

.log-container {
    margin-top: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: #0a0c10;
    overflow: hidden;
}

.log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-muted);
}

.log-viewer {
    max-height: 500px;
    overflow-y: auto;
    padding: 14px;
    margin: 0;
    font-family: var(--font);
    font-size: 11px;
    line-height: 1.7;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-all;
}

.log-viewer::-webkit-scrollbar { width: 6px; }
.log-viewer::-webkit-scrollbar-track { background: transparent; }
.log-viewer::-webkit-scrollbar-thumb { background: var(--border-subtle); border-radius: 3px; }

/* ============================================================
   APP LIST
   ============================================================ */

.resource-list {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    overflow: hidden;
}

.resource-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.1s var(--ease);
    text-decoration: none !important;
    color: var(--text);
    gap: 12px;
}

.resource-item:last-child { border-bottom: none; }
.resource-item:hover { background: var(--bg-hover); }

.resource-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    background: var(--accent-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.resource-icon svg {
    width: 16px;
    height: 16px;
    fill: var(--accent);
}

.resource-main { flex: 1; min-width: 0; }

.resource-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-heading);
}

.resource-meta {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    gap: 12px;
    margin-top: 2px;
}

.resource-status {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.resource-status-text {
    font-size: 11px;
    text-transform: capitalize;
    color: var(--text-muted);
}

/* ============================================================
   METRICS CHARTS
   ============================================================ */

.metrics-section {
    margin: 24px 0;
}

.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.period-selector {
    display: flex;
    gap: 2px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2px;
}

.period-btn {
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 500;
    font-family: var(--font-ui);
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s var(--ease);
}

.period-btn:hover {
    color: var(--text);
    background: var(--bg-hover);
}

.period-btn.active {
    color: var(--accent);
    background: var(--accent-subtle);
}

.chart-container {
    height: 250px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    position: relative;
}

/* ============================================================
   UTILITY
   ============================================================ */

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-error { color: var(--red); font-size: 11px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.gap-8 { gap: 8px; }

/* ============================================================
   MOBILE SIDEBAR TOGGLE
   ============================================================ */

.mobile-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 250;
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border);
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.mobile-toggle svg {
    width: 18px;
    height: 18px;
    fill: var(--text-secondary);
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 190;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
    :root { --sidebar-w: 260px; }

    .shell { margin-left: 0; }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.2s var(--ease);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-backdrop.visible {
        display: block;
    }

    .mobile-toggle { display: flex; }

    .page {
        padding: 20px 16px;
        padding-top: 56px;
    }

    .page-header { flex-wrap: wrap; }
    .detail-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .auth-card { padding: 28px 20px; }
}

@media (max-width: 480px) {
    .resource-meta { flex-wrap: wrap; gap: 4px 10px; }
    .action-row { flex-wrap: wrap; }
}
