/**
 * Dialed Design System - Purple/Pearl Iridescent Theme
 * Enterprise-grade UI styling for all admin portal pages
 * Version 2.0 - Complete Overhaul
 */

/* =====================================================
   CSS VARIABLES - BRAND COLORS
   ===================================================== */
:root {
    /* Page Backgrounds - Light Pearl/Cream */
    --bg-page: #FDFCFA;
    --bg-warm: #F9F7F5;
    --bg-cream: #FEFDFB;
    --bg-card: #FFFFFF;
    --bg-hover: rgba(45, 36, 56, 0.03);
    --bg-secondary: #F9F7F5;

    /* Sidebar - Deep Iridescent Purple-Black */
    --sidebar-dark: #1A1520;
    --sidebar-mid: #2D2438;
    --sidebar-light: #3D3248;
    --sidebar-accent: #4D4258;

    /* Accent tones for buttons */
    --accent: #2D2438;
    --accent-light: #3D3248;
    --accent-hover: #1A1520;

    /* Iridescent Accent Colors */
    --iridescent-teal: #7DD3C0;
    --iridescent-pink: #E8C4D0;
    --iridescent-lavender: #B8A9C9;
    --iridescent-gold: #D4C4A8;

    /* Iridescent Tints for backgrounds */
    --tint-pink: rgba(232, 196, 208, 0.25);
    --tint-lavender: rgba(184, 169, 201, 0.2);
    --tint-teal: rgba(125, 211, 192, 0.15);
    --tint-gold: rgba(212, 196, 168, 0.2);

    /* Text Colors - CRITICAL FOR READABILITY */
    --text-primary: #1A1520;
    --text-secondary: #4D4258;
    --text-muted: #7A7085;
    --text-light: #A8A0B0;
    --text-on-dark: #F8F6FA;

    /* Pearl Palette */
    --pearl-white: #FDFCFA;
    --pearl-cream: #FAF8F5;
    --pearl-blush: #FDF6F3;
    --pearl-warm: #F8F0EA;
    --pearl-tan: #EDE6E0;
    --pearl-taupe: #DED6CE;

    /* Borders */
    --border: #E8E2D8;
    --border-hover: #D4D1CE;
    --border-light: rgba(184, 169, 201, 0.2);

    /* Status Colors */
    --success: #22C55E;
    --success-bg: rgba(34, 197, 94, 0.1);
    --warning: #F59E0B;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --danger: #EF4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --info: #3B82F6;
    --info-bg: rgba(59, 130, 246, 0.1);

    /* Typography */
    --font-display: 'Satoshi', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(45, 36, 56, 0.06);
    --shadow-md: 0 4px 12px rgba(45, 36, 56, 0.08);
    --shadow-lg: 0 8px 30px rgba(45, 36, 56, 0.12);
    --shadow-xl: 0 20px 50px rgba(45, 36, 56, 0.15);
}

/* =====================================================
   BASE STYLES
   ===================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    max-width: 100%;
}

body {
    font-family: var(--font-body);
    background:
        radial-gradient(ellipse at 100% 0%, var(--tint-teal) 0%, transparent 50%),
        radial-gradient(ellipse at 0% 100%, var(--tint-pink) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, var(--tint-lavender) 0%, transparent 60%),
        radial-gradient(ellipse at 30% 20%, var(--tint-gold) 0%, transparent 40%),
        var(--bg-cream);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =====================================================
   TYPOGRAPHY - ALL TEXT MUST BE READABLE
   ===================================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

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

p, span, label, td, th, li {
    color: var(--text-primary);
}

.text-secondary { color: var(--text-secondary) !important; }
.text-muted { color: var(--text-muted) !important; }

a {
    color: var(--sidebar-mid);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--sidebar-dark);
}

/* =====================================================
   PAGE HEADER - PURPLE GRADIENT
   ===================================================== */
.page-header {
    background: linear-gradient(135deg, var(--sidebar-mid) 0%, var(--sidebar-dark) 100%);
    padding: 2rem 2.5rem;
    border-radius: var(--radius-xl);
    margin-bottom: 1.5rem;
    color: var(--text-on-dark);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.page-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(255,255,255,0.08) 0%, transparent 50%);
    pointer-events: none;
}

.page-header h1,
.page-header h2 {
    color: var(--text-on-dark);
    margin-bottom: 0.5rem;
}

.page-header p,
.page-header .subtitle {
    color: rgba(248, 246, 250, 0.8);
    font-size: 0.9375rem;
}

/* =====================================================
   CARDS - PREMIUM STYLING
   ===================================================== */
.card {
    background: linear-gradient(145deg, #FFFFFF 0%, var(--pearl-cream) 100%);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(184, 169, 201, 0.3);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(90deg, rgba(184, 169, 201, 0.05) 0%, transparent 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3,
.card-header h4 {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* =====================================================
   STAT CARDS - IRIDESCENT HOVER EFFECTS
   ===================================================== */
.stat-card, .quick-stat, .metric-card {
    background: linear-gradient(145deg, #FFFFFF 0%, var(--pearl-blush) 100%);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-light);
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before, .quick-stat::before, .metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.6s ease;
}

.stat-card:hover::before, .quick-stat:hover::before, .metric-card:hover::before {
    left: 100%;
}

.stat-card:hover, .quick-stat:hover, .metric-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--iridescent-lavender);
}

.stat-value, .quick-stat-value, .metric-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--font-display);
    background: linear-gradient(135deg, var(--sidebar-dark) 0%, var(--sidebar-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.stat-label, .quick-stat-label, .metric-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.75px;
    margin-top: 0.5rem;
    font-weight: 600;
}

/* =====================================================
   BUTTONS - PURPLE THEME
   ===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--sidebar-mid) 0%, var(--sidebar-dark) 100%);
    color: var(--text-on-dark);
    box-shadow: 0 2px 8px rgba(45, 36, 56, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--sidebar-light) 0%, var(--sidebar-mid) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(45, 36, 56, 0.35);
    color: var(--text-on-dark);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--sidebar-mid);
    background: rgba(45, 36, 56, 0.03);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #DC2626 100%);
    color: var(--text-on-dark);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #16A34A 100%);
    color: var(--text-on-dark);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* =====================================================
   FORM ELEMENTS
   ===================================================== */
input, select, textarea {
    font-family: var(--font-body);
    font-size: 0.9375rem;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    transition: all 0.2s;
    width: 100%;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--sidebar-mid);
    box-shadow: 0 0 0 3px rgba(45, 36, 56, 0.1);
}

input::placeholder, textarea::placeholder {
    color: var(--text-muted);
}

label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
}

/* =====================================================
   TABLES
   ===================================================== */
table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-warm);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    font-size: 0.9375rem;
}

tr:hover td {
    background: rgba(184, 169, 201, 0.05);
}

/* =====================================================
   TABS - PURPLE ACTIVE STATE
   ===================================================== */
.tabs, .tab-nav {
    display: flex;
    gap: 0.375rem;
    background: linear-gradient(145deg, #FFFFFF 0%, var(--pearl-cream) 100%);
    border-radius: var(--radius-lg);
    padding: 0.375rem;
    border: 1px solid var(--border-light);
}

.tab {
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border: none;
    background: none;
    transition: all 0.3s ease;
}

.tab:hover {
    background: rgba(45, 36, 56, 0.05);
    color: var(--text-primary);
}

.tab.active {
    background: linear-gradient(135deg, var(--sidebar-mid) 0%, var(--sidebar-dark) 100%);
    color: var(--text-on-dark);
    box-shadow: 0 2px 8px rgba(45, 36, 56, 0.2);
}

/* =====================================================
   STATUS BADGES
   ===================================================== */
.badge, .status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success, .status-badge.active, .status-badge.complete, .status-badge.delivered {
    background: var(--success-bg);
    color: var(--success);
}

.badge-warning, .status-badge.pending, .status-badge.in-progress {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-danger, .status-badge.overdue, .status-badge.rejected {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge-info, .status-badge.shipped, .status-badge.in-transit {
    background: var(--info-bg);
    color: var(--info);
}

.badge-neutral {
    background: rgba(45, 36, 56, 0.1);
    color: var(--text-secondary);
}

/* Pearl Studio NEW badge */
.nav-badge.new {
    background: linear-gradient(135deg, #7DD3C0, #7DD3FC);
    color: #1a1a1a;
    font-size: 0.6rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: auto;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* =====================================================
   MODALS
   ===================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26, 21, 32, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

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

.modal-header h2, .modal-header h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(90vh - 180px);
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background: var(--bg-warm);
}

/* =====================================================
   PROGRESS INDICATORS
   ===================================================== */
.progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--iridescent-lavender), var(--success));
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* =====================================================
   EMPTY STATES
   ===================================================== */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.9375rem;
}

/* =====================================================
   ANIMATIONS
   ===================================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

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

.animate-fade-in {
    animation: fadeIn 0.3s ease;
}

/* =====================================================
   SCROLLBAR STYLING
   ===================================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-warm);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* =====================================================
   UTILITY CLASSES
   ===================================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }

.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* =====================================================
   RESPONSIVE BASE STYLES
   Critical fallback if mobile-app.css fails to load
   ===================================================== */

/* Fluid Typography - scales smoothly from mobile to desktop */
:root {
    --fluid-h1: clamp(1.5rem, 4vw, 2rem);
    --fluid-h2: clamp(1.25rem, 3vw, 1.5rem);
    --fluid-h3: clamp(1.1rem, 2.5vw, 1.25rem);
    --fluid-body: clamp(0.875rem, 2vw, 0.9375rem);
    --fluid-small: clamp(0.75rem, 1.8vw, 0.8125rem);
}

h1 { font-size: var(--fluid-h1); }
h2 { font-size: var(--fluid-h2); }
h3 { font-size: var(--fluid-h3); }
body { font-size: var(--fluid-body); }

/* iOS Zoom Prevention - inputs must be 16px+ */
@supports (-webkit-touch-callout: none) {
    input, select, textarea {
        font-size: 16px !important;
    }
}

/* Safe Area Support for notch/Dynamic Island */
body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* Firefox Scrollbar Hiding (supplement WebKit) */
html {
    scrollbar-width: thin;
    scrollbar-color: var(--border) var(--bg-warm);
}

/* =====================================================
   WIDE DESKTOP (1280px+)
   ===================================================== */
@media (min-width: 1280px) {
    .page-header {
        padding: 2.5rem 3rem;
    }

    .card-body {
        padding: 2rem;
    }
}

/* =====================================================
   DESKTOP (1024px - 1279px)
   ===================================================== */
@media (max-width: 1279px) {
    .page-header {
        padding: 1.75rem 2rem;
    }

    .stat-value, .quick-stat-value, .metric-value {
        font-size: 1.75rem;
    }
}

/* =====================================================
   TABLET (768px - 1023px)
   ===================================================== */
@media (max-width: 1023px) {
    .page-header {
        padding: 1.5rem 1.5rem;
        border-radius: var(--radius-lg);
        margin-bottom: 1rem;
    }

    .card-body {
        padding: 1.25rem;
    }

    .modal {
        max-width: 90vw;
        margin: 1rem;
    }

    .modal-body {
        max-height: calc(85vh - 160px);
    }

    /* Responsive grid fallback */
    .grid, [class*="grid-cols"] {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1rem;
    }

    /* Tabs become scrollable */
    .tabs, .tab-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .tabs::-webkit-scrollbar, .tab-nav::-webkit-scrollbar {
        display: none;
    }

    .tab {
        flex-shrink: 0;
    }

    /* Table horizontal scroll */
    .table-container, .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 600px;
    }

    th, td {
        padding: 0.75rem;
        white-space: nowrap;
    }
}

/* =====================================================
   MOBILE LANDSCAPE / SMALL TABLET (640px - 767px)
   ===================================================== */
@media (max-width: 767px) {
    .page-header {
        padding: 1.25rem 1rem;
        border-radius: var(--radius-md);
    }

    .page-header h1 {
        font-size: 1.25rem;
    }

    .page-header p, .page-header .subtitle {
        font-size: 0.8125rem;
    }

    .card {
        border-radius: var(--radius-md);
    }

    .card-header {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .card-body {
        padding: 1rem;
    }

    .stat-card, .quick-stat, .metric-card {
        padding: 1rem;
    }

    .stat-value, .quick-stat-value, .metric-value {
        font-size: 1.5rem;
    }

    .stat-label, .quick-stat-label, .metric-label {
        font-size: 0.65rem;
    }

    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
        width: 100%;
    }

    .btn-sm {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }

    /* Form elements full width */
    input, select, textarea {
        padding: 0.875rem 1rem;
    }

    .modal-overlay {
        padding: 0.75rem;
        align-items: flex-end;
    }

    .modal {
        max-width: 100%;
        max-height: 85vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-header h2, .modal-header h3 {
        font-size: 1.125rem;
    }

    .modal-body {
        padding: 1rem;
        max-height: calc(85vh - 140px);
    }

    .modal-footer {
        padding: 0.75rem 1rem;
        flex-direction: column;
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
    }

    .modal-footer .btn {
        width: 100%;
    }

    /* Minimum touch targets - 44px per Apple HIG */
    .btn, button, a[role="button"], .tab {
        min-height: 44px;
    }

    /* Empty states smaller */
    .empty-state {
        padding: 2rem 1rem;
    }

    .empty-state svg {
        width: 40px;
        height: 40px;
    }
}

/* =====================================================
   MOBILE PORTRAIT (< 640px)
   ===================================================== */
@media (max-width: 639px) {
    body {
        padding-bottom: env(safe-area-inset-bottom);
    }

    .page-header {
        padding: 1rem;
        margin-bottom: 0.75rem;
    }

    .page-header h1 {
        font-size: 1.125rem;
    }

    /* Single column layout */
    .grid, [class*="grid-cols"] {
        grid-template-columns: 1fr;
    }

    /* Flex wrapping */
    .flex {
        flex-wrap: wrap;
    }

    /* Gap adjustments */
    .gap-3 { gap: 1rem; }
    .gap-2 { gap: 0.75rem; }
    .gap-1 { gap: 0.5rem; }

    /* Margin/padding adjustments */
    .mb-4 { margin-bottom: 1.5rem; }
    .mb-3 { margin-bottom: 1rem; }
    .p-4 { padding: 1.5rem; }
    .p-3 { padding: 1rem; }

    /* Compact badges */
    .badge, .status-badge {
        padding: 0.2rem 0.5rem;
        font-size: 0.625rem;
    }

    /* Progress bar thinner */
    .progress-bar {
        height: 6px;
    }
}

/* =====================================================
   EXTRA SMALL (< 380px)
   ===================================================== */
@media (max-width: 379px) {
    .page-header {
        padding: 0.875rem;
    }

    .page-header h1 {
        font-size: 1rem;
    }

    .card-body {
        padding: 0.75rem;
    }

    .stat-value, .quick-stat-value, .metric-value {
        font-size: 1.25rem;
    }

    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }

    .tab {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }

    th, td {
        padding: 0.5rem;
        font-size: 0.8125rem;
    }
}

/* =====================================================
   REDUCED MOTION - Accessibility
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .stat-card:hover, .quick-stat:hover, .metric-card:hover,
    .btn:hover, .card:hover {
        transform: none;
    }

    .stat-card::before, .quick-stat::before, .metric-card::before {
        display: none;
    }
}

/* =====================================================
   PRINT STYLES
   ===================================================== */
@media print {
    body {
        background: white !important;
    }

    .page-header {
        background: #2D2438 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .btn, button, .tabs, .modal-overlay {
        display: none !important;
    }

    .card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}
