/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Primary Colors */
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --secondary-hover: #475569;
    --success-color: #10b981;
    --success-hover: #059669;
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    --warning-color: #f59e0b;
    --warning-hover: #d97706;
    --info-color: #0ea5e9;
    --info-hover: #0284c7;

    /* Surface Colors */
    --background: #f8fafc;
    --surface: #ffffff;
    --surface-elevated: #ffffff;

    /* Text Colors */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-disabled: #cbd5e1;

    /* Border Colors */
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --border-dark: #cbd5e1;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Spacing Scale (4px base) */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-base: 16px;
    --space-lg: 20px;
    --space-xl: 24px;
    --space-2xl: 32px;
    --space-3xl: 48px;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Typography Scale */
    --font-size-xs: 10px;
    --font-size-sm: 12px;
    --font-size-base: 14px;
    --font-size-md: 14px;
    --font-size-lg: 16px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;
    --font-size-3xl: 32px;
    --font-size-4xl: 48px;

    /* Font Weights */
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;

    /* Line Heights */
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;

    /* Z-Index Scale */
    --z-base: 1;
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-modal: 1050;
    --z-overlay: 10000;

    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 200ms ease-in-out;
    --transition-slow: 300ms ease-in-out;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
}

/* Admin pages: reset header padding */
.admin-container header {
    padding: 0;
    margin-bottom: 0;
    text-align: left;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Admin Container */
.admin-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

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

.header-title {
    flex: 1;
}

.header-actions {
    display: flex;
    gap: 12px;
}

/* Controls */
.controls {
    margin: 20px 0;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .container {
        padding: 15px;
    }

    .section {
        padding: 20px;
    }
}

/* Accessibility */
.btn:focus,
input:focus,
select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ===========================
   Responsive Admin Layout
   =========================== */
@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr;
    }

    .overview-cards {
        grid-template-columns: 1fr;
    }

    .admin-container {
        padding: 15px;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ===========================
   Super Admin Navigation Styling
   =========================== */

/* Super Admin section - subtle purple/indigo tint */
.subnav-section.super-admin {
    background: linear-gradient(to bottom, rgba(139, 92, 246, 0.03), rgba(139, 92, 246, 0.06));
    border-left: 2px solid rgba(139, 92, 246, 0.2);
    padding-left: 15px;
    margin-left: 15px;
}

/* Super Admin section label - deeper purple */
.subnav-section.super-admin .subnav-label {
    color: #7c3aed;
    font-weight: 800;
}

.subnav-section.super-admin .subnav-label::before {
    background: linear-gradient(to bottom, #7c3aed, #a78bfa);
    width: 2px;
}

/* Super Admin subnav items */
.subnav-item.super-admin {
    color: #6b21a8;
}

.subnav-item.super-admin:hover {
    color: #7c3aed;
    background: rgba(139, 92, 246, 0.08);
}

.subnav-item.super-admin.active {
    color: #7c3aed;
    border-bottom-color: #7c3aed;
}

/* Mobile super admin styling */
@media (max-width: 900px) {
    .subnav-section.super-admin {
        border-left: none;
        padding-left: 0;
        margin-left: 0;
        background: rgba(139, 92, 246, 0.05);
    }
}

/* ===========================
   CSS Utility Classes
   =========================== */

/* === Layout Utilities === */
.flex-row {
    display: flex;
    flex-direction: row;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-start {
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.flex-end {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.flex-align-center {
    display: flex;
    align-items: center;
}

.flex-align-start {
    display: flex;
    align-items: flex-start;
}

.flex-align-end {
    display: flex;
    align-items: flex-end;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-1 {
    flex: 1;
}

.flex-shrink-0 {
    flex-shrink: 0;
}

/* Grid Utilities */
.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.grid-3col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
}

.grid-auto-fit {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

/* Gap Utilities */
.gap-xs {
    gap: 3px;
}

.gap-sm {
    gap: 8px;
}

.gap-md {
    gap: 10px;
}

.gap-base {
    gap: 15px;
}

.gap-lg {
    gap: 20px;
}

/* === Spacing Utilities === */
/* Margin Top */
.mt-xs {
    margin-top: 4px;
}

.mt-sm {
    margin-top: 8px;
}

.mt-md {
    margin-top: 15px;
}

.mt-lg {
    margin-top: 20px;
}

.mt-xl {
    margin-top: 30px;
}

/* Margin Bottom */
.mb-xs {
    margin-bottom: 4px;
}

.mb-sm {
    margin-bottom: 8px;
}

.mb-md {
    margin-bottom: 15px;
}

.mb-lg {
    margin-bottom: 20px;
}

.mb-xl {
    margin-bottom: 30px;
}

/* Margin Left */
.ml-sm {
    margin-left: 8px;
}

.ml-md {
    margin-left: 12px;
}

.ml-lg {
    margin-left: 20px;
}

/* Margin Right */
.mr-sm {
    margin-right: 8px;
}

.mr-md {
    margin-right: 10px;
}

/* Margin All */
.m-0 {
    margin: 0;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

/* Padding */
.p-sm {
    padding: 8px;
}

.p-md {
    padding: 12px;
}

.p-base {
    padding: 15px;
}

.p-lg {
    padding: 20px;
}

.p-xl {
    padding: 30px;
}

.px-sm {
    padding-left: 8px;
    padding-right: 8px;
}

.px-md {
    padding-left: 12px;
    padding-right: 12px;
}

.py-sm {
    padding-top: 8px;
    padding-bottom: 8px;
}

.py-md {
    padding-top: 12px;
    padding-bottom: 12px;
}

.pt-md {
    padding-top: 15px;
}

.pb-md {
    padding-bottom: 15px;
}

.pl-lg {
    padding-left: 20px;
}

/* === Typography Utilities === */
.text-xs {
    font-size: 10px;
}

.text-sm {
    font-size: 12px;
}

.text-base {
    font-size: 13px;
}

.text-md {
    font-size: 14px;
}

.text-lg {
    font-size: 15px;
}

.text-xl {
    font-size: 16px;
}

.text-2xl {
    font-size: 20px;
}

.text-3xl {
    font-size: 24px;
}

.text-4xl {
    font-size: 32px;
}

.text-5xl {
    font-size: 48px;
}

/* Text Colors */
.text-muted {
    color: #64748b;
}

.text-primary {
    color: #1e293b;
}

.text-danger {
    color: #dc2626;
}

.text-success {
    color: #10b981;
}

.text-warning {
    color: #856404;
}

.text-white {
    color: white;
}

.text-white-alpha-90 {
    color: rgba(255, 255, 255, 0.9);
}

.text-white-alpha-80 {
    color: rgba(255, 255, 255, 0.8);
}

.text-purple {
    color: #6b21a8;
}

/* Font Weights */
.text-normal {
    font-weight: 400;
}

.text-medium {
    font-weight: 500;
}

.text-semibold {
    font-weight: 600;
}

.text-bold {
    font-weight: bold;
}

/* Font Families */
.font-mono {
    font-family: 'Courier New', monospace;
}

/* Text Alignment */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

/* Text Transform */
.text-uppercase {
    text-transform: uppercase;
}

/* Letter Spacing */
.letter-spacing-wide {
    letter-spacing: 1px;
}

.letter-spacing-wider {
    letter-spacing: 8px;
}

/* Line Height */
.line-height-relaxed {
    line-height: 1.6;
}

/* === Component Classes === */

/* === State Classes === */
.hidden {
    display: none !important;
}

.visible {
    display: block;
}

.visible-inline {
    display: inline-block;
}

/* Width Utilities */
.width-full {
    width: 100%;
}

.width-auto {
    width: auto;
}

/* Opacity */
.opacity-90 {
    opacity: 0.9;
}

.opacity-80 {
    opacity: 0.8;
}

/* Background Colors */
.bg-white {
    background: white;
}

.bg-white-alpha-15 {
    background: rgba(255, 255, 255, 0.15);
}

.bg-white-alpha-20 {
    background: rgba(255, 255, 255, 0.2);
}

.bg-white-alpha-30 {
    background: rgba(255, 255, 255, 0.3);
}

.bg-white-alpha-95 {
    background: rgba(255, 255, 255, 0.95);
}

.bg-gray-light {
    background: #f1f5f9;
}

.bg-gray-lighter {
    background: #f8fafc;
}

/* Border Utilities */
.border-gray {
    border: 1px solid #cbd5e1;
}

.border-gray-light {
    border: 1px solid #e2e8f0;
}

.border-white-alpha-50 {
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.border-dashed {
    border: 2px dashed #cbd5e1;
}

.border-radius-sm {
    border-radius: 6px;
}

.border-radius-md {
    border-radius: 8px;
}

.border-radius-lg {
    border-radius: 12px;
}

/* Shadows */
.shadow-sm {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.shadow-md {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.shadow-lg {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.text-shadow-sm {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Cursor */
.cursor-pointer {
    cursor: pointer;
}

/* Overflow */
.overflow-auto {
    overflow: auto;
}

.overflow-y-auto {
    overflow-y: auto;
}

/* White Space */
.whitespace-nowrap {
    white-space: nowrap;
}

.word-break-all {
    word-break: break-all;
}

/* ===========================
   Additional Core Utilities (Phase 1)
   =========================== */

/* Visibility & Display */
.visible-flex {
    display: flex;
}

.visible-grid {
    display: grid;
}

/* Border Utilities - Directional */
.border-t {
    border-top: 1px solid var(--border-color);
}

.border-b {
    border-bottom: 1px solid var(--border-color);
}

.border-l {
    border-left: 1px solid var(--border-color);
}

.border-r {
    border-right: 1px solid var(--border-color);
}

.border-t-2 {
    border-top: 2px solid var(--border-color);
}

.border-b-2 {
    border-bottom: 2px solid var(--border-color);
}

.border-l-4 {
    border-left: 4px solid var(--border-color);
}

.border-none {
    border: none;
}

/* Transition Utilities */
.transition-fast {
    transition: var(--transition-fast);
}

.transition-base {
    transition: var(--transition-base);
}

.transition-slow {
    transition: var(--transition-slow);
}

.transition-all {
    transition: all var(--transition-base);
}

/* Position Utilities */
.position-relative {
    position: relative;
}

.position-absolute {
    position: absolute;
}

.position-fixed {
    position: fixed;
}

.position-sticky {
    position: sticky;
}

/* Z-Index Utilities */
.z-base {
    z-index: var(--z-base);
}

.z-dropdown {
    z-index: var(--z-dropdown);
}

.z-sticky {
    z-index: var(--z-sticky);
}

.z-modal {
    z-index: var(--z-modal);
}

.z-overlay {
    z-index: var(--z-overlay);
}

/* Height Utilities */
.h-full {
    height: 100%;
}

.h-auto {
    height: auto;
}

.min-h-screen {
    min-height: 100vh;
}

.max-h-400 {
    max-height: 400px;
}

/* Max Width Utilities */
.max-w-sm {
    max-width: 400px;
}

.max-w-md {
    max-width: 500px;
}

.max-w-lg {
    max-width: 600px;
}

.max-w-full {
    max-width: 100%;
}

/* Pointer Events */
.pointer-events-none {
    pointer-events: none;
}

.pointer-events-auto {
    pointer-events: auto;
}

/* User Select */
.user-select-none {
    user-select: none;
}

/* Additional Flex Utilities */
.justify-center {
    justify-content: center;
}

.justify-start {
    justify-content: flex-start;
}

.justify-end {
    justify-content: flex-end;
}

.items-start {
    align-items: flex-start;
}

.items-center {
    align-items: center;
}

.items-end {
    align-items: flex-end;
}

/* Additional Grid Utilities */
.grid-cols-1 {
    grid-template-columns: 1fr;
}

.grid-cols-4 {
    grid-template-columns: 1fr 1fr 1fr 1fr;
}

/* Additional Text Utilities */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Inset Utilities */
.inset-0 {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

/* Layout Utilities - Content Sections */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.full-width-section {
    background: var(--surface);
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

/* ===========================
   Additional Utilities (Phase 3 - host.html optimization)
   =========================== */

/* Padding Zero */
.p-0 {
    padding: 0;
}

.px-xs {
    padding-left: 4px;
    padding-right: 4px;
}

.py-xs {
    padding-top: 4px;
    padding-bottom: 4px;
}

/* Text Color Utilities */
.text-secondary-dark {
    color: #475569;
}

.text-danger-dark {
    color: #991b1b;
}

/* Typography Utilities */
.tracking-tight {
    letter-spacing: 0.5px;
}

/* Specific Height/Width Utilities */
.h-32 {
    height: 32px;
}

.h-40 {
    height: 40px;
}

.w-48 {
    width: 200px;
}

.h-48 {
    height: 200px;
}

/* Gap Utilities - Specific Values */
.gap-6 {
    gap: 6px;
}



/* Grid Display Utilities */
.grid-auto {
    display: grid;
}

/* ===========================
   Additional Utilities (Phase 3 - listen.html optimization)
   =========================== */

/* Display Block */
.block {
    display: block;
}

/* Border Width Utilities */
.border-2 {
    border-width: 2px;
}


/* Letter Spacing - Wide */
.tracking-wide {
    letter-spacing: 2px;
}


/* ===========================
   Additional Utilities (Phase 3 - admin files optimization)
   =========================== */

/* Cursor Utilities */
.cursor-help {
    cursor: help;
}

/* Additional Margin Utilities */
.ml-6 {
    margin-left: 6px;
}

.ml-auto {
    margin-left: auto;
}

/* Grid Column Span */
.col-span-2 {
    grid-column: span 2;
}

/* Warning/Alert Text Color */
.text-warning-dark {
    color: #9a3412;
}

/* Warning/Alert Backgrounds */
.bg-warning-light {
    background: #fff7ed;
}

.border-warning {
    border: 2px solid #fb923c;
}

/* Log Level / Status Colors */
.text-info-blue {
    color: #3b82f6;
}

.text-warning-orange {
    color: #f59e0b;
}

/* Width Utilities */
.w-120 {
    width: 120px;
}

.w-auto {
    width: auto;
}

.w-40 {
    width: 40px;
}

/* Table Utilities */
.border-collapse {
    border-collapse: collapse;
}

/* Border Top Width */
.border-t-1 {
    border-top-width: 1px;
}

/* ===========================
/* ===========================
   Consolidated Components (Phase 2)
   =========================== */

/* Metric Card Component (replaces duplicates in admin-monitoring, admin-baselines) */
