/* ============================================================
   Marriage Bureau Management System v25 — Master Stylesheet
   Premium Day/Night Theme System with CSS Custom Properties
   Default: Dark Mode | Toggle: localStorage persisted
   ============================================================ */

/* ============================================================
   CSS CUSTOM PROPERTIES
   Premium Light Theme = Default (:root)
   Dark Theme = html.dark
   ============================================================ */
:root {
    /* --- Theme Colors (overridden by PHP inline for theme variants) --- */
    --theme-primary: #ef4444;
    --theme-accent: #f43f5e;
    --theme-active-bg: linear-gradient(135deg, #ef4444, #f43f5e);
    --font-size-base: 14px;

    /* --- Semantic Color Tokens --- */
    --c-bg: #F8FAFC;
    --c-bg-alt: #F1F5F9;
    --c-card: #FFFFFF;
    --c-card-hover: #F8FAFC;
    --c-input: #FFFFFF;
    --c-muted: #F1F5F9;
    --c-text: #0F172A;
    --c-text-2: #1E293B;
    --c-text-3: #334155;
    --c-text-4: #64748B;
    --c-border: #E2E8F0;
    --c-border-light: #F1F5F9;
    --c-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    --c-shadow-lg: 0 4px 12px rgba(15, 23, 42, 0.08);
    --c-sidebar-bg: #FFFFFF;
    --c-sidebar-text: #1E293B;
    --c-sidebar-hover: #F1F5F9;
    --c-sidebar-border: #E2E8F0;
    --c-danger-bg: #FEF2F2;
    --c-danger-text: #DC2626;
    --c-success-bg: #F0FDF4;
    --c-warning-bg: #FFFBEB;
}

html.dark {
    --c-bg: #030712;
    --c-bg-alt: #111827;
    --c-card: #1F2937;
    --c-card-hover: #283548;
    --c-input: #1F2937;
    --c-muted: #111827;
    --c-text: #F9FAFB;
    --c-text-2: #D1D5DB;
    --c-text-3: #9CA3AF;
    --c-text-4: #6B7280;
    --c-border: #374151;
    --c-border-light: #1F2937;
    --c-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    --c-shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.3);
    --c-danger-bg: #450A0A;
    --c-danger-text: #FCA5A5;
    --c-success-bg: #052E16;
    --c-warning-bg: #451A03;
}

/* ============================================================
   SMOOTH THEME TRANSITIONS
   ============================================================ */
body, .card, .stat-card, .btn, .btn-primary, .btn-secondary, .btn-danger,
.input, .select, .label, .badge, .sidebar, .sidebar-link,
.profile-card, .profile-card-body, .profile-card-info, .profile-card-photo,
.profile-card-name, .profile-card-age, .profile-card-location,
.profile-card-detail, .profile-card-detail-label,
.profile-card-badges, .profile-card-actions, .tab-btn,
.photo-upload-zone, .photo-item, .priority-badge,
.progress-bar, .match-check, .toast,
html:not(.dark) .sidebar .theme-toggle,
html.dark .sidebar .theme-toggle {
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.2s ease, box-shadow 0.25s ease;
}

/* ============================================================
   BASE
   ============================================================ */
body {
    font-size: var(--font-size-base);
    background-color: var(--c-bg);
    color: var(--c-text);
    min-height: 100vh;
}

/* ============================================================
   THEME TOGGLE BUTTON — Premium pill button
   ============================================================ */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.625rem;
    border: 1px solid var(--c-border);
    background: var(--c-card);
    color: var(--c-text-2);
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}
.theme-toggle:hover {
    background: var(--c-muted);
    border-color: var(--c-text-4);
    transform: scale(1.05);
}
.theme-toggle:active {
    transform: scale(0.95);
}
.theme-toggle svg {
    width: 1.125rem;
    height: 1.125rem;
    position: absolute;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.theme-toggle .icon-sun {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}
.theme-toggle .icon-moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}
/* In dark mode: show sun icon (to switch to light) */
html.dark .theme-toggle .icon-sun {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}
html.dark .theme-toggle .icon-moon {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}
html.dark .theme-toggle {
    color: #FCD34D;
    border-color: rgba(252, 211, 77, 0.3);
    background: rgba(252, 211, 77, 0.1);
}
html.dark .theme-toggle:hover {
    background: rgba(252, 211, 77, 0.2);
    border-color: rgba(252, 211, 77, 0.5);
}

/* Sidebar theme toggle — always on dark sidebar background */
.sidebar .theme-toggle {
    background: rgba(255, 255, 255, 0.08) !important;
    color: rgba(255, 255, 255, 0.7) !important;
    border: none !important;
}
.sidebar .theme-toggle:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #FCD34D !important;
}
html.dark .sidebar .theme-toggle:hover {
    background: rgba(252, 211, 77, 0.15) !important;
    color: #FCD34D !important;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
/* Light mode sidebar */
.sidebar {
    background: var(--c-sidebar-bg) !important;
    border-right: 1px solid var(--c-sidebar-border);
}
.sidebar .sidebar-link {
    color: var(--c-sidebar-text);
}
.sidebar .sidebar-link:hover {
    background: var(--c-sidebar-hover);
    color: var(--c-text);
}
.sidebar .sidebar-link.active {
    color: white;
}
.sidebar p,
.sidebar span,
.sidebar h1 {
    color: var(--c-sidebar-text);
}
.sidebar h1 {
    color: var(--c-text);
}
.sidebar .text-gray-400,
.sidebar .text-gray-300 {
    color: var(--c-text-4) !important;
}
.sidebar .text-gray-300 {
    color: var(--c-text-3) !important;
}
/* Sidebar toggle in light mode — dark bg needed */
html:not(.dark) .sidebar .theme-toggle {
    background: rgba(0, 0, 0, 0.06) !important;
    color: var(--c-text-3) !important;
    border: 1px solid var(--c-border) !important;
}
html:not(.dark) .sidebar .theme-toggle:hover {
    background: rgba(0, 0, 0, 0.1) !important;
    color: var(--c-text) !important;
}

/* Dark mode sidebar override */
html.dark .sidebar {
    background: var(--theme-sidebar) !important;
    border-right: none;
}
html.dark .sidebar .sidebar-link {
    color: rgba(255, 255, 255, 0.7);
}
html.dark .sidebar .sidebar-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}
html.dark .sidebar .sidebar-link.active {
    background: var(--theme-active-bg);
    color: white;
}
html.dark .sidebar p,
html.dark .sidebar span,
html.dark .sidebar h1 {
    color: rgba(255, 255, 255, 0.7);
}
html.dark .sidebar h1 {
    color: white;
}
html.dark .sidebar .text-gray-400,
html.dark .sidebar .text-gray-300 {
    color: rgba(255, 255, 255, 0.4) !important;
}
html.dark .sidebar .border-white\/10 {
    border-color: rgba(255, 255, 255, 0.1) !important;
}
html.dark .sidebar .border-t {
    border-color: rgba(255, 255, 255, 0.1) !important;
}
html.dark .sidebar .text-gray-400\.hover\:text-red-400:hover {
    color: #f87171 !important;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--c-card);
    border-radius: 0.75rem;
    border: 1px solid var(--c-border);
    box-shadow: var(--c-shadow);
}
.card:hover {
    box-shadow: var(--c-shadow-lg);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
}
.btn-primary {
    background: var(--theme-active-bg);
    color: white;
}
.btn-primary:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}
.btn-secondary {
    background: var(--c-muted);
    color: var(--c-text-2);
    border: 1px solid var(--c-border);
}
.btn-secondary:hover {
    background: var(--c-border);
    color: var(--c-text);
}
.btn-danger {
    background: var(--c-danger-bg);
    color: var(--c-danger-text);
}
.btn-danger:hover {
    filter: brightness(0.95);
}

/* ============================================================
   FORM INPUTS
   ============================================================ */
.input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--c-border);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    outline: none;
    background: var(--c-input);
    color: var(--c-text);
}
.input:focus {
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.133);
}
html.dark .input:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}
html.dark .input::placeholder {
    color: var(--c-text-4);
}

.select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--c-border);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background: var(--c-input);
    color: var(--c-text);
    outline: none;
    cursor: pointer;
}
.select:focus {
    border-color: var(--theme-primary);
}

.label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--c-text-2);
    margin-bottom: 0.25rem;
}

/* ============================================================
   BADGE
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-card {
    position: relative;
    overflow: hidden;
    border-radius: 0.75rem;
    background: var(--c-card);
    border: 1px solid var(--c-border);
    padding: 1.25rem;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideDown 0.3s ease;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   TABLES
   ============================================================ */
.table-row:hover {
    background: var(--c-muted);
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar {
    height: 6px;
    border-radius: 3px;
    background: var(--c-border);
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s;
}

/* ============================================================
   MATCH CHECK
   ============================================================ */
.match-check {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}
.match-check.yes {
    background: #dcfce7;
    color: #16a34a;
}
.match-check.no {
    background: #fee2e2;
    color: #dc2626;
}
html.dark .match-check.yes {
    background: #052E16;
    color: #4ADE80;
}
html.dark .match-check.no {
    background: #450A0A;
    color: #FCA5A5;
}

/* ============================================================
   PHOTO GALLERY
   ============================================================ */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
}
.photo-item {
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 2px solid var(--c-border);
    cursor: grab;
}
.photo-item:hover {
    border-color: var(--theme-primary);
    box-shadow: var(--c-shadow-lg);
}
.photo-item.primary {
    border-color: var(--theme-primary);
    border-width: 3px;
}
.photo-item img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    display: block;
}
.photo-item .photo-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 50%, rgba(0, 0, 0, 0.6));
    opacity: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0.5rem;
}
.photo-item:hover .photo-overlay {
    opacity: 1;
}
.photo-item .photo-actions {
    display: flex;
    gap: 0.25rem;
}
.photo-item .photo-action-btn {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: var(--c-text-2);
}
.photo-item .photo-action-btn:hover {
    background: var(--theme-primary);
    color: white;
}
.photo-item .photo-action-btn.delete-btn:hover {
    background: #dc2626;
}
.photo-item .photo-badge {
    position: absolute;
    top: 0.375rem;
    left: 0.375rem;
    background: var(--theme-primary);
    color: white;
    font-size: 0.6rem;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-weight: 600;
}

/* ============================================================
   PHOTO UPLOAD ZONE
   ============================================================ */
.photo-upload-zone {
    border: 2px dashed var(--c-border);
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    background: var(--c-muted);
}
.photo-upload-zone:hover,
.photo-upload-zone.dragover {
    border-color: var(--theme-primary);
}
.photo-upload-zone.dragover {
    transform: scale(1.01);
}
.photo-upload-zone i {
    font-size: 2rem;
    color: var(--c-text-4);
    margin-bottom: 0.5rem;
}

/* ============================================================
   PRIORITY BADGE & CARD
   ============================================================ */
.priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
    text-transform: uppercase;
}
html.dark .priority-badge {
    background: #451a03;
    color: #fed7aa;
    border-color: #92400e;
}
.priority-card {
    border-left: 3px solid #f59e0b !important;
}
.priority-card:hover {
    border-left-color: #d97706 !important;
}

/* ============================================================
   PROFILE CARDS GRID — Guaranteed 2-column layout
   ============================================================ */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.profile-card {
    background: var(--c-card);
    border-radius: 0.75rem;
    border: 1px solid var(--c-border);
    box-shadow: var(--c-shadow);
    overflow: hidden;
}
.profile-card:hover {
    box-shadow: var(--c-shadow-lg);
}

.profile-card-body {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    padding: 1rem;
}

.profile-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.profile-card-photo {
    width: 140px;
    min-width: 140px;
    height: 170px;
    border-radius: 0.75rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--c-muted);
    flex-shrink: 0;
}
.profile-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.profile-card-photo svg {
    opacity: 0.4;
}

.profile-card-meta {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.5rem;
}
.profile-card-avatar {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--c-border);
}
.profile-card-avatar-fallback {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}
.profile-card-meta-badges {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.profile-card-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--c-text);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0;
}

.profile-card-age {
    font-size: 0.875rem;
    color: var(--c-text-2);
    margin-top: 0.125rem;
}

.profile-card-location {
    font-size: 0.75rem;
    color: var(--c-text-3);
    margin-top: 0.125rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.profile-card-location svg {
    flex-shrink: 0;
}

.profile-card-details {
    margin-top: 0.625rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.profile-card-detail {
    font-size: 0.75rem;
    color: var(--c-text-2);
    line-height: 1.4;
}
.profile-card-detail-label {
    color: var(--c-text-4);
}

.profile-card-badges {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--c-border-light);
    margin-top: 0.75rem;
}
.profile-card-badges-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.profile-card-badges-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.profile-card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem 1rem;
}
.profile-card-actions .btn {
    flex: 1;
    font-size: 0.75rem;
    padding: 0.375rem 0.625rem;
}

/* Mobile: stack vertically */
@media (max-width: 639px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
    .profile-card-body {
        flex-direction: column-reverse;
    }
    .profile-card-photo {
        width: 100%;
        min-width: unset;
        height: 200px;
    }
}

/* ============================================================
   TAB BUTTON (profile_view)
   ============================================================ */
.tab-btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    background: transparent;
    color: var(--c-text-3);
    cursor: pointer;
    white-space: nowrap;
}
.tab-btn:hover {
    background: var(--c-muted);
    color: var(--c-text);
}
.tab-btn.active {
    background: var(--theme-primary);
    color: white;
    border-color: transparent;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
#thumbnailStrip {
    scrollbar-width: thin;
    scrollbar-color: var(--c-border) transparent;
}

/* Lightbox */
#lightbox {
    display: none;
}

/* Mobile Sidebar Toggle */
.mobile-menu-btn {
    display: none;
}

.gallery-section img {
    max-width: 100%;
}

/* ============================================================
   RESPONSIVE — Mobile Sidebar
   ============================================================ */
@media (max-width: 1023px) {
    /* Off-canvas drawer */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 50;
        overflow-y: auto;
        /* Light mode: white sidebar bg (same as desktop) */
        background: #FFFFFF !important;
        border-right: 1px solid #E2E8F0;
    }
    .sidebar.open {
        transform: translateX(0);
    }

    /* Dark mode: solid dark bg (no transparency) */
    html.dark .sidebar {
        background: #111827 !important;
        border-right: none;
    }
    html.dark .sidebar p,
    html.dark .sidebar span,
    html.dark .sidebar h1 {
        color: rgba(255, 255, 255, 0.7);
    }
    html.dark .sidebar h1 {
        color: #ffffff;
    }
    html.dark .sidebar .sidebar-link {
        color: rgba(255, 255, 255, 0.7);
    }
    html.dark .sidebar .sidebar-link:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #ffffff;
    }
    html.dark .sidebar .sidebar-link.active {
        background: var(--theme-active-bg);
        color: #ffffff;
    }
    html.dark .sidebar .text-gray-400,
    html.dark .sidebar .text-gray-300 {
        color: rgba(255, 255, 255, 0.4) !important;
    }
    html.dark .sidebar .border-white\/10 {
        border-color: rgba(255, 255, 255, 0.1) !important;
    }
    html.dark .sidebar .border-t {
        border-color: rgba(255, 255, 255, 0.1) !important;
    }

    /* Backdrop overlay */
    .mobile-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 40;
    }
    .mobile-overlay.open {
        display: block;
    }

    /* Hamburger button */
    .mobile-menu-btn {
        display: flex;
        background: var(--c-card) !important;
        border-color: var(--c-border) !important;
        color: var(--c-text) !important;
        box-shadow: var(--c-shadow) !important;
    }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
    .sidebar, .mobile-menu-btn, .mobile-overlay, .no-print, .btn,
    .toast, .photo-upload-zone, .photo-overlay, .photo-actions,
    #lightbox, .action-buttons, .export-menu-wrap, .print-only-hide,
    .theme-toggle {
        display: none !important;
    }
    main { margin: 0 !important; padding: 10px !important; }
    .card, .profile-card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        page-break-inside: avoid;
        margin-bottom: 10px !important;
        background: white !important;
    }
    body { background: white !important; font-size: 11pt !important; color: #000 !important; }
    .photo-gallery { grid-template-columns: repeat(4, 1fr); }
    .photo-item { border: 1px solid #e5e7eb !important; break-inside: avoid; }
    .gallery-section img { max-width: 200px !important; max-height: 250px !important; }
    .print-only { display: block !important; }
}

/* ============================================================
   DARK THEME — Tailwind utility overrides
   ============================================================ */
html.dark .bg-white {
    background-color: var(--c-card) !important;
}
html.dark .bg-gray-50 {
    background-color: var(--c-bg-alt) !important;
}
html.dark .bg-gray-50\/80 {
    background-color: rgba(17, 24, 39, 0.8) !important;
}
html.dark .bg-gray-100 {
    background-color: #374151 !important;
}
html.dark .border-gray-100 {
    border-color: #374151 !important;
}
html.dark .border-gray-200 {
    border-color: #4b5563 !important;
}
html.dark .border-gray-300 {
    border-color: #4b5563 !important;
}
html.dark .text-gray-300 {
    color: var(--c-text-3) !important;
}
html.dark .text-gray-500 {
    color: var(--c-text-3) !important;
}
html.dark .text-gray-600 {
    color: var(--c-text-2) !important;
}
html.dark .text-gray-700 {
    color: var(--c-text-2) !important;
}
html.dark .text-gray-800 {
    color: #f3f4f6 !important;
}
html.dark .text-gray-900 {
    color: #f9fafb !important;
}
html.dark .divide-gray-50 > :not([hidden]) ~ :not([hidden]) {
    border-color: #374151 !important;
}
html.dark .divide-gray-200 > :not([hidden]) ~ :not([hidden]) {
    border-color: #374151 !important;
}

/* Dark: Login page specific */
html.dark .bg-gradient-to-br {
    background: linear-gradient(to bottom right, #111827, #1f2937) !important;
}
html.dark .shadow-rose-100\/50 {
    box-shadow: none !important;
}

/* Dark: Settings page */
html.dark .bg-gray-200 {
    background-color: #374151 !important;
}

/* Dark: Status badges */
html.dark .bg-emerald-100 {
    background-color: #064e3b !important;
}
html.dark .text-emerald-800 {
    color: #6ee7b7 !important;
}
html.dark .bg-amber-100 {
    background-color: #78350f !important;
}
html.dark .text-amber-800 {
    color: #fcd34d !important;
}
html.dark .bg-red-100 {
    background-color: #7f1d1d !important;
}
html.dark .text-red-800 {
    color: #fca5a5 !important;
}
html.dark .bg-gray-100.text-gray-800,
html.dark [class*="bg-gray-100"][class*="text-gray-800"] {
    background-color: #374151 !important;
    color: var(--c-text-2) !important;
}

/* Dark: Focus ring on inputs */
html.dark .ring-red-100 {
    --tw-ring-color: #450a0a !important;
}

/* ============================================================
   LIGHT THEME — Additional overrides for premium feel
   ============================================================ */
/* Light: subtle hover effects */
html:not(.dark) .card:hover {
    border-color: #CBD5E1;
}
html:not(.dark) .profile-card:hover {
    border-color: #CBD5E1;
}
html:not(.dark) .btn-primary:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* ============================================================
   GLOBAL SCROLLBAR STYLING
   ============================================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--c-bg);
}
::-webkit-scrollbar-thumb {
    background: var(--c-border);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--c-text-4);
}
html.dark ::-webkit-scrollbar-track {
    background: var(--c-bg-alt);
}
html.dark ::-webkit-scrollbar-thumb {
    background: #4b5563;
}
html.dark ::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* ============================================================
   ANIMATION KEYFRAMES
   ============================================================ */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
