/* ==========================================================================
   SeatAllocationV2 - Premium Design System Tokens & Global Styles
   ========================================================================== */

:root {
    --font-primary: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Brand Colors */
    --color-primary: #4f46e5;
    --color-primary-hover: #4338ca;
    --color-primary-light: #eef2ff;
    --color-secondary: #0ea5e9;
    
    /* Slate / Neutral Palette */
    --color-bg: #f8fafc;
    --color-surface: #ffffff;
    --color-surface-hover: #f1f5f9;
    --color-border: #e2e8f0;
    --color-border-dark: #cbd5e1;
    
    /* Typography */
    --color-text-primary: #0f172a;
    --color-text-secondary: #475569;
    --color-text-muted: #94a3b8;
    
    /* Semantic Status Colors */
    --color-success: #10b981;
    --color-success-bg: #ecfdf5;
    --color-success-border: #a7f3d0;
    
    --color-danger: #ef4444;
    --color-danger-bg: #fef2f2;
    --color-danger-border: #fecaca;
    
    --color-warning: #f59e0b;
    --color-warning-bg: #fffbeb;
    --color-warning-border: #fde68a;
    
    --color-info: #3b82f6;
    --color-info-bg: #eff6ff;
    --color-info-border: #bfdbfe;
    
    /* Elevations & Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.03);

    /* Dimensions */
    --sidebar-width: 260px;
    --header-height: 68px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
}

/* Global Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

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

/* Layout Architecture */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar Styling */
.app-sidebar {
    width: var(--sidebar-width);
    background: #0f172a;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.25s ease-in-out;
}

.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    gap: 12px;
}

.brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 18px;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.4);
}

.brand-title {
    font-size: 17px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
    margin: 0;
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 11px;
    font-weight: 500;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sidebar-user-card {
    margin: 18px 16px 10px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

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

.user-name {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: #38bdf8;
    letter-spacing: 0.04em;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 12px 12px 6px;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all 0.15s ease;
    margin-bottom: 4px;
}

.sidebar-link i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    color: #64748b;
    transition: color 0.15s ease;
}

.sidebar-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-link:hover i {
    color: #38bdf8;
}

.sidebar-link.active {
    color: #ffffff;
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.sidebar-link.active i {
    color: #ffffff;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-signout {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171;
    font-size: 13px;
    font-weight: 700;
    border-radius: var(--radius-md);
    transition: all 0.15s ease;
    cursor: pointer;
}

.btn-signout:hover {
    background: #ef4444;
    color: #ffffff;
}

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

/* Top App Header */
.app-header {
    height: var(--header-height);
    background: #ffffff;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: var(--shadow-sm);
}

.header-title-area h1 {
    font-size: 20px;
    font-weight: 800;
    color: var(--color-text-primary);
    margin: 0;
    letter-spacing: -0.02em;
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: var(--color-primary-light);
    border: 1px solid rgba(79, 70, 229, 0.2);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
    color: var(--color-primary);
}

.header-badge .dot {
    width: 7px;
    height: 7px;
    border-radius: var(--radius-full);
    background-color: var(--color-primary);
}

/* Content Container */
.app-content {
    flex: 1;
    padding: 28px 32px 48px;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
}

/* Global Card Component */
.card-premium {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 24px;
    transition: box-shadow 0.2s ease;
}

.card-premium:hover {
    box-shadow: var(--shadow-md);
}

.card-header-premium {
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
}

.card-title-premium {
    font-size: 17px;
    font-weight: 800;
    color: var(--color-text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body-premium {
    padding: 24px;
}

/* Metric / Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.stat-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.stat-icon-indigo {
    background: #e0e7ff;
    color: #4f46e5;
}

.stat-icon-emerald {
    background: #d1fae5;
    color: #059669;
}

.stat-icon-rose {
    background: #ffe4e6;
    color: #e11d48;
}

.stat-icon-sky {
    background: #e0f2fe;
    color: #0284c7;
}

.stat-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--color-text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary);
}

/* Toast Alerts */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 420px;
    width: 100%;
}

.toast-alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    background: #ffffff;
}

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

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

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

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

.toast-content {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.toast-close:hover {
    color: var(--color-text-primary);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Forms & Inputs */
.form-label-custom {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-control-custom {
    width: 100%;
    height: 46px;
    padding: 10px 16px;
    font-family: var(--font-primary);
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-primary);
    background-color: #ffffff;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: all 0.15s ease;
}

.form-control-custom:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.btn-primary-custom {
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 24px;
    font-family: var(--font-primary);
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    transition: all 0.15s ease;
}

.btn-primary-custom:hover {
    background: linear-gradient(135deg, #4338ca 0%, #3730a3 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
    color: #ffffff;
}

.btn-primary-custom:active {
    transform: translateY(0);
}

/* Footer */
.app-footer {
    padding: 20px 32px;
    border-top: 1px solid var(--color-border);
    background: #ffffff;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-muted);
    text-align: center;
}

/* Mobile Responsiveness */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--color-text-primary);
    cursor: pointer;
}

@media (max-width: 992px) {
    .app-sidebar {
        transform: translateX(-100%);
    }
    .app-sidebar.show {
        transform: translateX(0);
    }
    .app-main {
        margin-left: 0;
    }
    .mobile-nav-toggle {
        display: block;
    }
    .app-header {
        padding: 0 16px;
    }
    .app-content {
        padding: 20px 16px;
    }
}