/**
 * Dear Nobody Admin Dashboard
 * Brand: Black & White, Raleway/Poppins
 * Per Dear Nobody Branding Guide
 * Copyright 2025 Intelliquinte L.L.C.
 */

/* ============================================================================
   CSS VARIABLES - Per Dear Nobody Branding Guide
   ============================================================================ */

:root {
    /* Primary Colors - Per Branding Guide */
    --color-black: #000000;
    --color-secondary-black: #2C2C2C;
    --color-white: #FFFFFF;
    
    /* Gray Scale - Per Branding Guide */
    --color-gray-50: #FAFAFA;
    --color-gray-100: #F5F5F5;
    --color-gray-200: #C4C4C4;
    --color-gray-300: #A0A0A0;
    --color-gray-400: #757575;
    --color-gray-500: #404040;
    --color-gray-600: #2C2C2C;
    --color-gray-700: #1A1A1A;
    --color-gray-800: #000000;
    --color-gray-900: #000000;
    
    /* Status Colors - Per Branding Guide */
    --color-success: #2E7D32;
    --color-warning: #FFD700;
    --color-error: #D32F2F;
    --color-info: #1976d2;
    --color-pending: #f57c00;
    
    /* Primary */
    --color-primary: var(--color-black);
    --color-primary-hover: var(--color-secondary-black);
    --color-background: var(--color-white);
    --color-surface: var(--color-gray-50);
    --color-border: var(--color-gray-100);
    --color-text: var(--color-gray-700);
    --color-text-secondary: var(--color-gray-500);
    
    /* Typography - Raleway for readability, Poppins for numbers */
    --font-heading: 'Raleway', system-ui, -apple-system, sans-serif;
    --font-primary: 'Raleway', system-ui, -apple-system, sans-serif;
    --font-numbers: 'Poppins', sans-serif;
    --font-mono: 'Monaco', 'Consolas', 'Courier New', monospace;
    
    /* Spacing - Per Branding Guide */
    --space-05: 0.125rem;
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    
    /* Sizing */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --header-height: 64px;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
    
    /* Shadows - Per Branding Guide */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-surface: 0 8px 30px rgba(0, 0, 0, 0.25);
    
    /* Transitions - Per Branding Guide */
    --transition-fast: 0.2s ease-out;
    --transition-normal: 0.3s ease-out;
    --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================================
   RESET & BASE
   ============================================================================ */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    font-weight: 400;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-background);
    min-height: 100vh;
}

/* ============================================================================
   TYPOGRAPHY - Per Branding Guide
   ============================================================================ */

/* Headings use Playfair Display per branding guide */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 500;
    line-height: 1.2;
    color: var(--color-black);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: var(--space-4);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-hover);
}

/* Numbers use Poppins per branding guide */
.number, .stat-value, .count, .badge-count, .stat-number {
    font-family: var(--font-numbers);
}

/* ============================================================================
   LAYOUT - APP SHELL
   ============================================================================ */

.app {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--color-black);
    color: var(--color-white);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width var(--transition-normal), transform var(--transition-normal);
}

.sidebar-header {
    padding: var(--space-6);
    padding-right: calc(var(--space-6) + 40px); /* Space for toggle button */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.sidebar-logo {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.sidebar-logo span {
    opacity: 0.6;
    font-weight: 400;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-4) 0;
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.sidebar-nav::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.nav-section {
    margin-bottom: var(--space-6);
}

.nav-section-title {
    padding: var(--space-2) var(--space-6);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-6);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

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

.nav-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--color-white);
    border-right: 3px solid var(--color-white);
}

.nav-item-icon {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    opacity: 0.8;
    flex-shrink: 0;
}

.nav-item-badge {
    margin-left: auto;
    background: var(--color-error);
    color: var(--color-white);
    font-size: 0.7rem;
    font-family: var(--font-numbers);
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-white);
    color: var(--color-black);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Logout Button */
.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--color-white);
}

.logout-btn:active {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(0.95);
}

.logout-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

/* Sidebar Toggle Button - Positioned in Header */
.sidebar-toggle {
    position: absolute;
    top: var(--space-5);
    right: var(--space-4);
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 101;
    transition: all var(--transition-fast);
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sidebar-toggle:active {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(0.95);
}

.sidebar-toggle svg {
    width: 16px;
    height: 16px;
    stroke: rgba(255, 255, 255, 0.7);
    transition: transform var(--transition-fast), stroke var(--transition-fast);
}

.sidebar-toggle:hover svg {
    stroke: var(--color-white);
}

/* Collapsed Sidebar State */
.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .sidebar-logo span,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .nav-item-text,
.sidebar.collapsed .nav-item-badge,
.sidebar.collapsed .user-details,
.sidebar.collapsed .logout-btn {
    display: none;
}

/* Hide text inside nav items when collapsed */
.sidebar.collapsed .nav-item {
    font-size: 0;
    overflow: hidden;
}

.sidebar.collapsed .nav-item .nav-item-icon {
    font-size: 1rem; /* Reset font size for icon */
}

.sidebar.collapsed .sidebar-logo {
    justify-content: center;
    font-size: 1rem;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: var(--space-3);
}

.sidebar.collapsed .nav-item-icon {
    margin: 0;
}

.sidebar.collapsed .user-info {
    justify-content: center;
}

.sidebar.collapsed .sidebar-header {
    padding-right: var(--space-6);
}

.sidebar.collapsed .sidebar-toggle {
    position: static;
    margin: 0 auto;
    margin-top: var(--space-3);
}

.sidebar.collapsed .sidebar-toggle svg {
    transform: rotate(180deg);
}

.sidebar.collapsed + .main,
body.sidebar-collapsed .main {
    margin-left: var(--sidebar-collapsed-width);
}

/* Main Content */
.main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition-normal);
}

/* Header */
.header {
    height: var(--header-height);
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-8);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

/* Real-time indicator */
.realtime-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

.realtime-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-success);
    animation: pulse 2s infinite;
}

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

.realtime-indicator.disconnected .realtime-dot {
    background: var(--color-error);
    animation: none;
}

/* Content Area */
.content {
    flex: 1;
    padding: var(--space-8);
    background: var(--color-surface);
}

/* ============================================================================
   COMPONENTS - CARDS
   ============================================================================ */

.card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
}

.card-body {
    padding: var(--space-6);
}

.card-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--color-border);
    background: var(--color-gray-50);
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
}

/* ============================================================================
   COMPONENTS - STATS
   ============================================================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.stat-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    padding: var(--space-6);
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-gray-100);
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-icon.pending { background: rgba(139, 92, 246, 0.1); color: var(--color-pending); }
.stat-icon.reports { background: rgba(239, 68, 68, 0.1); color: var(--color-error); }
.stat-icon.deletions { background: rgba(245, 158, 11, 0.1); color: var(--color-warning); }
.stat-icon.published { background: rgba(34, 197, 94, 0.1); color: var(--color-success); }

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-1);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--font-numbers);
    line-height: 1;
}

.stat-change {
    font-size: 0.8rem;
    margin-top: var(--space-2);
}

.stat-change.positive { color: var(--color-success); }
.stat-change.negative { color: var(--color-error); }

/* ============================================================================
   COMPONENTS - BUTTONS
   ============================================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    font-family: var(--font-primary);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

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

.btn-primary {
    background: var(--color-black);
    color: var(--color-white);
    border-color: var(--color-black);
}

.btn-primary:hover:not(:disabled) {
    background: var(--color-gray-800);
}

.btn-secondary {
    background: var(--color-white);
    color: var(--color-black);
    border-color: var(--color-border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--color-gray-50);
    border-color: var(--color-gray-400);
}

.btn-success {
    background: var(--color-success);
    color: var(--color-white);
}

.btn-success:hover:not(:disabled) {
    background: #16a34a;
}

.btn-danger {
    background: var(--color-error);
    color: var(--color-white);
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--color-gray-100);
    color: var(--color-text);
}

.btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: 0.8rem;
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: 1rem;
}

.btn-icon {
    padding: var(--space-2);
    width: 36px;
    height: 36px;
}

/* ============================================================================
   COMPONENTS - BADGES
   ============================================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 20px;
}

.badge-pending {
    background: rgba(139, 92, 246, 0.1);
    color: var(--color-pending);
}

.badge-published {
    background: rgba(34, 197, 94, 0.1);
    color: var(--color-success);
}

.badge-rejected {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-error);
}

.badge-review {
    background: rgba(59, 130, 246, 0.1);
    color: var(--color-info);
}

.badge-explicit {
    background: var(--color-black);
    color: var(--color-white);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
}

/* ============================================================================
   COMPONENTS - FORMS
   ============================================================================ */

.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: var(--space-2);
    color: var(--color-text);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    background: var(--color-white);
    color: var(--color-text);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-black);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    margin-top: var(--space-1);
}

.form-error {
    font-size: 0.8rem;
    color: var(--color-error);
    margin-top: var(--space-1);
}

/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    cursor: pointer;
}

.form-check input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--color-black);
}

/* ============================================================================
   COMPONENTS - TABLE
   ============================================================================ */

.table-wrapper {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.table th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-secondary);
    background: var(--color-gray-50);
}

.table tbody tr:hover {
    background: var(--color-gray-50);
}

.table-actions {
    display: flex;
    gap: var(--space-2);
}

/* ============================================================================
   COMPONENTS - QUEUE ITEM
   ============================================================================ */

.queue-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.queue-item {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    padding: var(--space-5);
    display: flex;
    gap: var(--space-5);
    transition: all var(--transition-fast);
}

.queue-item:hover {
    border-color: var(--color-gray-400);
    box-shadow: var(--shadow-md);
}

.queue-item.priority-high {
    border-left: 4px solid var(--color-error);
}

.queue-item.priority-medium {
    border-left: 4px solid var(--color-warning);
}

.queue-priority {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    font-family: var(--font-numbers);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--color-gray-400);
}

.queue-content {
    flex: 1;
    min-width: 0;
}

.queue-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-2);
    flex-wrap: wrap;
}

.queue-id {
    font-family: var(--font-numbers);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text);
}

.queue-type {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

.queue-preview {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.queue-meta {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-top: var(--space-3);
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

.queue-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    justify-content: center;
}

/* ============================================================================
   COMPONENTS - MODAL
   ============================================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--color-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    transform: translateY(20px);
    transition: transform var(--transition-normal);
}

.modal-overlay.open .modal {
    transform: translateY(0);
}

.modal-header {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    background: var(--color-gray-100);
    border: none;
    cursor: pointer;
    padding: var(--space-2);
    color: var(--color-text-secondary);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.modal-close:hover {
    color: var(--color-text);
    background: var(--color-gray-200);
    transform: scale(1.1);
}

.modal-close:active {
    transform: scale(0.95);
}

.modal-body {
    padding: var(--space-6);
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

.modal-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
}

/* ============================================================================
   COMPONENTS - TOAST
   ============================================================================ */

.toast-container {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.toast {
    background: var(--color-black);
    color: var(--color-white);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 300px;
    transform: translateX(120%);
    transition: transform var(--transition-normal);
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background: var(--color-success);
}

.toast.error {
    background: var(--color-error);
}

.toast.warning {
    background: var(--color-warning);
    color: var(--color-black);
}

/* ============================================================================
   COMPONENTS - EMPTY STATE
   ============================================================================ */

.empty-state {
    text-align: center;
    padding: var(--space-16) var(--space-8);
}

.empty-state-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--space-4);
    opacity: 0.3;
}

.empty-state-title {
    font-size: 1.25rem;
    margin-bottom: var(--space-2);
}

.empty-state-text {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-6);
}

/* ============================================================================
   COMPONENTS - LOADING
   ============================================================================ */

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--color-gray-200);
    border-top-color: var(--color-black);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================================
   UTILITIES
   ============================================================================ */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-secondary { color: var(--color-text-secondary); }
.text-success { color: var(--color-success); }
.text-error { color: var(--color-error); }
.text-warning { color: var(--color-warning); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }

.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

.hidden { display: none !important; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ============================================================================
   LOGIN PAGE
   ============================================================================ */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-black);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: var(--space-8);
}

.login-logo {
    text-align: center;
    margin-bottom: var(--space-8);
    color: var(--color-white);
}

.login-logo h1 {
    color: var(--color-white);
    font-size: 1.5rem;
    margin-bottom: var(--space-2);
}

.login-logo span {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.6;
}

.login-card {
    background: var(--color-white);
    border-radius: var(--border-radius-lg);
    padding: var(--space-8);
}

.login-title {
    text-align: center;
    margin-bottom: var(--space-6);
}

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

/* Sidebar overlay for mobile */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Sidebar close button - hidden on desktop */
.sidebar-close {
    display: none;
}

/* Mobile menu toggle - hidden by default on desktop */
.mobile-menu-toggle,
.btn.mobile-menu-toggle,
button.mobile-menu-toggle {
    display: none !important;
    align-items: center;
    justify-content: center;
    padding: var(--space-2);
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: background var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}

.mobile-menu-toggle:hover,
.btn.mobile-menu-toggle:hover {
    background: var(--color-gray-100);
}

.mobile-menu-toggle:active,
.btn.mobile-menu-toggle:active {
    background: var(--color-gray-200);
}

.mobile-menu-toggle svg {
    width: 24px;
    height: 24px;
    stroke: var(--color-text);
}

/* Tablet and below */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height for mobile browsers */
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
        will-change: transform;
    }
    
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
    }
    
    .main {
        margin-left: 0;
        width: 100%;
    }
    
    .mobile-menu-toggle,
    .btn.mobile-menu-toggle,
    button.mobile-menu-toggle {
        display: flex !important;
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Sidebar close button - only on mobile */
    .sidebar-close {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
        background: rgba(255, 255, 255, 0.1);
        border: none;
        border-radius: 50%;
        cursor: pointer;
        z-index: 101;
        transition: background 0.2s, transform 0.2s;
        -webkit-tap-highlight-color: transparent;
    }
    
    .sidebar-close:hover,
    .sidebar-close:focus {
        background: rgba(255, 255, 255, 0.2);
    }
    
    .sidebar-close:active {
        background: rgba(255, 255, 255, 0.3);
        transform: scale(0.95);
    }
    
    .sidebar-close svg {
        width: 22px;
        height: 22px;
        stroke: #fff;
        stroke-width: 2.5;
    }
    
    /* Add padding to sidebar header for close button */
    .sidebar .sidebar-header {
        padding-right: 60px;
    }
    
    /* Header adjustments */
    .main-header {
        padding: var(--space-3) var(--space-4);
    }
    
    .page-title {
        font-size: 1.25rem;
    }
}

@media (max-width: 768px) {
    /* Header adjustments */
    .header {
        padding: 0 var(--space-4);
        height: 56px;
    }
    
    .header-left {
        gap: var(--space-3);
    }
    
    .page-title {
        font-size: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-3);
    }
    
    .content {
        padding: var(--space-4);
    }
    
    .queue-item {
        flex-direction: column;
        gap: var(--space-3);
    }
    
    .queue-actions {
        flex-direction: row;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    
    /* Card adjustments */
    .card {
        padding: var(--space-4);
    }
    
    .card-title {
        font-size: 1rem;
    }
    
    /* Table responsive */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Button groups */
    .btn-group {
        flex-wrap: wrap;
        gap: var(--space-2);
    }
    
    /* Form adjustments */
    .form-row {
        flex-direction: column;
    }
    
    /* Modal adjustments */
    .modal-container {
        width: 95%;
        max-height: 90vh;
        margin: auto;
    }
    
    /* Header actions */
    .header-actions {
        gap: var(--space-2);
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .content {
        padding: var(--space-3);
    }
    
    .main-header {
        padding: var(--space-2) var(--space-3);
    }
    
    .page-title {
        font-size: 1.1rem;
    }
    
    /* Hide less important elements */
    .page-subtitle {
        display: none;
    }
    
    /* Stack buttons */
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
    
    /* Smaller badges */
    .nav-item-badge {
        font-size: 0.65rem;
        padding: 0.15em 0.4em;
    }
    
    /* Card compact mode */
    .stat-card {
        padding: var(--space-3);
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    /* Modal full screen on small phones */
    .modal-container {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
}

/* Touch-friendly targets */
@media (pointer: coarse) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav-item {
        min-height: 48px;
    }
    
    input, select, textarea {
        min-height: 44px;
    }
}

/* ============================================================================
   STATS PERIOD LABELS
   ============================================================================ */

.stats-bar-header {
    display: flex;
    justify-content: flex-end;
    padding: 0 var(--spacing-md) var(--spacing-xs);
    margin-bottom: -0.25rem;
}

.stats-period-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--color-gray-100);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
}

