:root {
    --font-base: 'Manrope', 'Segoe UI', sans-serif;
    --font-display: 'Sora', 'Trebuchet MS', sans-serif;
    --primary-color: #1d4f91; /* Deep Blue */
    --primary-light: #2f6ab6;
    --secondary-color: #f5b921; /* Gold */
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --bg-color: #0b1220;
    --text-primary: #f3f4f6;
    --text-secondary: #cbd5e1;
    --card-bg: rgba(17, 24, 39, 0.82);
    --border-radius: 12px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
}

body {
    background: radial-gradient(circle at top right, #16243d 0%, #0b1220 45%, #060b14 100%);
    font-family: var(--font-base);
    color: var(--text-primary);
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    min-height: 100dvh;
}

#app {
    min-height: 100dvh;
}

body.theme-light {
    --primary-color: #0d2b56;
    --primary-light: #2a4d82;
    --bg-color: #f3f4f6;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --card-bg: rgba(255, 255, 255, 0.9);
    background: radial-gradient(circle at top right, #e8eef7 0%, #f4f6fb 45%, #eef2f9 100%);
    color: var(--text-primary);
}

body.theme-light .card {
    border: 1px solid rgba(15, 23, 42, 0.1);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

body.theme-light .card-header {
    color: #0f172a;
    background-color: rgba(255, 255, 255, 0.72);
    border-bottom: 1px solid rgba(15, 23, 42, 0.12);
}

body.theme-light .form-control,
body.theme-light .form-select {
    background: rgba(255, 255, 255, 0.95);
    color: #1f2937;
    border: 1px solid rgba(15, 23, 42, 0.16);
}

body.theme-light .form-control::placeholder {
    color: #6b7280;
}

body.theme-light .table thead th {
    background-color: #f1f5f9;
    color: #334155;
    border-bottom: 1px solid #dbe3ef;
}

body.theme-light .table td {
    color: #1f2937;
    border-bottom: 1px solid #e2e8f0;
}

body.theme-light .table-hover tbody tr:hover {
    background-color: rgba(13, 43, 86, 0.06);
}

body.theme-light .text-muted {
    color: #64748b !important;
}

body.theme-light .text-secondary {
    color: #475569 !important;
}

body.theme-light .small {
    color: #475569 !important;
}

body.theme-dark .form-text,
body:not(.theme-light) .form-text {
    color: #94a3b8 !important;
}

body.theme-light .form-text {
    color: #64748b !important;
}

body.theme-light .bg-light {
    background-color: #f8fafc !important;
    color: #1f2937 !important;
}

body.theme-light .alert-light {
    background-color: #f8fafc;
    border-color: #e2e8f0;
    color: #334155;
}

body.theme-light .card-header .text-muted,
body.theme-light .card-body .text-muted,
body.theme-light .table .text-muted {
    color: #64748b !important;
}

body.theme-light .btn-outline-info {
    border: 1px solid #0ea5e9;
    color: #0369a1;
    background: rgba(14, 165, 233, 0.08);
}

body.theme-light .btn-outline-info:hover {
    background: rgba(14, 165, 233, 0.18);
    color: #075985;
    border-color: #0284c7;
}

.profile-field-missing {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.2) !important;
    animation: profileFieldPulse 0.7s ease-in-out 2;
}

@keyframes profileFieldPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.35);
    }
    100% {
        box-shadow: 0 0 0 0.45rem rgba(220, 53, 69, 0);
    }
}

/* Theme-aware dropdown menus */
body.theme-dark .dropdown-menu,
body:not(.theme-light) .dropdown-menu {
    background-color: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.28);
    box-shadow: 0 12px 26px rgba(2, 6, 23, 0.45);
}

body.theme-dark .dropdown-item,
body:not(.theme-light) .dropdown-item {
    color: #e2e8f0;
}

body.theme-dark .dropdown-item:hover,
body:not(.theme-light) .dropdown-item:hover {
    background-color: rgba(59, 130, 246, 0.2);
    color: #ffffff;
}

body.theme-dark .dropdown-divider,
body:not(.theme-light) .dropdown-divider {
    border-top-color: rgba(148, 163, 184, 0.25);
}

body.theme-light .dropdown-menu {
    background-color: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(15, 23, 42, 0.12);
}

body.theme-light .dropdown-item {
    color: #1f2937;
}

body.theme-light .dropdown-item:hover {
    background-color: rgba(13, 43, 86, 0.08);
    color: #0f172a;
}

/* Theme-aware native select option lists */
body.theme-dark .form-select option,
body:not(.theme-light) .form-select option {
    background-color: #0f172a;
    color: #e5e7eb;
}

body.theme-light .form-select option {
    background-color: #ffffff;
    color: #1f2937;
}

/* Navbar */
.navbar {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light)) !important;
    box-shadow: var(--shadow-md);
    padding: 0.8rem 1rem;
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: -0.5px;
    font-size: 1.5rem;
}

.app-navbar-brand {
    transition: var(--transition);
}

.app-navbar-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    background-color: transparent !important;
    transition: var(--transition);
}

.app-navbar-title {
    display: inline-block;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-navbar-username {
    color: rgba(255, 255, 255, 0.92) !important;
}

body.theme-light .app-navbar-username {
    color: #f8fafc !important;
}

.app-navbar-brand:hover {
    transform: translateY(-1px);
}

.app-navbar-brand:hover .app-navbar-logo {
    transform: scale(1.06);
}

@media (max-width: 576px) {
    .app-navbar-title {
        max-width: 170px;
    }
}

.navbar .nav-link {
    font-weight: 500;
    opacity: 0.9;
    transition: var(--transition);
}

.navbar .nav-link:hover, .navbar .nav-link.active {
    opacity: 1;
    color: var(--secondary-color) !important;
    transform: translateY(-1px);
}

body.theme-dark .navbar .nav-link.active,
body:not(.theme-light) .navbar .nav-link.active {
    color: #f5b921 !important;
}

.navbar .btn {
    border-width: 1px;
    font-weight: 600;
    min-height: 34px;
    box-shadow: none;
}

.navbar .btn.btn-sm {
    padding: 0.35rem 0.8rem;
}

.navbar .btn-outline-info,
.navbar .btn-outline-warning,
.navbar .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.58);
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
}

.navbar .btn-outline-info:hover,
.navbar .btn-outline-warning:hover,
.navbar .btn-outline-light:hover {
    border-color: rgba(255, 255, 255, 0.82);
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.navbar .btn-outline-info:focus,
.navbar .btn-outline-warning:focus,
.navbar .btn-outline-light:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.22);
}

.navbar .bi {
    color: #e2e8f0;
    transition: var(--transition);
}

.navbar .bi-moon-stars,
.navbar .bi-sun {
    color: #fbbf24;
}

.navbar .bi-key {
    color: #a78bfa;
}

.navbar .bi-box-arrow-right {
    color: #f87171;
}

.navbar .bi-person-circle,
.navbar .bi-chevron-down,
.navbar .bi-list {
    color: #7dd3fc;
}

.navbar .btn:hover .bi,
.navbar .btn:focus .bi,
.navbar .dropdown-item:hover .bi {
    filter: brightness(1.15);
}

/* Auth Glass View */
.auth-glass-bg {
    width: 100%;
    min-height: 100dvh;
    background-image:
        linear-gradient(rgba(8, 24, 48, 0.46), rgba(8, 24, 48, 0.46)),
        url('../img/colombo-port.jpg');
    background-color: #0b1220;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: scroll;
}

body.theme-dark .auth-glass-bg,
body:not(.theme-light) .auth-glass-bg {
    background-image:
    linear-gradient(rgba(2, 6, 23, 0.52), rgba(2, 6, 23, 0.52)),
        url('../img/colombo-port.jpg');
}

.welcome-glow-bg {
    position: relative;
    overflow: visible;
    isolation: auto;
}

@media (prefers-reduced-motion: reduce) {
    .welcome-glow-bg::before {
        animation: none;
    }
}

.auth-theme-toggle {
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    right: 14px;
    z-index: 1200;
    border-width: 1px;
    font-weight: 600;
    min-height: 34px;
    padding: 0.35rem 0.8rem;
    box-shadow: 0 8px 22px rgba(2, 6, 23, 0.35);
    border-color: rgba(255, 255, 255, 0.75) !important;
    background: rgba(15, 23, 42, 0.72) !important;
    color: #f8fafc !important;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.auth-theme-toggle:hover {
    border-color: rgba(255, 255, 255, 0.92) !important;
    background: rgba(15, 23, 42, 0.86) !important;
    color: #ffffff !important;
}

.auth-theme-toggle:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.22) !important;
}

body.theme-light .auth-theme-toggle {
    border-color: #0369a1 !important;
    color: #0f172a !important;
    background: rgba(255, 255, 255, 0.9) !important;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.16);
}

body.theme-light .auth-theme-toggle:hover {
    border-color: #075985 !important;
    color: #0b3b61 !important;
    background: rgba(240, 249, 255, 0.96) !important;
}

@media (max-width: 575px) {
    .auth-theme-toggle {
        top: max(10px, env(safe-area-inset-top));
        right: 10px;
        min-height: 32px;
        padding: 0.3rem 0.7rem;
    }
}

body.theme-light .auth-theme-toggle:focus {
    box-shadow: 0 0 0 0.2rem rgba(14, 165, 233, 0.22) !important;
}

.auth-glass-card {
    width: 100%;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.38);
    background: rgba(15, 23, 42, 0.84);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 18px 45px rgba(2, 6, 23, 0.55);
}

.card.auth-glass-card {
    background: rgba(15, 23, 42, 0.92) !important;
    border: 1px solid rgba(148, 163, 184, 0.4) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    box-shadow: 0 18px 42px rgba(2, 6, 23, 0.56) !important;
}

.auth-glass-card .card-header,
.auth-glass-card .card-footer {
    background: transparent;
}

.auth-glass-card .card-title,
.auth-glass-card h4,
.auth-glass-card h2,
.auth-glass-card h5 {
    color: #e2e8f0 !important;
}

.auth-glass-card .text-muted,
.auth-glass-card .text-secondary,
.auth-glass-card .small {
    color: #cbd5e1 !important;
}

.auth-glass-card .form-label {
    color: #e2e8f0;
}

.auth-glass-card .form-control,
.auth-glass-card .form-select {
    background: rgba(15, 23, 42, 0.72);
    border-color: rgba(148, 163, 184, 0.34);
    color: #f8fafc;
}

.auth-form-card .form-control,
.auth-form-card .form-select {
    background: rgba(15, 23, 42, 0.36);
    border: 1px solid rgba(148, 163, 184, 0.5);
    color: #f8fafc;
    backdrop-filter: blur(10px) saturate(130%);
    -webkit-backdrop-filter: blur(10px) saturate(130%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.auth-form-card .form-control::placeholder {
    color: rgba(203, 213, 225, 0.88);
}

.auth-form-card .form-control:focus,
.auth-form-card .form-select:focus {
    border-color: rgba(125, 211, 252, 0.95);
    background: rgba(15, 23, 42, 0.5);
    color: #ffffff;
    box-shadow: 0 0 0 0.2rem rgba(56, 189, 248, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.auth-glass-card .card-body,
.auth-glass-card .card-header,
.auth-glass-card .card-footer,
.auth-glass-card p,
.auth-glass-card span,
.auth-glass-card label {
    color: #e2e8f0;
}

.auth-glass-card .form-control::placeholder {
    color: #94a3b8;
}

.auth-glass-card a {
    color: #93c5fd !important;
}

.auth-glass-card a:hover {
    color: #bfdbfe !important;
}

body.theme-light .auth-glass-card {
    border: 1px solid rgba(255, 255, 255, 0.65);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.30);
}

body.theme-light .card.auth-glass-card {
    background: rgba(255, 255, 255, 0.94) !important;
    border: 1px solid rgba(255, 255, 255, 0.78) !important;
    box-shadow: 0 18px 42px rgba(2, 6, 23, 0.35) !important;
}

body.theme-light .auth-glass-card .card-title,
body.theme-light .auth-glass-card h4,
body.theme-light .auth-glass-card h2,
body.theme-light .auth-glass-card h5 {
    color: #0d2b56 !important;
}

body.theme-light .auth-glass-card .text-muted,
body.theme-light .auth-glass-card .text-secondary,
body.theme-light .auth-glass-card .small {
    color: #4b5563 !important;
}

body.theme-light .auth-glass-card .form-label {
    color: #1f2937;
}

body.theme-light .auth-glass-card .form-control,
body.theme-light .auth-glass-card .form-select {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(13, 43, 86, 0.18);
    color: #0f172a;
}

body.theme-light .auth-form-card .form-control,
body.theme-light .auth-form-card .form-select {
    background: rgba(255, 255, 255, 0.42);
    border: 1px solid rgba(15, 23, 42, 0.24);
    color: #0f172a;
    backdrop-filter: blur(10px) saturate(130%);
    -webkit-backdrop-filter: blur(10px) saturate(130%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

body.theme-light .auth-form-card .form-control::placeholder {
    color: rgba(71, 85, 105, 0.92);
}

body.theme-light .auth-form-card .form-control:focus,
body.theme-light .auth-form-card .form-select:focus {
    border-color: rgba(14, 116, 144, 0.72);
    background: rgba(255, 255, 255, 0.56);
    box-shadow: 0 0 0 0.2rem rgba(14, 165, 233, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

body.theme-light .auth-glass-card .card-body,
body.theme-light .auth-glass-card .card-header,
body.theme-light .auth-glass-card .card-footer,
body.theme-light .auth-glass-card p,
body.theme-light .auth-glass-card span,
body.theme-light .auth-glass-card label {
    color: #1f2937;
}

body.theme-light .auth-glass-card .form-control::placeholder {
    color: #6b7280;
}

body.theme-light .auth-glass-card a {
    color: #1d4ed8 !important;
}

body.theme-light .auth-glass-card a:hover {
    color: #1e40af !important;
}

.auth-glass-card .btn-outline-primary {
    border: 1px solid #1d4ed8;
    color: #1e3a8a;
    background: rgba(29, 78, 216, 0.08);
}

.auth-glass-card .btn-outline-primary:hover {
    border-color: #1e40af;
    background: rgba(29, 78, 216, 0.18);
    color: #1e3a8a;
}

.auth-glass-card .btn-outline-secondary {
    border: 1px solid rgba(148, 163, 184, 0.78);
    color: #e2e8f0;
    background: rgba(148, 163, 184, 0.14);
}

.auth-glass-card .btn-outline-secondary:hover {
    border-color: rgba(226, 232, 240, 0.92);
    background: rgba(148, 163, 184, 0.28);
    color: #ffffff;
}

body.theme-light .auth-glass-card .btn-outline-secondary {
    border: 1px solid #64748b;
    color: #334155;
    background: rgba(100, 116, 139, 0.1);
}

body.theme-light .auth-glass-card .btn-outline-secondary:hover {
    border-color: #475569;
    background: rgba(100, 116, 139, 0.2);
    color: #1f2937;
}

.auth-glass-logo {
    width: 90px;
    height: auto;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.28));
}

.welcome-info-panel {
    background: rgba(15, 23, 42, 0.42);
    border-color: rgba(148, 163, 184, 0.35) !important;
}

.welcome-info-panel ul li {
    margin-bottom: 0.2rem;
}

/* Home page enhancements */
.home-shell {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.home-card {
    width: min(1120px, 96vw);
    border-radius: 24px;
    border: 1px solid rgba(148, 163, 184, 0.5) !important;
    background: linear-gradient(155deg, rgba(15, 23, 42, 0.5), rgba(15, 23, 42, 0.34)) !important;
    backdrop-filter: blur(18px) saturate(130%);
    -webkit-backdrop-filter: blur(18px) saturate(130%);
    box-shadow: 0 24px 56px rgba(2, 6, 23, 0.52), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.card.auth-glass-card.home-card {
    border: 1px solid rgba(148, 163, 184, 0.42) !important;
    background: linear-gradient(155deg, rgba(15, 23, 42, 0.34), rgba(15, 23, 42, 0.2)) !important;
    backdrop-filter: blur(24px) saturate(145%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(145%) !important;
    box-shadow: 0 20px 52px rgba(2, 6, 23, 0.44), inset 0 1px 0 rgba(255, 255, 255, 0.14) !important;
}

.card.auth-glass-card.auth-form-card {
    border: 1px solid rgba(148, 163, 184, 0.42) !important;
    background: linear-gradient(155deg, rgba(15, 23, 42, 0.34), rgba(15, 23, 42, 0.2)) !important;
    backdrop-filter: blur(24px) saturate(145%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(145%) !important;
    box-shadow: 0 20px 48px rgba(2, 6, 23, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
}

.home-grid {
    position: relative;
}

.home-chip {
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(14, 116, 144, 0.16);
    color: #dbeafe;
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.home-main-logo {
    width: 82px;
}

.home-title {
    font-family: var(--font-display);
    font-size: clamp(1.45rem, 1.2rem + 1.4vw, 2.25rem);
    letter-spacing: 0.02em;
    line-height: 1.1;
    color: #f8fafc;
}

.home-subtitle {
    color: #bfdbfe;
    font-size: 0.96rem;
    font-weight: 600;
}

.home-lead {
    font-size: 1.02rem;
    max-width: 52ch;
}

.home-cta-wrap .home-cta {
    min-width: 190px;
}

.home-kpi-row {
    animation: fadeRiseIn 0.7s ease both;
}

.home-kpi-box {
    height: 100%;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 14px;
    padding: 0.75rem 0.85rem;
    background: rgba(2, 6, 23, 0.28);
}

.home-kpi-value {
    font-size: 1.05rem;
    font-weight: 800;
    color: #facc15;
}

.home-kpi-label {
    font-size: 0.78rem;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.home-info-panel {
    border-radius: 16px;
    background:
        linear-gradient(170deg, rgba(15, 23, 42, 0.36), rgba(15, 23, 42, 0.22)),
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.16) 0%, transparent 44%);
    backdrop-filter: blur(16px) saturate(130%);
    -webkit-backdrop-filter: blur(16px) saturate(130%);
    border: 1px solid rgba(148, 163, 184, 0.34) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.home-panel-title {
    letter-spacing: 0.08em;
    font-size: 0.75rem;
}

.home-download-btn {
    justify-content: flex-start;
}

.home-support-line {
    border-top: 1px dashed rgba(148, 163, 184, 0.45);
    border-bottom: 1px dashed rgba(148, 163, 184, 0.45);
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
}

.home-rule-list li {
    margin-bottom: 0.32rem;
    line-height: 1.4;
}

.home-card-theme-toggle {
    border: 1px solid rgba(148, 163, 184, 0.58);
    background: rgba(15, 23, 42, 0.62);
    color: #e2e8f0;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 8px 18px rgba(2, 6, 23, 0.28);
    width: 42px;
    height: 42px;
    min-width: 42px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.home-card-theme-toggle:hover {
    border-color: rgba(255, 255, 255, 0.82);
    background: rgba(15, 23, 42, 0.82);
    color: #ffffff;
}

body.theme-light .home-card-theme-toggle {
    border-color: rgba(15, 23, 42, 0.28);
    background: rgba(255, 255, 255, 0.9);
    color: #0f172a;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.12);
}

body.theme-light .home-card-theme-toggle:hover {
    border-color: rgba(15, 23, 42, 0.46);
    background: rgba(248, 250, 252, 0.96);
    color: #020617;
}

.home-card-theme-toggle i {
    font-size: 1.05rem;
    line-height: 1;
}

@keyframes fadeRiseIn {
    from {
        opacity: 0;
        transform: translateY(9px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body.theme-light .welcome-info-panel {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(15, 23, 42, 0.16) !important;
}

body.theme-light .home-chip {
    border-color: rgba(2, 132, 199, 0.4);
    background: rgba(14, 165, 233, 0.12);
    color: #0c4a6e;
}

body.theme-light .home-title {
    color: #0f172a;
}

body.theme-light .home-subtitle {
    color: #1d4ed8;
}

body.theme-light .home-kpi-box {
    border-color: rgba(15, 23, 42, 0.14);
    background: rgba(255, 255, 255, 0.88);
}

body.theme-light .home-kpi-value {
    color: #b45309;
}

body.theme-light .home-kpi-label {
    color: #475569;
}

body.theme-light .home-info-panel {
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.45), rgba(241, 245, 249, 0.38)),
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.16) 0%, transparent 44%);
    border: 1px solid rgba(15, 23, 42, 0.14) !important;
}

body.theme-light .home-card {
    background: linear-gradient(155deg, rgba(255, 255, 255, 0.4), rgba(248, 250, 252, 0.34)) !important;
    border: 1px solid rgba(255, 255, 255, 0.76) !important;
    box-shadow: 0 20px 44px rgba(15, 23, 42, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

body.theme-light .card.auth-glass-card.home-card {
    background: linear-gradient(155deg, rgba(255, 255, 255, 0.4), rgba(248, 250, 252, 0.34)) !important;
    border: 1px solid rgba(255, 255, 255, 0.82) !important;
    backdrop-filter: blur(24px) saturate(145%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(145%) !important;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}

body.theme-light .card.auth-glass-card.auth-form-card {
    background: linear-gradient(155deg, rgba(255, 255, 255, 0.4), rgba(248, 250, 252, 0.34)) !important;
    border: 1px solid rgba(255, 255, 255, 0.82) !important;
    backdrop-filter: blur(24px) saturate(145%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(145%) !important;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.88) !important;
}

body.theme-light .home-panel-title {
    color: #0f172a;
}

body.theme-light .home-support-line {
    border-top-color: rgba(15, 23, 42, 0.24);
    border-bottom-color: rgba(15, 23, 42, 0.24);
}

@media (min-width: 992px) {
    .home-card {
        width: min(1160px, 95vw);
    }

    .home-card .card-body {
        padding: 2rem 2.2rem !important;
    }

    .home-grid {
        --bs-gutter-x: 2rem;
    }

    .home-left-col {
        padding-right: 0.65rem;
        padding-top: 0.4rem;
    }

    .home-right-col {
        padding-left: 0.65rem;
    }

    .home-lead {
        max-width: 46ch;
    }

    .home-chip {
        margin-bottom: 0.85rem !important;
    }

    .home-info-panel {
        min-height: 100%;
        justify-content: space-between !important;
    }

    .home-rule-list li {
        margin-bottom: 0.44rem;
    }
}

@media (max-width: 991px) {
    .home-card {
        width: min(920px, 97vw);
    }

    .home-main-logo {
        width: 74px;
    }
}

@media (max-width: 767px) {
    .home-shell {
        min-height: 100dvh;
        align-items: flex-start !important;
        padding-top: 1.1rem !important;
        padding-bottom: 1.1rem !important;
    }

    .home-card {
        border-radius: 18px;
    }

    .home-card .card-body {
        padding: 1.05rem !important;
    }

    .home-main-logo {
        width: 64px;
    }

    .home-title {
        font-size: clamp(1.35rem, 1.05rem + 1.2vw, 1.75rem);
    }

    .home-subtitle {
        font-size: 0.9rem;
    }

    .home-lead {
        font-size: 0.95rem;
        line-height: 1.5;
        margin-bottom: 0.9rem !important;
    }

    .home-cta-wrap .home-cta {
        min-width: 100%;
        min-height: 44px;
    }

    .home-kpi-row {
        margin-top: 0.65rem !important;
    }

    .home-kpi-box {
        padding: 0.62rem 0.68rem;
    }

    .home-info-panel {
        padding: 0.9rem !important;
    }

    .home-rule-list li {
        margin-bottom: 0.26rem;
        line-height: 1.34;
    }

    .home-card-theme-toggle {
        width: 42px;
        min-height: 40px;
    }
}

@media (max-width: 575px) {
    .home-title {
        font-size: 1.32rem;
        line-height: 1.15;
    }

    .home-subtitle {
        font-size: 0.85rem;
    }

    .home-main-logo {
        width: 56px;
    }

    .home-chip {
        font-size: 0.7rem;
        padding: 0.3rem 0.62rem;
    }

    .home-panel-title {
        font-size: 0.7rem;
    }

    .home-download-btn {
        min-height: 38px;
        font-size: 0.82rem;
    }

    .home-support-line {
        font-size: 0.8rem;
        padding-top: 0.45rem;
        padding-bottom: 0.45rem;
    }

    .home-kpi-value {
        font-size: 0.96rem;
    }

    .home-kpi-label {
        font-size: 0.71rem;
        letter-spacing: 0.04em;
    }
}

@media (max-width: 400px) {
    .home-shell {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    .home-card {
        border-radius: 14px;
    }

    .home-title {
        font-size: 1.22rem;
    }

    .home-main-logo {
        width: 50px;
    }
}

.rules-preview-panel {
    background: rgba(15, 23, 42, 0.46);
    border-color: rgba(148, 163, 184, 0.35) !important;
}

.rules-preview-panel h6,
.rules-preview-panel li {
    color: #e2e8f0;
}

.rules-preview-panel ul {
    padding-left: 1.1rem;
}

.rules-preview-panel li {
    line-height: 1.45;
}

body.theme-light .rules-preview-panel {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(15, 23, 42, 0.14) !important;
}

body.theme-light .rules-preview-panel h6,
body.theme-light .rules-preview-panel li {
    color: #0f172a;
}

.guideline-file-input {
    min-width: 220px;
}

body.theme-dark .guideline-file-input,
body:not(.theme-light) .guideline-file-input {
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.45);
    background: rgba(15, 23, 42, 0.78);
}

body.theme-dark .guideline-file-input::file-selector-button,
body:not(.theme-light) .guideline-file-input::file-selector-button {
    margin-right: 0.7rem;
    border: 1px solid rgba(96, 165, 250, 0.6);
    border-radius: 8px;
    padding: 0.32rem 0.72rem;
    color: #dbeafe;
    background: rgba(59, 130, 246, 0.18);
    cursor: pointer;
}

body.theme-light .guideline-file-input {
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.2);
    background: #ffffff;
}

body.theme-light .guideline-file-input::file-selector-button {
    margin-right: 0.7rem;
    border: 1px solid rgba(37, 99, 235, 0.45);
    border-radius: 8px;
    padding: 0.32rem 0.72rem;
    color: #1e3a8a;
    background: rgba(59, 130, 246, 0.12);
    cursor: pointer;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    background-color: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: var(--transition);
    overflow: hidden;
    position: relative;
    will-change: transform, box-shadow;
    animation: card-enter 0.45s ease-out both;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px) scale(1.01);
}

.card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.12) 40%, transparent 80%);
}

.card:hover::before {
    opacity: 1;
}

.card-header {
    background-color: rgba(255, 255, 255, 0.09);
    border-bottom: 1px solid rgba(255,255,255,0.18);
    padding: 1rem 1.25rem;
    font-weight: 700;
    color: #dbeafe;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: 1.25rem;
}

.card-header.bg-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light)) !important;
    border-bottom: none;
}
.card-header.bg-info {
    background: linear-gradient(135deg, var(--info-color), #60a5fa) !important;
    border-bottom: none;
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 0.4rem 1rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: var(--transition);
    border: none;
    box-shadow: var(--shadow-sm);
    font-size: 0.9rem;
    color: #f8fafc;
    position: relative;
    overflow: hidden;
    will-change: transform, box-shadow;
}

.btn:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: var(--shadow-sm);
}

.btn::after {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.26), transparent);
    transition: left 0.45s ease;
}

.btn:hover::after {
    left: 140%;
}

@keyframes card-enter {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .card,
    .btn {
        animation: none !important;
        transition: none !important;
    }

    .card:hover,
    .btn:hover,
    .btn:active {
        transform: none !important;
    }

    .btn::after,
    .card::before {
        display: none;
    }
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: #ffffff;
}

.btn-success {
    background: linear-gradient(135deg, #22a06b, #6ee7b7);
    color: #ffffff;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #f87171);
    color: #ffffff;
}

.btn-secondary {
    background: linear-gradient(135deg, #64748b, #94a3b8);
    color: #ffffff;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color), #fbbf24);
    color: #111827;
}
.btn-warning:hover {
    color: #111827;
}

.btn-outline-primary {
    border: 1px solid #60a5fa;
    color: #bfdbfe;
    background: rgba(96, 165, 250, 0.08);
}
.btn-outline-primary:hover {
    background: rgba(96, 165, 250, 0.25);
    color: #ffffff;
}

.btn-outline-warning {
    border: 1px solid #fbbf24;
    color: #fde68a;
    background: rgba(251, 191, 36, 0.08);
}
.btn-outline-warning:hover {
    background: rgba(251, 191, 36, 0.24);
    color: #fff8e1;
}

.btn-outline-danger {
    border: 1px solid #f87171;
    color: #fecaca;
    background: rgba(248, 113, 113, 0.08);
}
.btn-outline-danger:hover {
    background: rgba(248, 113, 113, 0.24);
    color: #fff;
}

.btn-outline-success {
    border: 1px solid #6ee7b7;
    color: #d1fae5;
    background: rgba(110, 231, 183, 0.12);
}

.btn-outline-success:hover {
    background: rgba(110, 231, 183, 0.28);
    color: #f0fdf4;
}

.btn-outline-secondary {
    border: 1px solid #94a3b8;
    color: #e2e8f0;
    background: rgba(148, 163, 184, 0.12);
}

.btn-outline-secondary:hover {
    background: rgba(148, 163, 184, 0.26);
    color: #ffffff;
}

.btn-outline-info {
    border: 1px solid #60a5fa;
    color: #bae6fd;
    background: rgba(59, 130, 246, 0.08);
}
.btn-outline-info:hover {
    background: rgba(59, 130, 246, 0.24);
    color: #fff;
}

.btn-outline-light {
    border: 1px solid rgba(255, 255, 255, 0.55);
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.06);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

body.theme-dark .btn:disabled,
body:not(.theme-light) .btn:disabled {
    opacity: 0.55;
    filter: saturate(0.75);
}

body.theme-light .btn-outline-secondary {
    border-color: #94a3b8;
    color: #334155;
    background: rgba(148, 163, 184, 0.12);
}

body.theme-light .btn-outline-secondary:hover {
    border-color: #64748b;
    color: #0f172a;
    background: rgba(148, 163, 184, 0.24);
}

body.theme-light .btn-outline-success {
    border-color: #34d399;
    color: #065f46;
    background: rgba(52, 211, 153, 0.14);
}

body.theme-light .btn-outline-success:hover {
    border-color: #10b981;
    color: #064e3b;
    background: rgba(52, 211, 153, 0.24);
}

body.theme-light .btn-outline-danger {
    border-color: #ef4444;
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.12);
}

body.theme-light .btn-outline-danger:hover {
    border-color: #dc2626;
    color: #7f1d1d;
    background: rgba(239, 68, 68, 0.24);
}

/* Forms */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #f9fafb;
    padding: 0.625rem 0.875rem;
    transition: var(--transition);
}

.form-control::placeholder {
    color: #cbd5e1;
}

/* Browser autofill theme compatibility */
body.theme-dark .form-control:-webkit-autofill,
body.theme-dark .form-control:-webkit-autofill:hover,
body.theme-dark .form-control:-webkit-autofill:focus,
body.theme-dark .form-control:-webkit-autofill:active,
body.theme-dark .form-select:-webkit-autofill,
body.theme-dark .form-select:-webkit-autofill:hover,
body.theme-dark .form-select:-webkit-autofill:focus,
body.theme-dark .form-select:-webkit-autofill:active,
body:not(.theme-light) .form-control:-webkit-autofill,
body:not(.theme-light) .form-control:-webkit-autofill:hover,
body:not(.theme-light) .form-control:-webkit-autofill:focus,
body:not(.theme-light) .form-control:-webkit-autofill:active,
body:not(.theme-light) .form-select:-webkit-autofill,
body:not(.theme-light) .form-select:-webkit-autofill:hover,
body:not(.theme-light) .form-select:-webkit-autofill:focus,
body:not(.theme-light) .form-select:-webkit-autofill:active,
body.theme-dark .form-control:autofill,
body.theme-dark .form-select:autofill,
body:not(.theme-light) .form-control:autofill,
body:not(.theme-light) .form-select:autofill {
    -webkit-text-fill-color: #f8fafc !important;
    caret-color: #f8fafc;
    -webkit-box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.08) inset;
    box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.08) inset;
    transition: background-color 5000s ease-in-out 0s;
}

body.theme-light .form-control:-webkit-autofill,
body.theme-light .form-control:-webkit-autofill:hover,
body.theme-light .form-control:-webkit-autofill:focus,
body.theme-light .form-control:-webkit-autofill:active,
body.theme-light .form-select:-webkit-autofill,
body.theme-light .form-select:-webkit-autofill:hover,
body.theme-light .form-select:-webkit-autofill:focus,
body.theme-light .form-select:-webkit-autofill:active,
body.theme-light .form-control:autofill,
body.theme-light .form-select:autofill {
    -webkit-text-fill-color: #1f2937 !important;
    caret-color: #1f2937;
    -webkit-box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.95) inset;
    box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.95) inset;
}

body.theme-dark .auth-glass-card .form-control:-webkit-autofill,
body.theme-dark .auth-glass-card .form-control:-webkit-autofill:hover,
body.theme-dark .auth-glass-card .form-control:-webkit-autofill:focus,
body.theme-dark .auth-glass-card .form-control:-webkit-autofill:active,
body:not(.theme-light) .auth-glass-card .form-control:-webkit-autofill,
body:not(.theme-light) .auth-glass-card .form-control:-webkit-autofill:hover,
body:not(.theme-light) .auth-glass-card .form-control:-webkit-autofill:focus,
body:not(.theme-light) .auth-glass-card .form-control:-webkit-autofill:active,
body.theme-dark .auth-glass-card .form-control:autofill,
body:not(.theme-light) .auth-glass-card .form-control:autofill {
    -webkit-text-fill-color: #f8fafc !important;
    caret-color: #f8fafc;
    -webkit-box-shadow: 0 0 0 1000px rgba(15, 23, 42, 0.72) inset;
    box-shadow: 0 0 0 1000px rgba(15, 23, 42, 0.72) inset;
    border: 1px solid rgba(148, 163, 184, 0.34);
}

body.theme-light .auth-glass-card .form-control:-webkit-autofill,
body.theme-light .auth-glass-card .form-control:-webkit-autofill:hover,
body.theme-light .auth-glass-card .form-control:-webkit-autofill:focus,
body.theme-light .auth-glass-card .form-control:-webkit-autofill:active,
body.theme-light .auth-glass-card .form-control:autofill {
    -webkit-text-fill-color: #0f172a !important;
    caret-color: #0f172a;
    -webkit-box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.98) inset;
    box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.98) inset;
}

body.theme-dark input.form-control,
body.theme-dark textarea.form-control,
body.theme-dark select.form-select,
body:not(.theme-light) input.form-control,
body:not(.theme-light) textarea.form-control,
body:not(.theme-light) select.form-select {
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc;
}

body.theme-dark input.form-control:focus,
body.theme-dark textarea.form-control:focus,
body.theme-dark select.form-select:focus,
body:not(.theme-light) input.form-control:focus,
body:not(.theme-light) textarea.form-control:focus,
body:not(.theme-light) select.form-select:focus {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff;
}

.form-control:focus, .form-select:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.18);
    background: rgba(255, 255, 255, 0.14);
}

/* Flatpickr readability in dark mode */
body.theme-dark .form-control.bg-white,
body.theme-dark .form-select.bg-white,
body:not(.theme-light) .form-control.bg-white,
body:not(.theme-light) .form-select.bg-white {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #f8fafc !important;
    border-color: rgba(255, 255, 255, 0.28) !important;
}

body.theme-dark .flatpickr-calendar,
body:not(.theme-light) .flatpickr-calendar {
    background: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 12px 28px rgba(2, 6, 23, 0.55);
}

body.theme-dark .flatpickr-months .flatpickr-month,
body:not(.theme-light) .flatpickr-months .flatpickr-month,
body.theme-dark .flatpickr-current-month .flatpickr-monthDropdown-months,
body:not(.theme-light) .flatpickr-current-month .flatpickr-monthDropdown-months,
body.theme-dark .flatpickr-current-month input.cur-year,
body:not(.theme-light) .flatpickr-current-month input.cur-year,
body.theme-dark span.flatpickr-weekday,
body:not(.theme-light) span.flatpickr-weekday,
body.theme-dark .flatpickr-weekdays,
body:not(.theme-light) .flatpickr-weekdays {
    background: #0f172a;
    color: #e2e8f0;
    fill: #e2e8f0;
}

body.theme-dark .flatpickr-day,
body:not(.theme-light) .flatpickr-day {
    color: #e5e7eb;
}

body.theme-dark .flatpickr-day.prevMonthDay,
body.theme-dark .flatpickr-day.nextMonthDay,
body:not(.theme-light) .flatpickr-day.prevMonthDay,
body:not(.theme-light) .flatpickr-day.nextMonthDay {
    color: #94a3b8;
}

body.theme-dark .flatpickr-day:hover,
body:not(.theme-light) .flatpickr-day:hover {
    background: rgba(59, 130, 246, 0.28);
    border-color: rgba(59, 130, 246, 0.5);
}

body.theme-dark .flatpickr-day.selected,
body.theme-dark .flatpickr-day.startRange,
body.theme-dark .flatpickr-day.endRange,
body:not(.theme-light) .flatpickr-day.selected,
body:not(.theme-light) .flatpickr-day.startRange,
body:not(.theme-light) .flatpickr-day.endRange {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
}

body.theme-dark .flatpickr-day.today,
body:not(.theme-light) .flatpickr-day.today {
    border-color: #93c5fd;
}

body.theme-dark .flatpickr-prev-month,
body.theme-dark .flatpickr-next-month,
body:not(.theme-light) .flatpickr-prev-month,
body:not(.theme-light) .flatpickr-next-month {
    color: #e2e8f0;
    fill: #e2e8f0;
    border-radius: 8px;
}

body.theme-dark .flatpickr-prev-month:hover,
body.theme-dark .flatpickr-next-month:hover,
body:not(.theme-light) .flatpickr-prev-month:hover,
body:not(.theme-light) .flatpickr-next-month:hover {
    background: rgba(59, 130, 246, 0.2);
}

body.theme-dark .flatpickr-prev-month svg,
body.theme-dark .flatpickr-next-month svg,
body:not(.theme-light) .flatpickr-prev-month svg,
body:not(.theme-light) .flatpickr-next-month svg {
    fill: #e2e8f0;
}

body.theme-dark .flatpickr-prev-month:hover svg,
body.theme-dark .flatpickr-next-month:hover svg,
body:not(.theme-light) .flatpickr-prev-month:hover svg,
body:not(.theme-light) .flatpickr-next-month:hover svg {
    fill: #ffffff;
}

body.theme-dark .reports-view .border.rounded.p-2,
body:not(.theme-light) .reports-view .border.rounded.p-2 {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(148, 163, 184, 0.35) !important;
    color: #f8fafc;
}

body.theme-dark .reports-view .border.rounded.p-2 .text-muted,
body:not(.theme-light) .reports-view .border.rounded.p-2 .text-muted {
    color: #cbd5e1 !important;
}

body.theme-dark .reports-view .border.rounded.p-2 strong,
body:not(.theme-light) .reports-view .border.rounded.p-2 strong {
    color: #ffffff;
}

body.theme-dark .reports-view .card-header.bg-light,
body:not(.theme-light) .reports-view .card-header.bg-light {
    background-color: rgba(15, 23, 42, 0.78) !important;
    color: #e2e8f0 !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.28) !important;
}

body.theme-dark .reports-view h6,
body.theme-dark .reports-view .form-label,
body:not(.theme-light) .reports-view h6,
body:not(.theme-light) .reports-view .form-label {
    color: #e2e8f0 !important;
}

body.theme-dark .reports-view .badge.bg-info.text-dark,
body:not(.theme-light) .reports-view .badge.bg-info.text-dark {
    color: #e6f6ff !important;
}

.form-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* Badges */
.badge {
    padding: 0.5em 0.8em;
    border-radius: 6px;
    font-weight: 600;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.badge.bg-secondary {
    background-color: rgba(71, 85, 105, 0.8) !important;
    color: #f8fafc !important;
}

.badge.bg-success {
    background-color: rgba(16, 185, 129, 0.82) !important;
    color: #ecfeff !important;
}

.badge.bg-danger {
    background-color: rgba(239, 68, 68, 0.82) !important;
    color: #fff1f2 !important;
}

.badge.bg-info {
    background-color: rgba(59, 130, 246, 0.82) !important;
    color: #eff6ff !important;
}

/* Tables */
.table {
    margin-bottom: 0;
    color: #f8fafc;
}
.table thead th {
    background-color: rgba(2, 6, 23, 0.85);
    color: #f8fafc;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255,255,255,0.28);
    padding: 0.6rem 0.75rem;
}
.table td {
    padding: 0.6rem 0.75rem;
    vertical-align: middle;
    color: #f8fafc;
    background-color: rgba(15, 23, 42, 0.55);
    border-bottom: 1px solid rgba(255,255,255,0.16);
    font-size: 0.9rem;
}
.table-hover tbody tr:hover {
    background-color: rgba(59, 130, 246, 0.24);
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(30, 41, 59, 0.66);
}

.table-responsive {
    background: rgba(15, 23, 42, 0.72);
}

.table-contrast thead th {
    background-color: rgba(2, 6, 23, 0.85) !important;
    color: #f8fafc !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.28) !important;
    font-weight: 700;
}

.table-contrast td {
    color: #f8fafc !important;
    background-color: rgba(15, 23, 42, 0.55);
}

.table-contrast.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(30, 41, 59, 0.66);
}

.table-contrast.table-hover tbody tr:hover {
    background-color: rgba(59, 130, 246, 0.24) !important;
}

body.theme-light .table-contrast thead th {
    background-color: #dbeafe !important;
    color: #0f172a !important;
    border-bottom: 1px solid #bfdbfe !important;
}

/* Light mode: all tables use audit-log equivalent light style */
body.theme-light .table thead th {
    background-color: #dbeafe;
    color: #0f172a;
    border-bottom: 1px solid #bfdbfe;
}

body.theme-light .table td {
    color: #0f172a;
    background-color: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid #dbe3ef;
}

body.theme-light .table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: #f8fafc;
}

body.theme-light .table-hover tbody tr:hover {
    background-color: rgba(13, 43, 86, 0.08);
}

body.theme-light .table-contrast td {
    color: #0f172a !important;
    background-color: rgba(255, 255, 255, 0.92);
}

body.theme-light .table-contrast.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: #f8fafc;
}

/* Sidebar (Super Admin) */
.superadmin-sidebar {
    background-color: rgba(2, 6, 23, 0.92);
    border-right: 1px solid rgba(148, 163, 184, 0.22);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.sidebar-header {
    color: #e2e8f0;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.4px;
    padding: 0.9rem 1rem 0.6rem;
    margin: 0 0.8rem 0.5rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
    align-items: center;
}

.sidebar {
    background-color: rgba(2, 6, 23, 0.92);
    border-right: 1px solid rgba(148, 163, 184, 0.22);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    z-index: 100; 
}

.sidebar .nav-link {
    color: #e2e8f0;
    padding: 0.6rem 1rem;
    font-weight: 500;
    border-radius: 0 24px 24px 0;
    margin-right: 1rem;
    margin-bottom: 0.15rem;
    transition: var(--transition);
    font-size: 0.95rem;
}

.superadmin-sidebar .nav-link {
    color: #e2e8f0;
    padding: 0.6rem 1rem;
    font-weight: 500;
    border-radius: 0 24px 24px 0;
    margin-right: 1rem;
    margin-bottom: 0.15rem;
    transition: transform 0.22s ease, background-color 0.22s ease, box-shadow 0.22s ease, color 0.22s ease;
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
    will-change: transform;
}

.superadmin-sidebar .nav-link::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 999px;
    background: linear-gradient(180deg, #38bdf8, #818cf8);
    opacity: 0;
    transform: scaleY(0.35);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.sidebar .nav-link:hover {
    color: #ffffff;
    background-color: rgba(59, 130, 246, 0.22);
}

.superadmin-sidebar .nav-link:hover {
    color: #ffffff;
    background-color: rgba(59, 130, 246, 0.22);
    transform: translateX(4px);
    box-shadow: 0 6px 14px rgba(30, 64, 175, 0.22);
}

.superadmin-sidebar .nav-link:hover::before {
    opacity: 0.9;
    transform: scaleY(1);
}

.sidebar .nav-link.active {
    color: #f5b921;
    background-color: rgba(245, 185, 33, 0.18);
    box-shadow: inset 0 0 0 1px rgba(245, 185, 33, 0.45);
    font-weight: 600;
}

.superadmin-sidebar .nav-link.active {
    color: #f5b921;
    background-color: rgba(245, 185, 33, 0.18);
    box-shadow: inset 0 0 0 1px rgba(245, 185, 33, 0.45);
    font-weight: 600;
    transform: translateX(4px);
}

.superadmin-sidebar .nav-link.active::before {
    opacity: 1;
    transform: scaleY(1);
    background: linear-gradient(180deg, #f5b921, #f59e0b);
}

body.theme-dark .sidebar .nav-link.active,
body:not(.theme-light) .sidebar .nav-link.active {
    color: #f5b921;
    background-color: rgba(245, 185, 33, 0.18);
    box-shadow: inset 0 0 0 1px rgba(245, 185, 33, 0.45);
}

body.theme-dark .superadmin-sidebar .nav-link.active,
body:not(.theme-light) .superadmin-sidebar .nav-link.active {
    color: #f5b921;
    background-color: rgba(245, 185, 33, 0.18);
    box-shadow: inset 0 0 0 1px rgba(245, 185, 33, 0.45);
}

.sidebar .nav-link i {
    margin-right: 10px;
    font-size: 1.1rem;
}

.superadmin-sidebar .nav-link i {
    margin-right: 10px;
    font-size: 1.1rem;
    color: #93c5fd;
}

.superadmin-sidebar .sidebar-header .bi-grid-1x2-fill {
    color: #38bdf8;
}

.superadmin-sidebar .btn .bi-list {
    color: #e2e8f0;
}

.superadmin-sidebar .nav-link .bi-speedometer2 {
    color: #38bdf8;
}

.superadmin-sidebar .nav-link .bi-people {
    color: #a78bfa;
}

.superadmin-sidebar .nav-link .bi-hourglass-split {
    color: #fbbf24;
}

.superadmin-sidebar .nav-link .bi-check-circle {
    color: #34d399;
}

.superadmin-sidebar .nav-link .bi-x-circle {
    color: #f87171;
}

.superadmin-sidebar .nav-link .bi-flag {
    color: #60a5fa;
}

.superadmin-sidebar .nav-link .bi-file-earmark-bar-graph,
.superadmin-sidebar .nav-link .bi-calendar-week {
    color: #34d399;
}

.superadmin-sidebar .nav-link .bi-calendar3 {
    color: #a78bfa;
}

.superadmin-sidebar .nav-link .bi-journal-text {
    color: #f59e0b;
}

.superadmin-sidebar .nav-link:hover i,
.superadmin-sidebar .nav-link.active i {
    filter: brightness(1.15);
}

.superadmin-sidebar #sidebarMenu .nav-item {
    opacity: 0;
    transform: translateX(-8px);
    animation: sa-menu-in 0.35s ease forwards;
}

.superadmin-sidebar #sidebarMenu .nav-item:nth-child(1) { animation-delay: 0.02s; }
.superadmin-sidebar #sidebarMenu .nav-item:nth-child(2) { animation-delay: 0.05s; }
.superadmin-sidebar #sidebarMenu .nav-item:nth-child(3) { animation-delay: 0.08s; }
.superadmin-sidebar #sidebarMenu .nav-item:nth-child(4) { animation-delay: 0.11s; }
.superadmin-sidebar #sidebarMenu .nav-item:nth-child(5) { animation-delay: 0.14s; }
.superadmin-sidebar #sidebarMenu .nav-item:nth-child(6) { animation-delay: 0.17s; }
.superadmin-sidebar #sidebarMenu .nav-item:nth-child(7) { animation-delay: 0.2s; }
.superadmin-sidebar #sidebarMenu .nav-item:nth-child(8) { animation-delay: 0.23s; }

@keyframes sa-menu-in {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .superadmin-sidebar .nav-link,
    .superadmin-sidebar .nav-link::before,
    .superadmin-sidebar #sidebarMenu .nav-item {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
}

@media (max-width: 767.98px) {
    .superadmin-sidebar {
        min-height: auto !important;
    }
    #sidebarMenu {
        margin-bottom: 0.75rem;
    }
}

/* Super Admin dashboard KPI cards */
.sa-kpi-card {
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.sa-kpi-card .h4.mb-0 {
    color: #f8fafc;
    font-weight: 700;
}

body.theme-light .sa-kpi-card .h4.mb-0 {
    color: #0f172a;
}

.sa-kpi-icon {
    width: 2.2rem;
    height: 2.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 1.05rem;
}

.sa-kpi-users .sa-kpi-icon {
    background: rgba(59, 130, 246, 0.2);
    color: #bfdbfe;
}

.sa-kpi-institutes .sa-kpi-icon {
    background: rgba(16, 185, 129, 0.2);
    color: #a7f3d0;
}

.sa-kpi-bookings .sa-kpi-icon {
    background: rgba(245, 158, 11, 0.22);
    color: #fde68a;
}

.sa-kpi-logs .sa-kpi-icon {
    background: rgba(168, 85, 247, 0.2);
    color: #e9d5ff;
}

body.theme-light .sa-kpi-users .sa-kpi-icon {
    background: rgba(59, 130, 246, 0.14);
    color: #1d4ed8;
}

body.theme-light .sa-kpi-institutes .sa-kpi-icon {
    background: rgba(16, 185, 129, 0.14);
    color: #047857;
}

body.theme-light .sa-kpi-bookings .sa-kpi-icon {
    background: rgba(245, 158, 11, 0.16);
    color: #b45309;
}

body.theme-light .sa-kpi-logs .sa-kpi-icon {
    background: rgba(168, 85, 247, 0.14);
    color: #7e22ce;
}

/* Login Page Styling */
.login-card {
    max-width: 420px;
    margin: 80px auto;
    border: none;
    box-shadow: var(--shadow-lg);
}

.login-card .card-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    text-align: center;
    font-size: 1.4rem;
    padding: 2rem 1rem;
    display: block;
}

/* Nav Tabs in Dashboard */
.nav-tabs {
    border-bottom: 1px solid rgba(255,255,255,0.2);
    margin-bottom: 1.5rem;
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: var(--transition);
}

.nav-tabs .nav-link:hover {
    color: var(--primary-color);
    background-color: transparent;
    border-color: transparent;
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    background-color: transparent;
}

body.theme-dark .nav-tabs .nav-link.active,
body:not(.theme-light) .nav-tabs .nav-link.active {
    color: #f5b921 !important;
    border-bottom-color: #f5b921 !important;
}

body.theme-dark .nav-tabs .nav-link:hover,
body:not(.theme-light) .nav-tabs .nav-link:hover {
    color: #f5b921;
}

.bg-light {
    background-color: rgba(255, 255, 255, 0.07) !important;
    color: #e5e7eb !important;
}

.text-muted {
    color: #cbd5e1 !important;
}

.text-secondary {
    color: #d1d5db !important;
}

.small {
    color: #e2e8f0;
}

.alert-light {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: #e5e7eb;
}

/* Theme-aware modals */
body.theme-dark .modal-content,
body:not(.theme-light) .modal-content {
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: #f1f5f9;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

body.theme-dark .modal-header,
body.theme-dark .modal-footer,
body:not(.theme-light) .modal-header,
body:not(.theme-light) .modal-footer {
    border-color: rgba(148, 163, 184, 0.22);
}

body.theme-dark .modal-title,
body.theme-dark .modal-body,
body.theme-dark .modal-body p,
body.theme-dark .modal-body span,
body.theme-dark .modal-body label,
body:not(.theme-light) .modal-title,
body:not(.theme-light) .modal-body,
body:not(.theme-light) .modal-body p,
body:not(.theme-light) .modal-body span,
body:not(.theme-light) .modal-body label {
    color: #f1f5f9;
}

body.theme-dark .btn-close,
body:not(.theme-light) .btn-close {
    filter: invert(1) grayscale(100%) brightness(180%);
}

body.theme-light .modal-content {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(15, 23, 42, 0.12);
    color: #1f2937;
}

body.theme-light .modal-header,
body.theme-light .modal-footer {
    border-color: rgba(15, 23, 42, 0.12);
}

body.theme-light .modal-title,
body.theme-light .modal-body,
body.theme-light .modal-body p,
body.theme-light .modal-body span,
body.theme-light .modal-body label {
    color: #1f2937;
}

body.theme-light .btn-close {
    filter: none;
}

/* SweetAlert - Edit Bus modal theme compatibility */
body.theme-dark .swal2-popup.bus-edit-swal-popup,
body:not(.theme-light) .swal2-popup.bus-edit-swal-popup {
    background: rgba(15, 23, 42, 0.96) !important;
    border: 1px solid rgba(148, 163, 184, 0.25) !important;
    color: var(--text-primary) !important;
}

body.theme-dark .swal2-popup.bus-edit-swal-popup .swal2-title,
body.theme-dark .swal2-popup.bus-edit-swal-popup .form-label,
body:not(.theme-light) .swal2-popup.bus-edit-swal-popup .swal2-title,
body:not(.theme-light) .swal2-popup.bus-edit-swal-popup .form-label {
    color: var(--text-primary) !important;
}

body.theme-dark .swal2-popup.bus-edit-swal-popup .form-control,
body:not(.theme-light) .swal2-popup.bus-edit-swal-popup .form-control {
    background: rgba(30, 41, 59, 0.85) !important;
    color: var(--text-primary) !important;
    border: 1px solid rgba(148, 163, 184, 0.35) !important;
}

body.theme-dark .swal2-popup.bus-edit-swal-popup .form-control::placeholder,
body:not(.theme-light) .swal2-popup.bus-edit-swal-popup .form-control::placeholder {
    color: var(--text-secondary) !important;
}

body.theme-light .swal2-popup.bus-edit-swal-popup {
    background: rgba(255, 255, 255, 0.98) !important;
    border: 1px solid rgba(15, 23, 42, 0.12) !important;
    color: #1f2937 !important;
}

body.theme-dark .swal2-popup.participant-edit-swal-popup,
body:not(.theme-light) .swal2-popup.participant-edit-swal-popup {
    background: rgba(15, 23, 42, 0.96) !important;
    border: 1px solid rgba(148, 163, 184, 0.25) !important;
    color: var(--text-primary) !important;
}

body.theme-dark .swal2-popup.participant-edit-swal-popup .swal2-title,
body.theme-dark .swal2-popup.participant-edit-swal-popup .form-label,
body:not(.theme-light) .swal2-popup.participant-edit-swal-popup .swal2-title,
body:not(.theme-light) .swal2-popup.participant-edit-swal-popup .form-label {
    color: var(--text-primary) !important;
}

body.theme-dark .swal2-popup.participant-edit-swal-popup .form-control,
body:not(.theme-light) .swal2-popup.participant-edit-swal-popup .form-control {
    background: rgba(30, 41, 59, 0.85) !important;
    color: var(--text-primary) !important;
    border: 1px solid rgba(148, 163, 184, 0.35) !important;
}

body.theme-dark .swal2-popup.participant-edit-swal-popup .form-control::placeholder,
body:not(.theme-light) .swal2-popup.participant-edit-swal-popup .form-control::placeholder {
    color: var(--text-secondary) !important;
}

body.theme-light .swal2-popup.participant-edit-swal-popup {
    background: rgba(255, 255, 255, 0.98) !important;
    border: 1px solid rgba(15, 23, 42, 0.12) !important;
    color: #1f2937 !important;
}

body.theme-dark .swal2-popup.booking-edit-swal-popup,
body:not(.theme-light) .swal2-popup.booking-edit-swal-popup {
    background: rgba(15, 23, 42, 0.96) !important;
    border: 1px solid rgba(148, 163, 184, 0.25) !important;
    color: var(--text-primary) !important;
}

body.theme-dark .swal2-popup.booking-edit-swal-popup .swal2-title,
body.theme-dark .swal2-popup.booking-edit-swal-popup .form-label,
body:not(.theme-light) .swal2-popup.booking-edit-swal-popup .swal2-title,
body:not(.theme-light) .swal2-popup.booking-edit-swal-popup .form-label {
    color: var(--text-primary) !important;
}

body.theme-dark .swal2-popup.booking-edit-swal-popup .form-control,
body.theme-dark .swal2-popup.booking-edit-swal-popup .form-select,
body:not(.theme-light) .swal2-popup.booking-edit-swal-popup .form-control,
body:not(.theme-light) .swal2-popup.booking-edit-swal-popup .form-select {
    background: rgba(30, 41, 59, 0.85) !important;
    color: var(--text-primary) !important;
    border: 1px solid rgba(148, 163, 184, 0.35) !important;
}

body.theme-dark .swal2-popup.booking-edit-swal-popup .form-control::placeholder,
body:not(.theme-light) .swal2-popup.booking-edit-swal-popup .form-control::placeholder {
    color: var(--text-secondary) !important;
}

body.theme-light .swal2-popup.booking-edit-swal-popup {
    background: rgba(255, 255, 255, 0.98) !important;
    border: 1px solid rgba(15, 23, 42, 0.12) !important;
    color: #1f2937 !important;
}

/* Client/Admin table wrappers that use Bootstrap utility classes */
body.theme-dark .table-responsive.bg-white,
body:not(.theme-light) .table-responsive.bg-white {
    background: rgba(15, 23, 42, 0.78) !important;
    border-color: rgba(148, 163, 184, 0.25) !important;
}

body.theme-dark .table-responsive.bg-white .table,
body:not(.theme-light) .table-responsive.bg-white .table {
    color: #f8fafc !important;
}

body.theme-dark .table-light,
body:not(.theme-light) .table-light {
    background-color: rgba(255, 255, 255, 0.12) !important;
    color: #f8fafc !important;
}

body.theme-dark .table-light th,
body.theme-dark .table-light td,
body:not(.theme-light) .table-light th,
body:not(.theme-light) .table-light td {
    background-color: rgba(255, 255, 255, 0.12) !important;
    color: #f8fafc !important;
    border-color: rgba(255, 255, 255, 0.22) !important;
}

body.theme-dark .table-responsive.bg-white .table td,
body.theme-dark .table-responsive.bg-white .table th,
body:not(.theme-light) .table-responsive.bg-white .table td,
body:not(.theme-light) .table-responsive.bg-white .table th {
    color: #f8fafc !important;
}

body.theme-light .table-responsive.bg-white {
    background: rgba(255, 255, 255, 0.96) !important;
    border-color: rgba(15, 23, 42, 0.12) !important;
}

body.theme-light .table-responsive.bg-white .table {
    color: #1f2937 !important;
}

body.theme-light .table-light,
body.theme-light .table-light th,
body.theme-light .table-light td {
    background-color: #f8fafc !important;
    color: #334155 !important;
    border-color: #e2e8f0 !important;
}

body.theme-dark .active-visits-section .card-body,
body:not(.theme-light) .active-visits-section .card-body {
    color: #f8fafc;
}

body.theme-dark .active-visits-section .card-body p,
body.theme-dark .active-visits-section .card-body strong,
body.theme-dark .active-visits-section .card-body .small,
body:not(.theme-light) .active-visits-section .card-body p,
body:not(.theme-light) .active-visits-section .card-body strong,
body:not(.theme-light) .active-visits-section .card-body .small {
    color: #f8fafc !important;
}

body.theme-dark .active-visits-section .alert-light,
body:not(.theme-light) .active-visits-section .alert-light {
    background-color: rgba(51, 65, 85, 0.36);
    border-color: rgba(148, 163, 184, 0.34);
    color: #e5e7eb;
}

body.theme-dark .active-visits-section .alert-success,
body:not(.theme-light) .active-visits-section .alert-success {
    background-color: rgba(16, 185, 129, 0.22);
    border-color: rgba(16, 185, 129, 0.38);
    color: #ecfdf5;
}

.participant-modal .modal-dialog {
    max-width: 860px;
}

.participant-modal .modal-header {
    border-bottom-width: 1px;
}

.participant-modal-body {
    max-height: min(68vh, 720px);
    overflow-y: auto;
}

.participant-modal-footer {
    border-top-width: 1px;
}

.participant-modal-tabs .nav-link {
    border-radius: 10px;
    font-weight: 600;
    padding: 0.55rem 0.75rem;
}

.participant-modal-tabs .nav-link .badge {
    font-size: 0.72rem;
    padding: 0.35em 0.5em;
    transition: var(--transition);
}

.participant-list .participant-item {
    border-radius: 10px;
    margin-bottom: 0.45rem;
    transition: var(--transition);
}

.participant-list .participant-item:hover {
    transform: translateY(-1px);
}

.participant-selected {
    border-width: 1px;
}

.participant-check {
    width: 1.08rem;
    height: 1.08rem;
    cursor: pointer;
}

body.theme-dark .participant-modal-content,
body:not(.theme-light) .participant-modal-content {
    background: rgba(15, 23, 42, 0.97);
}

body.theme-dark .participant-modal-tabs .nav-link,
body:not(.theme-light) .participant-modal-tabs .nav-link {
    background: rgba(148, 163, 184, 0.12);
    color: #e2e8f0;
}

body.theme-dark .participant-modal-tabs .nav-link.active,
body:not(.theme-light) .participant-modal-tabs .nav-link.active {
    background: rgba(59, 130, 246, 0.3);
    color: #ffffff;
}

body.theme-dark .participant-modal-tabs .nav-link.active .badge,
body:not(.theme-light) .participant-modal-tabs .nav-link.active .badge {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff;
}

body.theme-dark .participant-list .participant-item,
body:not(.theme-light) .participant-list .participant-item {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(148, 163, 184, 0.28);
    color: #f8fafc;
}

body.theme-dark .participant-list .participant-item .text-muted,
body:not(.theme-light) .participant-list .participant-item .text-muted {
    color: #cbd5e1 !important;
}

body.theme-dark .participant-list .participant-item.participant-selected,
body:not(.theme-light) .participant-list .participant-item.participant-selected {
    background: rgba(30, 64, 175, 0.28);
    border-color: rgba(96, 165, 250, 0.65);
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.35);
}

body.theme-dark .participant-modal .alert-info,
body:not(.theme-light) .participant-modal .alert-info {
    background: rgba(37, 99, 235, 0.2);
    border-color: rgba(96, 165, 250, 0.35);
    color: #dbeafe;
}

body.theme-light .participant-modal-tabs .nav-link {
    background: #f1f5f9;
    color: #334155;
}

body.theme-light .participant-modal-tabs .nav-link.active {
    background: rgba(37, 99, 235, 0.15);
    color: #0f172a;
}

body.theme-light .participant-modal-tabs .nav-link.active .badge {
    background: rgba(37, 99, 235, 0.2) !important;
    color: #0f172a;
}

body.theme-light .participant-list .participant-item {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #1f2937;
}

body.theme-light .participant-list .participant-item.participant-selected {
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.35);
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.14);
}

.client-institute-banner {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(148, 163, 184, 0.14);
}

.client-institute-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
    color: #cbd5e1;
}

.client-institute-name {
    font-weight: 700;
    color: #f8fafc;
}

body.theme-light .client-institute-banner {
    border-color: rgba(15, 23, 42, 0.15);
    background: rgba(255, 255, 255, 0.86);
}

body.theme-light .client-institute-label {
    color: #475569;
}

body.theme-light .client-institute-name {
    color: #0f172a;
}

.client-tabs {
    gap: 0.6rem;
    border-bottom: none;
}

.client-tabs-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.client-tabs-wrap .client-tabs {
    width: max-content;
    min-width: 100%;
    flex-wrap: nowrap;
}

.client-tabs-wrap .nav-item {
    flex: 0 0 auto;
}

.client-tabs .nav-item {
    margin-bottom: 0.35rem;
}

.client-tabs .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.45);
    padding: 0.58rem 0.9rem;
}

.client-tabs .nav-link:hover {
    border-color: rgba(96, 165, 250, 0.65);
    background: rgba(30, 41, 59, 0.72);
}

.client-tabs .nav-link.active {
    border-color: rgba(59, 130, 246, 0.95);
    background: rgba(59, 130, 246, 0.2);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.client-tabs .tab-step-badge {
    min-width: 1.4rem;
    height: 1.4rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(148, 163, 184, 0.24);
    color: #e2e8f0;
}

.client-tabs .tab-icon {
    font-size: 1rem;
}

.client-tabs .tab-icon-profile {
    color: #60a5fa;
}

.client-tabs .tab-icon-lists {
    color: #f59e0b;
}

.client-tabs .tab-icon-visit {
    color: #34d399;
}

.client-tabs .tab-label {
    color: #e2e8f0;
    font-weight: 600;
}

.client-tabs .tab-count-badge {
    margin-left: 0.2rem;
    background: rgba(148, 163, 184, 0.24);
    color: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.3);
    font-size: 0.72rem;
    font-weight: 700;
}

.client-tabs .nav-link.active .tab-step-badge,
.client-tabs .nav-link.active .tab-count-badge {
    background: rgba(59, 130, 246, 0.25);
    border-color: rgba(96, 165, 250, 0.5);
    color: #dbeafe;
}

body.theme-light .client-tabs .nav-link {
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.45);
}

body.theme-light .client-tabs .nav-link:hover {
    background: rgba(239, 246, 255, 0.9);
    border-color: rgba(59, 130, 246, 0.6);
}

body.theme-light .client-tabs .nav-link.active {
    background: rgba(219, 234, 254, 0.85);
    border-color: rgba(37, 99, 235, 0.9);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.14);
}

body.theme-light .client-tabs .tab-step-badge,
body.theme-light .client-tabs .tab-count-badge {
    background: rgba(15, 23, 42, 0.08);
    color: #1e293b;
    border-color: rgba(15, 23, 42, 0.12);
}

body.theme-light .client-tabs .tab-label {
    color: #0f172a;
}

@media (max-width: 767.98px) {
    .client-tabs-wrap {
        padding-bottom: 0.25rem;
    }

    .client-tabs-wrap .client-tabs {
        margin-bottom: 1rem !important;
    }

    .client-tabs .nav-link {
        padding: 0.54rem 0.78rem;
    }

    .client-tabs .tab-label {
        white-space: nowrap;
        font-size: 0.88rem;
    }
}

/* Add Bus panel theme compatibility */
body.theme-dark .bus-form-panel,
body:not(.theme-light) .bus-form-panel {
    background: rgba(15, 23, 42, 0.78) !important;
    border-color: rgba(148, 163, 184, 0.3) !important;
}

body.theme-dark .bus-form-panel .bus-form-card,
body:not(.theme-light) .bus-form-panel .bus-form-card {
    background: rgba(30, 41, 59, 0.72) !important;
    border-color: rgba(148, 163, 184, 0.28) !important;
}

body.theme-dark .bus-form-panel h5,
body.theme-dark .bus-form-panel h6,
body.theme-dark .bus-form-panel .form-label,
body:not(.theme-light) .bus-form-panel h5,
body:not(.theme-light) .bus-form-panel h6,
body:not(.theme-light) .bus-form-panel .form-label {
    color: #e2e8f0 !important;
}

body.theme-dark .bus-form-panel .input-group-text,
body:not(.theme-light) .bus-form-panel .input-group-text {
    background: rgba(15, 23, 42, 0.92);
    border-color: rgba(148, 163, 184, 0.34);
    color: #cbd5e1;
}

body.theme-dark .bus-form-panel .form-control.bg-white,
body:not(.theme-light) .bus-form-panel .form-control.bg-white {
    background: rgba(15, 23, 42, 0.62) !important;
    color: #f8fafc !important;
    border-color: rgba(148, 163, 184, 0.34) !important;
}

body.theme-dark .bus-form-cancel,
body:not(.theme-light) .bus-form-cancel {
    background: rgba(71, 85, 105, 0.36) !important;
    border: 1px solid rgba(148, 163, 184, 0.4) !important;
    color: #e2e8f0 !important;
}

body.theme-dark .bus-form-cancel:hover,
body:not(.theme-light) .bus-form-cancel:hover {
    background: rgba(100, 116, 139, 0.5) !important;
    color: #ffffff !important;
}

body.theme-light .bus-form-panel {
    background: #ffffff !important;
}

body.theme-light .bus-form-panel .bus-form-card {
    background: #f8fafc !important;
}

body.theme-dark .booking-auto-note,
body:not(.theme-light) .booking-auto-note {
    background: rgba(37, 99, 235, 0.2);
    border-color: rgba(96, 165, 250, 0.4);
    color: #dbeafe;
}

body.theme-dark .booking-auto-note strong,
body:not(.theme-light) .booking-auto-note strong {
    color: #ffffff;
}

body.theme-light .booking-auto-note {
    background: rgba(219, 234, 254, 0.9);
    border-color: rgba(147, 197, 253, 0.7);
    color: #1e3a8a;
}

body.theme-dark .booking-disabled-note,
body:not(.theme-light) .booking-disabled-note {
    background: rgba(217, 119, 6, 0.2);
    border-color: rgba(251, 191, 36, 0.45);
    color: #fef3c7;
}

body.theme-dark .booking-disabled-note strong,
body:not(.theme-light) .booking-disabled-note strong {
    color: #ffffff;
}

body.theme-light .booking-disabled-note {
    background: rgba(254, 243, 199, 0.9);
    border-color: rgba(251, 191, 36, 0.6);
    color: #92400e;
}

/* Keep gate pass strictly light-themed regardless of current app theme */
body.theme-dark #print-area,
body.theme-dark #print-area *,
body:not(.theme-light) #print-area,
body:not(.theme-light) #print-area * {
    background-color: #ffffff !important;
    color: #111827 !important;
    border-color: #d1d5db !important;
}

body.theme-dark #print-area .table,
body.theme-dark #print-area .table th,
body.theme-dark #print-area .table td,
body:not(.theme-light) #print-area .table,
body:not(.theme-light) #print-area .table th,
body:not(.theme-light) #print-area .table td {
    background-color: #ffffff !important;
    color: #111827 !important;
    border-color: #d1d5db !important;
}

body.theme-dark #print-area .badge,
body:not(.theme-light) #print-area .badge {
    color: #111827 !important;
    background-color: #e5e7eb !important;
}

#print-area .print-approval-block {
    margin-top: 1.25rem;
}

#print-area h2 {
    color: #0f172a !important;
    letter-spacing: 0.02em;
    font-size: 1.55rem;
    margin-bottom: 0.2rem;
}

#print-area h4 {
    color: #334155 !important;
    font-weight: 500;
    font-size: 1rem;
    margin-bottom: 0.35rem;
}

#print-area hr {
    border-top: 2px solid #cbd5e1;
    margin-top: 0.5rem;
    margin-bottom: 0.85rem;
}

#print-area .print-gp-info-table thead th {
    background-color: #0d6efd !important;
    color: #ffffff !important;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 0.82rem;
}

#print-area .print-gp-info-table th,
#print-area .print-gp-info-table td {
    padding: 0.24rem 0.42rem !important;
    font-size: 0.86rem;
    line-height: 1.2;
    vertical-align: middle;
}

#print-area .print-gp-info-table tbody tr:nth-child(even) td,
#print-area .print-gp-info-table tbody tr:nth-child(even) th {
    background-color: #f8fafc !important;
}

#print-area .print-gp-info-table tbody th {
    width: 30%;
    font-weight: 700;
}

#print-area .print-gp-vehicle-table thead th {
    background-color: #198754 !important;
    color: #ffffff !important;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 0.8rem;
}

#print-area .print-gp-summary-table thead th {
    background-color: #6c757d !important;
    color: #ffffff !important;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 0.8rem;
}

#print-area .print-gp-summary-table tbody td {
    font-size: 1rem;
    font-weight: 500;
}

#print-area .print-gp-summary-table tbody td:last-child {
    background-color: #f3f4f6 !important;
    font-weight: 700;
}

#print-area .signature-line {
    width: 88%;
    height: 2.5rem;
    margin: 0 auto 0.5rem;
    border-bottom: 1.5px solid #111827;
}

/* Animations */
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.3s ease;
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

@page {
    size: A4 portrait;
    margin: 10mm;
}

/* Print Styles */
@media print {

    html,
    body {
        width: 210mm;
        min-height: 297mm;
        background: #ffffff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    #app > *:not(#print-area) {
        display: none !important;
    }

    #print-area {
        display: block !important;
        position: static !important;
        width: 190mm !important;
        max-width: 190mm !important;
        min-height: 277mm;
        max-width: none !important;
        background-color: white !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 auto !important;
        box-sizing: border-box;
    }

    #print-area .table {
        width: 100% !important;
        table-layout: fixed;
    }

    #print-area .table th,
    #print-area .table td {
        padding: 0.42rem 0.55rem !important;
        word-break: break-word;
        white-space: normal !important;
    }

    #print-area .print-gp-info-table th,
    #print-area .print-gp-info-table td {
        padding: 0.2rem 0.35rem !important;
        font-size: 0.8rem !important;
        line-height: 1.15 !important;
    }

    #print-area .print-gp-info-table,
    #print-area .print-gp-vehicle-table,
    #print-area .print-gp-summary-table {
        page-break-inside: avoid;
    }

    #print-area .signature-line {
        height: 2.2rem;
        border-bottom: 1.5px solid #111827;
    }
    .d-print-none {
        display: none !important;
    }
}
