/* ============================================================
   BIRTHDAY WISHES — Modern Stylesheet v3
   Emerald theme · Inter font · Mobile-first · Bootstrap 5
   ============================================================ */

/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */
:root {
    /* Primary palette — emerald */
    --primary:         #10b981;
    --primary-dark:    #059669;
    --primary-darker:  #047857;
    --primary-light:   #34d399;
    --primary-lighter: #a7f3d0;
    --primary-bg:      #ecfdf5;
    --primary-glow:    rgba(16, 185, 129, .22);

    /* Accents */
    --accent:          #f59e0b;
    --accent-bg:       #fef3c7;
    --danger:          #ef4444;
    --danger-bg:       #fee2e2;
    --info:            #3b82f6;
    --info-bg:         #eff6ff;
    --purple:          #8b5cf6;
    --purple-bg:       #f5f3ff;
    --indigo:          #4f46e5;
    --indigo-bg:       #eef2ff;

    /* Neutrals — modern slate scale */
    --text:            #0f172a;
    --text-secondary:  #334155;
    --muted:           #64748b;
    --muted-light:     #94a3b8;
    --border:          #e5e7eb;
    --border-light:    #f1f5f9;
    --surface:         #ffffff;
    --surface-2:       #f8fafc;
    --surface-3:       #f1f5f9;

    /* Radii */
    --radius-xs:       6px;
    --radius-sm:       10px;
    --radius:          16px;
    --radius-lg:       20px;
    --radius-xl:       24px;

    /* Shadows — soft, layered */
    --shadow-xs:  0 1px 2px rgba(15, 23, 42, .04);
    --shadow-sm:  0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
    --shadow:     0 4px 12px -2px rgba(15, 23, 42, .08), 0 2px 6px -2px rgba(15, 23, 42, .05);
    --shadow-md:  0 10px 24px -8px rgba(15, 23, 42, .12), 0 4px 8px -4px rgba(15, 23, 42, .06);
    --shadow-lg:  0 20px 40px -12px rgba(15, 23, 42, .18), 0 8px 16px -8px rgba(15, 23, 42, .08);
    --shadow-glow: 0 12px 32px -8px var(--primary-glow);

    /* Motion */
    --ease:        cubic-bezier(.4, 0, .2, 1);
    --ease-out:    cubic-bezier(.16, 1, .3, 1);
    --transition:  all .2s var(--ease);

    /* Layout */
    --navbar-h:    56px;
    --page-max:    1440px;
}

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

html {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--navbar-h) + 12px);
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--surface-2);
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

body { padding-bottom: 80px; }
body.login-body { padding-bottom: 0; }
body.no-scroll { overflow: hidden; }

a {
    color: var(--primary-dark);
    text-decoration: none;
    transition: color .15s var(--ease);
}
a:hover { color: var(--primary-darker); }

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--text);
    line-height: 1.25;
    margin-top: 0;
}

img, svg, video { max-width: 100%; height: auto; }
button { font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ============================================================
   3. CONTAINER
   ============================================================ */
.container-fluid-app {
    width: 100%;
    max-width: var(--page-max);
    margin: 0 auto;
    padding: 1.25rem 1.25rem 2rem;
}
@media (max-width: 575.98px) {
    .container-fluid-app { padding: .875rem .875rem 1.5rem; }
}

/* Full-bleed variant (used by judges, persons, template studio) */
.container-bleed {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* ============================================================
   4. NAVBAR
   ============================================================ */
.navbar {
    min-height: var(--navbar-h);
    box-shadow: var(--shadow-sm);
    z-index: 1030;
}
.navbar-brand {
    font-weight: 800;
    letter-spacing: -.02em;
}
.navbar .nav-link {
    font-weight: 600;
    font-size: .9rem;
    border-radius: var(--radius-xs);
    padding: .4rem .7rem !important;
    transition: background .15s var(--ease);
}
.navbar .nav-link:hover,
.navbar .nav-link.active {
    background: rgba(255, 255, 255, .12);
}
.navbar .dropdown-menu {
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
    padding: .35rem;
    min-width: 220px;
}
.navbar .dropdown-item {
    border-radius: var(--radius-xs);
    padding: .5rem .75rem;
    font-size: .88rem;
    font-weight: 500;
    transition: background .12s var(--ease);
}
.navbar .dropdown-item:hover,
.navbar .dropdown-item.active {
    background: var(--primary-bg);
    color: var(--primary-darker);
}
.navbar .dropdown-divider { margin: .35rem 0; }

/* ============================================================
   5. PAGE HEADER
   ============================================================ */
.page-header {
    display: flex;
    flex-wrap: wrap;
    gap: .875rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}
.page-header h1,
.page-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -.025em;
    color: var(--text);
}
.page-header .page-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    align-items: center;
}

/* ============================================================
   6. STAT CARDS
   ============================================================ */
.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.25rem 1.35rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--primary);
    height: 100%;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: "";
    position: absolute;
    top: 0; right: 0;
    width: 120px; height: 120px;
    background: radial-gradient(circle at top right, var(--primary-glow), transparent 65%);
    opacity: 0;
    transition: opacity .3s var(--ease);
    pointer-events: none;
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-lighter);
}
.stat-card:hover::before { opacity: 1; }

.stat-card .stat-label {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: .5rem;
}
.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -.03em;
    color: var(--primary-dark);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.stat-card .stat-icon {
    float: right;
    font-size: 1.85rem;
    color: var(--primary-lighter);
    line-height: 1;
    transition: var(--transition);
}
.stat-card:hover .stat-icon {
    color: var(--primary-light);
    transform: scale(1.08) rotate(-4deg);
}
.stat-card.accent { border-left-color: var(--accent); }
.stat-card.accent .stat-value { color: #b45309; }
.stat-card.accent::before {
    background: radial-gradient(circle at top right, rgba(245,158,11,.18), transparent 65%);
}
.stat-card.danger { border-left-color: var(--danger); }
.stat-card.danger .stat-value { color: #b91c1c; }
.stat-card.danger::before {
    background: radial-gradient(circle at top right, rgba(239,68,68,.16), transparent 65%);
}
.stat-card.info { border-left-color: var(--info); }
.stat-card.info .stat-value { color: #1d4ed8; }
.stat-card.purple { border-left-color: var(--purple); }
.stat-card.purple .stat-value { color: #6d28d9; }

/* ============================================================
   7. PERSON CARDS (mobile list view)
   ============================================================ */
.person-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1rem 1.15rem;
    margin-bottom: .75rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: var(--transition);
}
.person-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--primary-lighter);
    transform: translateY(-1px);
}
.person-card .person-name {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -.015em;
    margin-bottom: .4rem;
    color: var(--text);
}
.person-card .person-meta {
    font-size: .82rem;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: .4rem 1rem;
    margin-bottom: .5rem;
}
.person-card .person-meta span {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}
.person-card .person-actions {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
}

/* ============================================================
   8. BADGES / CHIPS
   ============================================================ */
.badge {
    font-weight: 600;
    letter-spacing: .01em;
    padding: .3rem .55rem;
    border-radius: 6px;
}

.badge-cat {
    display: inline-flex;
    align-items: center;
    padding: .22rem .6rem;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .02em;
    border-radius: 999px;
    color: #fff;
    background: var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    white-space: nowrap;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .72rem;
    padding: .25rem .65rem;
    border-radius: 999px;
    background: var(--primary-bg);
    color: var(--primary-dark);
    font-weight: 700;
    letter-spacing: .01em;
    border: 1px solid var(--primary-lighter);
}
.chip-accent { background: var(--accent-bg); color: #92400e; border-color: #fcd34d; }
.chip-purple { background: var(--purple-bg); color: #6d28d9; border-color: #ddd6fe; }
.chip-info   { background: var(--info-bg);   color: #1e40af; border-color: #bfdbfe; }

/* ============================================================
   9. STATUS BADGES
   ============================================================ */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .64rem;
    font-weight: 700;
    padding: .2rem .6rem;
    border-radius: 999px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: .05em;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.status-deceased-row { opacity: .7; }
.status-deceased-row td:first-child { border-left: 4px solid #6b7280; }
.status-dnc-row td:first-child      { border-left: 4px solid var(--accent); }
.status-hold-row td:first-child     { border-left: 4px solid var(--purple); }

.wishes-blocked {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .72rem;
    color: var(--muted-light);
    font-style: italic;
    font-weight: 500;
}

/* ============================================================
   10. BUTTONS
   ============================================================ */
.btn {
    font-weight: 600;
    letter-spacing: -.005em;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    padding: .5rem .95rem;
}
.btn:focus, .btn:focus-visible {
    box-shadow: 0 0 0 3px var(--primary-glow);
    outline: none;
}
.btn-sm { padding: .3rem .65rem; font-size: .8rem; }
.btn-lg { padding: .7rem 1.3rem; font-size: 1rem; }

/* Primary — emerald gradient */
.btn-emerald {
    background: linear-gradient(180deg, var(--primary-light) 0%, var(--primary) 100%);
    border: 1px solid var(--primary-dark);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 6px -1px var(--primary-glow), inset 0 1px 0 rgba(255,255,255,.25);
}
.btn-emerald:hover, .btn-emerald:focus {
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: var(--primary-darker);
    color: #fff;
    box-shadow: 0 6px 14px -2px var(--primary-glow), inset 0 1px 0 rgba(255,255,255,.2);
    transform: translateY(-1px);
}
.btn-emerald:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px var(--primary-glow);
}
.btn-emerald:disabled, .btn-emerald.disabled {
    opacity: .55;
    transform: none;
    box-shadow: none;
    cursor: not-allowed;
}

/* Outline emerald */
.btn-outline-emerald {
    color: var(--primary-dark);
    border: 1.5px solid var(--primary);
    font-weight: 600;
    background: var(--surface);
}
.btn-outline-emerald:hover,
.btn-outline-emerald.active,
.btn-outline-emerald:focus {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px -2px var(--primary-glow);
    transform: translateY(-1px);
}

/* Danger outline */
.btn-outline-danger {
    color: var(--danger);
    border: 1.5px solid var(--danger);
    background: var(--surface);
    font-weight: 600;
}
.btn-outline-danger:hover,
.btn-outline-danger:focus {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
    box-shadow: 0 4px 12px -2px rgba(239,68,68,.35);
    transform: translateY(-1px);
}

/* Ghost (for dark backgrounds like template studio topbar) */
.btn-ghost {
    background: rgba(255,255,255,.14);
    color: #fff;
    border: 1px solid rgba(255,255,255,.28);
    font-weight: 600;
    backdrop-filter: blur(8px);
}
.btn-ghost:hover {
    background: rgba(255,255,255,.26);
    color: #fff;
    border-color: rgba(255,255,255,.4);
}

/* ============================================================
   11. FILTER PILLS
   ============================================================ */
.filter-pills {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
}
.filter-pills .btn {
    font-size: .82rem;
    padding: .4rem 1rem;
    border-radius: 999px;
    font-weight: 600;
}
.filter-pills .btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px -2px var(--primary-glow);
}

/* ============================================================
   12. TABLES
   ============================================================ */
.table-responsive {
    width: 100%;
    max-height: 72vh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    background: var(--surface);
    scrollbar-width: thin;
    scrollbar-color: var(--primary-lighter) transparent;
}
.table-responsive::-webkit-scrollbar { width: 8px; height: 8px; }
.table-responsive::-webkit-scrollbar-thumb {
    background: var(--primary-lighter);
    border-radius: 4px;
}
.table-responsive::-webkit-scrollbar-thumb:hover { background: var(--primary-light); }
.table-responsive::-webkit-scrollbar-track { background: transparent; }

.table-app {
    width: 100%;
    margin: 0;
    font-size: .82rem;
    line-height: 1.45;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 720px;
}
.table-app thead th {
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary-darker) 100%);
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    font-size: .68rem;
    letter-spacing: .06em;
    padding: .65rem .75rem;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 3;
    border-bottom: none;
}
.table-app tbody td {
    padding: .6rem .75rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
    transition: background .15s var(--ease);
}
.table-app tbody tr:nth-child(even) td { background: #fbfcfe; }
.table-app tbody tr:hover td {
    background: var(--primary-bg);
    color: var(--text);
}
.table-app tbody tr:last-child td { border-bottom: none; }
.table-app .btn-sm {
    padding: .25rem .55rem;
    font-size: .72rem;
    line-height: 1.3;
    border-radius: var(--radius-xs);
}

/* Sticky first column */
.table-app thead th:first-child,
.table-app tbody td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--surface);
    box-shadow: 4px 0 6px -4px rgba(15,23,42,.08);
}
.table-app thead th:first-child {
    background: var(--primary-darker);
    z-index: 4;
}
.table-app tbody tr:nth-child(even) td:first-child { background: #fbfcfe; }
.table-app tbody tr:nth-child(odd)  td:first-child { background: var(--surface); }
.table-app tbody tr:hover td:first-child { background: var(--primary-bg); }

@media (min-width: 1200px) {
    .table-app { font-size: .84rem; }
    .table-app tbody td { max-width: 320px; }
}
@media (max-width: 767.98px) {
    .table-responsive { max-height: none; }
    .table-app { font-size: .84rem; min-width: 560px; }
    .table-app tbody td { max-width: 200px; }
}

/* ============================================================
   13. MODAL
   ============================================================ */
.modal-content {
    border-radius: var(--radius-lg);
    border: none;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.modal-header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: #fff;
    border: none;
    padding: 1rem 1.35rem;
}
.modal-header .btn-close {
    filter: invert(1) grayscale(1) brightness(2);
    opacity: .85;
}
.modal-header .btn-close:hover { opacity: 1; }
.modal-header .modal-title {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -.01em;
}
.modal-body { padding: 1.35rem; }
.modal-footer { border-top: 1px solid var(--border-light); padding: .9rem 1.35rem; }
.modal-footer.bg-light { background: var(--surface-2) !important; }

.modal-backdrop.show { opacity: .55; }

/* ============================================================
   14. FORM SECTION TITLE
   ============================================================ */
.form-section-title {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 1.25rem 0 .65rem;
    padding-bottom: .35rem;
    border-bottom: 1px solid var(--primary-lighter);
    display: flex;
    align-items: center;
    gap: .35rem;
}
.form-section-title:first-child { margin-top: 0; }

/* ============================================================
   15. FORM CONTROLS
   ============================================================ */
.form-label {
    font-size: .72rem;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: .35rem;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    font-size: .92rem;
    padding: .58rem .85rem;
    background: var(--surface);
    color: var(--text);
    transition: var(--transition);
}
.form-control::placeholder { color: var(--muted-light); }
.form-control:hover, .form-select:hover { border-color: #cbd5e1; }
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
    outline: none;
}
.form-control-sm, .form-select-sm {
    font-size: .82rem;
    padding: .38rem .6rem;
    border-radius: var(--radius-xs);
}
textarea.form-control { resize: vertical; min-height: 60px; }

.form-text { font-size: .72rem; color: var(--muted-light); }

/* ============================================================
   16. LANGUAGE INPUT DIFFERENTIATION
   ============================================================ */
.input-hi {
    background-color: #fffbf0 !important;
    border-color: #fde68a !important;
    color: #78350f !important;
}
.input-hi:focus {
    background-color: #fff8e6 !important;
    border-color: #f59e0b !important;
    box-shadow: 0 0 0 4px rgba(245,158,11,.18) !important;
    color: #78350f !important;
}
.input-hi::placeholder { color: #b45309; opacity: .55; }

.input-en {
    background-color: #f7fef9 !important;
    border-color: #bbf7d0 !important;
}
.input-en:focus {
    background-color: #ecfdf5 !important;
    border-color: #10b981 !important;
    box-shadow: 0 0 0 4px var(--primary-glow) !important;
}

.label-hi::after {
    content: " हिं";
    font-size: .56rem;
    color: #92400e;
    background: var(--accent-bg);
    padding: 2px 6px;
    border-radius: 5px;
    margin-left: 6px;
    font-weight: 700;
    letter-spacing: .04em;
}
.label-en::after {
    content: " EN";
    font-size: .56rem;
    color: #065f46;
    background: #d1fae5;
    padding: 2px 6px;
    border-radius: 5px;
    margin-left: 6px;
    font-weight: 700;
    letter-spacing: .04em;
}

/* ============================================================
   17. TOAST
   ============================================================ */
.toast-container { z-index: 1300; }
.toast {
    border-radius: var(--radius);
    font-size: .9rem;
    box-shadow: var(--shadow-md);
    border: none;
}
.toast-body { padding: .7rem 1rem; font-weight: 600; }

/* ============================================================
   18. FAB (mobile only)
   ============================================================ */
.fab {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    font-size: 1.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    box-shadow: 0 12px 28px -6px var(--primary-glow), 0 6px 14px -6px rgba(0,0,0,.15);
    z-index: 1040;
    transition: var(--transition);
}
.fab:hover {
    transform: scale(1.08) rotate(90deg);
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: #fff;
}
@media (min-width: 768px) { .fab { display: none; } }

/* ============================================================
   19. EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 3.5rem 1rem;
    color: var(--muted);
}
.empty-state i {
    font-size: 3.5rem;
    color: var(--primary-lighter);
    display: block;
    margin-bottom: .75rem;
}
.empty-state h5 { color: var(--text); font-weight: 700; margin-bottom: .5rem; }
.empty-state p { font-size: .9rem; margin-bottom: 1rem; }

/* ============================================================
   20. LOGIN PAGE
   ============================================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 15% 20%, rgba(52, 211, 153, .35) 0%, transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(4, 120, 87, .55) 0%, transparent 50%),
        linear-gradient(135deg, var(--primary-darker) 0%, var(--primary) 100%);
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
}
.login-page::before,
.login-page::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: .35;
    pointer-events: none;
}
.login-page::before {
    width: 400px; height: 400px;
    background: var(--primary-light);
    top: -150px; left: -150px;
}
.login-page::after {
    width: 300px; height: 300px;
    background: var(--accent);
    bottom: -120px; right: -120px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: rgba(255,255,255,.96);
    border-radius: var(--radius-xl);
    box-shadow: 0 24px 64px -12px rgba(0,0,0,.35), 0 8px 24px -8px rgba(0,0,0,.2);
    padding: 2.25rem 2rem;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,.5);
}
.login-card .login-logo {
    width: 76px;
    height: 76px;
    border-radius: 22px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    margin: 0 auto 1.25rem;
    box-shadow: 0 12px 32px -8px var(--primary-glow), inset 0 2px 4px rgba(255,255,255,.3);
}
.login-card h1 {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -.025em;
    color: var(--text);
    margin-bottom: .35rem;
}
.login-card .subtitle {
    text-align: center;
    color: var(--muted);
    font-size: .9rem;
    margin-bottom: 1.75rem;
}
.login-card .form-control { height: 50px; border-radius: var(--radius-sm); }

.btn-login {
    height: 52px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    letter-spacing: .01em;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    color: #fff;
    box-shadow: 0 6px 16px -4px var(--primary-glow);
    transition: var(--transition);
}
.btn-login:hover {
    filter: brightness(1.06);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px -6px var(--primary-glow);
}
.btn-login:active { transform: translateY(0); }

/* ============================================================
   21. ALERTS
   ============================================================ */
.alert {
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-weight: 500;
    padding: .85rem 1.1rem;
}
.alert-success {
    background: var(--primary-bg);
    color: var(--primary-darker);
    border-color: var(--primary-lighter);
}
.alert-danger {
    background: var(--danger-bg);
    color: #991b1b;
    border-color: #fecaca;
}
.alert-warning {
    background: var(--accent-bg);
    color: #78350f;
    border-color: #fcd34d;
}
.alert-info {
    background: var(--info-bg);
    color: #1e40af;
    border-color: #bfdbfe;
}

/* ============================================================
   22. PROGRESS
   ============================================================ */
.progress {
    border-radius: 999px;
    background: var(--surface-3);
    overflow: hidden;
}
.progress-bar {
    background: linear-gradient(90deg, var(--primary-light), var(--primary-dark));
    transition: width .4s var(--ease-out);
}

/* ============================================================
   23. UTILITIES
   ============================================================ */
.text-muted    { color: var(--muted) !important; }
.text-emerald  { color: var(--primary-dark) !important; }
.text-accent   { color: #b45309 !important; }
.text-danger   { color: #b91c1c !important; }
.text-indigo   { color: var(--indigo) !important; }

.bg-surface    { background: var(--surface) !important; }
.bg-surface-2  { background: var(--surface-2) !important; }
.bg-primary-bg { background: var(--primary-bg) !important; }

.mono {
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .8rem;
    letter-spacing: -.01em;
}
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

hr { border-color: var(--border-light); opacity: 1; }

input[type=checkbox], input[type=radio] {
    accent-color: var(--primary);
    cursor: pointer;
}

::selection {
    background: var(--primary-light);
    color: #fff;
}

/* Focus ring for accessibility */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Scrollbar (global thin, subtle) */
* {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
*::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
*::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   24. ROW ACCENTS (shared across judges / persons / demise)
   ============================================================ */
.row-accent-deceased { --row-accent: #6b7280; }
.row-accent-dnc      { --row-accent: var(--accent); }
.row-accent-hold     { --row-accent: var(--purple); }

/* ============================================================
   25. HELPERS FOR TEMPLATE STUDIO / FILE BADGES
   ============================================================ */
.file-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .18rem .55rem;
    background: var(--indigo-bg);
    border: 1px solid #c7d2fe;
    border-radius: 6px;
    color: #4338ca;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .68rem;
    font-weight: 700;
    max-width: 460px;
    overflow: hidden;
}
.file-badge .fb-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-badge .fb-cat  {
    color: #6366f1;
    font-family: Inter, system-ui, sans-serif;
    font-weight: 600;
    font-size: .66rem;
    opacity: .85;
}
.file-badge .fb-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 2px rgba(245,158,11,.22);
    display: none;
}
.file-badge.dirty .fb-dot { display: inline-block; }

/* ============================================================
   26. RESPONSIVE TWEAKS
   ============================================================ */
@media (max-width: 767.98px) {
    body { padding-bottom: 88px; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .page-header h1, .page-header h3 { font-size: 1.25rem; }
    .stat-card { padding: 1rem 1.1rem; }
    .stat-card .stat-value { font-size: 1.65rem; }
    .modal-body { padding: 1rem; }
}

/* ============================================================
   27. PRINT STYLES
   ============================================================ */
@media print {
    body { background: #fff; padding: 0; }
    .navbar, .fab, .modal, .modal-backdrop,
    .no-print, .btn, .page-header .page-actions,
    .status-pills, .filter-pills, .toast-container {
        display: none !important;
    }
    .container-fluid-app { padding: 0; max-width: 100%; }
    .table-responsive {
        max-height: none;
        box-shadow: none;
        border: none;
    }
    .table-app thead th {
        background: #fff !important;
        color: #000 !important;
        border-bottom: 2px solid #000;
    }
    .table-app tbody td { border-bottom: 1px solid #ccc; }
    a { color: #000; text-decoration: none; }
    .stat-card { box-shadow: none; border: 1px solid #ccc; }
}

/* ============================================================
   28. REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
    .stat-card:hover,
    .person-card:hover,
    .btn:hover,
    .fab:hover {
        transform: none !important;
    }
}

/* ============================================================
   29. DARK-MODE-READY HOOK (opt-in via .dark-theme on <html>)
   ============================================================ */
@media (prefers-color-scheme: dark) {
    html.dark-theme {
        --text:           #f1f5f9;
        --text-secondary: #cbd5e1;
        --muted:          #94a3b8;
        --muted-light:    #64748b;
        --border:         #334155;
        --border-light:   #1e293b;
        --surface:        #0f172a;
        --surface-2:      #020617;
        --surface-3:      #1e293b;
    }
    html.dark-theme body { background: var(--surface-2); color: var(--text); }
    html.dark-theme .table-app tbody tr:nth-child(even) td { background: #0b1220; }
    html.dark-theme .table-app tbody tr:nth-child(even) td:first-child { background: #0b1220; }
    html.dark-theme .table-app tbody td:first-child { background: var(--surface); }
    html.dark-theme .form-control,
    html.dark-theme .form-select {
        background: var(--surface);
        color: var(--text);
    }
}