/**
 * AluRail Admin Center - Katalyst Design System Stylesheet
 *
 * Ultra-clean, borderless surface separation, fatigue-free contrast,
 * full Dark & Light mode readiness, vertical sidebar navigation,
 * and modern SaaS aesthetics matching demo_admin_katalyst.
 *
 * @package AluRail
 */

/* ==========================================================================
   1. ROOT DESIGN TOKENS & CSS VARIABLES
   ========================================================================== */
:root,
.light-theme,
[data-theme="light"] {
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Base Surfaces */
    --bg-app: #f6f8fa;
    --bg-topbar: rgba(255, 255, 255, 0.94);
    --bg-nav: #ffffff;
    --bg-subnav: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #fcfdfe;
    --bg-subtle: #f1f5f9;
    --bg-input: #ffffff;
    --bg-modal: #ffffff;
    --bg-modal-header: #f8fafc;
    --bg-modal-footer: #f8fafc;

    /* Borders (Translucent & Soft) */
    --border-subtle: rgba(15, 23, 42, 0.08);
    --border-light: rgba(15, 23, 42, 0.04);
    --border-hover: rgba(0, 144, 255, 0.35);

    /* Typography Colors */
    --text-main: #0f172a;
    --text-body: #334155;
    --text-muted: #64748b;
    --text-dim: #94a3b8;

    /* Brand & Accents (Katalyst Blue) */
    --brand-primary: #0090ff;
    --brand-hover: #0574f0;
    --brand-active: #085ccd;
    --brand-tint: rgba(0, 144, 255, 0.08);
    --brand-border: rgba(0, 144, 255, 0.22);
    --brand-text: #0574f0;

    /* Semantic Status */
    --success-bg: rgba(16, 185, 129, 0.1);
    --success-text: #059669;
    --success-border: rgba(16, 185, 129, 0.25);

    --warning-bg: rgba(245, 158, 11, 0.1);
    --warning-text: #d97706;
    --warning-border: rgba(245, 158, 11, 0.25);

    --danger-bg: rgba(239, 68, 68, 0.1);
    --danger-text: #dc2626;
    --danger-border: rgba(239, 68, 68, 0.25);

    --purple-bg: rgba(168, 85, 247, 0.1);
    --purple-text: #7c3aed;
    --purple-border: rgba(168, 85, 247, 0.25);

    /* Shadows & Elevations */
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 16px -2px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 12px 32px -4px rgba(15, 23, 42, 0.12);
    --shadow-modal: 0 24px 48px -12px rgba(15, 23, 42, 0.25);
    
    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-full: 9999px;
}

.dark-theme,
[data-theme="dark"] {
    /* Base Surfaces */
    --bg-app: #0c1017;
    --bg-topbar: rgba(17, 22, 32, 0.9);
    --bg-nav: #111620;
    --bg-subnav: #0d121a;
    --bg-card: #131822;
    --bg-card-hover: #161c27;
    --bg-subtle: #171d29;
    --bg-input: #0e131d;
    --bg-modal: #131822;
    --bg-modal-header: #0f141d;
    --bg-modal-footer: #0f141d;

    /* Borders (Translucent & Soft) */
    --border-subtle: rgba(255, 255, 255, 0.07);
    --border-light: rgba(255, 255, 255, 0.04);
    --border-hover: rgba(0, 144, 255, 0.4);

    /* Typography Colors */
    --text-main: #f0f6fc;
    --text-body: #c9d1d9;
    --text-muted: #8b949e;
    --text-dim: #6e7681;

    /* Brand & Accents */
    --brand-primary: #0090ff;
    --brand-hover: #38a5ff;
    --brand-active: #0574f0;
    --brand-tint: rgba(0, 144, 255, 0.12);
    --brand-border: rgba(0, 144, 255, 0.3);
    --brand-text: #58b2ff;

    /* Semantic Status */
    --success-bg: rgba(16, 185, 129, 0.12);
    --success-text: #34d399;
    --success-border: rgba(16, 185, 129, 0.3);

    --warning-bg: rgba(245, 158, 11, 0.12);
    --warning-text: #fbbf24;
    --warning-border: rgba(245, 158, 11, 0.3);

    --danger-bg: rgba(239, 68, 68, 0.12);
    --danger-text: #f87171;
    --danger-border: rgba(239, 68, 68, 0.3);

    --purple-bg: rgba(168, 85, 247, 0.14);
    --purple-text: #c084fc;
    --purple-border: rgba(168, 85, 247, 0.3);

    /* Shadows & Elevations */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 6px 20px -2px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 16px 40px -4px rgba(0, 0, 0, 0.6);
    --shadow-modal: 0 24px 60px -12px rgba(0, 0, 0, 0.8);
}

/* ==========================================================================
   2. GLOBAL RESET & BASE STYLES
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

body.aluline-tgv-admin-page {
    margin: 0;
    padding: 0;
    background-color: var(--bg-app);
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 13.5px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

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

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

/* Ultra-Slim Modern Scrollbars (Fatigue-Free) */
html, body, *, *::before, *::after {
    scrollbar-width: thin !important;
    scrollbar-color: rgba(148, 163, 184, 0.28) transparent !important;
}

::-webkit-scrollbar {
    width: 4px !important;
    height: 4px !important;
}

::-webkit-scrollbar-track {
    background: transparent !important;
}

::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.28) !important;
    border-radius: 9999px !important;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.55) !important;
}

::-webkit-scrollbar-button {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

::-webkit-scrollbar-corner {
    background: transparent !important;
}

.dark-theme,
[data-theme="dark"] {
    scrollbar-color: rgba(255, 255, 255, 0.16) transparent !important;
}

.dark-theme ::-webkit-scrollbar-thumb,
[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.16) !important;
}

.dark-theme ::-webkit-scrollbar-thumb:hover,
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35) !important;
}

/* ==========================================================================
   3. MASTER KATALYST LAYOUT (VERTICAL SIDEBAR + VIEWPORT)
   ========================================================================== */
.katalyst-layout-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar */
.katalyst-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--bg-nav);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 30;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.katalyst-sidebar.collapsed {
    width: 68px;
}

.katalyst-sidebar.collapsed .brand-text,
.katalyst-sidebar.collapsed .nav-group-label,
.katalyst-sidebar.collapsed .tab-nav-lead span,
.katalyst-sidebar.collapsed .pulse-dot,
.katalyst-sidebar.collapsed .nav-badge-pill,
.katalyst-sidebar.collapsed .user-text {
    display: none !important;
}

.katalyst-sidebar.collapsed .sidebar-brand-header {
    padding: 0 8px;
    justify-content: center;
    position: relative;
    height: 64px;
}

.katalyst-sidebar.collapsed .brand-link {
    gap: 0;
    justify-content: center;
    margin: 0;
}

.katalyst-sidebar.collapsed .brand-icon-box {
    width: 38px;
    height: 38px;
    font-size: 19px;
    margin: 0 auto;
}

.katalyst-sidebar.collapsed .sidebar-collapse-btn {
    position: absolute;
    right: -12px;
    top: 20px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-md);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.85);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.katalyst-sidebar.collapsed:hover .sidebar-collapse-btn,
.katalyst-sidebar.collapsed .sidebar-brand-header:hover .sidebar-collapse-btn {
    opacity: 1;
    transform: scale(1);
}

.katalyst-sidebar.collapsed .sidebar-collapse-btn:hover {
    background: var(--brand-primary);
    color: #ffffff;
    border-color: var(--brand-primary);
    box-shadow: 0 2px 8px rgba(0, 144, 255, 0.35);
}

.katalyst-sidebar.collapsed .sidebar-nav-scroll {
    padding: 16px 8px;
}

.katalyst-sidebar.collapsed .tab-nav-btn {
    justify-content: center;
    padding: 10px 0;
    border-radius: var(--radius-md);
}

.katalyst-sidebar.collapsed .tab-nav-lead {
    justify-content: center;
    margin: 0 auto;
}

.katalyst-sidebar.collapsed .tab-nav-lead i {
    font-size: 18px;
}

/* Sidebar Header */
.sidebar-brand-header {
    height: 64px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.brand-icon-box {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #0090ff 0%, #38bdf8 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 2px 10px rgba(0, 144, 255, 0.3);
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: -0.01em;
}

.badge-tag {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    background: var(--brand-tint);
    color: var(--brand-text);
    padding: 1px 6px;
    border-radius: var(--radius-full);
    border: 1px solid var(--brand-border);
}

.brand-sub {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.sidebar-collapse-btn {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.sidebar-collapse-btn:hover {
    color: var(--text-main);
    background: var(--bg-subtle);
}

/* Sidebar Scrollable Nav */
.sidebar-nav-scroll {
    flex: 1;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 16px 10px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    scrollbar-width: thin !important;
    scrollbar-color: rgba(148, 163, 184, 0.28) transparent !important;
}

.sidebar-nav-scroll::-webkit-scrollbar {
    width: 4px !important;
}

.sidebar-nav-scroll::-webkit-scrollbar-track {
    background: transparent !important;
}

.sidebar-nav-scroll::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.28) !important;
    border-radius: 9999px !important;
}

.sidebar-nav-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.55) !important;
}

.dark-theme .sidebar-nav-scroll::-webkit-scrollbar-thumb,
[data-theme="dark"] .sidebar-nav-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.16) !important;
}

.dark-theme .sidebar-nav-scroll::-webkit-scrollbar-thumb:hover,
[data-theme="dark"] .sidebar-nav-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35) !important;
}

.nav-group-section {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-group-label {
    padding: 0 10px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.nav-group-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tab-nav-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.15s ease;
    border: 1px solid transparent;
    text-decoration: none;
    cursor: pointer;
    background: transparent;
}

.tab-nav-btn:hover {
    color: var(--text-main);
    background: var(--bg-subtle);
}

.tab-nav-btn.active {
    color: var(--brand-text);
    background: var(--brand-tint);
    border-color: var(--brand-border);
    box-shadow: 0 1px 4px rgba(0, 144, 255, 0.15);
}

.tab-nav-lead {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tab-nav-lead i {
    font-size: 16px;
    flex-shrink: 0;
}

.nav-badge-pill {
    font-family: var(--font-mono);
    font-size: 9.5px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: var(--radius-full);
}

.nav-badge-pill.warn {
    background: var(--warning-bg);
    color: var(--warning-text);
    border: 1px solid var(--warning-border);
}

.nav-badge-pill.info {
    background: var(--brand-tint);
    color: var(--brand-text);
    border: 1px solid var(--brand-border);
}

/* Sidebar Footer User Card */
.sidebar-user-footer {
    padding: 12px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-nav);
    flex-shrink: 0;
}

.user-footer-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
}

.user-lead {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar-initials {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0090ff 0%, #6366f1 100%);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.user-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.user-name-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
}

.user-role-title {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
}

.user-logout-btn {
    color: var(--text-muted);
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: color 0.15s, background-color 0.15s;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.user-logout-btn:hover {
    color: var(--danger-text);
}

/* Collapsed User Footer Card */
.katalyst-sidebar.collapsed .sidebar-user-footer {
    padding: 10px 6px;
}

.katalyst-sidebar.collapsed .user-footer-card {
    flex-direction: column;
    gap: 8px;
    padding: 4px 0;
    background: transparent;
    border: none;
    align-items: center;
    justify-content: center;
}

.katalyst-sidebar.collapsed .user-lead {
    gap: 0;
    justify-content: center;
}

.katalyst-sidebar.collapsed .user-avatar-initials {
    width: 36px;
    height: 36px;
    font-size: 12px;
    margin: 0 auto;
    cursor: default;
}

.katalyst-sidebar.collapsed .user-logout-btn {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-md);
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 16px;
    color: var(--text-muted);
}

.katalyst-sidebar.collapsed .user-logout-btn:hover {
    background: var(--danger-bg);
    border-color: var(--danger-border);
    color: var(--danger-text);
    transform: translateY(-1px);
}

/* Collapsed Sidebar Custom Floating Tooltip */
#katalyst-sidebar-tooltip {
    position: fixed;
    z-index: 999999;
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    color: #f8fafc;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    box-shadow: 0 10px 30px -4px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
    pointer-events: none;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(-50%) translateX(-6px);
    transition: opacity 0.15s ease, transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.01em;
}

#katalyst-sidebar-tooltip.active {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

#katalyst-sidebar-tooltip::before {
    content: "";
    position: absolute;
    left: -5px;
    top: 50%;
    transform: translateY(-50%);
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-right: 5px solid rgba(15, 23, 42, 0.94);
}

.dark-theme #katalyst-sidebar-tooltip,
[data-theme="dark"] #katalyst-sidebar-tooltip {
    background: rgba(10, 15, 25, 0.96);
    border-color: rgba(255, 255, 255, 0.12);
}

.dark-theme #katalyst-sidebar-tooltip::before,
[data-theme="dark"] #katalyst-sidebar-tooltip::before {
    border-right-color: rgba(10, 15, 25, 0.96);
}

#katalyst-sidebar-tooltip .tooltip-badge {
    font-size: 9.5px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    background: var(--brand-primary);
    color: #ffffff;
    letter-spacing: 0.03em;
}

/* ==========================================================================
   4. MAIN VIEWPORT & TOPBAR
   ========================================================================== */
.katalyst-main-viewport {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
    overflow-x: hidden;
    background: var(--bg-app);
}

.katalyst-topbar {
    height: 64px;
    background: var(--bg-topbar);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 20;
    flex-shrink: 0;
}

.topbar-search-box {
    position: relative;
    width: 100%;
    max-width: 480px;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 15px;
    pointer-events: none;
}

.topbar-search-box input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 7px 44px 7px 34px;
    font-size: 12px;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s;
}

.topbar-search-box input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 2px var(--brand-tint);
}

.search-kbd {
    position: absolute;
    right: 10px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: var(--radius-sm);
    background: var(--bg-subtle);
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
    pointer-events: none;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-indicator-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid var(--success-border);
    font-size: 11.5px;
    font-weight: 700;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.2); }
}

.top-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-body);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.top-action-btn:hover {
    background: var(--bg-subtle);
    color: var(--text-main);
    border-color: var(--border-hover);
}

.top-action-btn.icon-only {
    padding: 7px 9px;
}

.katalyst-content-area {
    flex: 1;
    padding: 24px;
    max-width: 100%;
}

.aluline-main-content {
    padding: 0;
    max-width: 100%;
}

/* ==========================================================================
   5. CARDS, GRIDS & TYPOGRAPHY
   ========================================================================== */
.tab-header {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.tab-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

.tab-header h3 {
    margin: 0 0 6px 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
}

.tab-header p {
    margin: 4px 0 0;
    font-size: 12.5px;
    color: var(--text-muted);
}

.tab-content-inner {
    margin-bottom: 24px;
}

.aluline-tab-content {
    display: block;
    animation: fadeInTab 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInTab {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Cards */
.aluline-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    overflow: hidden;
    margin-bottom: 20px;
}

.aluline-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

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

.aluline-card .card-header h3 {
    margin: 0;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-main);
}

.aluline-card .card-body {
    padding: 18px 20px;
}

.aluline-card .card-footer {
    padding: 12px 20px;
    background: var(--bg-subtle);
    border-top: 1px solid var(--border-subtle);
}

/* KPI Stat Cards Grid */
.aluline-grid-container {
    display: grid;
    gap: 14px;
}

.aluline-grid-container.two-cols {
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

.aluline-grid-container.three-cols {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.aluline-grid-container.four-cols {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.statistic {
    font-family: var(--font-mono);
    font-size: 26px;
    font-weight: 800;
    margin: 0 0 4px 0;
    color: var(--text-main);
}

.description {
    margin: 0;
    font-size: 11.5px;
    color: var(--text-muted);
}

.statistic-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-resource {
    font-size: 13px !important;
    font-weight: 600 !important;
    word-break: break-word;
}

/* ==========================================================================
   6. SYSTEM & ADMIN TAB SPECIAL STYLES
   ========================================================================== */
.aluline-subnav,
.aluline-settings-subnav {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 24px;
    padding: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    max-width: 100%;
}

.subnav-tab-btn,
.settings-subnav-btn {
    background: transparent;
    border: 1px solid transparent;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    text-decoration: none;
    font-family: inherit;
    line-height: 1.4;
    outline: none;
}

.subnav-tab-btn i,
.settings-subnav-btn i {
    font-size: 16px;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.subnav-tab-btn:hover,
.settings-subnav-btn:hover {
    border-color: var(--border-subtle);
    color: var(--text-main);
    background: var(--bg-subtle);
}

.subnav-tab-btn:hover i,
.settings-subnav-btn:hover i {
    color: var(--brand-primary);
}

.subnav-tab-btn.active,
.settings-subnav-btn.active {
    background: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(0, 144, 255, 0.35);
    font-weight: 700;
}

.subnav-tab-btn.active i,
.settings-subnav-btn.active i {
    color: #ffffff !important;
}

.tab-subcontent,
.settings-card[data-subtab] {
    transition: opacity 0.2s ease;
}

/* Appearance Theme Picker Grid */
.theme-picker-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
}

.theme-picker-item {
    background: var(--bg-card);
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}

.theme-picker-item:hover {
    border-color: var(--brand-border);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.theme-picker-item.selected {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 2px var(--brand-tint), var(--shadow-md);
}

.theme-picker-item img {
    display: block;
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    background: var(--bg-subtle);
    min-height: 90px;
    border-bottom: 1px solid var(--border-subtle);
}

.theme-picker-item p {
    text-align: center;
    padding: 10px 12px;
    margin: 0;
    background: var(--bg-card);
    font-weight: 700;
    font-size: 12px;
    color: var(--text-main);
}

.map-toggles-container {
    padding: 8px 10px;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border-subtle);
}

.map-visibility-toggle,
.map-recom-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

/* Modern iOS-Style Toggle Switch */
.aluline-toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}

.aluline-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.aluline-toggle-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--border-subtle);
    transition: 0.25s;
    border-radius: 22px;
    border: 1px solid var(--border-subtle);
}

.aluline-toggle-switch .slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: #ffffff;
    transition: 0.25s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.aluline-toggle-switch input:checked + .slider {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.aluline-toggle-switch input:checked + .slider:before {
    transform: translateX(22px);
}

/* Maintenance Console & Log Boxes */
.message-content-box {
    background: #0d1117;
    color: #58a6ff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 16px;
    max-height: 42vh;
    overflow-y: auto;
    white-space: pre-wrap;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.6;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.5);
}

/* Image Uploaders & Galleries */
.image-uploader-wrapper {
    display: flex;
    align-items: center;
    gap: 14px;
}

.image-uploader-wrapper .image-preview {
    width: 60px;
    height: 60px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    object-fit: contain;
    background-color: var(--bg-subtle);
}

.splash-image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 10px;
}

.splash-image-item {
    position: relative;
    width: 64px;
    height: 64px;
}

.splash-image-item img {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    object-fit: cover;
}

.shortcode-list p {
    background: var(--bg-subtle);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 12px;
    margin: 4px 0;
    border: 1px solid var(--border-subtle);
}

.social-media-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    align-items: center;
    margin-bottom: 14px;
}

/* Drag and Drop Importer Boxes */
#csv-uploader-wrapper,
#geojson-uploader-wrapper,
#cron-importer-wrapper {
    border: 2px dashed var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    background: var(--bg-subtle);
    transition: all 0.2s ease;
}

#csv-uploader-wrapper.active,
#geojson-uploader-wrapper.active,
#cron-importer-wrapper.active {
    background: var(--brand-tint);
    border-color: var(--brand-primary);
}

/* Metro Timetables & Alignment Order Lists */
.compact-list {
    list-style: none;
    padding: 0;
    margin: 0;
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    max-height: 220px;
    overflow-y: auto;
}

.compact-list li {
    padding: 8px 14px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12.5px;
}

.compact-list li:last-child {
    border-bottom: none;
}

.schedule-creator-grid {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 20px;
    align-items: start;
}

.schedule-creator-map {
    width: 100%;
    height: 360px;
    background-color: var(--bg-subtle);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.schedule-creator-step {
    display: none;
}

.schedule-creator-step.active {
    display: block;
    animation: fadeInTab 0.3s ease;
}

#schedule-creator-stops-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

#schedule-creator-stops-table th,
#schedule-creator-stops-table td {
    padding: 8px;
    border: 1px solid var(--border-subtle);
    text-align: left;
    font-size: 12.5px;
}

#schedule-creator-stops-table th {
    background: var(--bg-subtle);
    font-weight: 700;
}

#schedule-creator-stops-table input {
    width: 100%;
    padding: 4px 8px;
    font-size: 12px;
    text-align: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: var(--bg-input);
    color: var(--text-main);
}

.aluline-modal-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 12px;
}

/* ==========================================================================
   7. FORMS & INPUTS
   ========================================================================== */
.aluline-form-group,
.form-group {
    margin-bottom: 15px;
}

.aluline-form-group label,
.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 5px;
}

.aluline-form-group input[type="text"],
.aluline-form-group input[type="password"],
.aluline-form-group input[type="email"],
.aluline-form-group input[type="number"],
.aluline-form-group input[type="date"],
.aluline-form-group select,
.aluline-form-group textarea,
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select,
.form-group textarea,
.aluline-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    color: var(--text-main);
    font-size: 12.5px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
}

.aluline-form-group input:focus,
.aluline-form-group select:focus,
.aluline-form-group textarea:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 2px var(--brand-tint);
}

/* Buttons */
.aluline-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 16px;
    border-radius: var(--radius-md);
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.4;
}

.aluline-button.primary {
    background: var(--brand-primary);
    color: #ffffff;
    border-color: var(--brand-primary);
    box-shadow: 0 2px 8px rgba(0, 144, 255, 0.25);
}

.aluline-button.primary:hover {
    background: var(--brand-hover);
    border-color: var(--brand-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 144, 255, 0.35);
}

.aluline-button.secondary {
    background: var(--bg-card);
    color: var(--text-body);
    border-color: var(--border-subtle);
    box-shadow: var(--shadow-sm);
}

.aluline-button.secondary:hover {
    background: var(--bg-subtle);
    color: var(--text-main);
    border-color: var(--border-hover);
}

.aluline-button.danger {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}

.aluline-button.danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

.aluline-btn-icon {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.aluline-btn-icon:hover {
    background: var(--bg-subtle);
    color: var(--text-main);
    border-color: var(--border-subtle);
}

/* Badges */
.aluline-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
}

.badge-purple { background: var(--purple-bg); color: var(--purple-text); border: 1px solid var(--purple-border); }
.badge-blue { background: var(--brand-tint); color: var(--brand-text); border: 1px solid var(--brand-border); }
.badge-green { background: var(--success-bg); color: var(--success-text); border: 1px solid var(--success-border); }
.badge-orange { background: var(--warning-bg); color: var(--warning-text); border: 1px solid var(--warning-border); }

/* ==========================================================================
   8. DATATABLES & ROW CHECKBOXES
   ========================================================================== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.dataTables_wrapper {
    position: relative;
    clear: both;
    width: 100%;
    margin-bottom: 8px;
}

/* DataTables Top Row (Length + Filter) */
.aluline-dt-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 16px;
}

.dataTables_wrapper .dataTables_length {
    float: none !important;
    display: inline-flex !important;
    align-items: center !important;
    margin: 0 !important;
}

.dataTables_wrapper .dataTables_length label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    color: var(--text-muted) !important;
    margin: 0 !important;
    white-space: nowrap !important;
}

.dataTables_wrapper .dataTables_length select {
    width: auto !important;
    min-width: 68px !important;
    height: 34px !important;
    padding: 4px 28px 4px 10px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    background-color: var(--bg-input) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: var(--radius-md) !important;
    color: var(--text-main) !important;
    display: inline-block !important;
    margin: 0 4px !important;
    cursor: pointer !important;
}

.dataTables_wrapper .dataTables_filter {
    float: none !important;
    display: inline-flex !important;
    align-items: center !important;
    margin: 0 !important;
    text-align: right !important;
}

.dataTables_wrapper .dataTables_filter label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    color: var(--text-muted) !important;
    margin: 0 !important;
}

.dataTables_wrapper .dataTables_filter input {
    background: var(--bg-input) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: var(--radius-md) !important;
    padding: 6px 12px !important;
    color: var(--text-main) !important;
    outline: none !important;
    font-size: 12.5px !important;
    margin-left: 0 !important;
    width: 220px !important;
    height: 34px !important;
    box-sizing: border-box !important;
    transition: all 0.15s ease !important;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--brand-primary) !important;
    box-shadow: 0 0 0 3px var(--brand-tint) !important;
    width: 250px !important;
}

/* DataTables Table Design */
table.dataTable {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 12.5px;
    margin: 8px 0 !important;
}

table.dataTable thead th {
    background: var(--bg-subnav);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-subtle) !important;
    white-space: nowrap;
}

table.dataTable tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-main);
    vertical-align: middle;
}

table.dataTable tbody tr:hover td {
    background-color: var(--bg-card-hover);
}

/* DataTables Bottom Row (Info + Pagination) */
.aluline-dt-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
}

.dataTables_wrapper .dataTables_info {
    float: none !important;
    padding: 0 !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: var(--text-muted) !important;
    margin: 0 !important;
}

.dataTables_wrapper .dataTables_paginate {
    float: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    margin: 0 !important;
    padding: 0 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 30px !important;
    height: 30px !important;
    padding: 0 10px !important;
    border-radius: var(--radius-md) !important;
    border: 1px solid var(--border-subtle) !important;
    background: var(--bg-card) !important;
    color: var(--text-body) !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    user-select: none !important;
    box-shadow: var(--shadow-sm) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.disabled):not(.current) {
    background: var(--bg-subtle) !important;
    border-color: var(--border-hover) !important;
    color: var(--text-main) !important;
    transform: translateY(-1px);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--brand-primary) !important;
    color: #ffffff !important;
    border-color: var(--brand-primary) !important;
    box-shadow: 0 2px 8px rgba(0, 144, 255, 0.3) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    opacity: 0.45 !important;
    cursor: not-allowed !important;
    background: transparent !important;
    border-color: var(--border-subtle) !important;
    color: var(--text-dim) !important;
    box-shadow: none !important;
}

/* Custom Clean Checkbox */
input[type="checkbox"] {
    accent-color: var(--brand-primary);
    width: 15px;
    height: 15px;
    cursor: pointer;
    vertical-align: middle;
}

/* ==========================================================================
   9. FLOATING BULK ACTION BAR (MULTI-SELECT DOCK)
   ========================================================================== */
.aluline-bulk-action-bar {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: #f1f5f9;
    padding: 8px 16px;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 36px -4px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.06) inset;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 58px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    white-space: nowrap;
    max-width: 92vw;
    overflow-x: auto;
}

.aluline-bulk-action-bar.visible {
    bottom: 24px;
}

.bulk-action-bar-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-right: 12px;
    font-size: 12px;
    font-weight: 700;
    color: #94a3b8;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
    height: 100%;
    flex-shrink: 0;
}

.bar-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-primary);
    color: #ffffff;
    min-width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 800;
    padding: 0 6px;
    box-shadow: 0 0 10px rgba(0, 144, 255, 0.5);
}

.bulk-action-bar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bar-sep {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 4px;
    flex-shrink: 0;
}

.bar-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 700;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1;
    white-space: nowrap;
}

.bar-btn:active {
    transform: scale(0.96);
}

.bar-btn .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    line-height: 14px;
}

.bar-btn--primary {
    background: var(--brand-primary);
    color: #ffffff;
    border-color: var(--brand-primary);
}
.bar-btn--primary:hover {
    background: var(--brand-hover);
    box-shadow: 0 2px 10px rgba(0, 144, 255, 0.5);
}

.bar-btn--secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.14);
}
.bar-btn--secondary:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.bar-btn--danger {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}
.bar-btn--danger:hover {
    background: #dc2626;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.5);
}

.bar-btn--warn {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.35);
}
.bar-btn--warn:hover {
    background: rgba(245, 158, 11, 0.3);
    color: #f59e0b;
}

.bar-btn--ghost {
    background: transparent;
    color: #94a3b8;
    border-color: transparent;
    padding: 6px 8px;
}
.bar-btn--ghost:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.bar-select,
.bulk-action-bar-actions select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-md);
    color: #ffffff;
    font-size: 12px;
    padding: 5px 10px;
    height: 32px;
    cursor: pointer;
    outline: none;
}

.bar-select option {
    background: #0f172a;
    color: #f1f5f9;
}

.bar-select-wide {
    width: 190px;
}

.bar-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-md);
    color: #ffffff;
    font-size: 12px;
    padding: 5px 10px;
    height: 32px;
    width: 95px;
    outline: none;
}

.bar-input::placeholder {
    color: #94a3b8;
}

/* ==========================================================================
   10. MODALS & DIALOGS (KATALYST MODAL SYSTEM)
   ========================================================================== */
.aluline-modal-backdrop {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    background: rgba(15, 23, 42, 0.65) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: none;
    align-items: center !important;
    justify-content: center !important;
    z-index: 99999 !important;
    padding: 24px;
    box-sizing: border-box !important;
}

.aluline-modal-backdrop.active,
.aluline-modal-backdrop[style*="display: block"],
.aluline-modal-backdrop[style*="display: flex"] {
    display: flex !important;
}

.aluline-modal,
.modal-content {
    background: var(--bg-modal);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.05);
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    margin: auto !important;
    animation: scaleModal 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleModal {
    0% { opacity: 0; transform: scale(0.95) translateY(12px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.aluline-modal.modal-sm { max-width: 460px; }
.aluline-modal.modal-md { max-width: 640px; }
.aluline-modal.modal-lg { max-width: 900px; }
.aluline-modal.modal-xl { max-width: 1200px; }

.aluline-modal-header {
    padding: 18px 24px;
    background: var(--bg-modal-header);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.aluline-modal-header h3,
.aluline-modal-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.01em;
}

.aluline-modal-close,
.close-modal {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: all 0.15s ease;
}

.aluline-modal-close:hover,
.close-modal:hover {
    color: var(--danger-text);
    background: var(--danger-bg);
    border-color: var(--danger-border);
    transform: scale(1.04);
}

.aluline-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    overscroll-behavior: contain;
}

.aluline-modal-footer,
.modal-footer {
    padding: 16px 24px;
    background: var(--bg-modal-footer);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-shrink: 0;
}

.aluline-modal-footer .footer-status {
    margin-right: auto;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.aluline-modal-footer .footer-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

/* Modal Section Cards & Fieldsets */
.modal-section-card {
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin-bottom: 16px;
}

.modal-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.modal-section-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
}

/* Segmented Tabs (Modal Header Navigation) */
.modal-tabs-segmented {
    display: flex;
    gap: 6px;
    padding: 4px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    margin-bottom: 20px;
}

.tab-seg-btn {
    flex: 1;
    padding: 9px 16px;
    border-radius: 7px;
    font-size: 12.5px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    background: transparent;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.tab-seg-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.tab-seg-btn.active {
    background: var(--brand-primary);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 144, 255, 0.32);
}

/* Wizard Stepper Component */
.schedule-wizard-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    padding: 14px 20px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
}

.wizard-step-node {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-dim);
    transition: all 0.2s ease;
}

.wizard-step-node .step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.wizard-step-node .step-text {
    display: flex;
    flex-direction: column;
}

.wizard-step-node .step-title {
    font-size: 12.5px;
    font-weight: 700;
    color: inherit;
    line-height: 1.2;
}

.wizard-step-node .step-subtitle {
    font-size: 10.5px;
    color: var(--text-dim);
}

.wizard-step-node.active {
    color: var(--brand-primary);
}

.wizard-step-node.active .step-num {
    background: var(--brand-primary);
    color: #ffffff;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 4px rgba(0, 144, 255, 0.2);
}

.wizard-step-node.active .step-subtitle {
    color: var(--text-muted);
}

.wizard-step-node.completed {
    color: var(--success-text);
}

.wizard-step-node.completed .step-num {
    background: var(--success-bg);
    color: var(--success-text);
    border-color: var(--success-border);
}

.wizard-step-divider {
    flex: 1;
    height: 2px;
    background: var(--border-subtle);
    margin: 0 14px;
}

/* Operating Days Pill Checkbox Group */
.days-pill-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 6px;
}

.day-pill-label {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    width: 44px !important;
    height: 36px !important;
    min-width: 44px !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    box-sizing: border-box !important;
    position: relative;
}

.day-pill-label span {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    text-align: center !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.day-pill-label:hover {
    border-color: var(--brand-primary);
    color: var(--text-main);
}

.day-pill-label:has(input:checked),
.day-pill-label.active {
    background: var(--brand-tint);
    border-color: var(--brand-border);
    color: var(--brand-primary);
    box-shadow: 0 1px 3px rgba(0, 144, 255, 0.12);
}

.day-pill-label input {
    position: absolute !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none !important;
}

/* Stops Table inside Modals */
#schedule-creator-stops-table,
#edit-schedule-stops-table,
#import-wa-preview-table {
    width: 100%;
    border-collapse: collapse;
}

#schedule-creator-stops-table th,
#edit-schedule-stops-table th,
#import-wa-preview-table th {
    padding: 10px 14px;
    background: var(--bg-subtle);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-subtle);
    text-align: left;
}

#schedule-creator-stops-table td,
#edit-schedule-stops-table td,
#import-wa-preview-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 12.5px;
    color: var(--text-main);
    vertical-align: middle;
}

#schedule-creator-stops-table tr:last-child td,
#edit-schedule-stops-table tr:last-child td,
#import-wa-preview-table tr:last-child td {
    border-bottom: none;
}

#schedule-creator-stops-table input,
#edit-schedule-stops-table input {
    width: 100%;
    padding: 6px 10px;
    font-size: 12.5px;
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-input);
    color: var(--text-main);
    box-sizing: border-box;
}

#schedule-creator-stops-table input:focus,
#edit-schedule-stops-table input:focus {
    border-color: var(--brand-primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 144, 255, 0.15);
}

.drag-handle {
    cursor: grab !important;
    text-align: center;
    color: var(--text-dim);
    user-select: none;
    -webkit-user-select: none;
    transition: color 0.15s ease;
    width: 32px;
}

.drag-handle:hover {
    color: var(--brand-primary);
}

.drag-handle:active {
    cursor: grabbing !important;
}

tr.sortable-ghost,
tr.ui-sortable-placeholder {
    opacity: 0.35 !important;
    background: var(--brand-tint) !important;
    border: 2px dashed var(--brand-border) !important;
}

tr.sortable-chosen {
    background: var(--bg-card-hover) !important;
}

tr.sortable-drag,
tr.ui-sortable-helper {
    background: var(--bg-card) !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--brand-border) !important;
    display: table !important;
}


/* ==========================================================================
   11. FLOATING ACTION DOCK (FAB)
   ========================================================================== */
.aluline-fab-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 990;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fab-buttons-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    border-radius: var(--radius-full);
    background: var(--bg-topbar);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.aluline-fab-container.collapsed .fab-buttons-wrapper {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.85) translateX(20px);
}

.aluline-fab-container button,
.aluline-fab-container a {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.aluline-fab-container button:hover,
.aluline-fab-container a:hover {
    background: var(--brand-primary);
    color: #ffffff;
    border-color: var(--brand-primary);
    transform: translateY(-2px);
}

#fab-toggle {
    background: var(--brand-primary);
    color: #ffffff;
    border-color: var(--brand-primary);
    box-shadow: 0 4px 14px rgba(0, 144, 255, 0.35);
}

.aluline-fab-container.collapsed #fab-toggle .ph-caret-left,
.aluline-fab-container.collapsed #fab-toggle .dashicons-arrow-left-alt2 {
    display: none !important;
}

.aluline-fab-container:not(.collapsed) #fab-toggle .ph-caret-right,
.aluline-fab-container:not(.collapsed) #fab-toggle .dashicons-arrow-right-alt2 {
    display: none !important;
}

/* ==========================================================================
   12. SELECT2 CUSTOMIZATION (DARK & LIGHT READY)
   ========================================================================== */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    background-color: var(--bg-input) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: var(--radius-md) !important;
    min-height: 38px !important;
    color: var(--text-main) !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text-main) !important;
    line-height: 36px !important;
    padding-left: 12px !important;
    font-size: 12.5px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: var(--brand-tint) !important;
    border: 1px solid var(--brand-border) !important;
    color: var(--brand-text) !important;
    border-radius: var(--radius-sm) !important;
    font-size: 11.5px;
    font-weight: 600;
}

.select2-dropdown {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-lg) !important;
    z-index: 999999 !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    background-color: var(--bg-input) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: var(--radius-sm) !important;
    color: var(--text-main) !important;
    font-size: 12px;
}

.select2-container--default .select2-results__option {
    color: var(--text-main) !important;
    font-size: 12px;
    padding: 8px 12px;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: var(--brand-primary) !important;
    color: #ffffff !important;
}

/* ==========================================================================
   13. PRELOADER & RIBBONS
   ========================================================================== */
.aluline-preloader {
    position: fixed;
    inset: 0;
    background: rgba(12, 16, 23, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999999;
}

.aluline-preloader.active {
    display: flex;
}

.aluline-preloader .loader {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(0, 144, 255, 0.2);
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.aluline-ribbon {
    position: fixed;
    top: 74px;
    right: 24px;
    z-index: 10000;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInRibbon 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInRibbon {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.aluline-ribbon.success {
    background: #065f46;
    color: #d1fae5;
    border: 1px solid #059669;
}

.aluline-ribbon.error {
    background: #991b1b;
    color: #fee2e2;
    border: 1px solid #dc2626;
}



/* ==========================================================================
   10. ACTION BUTTONS, TOGGLES, SPECIAL LIVERY & UTILITIES
   ========================================================================== */

/* Switch Toggle */
.aluline-switch { position: relative; display: inline-block; width: 44px; height: 24px; vertical-align: middle; }
.aluline-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--border-subtle, #cbd5e1); transition: .3s; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .3s; box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
input:checked + .slider { background-color: var(--brand-primary, #0090ff); }
input:focus + .slider { box-shadow: 0 0 1px var(--brand-primary, #0090ff); }
input:checked + .slider:before { transform: translateX(20px); }
.slider.round { border-radius: 24px; }
.slider.round:before { border-radius: 50%; }

/* Clean Borderless Action Icons (Edit & Delete) */
.actions-cell {
    white-space: nowrap !important;
}
.actions-cell button,
.actions-cell .edit-btn,
.actions-cell .delete-btn {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 6px !important;
    margin: 0 2px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: var(--radius-sm, 6px) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    line-height: 1 !important;
    vertical-align: middle !important;
    outline: none !important;
    color: var(--text-muted, #64748b) !important;
}
.actions-cell button i.ph,
.actions-cell .edit-btn i.ph,
.actions-cell .delete-btn i.ph {
    font-size: 16px !important;
    line-height: 1 !important;
    display: inline-block !important;
}
.actions-cell .edit-btn:hover,
.actions-cell button.edit-btn:hover {
    background-color: rgba(37, 99, 235, 0.12) !important;
    color: #2563eb !important;
    transform: translateY(-1px) scale(1.08) !important;
}
.actions-cell .delete-btn:hover,
.actions-cell button.delete-btn:hover {
    background-color: rgba(239, 68, 68, 0.12) !important;
    color: #ef4444 !important;
    transform: translateY(-1px) scale(1.08) !important;
}
.actions-cell button:active {
    transform: scale(0.95) !important;
}

/* Modern Column Header Filter Icon */
.aluline-col-filter-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--text-muted, #64748b);
    opacity: 0.65;
    cursor: pointer;
    transition: all 0.2s ease;
    vertical-align: middle;
}
.aluline-col-filter-icon:hover,
.aluline-col-filter-icon.active {
    opacity: 1;
    color: var(--brand-primary, #0090ff);
    background: rgba(0, 144, 255, 0.12);
}

/* Force Select2 z-index to be above the Bulk Action Bar */
.select2-container--open {
    z-index: 99999 !important;
}

/* Special Locomotive Livery Text */
.special-loco-text {
    font-weight: 800;
    white-space: nowrap;
    vertical-align: middle;
    letter-spacing: 0.3px;
    font-family: inherit;
}
.special-loco-text span {
    font-weight: 800;
}

