/* ==========================================================================
   OBSCURA CLOUD // LUXURY NEON HOT PINK & PURE WHITE DESIGN SYSTEM
   ========================================================================== */

:root {
    /* Base Obsidian Tones */
    --bg-base: #07080c;
    --bg-surface: #0c0e15;
    --bg-card: rgba(16, 18, 27, 0.9);
    --bg-card-hover: rgba(26, 24, 38, 0.95);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(255, 0, 127, 0.4);

    /* Luxury Obscura Pink & Crisp Pure White */
    --accent-pink: #ff007f;
    --accent-pink-hover: #ff2a8d;
    --accent-pink-glow: rgba(255, 0, 127, 0.35);
    --accent-pink-soft: rgba(255, 0, 127, 0.14);
    
    --accent-green: #00ff88;
    --accent-amber: #ffaa00;
    --accent-red: #ff3366;
    --accent-purple: #c77dff;

    /* High-Contrast Balanced Typography */
    --text-pure-white: #ffffff;
    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    --sidebar-width: 260px;
    --header-height: 64px;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 18px;

    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --shadow-pink-glow: 0 0 25px rgba(255, 0, 127, 0.25);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.55);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    background-color: var(--bg-base);
    color: var(--text-primary);
}

body, body.pink-theme {
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(circle at 15% 10%, rgba(255, 0, 127, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 85% 90%, rgba(123, 44, 191, 0.06) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(12, 14, 21, 0.6) 0%, transparent 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Glassmorphism Surface Base */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    z-index: 1;
}

.glass-panel:hover {
    border-color: rgba(255, 0, 127, 0.3);
    box-shadow: 0 12px 38px rgba(255, 0, 127, 0.12), var(--shadow-card);
}

/* App Layout & Container */
.app-container, .app-layout {
    display: flex;
    min-height: 100vh;
    background: transparent;
    position: relative;
    z-index: 2;
}

/* ==========================================================================
   SIDEBAR NAVIGATION
   ========================================================================== */
.sidebar {
    width: var(--sidebar-width);
    background: #0a0c13;
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-brand {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    font-size: 24px;
    filter: drop-shadow(0 0 10px var(--accent-pink));
}

.brand-info {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: var(--text-pure-white);
}

.text-pink {
    color: var(--accent-pink);
    text-shadow: 0 0 12px var(--accent-pink-glow);
}

.brand-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.nav-item:hover {
    color: var(--text-pure-white);
    background: rgba(255, 255, 255, 0.06);
}

.nav-item.active {
    background: var(--accent-pink-soft);
    border-color: rgba(255, 0, 127, 0.35);
    color: var(--text-pure-white);
    font-weight: 700;
    box-shadow: 0 0 18px rgba(255, 0, 127, 0.15);
}

.nav-item.active .nav-icon {
    filter: drop-shadow(0 0 8px var(--accent-pink));
}

.nav-icon {
    font-size: 18px;
}

.badge-live {
    margin-left: auto;
    font-size: 10px;
    font-family: var(--font-mono);
    padding: 2px 7px;
    background: rgba(0, 255, 136, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(0, 255, 136, 0.35);
    border-radius: 4px;
    font-weight: bold;
    animation: pulse 2s infinite;
}

.badge-pink {
    margin-left: auto;
    font-size: 10px;
    font-family: var(--font-mono);
    padding: 2px 7px;
    background: var(--accent-pink-soft);
    color: var(--accent-pink);
    border: 1px solid rgba(255, 0, 127, 0.35);
    border-radius: 4px;
    font-weight: bold;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.25);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-pink), #7b2cbf);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: #fff;
    box-shadow: 0 0 10px var(--accent-pink-glow);
}

.user-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-pure-white);
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 15px;
}

.btn-logout:hover {
    border-color: var(--accent-red);
    color: var(--accent-red);
    background: rgba(255, 0, 85, 0.1);
}

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 32px 36px;
    max-width: 1450px;
    width: calc(100% - var(--sidebar-width));
    background: transparent;
}

/* Mobile Header */
.mobile-header {
    display: none;
    height: var(--header-height);
    background: #0a0c13;
    border-bottom: 1px solid var(--border-subtle);
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.mobile-header .brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 800;
    color: #fff;
}

.mobile-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-status-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(0, 255, 136, 0.12);
    border: 1px solid rgba(0, 255, 136, 0.35);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--accent-green);
}

.btn-menu-toggle {
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    width: 36px;
    height: 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.btn-menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text-pure-white);
    border-radius: 2px;
}

/* Top Bar (Desktop) */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-pure-white);
    letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.page-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-family: var(--font-mono);
    color: var(--text-pure-white);
    padding: 7px 16px;
    background: rgba(16, 18, 27, 0.95);
    border: 1px solid rgba(0, 255, 136, 0.35);
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 12px rgba(0, 255, 136, 0.12);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-indicator.online {
    background: var(--accent-green);
    box-shadow: 0 0 10px var(--accent-green);
}

.status-indicator.offline {
    background: var(--accent-red);
    box-shadow: 0 0 10px var(--accent-red);
}

/* ==========================================================================
   BUTTONS & CONTROLS
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
}

.btn-sm {
    padding: 7px 14px;
    font-size: 13px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-pink) 0%, #d9006c 100%);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 4px 18px rgba(255, 0, 127, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
    box-shadow: 0 6px 26px rgba(255, 0, 127, 0.65);
    transform: translateY(-2px);
    color: #ffffff;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--text-pure-white);
    font-weight: 600;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.28);
    color: #ffffff;
}

.btn-danger {
    background: rgba(255, 0, 85, 0.16);
    border: 1px solid rgba(255, 0, 85, 0.45);
    color: #ff4d6d;
    font-weight: 600;
}

.btn-danger:hover {
    background: rgba(255, 0, 85, 0.3);
    box-shadow: 0 0 16px rgba(255, 0, 85, 0.4);
    color: #ffffff;
}

.btn-block {
    width: 100%;
}

.btn-group {
    display: inline-flex;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 3px;
    gap: 4px;
}

.btn-tab-pill {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-tab-pill.active {
    background: var(--accent-pink);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 0 12px var(--accent-pink-glow);
}

/* Tab Management */
.tab-pane {
    display: none;
    animation: fadeIn 0.25s ease forwards;
}

.tab-pane.active {
    display: block;
}

/* ==========================================================================
   DASHBOARD METRICS & WIDGETS
   ========================================================================== */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 18px;
    margin-bottom: 30px;
}

.metric-card {
    padding: 22px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
}

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

.metric-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1.1px;
    font-family: var(--font-mono);
}

.metric-icon {
    font-size: 18px;
}

.metric-value {
    font-size: 28px;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--text-pure-white);
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.progress-bar-wrap {
    height: 7px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}

.progress-fill.pink { background: var(--accent-pink); box-shadow: 0 0 10px var(--accent-pink); }
.progress-fill.white { background: #ffffff; box-shadow: 0 0 10px rgba(255, 255, 255, 0.7); }
.progress-fill.pink-light { background: #ff70a6; box-shadow: 0 0 10px #ff70a6; }

.metric-sub {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.status-ok {
    color: var(--accent-green) !important;
    font-weight: 600;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    font-size: 19px;
    font-weight: 800;
    color: var(--text-pure-white);
    letter-spacing: -0.3px;
}

.section-badge {
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* Bot Cards Grid */
.bots-grid, .bot-control-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 20px;
}

.bot-card {
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bot-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.bot-info-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-pure-white);
    letter-spacing: -0.3px;
}

.bot-info-engine {
    font-size: 13px;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    margin-top: 3px;
    line-height: 1.4;
}

.bot-info-engine code {
    background: rgba(255, 0, 127, 0.12);
    color: #ff94c2;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.badge-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    font-family: var(--font-mono);
    text-transform: uppercase;
}

.badge-status.online {
    background: rgba(0, 255, 136, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(0, 255, 136, 0.4);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.2);
}

.badge-status.offline, .badge-status.errored {
    background: rgba(255, 0, 85, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(255, 0, 85, 0.4);
}

/* Specification Tables (PID, Engine, RAM, Restarts) */
.spec-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(8, 10, 16, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
}

.spec-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding-bottom: 6px;
}

.spec-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.spec-label {
    color: var(--text-muted);
    font-weight: 500;
}

.spec-val {
    color: var(--text-pure-white);
    font-family: var(--font-mono);
    font-weight: 600;
}

.spec-val code {
    background: rgba(255, 0, 127, 0.12);
    color: #ff94c2;
    padding: 2px 6px;
    border-radius: 4px;
}

.bot-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 12px;
    background: rgba(8, 10, 16, 0.7);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.bot-stat-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bot-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.bot-stat-val {
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-pure-white);
}

.bot-actions-row {
    display: flex;
    gap: 10px;
    margin-top: auto;
    flex-wrap: wrap;
}

/* ==========================================================================
   24H ACTIVITY TREND CHART
   ========================================================================== */
.chart-panel {
    padding: 22px;
}

.neon-chart-svg {
    width: 100%;
    height: auto;
    max-height: 160px;
    filter: drop-shadow(0 0 10px rgba(255, 0, 127, 0.45));
}

.chart-footer-row {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 10px;
    border-top: 1px solid var(--border-subtle);
    padding-top: 10px;
}

/* ==========================================================================
   STREAMING CONSOLE & COMMAND RUNNER
   ========================================================================== */
.console-wrapper {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 180px);
    min-height: 580px;
}

.console-toolbar {
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: rgba(12, 14, 21, 0.95);
}

.toolbar-left, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.control-select, .search-box input {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-subtle);
    color: var(--text-pure-white);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.control-select:focus, .search-box input:focus {
    border-color: var(--accent-pink);
    box-shadow: 0 0 10px var(--accent-pink-glow);
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 10px;
    font-size: 12px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-box input {
    padding-left: 32px;
    width: 220px;
}

.command-chips-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: rgba(8, 9, 14, 0.8);
    border-bottom: 1px solid var(--border-subtle);
    overflow-x: auto;
}

.chips-label {
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-weight: bold;
    white-space: nowrap;
}

.cmd-chip {
    background: rgba(255, 0, 127, 0.1);
    border: 1px solid rgba(255, 0, 127, 0.3);
    color: #ff94c2;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-family: var(--font-mono);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.cmd-chip:hover {
    background: var(--accent-pink);
    color: #fff;
    box-shadow: 0 0 12px var(--accent-pink-glow);
}

.terminal-body {
    flex: 1;
    background: #050609;
    padding: 18px;
    font-family: var(--font-mono);
    font-size: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.terminal-line {
    word-break: break-all;
    white-space: pre-wrap;
    line-height: 1.6;
}

.terminal-line.info { color: #f1f5f9; }
.terminal-line.warn { color: var(--accent-amber); }
.terminal-line.error { color: var(--accent-red); font-weight: bold; }
.terminal-line.system-line { color: var(--accent-pink); font-weight: 600; }
.terminal-line.cmd-echo { color: #00ff88; font-weight: bold; }

.log-time {
    color: var(--text-dim);
    margin-right: 8px;
}

.log-tag {
    font-weight: bold;
    color: var(--accent-pink);
    margin-right: 8px;
}

.console-command-bar {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: #080a0f;
    border-top: 1px solid var(--border-subtle);
    gap: 12px;
}

.cmd-prompt-symbol {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: bold;
    color: var(--accent-pink);
    margin-left: 6px;
}

.cmd-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-pure-white);
    font-family: var(--font-mono);
    font-size: 13px;
}

.console-footer {
    padding: 8px 18px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    background: rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   FILE MANAGER & CODE EDITOR
   ========================================================================== */
.file-manager-wrapper {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 180px);
    min-height: 600px;
}

.fm-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    background: rgba(12, 14, 21, 0.95);
}

.fm-bot-switch {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fm-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-pure-white);
}

.fm-path-breadcrumbs {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent-pink);
    background: rgba(255, 0, 127, 0.1);
    padding: 5px 12px;
    border-radius: 4px;
    border: 1px solid rgba(255, 0, 127, 0.25);
}

.fm-body-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.fm-file-tree {
    width: 280px;
    background: rgba(8, 10, 15, 0.85);
    border-right: 1px solid var(--border-subtle);
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tree-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    transition: all 0.2s;
}

.tree-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-pure-white);
}

.tree-item.active {
    background: var(--accent-pink-soft);
    border: 1px solid rgba(255, 0, 127, 0.35);
    color: var(--text-pure-white);
    font-weight: 600;
}

.tree-icon {
    font-size: 14px;
}

.fm-editor-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #050608;
}

.fm-editor-toolbar {
    padding: 10px 18px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #090b10;
}

.editor-file-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.editor-filename {
    font-size: 13px;
    font-family: var(--font-mono);
    font-weight: bold;
    color: var(--text-pure-white);
}

.editor-filesize {
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.badge-modified {
    font-size: 10px;
    font-family: var(--font-mono);
    background: rgba(255, 170, 0, 0.2);
    color: var(--accent-amber);
    padding: 2px 6px;
    border-radius: 4px;
}

.code-editor-textarea {
    flex: 1;
    background: #050608;
    border: none;
    outline: none;
    color: #e2e8f0;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    padding: 18px;
    resize: none;
    white-space: pre;
    overflow: auto;
}

/* ==========================================================================
   BACKUP STORAGE VAULT
   ========================================================================== */
.backups-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.backup-header-card {
    padding: 26px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    border-color: rgba(255, 0, 127, 0.3);
    background: linear-gradient(135deg, rgba(255, 0, 127, 0.12) 0%, rgba(16, 18, 28, 0.95) 100%);
}

.backup-header-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.backup-vault-icon {
    font-size: 42px;
    filter: drop-shadow(0 0 15px var(--accent-pink));
}

.backup-vault-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-pure-white);
}

.backup-vault-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.backup-header-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.storage-metric-summary {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.storage-metric-num {
    font-size: 24px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-pure-white);
}

.storage-metric-label {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.backup-table-panel {
    padding: 24px;
}

/* ==========================================================================
   TABLES & DATA GRIDS
   ========================================================================== */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.data-table th {
    padding: 13px 14px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    background: rgba(0, 0, 0, 0.25);
}

.data-table td {
    padding: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.loading-cell {
    text-align: center;
    padding: 30px !important;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.btn-download-backup {
    background: rgba(255, 0, 127, 0.15);
    border: 1px solid rgba(255, 0, 127, 0.35);
    color: #fff;
    padding: 5px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    font-family: var(--font-mono);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-download-backup:hover {
    background: var(--accent-pink);
    box-shadow: 0 0 12px var(--accent-pink-glow);
}

/* ==========================================================================
   SETTINGS & HOST DETAILS
   ========================================================================== */
.settings-grid, .metrics-detail-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 20px;
}

.settings-card, .detail-card, .audit-panel {
    padding: 24px;
    background: var(--bg-card);
}

.settings-card h3, .detail-card h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-pure-white);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
}

.audit-badge {
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.06);
    padding: 3px 8px;
    border-radius: 4px;
}

/* Environment Variable Manager */
.env-key-cell {
    font-family: var(--font-mono);
    font-weight: bold;
    color: var(--accent-pink);
    font-size: 12px;
}

.env-val-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    color: var(--text-pure-white);
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 7px 12px;
    outline: none;
    transition: border-color 0.2s;
}

.env-val-input:focus {
    border-color: var(--accent-pink);
    box-shadow: 0 0 10px var(--accent-pink-glow);
}

.btn-eye-toggle {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
    transition: color 0.2s;
}

.btn-eye-toggle:hover {
    color: var(--text-pure-white);
}

/* Form Controls */
.form-group {
    margin-bottom: 16px;
}

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

.form-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-pure-white);
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-input:focus {
    border-color: var(--accent-pink);
    box-shadow: 0 0 12px var(--accent-pink-glow);
}

/* Switch Toggle */
.switch-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.12);
    transition: .3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--accent-pink);
    box-shadow: 0 0 12px var(--accent-pink-glow);
}

input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

/* ==========================================================================
   MODALS & AUTH OVERLAYS
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-card {
    width: 100%;
    max-width: 440px;
    padding: 28px;
    box-shadow: 0 12px 50px rgba(0, 0, 0, 0.95);
    border-color: rgba(255, 0, 127, 0.35);
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.modal-title { font-size: 18px; font-weight: 800; color: var(--text-pure-white); }
.modal-body { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; line-height: 1.6; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; }

/* Login Modal */
.login-card {
    width: 100%;
    max-width: 420px;
    padding: 36px;
    box-shadow: var(--shadow-pink-glow), 0 20px 60px rgba(0, 0, 0, 0.9);
    border-color: var(--border-glow);
}

.login-brand { text-align: center; margin-bottom: 24px; }
.login-title { font-size: 21px; font-weight: 800; letter-spacing: 0.8px; margin-top: 8px; color: var(--text-pure-white); }
.login-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.login-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 3px;
    margin-bottom: 22px;
    gap: 4px;
}

.login-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 9px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.login-tab-btn.active {
    background: var(--accent-pink);
    color: #fff;
    box-shadow: 0 0 12px var(--accent-pink-glow);
}

.qr-container-box {
    position: relative;
    display: inline-block;
    padding: 12px;
    background: #000;
    border: 2px solid var(--accent-pink);
    border-radius: 12px;
    box-shadow: 0 0 30px var(--accent-pink-glow);
    overflow: hidden;
    margin: 8px auto 14px auto;
}

.qr-code-img {
    display: block;
    width: 220px;
    height: 220px;
    border-radius: 6px;
}

.qr-scan-line {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #ff007f, #ffffff, #ff007f, transparent);
    box-shadow: 0 0 14px #ff007f;
    animation: qrScanLaser 2.2s infinite ease-in-out;
}

@keyframes qrScanLaser {
    0% { top: 0; opacity: 0.8; }
    50% { top: calc(100% - 3px); opacity: 1; }
    100% { top: 0; opacity: 0.8; }
}

.qr-status-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-pure-white);
    font-weight: 600;
    margin-bottom: 4px;
}

.qr-timer-text {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
}

.login-error {
    color: var(--accent-red);
    font-size: 13px;
    margin-bottom: 16px;
    display: none;
    background: rgba(255, 0, 85, 0.12);
    border: 1px solid rgba(255, 0, 85, 0.3);
    padding: 8px 12px;
    border-radius: 6px;
}

.login-footer {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-top: 20px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 2000;
}

.toast {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 12px 18px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
    animation: slideUp 0.3s ease;
}

.toast.success { border-color: var(--accent-green); color: var(--accent-green); }
.toast.error { border-color: var(--accent-red); color: var(--accent-red); }
.toast.info { border-color: var(--accent-pink); color: #fff; }

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

/* Sidebar Backdrop (Mobile Drawer) */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
    display: block;
    opacity: 1;
    pointer-events: all;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS & MOBILE COMPATIBILITY
   ========================================================================== */
@media (max-width: 900px) {
    /* Critical: Stack header vertically above main-content on mobile */
    .app-container, .app-layout {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        min-height: 100vh;
        overflow-x: hidden;
    }

    .mobile-header {
        display: flex !important;
        width: 100% !important;
        height: 60px;
        position: sticky;
        top: 0;
        z-index: 100;
        background: #090b12;
        border-bottom: 1px solid var(--border-subtle);
        padding: 0 16px;
        box-sizing: border-box;
    }

    .sidebar {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 280px !important;
        max-width: 82vw !important;
        background: #08090f !important;
        border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
        transform: translateX(-100%);
        z-index: 1000 !important;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        display: flex;
        flex-direction: column;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 12px 0 60px rgba(0, 0, 0, 0.95), 0 0 35px rgba(255, 0, 127, 0.2);
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 16px 14px 40px 14px !important;
        box-sizing: border-box !important;
        display: block !important;
        overflow-x: hidden !important;
    }

    /* Keep page title clean and visible on mobile */
    .top-bar {
        display: flex !important;
        flex-direction: column;
        gap: 6px;
        margin-bottom: 18px;
    }

    .page-title {
        font-size: 22px;
        letter-spacing: -0.3px;
    }

    .page-desc {
        font-size: 13px;
        line-height: 1.4;
    }

    .top-actions {
        display: none !important;
    }

    /* Grids & Cards */
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
        margin-bottom: 20px;
    }

    .metric-card {
        padding: 16px 14px;
    }

    .metric-value {
        font-size: 22px;
        margin-bottom: 8px;
    }

    .metric-sub {
        font-size: 11px;
    }

    .bots-grid, .bot-control-cards {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }

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

    .bot-stats-row {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        padding: 10px;
    }

    .bot-stat-val {
        font-size: 13px;
    }

    .bot-actions-row {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .bot-actions-row .btn {
        flex: 1 1 calc(50% - 4px);
    }

    /* Chart */
    .chart-panel {
        padding: 16px 14px;
        margin-bottom: 20px;
    }

    .chart-container {
        overflow-x: auto;
    }

    /* Console */
    .console-wrapper {
        height: calc(100vh - 160px);
        min-height: 480px;
    }

    .console-toolbar {
        padding: 10px 12px;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .toolbar-left, .toolbar-right {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .control-select, .search-box, .search-box input {
        width: 100% !important;
    }

    .toolbar-right {
        flex-direction: row;
        justify-content: flex-end;
    }

    .terminal-body {
        padding: 12px;
        font-size: 11px;
    }

    /* File Manager */
    .file-manager-wrapper {
        height: auto;
        min-height: auto;
    }

    .fm-header {
        padding: 12px;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .fm-bot-switch {
        justify-content: space-between;
        width: 100%;
    }

    .fm-path-breadcrumbs {
        width: 100%;
        box-sizing: border-box;
        overflow-x: auto;
        white-space: nowrap;
    }

    .fm-body-layout {
        flex-direction: column;
    }

    .fm-file-tree {
        width: 100% !important;
        height: 190px !important;
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
    }

    .fm-editor-wrap {
        width: 100%;
        min-height: 360px;
    }

    .code-editor-textarea {
        padding: 12px;
        font-size: 12px;
        min-height: 320px;
    }

    /* Backup Vault */
    .backup-header-card {
        padding: 18px 14px;
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .backup-header-right {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    .storage-metric-summary {
        align-items: flex-start;
    }

    .backup-table-panel {
        padding: 16px 12px;
    }

    /* Settings & Details */
    .settings-grid, .metrics-detail-layout {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }

    .settings-card, .detail-card, .audit-panel {
        padding: 18px 14px;
    }

    /* Prevent mobile input zoom */
    .form-input, .env-val-input {
        font-size: 16px !important;
    }
}

@media (max-width: 480px) {
    .metrics-grid {
        grid-template-columns: 1fr !important;
    }

    .bot-actions-row .btn {
        flex: 1 1 100%;
    }

    .chart-footer-row {
        font-size: 9px;
    }
}
