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

:root, [data-theme="dark"] {
    --bg-main: #0b1120;
    --bg-panel: #151e32;
    --bg-header: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #0f172a;
    --border-color: #334155;
    --border-accent: #3b82f6;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --status-success: #10b981;
    --status-warning: #f59e0b;
    --status-danger: #ef4444;
    --status-active: #3b82f6;
    --status-pending: #475569;

    --header-gradient: linear-gradient(90deg, #0f172a 0%, #1e293b 100%);
    --header-flight-bg: rgba(15, 23, 42, 0.6);
    --header-flight-border: rgba(51, 65, 85, 0.6);
    --header-text: #ffffff;
    --header-logo-filter: brightness(0) invert(1) drop-shadow(0 1px 3px rgba(0,0,0,0.4));
    
    --auth-bg: radial-gradient(circle at center, #151e32 0%, #0b1120 100%);
    --auth-card-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    
    --table-header-bg: #0f172a;
    --table-hover-bg: rgba(30, 41, 59, 0.6);
    --table-border: rgba(51, 65, 85, 0.4);
    
    --fuselage-bg: #090d16;
    --fuselage-border: #334155;
    --fuselage-shadow: inset 0 0 35px rgba(0,0,0,0.85), 0 8px 24px rgba(0,0,0,0.5);
    --cabin-bg: rgba(15, 23, 42, 0.7);
    --cabin-border: #1e293b;
    --nose-tail-bg: linear-gradient(135deg, #1e293b, #0f172a);
    --nose-tail-border: #475569;
    --seat-occupied-bg: #1e293b;
    --seat-occupied-border: #334155;
    --seat-occupied-color: #475569;
    --aisle-color: #475569;
    --divider-line: linear-gradient(180deg, transparent, #334155, transparent);
    
    --card-title-color: #ffffff;
    --tag-info-bg: rgba(245, 158, 11, 0.1);
    --tag-info-border: rgba(245, 158, 11, 0.3);
    --tag-info-text: #fbbf24;
    --confirm-banner-bg: rgba(37, 99, 235, 0.1);
    --confirm-banner-border: rgba(37, 99, 235, 0.3);
    
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="light"], [data-theme="white"] {
    --bg-main: #f1f5f9;
    --bg-panel: #ffffff;
    --bg-header: #ffffff;
    --bg-card: #f8fafc;
    --bg-input: #ffffff;
    --border-color: #cbd5e1;
    --border-accent: #2563eb;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    --accent-blue: #2563eb;
    --accent-cyan: #0284c7;
    --status-success: #059669;
    --status-warning: #d97706;
    --status-danger: #dc2626;
    --status-active: #2563eb;
    --status-pending: #94a3b8;

    --header-gradient: linear-gradient(90deg, #ffffff 0%, #f8fafc 100%);
    --header-flight-bg: #f1f5f9;
    --header-flight-border: #e2e8f0;
    --header-text: #0f172a;
    --header-logo-filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
    
    --auth-bg: radial-gradient(circle at center, #ffffff 0%, #e2e8f0 100%);
    --auth-card-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    
    --table-header-bg: #f1f5f9;
    --table-hover-bg: #f8fafc;
    --table-border: #e2e8f0;
    
    --fuselage-bg: #f8fafc;
    --fuselage-border: #cbd5e1;
    --fuselage-shadow: inset 0 0 25px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.08);
    --cabin-bg: #ffffff;
    --cabin-border: #e2e8f0;
    --nose-tail-bg: linear-gradient(135deg, #e2e8f0, #f1f5f9);
    --nose-tail-border: #cbd5e1;
    --seat-occupied-bg: #e2e8f0;
    --seat-occupied-border: #cbd5e1;
    --seat-occupied-color: #94a3b8;
    --aisle-color: #94a3b8;
    --divider-line: linear-gradient(180deg, transparent, #cbd5e1, transparent);
    
    --card-title-color: #0f172a;
    --tag-info-bg: rgba(245, 158, 11, 0.1);
    --tag-info-border: rgba(245, 158, 11, 0.3);
    --tag-info-text: #b45309;
    --confirm-banner-bg: rgba(37, 99, 235, 0.06);
    --confirm-banner-border: rgba(37, 99, 235, 0.2);
    
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

html, body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-primary);
    user-select: none;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* ==========================================================================
   WORKSTATION APP SHELL LAYOUT
   ========================================================================== */
.dcs-app-container {
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* --- HEADER BAR --- */
.dcs-header {
    height: 52px !important;
    min-height: 52px !important;
    max-height: 52px !important;
    box-sizing: border-box;
    background: var(--header-gradient);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
    gap: 12px;
    flex-wrap: nowrap;
    overflow: hidden;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.dcs-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    white-space: nowrap;
}

.dcs-brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.2;
    white-space: nowrap;
}

.dcs-brand-title {
    font-weight: 800;
    font-size: 14px;
    color: var(--header-text);
    letter-spacing: 0.5px;
}

.dcs-brand-subtitle {
    font-size: 11px;
    color: var(--text-muted);
}

.dcs-brand-logo {
    height: 34px;
    width: auto;
    filter: var(--header-logo-filter);
    transition: filter 0.2s ease;
}

.dcs-logo-badge {
    background: linear-gradient(135deg, #2563eb, #0284c7);
    color: #ffffff;
    font-weight: 800;
    font-size: 14px;
    padding: 4px 10px;
    border-radius: 4px;
    letter-spacing: 1px;
    box-shadow: 0 0 12px rgba(37, 99, 235, 0.4);
}

.dcs-title {
    font-weight: 700;
    font-size: 16px;
    color: var(--header-text);
    letter-spacing: 0.5px;
}

.dcs-simulation-tag {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.dcs-header-flight-info {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--header-flight-bg);
    padding: 0 14px;
    border-radius: 6px;
    border: 1px solid var(--header-flight-border);
    flex-shrink: 0;
    white-space: nowrap;
    height: 34px !important;
    max-height: 34px !important;
    box-sizing: border-box;
    overflow: hidden;
    transition: all 0.2s ease;
}

.dcs-header-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    white-space: nowrap !important;
    flex-shrink: 0;
}

.dcs-header-item span {
    white-space: nowrap !important;
}

.dcs-header-item .label {
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 10px;
    white-space: nowrap !important;
}

.dcs-header-item .value {
    color: var(--header-text);
    font-weight: 700;
    font-family: var(--font-mono);
    white-space: nowrap !important;
    display: inline-block;
}

.dcs-header-user, .dcs-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.dcs-user-info {
    text-align: right;
    white-space: nowrap;
    max-width: 180px;
}

.dcs-user-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--header-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dcs-user-role {
    font-size: 10px;
    color: var(--accent-cyan);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dcs-btn-header {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.dcs-btn-header:hover {
    background: var(--border-color);
    color: var(--text-primary);
    border-color: var(--border-accent);
}

.dcs-btn-header.active {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

/* --- THEME SELECTOR TOGGLE --- */
.dcs-theme-selector {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2px;
    gap: 2px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dcs-theme-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    user-select: none;
    font-family: var(--font-sans);
}

.dcs-theme-btn:hover {
    color: var(--text-primary);
}

.dcs-theme-btn.active {
    background: var(--accent-blue);
    color: #ffffff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* --- MAIN WORK AREA (NAV SIDEBAR + CENTER VIEW) --- */
.dcs-main-workspace {
    display: flex;
    flex: 1;
    height: calc(100vh - 94px); /* 52px header + 42px footer */
    overflow: hidden;
}

/* LEFT WORKFLOW SIDEBAR */
.dcs-sidebar {
    width: 220px;
    min-width: 220px;
    background: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.dcs-sidebar-title {
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(51, 65, 85, 0.4);
}

.dcs-workflow-nav {
    list-style: none;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dcs-nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.dcs-nav-item:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.dcs-nav-item.active {
    background: linear-gradient(90deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.dcs-nav-item.completed {
    color: var(--status-success);
}

.dcs-nav-item.disabled {
    opacity: 0.35;
    cursor: not-allowed !important;
    pointer-events: none !important;
    user-select: none;
}

.dcs-nav-item.locked-paid {
    opacity: 0.45;
    cursor: not-allowed !important;
    pointer-events: none !important;
    user-select: none;
    background: rgba(15, 23, 42, 0.45);
    border-left: 2px solid rgba(239, 68, 68, 0.6);
}

.dcs-nav-status-icon {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 12px;
}

/* CENTER WORKSPACE */
.dcs-center-workspace {
    flex: 1;
    background: var(--bg-main);
    padding: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dcs-workspace-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: var(--auth-card-shadow);
    overflow: hidden;
}

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

.dcs-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--card-title-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.dcs-card-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

/* --- FOOTER / STATUS BAR --- */
.dcs-footer {
    height: 42px;
    background: var(--bg-header);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
}

.dcs-status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
}

.dcs-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--status-success);
    box-shadow: 0 0 8px var(--status-success);
}

.dcs-action-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dcs-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dcs-btn:disabled,
.dcs-btn[disabled] {
    opacity: 0.55 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    pointer-events: none;
    filter: grayscale(35%);
}

.dcs-btn-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.dcs-btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

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

.dcs-btn-secondary:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

/* ==========================================================================
   FORM CONTROLS & OPERATIONAL TABLES
   ========================================================================== */
.dcs-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.dcs-input {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-family: var(--font-mono);
    font-weight: 600;
    letter-spacing: 1px;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.dcs-input:focus {
    outline: none;
    border-color: var(--border-accent);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.dcs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.dcs-table th {
    background: var(--table-header-bg);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.dcs-table td {
    padding: 12px;
    border-bottom: 1px solid var(--table-border);
    color: var(--text-primary);
}

.dcs-table tbody tr:hover {
    background: var(--table-hover-bg);
}

.dcs-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    font-family: var(--font-mono);
}

.dcs-badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.dcs-badge-info {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.dcs-badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ==========================================================================
   AUTH PAGES STYLING (LOGIN / REGISTER / PROFILE)
   ========================================================================== */
.dcs-auth-wrapper {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--auth-bg);
    transition: background 0.2s ease;
}

.dcs-auth-card {
    width: 420px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px;
    box-shadow: var(--auth-card-shadow);
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.dcs-auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.dcs-auth-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--card-title-color);
    margin-top: 10px;
    letter-spacing: 0.5px;
}

.dcs-auth-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.dcs-form-group {
    margin-bottom: 18px;
}

.dcs-form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dcs-form-control {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.dcs-form-control:focus {
    outline: none;
    border-color: var(--border-accent);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.dcs-btn-block {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    justify-content: center;
    margin-top: 10px;
}

.dcs-alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
}

.dcs-alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
}
