/* ═══════════════════════════════════════════════════════════════
   XENTRO · Liquid Glass Design System v3
   Premium macOS/iOS-inspired desktop application UI
   deep charcoal · liquid glass · restrained blue accents · native controls
   ═══════════════════════════════════════════════════════════════ */

/* ══ DEPTH LEVELS ══ */
/* Level 0: Background
   Level 1: App shell window
   Level 2: Sidebar / main panels
   Level 3: Floating cards
   Level 4: Popovers / menus
   Level 5: Modal sheets */

:root {
    /* Core palette — restrained, Apple-like */
    --bg0: var(--bg0);
    --bg1: var(--bg1);
    --bg2: var(--bg2);
    --panel: var(--panel);
    --panel2: var(--panel2);
    --panel3: var(--panel3);
    --line: var(--line);
    --line2: var(--line2);
    --tx: var(--tx);
    --tx2: var(--tx2);
    --tx3: var(--tx3);
    --blue: var(--blue);
    --blue2: var(--blue2);
    --blue3: var(--blue3);
    --cyan: var(--cyan);
    --green: var(--green);
    --green2: var(--green2);
    --orange: var(--orange);
    --orange2: var(--orange2);
    --red: var(--red);

    /* Liquid Glass surface — base */
    --glass-tint: rgba(10, 16, 28, 0.60);
    --glass-blur: 24px;
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-shadow: 0 12px 40px rgba(0, 0, 0, 0.32);
    --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.08);

    /* Depth-level surfaces */
    --surface-0: transparent;
    --surface-1: rgba(6, 11, 22, 0.42);
    --surface-2: rgba(10, 16, 28, 0.48);
    --surface-3: rgba(14, 22, 40, 0.52);
    --surface-4: rgba(14, 22, 40, 0.62);
    --surface-5: rgba(6, 11, 22, 0.72);

    /* Blur per level */
    --blur-0: 0px;
    --blur-1: 12px;
    --blur-2: 16px;
    --blur-3: 20px;
    --blur-4: 24px;
    --blur-5: 28px;

    /* Shadows per level */
    --shadow-0: none;
    --shadow-1: 0 8px 28px rgba(0, 0, 0, 0.28);
    --shadow-2: 0 10px 32px rgba(0, 0, 0, 0.32);
    --shadow-3: 0 14px 42px rgba(0, 0, 0, 0.36);
    --shadow-4: 0 18px 50px rgba(0, 0, 0, 0.38);
    --shadow-5: 0 24px 64px rgba(0, 0, 0, 0.42);

    --radius: var(--radius);
    --radius-s: var(--radius-s);
    --radius-i: var(--radius-i);
    --font: var(--font);
    --mono: var(--mono);
    --ui-density: var(--ui-density, 1);
}

/* ══ BASE ══ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: var(--font);
    color: var(--tx);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "kern" 1;
}

/* ══ LEVEL 0: BACKGROUND ══ */
.bg-fx {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(150deg, var(--bg0) 0%, var(--bg1) 35%, var(--bg2) 100%);
}

/* ┐ Subtle texture overlay for premium feel — very faint */
.bg-fx::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.012) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(124, 215, 236, 0.018) 0%, transparent 40%);
    pointer-events: none;
}

/* ══ CONTAINER: APP WINDOW (Level 1) ══ */
#xentro-root {
    position: relative;
    z-index: 1;
    height: 100vh;
    padding: 22px;
    display: flex;
    justify-content: center;
}

.app-window {
    width: 100%;
    max-width: 1380px;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 26px;
    background: var(--surface-1);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-1);
    backdrop-filter: blur(var(--blur-1));
    -webkit-backdrop-filter: blur(var(--blur-1));
    overflow: hidden;
    transition: box-shadow 0.24s ease;
}

.app-window:hover {
    box-shadow: var(--shadow-2);
}

/* ══ LEVEL 2 PANEL SURFACE ══ */
.panel {
    background: var(--surface-2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-0);
    backdrop-filter: blur(var(--blur-2));
    -webkit-backdrop-filter: blur(var(--blur-2));
    transition: border-color 0.18s ease, box-shadow 0.22s ease;
}

.panel:hover {
    border-color: var(--line2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

/* ══ LEVEL 3 FLOATING CARD ══ */
.card {
    background: var(--surface-3);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-0);
    backdrop-filter: blur(var(--blur-3));
    -webkit-backdrop-filter: blur(var(--blur-3));
    transition: transform 0.18s ease, box-shadow 0.22s ease, border-color 0.18s ease;
}

.card:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 26px rgba(0, 0, 0, 0.32);
}

/* ══ LEVEL 4 POPOVER / MENU ══ */
.popover {
    background: var(--surface-4);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    box-shadow: var(--shadow-4);
    backdrop-filter: blur(var(--blur-4));
    -webkit-backdrop-filter: blur(var(--blur-4));
    z-index: 100;
}

/* ══ LEVEL 5 MODAL SHEET ══ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(0, 0, 0, 0.40);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeAppear 0.22s ease;
}
@keyframes fadeAppear { from { opacity: 0; } to { opacity: 1; } }

.modal-sheet {
    background: var(--surface-5);
    border: 1px solid var(--glass-border);
    border-radius: 22px;
    box-shadow: var(--shadow-5);
    backdrop-filter: blur(var(--blur-5));
    -webkit-backdrop-filter: blur(var(--blur-5));
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    animation: scaleAppear 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
}
@keyframes scaleAppear {
    from { opacity: 0; transform: scale(0.94); }
    to { opacity: 1; transform: scale(1); }
}

/* Inner highlight / glass rim */
.panel::before, .card::before, .popover::before, .modal-sheet::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), inset 0 -1px 0 rgba(0, 0, 0, 0.18);
}

/* ══ TITLE BAR (macOS style) ══ */
.titlebar {
    height: 46px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px 0 20px;
    background: linear-gradient(180deg, rgba(10, 16, 28, 0.58), rgba(6, 11, 22, 0.32));
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10;
}

.tb-left { display: flex; align-items: center; gap: 11px; }
.logo {
    width: 25px;
    height: 25px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 12px rgba(36, 169, 255, 0.32);
}
.logo svg { width: 13px; height: 13px; }
.tb-title { font-size: 13px; font-weight: 700; letter-spacing: -0.2px; color: var(--tx); }
.tb-sub { font-size: 10px; color: var(--tx3); font-family: var(--mono); margin-top: 1px; }

.tb-center { position: absolute; left: 50%; transform: translateX(-50%); }
.tb-pill {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--line);
    color: var(--tx3);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.tb-pill.live::before, .tb-pill::after {
    content: '';
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--green2);
}

.tb-right { display: flex; align-items: center; gap: 3px; }
.tb-up { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10px; color: var(--tx3); margin-right: 12px; letter-spacing: 0.3px; }
.tb-up::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--green2); box-shadow: 0 0 6px var(--green2); }
.tb-clock { font-family: var(--mono); font-size: 10.5px; color: var(--tx3); margin-right: 8px; letter-spacing: 0.4px; }

.win-btn {
    width: 30px;
    height: 26px;
    border-radius: 7px;
    border: none;
    background: transparent;
    color: var(--tx3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.15s;
}
.win-btn:hover { background: rgba(255, 255, 255, 0.08); color: var(--tx); }
.win-btn.win-close:hover { background: rgba(255, 85, 85, 0.14); color: var(--red); }
.win-btn svg { width: 10px; height: 10px; }

/* ══ APP BODY ══ */
.app-body {
    flex: 1;
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    min-height: 0;
}

/* ══ SIDEBAR (macOS navigation rail) ══ */
.sidebar {
    background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    min-height: 0;
    backdrop-filter: blur(var(--blur-2));
    -webkit-backdrop-filter: blur(var(--blur-2));
}

.side-nav { flex: 1; min-height: 0; }

.nav-label {
    font-size: 8.5px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--tx3);
    opacity: 0.7;
    padding: 14px 14px 4px 16px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 1px 10px;
    padding: 9px 14px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--tx3);
    font-family: var(--font);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.16s ease;
    text-decoration: none;
    position: relative;
    opacity: 0.85;
}

.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; transition: 0.16s; }

.nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--tx2);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--blue-a22);
    color: var(--blue3);
    box-shadow: 0 0 0 2px rgba(88, 102, 242, 0.12);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 9px;
    bottom: 9px;
    width: 3px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--blue), var(--cyan));
}

.nav-item.active svg { color: var(--blue3); }

.side-foot {
    border-top: 1px solid var(--line);
    padding: 10px 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.side-fuser {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    flex: 1;
    padding: 8px 11px;
    border-radius: 9px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.03);
    text-decoration: none;
    transition: 0.16s;
}

.side-fuser:hover { background: rgba(255, 255, 255, 0.06); }
.side-fuser img { width: 28px; height: 28px; border-radius: 7px; flex-shrink: 0; border: 1px solid var(--line2); }
.side-fuser .sf-name { font-size: 11.5px; font-weight: 600; color: var(--tx); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-fuser .sf-sub { font-size: 9.5px; color: var(--tx3); font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-fuser .sf-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; margin-left: auto; }
.side-fuser .sf-dot.online { background: var(--green2); box-shadow: 0 0 6px var(--green2); }

.side-logout {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--tx3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.15s;
    flex-shrink: 0;
    text-decoration: none;
}
.side-logout svg { width: 13px; height: 13px; }
.side-logout:hover { background: rgba(255, 85, 85, 0.14); color: var(--red); }

/* ══ MAIN COLUMN ══ */
.main-col {
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Top strip — integrated into window, not a separate bar */
.top-strip {
    flex-shrink: 0;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 22px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(10, 16, 28, 0.40), rgba(10, 16, 28, 0.30));
}

.ts-crumb { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--tx3); min-width: 0; }
.ts-crumb .ts-brand { color: var(--blue3); font-weight: 700; font-size: 11.5px; letter-spacing: 0.3px; }
.ts-crumb b { color: var(--tx); font-weight: 600; font-size: 11.5px; }
.ts-crumb .ts-sep { color: var(--tx3); opacity: 0.6; font-size: 10px; }

.ts-right { display: flex; align-items: center; gap: 10px; }
.ts-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: 0.15s;
    text-decoration: none;
}
.ts-user:hover { background: rgba(255, 255, 255, 0.06); border-color: var(--line2); }
.ts-user img { width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--line2); }
.ts-user span { font-size: 11.5px; font-weight: 600; color: var(--tx); }
.ts-user .ts-u-dot { width: 7px; height: 7px; border-radius: 50%; margin-left: 1px; }

.ts-link {
    color: var(--tx3);
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border-radius: 7px;
    transition: 0.14s;
}
.ts-link:hover { color: var(--red); background: rgba(245, 85, 85, 0.08); }
.ts-link svg { width: 12px; height: 12px; }

/* ══ CONTENT AREA ══ */
.content {
    flex: 1;
    overflow-y: auto;
    padding: 22px 26px;
    min-height: 0;
    animation: ntFadeIn 0.28s ease;
}
@keyframes ntFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.content::-webkit-scrollbar { width: 5px; }
.content::-webkit-scrollbar-thumb { background: var(--line-a22); border-radius: 4px; }

/* ══ PAGE HEAD ══ */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.page-head h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--tx);
    display: flex;
    align-items: center;
    gap: 10px;
}
.page-head h1 .h-emoji { font-size: 15px; }
.page-head p { font-size: 12px; color: var(--tx3); line-height: 1.5; }

.page-head-actions { display: flex; gap: 8px; align-items: center; }

/* ══ GRID SYSTEM ══ */
.grid-2 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 20px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.inline { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ══ TYPOGRAPHY (Apple-inspired) ══ */
h1 { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; }
h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.2px; }
h3 { font-size: 13px; font-weight: 600; letter-spacing: -0.1px; }
h4 { font-size: 11.5px; font-weight: 600; }
p { font-size: 13px; line-height: 1.55; color: var(--tx2); }
.caption { font-size: 11px; color: var(--tx3); line-height: 1.5; }
.micro { font-size: 9.5px; font-weight: 600; letter-spacing: 0.8px; text-transform: uppercase; color: var(--tx3); }

/* ══ BUTTONS (native controls) ══ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 34px;
    padding: 0 14px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    color: var(--tx2);
    font-family: var(--font);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.16s ease;
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
}
.btn:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--tx);
}
.btn:active { transform: translateY(0.5px) scale(0.985); }

.btn-primary {
    background: linear-gradient(135deg, #2A7BFF, #00C4FF);
    border: 1px solid rgba(42, 123, 255, 0.4);
    color: #fff;
    box-shadow: 0 4px 18px rgba(42, 123, 255, 0.30);
}
.btn-primary:hover {
    box-shadow: 0 6px 24px rgba(42, 123, 255, 0.38);
    filter: brightness(1.04);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--line);
    color: var(--tx3);
}
.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--tx2);
}

.btn-danger {
    background: rgba(255, 85, 85, 0.12);
    border: 1px solid rgba(255, 85, 85, 0.32);
    color: #FF8A96;
}
.btn-danger:hover {
    background: rgba(255, 85, 85, 0.20);
    color: #FFB0B8;
}

.btn-sm { height: 30px; padding: 0 11px; font-size: 11.5px; border-radius: 7px; }
.btn-lg { height: 40px; padding: 0 22px; font-size: 13.5px; border-radius: 11px; }
.btn-block { width: 100%; }

/* Secondary action — glass tint */
.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--tx2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.10);
    color: var(--tx);
}

/* ══ INPUTS (macOS/iOS style) ══ */
.input-field, .select-box {
    height: 36px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    color: var(--tx);
    font-family: var(--font);
    font-size: 12.5px;
    outline: none;
    transition: all 0.16s ease;
    width: 100%;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.input-field:focus, .select-box:focus {
    border-color: var(--blue3);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.16);
    background: rgba(255, 255, 255, 0.05);
}
.input-field::placeholder { color: var(--tx3); }
.input-field:disabled { opacity: 0.4; cursor: not-allowed; }
.input-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--tx3);
    margin-bottom: 6px;
}

.search-box { position: relative; flex: 1; min-width: 200px; max-width: 420px; }
.search-box svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--tx3); }
.search-box input { height: 36px; padding: 0 12px 0 38px; border-radius: 10px; }

select.input-field {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235C6A86' stroke-width='2.2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
    background-size: 13px;
    padding-right: 34px;
}

.input-group { margin-bottom: 0; }

/* ══ SWITCHES (iOS-style) ══ */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--line);
    transition: 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
    border-radius: 999px;
}
.slider:before {
    position: absolute; content: "";
    height: 16px; width: 16px;
    left: 3px; bottom: 3px;
    background: #b8c4d8;
    transition: 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
    border-radius: 50%;
}
input:checked + .slider {
    background: linear-gradient(135deg, #2A7BFF, #00C4FF);
    border-color: rgba(42, 123, 255, 0.50);
}
input:checked + .slider:before { transform: translateX(18px); background: #fff; }

/* ═= TOGGLES ══ */
.toggle-switch { position: relative; display: inline-block; width: 42px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-switch .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line); transition: 0.24s; border-radius: 999px; }
.toggle-switch .slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px; background: #b8c4d8; transition: 0.24s; border-radius: 50%; }
.toggle-switch input:checked + .slider { background: linear-gradient(135deg, #2A7BFF, #00C4FF); border-color: rgba(42, 123, 255, 0.50); }
.toggle-switch input:checked + .slider:before { transform: translateX(18px); background: #fff; }

/* ══ BADGES / CHIPS ══ */
.badge, .tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.4px;
    white-space: nowrap;
}
.badge-green, .tag.online, .tag.done { background: rgba(34, 211, 138, 0.14); border: 1px solid rgba(34, 211, 138, 0.34); color: var(--green2); }
.badge-orange, .tag.warn { background: rgba(255, 165, 0, 0.12); border: 1px solid rgba(255, 165, 0, 0.32); color: var(--orange2); }
.badge-red, .tag.error { background: rgba(255, 85, 85, 0.12); border: 1px solid rgba(255, 85, 85, 0.32); color: #FF8A96; }
.badge-blue, .tag { background: rgba(56, 189, 248, 0.12); border: 1px solid rgba(56, 189, 248, 0.30); color: var(--blue3); }
.badge-gray, .tag { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); color: var(--tx3); }
.badge-cyan, .tag { background: rgba(34, 211, 209, 0.12); border: 1px solid rgba(34, 211, 209, 0.30); color: var(--cyan); }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.10);
    border: 1px solid rgba(56, 189, 248, 0.24);
    color: #93F0FF;
    font-size: 10.5px;
    font-weight: 700;
}

/* ══ LISTS / ROWS ══ */
.list { display: flex; flex-direction: column; gap: 6px; }
.list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 13px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.16s ease;
    font-size: 12.5px;
}
.list-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--line);
}

/* ══ TABS / SEG ══ */
.seg {
    display: inline-flex;
    padding: 3px;
    gap: 2px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
    border-radius: 10px;
}
.seg-btn {
    height: 30px;
    padding: 0 14px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--tx3);
    font-family: var(--font);
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.16s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.seg-btn svg { width: 13px; height: 13px; }
.seg-btn:hover { color: var(--tx2); }
.seg-btn.active {
    background: rgba(255, 255, 255, 0.08);
    color: var(--tx);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.tabs {
    display: flex;
    gap: 2px;
    padding: 3px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 16px;
}
.tab {
    padding: 7px 14px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--tx3);
    border: none;
    background: transparent;
    border-radius: 7px;
    cursor: pointer;
    transition: 0.16s ease;
}
.tab:hover { color: var(--tx2); }
.tab.active {
    background: rgba(255, 255, 255, 0.07);
    color: var(--tx);
}

/* ══ DROPDOWNS / MENUS ══ */
.dropdown { position: relative; }
.dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 190px;
    background: rgba(14, 22, 40, 0.72);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 5px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 100;
    display: none;
    animation: menuIn 0.18s ease;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu .menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 11px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--tx2);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.14s ease;
}
.dropdown-menu .menu-item:hover { background: rgba(255, 255, 255, 0.06); color: var(--tx); }
.dropdown-menu .menu-item svg { width: 14px; height: 14px; opacity: 0.75; flex-shrink: 0; }
.dropdown-menu .menu-item.danger { color: #FF8A96; }
.dropdown-menu .menu-item.danger:hover { background: rgba(255, 85, 85, 0.12); }
.dropdown-menu .menu-sep { height: 1px; background: var(--line); margin: 5px 4px; }

@keyframes menuIn { from { opacity: 0; transform: translateY(-4px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ══ TOAST ══ */
.toast {
    position: fixed;
    top: 64px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: rgba(10, 16, 28, 0.84);
    border: 1px solid var(--line);
    color: var(--tx);
    font-size: 12px;
    font-weight: 500;
    padding: 9px 18px;
    border-radius: 11px;
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.42);
    display: flex;
    align-items: center;
    gap: 9px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.22s ease;
    z-index: 300;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast .t-ic { width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.toast .t-ic svg { width: 10px; height: 10px; }
.toast.t-ok .t-ic { background: rgba(34, 211, 138, 0.16); color: var(--green2); border: 1px solid rgba(34, 211, 138, 0.34); }
.toast.t-err .t-ic { background: rgba(255, 85, 85, 0.16); color: #FF8A96; border: 1px solid rgba(255, 85, 85, 0.34); }
.toast.t-info .t-ic { background: rgba(56, 189, 248, 0.16); color: var(--blue3); border: 1px solid rgba(56, 189, 248, 0.34); }

/* ══ CONTEXT MENU ══ */
.ctx-menu {
    position: fixed;
    z-index: 200;
    min-width: 200px;
    background: rgba(14, 22, 40, 0.76);
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 5px;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.46);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: none;
    animation: menuIn 0.16s ease;
}
.ctx-menu.show { display: block; }
.ctx-menu .menu-item { width: 100%; display: flex; align-items: center; gap: 9px; padding: 8px 11px; border: none; border-radius: 8px; background: transparent; color: var(--tx2); font-family: var(--font); font-size: 12px; cursor: pointer; text-align: left; transition: 0.13s; }
.ctx-menu .menu-item:hover { background: rgba(255, 255, 255, 0.06); color: var(--tx); }
.ctx-menu .menu-item.danger { color: #FF8A96; }
.ctx-menu .menu-item.danger:hover { background: rgba(255, 85, 85, 0.12); }
.ctx-menu .menu-item svg { width: 13.5px; height: 13.5px; opacity: 0.75; flex-shrink: 0; }
.ctx-menu .menu-sep { height: 1px; background: var(--line); margin: 5px 4px; }
.ctx-menu .menu-sub { color: var(--tx3); font-size: 10px; padding: 4px 11px 7px; }

/* ══ MODAL / SHEETS ══ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.40);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 250;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeAppear 0.2s ease;
}
.modal-content {
    max-height: calc(100vh - 48px);
    overflow-y: auto;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--line);
}
.modal-header h2 { font-size: 15px; font-weight: 600; }
.modal-close {
    width: 26px; height: 26px;
    border-radius: 7px;
    border: none;
    background: transparent;
    color: var(--tx3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.14s;
}
.modal-close:hover { background: rgba(255, 255, 255, 0.06); color: var(--tx); }
.modal-actions { display: flex; gap: 8px; margin-top: 18px; justify-content: flex-end; }

/* ══ PROGRESS ══ */
.progress-wrap { width: 100%; height: 5px; background: rgba(255, 255, 255, 0.06); border-radius: 6px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #2A7BFF, #00C4FF); border-radius: 6px; transition: width 0.4s ease; }

/* ══ DIVIDERS ══ */
.divider { border: none; height: 1px; background: var(--line); margin: 18px 0; }
.divider-dashed { border: none; height: 1px; border-top: 1px dashed var(--line); margin: 16px 0; }

/* ══ UTILITIES ══ */
.muted { color: var(--tx3); }
.mono { font-family: var(--mono); }
.text-click { color: var(--blue3); cursor: pointer; text-decoration: none; }
.text-click:hover { text-decoration: underline; }

/* ══ RESPONSIVE ══ */
@media (max-width: 1280px) {
    .grid-2 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    #xentro-root { padding: 16px; }
}

@media (max-width: 900px) {
    #xentro-root { padding: 10px; }
    .app-body { grid-template-columns: 68px minmax(0, 1fr); }
    .sidebar { padding: 8px; }
    .sidebar .nav-label { display: none; }
    .sidebar .nav-item { justify-content: center; padding: 8px 0; }
    .sidebar .nav-item span { display: none; }
    .sidebar .nav-item::before { display: none; }
    .sidebar .side-foot { justify-content: center; }
    .sidebar .side-fuser { display: none; }
    .content { padding: 16px 16px 56px; }
    .grid-3, .form-grid { grid-template-columns: 1fr; }
    .modal-overlay { padding: 12px; }
}