/* ================================================================
   WARDEN app.css — Warden-specific overrides
   ----------------------------------------------------------------
   LOADS AFTER zelicra-theme.css (shared theme).

   REMOVED (now handled by shared theme):
   - .t-dark/.t-light colour variable blocks -> zelicra-theme.css
   - body.theme-dark/body.theme-light variable blocks -> zelicra-theme.css
   - All backdrop-filter rules -> zelicra-theme.js glass slider
   - --glass-highlight, --bg-card, --bg-primary variables -> --zl-* from theme
   - Competing .card::before glass highlight rules -> theme handles
   - body { background/color/font } rules -> theme handles
   - Stat card backdrop-filter -> theme glass UI handles

   KEPT:
   - Warden indigo accent override
   - Warden-specific --sidebar-w (260px vs theme default 230px)
   - All component CSS (badges, forms, RAG dots, gauges, etc.)
   - All layout/structural CSS
   - Animations and utility classes
================================================================ */

/* -- Warden Brand Overrides -- */
:root {
    --sidebar-w: 260px;
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --primary-glow: rgba(99, 102, 241, 0.3);
    --primary-muted: rgba(99, 102, 241, 0.12);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s ease;
}
/* Keep Warden indigo as the accent colour */
.t-dark, .t-light { --accent: #6366f1; --accent-bg: rgba(99,102,241,0.15); --accent-text: #818cf8; }

/* -- Scrollbar -- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(99,102,241,0.4); }
.t-light ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); }
.t-light ::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.2); }

/* -- Animations -- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes ragPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
    50% { box-shadow: 0 0 0 4px rgba(239,68,68,0); }
}
@keyframes ragPulseAmber {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0.4); }
    50% { box-shadow: 0 0 0 4px rgba(245,158,11,0); }
}
@keyframes bellShake {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(15deg); }
    50% { transform: rotate(-10deg); }
    75% { transform: rotate(5deg); }
}
@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
@keyframes flashIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulseUrgent {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* -- Page Content Entrance -- */
.page-content { animation: fadeInUp 0.4s ease both; }

/* -- Stat Cards (Warden-specific gradient numbers) -- */
.stat-card[data-color="indigo"] { --stat-color: #6366f1; --stat-color-light: #818cf8; }
.stat-card[data-color="amber"] { --stat-color: #f59e0b; --stat-color-light: #fbbf24; }
.stat-card[data-color="green"] { --stat-color: #10b981; --stat-color-light: #34d399; }
.stat-card[data-color="red"] { --stat-color: #ef4444; --stat-color-light: #f87171; }

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    animation: countUp 0.5s ease forwards;
    background: linear-gradient(135deg, var(--stat-color, var(--primary)), var(--stat-color-light, var(--primary-hover)));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.stat-card:nth-child(1) .stat-number { animation-delay: 0.1s; }
.stat-card:nth-child(2) .stat-number { animation-delay: 0.2s; }
.stat-card:nth-child(3) .stat-number { animation-delay: 0.3s; }
.stat-card:nth-child(4) .stat-number { animation-delay: 0.4s; }

.stat-number.indigo { background: linear-gradient(135deg, #6366f1, #818cf8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-number.amber { background: linear-gradient(135deg, #f59e0b, #fbbf24); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-number.green { background: linear-gradient(135deg, #10b981, #34d399); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-number.red { background: linear-gradient(135deg, #ef4444, #f87171); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* -- Warden Forms (extends shared theme forms) -- */
.form-group {
    margin-bottom: 1.25rem;
}
.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text2);
    margin-bottom: 0.4rem;
    letter-spacing: 0.02em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    font-family: var(--font);
    font-size: 15px;
    color: var(--text);
    background: var(--bg2);
    border: 1px solid var(--bd2);
    border-radius: var(--radius-sm);
    outline: none;
    transition: var(--transition-fast);
    -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
input::placeholder, textarea::placeholder { color: var(--text3); }

/* -- Warden Buttons (extends shared theme) -- */
.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
    border: none;
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--bd2);
    color: var(--text2);
}
.btn-outline:hover {
    border-color: #6366f1;
    color: #6366f1;
    background: rgba(99, 102, 241, 0.05);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
    border: none;
}
.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.45);
    color: #fff;
}

.btn-success, .btn-green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
    border: none;
}
.btn-success:hover, .btn-green:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
    color: #fff;
}

.btn-block { display: flex; width: 100%; }
.btn-lg { height: 48px; font-size: 1rem; }
.btn-loading { opacity: 0.7; pointer-events: none; }

/* -- Flash Messages (Warden-specific) -- */
.flash {
    animation: slideDown 0.3s ease;
    border-radius: 12px;
    padding: 14px 20px;
    border: 1px solid;
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.5;
    word-break: break-word;
    transition: opacity 0.4s ease;
}
.flash.hiding { opacity: 0; }
.flash-success { background: rgba(16, 185, 129, 0.12); color: #15803d; border-color: rgba(16, 185, 129, 0.3); }
.flash-error { background: rgba(239, 68, 68, 0.12); color: #b91c1c; border-color: rgba(239, 68, 68, 0.3); }
.flash-warning { background: rgba(245, 158, 11, 0.08); color: #92400e; border-color: rgba(245, 158, 11, 0.3); }
.flash-info { background: rgba(59, 130, 246, 0.08); color: #1e40af; border-color: rgba(59, 130, 246, 0.3); }
.t-dark .flash-success { color: #6ee7b7; }
.t-dark .flash-error { color: #fca5a5; }
.t-dark .flash-warning { color: #fcd34d; }
.t-dark .flash-info { color: #93c5fd; }

/* -- Warden Badges -- */
.badge-health-safety { background: rgba(249,115,22,0.12); color: #f97316; }
.badge-medication { background: rgba(168,85,247,0.12); color: #a855f7; }
.badge-safeguarding { background: rgba(239,68,68,0.12); color: #ef4444; }
.badge-general { background: rgba(99,102,241,0.12); color: #6366f1; }
.badge-policy { background: rgba(99,102,241,0.12); color: #6366f1; }
.badge-shift-handover { background: rgba(59,130,246,0.12); color: #3b82f6; }
.badge-hr { background: rgba(236,72,153,0.12); color: #ec4899; }
.badge-urgent { background: rgba(239,68,68,0.15); color: #ef4444; animation: pulseUrgent 2s infinite; }
.badge-important { background: rgba(245,158,11,0.15); color: #f59e0b; }
.badge-overdue { background: rgba(239,68,68,0.15); color: #ef4444; }
.badge-scheduled { background: rgba(99,102,241,0.15); color: #818cf8; }
.badge-home-manager { background: rgba(245,158,11,0.12); color: #f59e0b; }
.badge-senior-carer { background: rgba(16,185,129,0.12); color: #10b981; }
.badge-staff-role { background: rgba(148,163,184,0.12); color: #94a3b8; }
.badge-team-leader { background: rgba(99,102,241,0.12); color: #818cf8; }

/* -- Avatar -- */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--primary-muted);
    color: var(--primary);
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}
.avatar-sm { width: 28px; height: 28px; font-size: 0.7rem; }

/* -- Progress Bars -- */
.progress-bar {
    height: 6px;
    background: var(--bg2);
    border-radius: 6px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-fill-green { background: linear-gradient(90deg, #10b981, #34d399); }
.progress-fill-amber { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.progress-fill-red { background: linear-gradient(90deg, #ef4444, #f87171); }

/* -- Table Wrapper (Warden-specific additions) -- */
.table-wrapper {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--bd);
    background: var(--surface);
}
.table-wrapper table { width: 100%; border-collapse: collapse; }
.table-wrapper th {
    background: var(--bg2);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text3);
    padding: 14px 20px;
    text-align: left;
}
.table-wrapper td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--bd);
    font-size: 0.88rem;
    color: var(--text2);
    transition: background 0.15s;
}
.table-wrapper tr:hover td { background: var(--bg2); }
.table-wrapper tr:last-child td { border-bottom: none; }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* -- Trial Banner -- */
.trial-banner {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.trial-banner-info { background: rgba(59, 130, 246, 0.08); color: #1e40af; border: 1px solid rgba(59, 130, 246, 0.2); }
.trial-banner-warning { background: rgba(245, 158, 11, 0.08); color: #92400e; border: 1px solid rgba(245, 158, 11, 0.2); }
.trial-banner-danger { background: rgba(239, 68, 68, 0.08); color: #b91c1c; border: 1px solid rgba(239, 68, 68, 0.2); }
.t-dark .trial-banner-info { color: #93c5fd; }
.t-dark .trial-banner-warning { color: #fcd34d; }
.t-dark .trial-banner-danger { color: #fca5a5; }

/* -- RAG Dots -- */
.rag-dot {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.rag-dot:hover { transform: scale(1.2); }
.rag-green { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 2px 8px rgba(16,185,129,0.3); }
.rag-amber { background: linear-gradient(135deg, #f59e0b, #d97706); box-shadow: 0 2px 8px rgba(245,158,11,0.3); animation: ragPulseAmber 2.5s infinite; }
.rag-red { background: linear-gradient(135deg, #ef4444, #dc2626); box-shadow: 0 2px 8px rgba(239,68,68,0.3); animation: ragPulse 2s infinite; }
.rag-grey { background: rgba(148,163,184,0.2); border: 1px dashed var(--text3); color: var(--text3); }

/* -- Compliance Gauge -- */
.compliance-gauge {
    width: 80px; height: 80px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    position: relative; flex-shrink: 0;
    background: conic-gradient(var(--score-color) calc(var(--score) * 3.6deg), var(--bg2) 0);
}
.compliance-gauge-inner {
    width: 60px; height: 60px; border-radius: 50%;
    background: var(--surface);
    display: flex; align-items: center; justify-content: center;
}
.compliance-gauge-value { font-size: 1.1rem; font-weight: 700; color: var(--score-color); }
.compliance-gauge-conic {
    width: 80px; height: 80px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    position: relative; flex-shrink: 0;
    background: conic-gradient(var(--score-color) calc(var(--score) * 3.6deg), var(--bg2) 0deg);
}
.compliance-gauge-conic-inner {
    width: 60px; height: 60px; border-radius: 50%;
    background: var(--surface);
    display: flex; align-items: center; justify-content: center;
}
.compliance-gauge-conic-value { font-size: 1.1rem; font-weight: 700; color: var(--score-color); }

/* -- Empty States -- */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--surface);
    border: 1px dashed var(--bd);
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
}
.empty-state-icon {
    width: 80px; height: 80px;
    border-radius: 24px;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 1.5rem;
    background: var(--primary-muted);
    color: var(--primary);
    animation: floatIcon 3s ease-in-out infinite;
}
.empty-state h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.empty-state p { color: var(--text2); margin-bottom: 1.5rem; font-size: 0.92rem; }

/* -- Staff Notice Card (mobile) -- */
.notice-card-staff {
    background: var(--surface);
    border: 1px solid var(--bd);
    border-radius: var(--radius);
    transition: var(--transition-fast);
    overflow: hidden;
    position: relative;
}

.btn-acknowledge {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 20px rgba(16,185,129,0.4);
    font-size: 17px;
    font-weight: 700;
    padding: 16px;
    border-radius: 14px;
    width: 100%;
    transition: var(--transition-fast);
    color: #fff;
    border: none;
    cursor: pointer;
    font-family: var(--font);
}
.btn-acknowledge:hover {
    box-shadow: 0 6px 28px rgba(16,185,129,0.6);
    transform: translateY(-1px);
}

/* -- Bell Notification -- */
.bell-has-notifications { animation: bellShake 0.5s ease; }

/* -- Utility -- */
.text-center  { text-align: center; }
.text-muted   { color: var(--text3); }
.text-secondary { color: var(--text2); }
.text-sm      { font-size: 0.85rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* -- Mobile Responsive -- */
@media (max-width: 768px) {
    .notice-row { flex-wrap: wrap; gap: 0.5rem; }
    .notice-row .notice-title { flex-basis: 100%; white-space: normal; }
    .notice-row .notice-date { font-size: 0.75rem; }
}
@media (max-width: 480px) {
    .notice-row .progress-mini { width: 60px; }
}

/* -- Checkbox and Radio Accent -- */
input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--primary);
}

/* -- Card hover exceptions -- */
.card.table-card:hover,
.card[style*="padding: 0"]:hover,
.card[style*="padding:0"]:hover {
    transform: none;
}

/* -- File input -- */
input[type="file"] {
    background: var(--bg2);
    border: 1px solid var(--bd2);
    border-radius: var(--radius-sm);
    padding: 0.65rem 1rem;
    font-family: var(--font);
    font-size: 0.9rem;
    color: var(--text2);
    cursor: pointer;
}
input[type="file"]:hover {
    border-color: var(--primary);
}
input[type="file"]::file-selector-button {
    background: var(--primary-muted);
    color: var(--primary);
    border: none;
    padding: 0.4rem 0.85rem;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    margin-right: 0.75rem;
    font-family: var(--font);
    transition: background 0.15s;
}
input[type="file"]::file-selector-button:hover {
    background: rgba(99, 102, 241, 0.2);
}

/* -- Dark theme date inputs -- */
.t-dark input[type="date"],
.t-dark input[type="time"],
.t-dark input[type="datetime-local"] {
    color-scheme: dark;
}

/* -- Focus visible -- */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
button:focus-visible,
.btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}
