/* ==========================================================================
   OMNITRACE — STRICT MONOCHROME SaaS DESIGN SYSTEM
   Palette: Deep Pitch Black (#000), Matte Dark Gray (#0A0A0A, #121212, #171717), Crisp White (#FFF)
   Aesthetic: Linear / Figma / Vercel flat monochrome vector UI
   ========================================================================== */

:root {
    /* Backgrounds */
    --bg-root: #000000;
    --bg-surface: #0a0a0a;
    --bg-surface-elevated: #121212;
    --bg-surface-hover: #1c1c1c;
    --bg-surface-active: #262626;
    --bg-surface-highlight: #333333;

    /* Borders */
    --border-subtle: #1a1a1a;
    --border-default: #262626;
    --border-strong: #404040;
    --border-white: #ffffff;
    --border-focus: #ffffff;

    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #a3a3a3;
    --text-muted: #737373;
    --text-dim: #525252;
    --text-inverse: #000000;

    /* Accent & Inverted Tokens */
    --accent-solid: #ffffff;
    --accent-solid-text: #000000;
    --accent-subtle: #171717;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', 'Geist Mono', 'SFMono-Regular', Consolas, Menlo, monospace;

    /* Geometry */
    --radius-xs: 2px;
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-pill: 9999px;

    /* Layout */
    --sidebar-width: 260px;
    --navbar-height: 56px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html, body {
    background-color: var(--bg-root);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-root);
}
::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: var(--radius-xs);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--border-strong);
}

/* Typography Helpers */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.02em;
}

p {
    color: var(--text-secondary);
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.15s ease;
}
a:hover {
    color: var(--text-secondary);
}

code, pre, .mono {
    font-family: var(--font-mono);
}

/* ==========================================================================
   NAVBAR & MOBILE CONTROLS
   ========================================================================== */
.navbar {
    height: var(--navbar-height);
    background: var(--bg-root);
    border-bottom: 1px solid var(--border-default);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    padding: 0;
    transition: all 0.12s ease;
}

.mobile-menu-btn svg {
    width: 18px;
    height: 18px;
}

.mobile-menu-btn:hover, .mobile-menu-btn:active {
    background: var(--bg-surface-elevated);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    font-weight: 700;
    text-decoration: none;
}

.brand-logo-badge {
    width: 28px;
    height: 28px;
    background: var(--text-primary);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 800;
    border-radius: var(--radius-xs);
    letter-spacing: 0.05em;
}

.brand-logo-img {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border-default);
    object-fit: cover;
    display: block;
}

.brand-title {
    font-family: var(--font-mono);
    font-weight: 700;
    letter-spacing: 0.08em;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.user-avatar {
    width: 22px;
    height: 22px;
    border-radius: var(--radius-xs);
    object-fit: cover;
    border: 1px solid var(--border-default);
}

.nav-logout-btn {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-family: var(--font-mono);
    padding-left: 8px;
    border-left: 1px solid var(--border-default);
    text-decoration: none;
    transition: color 0.15s ease;
}
.nav-logout-btn:hover {
    color: var(--text-primary);
}

/* ==========================================================================
   APP LAYOUT & SIDEBAR
   ========================================================================== */
.app-container {
    display: flex;
    min-height: calc(100vh - var(--navbar-height));
    position: relative;
}

.mobile-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 240;
    display: none;
}
.mobile-sidebar-overlay.active {
    display: block;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-root);
    border-right: 1px solid var(--border-default);
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-default);
}

.sidebar-mobile-title {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.08em;
}

.sidebar-close-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
}
.sidebar-close-btn svg {
    width: 16px;
    height: 16px;
}
.sidebar-close-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.guild-header-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    overflow: hidden;
}

.guild-icon-badge {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-primary);
}


.guild-header-card > div:last-child {
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.guild-header-card h3 {
    font-size: 0.88rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.guild-header-card span {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid transparent;
    transition: all 0.12s ease;
    text-decoration: none;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-surface);
    border-color: var(--border-subtle);
}

.nav-link.active {
    color: var(--text-inverse);
    background: var(--text-primary);
    font-weight: 600;
    border-color: var(--text-primary);
}

.nav-link.active .nav-svg-icon {
    stroke: var(--text-inverse);
}

.nav-svg-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    stroke: currentColor;
    stroke-width: 2;
}

.main-content {
    flex: 1;
    min-width: 0;
    padding: 32px;
    background: var(--bg-root);
}

/* ==========================================================================
   PAGE HEADERS & BUTTONS
   ========================================================================== */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-default);
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.page-subtitle {
    font-size: 0.88rem;
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.12s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--text-primary);
    color: var(--text-inverse);
    border-color: var(--text-primary);
}
.btn-primary:hover {
    background: #e5e5e5;
    border-color: #e5e5e5;
    color: var(--text-inverse);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--border-default);
}
.btn-secondary:hover {
    background: var(--bg-surface-elevated);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.btn-freeze {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--border-default);
}
.btn-freeze.active {
    background: var(--text-primary);
    color: var(--text-inverse);
    border-color: var(--text-primary);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.78rem;
}

.btn-danger {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border-strong);
}
.btn-danger:hover {
    background: var(--text-primary);
    color: var(--text-inverse);
    border-color: var(--text-primary);
}

.admin-tab-btn.active {
    background: var(--text-primary);
    color: var(--text-inverse);
    border-color: var(--text-primary);
}

/* ==========================================================================
   CARDS & PANELS
   ========================================================================== */
.card, .stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 20px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.stat-label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

/* Status Pill / Badges */
.status-pill, .badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: var(--radius-xs);
    font-size: 0.72rem;
    font-family: var(--font-mono);
    font-weight: 600;
    border: 1px solid var(--border-default);
    background: var(--bg-surface);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-solid {
    background: var(--text-primary);
    color: var(--text-inverse);
    border-color: var(--text-primary);
}

.badge-outline {
    border-color: var(--border-strong);
    color: var(--text-primary);
    background: transparent;
}

.badge-alert {
    border-color: var(--border-white);
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    font-weight: 700;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-primary);
}

/* ==========================================================================
   FILTER TABS & TOOLBARS
   ========================================================================== */
.filter-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-subtle);
}

.filter-tab {
    padding: 5px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.12s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-tab:hover {
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.filter-tab.active {
    background: var(--text-primary);
    color: var(--text-inverse);
    border-color: var(--text-primary);
    font-weight: 600;
}

/* ==========================================================================
   EVENT STREAM & CARDS (LIVE FEED)
   ========================================================================== */
.stream-feed {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.event-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    transition: border-color 0.12s ease, background 0.12s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.event-card:hover {
    background: var(--bg-surface-elevated);
    border-color: var(--border-strong);
}

.event-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.event-card-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.event-icon-box {
    width: 24px;
    height: 24px;
    background: var(--bg-root);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.event-type-badge {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border-default);
    background: var(--bg-root);
    color: var(--text-primary);
    letter-spacing: 0.04em;
}

.event-title-text {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-timestamp {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.event-body-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.45;
    word-break: break-word;
}

.event-body-text strong {
    color: var(--text-primary);
}

.event-meta-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.event-meta-tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    background: var(--bg-root);
    border: 1px solid var(--border-subtle);
    padding: 2px 6px;
    border-radius: var(--radius-xs);
}

/* ==========================================================================
   DATA TABLES (EXPLORER)
   ========================================================================== */
.table-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    text-align: left;
}

.data-table th {
    background: var(--bg-surface-elevated);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-default);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background 0.1s ease;
    cursor: pointer;
}

.data-table tbody tr:hover {
    background: var(--bg-surface-hover);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ==========================================================================
   FORMS, INPUTS & CONTROLS
   ========================================================================== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.form-label {
    font-size: 0.78rem;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-control {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    padding: 8px 12px;
    outline: none;
    transition: border-color 0.12s ease;
}

.form-control:focus {
    border-color: var(--border-white);
}

.form-control::placeholder {
    color: var(--text-dim);
}

/* Range Slider */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: var(--border-default);
    border-radius: var(--radius-xs);
    outline: none;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: var(--radius-xs);
    background: var(--text-primary);
    cursor: pointer;
    border: 1px solid var(--bg-root);
}

/* Checkbox */
input[type="checkbox"] {
    accent-color: var(--text-primary);
    cursor: pointer;
}

/* ==========================================================================
   VOICE RADAR ROOMS GRID
   ========================================================================== */
.voice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.voice-room-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.voice-room-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-subtle);
}

.voice-room-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
}

.voice-member-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
}

.voice-member-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

/* ==========================================================================
   DOSSIER & HEATMAP (MONOCHROME 5-TIER)
   ========================================================================== */
.dossier-header-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.dossier-avatar {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    object-fit: cover;
}

.heatmap-grid {
    display: grid;
    grid-template-columns: 32px repeat(24, 1fr);
    gap: 4px;
    margin-top: 12px;
    align-items: center;
    min-width: 680px;
}

.heatmap-cell {
    aspect-ratio: 1;
    border-radius: 1px;
    border: 1px solid var(--border-subtle);
    background: #0d0d0d;
}
.heatmap-cell[data-level="1"] { background: #262626; }
.heatmap-cell[data-level="2"] { background: #525252; }
.heatmap-cell[data-level="3"] { background: #a3a3a3; }
.heatmap-cell[data-level="4"] { background: #ffffff; }

/* ==========================================================================
   SIDE DRAWER (INSPECTOR)
   ========================================================================== */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 200;
    display: none;
}
.drawer-overlay.active {
    display: block;
}

.drawer {
    position: fixed;
    top: 0;
    right: -480px;
    width: 480px;
    max-width: 100vw;
    height: 100vh;
    background: var(--bg-root);
    border-left: 1px solid var(--border-default);
    z-index: 201;
    display: flex;
    flex-direction: column;
    transition: right 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.drawer.active {
    right: 0;
}

.drawer-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-default);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.json-viewer {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 280px;
    overflow-y: auto;
}

.json-toggle-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    cursor: pointer;
}
.json-toggle-btn:hover {
    border-color: var(--border-strong);
    color: var(--text-primary);
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-white);
    color: var(--text-primary);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toast-in 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toast-in {
    from { transform: translateY(10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ==========================================================================
   MOBILE BOTTOM NAVIGATION (HIDDEN ON DESKTOP)
   ========================================================================== */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-default);
    z-index: 150;
    align-items: center;
    justify-content: space-around;
    padding: 0 6px;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.mobile-bottom-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 0;
    height: 100%;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.12s ease, transform 0.12s ease;
    padding: 4px 0;
}

.mobile-bottom-icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    transition: transform 0.12s ease;
}

.mobile-bottom-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-top: 3px;
    white-space: nowrap;
}

.mobile-bottom-item:active {
    transform: scale(0.92);
}

.mobile-bottom-item.active {
    color: var(--text-primary);
}

.mobile-bottom-item.active .mobile-bottom-icon {
    stroke: var(--text-primary);
    stroke-width: 2.2;
}

/* ==========================================================================
   RESPONSIVE UTILITIES & GRID HELPERS
   ========================================================================== */
.explorer-filter-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) auto;
    gap: 12px;
    align-items: flex-end;
}

.settings-channels-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.settings-actions-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.page-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.dossier-columns-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.rbac-add-group {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    margin-bottom: 18px;
}

/* ==========================================================================
   MEDIA QUERIES — TABLETS & IPADS (<= 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
    .main-content {
        padding: 24px;
    }
}

/* ==========================================================================
   MEDIA QUERIES — OFF-CANVAS SIDEBAR (<= 900px)
   ========================================================================== */
@media (max-width: 900px) {
    .mobile-menu-btn {
        display: inline-flex;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 280px;
        max-width: 85vw;
        height: 100vh;
        z-index: 250;
        transform: translateX(-100%);
        background: var(--bg-surface-elevated);
        border-right: 1px solid var(--border-strong);
        box-shadow: 8px 0 32px rgba(0, 0, 0, 0.9);
        overflow-y: auto;
        padding: 16px 14px;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .sidebar-mobile-header {
        display: flex;
    }

    .app-container {
        display: block;
    }

    .main-content {
        width: 100%;
        min-width: 0;
        padding: 20px 16px;
    }

    .drawer {
        width: 440px;
        max-width: 95vw;
    }
}

/* ==========================================================================
   MEDIA QUERIES — SMARTPHONES & MOBILE (<= 768px)
   ========================================================================== */
@media (max-width: 768px) {
    .navbar {
        padding: 0 14px;
        height: 54px;
    }

    .mobile-bottom-nav {
        display: flex;
    }

    .main-content {
        padding: 16px 12px 76px 12px;
    }

    /* Page Header */
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 18px;
        padding-bottom: 14px;
    }

    .page-title {
        font-size: 1.3rem;
    }

    .page-subtitle {
        font-size: 0.8rem;
    }

    .page-header-actions {
        width: 100%;
    }

    .page-header-actions .btn {
        flex: 1;
        justify-content: center;
    }

    /* Telemetry & Stats Grid (Mobile Responsive) */
    .stat-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px;
        margin-bottom: 18px;
    }

    .stat-grid .stat-card:last-child {
        grid-column: span 2;
    }

    .stat-card {
        padding: 12px 10px;
    }

    .stat-label {
        font-size: 0.68rem;
        margin-bottom: 6px;
    }

    .stat-value {
        font-size: 1.35rem;
    }

    /* Filter Toolbar Horizontal Scroll Bar */
    .filter-toolbar {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 6px;
        padding-bottom: 8px;
        margin-bottom: 14px;
        scrollbar-width: none;
    }

    .filter-toolbar::-webkit-scrollbar {
        display: none;
    }

    .filter-tab {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 6px 12px;
        font-size: 0.78rem;
    }

    /* Event Cards (Live Feed) */
    .event-card {
        padding: 10px 12px;
        gap: 6px;
    }

    .event-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .event-card-main {
        width: 100%;
        gap: 8px;
    }

    .event-timestamp {
        font-size: 0.68rem;
        align-self: flex-end;
        margin-top: -16px;
    }

    /* Explorer Forms */
    .explorer-filter-form {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .explorer-filter-form > div:last-child {
        display: flex;
        gap: 8px;
        width: 100%;
    }

    .explorer-filter-form > div:last-child .btn {
        flex: 1;
        justify-content: center;
    }

    /* Tables */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        border-radius: var(--radius-sm);
    }

    .data-table th, .data-table td {
        padding: 8px 10px;
        font-size: 0.75rem;
    }

    /* Voice Matrix */
    .voice-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* Settings Page */
    .settings-channels-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .settings-actions-group {
        flex-direction: column;
        width: 100%;
    }

    .settings-actions-group .btn {
        width: 100%;
        justify-content: center;
    }

    .rbac-add-group {
        flex-direction: column;
        gap: 8px;
    }

    .rbac-add-group .btn {
        width: 100%;
        justify-content: center;
    }

    /* Dossier Columns */
    .dossier-columns-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .dossier-header-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 16px;
        gap: 14px;
    }

    /* Fullscreen Inspector Side Drawer on Phones */
    .drawer {
        width: 100vw;
        max-width: 100vw;
        right: -100vw;
        border-left: none;
    }

    .drawer.active {
        right: 0;
    }

    /* Toast on mobile */
    #toast-container {
        bottom: 74px;
        right: 12px;
        left: 12px;
    }

    .toast {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================================
   MEDIA QUERIES — EXTRA SMALL SCREENS (<= 480px)
   ========================================================================== */
@media (max-width: 480px) {
    .navbar {
        padding: 0 10px;
        height: 52px;
    }

    .brand-title {
        font-size: 0.85rem;
    }

    .admin-badge-pill {
        padding: 4px 8px !important;
    }

    .admin-badge-text {
        display: none;
    }

    .user-badge {
        padding: 3px 8px;
    }

    .user-badge .user-name {
        max-width: 75px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .stat-card {
        padding: 10px 8px;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    .stat-label {
        font-size: 0.65rem;
    }

    .event-timestamp {
        margin-top: 0;
        align-self: flex-start;
    }
}

/* ==========================================================================
   LANDING / MAIN INITIAL SCREEN WITH STYLIZED HERO BACKGROUND
   ========================================================================== */
.landing-hero-container {
    position: relative;
    max-width: 1040px;
    margin: 10px auto 40px auto;
    padding: 24px 16px 60px 16px;
    text-align: center;
    z-index: 1;
}

/* Background stylized cybernetic grid & ambient glow */
.landing-bg-glow {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(ellipse 90% 65% at 50% 12%, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.45) 50%, var(--bg-root) 100%),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.55) 50%, var(--bg-root) 88%),
        url('/static/img/hero-bg.jpg');
    background-size: cover;
    background-position: top center;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 0;
    opacity: 0.85;
}

.landing-content {
    position: relative;
    z-index: 1;
}

/* Top System Pill Badge */
.landing-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(10, 10, 10, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-xs);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 28px;
    font-family: var(--font-mono);
    letter-spacing: 0.06em;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.landing-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #00e5ff;
    box-shadow: 0 0 8px #00e5ff;
    display: inline-block;
}

.landing-badge-divider {
    color: var(--border-strong);
}

/* Hero Typography */
.landing-title {
    font-size: 3.1rem;
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.04em;
    margin-bottom: 20px;
    color: #ffffff;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.9), 0 0 35px rgba(0, 229, 255, 0.06);
}

.landing-subtitle {
    font-size: 1.05rem;
    color: #a3a3a3;
    line-height: 1.65;
    margin-bottom: 38px;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.9);
}

/* Hero CTA Group */
.landing-cta-group {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-bottom: 60px;
}

.btn-hero {
    padding: 13px 32px;
    font-size: 0.95rem;
    font-weight: 700;
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.15), 0 4px 12px rgba(0, 0, 0, 0.5);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-hero:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 35px rgba(255, 255, 255, 0.28), 0 6px 16px rgba(0, 0, 0, 0.7);
}

.btn-hero-icon {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

/* Landing Feature Cards Grid */
.landing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    text-align: left;
}

.landing-card {
    background: rgba(10, 10, 10, 0.78);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.landing-card:hover {
    background: rgba(18, 18, 18, 0.92);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7), 0 0 25px rgba(0, 229, 255, 0.06);
}

.landing-card-header {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.landing-card-icon {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
    transition: color 0.15s ease;
}

.landing-card:hover .landing-card-icon {
    color: var(--text-primary);
}

.landing-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.landing-card-desc {
    font-size: 0.86rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Landing Footer */
.landing-footer {
    margin-top: 80px;
    padding-top: 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.landing-footer-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.landing-brand-tag {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--text-primary);
}

.landing-footer-links {
    display: flex;
    gap: 20px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    flex-wrap: wrap;
}

.landing-footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

.landing-footer-links a:hover {
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .landing-title {
        font-size: 2.2rem;
    }
    .landing-subtitle {
        font-size: 0.95rem;
    }
    .landing-hero-container {
        padding: 16px 10px 40px 10px;
    }
    .landing-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}


