@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&family=DM+Mono:wght@400;500;700&family=Nunito:wght@400;600;700;800;900&display=swap');

:root {
    --brand: #2E9AB8;
    --brand-d: #1F7A94;
    --brand-dd: #155F73;
    --brand-l: #A8D8EA;
    --brand-ll: #C8EAF5;
    --brand-lll: #E8F6FB;
    --bee: #D4A017;
    --bee-d: #B8860B;
    --bee-dd: #8B6508;
    --bee-l: #F5DFA0;
    --bee-ll: #FAF0C8;
    --bee-lll: #FDF8E8;

    --ink: #0F1923;
    --ink-2: #1E2E40;
    --ink-3: #334155;
    --muted: #64748B;
    --muted-2: #94A3B8;
    --rule: #E2E8F0;
    --rule-2: #CBD5E1;
    --surface: #FFFFFF;
    --canvas: #F8FAFC;
    --canvas-2: #F1F5F9;

    --red: #EF4444;
    --red-l: #FEE2E2;
    --amber: #F59E0B;
    --amber-l: #FEF3C7;
    --green: #10B981;
    --green-l: #D1FAE5;
    --blue: #3B82F6;
    --blue-l: #EFF6FF;

    --shadow-xs: 0 2px 4px rgba(15, 25, 35, 0.05);
    --shadow-sm: 0 4px 12px rgba(15, 25, 35, 0.08);
    --shadow-md: 0 12px 32px rgba(15, 25, 35, 0.12);
    --shadow-hover: 0 20px 40px rgba(46, 154, 184, 0.15);
    --r-md: 14px;
    --r-lg: 20px;
    --r-xl: 28px;
    --r-pill: 99px;
}


html.dark {
    --surface: #1A1A1A;
    --canvas: #0A0A0A;
    --canvas-2: #222222;
    --rule: #2A2A2A;
    --rule-2: #3A3A3A;
    --ink: #F0F0F0;
    --ink-2: #E0E0E0;
    --ink-3: #CCCCCC;
    --muted: #999999;
    --muted-2: #666666;
    --brand: #3DB8D4;
    --brand-d: #2E9AB8;
    --brand-dd: #5CCCE6;
    --brand-l: #1A3040;
    --brand-ll: #152530;
    --brand-lll: #101D28;
    --bee: #E8A820;
    --bee-d: #D4A017;
    --bee-dd: #F0B830;
    --bee-l: #2A2200;
    --bee-ll: #1F1A00;
    --bee-lll: #151100;
    --red: #E05555;
    --red-l: #1A0000;
    --amber: #E8A820;
    --amber-l: #1F1A00;
    --green: #30A870;
    --green-l: #001A0E;
    --blue: #5B9CF6;
    --blue-l: #0A1A30;
    --shadow-xs: 0 2px 8px rgba(0,0,0,0.4);
    --shadow-sm: 0 4px 16px rgba(0,0,0,0.5);
    --shadow-md: 0 12px 40px rgba(0,0,0,0.6);
    --shadow-hover: 0 20px 40px rgba(0,0,0,0.5);
}


html.high-contrast {
    --rule: #CBD5E1;
    --rule-2: #94A3B8;
}
html.high-contrast .card,
html.high-contrast .e-card,
html.high-contrast .e-med-card,
html.high-contrast .e-appt-item,
html.high-contrast .modal {
    border-width: 2px;
}
html.high-contrast .form-control {
    border-width: 1.8px;
}
html.high-contrast.dark {
    --rule: #444444;
    --rule-2: #555555;
}


html.dark .mgr-nav-pill {
    background: linear-gradient(135deg, rgba(46,154,184,0.15), rgba(46,154,184,0.06));
    box-shadow: inset 0 0 0 1.5px var(--brand), 0 0 12px rgba(46,154,184,0.1);
}
html.dark .elder-nav-pill {
    background: linear-gradient(135deg, rgba(212,160,23,0.15), rgba(212,160,23,0.06));
    box-shadow: inset 0 0 0 1.5px var(--bee), 0 0 12px rgba(212,160,23,0.1);
}
html.dark .m-nav-item.active .m-nav-label {
    color: #fff;
}
html.dark .e-nav-item.active .e-nav-label {
    color: #fff;
}


html.dark [style*="background:#fff"][style*="border-radius:18px"],
html.dark [style*="background:#fff"][style*="grid-template-columns:repeat(7"] {
    background: var(--surface) !important;
}
html.dark [style*="background:#f8fafb"] {
    background: var(--canvas-2) !important;
}
html.dark [style*="border-right:1px solid #f0f2f4"],
html.dark [style*="border-bottom:1px solid #f0f2f4"] {
    border-color: var(--rule) !important;
}
html.dark [style*="color:#1a2332"],
html.dark [style*="color:#0e6b7a"] {
    color: var(--ink) !important;
}
html.dark [style*="color:#c0c8d0"] {
    color: var(--muted-2) !important;
}
html.dark [style*="color:#6b7280"] {
    color: var(--muted) !important;
}
html.dark [style*="background:#fafbfc"] {
    background: var(--canvas) !important;
}

html.dark [style*="background:'#f0fafa'"],
html.dark [onmouseenter*="f0fafa"] {
    --cal-hover: var(--canvas-2);
}

html.dark [style*="background:#fff"][style*="border-radius:20px"] {
    background: var(--surface) !important;
}


html.dark .card {
    background: var(--surface);
    border-color: var(--rule);
}
html.dark .card-header {
    background: var(--canvas-2);
    border-color: var(--rule);
}
html.dark .elder-banner {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
}
html.dark .form-control {
    background: var(--canvas);
    border-color: var(--rule);
    color: var(--ink);
}
html.dark .form-control::placeholder {
    color: var(--muted-2);
}
html.dark .modal {
    background: var(--surface);
}
html.dark .modal-header {
    background: var(--canvas-2);
    border-color: var(--rule);
}
html.dark .modal-footer {
    border-color: var(--rule);
}
html.dark .table-wrap table {
    background: var(--surface);
}
html.dark table thead {
    background: var(--canvas-2);
}
html.dark table tbody tr {
    border-color: var(--rule);
}
html.dark table tbody tr:hover {
    background: var(--canvas-2);
}
html.dark .btn-ghost {
    color: var(--ink);
    border-color: var(--rule);
}
html.dark .alert {
    background: var(--canvas-2);
    border-color: var(--rule);
}

html.dark [style*="background:#fff;border:1.5px solid var(--rule)"] {
    background: var(--surface) !important;
}
html.dark [style*="background:#fff;border-radius:16px"] {
    background: var(--surface) !important;
}

html.dark [style*="background:#fff"][style*="box-shadow:var(--shadow-xs)"] {
    background: var(--surface) !important;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 13px;
    scroll-behavior: smooth;
    overflow: hidden;
    height: 100%;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--canvas);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    height: 100%;
    overflow: hidden;
}


*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
*::-webkit-scrollbar-track {
    background: transparent;
}
*::-webkit-scrollbar-thumb {
    background: var(--rule-2);
    border-radius: 99px;
}
*::-webkit-scrollbar-thumb:hover {
    background: var(--muted-2);
}
* {
    scrollbar-width: thin;
    scrollbar-color: var(--rule-2) transparent;
}

.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.icon {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: inline-block;
    vertical-align: middle;
}

.icon-sm {
    width: 16px;
    height: 16px;
    stroke-width: 3;
}

.icon-lg {
    width: 28px;
    height: 28px;
    stroke-width: 2;
}

.icon-xl {
    width: 44px;
    height: 44px;
    stroke-width: 2;
}

.icon-fill {
    fill: currentColor;
    stroke: none;
}


:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    border-radius: 4px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.h2 {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.2px;
}

.h3 {
    font-size: 1rem;
    font-weight: 700;
}

.small {
    font-size: 0.85rem;
}

.tiny {
    font-size: 0.75rem;
}

.mono {
    font-family: 'DM Mono', monospace;
}

.text-muted {
    color: var(--muted);
}

.fw-700 {
    font-weight: 700;
}

.fw-800 {
    font-weight: 800;
}

.g2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-gap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mt-6 {
    margin-top: 6px;
}

.mt-10 {
    margin-top: 10px;
}

.mt-14 {
    margin-top: 14px;
}

.mt-18 {
    margin-top: 18px;
}

.mb-6 {
    margin-bottom: 6px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-14 {
    margin-bottom: 14px;
}

.mb-18 {
    margin-bottom: 18px;
}

.card {
    background: var(--surface);
    border-radius: var(--r-lg);
    border: 1.5px solid var(--rule);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}

.card-p {
    padding: 18px 20px;
}

.card-header {
    padding: 13px 20px;
    border-bottom: 1.5px solid var(--rule);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header-title {
    font-size: 0.875rem;
    font-weight: 800;
    color: var(--ink);
}

.card-footer {
    padding: 10px 20px;
    border-top: 1.5px solid var(--rule);
    background: var(--canvas);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--r-pill);
    font-size: 0.68rem;
    font-weight: 700;
}

.badge-brand {
    background: var(--brand-ll);
    color: var(--brand-dd);
}

.badge-red {
    background: var(--red-l);
    color: var(--red);
}

.badge-amber {
    background: var(--amber-l);
    color: var(--amber);
}

.badge-green {
    background: var(--green-l);
    color: var(--green);
}

.badge-blue {
    background: var(--blue-l);
    color: var(--blue);
}

.badge-neutral {
    background: var(--canvas-2);
    color: var(--muted);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: var(--r-md);
    border: 1.5px solid transparent;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.btn-brand {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}

.btn-brand:hover {
    background: var(--brand-d);
}

.btn-ghost {
    background: transparent;
    color: var(--muted);
    border-color: var(--rule-2);
}

.btn-ghost:hover {
    background: var(--canvas-2);
    border-color: var(--rule);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.78rem;
}

.form-group {
    margin-bottom: 14px;
}

.form-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--ink-2);
    margin-bottom: 6px;
}

.req {
    color: var(--red);
    font-weight: 800;
    margin-left: 3px;
}

.form-control {
    width: 100%;
    background: var(--surface);
    border: 1.5px solid var(--rule-2);
    border-radius: var(--r-md);
    padding: 10px 14px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ink);
    outline: none;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: var(--brand);
}

.form-control::placeholder,
.auth-input::placeholder {
    color: #9CA3AF;
}

input.form-control[type="date"],
input.form-control[type="time"],
input.form-control[type="datetime-local"] {
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

input.form-control[type="date"]:hover,
input.form-control[type="time"]:hover,
input.form-control[type="datetime-local"]:hover {
    border-color: var(--brand);
    background-color: var(--brand-lll);
}

.days-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 5px 12px;
    border-radius: var(--r-pill);
    font-size: 0.7rem;
    font-weight: 800;
    background: var(--brand-lll);
    color: var(--brand-dd);
    border: 1px solid var(--brand-l);
    transition: all 0.2s ease;
    cursor: default;
}

.days-badge:hover {
    background: var(--brand-ll);
    transform: translateY(-1px);
}

textarea.form-control {
    resize: none;
    min-height: 90px;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

select.form-control:hover {
    border-color: var(--brand);
    background-color: var(--brand-lll);
}

.independent-badge {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 3px 10px;
    border-radius: var(--r-pill);
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(4px);
}

.form-control[type="file"] {
    padding: 8px;
    font-size: 0.8rem;
    background: var(--canvas-2);
}

.form-control[type="file"]::file-selector-button {
    background: var(--brand);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    margin-right: 10px;
    font-family: inherit;
    font-weight: 700;
    transition: background 0.2s;
}

.form-control[type="file"]::file-selector-button:hover {
    background: var(--brand-d);
}

.table-wrap {
    border-radius: var(--r-lg);
    border: 1.5px solid var(--rule);
    overflow-x: auto;
    box-shadow: var(--shadow-xs);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    min-width: 600px;
}

.days-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px 10px;
    border-radius: var(--r-pill);
    font-size: 0.68rem;
    font-weight: 700;
    background: var(--brand-lll);
    color: var(--brand-dd);
    border: 1px solid var(--brand-l);
}

thead th {
    background: var(--canvas);
    border-bottom: 1.5px solid var(--rule);
    padding: 10px 16px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--muted);
    text-align: center;
}

tbody tr {
    border-bottom: 1px solid var(--rule);
}

tbody tr:last-child {
    border-bottom: none;
}

tbody tr:hover {
    background: var(--canvas);
}

td {
    padding: 12px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink-3);
    text-align: center;
    vertical-align: middle;
}

.td-name {
    font-weight: 700;
    color: var(--ink);
}

.pill-thumb {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
}

.pt-brand {
    background: var(--brand-ll);
    color: var(--brand-dd);
}

.pt-blue {
    background: var(--blue-l);
    color: var(--blue);
}

.pt-amber {
    background: var(--amber-l);
    color: var(--amber);
}

.pt-red {
    background: var(--red-l);
    color: var(--red);
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--r-md);
    font-size: 0.85rem;
    font-weight: 600;
    border: 1.5px solid transparent;
}

.alert-warn {
    background: var(--amber-l);
    border-color: #FCD34D;
    color: #7D4E00;
}

.stock-bar {
    height: 6px;
    background: var(--canvas-2);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}

.stock-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.log-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--rule);
}

.log-row:last-child {
    border-bottom: none;
}

.log-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.log-time {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 600;
}

.appt-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--surface);
    border: 1.5px solid var(--rule);
    border-radius: var(--r-lg);
    margin-bottom: 12px;
    box-shadow: var(--shadow-xs);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.appt-item:hover {
    border-color: var(--brand-l);
    box-shadow: var(--shadow-sm);
}


.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.cal-head {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    padding: 8px 0;
    letter-spacing: 0.5px;
}

.cal-day {
    position: relative;
    text-align: center;
    padding: 10px 4px 14px;
    border-radius: var(--r-md);
    cursor: default;
    transition: all 0.15s ease;
}

.cal-day:hover:not(.cal-empty) {
    background: var(--canvas-2);
}

.cal-day-num {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--ink);
}

.cal-empty .cal-day-num {
    visibility: hidden;
}

.cal-today {
    background: var(--brand-lll) !important;
    border: 1.5px solid var(--brand);
}

.cal-today .cal-day-num {
    color: var(--brand-dd);
    font-weight: 900;
}

.cal-has-appt {
    cursor: pointer;
}

.cal-has-appt .cal-day-num {
    font-weight: 900;
}

.cal-dot {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand);
}

.cal-has-appt.cal-today .cal-dot {
    background: var(--brand-dd);
}

.appt-date {
    background: var(--brand);
    color: #fff;
    border-radius: var(--r-md);
    padding: 10px 14px;
    text-align: center;
    min-width: 60px;
    flex-shrink: 0;
}

.appt-month {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.85;
}

.appt-day {
    font-size: 1.8rem;
    font-weight: 900;
    line-height: 1;
    font-family: 'DM Mono', monospace;
}

.elder-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dd) 100%);
  color: #fff;
  border-radius: var(--r-lg);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.divider {
    height: 1.5px;
    background: var(--rule);
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 25, 35, 0.55);
    backdrop-filter: blur(4px);
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.overlay.hidden {
    display: none;
}

.modal {
    background: var(--surface);
    border-radius: var(--r-xl);
    width: 100%;
    max-width: 500px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
    animation: slideUpFade 0.25s ease;
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
}

.modal form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--canvas-2);
    border-bottom: 1.5px solid var(--rule);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
}

.modal-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ink-3);
}

.modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
    background: var(--surface);
    
    scrollbar-width: thin;
    scrollbar-color: var(--rule-2) transparent;
}



.modal-footer {
    padding: 14px 20px;
    border-top: 1.5px solid var(--rule);
    background: var(--surface);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    border-radius: 0 0 var(--r-xl) var(--r-xl);
}

.modal-close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--muted);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
    padding: 0;
}

.modal-close:hover {
    background: var(--red-l);
    color: var(--red);
}

.modal-close .icon-sm {
    width: 18px;
    height: 18px;
}

#toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--surface);
    color: var(--ink);
    border-radius: var(--r-lg);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 9000;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
    max-width: 90vw;
    border: 1.5px solid var(--rule);
}

#toast.toast-success {
    border-color: var(--green);
    background: var(--green-l);
}

#toast.toast-error {
    border-color: var(--red);
    background: var(--red-l);
}

#toast.toast-warn {
    border-color: var(--amber);
    background: var(--amber-l);
}

#toast.toast-info {
    border-color: var(--brand);
    background: var(--brand-lll);
}

#toast.show {
    transform: translateX(-50%) translateY(0);
}

#toastMsg {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--ink);
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


#lightbox {
    position: fixed;
    inset: 0;
    background: rgba(15, 25, 35, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px;
    cursor: zoom-out;
    animation: fadeIn 0.3s ease;
}

#lightbox.active {
    display: flex;
}

#lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: var(--r-lg);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#lightbox .lb-close {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10001;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

#lightbox .lb-close:hover {
    background: var(--red);
    border-color: var(--red-l);
    transform: rotate(90deg) scale(1.1);
}

#lightbox .lb-close svg {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.img-zoom {
    cursor: zoom-in;
    transition: transform 0.2s ease;
}

.img-zoom:hover {
    transform: scale(1.05);
}

@keyframes slideRightFade {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes floatBob {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-15px);
    }
}

@keyframes floatBobSlow {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(1.5deg);
    }
}

@keyframes floatBobReverse {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(15px) rotate(-1.5deg);
    }
}




.day-picker {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.day-btn {
    flex: 1;
    min-width: 36px;
    padding: 7px 4px;
    border-radius: 10px;
    border: 1.5px solid var(--rule-2);
    background: var(--canvas-2);
    color: var(--muted);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.day-btn:hover {
    border-color: var(--brand-l);
    background: var(--brand-lll);
    color: var(--brand-dd);
}

.day-btn.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}


.no-transition, .no-transition * {
    transition: none !important;
}


.elder-page.active, .page.active {
    opacity: 1;
}


* {
    scrollbar-width: thin;
    scrollbar-color: var(--rule-2) transparent;
}

*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: var(--rule-2);
    border-radius: 99px;
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--muted-2);
}

*::-webkit-scrollbar-corner {
    background: transparent;
}

*::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}



/* ===== DARK MODE FIXES: Elder Dropdown, Modals, All Overlays ===== */

/* Elder switcher dropdown in dark mode */
html.dark .elder-switcher-dropdown {
    background: #1A1A1A;
    border-color: var(--rule);
}
html.dark .elder-switcher-dropdown-header {
    border-color: var(--rule);
}
html.dark .elder-switcher-item:hover {
    background: #222222;
}
html.dark .elder-switcher-item.active {
    background: var(--brand-lll);
}
html.dark .elder-switcher-btn {
    background: #1A1A1A;
    border-color: var(--rule);
}
html.dark .elder-switcher-btn:hover,
html.dark .elder-switcher-btn.open {
    background: var(--brand-lll);
    border-color: var(--brand);
}

/* Elder selector bar (select dropdown) in dark mode */
html.dark .elder-selector-bar {
    background: #1A1A1A !important;
    border-color: var(--rule) !important;
}
html.dark .elder-selector-bar select {
    background: #1A1A1A !important;
    border-color: var(--rule) !important;
    color: var(--ink) !important;
}

/* All modals and overlays in dark mode */
html.dark .overlay {
    background: rgba(0, 0, 0, 0.7);
}
html.dark #globalConfirmModal > div > div,
html.dark #logoutModal > div,
html.dark #unsavedChangesModal > div,
html.dark #elderInfoModal > div > div,
html.dark #dayDetailsModal > div > div,
html.dark #forgotModal > div > div {
    background: #1A1A1A !important;
}
html.dark #globalConfirmModal > div,
html.dark #logoutModal,
html.dark #unsavedChangesModal,
html.dark #elderInfoModal > div,
html.dark #dayDetailsModal > div,
html.dark #forgotModal > div {
    background: rgba(0, 0, 0, 0.7);
}

/* Fixed modals (non-overlay class) in dark mode */
html.dark [style*="position:fixed"][style*="z-index:10000"] > div[style*="background:#fff"],
html.dark [style*="position:fixed"][style*="z-index:10001"] > div[style*="background:#fff"],
html.dark [style*="position:fixed"][style*="z-index:9999"] > div[style*="background:#fff"] {
    background: #1A1A1A !important;
}

/* Inline white backgrounds in dark mode */
html.dark [style*="background:#fff"][style*="border-radius:16px"],
html.dark [style*="background:#fff"][style*="border-radius:20px"],
html.dark [style*="background:#fff"][style*="border-radius:24px"],
html.dark [style*="background:#fff"][style*="border-radius:28px"],
html.dark [style*="background:#fff"][style*="border-radius:var(--r-xl)"] {
    background: #1A1A1A !important;
}

/* Cards with inline background:#fff in dark mode */
html.dark [style*="background:#fff"][style*="box-shadow:var(--shadow-xs)"],
html.dark [style*="background:#fff"][style*="border:1.5px solid var(--rule)"] {
    background: #1A1A1A !important;
}

/* Calendar card in dark mode */
html.dark .card[style*="background:#fff"] {
    background: #1A1A1A !important;
}

/* Confirm modal, logout modal, unsaved changes modal backgrounds */
html.dark #globalConfirmModal [style*="background:#fff"],
html.dark #logoutModal [style*="background:#fff"],
html.dark #unsavedChangesModal [style*="background:#fff"],
html.dark #elderInfoModal [style*="background:#fff"],
html.dark #dayDetailsModal [style*="background:#fff"],
html.dark #forgotModal [style*="background:#fff"],
html.dark #medAlarmModal [style*="background:#fff"],
html.dark #missReasonModal [style*="background:#fff"],
html.dark #sosModal [style*="background:#fff"],
html.dark #sosCountdownModal [style*="background:#fff"],
html.dark #affirmationModal [style*="background:#fff"] {
    background: #1A1A1A !important;
}

/* Modal header backgrounds in dark mode */
html.dark [style*="background:var(--canvas-2)"][style*="border-bottom"] {
    background: #111111 !important;
}
html.dark [style*="background:#f3f4f6"] {
    background: #222222 !important;
}

/* Select dropdown options in dark mode */
html.dark select,
html.dark select option {
    background: #1A1A1A;
    color: var(--ink);
}
html.dark select.form-control,
html.dark select[id="missReasonInput"] {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns=%22http://www.w3.org/2000/svg%22 width=%2212%22 height=%2212%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%23ffffff%22 stroke-width=%222.5%22 stroke-linecap=%22round%22><polyline points=%226 9 12 15 18 9%22/></svg>') !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
}

/* Day picker buttons in dark mode */
html.dark .day-btn {
    background: #1A1A1A;
    border-color: var(--rule);
    color: var(--muted);
}
html.dark .day-btn:hover {
    background: var(--brand-lll);
}
html.dark .day-btn.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

/* Date/time input — spacing for picker icon */
input[type="date"],
input[type="time"],
input[type="datetime-local"],
.form-control[type="date"],
.form-control[type="time"],
.form-control[type="datetime-local"] {
    padding-right: 14px;
}
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
.form-control[type="date"]::-webkit-calendar-picker-indicator,
.form-control[type="time"]::-webkit-calendar-picker-indicator,
.form-control[type="datetime-local"]::-webkit-calendar-picker-indicator {
    padding: 4px;
    margin-right: 4px;
    cursor: pointer;
    opacity: 0.6;
}

/* Dark mode: date/time input icons white */
html.dark input[type="date"]::-webkit-calendar-picker-indicator,
html.dark input[type="time"]::-webkit-calendar-picker-indicator,
html.dark input[type="datetime-local"]::-webkit-calendar-picker-indicator,
html.dark .form-control[type="date"]::-webkit-calendar-picker-indicator,
html.dark .form-control[type="time"]::-webkit-calendar-picker-indicator,
html.dark .form-control[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(2) !important;
    opacity: 0.9 !important;
    cursor: pointer;
}
/* Ensure dark mode doesn't override our custom background */
html.dark input[type="date"],
html.dark input[type="time"],
html.dark input[type="datetime-local"],
html.dark .form-control[type="date"],
html.dark .form-control[type="time"],
html.dark .form-control[type="datetime-local"] {
    background: var(--canvas) !important;
    color: var(--ink) !important;
    border-color: var(--rule) !important;
}

/* Toast in dark mode */
html.dark #toast {
    background: #1A1A1A;
    border-color: var(--rule);
}
