/**
 * LEVELLANCE ENTERPRISE DESIGN SYSTEM
 * Based on Universal UI/UX Design System Specification
 * Pure Vanilla CSS - Zero external runtime dependencies
 * Architecture: Beautiful + Clear + Consistent + Accessible + Responsive + Maintainable
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Sarabun:wght@300;400;500;600;700&display=swap');

:root {
    /* ==========================================================================
       1. SEMANTIC COLOR TOKENS (WCAG AA Compliant Contrast)
       ========================================================================== */
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-primary-active: #1e40af;
    --color-primary-light: #eff6ff;
    --color-primary-border: #bfdbfe;
    --color-primary-text: #1e40af;

    --color-secondary: #475569;
    --color-secondary-hover: #334155;
    --color-secondary-light: #f1f5f9;
    --color-secondary-border: #cbd5e1;

    --color-success: #059669;
    --color-success-hover: #047857;
    --color-success-light: #ecfdf5;
    --color-success-border: #a7f3d0;
    --color-success-text: #065f46;

    --color-warning: #d97706;
    --color-warning-hover: #b45309;
    --color-warning-light: #fffbeb;
    --color-warning-border: #fde68a;
    --color-warning-text: #92400e;

    --color-danger: #dc2626;
    --color-danger-hover: #b91c1c;
    --color-danger-light: #fef2f2;
    --color-danger-border: #fecaca;
    --color-danger-text: #991b1b;

    --color-info: #0891b2;
    --color-info-hover: #0e7490;
    --color-info-light: #ecfeff;
    --color-info-border: #a5f3fc;
    --color-info-text: #155e75;

    /* Base Surfaces & Backgrounds */
    --color-bg: #f8fafc;
    --color-surface: #ffffff;
    --color-surface-elevated: #ffffff;
    --color-surface-muted: #f1f5f9;
    --color-surface-subtle: #f8fafc;

    /* High Contrast Typography */
    --color-text-main: #0f172a;       /* Slate 900 - Primary text */
    --color-text-secondary: #334155;  /* Slate 700 - Secondary text */
    --color-text-muted: #64748b;      /* Slate 500 - Metadata & labels */
    --color-text-disabled: #94a3b8;   /* Slate 400 - Disabled */
    --color-text-inverse: #ffffff;

    /* Crisp Borders & Dividers */
    --color-border: #e2e8f0;          /* Slate 200 */
    --color-border-subtle: #f1f5f9;   /* Slate 100 */
    --color-border-strong: #cbd5e1;   /* Slate 300 */
    --color-border-focus: #3b82f6;

    /* Sidebar Executive Dark Theme */
    --sidebar-bg: #0f172a;            /* Slate 900 */
    --sidebar-surface: #1e293b;       /* Slate 800 */
    --sidebar-text: #94a3b8;          /* Slate 400 */
    --sidebar-text-hover: #f8fafc;    /* Slate 50 */
    --sidebar-hover: rgba(255, 255, 255, 0.08);
    --sidebar-active-bg: #2563eb;
    --sidebar-active-text: #ffffff;
    --sidebar-border: rgba(255, 255, 255, 0.08);

    /* ==========================================================================
       2. TYPOGRAPHY SYSTEM
       ========================================================================== */
    --font-sans: 'Plus Jakarta Sans', 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

    /* ==========================================================================
       3. SPACING SCALE
       ========================================================================== */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;

    /* ==========================================================================
       4. BORDER RADII
       ========================================================================== */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* ==========================================================================
       5. ELEVATION & SHADOW SYSTEM
       ========================================================================== */
    --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.08);

    /* ==========================================================================
       6. TRANSITIONS & Z-INDEX
       ========================================================================== */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-drawer: 1050;
    --z-modal: 1060;
    --z-toast: 1070;
}

/* Base Reset & Box Sizing */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    color: var(--color-text-main);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

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

img, svg {
    vertical-align: middle;
}

/* ==========================================================================
   LAYOUT STRUCTURE (Desktop & Responsive)
   ========================================================================== */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
}

/* Demo Switcher Top Bar */
.demo-floating-bar {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    color: #ffffff;
    padding: 10px 24px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    gap: 16px;
    flex-wrap: wrap;
}
.demo-bar-badge {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.demo-roles-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.demo-role-btn {
    background: rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
}
.demo-role-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}
.demo-role-btn.active {
    background: var(--color-primary);
    border-color: #60a5fa;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

/* ==========================================================================
   SIDEBAR COMPONENT
   ========================================================================== */
.app-sidebar {
    width: 275px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-right: 1px solid var(--sidebar-border);
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: var(--z-drawer);
    transition: transform var(--transition-slow), width var(--transition);
}

/* Sidebar Brand Header */
.sidebar-brand {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--sidebar-border);
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
}
.brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}
.brand-logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    flex-shrink: 0;
}
.brand-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.01em;
    line-height: 1.2;
}
.brand-sub {
    font-size: 0.68rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}
.sidebar-close-btn {
    display: none;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}
.sidebar-close-btn:hover {
    color: #ffffff;
    background: var(--sidebar-hover);
}

/* Sidebar Navigation Groups & Links */
.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}
.sidebar-nav::-webkit-scrollbar {
    width: 5px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-full);
}

.nav-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.nav-group-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    padding: 8px 12px 4px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: var(--radius-md);
    color: var(--sidebar-text);
    font-weight: 500;
    font-size: 0.88rem;
    transition: var(--transition-fast);
    position: relative;
}
.nav-link:hover {
    background-color: var(--sidebar-hover);
    color: var(--sidebar-text-hover);
    transform: translateX(2px);
}
.nav-link.active {
    background-color: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}
.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke-width: 2;
}
.nav-link .nav-badge {
    margin-left: auto;
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    font-weight: 700;
}

/* Bottom Sidebar Production Action */
.sidebar-footer-prod {
    padding: 16px 14px;
    border-top: 1px solid var(--sidebar-border);
    background: rgba(0, 0, 0, 0.25);
}
.prod-transition-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 11px 14px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transition: var(--transition-fast);
    text-decoration: none;
}
.prod-transition-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

/* Sidebar Backdrop (Mobile/Tablet drawer dismiss) */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: calc(var(--z-drawer) - 1);
    opacity: 0;
    transition: opacity var(--transition);
}

/* ==========================================================================
   MAIN CONTENT AREA & TOP HEADER
   ========================================================================== */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background-color: var(--color-bg);
}

.app-header {
    background-color: var(--color-surface);
    min-height: 68px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    gap: 16px;
    box-shadow: var(--shadow-xs);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

/* Mobile Sidebar Toggle Button */
.sidebar-toggle-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: var(--color-surface-muted);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    flex-shrink: 0;
}
.sidebar-toggle-btn:hover {
    background: #e2e8f0;
    color: var(--color-text-main);
}

/* Breadcrumbs */
.header-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.header-breadcrumbs a {
    color: var(--color-text-secondary);
    font-weight: 500;
}
.header-breadcrumbs a:hover {
    color: var(--color-primary);
}
.header-breadcrumbs .separator {
    color: #94a3b8;
    font-size: 0.75rem;
}
.header-breadcrumbs .current {
    color: var(--color-text-main);
    font-weight: 600;
}

/* Header Search */
.header-search {
    display: flex;
    align-items: center;
    background-color: var(--color-surface-muted);
    border-radius: var(--radius-md);
    padding: 7px 14px;
    width: 280px;
    border: 1px solid var(--color-border);
    transition: var(--transition-fast);
}
.header-search:focus-within {
    border-color: var(--color-border-focus);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.header-search input {
    border: none;
    background: transparent;
    outline: none;
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--color-text-main);
    width: 100%;
    margin-left: 8px;
}

/* Header Right User Controls */
.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}
.header-clock-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--color-surface-muted);
    border: 1px solid var(--color-border);
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-primary);
}

/* Notification Button & Dropdown */
.notif-btn {
    background: var(--color-surface-muted);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    color: var(--color-text-secondary);
    transition: var(--transition-fast);
}
.notif-btn:hover {
    background: #e2e8f0;
    color: var(--color-text-main);
}
.notif-count-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.68rem;
    font-weight: 800;
    padding: 1px 5px;
    min-width: 17px;
    text-align: center;
    box-shadow: 0 0 4px rgba(239, 68, 68, 0.5);
}

/* User Menu Pill & Avatar */
.header-user-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 6px 4px 10px;
    border-radius: var(--radius-full);
    background: var(--color-surface-muted);
    border: 1px solid var(--color-border);
    cursor: pointer;
    transition: var(--transition-fast);
}
.header-user-pill:hover {
    background: #e2e8f0;
}
.user-avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* ==========================================================================
   PAGE CONTENT & SECTION HEADERS
   ========================================================================== */
.page-content {
    padding: 28px 32px;
    flex: 1;
    width: 100%;
    max-width: 1480px;
    margin: 0 auto;
}
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}
.page-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--color-text-main);
    letter-spacing: -0.02em;
    line-height: 1.25;
}
.page-subtitle {
    font-size: 0.88rem;
    color: var(--color-text-muted);
    margin-top: 4px;
    line-height: 1.4;
}

/* ==========================================================================
   KPI STATS GRID
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}
.stat-card {
    background-color: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-xs);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-border-strong);
}
.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.stat-card-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-secondary);
}
.stat-card-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-primary-light);
    color: var(--color-primary);
    flex-shrink: 0;
}
.stat-card-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--color-text-main);
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.stat-card-footer {
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ==========================================================================
   RESPONSIVE GRID FRAMEWORK
   ========================================================================== */
.grid-row {
    display: grid;
    gap: 20px;
    margin-bottom: 24px;
}
.grid-cols-1 { grid-template-columns: 1fr; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2-1 { grid-template-columns: 2fr 1fr; }
.grid-1-2 { grid-template-columns: 1fr 2fr; }

/* Responsive Grid Fallbacks for inline styles */
@media (max-width: 1024px) {
    .grid-2-1, .grid-1-2, .grid-cols-3, .grid-cols-4,
    [style*="grid-template-columns: 2fr 1fr"],
    [style*="grid-template-columns: 1fr 2fr"],
    [style*="grid-template-columns:2fr 1fr"],
    [style*="grid-template-columns:1fr 2fr"],
    [style*="grid-template-columns: 280px 1fr"],
    [style*="grid-template-columns:280px 1fr"],
    [style*="grid-template-columns: repeat(4, 1fr)"],
    [style*="grid-template-columns: 2fr 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
}
@media (max-width: 768px) {
    .grid-cols-2,
    [style*="grid-template-columns: 1fr 1fr"],
    [style*="grid-template-columns:1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================================================
   CARDS & SURFACES
   ========================================================================== */
.card {
    background-color: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-xs);
    margin-bottom: 24px;
    overflow: hidden;
    transition: var(--transition-fast);
}
.card:hover {
    border-color: #cbd5e1;
}
.card-header {
    padding: 16px 22px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #ffffff;
    flex-wrap: wrap;
    gap: 12px;
}
.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-subtitle {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-weight: normal;
    margin-top: 2px;
}
.card-body {
    padding: 22px;
}
.card-footer {
    padding: 14px 22px;
    background-color: var(--color-surface-subtle);
    border-top: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ==========================================================================
   TABLES & DATA PRESENTATION
   ========================================================================== */
.table-responsive {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
}
.table th {
    background-color: var(--color-surface-muted);
    color: var(--color-text-secondary);
    font-weight: 700;
    padding: 12px 18px;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}
.table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-main);
    vertical-align: middle;
}
.table tbody tr {
    transition: background-color var(--transition-fast);
}
.table tbody tr:hover {
    background-color: #f8fafc;
}
.table tbody tr:last-child td {
    border-bottom: none;
}

/* ==========================================================================
   BADGES (High Contrast & Accessible)
   ========================================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}
.badge-success {
    background-color: var(--color-success-light);
    color: var(--color-success-text);
    border: 1px solid var(--color-success-border);
}
.badge-warning {
    background-color: var(--color-warning-light);
    color: var(--color-warning-text);
    border: 1px solid var(--color-warning-border);
}
.badge-danger {
    background-color: var(--color-danger-light);
    color: var(--color-danger-text);
    border: 1px solid var(--color-danger-border);
}
.badge-info {
    background-color: var(--color-info-light);
    color: var(--color-info-text);
    border: 1px solid var(--color-info-border);
}
.badge-primary {
    background-color: var(--color-primary-light);
    color: var(--color-primary-text);
    border: 1px solid var(--color-primary-border);
}
.badge-secondary {
    background-color: var(--color-secondary-light);
    color: var(--color-secondary);
    border: 1px solid var(--color-secondary-border);
}

/* ==========================================================================
   BUTTONS & ACTIONS (Touch Targets >= 44px on Mobile)
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    font-family: inherit;
    line-height: 1.3;
    white-space: nowrap;
}
.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
}
.btn-primary {
    background-color: var(--color-primary);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}
.btn-primary:hover {
    background-color: var(--color-primary-hover);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.25);
}
.btn-secondary {
    background-color: var(--color-surface);
    border-color: var(--color-border);
    color: var(--color-text-main);
}
.btn-secondary:hover {
    background-color: var(--color-surface-muted);
    border-color: var(--color-border-strong);
    color: var(--color-text-main);
}
.btn-success {
    background-color: var(--color-success);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(5, 150, 105, 0.2);
}
.btn-success:hover {
    background-color: var(--color-success-hover);
    color: #ffffff;
    transform: translateY(-1px);
}
.btn-danger {
    background-color: var(--color-danger);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}
.btn-danger:hover {
    background-color: var(--color-danger-hover);
    color: #ffffff;
    transform: translateY(-1px);
}
.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}
.btn-lg {
    padding: 12px 24px;
    font-size: 1rem;
    border-radius: var(--radius-lg);
}

/* ==========================================================================
   FORMS & INPUTS
   ========================================================================== */
.form-group {
    margin-bottom: 18px;
}
.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-secondary);
}
.form-control, .form-select {
    width: 100%;
    padding: 9px 14px;
    font-size: 0.88rem;
    font-family: inherit;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background-color: #ffffff;
    color: var(--color-text-main);
    transition: var(--transition-fast);
}
.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--color-border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.form-control::placeholder {
    color: #94a3b8;
}
textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* ==========================================================================
   ALERTS
   ========================================================================== */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.4;
}
.alert-success {
    background-color: var(--color-success-light);
    color: var(--color-success-text);
    border: 1px solid var(--color-success-border);
}
.alert-danger {
    background-color: var(--color-danger-light);
    color: var(--color-danger-text);
    border: 1px solid var(--color-danger-border);
}
.alert-warning {
    background-color: var(--color-warning-light);
    color: var(--color-warning-text);
    border: 1px solid var(--color-warning-border);
}
.alert-info {
    background-color: var(--color-info-light);
    color: var(--color-info-text);
    border: 1px solid var(--color-info-border);
}

/* ==========================================================================
   TABS NAVIGATION
   ========================================================================== */
.tab-container {
    width: 100%;
}
.tab-nav {
    display: flex;
    gap: 6px;
    border-bottom: 2px solid var(--color-border);
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
}
.tab-btn {
    padding: 10px 18px;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--color-text-secondary);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition-fast);
    white-space: nowrap;
}
.tab-btn:hover {
    color: var(--color-primary);
    background-color: var(--color-surface-muted);
}
.tab-btn.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    font-weight: 700;
    background-color: #ffffff;
}

/* ==========================================================================
   KANBAN ATS BOARD
   ========================================================================== */
.kanban-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
    -webkit-overflow-scrolling: touch;
}
.kanban-column {
    flex: 0 0 280px;
    background-color: var(--color-surface-muted);
    border-radius: var(--radius-lg);
    padding: 16px;
    border: 1px solid var(--color-border);
}
.kanban-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-border);
}
.kanban-column-title {
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.kanban-card {
    background-color: #ffffff;
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 12px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-xs);
    transition: var(--transition);
}
.kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

/* ==========================================================================
   RESPONSIVE DESIGN & MOBILE OPTIMIZATIONS
   ========================================================================== */

/* Tablet & Mobile Breakpoint (<= 1024px) */
@media (max-width: 1024px) {
    .app-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: var(--z-drawer);
        transform: translateX(-100%);
        box-shadow: var(--shadow-xl);
    }
    .app-sidebar.sidebar-open {
        transform: translateX(0);
    }
    .sidebar-close-btn {
        display: block;
    }
    .sidebar-backdrop.active {
        display: block;
        opacity: 1;
    }
    .sidebar-toggle-btn {
        display: flex;
    }
    .app-header {
        padding: 0 18px;
    }
    .page-content {
        padding: 20px 18px;
    }
    .header-search {
        width: 200px;
    }
}

/* Mobile Screens (<= 768px) */
@media (max-width: 768px) {
    .app-header {
        min-height: 60px;
        padding: 0 14px;
    }
    .header-search {
        display: none; /* Hide top search bar on small mobile screens to keep header tidy */
    }
    .header-clock-badge {
        display: none;
    }
    .header-breadcrumbs {
        font-size: 0.78rem;
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 18px;
    }
    .page-header > div:last-child {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    .page-header > div:last-child .btn {
        flex: 1;
    }
    .page-content {
        padding: 16px 12px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .card-header {
        padding: 14px 16px;
    }
    .card-body {
        padding: 16px;
    }
    .table th, .table td {
        padding: 10px 12px;
        font-size: 0.8rem;
    }
    .btn {
        min-height: 40px; /* Accessible touch target */
    }
}

/* Small Mobile Screens (<= 480px) */
@media (max-width: 480px) {
    .demo-floating-bar {
        padding: 8px 12px;
        font-size: 0.78rem;
    }
    .demo-roles-group {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 4px;
    }
    .page-title {
        font-size: 1.25rem;
    }
    .stat-card-value {
        font-size: 1.5rem;
    }
}

/* Print Styles */
@media print {
    body { background-color: #ffffff; }
    .demo-floating-bar, .app-sidebar, .app-header, .sidebar-backdrop, .btn, .no-print {
        display: none !important;
    }
    .app-main { margin: 0; padding: 0; }
    .page-content { padding: 0; max-width: 100%; }
    .card { border: none; box-shadow: none; margin: 0; }
}
