/* ============================================================
   TESSERACT CLOUD TECHNOLOGIES
   Cosmic Light Theme — Nebula Blue + Gold Accents
   ============================================================ */

/* ============================================================
   1. ROOT VARIABLES
   ============================================================ */
:root {
    /* Cosmic backdrop (dark — the starfield sits here) */
    --primary-dark: #0f0e17;
    --primary-mid: #1a1932;
    --primary-light: #2d2b55;

    /* Nebula Blue (primary accent) */
    --nebula-blue: #2563eb;
    --nebula-blue-light: #3b82f6;
    --nebula-blue-dark: #1e40af;
    --nebula-glow: rgba(37, 99, 235, 0.25);

    /* Cosmic Gold (secondary accent) */
    --cosmic-gold: #c9962f;
    --cosmic-gold-light: #f0c14b;
    --cosmic-gold-soft: rgba(201, 150, 47, 0.15);

    /* Light surfaces (translucent so starfield shows through) */
    --surface-card: rgba(255, 255, 255, 0.88);
    --surface-card-solid: #ffffff;
    --surface-subtle: rgba(241, 244, 250, 0.75);
    --surface-hover: rgba(238, 241, 248, 0.85);
    --surface-input: rgba(255, 255, 255, 0.92);
    --surface-modal: rgba(255, 255, 255, 0.97);

    /* Borders */
    --border-light: rgba(227, 230, 238, 0.9);
    --border-medium: rgba(207, 212, 224, 0.9);
    --border-blue: rgba(37, 99, 235, 0.25);

    /* Text on light surfaces */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-faint: #94a3b8;

    /* Text on the dark cosmic backdrop */
    --starlight: #fffffe;
    --starlight-dim: rgba(255, 255, 255, 0.6);
    --starlight-faint: rgba(255, 255, 255, 0.3);

    /* Status colors */
    --cosmic-teal: #1a8f5e;
    --cosmic-teal-light: #2cb67d;
    --danger-red: #dc2626;
    --danger-red-light: #ef4444;
    --warning-gold: #b45309;
    --warning-gold-light: #d97706;
    --success-green: #16a34a;

    /* Layout */
    --sidebar-width: 260px;
    --topbar-height: 70px;
    --footer-height: 50px;

    /* Shadows — tuned to look right over the starfield */
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12), 0 4px 8px rgba(15, 23, 42, 0.06);
    --shadow-xl: 0 20px 60px rgba(15, 23, 42, 0.15);
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Fragment Mono', monospace !important;
    background: var(--primary-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Base text colors — apply on light surfaces only */
.card-tesseract,
.modal-content,
.tesseract-modal,
.table-tesseract {
    color: var(--text-primary);
}

/* ============================================================
   3. TYPOGRAPHY
   ============================================================ */
code {
    color: var(--nebula-blue-dark);
    background: rgba(37, 99, 235, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.text-glow,
.text-glow-purple {
    color: var(--nebula-blue);
    text-shadow: none;
}

.text-glow-gold {
    color: var(--cosmic-gold);
    text-shadow: none;
}

/* ============================================================
   4. CUSTOM SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--nebula-blue);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--nebula-blue-dark);
}

/* ============================================================
   5. ANIMATED COSMIC BACKGROUND
   ============================================================ */
.stars-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(ellipse at 50% 0%, var(--primary-mid) 0%, var(--primary-dark) 70%);
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #ffffff;
    border-radius: 50%;
    animation: twinkle 3s ease-in-out infinite alternate;
    will-change: opacity, transform;
}

.star:nth-child(odd) { animation-delay: 1.5s; }
.star:nth-child(3n) { width: 3px; height: 3px; animation-duration: 4s; }
.star:nth-child(5n) { width: 1px; height: 1px; animation-duration: 2s; }

@keyframes twinkle {
    0%   { opacity: 0.2; transform: scale(0.8); }
    100% { opacity: 1;   transform: scale(1.2); }
}

.shooting-star {
    position: fixed;
    width: 100px;
    height: 2px;
    background: linear-gradient(to right, rgba(255,255,255,0), rgba(59, 130, 246, 0.8));
    border-radius: 2px;
    animation: shoot 8s linear infinite;
    pointer-events: none;
    z-index: 0;
    will-change: transform, opacity;
}

.shooting-star::after {
    content: '';
    position: absolute;
    right: 0;
    top: -2px;
    width: 6px;
    height: 6px;
    background: var(--nebula-blue-light);
    border-radius: 50%;
    box-shadow: 0 0 20px var(--nebula-blue-light);
}

.shooting-star:nth-child(1) { top: 10%; left: -100px; animation-delay: 0s; }
.shooting-star:nth-child(2) { top: 30%; left: -100px; animation-delay: 4s; }
.shooting-star:nth-child(3) { top: 50%; left: -100px; animation-delay: 2s; }
.shooting-star:nth-child(4) { top: 70%; left: -100px; animation-delay: 6s; }

@keyframes shoot {
    0%   { transform: translate(0, 0) rotate(15deg); opacity: 0; }
    5%   { opacity: 1; }
    15%  { transform: translate(800px, 200px) rotate(15deg); opacity: 1; }
    20%  { opacity: 0; }
    100% { opacity: 0; }
}

/* ============================================================
   6. LAYOUT SHELL — SIDEBAR / TOPBAR / CONTENT / FOOTER
   ============================================================ */

/* ---- SIDEBAR ---- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--surface-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid var(--border-light);
    z-index: 1000;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.sidebar-brand {
    flex-shrink: 0;
    padding: 20px 16px 16px;
    text-align: center;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-brand .logo-text {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 4px;
    background: linear-gradient(135deg, var(--nebula-blue) 0%, var(--cosmic-gold) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-brand .logo-sub {
    font-size: 10px;
    letter-spacing: 6px;
    color: var(--cosmic-gold);
    text-transform: uppercase;
    margin-top: 2px;
    -webkit-text-fill-color: var(--cosmic-gold);
}

.sidebar-brand .logo-divider {
    width: 60px;
    height: 2px;
    margin: 8px auto 0;
    background: linear-gradient(90deg, transparent, var(--nebula-blue), transparent);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 10px 15px 8px;
}

.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-track { background: rgba(15, 23, 42, 0.03); }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--nebula-blue); border-radius: 4px; }

.sidebar-nav .nav-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-faint);
    padding: 20px 16px 8px;
    font-weight: 600;
}

.sidebar-nav .nav-label:first-of-type { padding-top: 8px; }

.sidebar-nav .nav-item { margin-bottom: 2px; }

.sidebar-nav .nav-item .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    transition: all 0.2s ease;
}

.sidebar-nav .nav-item .nav-link i {
    width: 20px;
    text-align: center;
    font-size: 14px;
    flex-shrink: 0;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.sidebar-nav .nav-item .nav-link span:not(.badge):not(.nav-icon-glow) {
    flex: 1;
}

.sidebar-nav .nav-item .nav-link:hover {
    background: rgba(37, 99, 235, 0.06);
    color: var(--nebula-blue);
}

.sidebar-nav .nav-item .nav-link:hover i { color: var(--nebula-blue); }

.sidebar-nav .nav-link.active {
    color: var(--nebula-blue-dark);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(201, 150, 47, 0.08));
    box-shadow: inset 3px 0 0 var(--nebula-blue);
    font-weight: 600;
}

.sidebar-nav .nav-link.active i { color: var(--nebula-blue); }

.sidebar-nav .nav-link .badge {
    margin-left: auto;
    background: rgba(15, 23, 42, 0.06);
    color: var(--text-secondary);
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 20px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.sidebar-nav .nav-link.active .badge {
    background: var(--nebula-blue) !important;
    color: #ffffff !important;
}

.sidebar-nav .nav-link .badge.bg-danger {
    background: var(--danger-red) !important;
    color: #ffffff !important;
}

.sidebar-nav .nav-link .badge.bg-warning {
    background: var(--cosmic-gold) !important;
    color: #ffffff !important;
}

.sidebar-nav .nav-link .badge.bg-success {
    background: var(--success-green) !important;
    color: #ffffff !important;
}

.sidebar-nav .nav-link .nav-icon-glow {
    position: absolute;
    right: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--nebula-blue), var(--nebula-blue-light));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-nav .nav-link.active .nav-icon-glow { opacity: 1; }

.sidebar-footer {
    flex-shrink: 0;
    margin-top: auto;
    text-align: center;
    padding: 12px 16px;
    border-top: 1px solid var(--border-light);
    color: var(--text-faint);
    font-size: 11px;
    letter-spacing: 1px;
    background: var(--surface-card);
}

/* Collapsed sidebar */
.sidebar.collapsed .sidebar-brand .logo-sub,
.sidebar.collapsed .sidebar-brand .logo-divider { display: none; }
.sidebar.collapsed .sidebar-brand .logo-text { font-size: 16px; }
.sidebar.collapsed .nav-label { display: none; }
.sidebar.collapsed .nav-link .badge { display: none; }
.sidebar.collapsed .nav-link span:not(.badge):not(.nav-icon-glow) { display: none; }
.sidebar.collapsed .nav-link { justify-content: center; padding: 12px; }
.sidebar.collapsed .nav-link i { margin-right: 0; font-size: 18px; }
.sidebar.collapsed .sidebar-footer { font-size: 9px; padding: 8px; }

/* Mobile overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 999;
}

.sidebar.open ~ .sidebar-overlay { display: block; }

/* ---- TOPBAR ---- */
.topbar {
    position: fixed;
    top: 0;
    right: 0;
    left: var(--sidebar-width);
    height: var(--topbar-height);
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    z-index: 999;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.topbar-left { display: flex; align-items: center; gap: 15px; }

.topbar-left .page-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.topbar-left .page-title small {
    font-weight: 400;
    color: var(--nebula-blue);
    font-size: 13px;
    margin-left: 8px;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    padding: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover { color: var(--nebula-blue); }

.topbar-right { display: flex; align-items: center; gap: 20px; }

/* ---- MAIN CONTENT ---- */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    padding: 30px 30px calc(var(--footer-height) + 30px) 30px;
    min-height: calc(100vh - var(--topbar-height));
    position: relative;
    z-index: 1;
    /* No background — the starfield shows through entirely */
    background: transparent;
}

/* ---- FOOTER ---- */
.footer {
    position: fixed;
    bottom: 0;
    right: 0;
    left: var(--sidebar-width);
    height: var(--footer-height);
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    z-index: 998;
}

.footer .copyright {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.footer .copyright strong {
    color: var(--nebula-blue);
    font-weight: 600;
}

.footer .footer-links { display: flex; gap: 20px; }

.footer .footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.footer .footer-links a:hover { color: var(--nebula-blue); }

/* ============================================================
   7. USER PROFILE DROPDOWN + NOTIFICATION BELL
   ============================================================ */

.user-profile { position: relative; cursor: pointer; }

.user-profile .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--nebula-blue), var(--cosmic-gold));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    font-size: 16px;
    border: 2px solid transparent;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.user-profile .user-avatar:hover {
    border-color: var(--nebula-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.user-profile .user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.user-profile .dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    background: var(--surface-card-solid);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 8px 0;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
}

.user-profile .dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.user-profile .dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-profile .dropdown-menu .dropdown-item:hover {
    background: rgba(37, 99, 235, 0.08);
    color: var(--nebula-blue);
}

.user-profile .dropdown-menu .dropdown-item i {
    width: 18px;
    font-size: 14px;
    color: var(--nebula-blue);
}

.user-profile .dropdown-menu .dropdown-item.dropdown-item-danger { color: var(--danger-red); }
.user-profile .dropdown-menu .dropdown-item.dropdown-item-danger i { color: var(--danger-red); }
.user-profile .dropdown-menu .dropdown-item.dropdown-item-danger:hover {
    background: rgba(220, 38, 38, 0.08);
    color: var(--danger-red);
}

.user-profile .dropdown-menu .dropdown-divider {
    border-color: var(--border-light);
    margin: 5px 15px;
}

.user-profile .dropdown-menu .user-info {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-light);
}

.user-profile .dropdown-menu .user-info .name {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
}

.user-profile .dropdown-menu .user-info .email {
    color: var(--text-muted);
    font-size: 12px;
}

/* Notification bell */
.notification-wrapper { position: relative; }

.notification-bell {
    position: relative;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    gap: 2px;
    transition: all 0.3s ease;
}

.notification-bell:hover {
    color: var(--nebula-blue);
    transform: scale(1.05);
}

.notification-badge {
    display: inline-block;
    background: var(--danger-red);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border: 2px solid var(--surface-card-solid);
    box-shadow: 0 0 10px rgba(220, 38, 38, 0.25);
    margin-left: -4px;
    position: relative;
    top: -8px;
}

.notification-badge.pulse { animation: pulse-badge 0.3s ease 2; }

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.2); }
}

/* Notification dropdown */
.notification-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: -20px;
    width: 420px;
    max-height: 500px;
    background: var(--surface-card-solid);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.notification-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.notification-dropdown-header {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.notification-dropdown-header span {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
}

.notification-dropdown-header .btn-mark-all-read {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.notification-dropdown-header .btn-mark-all-read:hover {
    color: var(--nebula-blue);
    background: rgba(37, 99, 235, 0.08);
}

.notification-dropdown-header .btn-view-all {
    color: var(--nebula-blue);
    font-size: 12px;
    text-decoration: none;
    margin-left: 10px;
}

.notification-dropdown-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    max-height: 350px;
}

.notification-dropdown-body::-webkit-scrollbar { width: 4px; }
.notification-dropdown-body::-webkit-scrollbar-track { background: transparent; }
.notification-dropdown-body::-webkit-scrollbar-thumb { background: var(--nebula-blue); border-radius: 4px; }

.notification-group-label {
    padding: 12px 10px 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-faint);
}

.notification-item {
    display: flex;
    align-items: flex-start;
    padding: 12px 20px;
    gap: 12px;
    cursor: pointer;
    border-left: 3px solid transparent;
    text-decoration: none;
    transition: all 0.2s ease;
}

.notification-item:hover { background: rgba(37, 99, 235, 0.04); }

.notification-item.unread {
    background: rgba(37, 99, 235, 0.05);
    border-left-color: var(--nebula-blue);
}

.notification-item .notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}

.notification-item .notification-icon.success { background: rgba(22, 163, 74, 0.12); color: var(--success-green); }
.notification-item .notification-icon.warning { background: rgba(180, 83, 9, 0.12); color: var(--warning-gold); }
.notification-item .notification-icon.danger  { background: rgba(220, 38, 38, 0.1); color: var(--danger-red); }
.notification-item .notification-icon.info    { background: rgba(37, 99, 235, 0.12); color: var(--nebula-blue); }

.notification-item .notification-content { flex: 1; min-width: 0; }

.notification-item .notification-content .title {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 13px;
    margin-bottom: 2px;
}

.notification-item .notification-content .message {
    color: var(--text-secondary);
    font-size: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-item .notification-content .time {
    color: var(--text-faint);
    font-size: 11px;
    margin-top: 4px;
}

.notification-empty {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-faint);
}

.notification-empty i {
    font-size: 32px;
    margin-bottom: 10px;
    display: block;
    color: var(--border-medium);
}

.notification-loading {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-muted);
}

.notification-loading .spinner-nebula { margin: 0 auto 10px; }

.notification-dropdown-footer {
    padding: 10px 20px;
    border-top: 1px solid var(--border-light);
    flex-shrink: 0;
}

.notification-dropdown-footer .btn { font-size: 13px; padding: 8px; }

/* ============================================================
   8. MODALS
   ============================================================ */
.modal-backdrop {
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1040 !important;
}

.modal {
    z-index: 1050 !important;
    pointer-events: none !important;
}

.modal .modal-dialog { pointer-events: auto !important; }

.tesseract-modal .modal-content {
    background: var(--surface-modal);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    pointer-events: auto !important;
    color: var(--text-primary);
}

.tesseract-modal .modal-header {
    border-bottom: 1px solid var(--border-light);
    padding: 20px 25px;
}

.tesseract-modal .modal-header .modal-title {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 18px;
}

.tesseract-modal .modal-header .btn-close {
    filter: none;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.tesseract-modal .modal-header .btn-close:hover {
    opacity: 1;
    transform: rotate(90deg);
}

.tesseract-modal .modal-body {
    padding: 25px;
    color: var(--text-secondary);
    pointer-events: auto !important;
    overflow-y: auto !important;
}

.tesseract-modal .modal-footer {
    border-top: 1px solid var(--border-light);
    padding: 15px 25px;
}

.tesseract-modal .modal-content input,
.tesseract-modal .modal-content textarea,
.tesseract-modal .modal-content select,
.tesseract-modal .modal-content button {
    pointer-events: auto !important;
    z-index: 1060 !important;
    user-select: text !important;
}

.tesseract-modal .modal-content textarea { resize: vertical !important; }

.tesseract-modal .modal-content .form-control {
    background: var(--surface-input) !important;
    border: 1px solid var(--border-light) !important;
    border-radius: 12px !important;
    padding: 12px 16px !important;
    color: var(--text-primary) !important;
    width: 100% !important;
    transition: all 0.3s ease !important;
}

.tesseract-modal .modal-content .form-control:focus {
    border-color: var(--nebula-blue) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
    background: var(--surface-input) !important;
    color: var(--text-primary) !important;
    outline: none !important;
}

.tesseract-modal .modal-content .form-control::placeholder { color: var(--text-faint) !important; }

.tesseract-modal .modal-content .form-label {
    color: var(--text-secondary) !important;
    font-weight: 500 !important;
    font-size: 13px !important;
}

.modal-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 15px;
}

.modal-icon.success { background: rgba(22, 163, 74, 0.12); color: var(--success-green); border: 2px solid rgba(22, 163, 74, 0.2); }
.modal-icon.error   { background: rgba(220, 38, 38, 0.12); color: var(--danger-red);   border: 2px solid rgba(220, 38, 38, 0.2); }
.modal-icon.warning { background: rgba(180, 83, 9, 0.12);  color: var(--warning-gold); border: 2px solid rgba(180, 83, 9, 0.2); }
.modal-icon.info    { background: rgba(37, 99, 235, 0.12); color: var(--nebula-blue);  border: 2px solid rgba(37, 99, 235, 0.2); }

/* ============================================================
   9. BUTTONS
   ============================================================ */
.btn-nebula,
.btn-nebula-outline,
.btn-nebula-warning,
.btn-nebula-danger,
.btn-cosmic,
.btn-danger {
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto !important;
}

.btn-nebula {
    background: var(--nebula-blue);
    color: #ffffff;
    border: none;
    padding: 10px 30px;
}

.btn-nebula:hover {
    background: var(--nebula-blue-dark);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.3);
}

.btn-nebula-outline {
    background: transparent;
    color: var(--nebula-blue);
    border: 2px solid var(--nebula-blue);
    padding: 9px 30px;
}

.btn-nebula-outline:hover {
    background: var(--nebula-blue);
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.2);
}

table .btn-nebula-outline:hover { color: var(--nebula-blue) !important; }
.btn-nebula-outline.text-success:hover { color: var(--nebula-blue) !important; }
.btn-nebula-outline.text-danger:hover  { color: var(--danger-red) !important; }
.btn-nebula-outline.text-warning:hover { color: var(--warning-gold) !important; }

.btn-nebula-warning {
    padding: 10px 30px;
    background: rgba(217, 119, 6, 0.12);
    color: var(--warning-gold);
    border: 1px solid rgba(217, 119, 6, 0.25);
}

.btn-nebula-warning:hover {
    background: rgba(217, 119, 6, 0.2);
    color: var(--warning-gold);
    border-color: rgba(217, 119, 6, 0.4);
    transform: translateY(-2px);
}

.btn-nebula-danger {
    padding: 10px 30px;
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger-red);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.btn-nebula-danger:hover {
    background: rgba(220, 38, 38, 0.2);
    color: var(--danger-red);
    border-color: rgba(220, 38, 38, 0.4);
    transform: translateY(-2px);
}

.btn-cosmic {
    background: var(--cosmic-gold);
    color: #ffffff;
    border: none;
    padding: 10px 30px;
}

.btn-cosmic:hover {
    background: #b8851f;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(201, 150, 47, 0.3);
}

.btn-danger { padding: 10px 30px; }

/* ============================================================
   10. CARDS
   ============================================================ */
.card-tesseract {
    background: var(--surface-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

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

.card-tesseract .card-header {
    background: var(--surface-subtle);
    border-bottom: 1px solid var(--border-light);
    padding: 18px 22px;
    color: var(--text-primary);
    font-weight: 600;
}

.card-tesseract .card-body {
    padding: 22px;
    color: var(--text-secondary);
}

.card-tesseract .card-footer {
    background: var(--surface-subtle);
    border-top: 1px solid var(--border-light);
    padding: 15px 22px;
}

/* Stat cards */
.stat-card-nebula {
    background: var(--surface-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 22px 25px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.stat-card-nebula::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--nebula-blue), var(--cosmic-gold));
    opacity: 0;
    transition: all 0.3s ease;
}

.stat-card-nebula:hover::before { opacity: 1; }

.stat-card-nebula:hover {
    transform: translateY(-4px);
    border-color: var(--border-blue);
    box-shadow: var(--shadow-md);
}

.stat-card-nebula .stat-icon {
    font-size: 32px;
    color: var(--nebula-blue);
    opacity: 0.7;
    margin-bottom: 8px;
}

.stat-card-nebula .stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-card-nebula .stat-label {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-card-nebula .stat-change {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 20px;
}

.stat-card-nebula .stat-change.up   { color: var(--success-green); background: rgba(22, 163, 74, 0.12); }
.stat-card-nebula .stat-change.down { color: var(--danger-red);   background: rgba(220, 38, 38, 0.12); }

/* ============================================================
   11. TABLES
   ============================================================ */
.table-tesseract {
    color: var(--text-primary);
    width: 100%;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface-card);
}

.table-tesseract th,
.table-tesseract td {
    white-space: nowrap;
    vertical-align: middle;
}

.table-tesseract thead th,
.table-tesseract tfoot th,
.table-tesseract tfoot td {
    background: var(--surface-subtle);
    border-bottom: 1px solid var(--border-light);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 1px;
    padding: 14px 18px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table-tesseract tfoot th,
.table-tesseract tfoot td {
    border-top: 1px solid var(--border-light);
    border-bottom: none;
    font-weight: 700;
    color: var(--text-primary);
    position: sticky;
    bottom: 0;
    top: auto;
}

.table-tesseract tbody td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    vertical-align: middle;
    background: var(--surface-card);
    transition: all 0.2s ease;
}

.table-tesseract tbody tr:hover td { background: var(--surface-hover); }

.table-tesseract tbody tr:hover td:first-child {
    border-left: 2px solid var(--nebula-blue);
    padding-left: 16px;
}

.table-tesseract tbody tr:nth-child(even) td { background: var(--surface-subtle); }
.table-tesseract tbody tr:nth-child(even):hover td { background: var(--surface-hover); }
.table-tesseract tbody tr:last-child td { border-bottom: none; }

/* Glow variant */
.table-tesseract-glow {
    color: var(--text-primary);
    width: 100%;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0 4px;
}

.table-tesseract-glow th,
.table-tesseract-glow td {
    white-space: nowrap;
    vertical-align: middle;
}

.table-tesseract-glow thead th,
.table-tesseract-glow tfoot th,
.table-tesseract-glow tfoot td {
    background: transparent;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 1px;
    padding: 12px 18px 8px;
}

.table-tesseract-glow tfoot th,
.table-tesseract-glow tfoot td {
    border-top: 1px solid var(--border-light);
    border-bottom: none;
    font-weight: 700;
    color: var(--text-primary);
    padding-top: 12px;
}

.table-tesseract-glow tbody td {
    padding: 14px 18px;
    background: var(--surface-card);
    border-radius: 8px;
    color: var(--text-primary);
    vertical-align: middle;
    border: none !important;
    transition: all 0.2s ease;
}

.table-tesseract-glow tbody tr:hover td {
    background: var(--surface-hover);
    border-color: var(--border-blue);
    box-shadow: 0 2px 12px rgba(37, 99, 235, 0.08);
}

.table-tesseract-compact thead th,
.table-tesseract-compact tfoot th,
.table-tesseract-compact tfoot td { padding: 10px 14px; font-size: 10px; }
.table-tesseract-compact tbody td         { padding: 10px 14px; font-size: 13px; }

.table-responsive {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    background: var(--surface-card);
}

/* Table action buttons */
.table-tesseract .btn-group {
    display: inline-flex;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.table-tesseract .btn-group .btn {
    background: var(--surface-card);
    border: none;
    color: var(--text-muted);
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 0;
    transition: all 0.2s ease;
}

.table-tesseract .btn-group .btn:hover { background: rgba(37, 99, 235, 0.08); color: var(--nebula-blue); }
.table-tesseract .btn-group .btn.text-danger:hover { background: rgba(220, 38, 38, 0.08); color: var(--danger-red); }
.table-tesseract .btn-group .btn:not(:last-child) { border-right: 1px solid var(--border-light); }

/* Bold total row in invoice/quote footers */
.table-total-row td { border-top: 2px solid var(--border-blue) !important; }

/* ============================================================
   12. DATATABLES
   ============================================================ */
.dataTables_wrapper { padding: 0; width: 100%; }

.dataTables_wrapper .row:first-child {
    padding: 16px 22px 8px;
    margin: 0;
    align-items: center;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
    padding: 0;
}

.dataTables_wrapper .dataTables_filter { justify-content: flex-end; }

.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
}

.dataTables_wrapper .dataTables_length select {
    background-color: var(--surface-input);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 6px 32px 6px 12px;
    color: var(--text-primary);
    font-size: 13px;
    min-width: 70px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.dataTables_wrapper .dataTables_length select:focus {
    border-color: var(--nebula-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

.dataTables_wrapper .dataTables_filter input {
    background: var(--surface-input);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 6px 14px;
    color: var(--text-primary);
    font-size: 13px;
    min-width: 220px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--nebula-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

.dataTables_wrapper .dataTables_filter input::placeholder { color: var(--text-faint); }

.dataTables_wrapper .row:last-child {
    padding: 16px 22px;
    margin: 0;
    align-items: center;
    border-top: 1px solid var(--border-light);
}

.dataTables_wrapper .dataTables_info {
    color: var(--text-muted);
    font-size: 13px;
    padding: 0 !important;
    margin: 0;
    line-height: 36px;
    white-space: nowrap;
}

.dataTables_wrapper .dataTables_paginate {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    padding: 0 !important;
    margin: 0;
    float: none !important;
    text-align: right;
    width: 100%;
}

.dataTables_wrapper .dataTables_paginate ul.pagination,
.dataTables_wrapper .dataTables_paginate .pagination {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    list-style: none;
    flex-wrap: wrap;
}

.dataTables_wrapper .dataTables_paginate .paginate_button,
.dataTables_wrapper .dataTables_paginate .page-link,
.dataTables_wrapper .dataTables_paginate button.paginate_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    background: var(--surface-card);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s ease;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover,
.dataTables_wrapper .dataTables_paginate .page-link:hover {
    background: rgba(37, 99, 235, 0.08);
    border-color: var(--border-blue);
    color: var(--nebula-blue);
    text-decoration: none;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button.active,
.dataTables_wrapper .dataTables_paginate .page-item.active .page-link {
    background: var(--nebula-blue);
    border-color: var(--nebula-blue);
    color: #ffffff;
    font-weight: 600;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button.previous.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.next.disabled {
    background: var(--surface-subtle);
    border-color: var(--border-light);
    color: var(--text-faint);
    cursor: not-allowed;
    opacity: 0.6;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:focus,
.dataTables_wrapper .dataTables_paginate .page-link:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.dataTables_wrapper .dataTables_processing {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    padding: 12px 24px;
}

.dataTables_wrapper .dataTables_empty {
    text-align: center;
    padding: 40px 20px !important;
    color: var(--text-muted);
    font-size: 14px;
}

table.dataTable thead th { position: relative; }

table.dataTable thead .sorting::before,
table.dataTable thead .sorting::after,
table.dataTable thead .sorting_asc::before,
table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::before,
table.dataTable thead .sorting_desc::after {
    opacity: 0.25;
    font-size: 10px;
    line-height: 1;
}

table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::after {
    opacity: 0.9;
    color: var(--nebula-blue);
}

table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control::before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control::before {
    background: var(--nebula-blue);
    border: none;
    box-shadow: none;
    color: #ffffff;
    font-weight: 700;
}

table.dataTable.dtr-inline.collapsed > tbody > tr.parent > td.dtr-control::before,
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > th.dtr-control::before {
    background: var(--nebula-blue-dark);
}

/* ============================================================
   13. FORMS
   ============================================================ */
.form-control,
.form-select {
    background: var(--surface-input);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    background: var(--surface-input);
    color: var(--text-primary);
    border-color: var(--nebula-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control::placeholder { color: var(--text-faint); }

.form-tesseract .form-control,
.form-tesseract .form-select { padding: 12px 16px; }

.form-tesseract .form-label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
}

.form-tesseract .form-text {
    color: var(--text-muted);
    font-size: 12px;
}

.form-tesseract .input-group .input-group-text {
    background: var(--surface-subtle);
    border: 1px solid var(--border-light);
    color: var(--nebula-blue);
    font-size: 18px;
    width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   14. BADGES
   ============================================================ */
.badge-status {
    padding: 4px 14px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.badge-status.success,
.badge-status.live,
.badge-status.active,
.badge-status.paid,
.badge-status.quoted           { background: rgba(22, 163, 74, 0.12); color: var(--success-green); border: 1px solid rgba(22, 163, 74, 0.2); }

.badge-status.development,
.badge-status.warning,
.badge-status.unpaid,
.badge-status.under_review,
.badge-status.submitted        { background: rgba(180, 83, 9, 0.12);  color: var(--warning-gold); border: 1px solid rgba(180, 83, 9, 0.2); }

.badge-status.maintenance,
.badge-status.info,
.badge-status.sent,
.badge-status.pending_verification { background: rgba(37, 99, 235, 0.12); color: var(--nebula-blue); border: 1px solid rgba(37, 99, 235, 0.2); }

.badge-status.overdue,
.badge-status.inactive,
.badge-status.deactivated,
.badge-status.danger,
.badge-status.suspended,
.badge-status.declined,
.badge-status.cancelled        { background: rgba(220, 38, 38, 0.1);  color: var(--danger-red);   border: 1px solid rgba(220, 38, 38, 0.2); }

.badge-status.converted,
.badge-status.accepted         { background: rgba(201, 150, 47, 0.15); color: var(--cosmic-gold);  border: 1px solid rgba(201, 150, 47, 0.25); }

.badge-status.ms-1 { font-size: 10px; }

/* Legacy .badge.bg-dark — reset to a light chip */
.badge.bg-dark {
    background: var(--surface-subtle) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border-light);
}

/* Priority pills */
.priority-low    { background: rgba(22, 163, 74, 0.12) !important; color: var(--success-green) !important; border: 1px solid rgba(22, 163, 74, 0.2) !important; }
.priority-medium { background: rgba(180, 83, 9, 0.12) !important;  color: var(--warning-gold) !important;  border: 1px solid rgba(180, 83, 9, 0.2) !important; }
.priority-high   { background: rgba(220, 38, 38, 0.1) !important;  color: var(--danger-red) !important;    border: 1px solid rgba(220, 38, 38, 0.2) !important; }
.priority-urgent { background: rgba(220, 38, 38, 0.18) !important; color: var(--danger-red) !important;    border: 1px solid rgba(220, 38, 38, 0.35) !important; font-weight: bold; }

.pending_approval {
    background: rgba(37, 99, 235, 0.12) !important;
    color: var(--nebula-blue) !important;
    border: 1px solid rgba(37, 99, 235, 0.2) !important;
}

/* ============================================================
   15. ALERTS
   ============================================================ */
.alert {
    border-radius: 12px;
    border-width: 1px;
}

.alert-info    { background: rgba(37, 99, 235, 0.08); border-color: rgba(37, 99, 235, 0.2); color: var(--nebula-blue-dark); }
.alert-success { background: rgba(22, 163, 74, 0.08); border-color: rgba(22, 163, 74, 0.2); color: #166534; }
.alert-warning { background: rgba(180, 83, 9, 0.08);  border-color: rgba(180, 83, 9, 0.2);  color: #78350f; }
.alert-danger  { background: rgba(220, 38, 38, 0.08); border-color: rgba(220, 38, 38, 0.2); color: #7f1d1d; }

/* ============================================================
   16. NAV PILLS
   ============================================================ */
.nav-pills .nav-link {
    color: var(--text-secondary);
    background: var(--surface-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-pills .nav-link:hover {
    background: rgba(37, 99, 235, 0.08);
    color: var(--nebula-blue);
    border-color: var(--border-blue);
}

.nav-pills .nav-link.active {
    background: var(--nebula-blue);
    color: #ffffff;
    border-color: var(--nebula-blue);
}

/* ============================================================
   17. AUTH PAGES
   ============================================================ */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--primary-dark);
    position: relative;
}

.auth-card {
    background: var(--surface-card-solid);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    padding: 45px 40px;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.8s ease;
}

.auth-card::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 26px;
    background: linear-gradient(135deg, var(--nebula-blue), transparent, var(--cosmic-gold));
    z-index: -1;
    opacity: 0.25;
}

.auth-card .auth-logo { text-align: center; margin-bottom: 30px; }

.auth-card .auth-logo h2 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 6px;
    background: linear-gradient(135deg, var(--nebula-blue) 0%, var(--cosmic-gold) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-card .auth-logo p {
    color: var(--text-muted);
    font-size: 12px;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-top: 5px;
}

.auth-card .auth-logo .logo-divider {
    width: 60px;
    height: 2px;
    margin: 10px auto;
    background: linear-gradient(90deg, transparent, var(--nebula-blue), transparent);
}

.auth-card .form-control {
    background: var(--surface-input);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 14px 18px;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.auth-card .form-control:focus {
    border-color: var(--nebula-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.auth-card .form-control::placeholder { color: var(--text-faint); }

.auth-card .input-group-text {
    background: var(--surface-subtle);
    border: 1px solid var(--border-light);
    border-right: none;
    color: var(--text-muted);
    border-radius: 12px 0 0 12px;
}

.auth-card .input-group .form-control { border-radius: 0 12px 12px 0; }

.auth-card .btn-auth {
    background: linear-gradient(135deg, var(--nebula-blue), var(--nebula-blue-dark));
    color: #ffffff;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
    width: 100%;
    letter-spacing: 2px;
    transition: all 0.3s ease;
}

.auth-card .btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(37, 99, 235, 0.3);
    color: #ffffff;
}

.auth-card .auth-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 12px;
}

.auth-back-link {
    color: rgba(0,0,0,0.3);
    text-decoration: none;
    font-size: 13px;
}

.verify-card {
    max-width: 480px;
}

.verify-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(127,90,240,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 28px;
    color: var(--nebula-blue-light);
}

.verify-text {
    color: rgba(0,0,0,0.4);
    font-size: 14px;
}

.verify-email {
    color: var(--starlight);
}

.verify-hint {
    color: rgba(0,0,0,0.2);
    font-size: 12px;
}

.code-input {
    width: 50px;
    height: 60px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 4px;
}

.verify-actions {
    font-size: 13px;
}

.resend-btn {
    color: var(--nebula-blue-light);
    text-decoration: none;
    padding: 0;
}

.forgot-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(127,90,240,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 24px;
    color: var(--nebula-blue-light);
}

.forgot-text {
    color: rgba(0,0,0,0.4);
    font-size: 14px;
}

.remember-label {
    color: rgba(0,0,0,0.5);
    font-size: 13px;
}

.forgot-link {
    color: var(--nebula-blue-light);
    font-size: 13px;
    text-decoration: none;
}

.auth-link {
    color: var(--nebula-blue-light);
    text-decoration: none;
}

.register-card {
    max-width: 900px !important;
}

.register-divider {
    border-color: rgba(127,90,240,0.1);
}

.register-section-title {
    color: rgba(0,0,0,0.4);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 12px;
}

.terms-label {
    color: rgba(0,0,0,0.4);
    font-size: 13px;
}

/* ============================================================
   18. DASHBOARD / CHART / FILTERS
   ============================================================ */
canvas { max-width: 100%; }

.filter-btn {
    color: var(--text-secondary);
    border-color: var(--border-light);
    background: var(--surface-card);
}

.filter-btn.active {
    background: var(--nebula-blue) !important;
    color: #ffffff !important;
    border-color: var(--nebula-blue) !important;
}

.filter-btn:hover {
    background: rgba(37, 99, 235, 0.08);
    color: var(--nebula-blue);
    border-color: var(--border-blue);
}

/* ============================================================
   19. VIEW HELPERS
   ============================================================ */

/* Section divider + label */
.section-divider { border-top: 1px solid var(--border-light); padding-top: 20px; margin-top: 10px; }

.section-title {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.form-actions { border-top: 1px solid var(--border-light); padding-top: 20px; }

/* Detail view labels */
.detail-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.detail-value     { font-size: 15px; font-weight: 500; color: var(--text-primary); }
.detail-value-lg  { font-size: 20px; font-weight: 700; }

/* Mini stats */
.mini-stat {
    text-align: center;
    padding: 12px;
    background: var(--surface-subtle);
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

.mini-stat-value { font-size: 24px; font-weight: 700; line-height: 1.2; }
.mini-stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Feature list */
.feature-list { padding-left: 20px; margin: 0; color: var(--text-primary); }
.feature-list li { margin-bottom: 4px; }

/* Meta list (key-value rows) */
.meta-list { font-size: 13px; }

.meta-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    color: var(--text-secondary);
}

.meta-row > span:last-child { color: var(--text-primary); font-weight: 500; }

/* Notes / quote panels */
.notes-panel {
    padding: 16px;
    background: var(--surface-subtle);
    border-radius: 12px;
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
}

.quote-link-panel {
    padding: 16px;
    background: rgba(22, 163, 74, 0.08);
    border: 1px solid rgba(22, 163, 74, 0.2);
    border-radius: 12px;
}

/* Summary tiles */
.summary-tile {
    padding: 16px;
    background: var(--surface-subtle);
    border-radius: 12px;
    border: 1px solid var(--border-light);
    text-align: center;
    height: 100%;
}

.summary-tile-label { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.summary-tile-value { font-size: 20px; font-weight: 700; color: var(--text-primary); }

/* Payment entries */
.payment-entry {
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.payment-entry:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.payment-meta { font-size: 11px; color: var(--text-faint); margin-top: 4px; }

/* Column widths for line-item tables */
.col-num    { width: 5%; }
.col-desc   { width: 40%; }
.col-qty    { width: 15%; }
.col-price  { width: 20%; }
.col-action { width: 5%; }
.col-desc-wide { width: 30%; }
.col-site      { width: 15%; }
.col-qty-sm    { width: 10%; }
.col-check     { width: 40px; }
.col-qty       { width: 100px; }
.qty-input     { width: 80px; }

.rfq-item-hint { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

.summary-divider { border-color: var(--border-blue); opacity: 1; }

/* ============================================================
   20. BUNDLE VIEW HELPERS
   ============================================================ */
.bundle-card { position: relative; overflow: hidden; }

.bundle-savings-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(201, 150, 47, 0.15);
    color: var(--cosmic-gold);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(201, 150, 47, 0.25);
    z-index: 1;
}

.icon-tile {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(37, 99, 235, 0.12);
    color: var(--nebula-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.icon-tile-sm { width: 40px; height: 40px; font-size: 16px; border-radius: 8px; display: inline-flex; }
.icon-tile-success { background: rgba(22, 163, 74, 0.12); color: var(--success-green); }
.icon-tile-danger  { background: rgba(220, 38, 38, 0.12); color: var(--danger-red); }
.icon-tile-warning { background: rgba(180, 83, 9, 0.12);  color: var(--warning-gold); }

.price-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 12px;
}

.price-strip-label { font-size: 11px; color: var(--text-muted); }
.price-strip-value { font-size: 18px; font-weight: 700; }
.price-strip-old   { font-size: 14px; color: var(--text-faint); text-decoration: line-through; }

.price-tile {
    padding: 16px;
    background: var(--surface-subtle);
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border-light);
    height: 100%;
}

.price-tile-highlight { background: rgba(201, 150, 47, 0.06); border-color: rgba(201, 150, 47, 0.2); }
.price-tile-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.price-tile-value { font-size: 28px; font-weight: 700; line-height: 1.2; }
.price-tile-value-strike { font-size: 22px; font-weight: 500; color: var(--text-faint); text-decoration: line-through; }
.price-tile-sub { font-size: 13px; opacity: 0.75; margin-top: 2px; }

.service-tile {
    padding: 12px 16px;
    background: var(--surface-subtle);
    border-radius: 8px;
    border: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.service-tile:hover { border-color: var(--border-blue); background: var(--surface-hover); }

.empty-state { padding: 60px 0; text-align: center; color: var(--text-muted); }
.empty-state > i { color: var(--border-medium); }
.empty-state > h5 { color: var(--text-secondary); }

.cursor-pointer { cursor: pointer; }

/* ============================================================
   21. QUEUE VIEW HELPERS
   ============================================================ */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    color: var(--text-muted);
    transition: background 0.2s ease, transform 0.15s ease;
}

.btn-icon:hover { background: rgba(37, 99, 235, 0.08); transform: scale(1.1); }
.btn-icon.text-danger:hover { background: rgba(220, 38, 38, 0.08); }
.btn-icon:focus { outline: none; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); }

.modal-code-panel {
    background: var(--primary-dark);
    color: #e2e8f0;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    max-height: 400px;
    overflow: auto;
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Fragment Mono', monospace;
}

.queue-info-panel { background: var(--surface-subtle); border-color: var(--border-light); }
.queue-tip { font-size: 12px; color: var(--text-muted); }
.queue-tip strong { color: var(--text-secondary); }
.queue-tip-list { margin: 4px 0 0 20px; padding: 0; list-style: disc; }
.queue-tip-list li { margin-bottom: 2px; }

.queue-command-list {
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.queue-command-list code { padding: 2px 8px; border-radius: 4px; font-size: 11px; }

/* ============================================================
   22. NOTIFICATIONS INDEX
   ============================================================ */
.notification-item-page {
    background: transparent;
    border-color: var(--border-light);
    padding: 15px 20px;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.notification-item-page.unread { background: rgba(37, 99, 235, 0.05); border-left: 3px solid var(--nebula-blue); }
.notification-item-page:hover { background: rgba(37, 99, 235, 0.03); }
.notification-item-page.unread:hover { background: rgba(37, 99, 235, 0.08); }

.notification-page-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    background: rgba(37, 99, 235, 0.12);
    color: var(--nebula-blue);
}

.notification-page-icon.success { background: rgba(22, 163, 74, 0.12); color: var(--success-green); }
.notification-page-icon.danger  { background: rgba(220, 38, 38, 0.12); color: var(--danger-red); }
.notification-page-icon.warning { background: rgba(180, 83, 9, 0.12);  color: var(--warning-gold); }
.notification-page-icon.info    { background: rgba(37, 99, 235, 0.12); color: var(--nebula-blue); }

.notification-new-badge { font-size: 8px; letter-spacing: 0.5px; vertical-align: middle; }
.notification-action-btn { font-size: 12px; padding: 4px 12px; }

/* ============================================================
   23. PROFILE VIEWS
   ============================================================ */
.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--nebula-blue), var(--nebula-blue-light));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 36px;
    font-weight: 700;
    color: #ffffff;
}

.profile-meta { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-light); }

.profile-meta-row { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.profile-meta-row:last-child { margin-bottom: 0; }

.info-tile {
    padding: 12px 16px;
    background: rgba(37, 99, 235, 0.05);
    border-radius: 8px;
    border: 1px solid var(--border-light);
    height: 100%;
}

.info-tile-label { font-size: 12px; color: var(--text-muted); }
.info-tile-value { font-weight: 500; color: var(--text-primary); margin-top: 2px; }
.info-tile-hint  { font-size: 11px; color: var(--text-faint); margin-top: 2px; }

.password-requirements { text-align: center; margin-bottom: 24px; }

.password-requirements-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 28px;
    color: var(--nebula-blue);
}

.password-requirements-title { color: var(--text-secondary); margin-bottom: 8px; }

.password-requirements-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

.password-requirements-list li { margin-bottom: 4px; }

.password-strength-meter { margin-top: 8px; }

.strength-bar {
    background: rgba(15, 23, 42, 0.06);
    border-radius: 4px;
    height: 4px;
    overflow: hidden;
}

.strength-bar-fill { height: 100%; border-radius: 4px; transition: width 0.3s ease; }
.strength-label { font-size: 12px; margin-top: 4px; }

.security-tip { display: flex; align-items: flex-start; gap: 12px; }
.security-tip-icon { color: var(--warning-gold); font-size: 20px; flex-shrink: 0; }
.security-tip-title { color: var(--text-secondary); margin-bottom: 4px; }

.security-tip-list {
    font-size: 13px;
    color: var(--text-muted);
    padding-left: 20px;
    margin: 0;
}

.session-row,
.security-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
}

.session-row:last-child,
.security-row:last-child,
.security-row-last { border-bottom: none; }

.session-info { display: flex; align-items: center; gap: 12px; }
.session-icon { color: var(--text-faint); font-size: 18px; }
.session-device { font-weight: 500; font-size: 14px; color: var(--text-primary); }
.session-badge { font-size: 10px; margin-left: 8px; }
.session-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.session-divider { margin: 0 6px; }
.security-row-title { font-weight: 500; font-size: 14px; color: var(--text-primary); }
.security-row-hint { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ============================================================
   24. SUPPORT TICKET VIEWS
   ============================================================ */
.reply-bubble {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow-wrap: break-word;
}

.reply-internal { background: rgba(37, 99, 235, 0.08); border-left: 3px solid var(--nebula-blue); }
.reply-admin    { background: rgba(22, 163, 74, 0.05); border-left: 3px solid var(--success-green); }
.reply-client   { background: var(--surface-subtle);   border-left: 3px solid var(--nebula-blue-light); }

.reply-message { color: var(--text-primary); overflow-wrap: break-word; }
.text-wrap-anywhere { overflow-wrap: anywhere; word-break: break-word; }

/* ============================================================
   25. ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.animate-fade-in-up { animation: fadeInUp 0.6s ease forwards; }

.animate-fade-in-up-delay-1 {
    animation: fadeInUp 0.6s ease forwards;
    animation-delay: 0.1s;
    opacity: 0;
}

.animate-fade-in-up-delay-2 {
    animation: fadeInUp 0.6s ease forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

.animate-fade-in-up-delay-3 {
    animation: fadeInUp 0.6s ease forwards;
    animation-delay: 0.3s;
    opacity: 0;
}

/* Spinner */
.spinner-nebula {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid rgba(37, 99, 235, 0.15);
    border-top-color: var(--nebula-blue);
    animation: spin 0.8s linear infinite;
}

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

/* ============================================================
   26. RESPONSIVE
   ============================================================ */
@media (min-width: 993px) {
    .sidebar-overlay { display: none !important; }
}

@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        width: 280px;
        height: 100vh;
        z-index: 1000;
        box-shadow: var(--shadow-lg);
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .sidebar.open { left: 0; }
    .sidebar.open ~ .sidebar-overlay { display: block; }

    .topbar { left: 0; padding: 0 20px; }

    .main-content {
        margin-left: 0;
        padding: 20px 20px calc(var(--footer-height) + 20px) 20px;
    }

    .footer {
        left: 0;
        flex-direction: column;
        justify-content: center;
        height: auto;
        padding: 10px 20px;
        gap: 5px;
    }

    .sidebar-toggle { display: block; }
    .topbar-left .page-title small { display: none; }
}

@media (max-width: 767px) {
    .dataTables_wrapper .row:last-child > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
        text-align: center;
    }

    .dataTables_wrapper .dataTables_info {
        text-align: center;
        line-height: 1.6;
        margin-bottom: 8px;
    }

    .dataTables_wrapper .dataTables_paginate { justify-content: center; }
    .dataTables_wrapper .dataTables_paginate ul.pagination,
    .dataTables_wrapper .dataTables_paginate .pagination { justify-content: center; }

    .dataTables_wrapper .dataTables_filter { justify-content: flex-start; margin-top: 8px; }
    .dataTables_wrapper .dataTables_filter input { min-width: 100%; }

    .queue-command-list { justify-content: flex-start; }
}

@media (max-width: 576px) {
    .topbar { padding: 0 15px; }
    .topbar-left .page-title { font-size: 15px; }

    .main-content { padding: 15px 15px calc(var(--footer-height) + 15px) 15px; }

    .stat-card-nebula .stat-number { font-size: 24px; }

    .user-profile .dropdown-menu { right: -10px; min-width: 200px; }
    .notification-dropdown { right: -180px; width: 340px; }
}

/* ============================================================
   27. PRINT
   ============================================================ */

/* Print header — invisible on screen */
.print-only { display: none; }

.print-header { margin-bottom: 12px; }

.print-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--nebula-blue);
    margin-bottom: 12px;
}

.print-header-brand { display: flex; align-items: center; gap: 12px; }
.print-logo { width: 48px; height: 48px; object-fit: contain; }

.print-brand-name {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 4px;
    color: var(--nebula-blue);
    line-height: 1;
}

.print-brand-sub {
    font-size: 10px;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--cosmic-gold);
    margin-top: 2px;
}

.print-header-doc {
    text-align: right;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-primary);
    line-height: 1.1;
}

.print-header-doc-number {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--text-secondary);
    margin-top: 4px;
}

.print-header-meta {
    display: flex;
    justify-content: space-between;
    gap: 32px;
    font-size: 12px;
    color: var(--text-primary);
    margin-bottom: 0;
}

.print-meta-block { flex: 1; }

.print-meta-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.print-meta-value { line-height: 1.6; }

@media print {
    @page {
        size: A4 landscape;
        margin: 12mm 10mm;
    }

    /* Force print header visible */
    .print-only { display: block !important; }

    /* Hide chrome */
    .sidebar,
    .topbar,
    .footer,
    .card-footer,
    .btn-group,
    .btn,
    .no-print { display: none !important; }

    .stars-bg,
    .shooting-star { display: none !important; }

    /* Page shell reset */
    body {
        background: #ffffff !important;
        color: var(--text-primary) !important;
    }

    .main-content {
        margin: 0 !important;
        padding: 10px !important;
        background: #ffffff !important;
    }

    /* Print header spacing */
    .print-header { margin-bottom: 12px !important; }
    .print-header-top { padding-bottom: 12px !important; margin-bottom: 12px !important; }
    .print-header-meta { margin-bottom: 0 !important; }

    /* Collapse the flex row into a single column stack */
    .quote-print-area .row,
    .invoice-print-area .row {
        display: block !important;
        margin: 0 !important;
        --bs-gutter-x: 0;
        --bs-gutter-y: 0;
    }

    .quote-print-area [class*="col-"],
    .invoice-print-area [class*="col-"] {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }

    .quote-print-area .col-lg-4 > .card-tesseract:first-child,
    .invoice-print-area .col-lg-4 > .card-tesseract:first-child {
        margin-top: 16px !important;
    }

    /* Cards become solid white for print */
    .card-tesseract {
        background: #ffffff !important;
        border: 1px solid #dddddd !important;
        box-shadow: none !important;
        margin-bottom: 0 !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    .card-tesseract .card-header {
        background: #f8f9fa !important;
        color: #333333 !important;
        border-bottom: 1px solid #dddddd !important;
    }

    .card-tesseract .card-body { color: #333333 !important; }

    /* Tables */
    .table-tesseract,
    .table-tesseract-glow { color: #333333 !important; }

    .table-tesseract thead th,
    .table-tesseract-glow thead th {
        color: #555555 !important;
        background: #f8f9fa !important;
        border-bottom-color: #dddddd !important;
    }

    .table-tesseract tbody td,
    .table-tesseract-glow tbody td {
        color: #333333 !important;
        background: #ffffff !important;
        border-bottom-color: #eeeeee !important;
    }

    .table-tesseract tbody tr,
    .table-tesseract-glow tbody tr { page-break-inside: avoid; }

    /* Badges and text accents */
    .badge-status { border: 1px solid #dddddd !important; }

    .text-glow,
    .text-glow-purple {
        color: #333333 !important;
        text-shadow: none !important;
    }

    .quote-print-area,
    .invoice-print-area { margin: 0 !important; padding: 0 !important; }
}

/* ============================================================
   28. UTILITY
   ============================================================ */
.border-nebula { border-color: var(--border-blue) !important; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }

/* ============================================================
   29. DASHBOARD — stat sub-text, view-all links, list items
   ============================================================ */

/* Small sub-text under a stat number (e.g. "3 active · 1 suspended") */
.stat-subtext {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.4;
}

/* "View All →" link in card headers */
.view-all-link {
    color: var(--nebula-blue);
    font-size: 13px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.view-all-link:hover {
    color: var(--nebula-blue-dark);
    text-decoration: underline;
}

.view-all-link i {
    font-size: 11px;
}

/* Card body list rows (Recent Clients, Pending Payments, Recent Sites) */
.dashboard-list-item {
    background: transparent;
    border-color: var(--border-light);
    padding: 12px 22px;
}

.dashboard-list-item:last-child {
    border-bottom: none;
}

.dashboard-item-title {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.dashboard-item-subtext {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Chart container — replaces the inline height: 250px */
.chart-container {
    position: relative;
    height: 250px;
}

/* Chart empty state (replaces the JS-injected inline styles) */
.chart-empty-state {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
}

.chart-empty-state i {
    color: var(--border-medium);
}

/* ============================================================
   30. AUTH PAGE EXTRAS
   ============================================================ */
.auth-back-link {
    color: var(--starlight-faint);
    text-decoration: none;
    font-size: 13px;
}

.auth-back-link:hover { color: var(--nebula-blue-light); }

.verify-card { max-width: 480px; }

.verify-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 28px;
    color: var(--nebula-blue-light);
}

.verify-text { color: var(--text-muted); font-size: 14px; }
.verify-email { color: var(--text-primary); }
.verify-hint { color: var(--text-faint); font-size: 12px; }

.code-input {
    width: 50px;
    height: 60px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 4px;
}

.verify-actions { font-size: 13px; }

.resend-btn {
    color: var(--nebula-blue);
    text-decoration: none;
    padding: 0;
    font-size: 13px;
}

.resend-btn:hover { color: var(--nebula-blue-dark); }

.forgot-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 24px;
    color: var(--nebula-blue-light);
}

.forgot-text { color: var(--text-muted); font-size: 14px; }

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

.forgot-link {
    color: var(--nebula-blue);
    font-size: 13px;
    text-decoration: none;
}

.forgot-link:hover { color: var(--nebula-blue-dark); }

.auth-link {
    color: var(--nebula-blue);
    text-decoration: none;
}

.auth-link:hover { color: var(--nebula-blue-dark); }

.register-card { max-width: 900px !important; }

.register-divider { border-color: var(--border-light); }

.register-section-title {
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 12px;
}

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

.toggle-password {
    background: var(--surface-subtle) !important;
    border: 1px solid var(--border-light) !important;
    color: var(--text-muted) !important;
    border-radius: 0 12px 12px 0 !important;
}

.toggle-password:hover {
    background: var(--surface-hover) !important;
    color: var(--nebula-blue) !important;
}

/* ============================================================
   31. CLIENT PORTAL — Detail & Meta Text Helpers
   ============================================================ */
.detail-value-secondary {
    color: var(--text-secondary);
    font-size: 14px;
}

.detail-value-sm { font-size: 13px; }

.detail-label-inline {
    color: var(--text-muted);
    font-size: 13px;
}

.card-body-padded { padding: 30px; }

.empty-state-sm { padding: 30px 0; }
.empty-state-sm > h5 { font-size: 16px; }
.empty-state-sm > p { font-size: 13px; }

.empty-state-icon { color: var(--border-medium); }

.summary-divider {
    border-color: var(--border-light);
    opacity: 1;
}

/* ============================================================
   32. ANNOUNCEMENTS
   ============================================================ */
.announcement-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 18px;
}

.announcement-content {
    color: var(--text-primary);
    line-height: 1.8;
    font-size: 15px;
    overflow-wrap: break-word;
}

.announcement-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.announcement-meta-value {
    color: var(--text-secondary);
    font-size: 13px;
}

.announcement-date {
    color: var(--text-faint);
    font-size: 11px;
    display: block;
}

.announcement-date-ago {
    color: var(--text-faint);
    font-size: 10px;
    display: block;
    margin-top: 2px;
    opacity: 0.7;
}

.announcement-footer {
    margin-top: 30px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.announcement-footer-meta {
    color: var(--text-faint);
    font-size: 12px;
}

.badge-status-announcement {
    font-size: 9px;
    padding: 2px 10px;
    text-transform: uppercase;
}

/* ============================================================
   33. CATALOG VIEWS
   ============================================================ */
.catalog-item-title {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
}

.catalog-item-desc {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 12px;
}

.catalog-price-strip {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.catalog-price-strip-grow { flex-grow: 1; }

.catalog-price-label {
    font-size: 11px;
    color: var(--text-faint);
}

.catalog-price-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--success-green);
}

.catalog-price-period {
    font-size: 11px;
    color: var(--text-muted);
}

.catalog-price-sub {
    font-size: 14px;
    color: var(--text-muted);
}

.catalog-price-strike {
    font-size: 14px;
    color: var(--text-faint);
    text-decoration: line-through;
}

.catalog-feature-list {
    font-size: 13px;
    color: var(--text-secondary);
}

.catalog-bundle-services {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.badge-status-sm {
    font-size: 10px;
    padding: 2px 8px;
}

/* ============================================================
   34. RFQ PROGRESS / SITE HERO / TICKET EXTRAS
   ============================================================ */
.rfq-progress-step { margin-bottom: 16px; }

.rfq-progress-step:last-child { margin-bottom: 0; }

.rfq-progress-label {
    margin-left: 8px;
    font-size: 13px;
    color: var(--text-primary);
}

.rfq-progress-time {
    color: var(--text-faint);
    font-size: 11px;
    margin-left: 40px;
}

.site-hero-icon {
    font-size: 48px;
    color: var(--nebula-blue-light);
}

.ticket-info-row { font-size: 13px; }

.reply-meta {
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 5px;
}

.reply-meta-time {
    color: var(--text-faint);
    font-size: 12px;
    margin-left: 8px;
}

.badge-admin { background: var(--success-green); color: #ffffff; }
.badge-client { background: var(--nebula-blue); color: #ffffff; }

.stat-subtext.success { color: var(--success-green); }
.stat-subtext.danger  { color: var(--danger-red); }

/* ============================================================
   35. LEGAL PAGES (Privacy Policy, Terms of Service)
   ============================================================ */

/* ---- Container / Card overrides ---- */
.auth-container-legal {
    padding: 60px 20px;
}

.auth-card-legal {
    max-width: 1600px;
    padding: 50px 55px;
}

.auth-logo-title-lg {
    font-size: 32px;
}

.auth-logo-sub-lg {
    font-size: 14px;
    letter-spacing: 8px;
}

/* ---- Meta line (Effective Date / Version) ---- */
.legal-meta {
    text-align: center;
    margin-bottom: 30px;
}

.legal-meta-text {
    font-size: 13px;
    color: var(--text-faint);
}

/* ---- Main content wrapper ---- */
.legal-content {
    font-size: 14px;
    line-height: 1.9;
    color: var(--text-secondary);
}

/* ---- Callout (Introduction / Preliminary) ---- */
.legal-callout {
    background: rgba(37, 99, 235, 0.05);
    border-left: 3px solid var(--nebula-blue);
    padding: 18px 24px;
    margin-bottom: 30px;
    border-radius: 0 8px 8px 0;
}

.legal-callout-lead {
    margin: 0;
    color: var(--text-secondary);
}

.legal-callout-title {
    color: var(--text-primary);
    font-size: 15px;
}

.legal-callout-note {
    margin: 12px 0 0 0;
    font-size: 13px;
    color: var(--text-muted);
}

.legal-callout-note-faint {
    margin: 8px 0 0 0;
    font-size: 13px;
    color: var(--text-faint);
}

/* ---- Section heading (h5) ---- */
.legal-section-heading {
    color: var(--nebula-blue);
    font-weight: 700;
    margin-top: 30px;
    margin-bottom: 14px;
    font-size: 18px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 8px;
}

/* ---- Subheading (h6) ---- */
.legal-subheading {
    color: var(--text-secondary);
    font-weight: 600;
    margin-top: 16px;
    margin-bottom: 6px;
    font-size: 14px;
}

/* ---- Paragraphs ---- */
.legal-paragraph {
    font-size: 13.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
    padding-left: 20px;
}

.legal-paragraph-faint {
    font-size: 13.5px;
    color: var(--text-faint);
    margin-bottom: 8px;
    padding-left: 20px;
}

/* ---- Lists ---- */
.legal-list {
    padding-left: 40px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.legal-list li {
    margin-bottom: 4px;
}

/* ---- Bold text inside legal content ---- */
.legal-strong {
    color: var(--text-secondary);
}

/* ---- Contact block (Privacy Policy) ---- */
.legal-contact-block {
    padding-left: 20px;
    margin-bottom: 8px;
}

.legal-contact-tile {
    background: var(--surface-subtle);
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 4px;
    border: 1px solid var(--border-light);
}

.legal-contact-tile:last-child {
    margin-bottom: 0;
}

.legal-contact-text {
    font-size: 13px;
    color: var(--text-muted);
}

/* ---- Domain fee tiles (Terms of Service) ---- */
.legal-fee-block {
    padding-left: 20px;
    margin-bottom: 8px;
}

.legal-fee-tile {
    background: var(--surface-subtle);
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 6px;
    border: 1px solid var(--border-light);
}

.legal-fee-tile:last-child {
    margin-bottom: 0;
}

.legal-fee-row {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px;
}

.legal-fee-primary {
    font-size: 13px;
    color: var(--text-muted);
}

.legal-fee-secondary {
    font-size: 12px;
    color: var(--text-faint);
}

/* ---- Update note ---- */
.legal-update-note {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

.legal-update-text {
    font-size: 13px;
    color: var(--text-faint);
    margin-bottom: 4px;
}

/* ---- Acknowledgment box ---- */
.legal-acknowledgment {
    margin-top: 20px;
    padding: 15px 20px;
    background: rgba(37, 99, 235, 0.05);
    border-radius: 8px;
    border: 1px solid var(--border-light);
    text-align: center;
}

.legal-acknowledgment-emphasized {
    margin-top: 35px;
    padding: 20px 24px;
}

.legal-acknowledgment-header {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.legal-acknowledgment-text {
    font-size: 13px;
    color: var(--text-faint);
    margin-bottom: 0;
}

.legal-acknowledgment-signature {
    font-size: 12px;
    color: var(--text-faint);
    margin-top: 8px;
    opacity: 0.7;
}

/* ---- Footer links ---- */
.legal-footer-links {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.legal-footer-link {
    color: var(--text-faint);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s ease;
}

.legal-footer-link:hover {
    color: var(--nebula-blue);
}

/* ---- Responsive ---- */
@media (max-width: 576px) {
    .auth-card-legal {
        padding: 30px 20px;
    }

    .auth-logo-title-lg {
        font-size: 24px;
    }

    .auth-logo-sub-lg {
        letter-spacing: 4px;
    }

    .legal-callout {
        padding: 14px 16px;
    }

    .legal-paragraph,
    .legal-paragraph-faint {
        padding-left: 0;
    }

    .legal-list {
        padding-left: 20px;
    }

    .legal-contact-block,
    .legal-fee-block {
        padding-left: 0;
    }

    .legal-fee-row {
        flex-direction: column;
        gap: 2px;
    }
}