/* Removed broken Google Fonts import for Pyidaungsu */

:root {
    /* --- Modern 60-30-10 Design System --- */
    
    /* Light Mode (Default) - Calm Navy/Teal Palette */
    --bg-main: #f0f4f8;
    --surface-card: #ffffff;
    --primary: #1a5276;         /* Deep Navy Blue (ငြိမ်သက်တဲ့ အပြာရောင်) */
    --secondary: #c0a060;       /* Warm Muted Gold */
    --accent-morning: #b07d2a;  /* Warm Amber */
    --accent-day: #1e7145;      /* Forest Green */
    
    --text-high: #1a202c;
    --text-mid: #4a5568;
    --text-low: #525e71;
    --text-on-primary: #ffffff;
    
    --status-error: #c0392b;
    --status-success: #1e8449;
    --status-warning: #d68910;
    
    /* Effects & Glassmorphism */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --glass-bg: rgba(255, 255, 255, 0.90);
    --glass-border: rgba(255, 255, 255, 0.4);
    
    /* Layout Tokens */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 24px;
    --grid-unit: 8px;
    
    /* Transition */
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;

    /* Legacy mapping for app stability */
    --bg-neutral: var(--bg-main);
    --surface-neutral: var(--surface-card);
    --primary-accent: var(--primary);
    --primary-color: var(--primary);
    --morning-color: var(--accent-morning);
    --day-color: var(--accent-day);
    --danger-color: var(--status-error);
    --success-color: var(--status-success);
    --text-primary: var(--text-high);
    --text-secondary: var(--text-mid);
    --space-1: var(--grid-unit);
    --space-2: calc(var(--grid-unit) * 2);
    --space-3: calc(var(--grid-unit) * 3);
    --space-4: calc(var(--grid-unit) * 4);
    --space-6: calc(var(--grid-unit) * 6);
    --space-8: calc(var(--grid-unit) * 8);
    --highlight-bg: #eaf4fb;
    --highlight-border: #1a5276;
}

/* --- Dark Mode Support --- */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-main: #111827;
        --surface-card: #1f2937;
        --primary: #5b9bd5;       /* Soft sky blue for dark mode */
        --secondary: #d4a843;
        
        --text-high: #e2e8f0;
        --text-mid: #9ca3af;
        --text-low: #6b7280;
        --text-on-primary: #111827;
        
        --glass-bg: rgba(31, 41, 55, 0.92);
        --glass-border: rgba(255, 255, 255, 0.08);
        --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
        
        --highlight-bg: #1c2e40;
        --highlight-border: #5b9bd5;
    }
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 15px;
}
.status-badge.admin {
    background: #e3f2fd;
    color: #1976d2;
}
.status-badge.super-admin {
    background: #fbe9e7;
    color: #d84315;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: 'Pyidaungsu', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-neutral);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    margin: 0;
    padding: var(--space-4) var(--space-2);
    line-height: 1.6;
}

input,
button,
select,
textarea,
.donor-entry {
    font-family: 'Pyidaungsu', sans-serif;
}

.container {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--space-3);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 900px;
    padding: var(--space-4);
    position: relative;
    margin-top: var(--space-2);
}

/* Header & Brand */
header {
    text-align: center;
    margin-bottom: 20px;
}

header h1 {
    font-size: 32px; 
    margin-bottom: var(--space-2);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-2);
    line-height: 1.2;
    color: var(--primary-accent);
    text-shadow: 0 1px 2px rgba(0,0,0,0.05);
    font-weight: 800;
}

header p {
    font-size: 14px;
    color: var(--text-mid);
    margin-top: 5px;
}

.logo-img {
    height: 50px;
    width: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--surface-neutral);
}

.contact-header {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    gap: 15px;
    align-items: center;
}

.contact-link {
    font-size: 16px;
    font-weight: bold;
    color: var(--primary-accent);
    text-decoration: none;
    background: var(--surface-card);
    padding: 5px 12px;
    border-radius: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.contact-btn-mini {
    background: var(--secondary);
    color: var(--primary-accent);
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.notice-box {
    background-color: #eaf4fb;
    border: 1px solid #5b9bd5;
    color: #1a4f72;
    padding: 10px 15px;
    border-radius: 8px;
    margin-top: 15px;
    font-size: 13px;
    font-weight: bold;
    text-align: center;
    line-height: 1.5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    animation: pulse-blue 2.5s infinite;
}

@keyframes pulse-blue {
    0%   { box-shadow: 0 0 0 0 rgba(91, 155, 213, 0.4); }
    70%  { box-shadow: 0 0 0 8px rgba(91, 155, 213, 0); }
    100% { box-shadow: 0 0 0 0 rgba(91, 155, 213, 0); }
}

.summary-counts {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    background-color: var(--bg-neutral);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 5px solid var(--primary-accent);
}

.summary-counts div {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-mid);
    padding: 4px;
}

.total-donors-banner {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 2px 8px !important;
}

.banner-label {
    font-size: 16px !important;
    font-weight: 800 !important;
    color: var(--primary-accent) !important;
    padding: 0 !important;
}

.banner-value {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: var(--text-mid) !important;
    letter-spacing: 0.5px;
    padding: 0 !important;
}

#new-donors-today {
    cursor: pointer;
    color: var(--primary-accent);
}

.upcoming-section {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    overflow: visible;
    padding-bottom: var(--space-2);
}

.upcoming-card {
    flex: 1 1 0;
    min-width: 0;
    background: var(--surface-neutral);
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: var(--space-2);
    padding: var(--space-2);
    box-shadow: var(--shadow-md);
    text-align: center;
    border-top: 4px solid var(--primary-accent);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.upcoming-card h3 {
    margin: 0 0 12px 0;
    font-size: 17px;
    color: var(--primary-accent);
    border-bottom: 2px solid var(--secondary);
    padding-bottom: 6px;
    display: inline-block;
}

.upcoming-row {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    font-size: 13px;
    margin-top: var(--space-1);
}

.upcoming-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    padding: var(--space-1) var(--space-2);
    border-radius: 6px;
}

.upcoming-label {
    font-weight: bold;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 70px;
    flex-shrink: 0;
}

.upcoming-name {
    color: var(--text-high);
    font-weight: 600;
    text-align: right;
    font-size: 13px;
    word-break: break-word;
    line-height: 1.4;
    flex: 1;
    margin-left: 5px;
}

.badge-morning { color: var(--morning-color); }
.badge-day { color: var(--day-color); }

.no-data {
    color: #aaa;
    font-style: italic;
    font-weight: normal;
    font-size: 12px;
}

/* Calendar Styles */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2);
    gap: var(--space-1);
}

.month-label-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px;
}

.calendar-header h2 {
    font-size: 24px;
    margin: 0;
    color: var(--primary-accent);
    font-weight: 800;
    cursor: pointer;
    text-align: center;
    letter-spacing: -0.01em;
}

.calendar-header .mm-month-header {
    font-size: 15px;
    color: var(--text-mid);
    font-weight: bold;
}

#month-picker {
    border: 2px solid var(--primary-accent);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-accent);
    background: white;
    outline: none;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

#month-picker:focus {
    box-shadow: 0 0 0 3px rgba(128, 0, 0, 0.2);
}

.nav-btn {
    background: var(--primary-accent);
    color: white;
    border: none;
    border-radius: var(--space-2);
    width: auto;
    min-width: 64px;
    height: 48px;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 var(--space-2);
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
}

.nav-btn:hover {
    filter: brightness(1.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.2);
}

.today-btn {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    background: #2d3748;
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background-color: #e0e0e0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.calendar-cell {
    background-color: var(--surface-card);
    padding: 0;
    min-height: 140px;
    height: 140px;
    font-size: 14px;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
    overflow: hidden;
}

.calendar-cell:hover {
    box-shadow: inset 0 0 0 1px #e2e8f0;
    z-index: 2;
}

.day-header {
    font-weight: 700;
    padding: 10px 4px;
    background-color: var(--primary-accent);
    color: #ffffff;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.05em;
    border-bottom: none;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: auto;
    height: auto;
}

.day-number {
    font-weight: 900;
    font-size: 18px;
    color: var(--text-high);
    line-height: 1;
}

.today {
    background-color: #f0f4ff !important;
    border: 2px solid var(--primary-accent) !important;
    position: relative;
    z-index: 10;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(128, 0, 0, 0.15);
}

.today .day-number {
    background-color: var(--primary-accent);
    color: #fff;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.date-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: calc(100% + 8px);
    margin: -4px -4px 6px -4px;
    padding: 6px 8px;
    background-color: #f8fafc;
    border-bottom: 1px solid #edf2f7;
}

.donations-container {
    margin-top: 5px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    flex-grow: 1;
    justify-content: flex-start;
}

.donor-entry {
    font-size: 11px;
    font-weight: 700;
    color: #2d3748;
    padding: 4px 6px;
    border-radius: 4px;
    text-align: left;
    cursor: pointer;
    width: calc(100% - 8px);
    margin-left: 4px;
    line-height: 1.2;
    margin-bottom: 2px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.donor-entry:hover {
    transform: translateX(2px);
    background-color: var(--surface-card) !important;
    box-shadow: var(--shadow-md);
    z-index: 10;
}

.donor-morning {
    background-color: #fff9e6;
    border-left-color: #f59e0b; /* Amber 500 */
}

.donor-day {
    background-color: #f0fff4;
    border-left-color: #22c55e; /* Green 500 */
}

.empty-slot,
.status-available {
    background: #ffffff !important;
    border: 1.5px dashed #cbd5e1 !important;
    color: var(--text-mid) !important;
    font-weight: 600 !important;
    box-shadow: none !important;
    transition: all 0.2s ease;
    opacity: 0.9;
}

.status-available.donor-morning,
.mobile-donor-item.status-available.morning {
    border-color: #f59e0b !important;
    color: #b45309 !important;
}

.status-available.donor-day,
.mobile-donor-item.status-available.day {
    border-color: #22c55e !important;
    color: #15803d !important;
}

.status-available:hover {
    background-color: #f8fafc !important;
    border-style: solid !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05) !important;
    opacity: 1;
}

.status-pending {
    border-left: 3px solid #f59e0b !important;
    color: #b45309 !important;
    font-size: 9px;
    opacity: 0.9;
}

.status-pending i {
    color: #f59e0b;
    margin-right: 3px;
}

.status-masked {
    border-left: 3px solid #94a3b8 !important;
    color: #64748b !important;
    opacity: 0.8;
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 15px;
    content-visibility: auto;
    contain-intrinsic-size: 0 500px;
}

.clickable-summary {
    cursor: pointer !important;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.clickable-summary:hover {
    background-color: #f0f4f8 !important;
    transform: translateY(-1px);
}

/* ---- Monthly Mini Summary Bar ---- */
.monthly-mini-bar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 10px !important;
    background: rgba(26, 82, 118, 0.06);
    border-radius: 10px;
    border-left: 3px solid var(--primary-accent);
    margin-top: 4px;
    width: 100%;
}

.mini-bar-header {
    font-size: 13px !important;
    font-weight: 800 !important;
    color: var(--primary-accent) !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.02em;
}

.mini-bar-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 !important;
}

.mini-bar-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 13px !important;
    font-weight: 700 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.10);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
    user-select: none;
}

.mini-bar-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    filter: brightness(1.05);
}

.mini-bar-badge:active {
    transform: translateY(0);
    filter: brightness(0.95);
}

.mini-morning-badge {
    background: linear-gradient(135deg, #fff7e0 0%, #ffe9a0 100%);
    color: #92600a !important;
    border: 1.5px solid #f59e0b;
}

.mini-day-badge {
    background: linear-gradient(135deg, #e8fff2 0%, #bbf7d0 100%);
    color: #14532d !important;
    border: 1.5px solid #22c55e;
}

.mini-count-pill {
    background: rgba(0,0,0,0.10);
    border-radius: 999px;
    padding: 0px 7px;
    font-size: 14px;
    font-weight: 900;
    min-width: 22px;
    text-align: center;
    display: inline-block;
}

/* ---- Offline Cache Banner ---- */
.offline-cache-banner {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(90deg, #fff3cd, #ffe69c);
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 5px 10px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #7c5c00 !important;
    animation: pulse-blue 3s infinite;
    width: 100%;
}

@media (prefers-color-scheme: dark) {
    .monthly-mini-bar {
        background: rgba(91, 155, 213, 0.10);
    }
    .mini-morning-badge {
        background: linear-gradient(135deg, #3d2a00 0%, #5c3d00 100%);
        color: #fcd34d !important;
        border-color: #d97706;
    }
    .mini-day-badge {
        background: linear-gradient(135deg, #0a2e18 0%, #14532d 100%);
        color: #86efac !important;
        border-color: #16a34a;
    }
    .offline-cache-banner {
        background: linear-gradient(90deg, #3d2a00, #5c3d00);
        color: #fcd34d !important;
        border-color: #d97706;
    }
}

.modal-backdrop.show {
    display: flex;
    animation: fadeIn var(--transition-fast);
}

.modal-content {
    background: var(--surface-card);
    padding: var(--space-4);
    border-radius: var(--space-3);
    width: 100%;
    max-width: 448px;
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(0,0,0,0.05);
}

.modal-content h3 {
    margin-top: 0;
    color: var(--primary-accent);
    font-size: 18px;
    border-bottom: 1px solid #eee;
    padding-bottom: var(--space-1);
    margin-bottom: var(--space-2);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.modal-actions button {
    padding: 10px 20px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-fast);
}

.primary-btn { background: var(--primary); color: white; }
.success-btn { background: var(--status-success); color: white; }
.danger-btn { background: var(--status-error); color: white; }
.cancel-btn { background: #e2e8f0; color: #4a5568; }

/* --- UTILITIES --- */
.text-red { color: var(--status-error) !important; }
.text-center { text-align: center !important; }
.centered-text { text-align: center !important; width: 100%; padding: 20px; color: var(--text-low); }
.w-full { width: 100% !important; }
.hidden { display: none !important; }
.pos-relative { position: relative !important; }
.pos-absolute { position: absolute !important; }
.flex { display: flex !important; }
.flex-col { flex-direction: column !important; }
.gap-sm { gap: 8px !important; }
.gap-md { gap: 16px !important; }
.items-center { align-items: center !important; }
.justify-center { justify-content: center !important; }

/* --- COMPONENT CLASSES --- */
.modal-content-lg { max-width: 600px !important; }
.scroll-y { overflow-y: auto !important; }
.max-h-400 { max-height: 400px !important; }
.input-group-relative { position: relative; width: 100%; }
.input-password { width: 100%; padding-right: 40px !important; }
.icon-password-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); cursor: pointer; color: var(--text-low); }
.env-banner-style { background: var(--status-warning); color: #000; text-align: center; font-size: 12px; font-weight: bold; padding: 4px; position: sticky; top: 0; z-index: 9999; box-shadow: var(--shadow-sm); }
.loading-text { font-size: 12px; color: var(--text-low); }

/* --- APP LINKED COMPONENTS --- */
#loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.82);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: 3000;
}

.spinner {
    width: 42px;
    height: 42px;
    border: 4px solid #e5e7eb;
    border-top-color: var(--primary-accent);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

.admin-only { display: none; }
.flex-grow { flex: 1 1 auto; }

.admin-btn,
.action-btn {
    border: none;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-accent);
    color: #fff;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.secondary,
.action-btn.secondary {
    background: #4a5568;
    color: #fff;
}

.danger-bg {
    background: var(--status-error) !important;
    color: #fff !important;
}

.morning-bg { background: #d97706 !important; color: #fff !important; } /* Amber 600 */
.day-bg { background: #16a34a !important; color: #fff !important; } /* Green 600 */

/* Choice Modal Slot Filled State */
.primary-btn.slot-filled.morning-bg {
    background: #d4d4d8 !important; /* Muted Light Grey */
    color: #71717a !important;
    opacity: 0.8;
}

.primary-btn.slot-filled.day-bg {
    background: #9ca3af !important; /* Muted Green-Greyish */
    color: #f3f4f6 !important;
    opacity: 0.8;
}

/* Adjusting to match user image even closer */
.primary-btn.slot-filled.day-bg {
    background-color: #a3b1a3 !important; /* Specifically muted green for already exists */
    color: #ffffff !important;
}

.primary-btn.slot-filled.morning-bg {
    background-color: #eab308 !important; /* Keep it yellow but maybe different? */
    /* Wait, the user image shows Yellow is the ACTIVE one in his case for morning */
    /* And Muted Green for Day (ရှိပြီး) */
}

.tabs-container { display: none; }
.search-hero-container {
    margin-bottom: 12px;
    display: flex;
    justify-content: center;
}

.search-hero-btn {
    border: none;
    border-radius: 999px;
    padding: 10px 16px;
    background: var(--primary-accent);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.admin-quick-access {
    display: none;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.admin-quick-btn {
    border: none;
    border-radius: 10px;
    padding: 8px 12px;
    background: #334155;
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.quick-badge,
.quick-badge-style {
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    background: var(--status-error);
    color: #fff;
    padding: 0 6px;
}

.btn-messages { background: #2563eb; }
.btn-bookings { background: #059669; }

.donors-section {
    margin: 18px 0 12px;
}

.donors-section h2 {
    margin: 0 0 15px;
    font-size: 19px;
    color: var(--primary-accent);
    font-weight: 800;
    border-bottom: 2px solid var(--secondary);
    display: inline-block;
    padding-bottom: 4px;
}

.donor-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.donor-card {
    background: var(--surface-card);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.donor-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--primary-accent);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.donor-card:active {
    transform: scale(0.96);
    box-shadow: none;
    border-color: var(--primary-accent);
}

.donor-card:active::after {
    opacity: 0.08;
    transition: opacity 0.05s ease;
}

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

.donor-card .icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    font-size: 20px;
}

.donor-card .icon.coffee { color: var(--morning-color); background: #fffcf0; }
.donor-card .icon.utensils { color: var(--day-color); background: #f0fdf4; }

.donor-card-info {
    flex-grow: 1;
}

.donor-card-info h3 { 
    margin: 0; 
    font-size: 13px; 
    color: var(--text-mid); 
    font-weight: 700;
}

.donor-card-info p { 
    margin: 4px 0 0; 
    font-size: 20px; 
    font-weight: 900; 
    color: var(--primary-accent); 
    line-height: 1;
}

.donor-card-action {
    color: var(--primary-accent);
    opacity: 0.4;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, opacity 0.2s;
}

.donor-card:hover .donor-card-action,
.donor-card:active .donor-card-action {
    transform: translateX(4px);
    opacity: 0.8;
}

.no-donations { margin: 8px 0 0; color: var(--text-low); font-size: 13px; }

.calendar-container { margin-top: 14px; }

.mm-date { font-size: 11px; color: #334155; line-height: 1.2; font-weight: 700; }
.mm-date.full-moon,
.mm-date.new-moon { color: var(--primary-accent); }
.mm-date.sabbath { color: #d97706; }

.booking-link {
    color: var(--primary-accent);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    text-decoration: underline;
}

.mobile-list-view { display: none; }
.mobile-list-row {
    display: grid;
    grid-template-columns: 75px 75px 1fr;
    gap: 8px;
    align-items: stretch;
    padding: 10px;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
    min-height: 90px; /* Enforce uniform row height */
}

.mobile-list-row.today-row { 
    background: #fffdf5; 
    border: 3px solid #ffbf00 !important; 
    border-radius: 12px;
    margin: 8px 0;
    box-shadow: 0 4px 12px rgba(255, 191, 0, 0.25);
    position: relative;
    overflow: hidden;
}

.today-row .col-eng-date {
    background: #ffbf00 !important;
    color: #000 !important;
    border-right: 1px solid rgba(0,0,0,0.1);
    margin: -10px 0 -10px -10px;
    padding: 10px;
    height: calc(100% + 20px);
}

.today-row .col-eng-date .day-val {
    color: rgba(0,0,0,0.7) !important;
}
.calendar-cell.other-month { background: #f8fafc; }

.col-eng-date {
    border-right: 1px solid #e5e7eb;
    padding-right: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.col-eng-date .date-val { font-size: 20px; font-weight: 900; line-height: 1; }
.col-eng-date .day-val { font-size: 11px; color: var(--text-mid); }

.col-mm-date {
    font-size: 12px;
    color: var(--text-mid);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-right: 1px solid #e5e7eb;
    padding-right: 4px;
}

.col-donors {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mobile-donor-item {
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    min-height: 32px;
}

.mobile-donor-item.morning { background: #fff9e6; border-left: 3px solid var(--morning-color); }
.mobile-donor-item.day { background: #f0fff4; border-left: 3px solid var(--day-color); }
.mobile-donor-item.status-pending { border-left: 3px solid #f59e0b !important; color: #b45309 !important; }
.mobile-donor-item.status-available { border-left: 3px solid var(--primary-accent) !important; color: var(--primary-accent) !important; }
.mobile-donor-empty { color: #9ca3af; font-size: 12px; padding: 4px 0; }

.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.form-group label { font-size: 13px; font-weight: 700; color: var(--text-mid); }
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
    color: var(--text-high);
    font-size: 14px;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 10px;
}

.results-table th,
.results-table td {
    border-bottom: 1px solid #e5e7eb;
    padding: 8px;
    text-align: left;
    vertical-align: top;
}

/* Excel Style Summary Table */
.excel-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    margin-top: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
}

.excel-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 800;
    text-align: left;
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
}

.excel-table td {
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    color: #1e293b;
    vertical-align: top;
}

.excel-table tr:nth-child(even) {
    background-color: #f1f5f9;
}

.excel-table tr:hover {
    background-color: #e0e7ff;
}

.results-table thead th {
    background: #f8fafc;
    color: var(--text-mid);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.booking-info-box {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 700;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: #e5e7eb;
    color: #334155;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

#toast-container {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 4000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    opacity: 0;
    transform: translateY(-6px);
    transition: all var(--transition-fast);
    color: #fff;
    padding: 10px 12px;
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    font-size: 13px;
    max-width: 280px;
}

.toast.show { opacity: 1; transform: translateY(0); }
.toast.info { background: #2563eb; }
.toast.success { background: #16a34a; }
.toast.warning { background: #d97706; }
.toast.error { background: #dc2626; }

/* --- Admin Lists & Items --- */
.message-item, .request-item {
    background: var(--surface-card);
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: var(--radius-md);
    padding: var(--space-2);
    margin-bottom: var(--space-2);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.message-item:hover, .request-item:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--secondary);
}

.message-item.unread, .request-item.pending {
    border-left: 4px solid var(--primary);
}

.message-item.read, .request-item.confirmed {
    border-left: 4px solid var(--status-success);
    opacity: 0.85;
}

.message-header, .request-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-1);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding-bottom: var(--space-1);
}

.message-header strong, .request-header strong {
    color: var(--primary);
    font-size: 15px;
}

.message-header small, .request-header small {
    color: var(--text-low);
    font-size: 11px;
}

.message-body {
    font-size: 13px;
    color: var(--text-mid);
    margin: var(--space-1) 0;
    line-height: 1.5;
    white-space: pre-wrap;
}

.message-actions, .request-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: var(--space-2);
}

/* --- Action Buttons (Small) --- */
.btn-small {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    background: #e2e8f0;
    color: #475569;
    transition: all var(--transition-fast);
}

.btn-small:hover {
    filter: brightness(0.9);
    transform: translateY(-1px);
}

.btn-small.success {
    background: var(--status-success);
    color: white;
}

.btn-small.danger {
    background: var(--status-error);
    color: white;
}

.status-badge.pending { background: #fef3c7; color: #92400e; }
.status-badge.confirmed { background: #dcfce7; color: #166534; }
.status-badge.rejected { background: #fee2e2; color: #991b1b; }
.v-info { display: inline-flex; align-items: center; gap: 8px; justify-content: center; }
.v-sep { opacity: 0.5; }
.tg-contact { display: flex; justify-content: center; }
.copy-text { font-size: 11px; color: var(--text-low); }

.footer-contact-box { margin-top: 12px; }
.footer-contact-label { margin: 0 0 6px; color: var(--text-mid); font-size: 12px; }
.footer-phone-link { color: var(--primary-accent); font-weight: 800; text-decoration: none; }
.tg-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    text-decoration: none;
    font-size: 12px;
    background: #0ea5e9;
    border-radius: 999px;
    padding: 5px 10px;
}

/* --- MEDIA QUERIES --- */
@media (max-width: 600px) {
    body { padding: 0; align-items: flex-start; background: var(--surface-card); }
    .container { padding: 10px; border-radius: 0; box-shadow: none; margin-bottom: 60px; }
    header h1 { flex-direction: column; gap: 8px; font-size: 18px; }
    .logo-img { width: 45px; height: 45px; }
    .summary-counts { flex-direction: column; }
    .donor-cards { grid-template-columns: 1fr; }
    .tabs-container { display: flex !important; justify-content: center; gap: 10px; margin-bottom: 20px; }
    .tab-btn { background: #eee; border: none; padding: 8px 16px; border-radius: 20px; font-size: 13px; font-weight: bold; color: #666; cursor: pointer; }
    .tab-btn.active { background: var(--primary); color: white; }
    .upcoming-section { flex-direction: column !important; overflow-x: hidden !important; padding-bottom: 0 !important; }
    .upcoming-card { display: none !important; width: 100% !important; flex: none !important; }
    .upcoming-section[data-active-tab="0"] .upcoming-card:nth-child(1),
    .upcoming-section[data-active-tab="1"] .upcoming-card:nth-child(2),
    .upcoming-section[data-active-tab="2"] .upcoming-card:nth-child(3) { display: flex !important; }
    .calendar-grid, .day-header { display: none !important; }
    .mobile-list-view { display: block; margin-top: 10px; border: 1px solid #e0e0e0; border-radius: 8px; overflow: hidden; }
    .mobile-list-row {
        display: flex;
        align-items: stretch;
        padding: 0;
        border-bottom: 1px solid #edf2f7;
        background: #fff;
    }
    .today-row {
        background-color: #fff9db !important;
        border-left: 4px solid var(--primary-accent);
    }
    .col-eng-date {
        flex: 0 0 65px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 10px 5px;
        border-right: 1px solid #edf2f7;
    }
    .col-eng-date .date-val { font-size: 22px; font-weight: 900; color: var(--text-high); line-height: 1; }
    .col-eng-date .day-val { font-size: 11px; font-weight: 700; color: var(--text-low); text-transform: uppercase; margin-top: 2px; }

    .col-mm-date {
        flex: 0 0 65px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 8px 4px;
        font-size: 13px;
        font-weight: 800;
        color: var(--primary-accent);
        border-right: 1px solid #edf2f7;
        line-height: 1.2;
    }
    .col-donors {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 8px;
        padding: 10px 12px !important;
    }
    .mobile-donor-item {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
        max-width: 100%;
        font-size: 13px;
        font-weight: 600;
        color: var(--text-high);
    }
    .modal-backdrop {
        align-items: flex-end;
        padding: 0;
        overflow: hidden;
    }
    .modal-content {
        max-width: 100% !important;
        width: 100%;
        border-radius: 20px 20px 0 0 !important;
        margin: 0;
        padding: 25px;
        max-height: 85vh;
        animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border: none;
        box-shadow: 0 -5px 25px rgba(0,0,0,0.15);
    }
    @keyframes slideUp {
        from { transform: translateY(100%); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
    }
    .modal-actions {
        flex-direction: column-reverse;
        gap: 10px;
    }
    .modal-actions button {
        width: 100%;
        padding: 14px;
        font-size: 16px;
    }
    .mobile-donor-item.status-available {
        background: #f8fafc;
        border: 1px dashed var(--primary-accent) !important;
        color: var(--primary-accent) !important;
        padding: 10px 12px;
        margin-top: 4px;
        justify-content: center;
        font-weight: 800;
        font-size: 14px;
        border-radius: 12px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        animation: pulse-soft 2s infinite;
    }
    @keyframes pulse-soft {
        0% { border-color: var(--primary-accent); box-shadow: 0 0 0 0 rgba(26, 82, 118, 0.1); }
        50% { border-color: var(--secondary); box-shadow: 0 0 0 4px rgba(192, 160, 96, 0.05); }
        100% { border-color: var(--primary-accent); box-shadow: 0 0 0 0 rgba(26, 82, 118, 0.1); }
    }
}

@media print {
    @page {
        size: A4;
        margin: 15mm;
    }

    body {
        font-size: 13pt !important;
        background: white !important;
        color: black !important;
    }

    .no-print, .footer, .calendar-header button, .scroll-hint, .calendar-grid, .day-header { 
        display: none !important; 
    }

    .container { 
        box-shadow: none !important; 
        border: none !important; 
        width: 100% !important; 
        max-width: 100% !important;
        padding: 0 !important; 
        margin: 0 !important; 
        background: white !important;
    }

    header h1 {
        font-size: 24pt !important;
        color: black !important;
        margin-bottom: 5mm !important;
    }

    .mobile-list-view { 
        display: block !important; 
        border: 2px solid #333 !important; 
        border-radius: 0 !important;
        margin-top: 10px !important;
    }

    .mobile-list-row { 
        break-inside: avoid; 
        border-bottom: 2px solid #333 !important; 
        padding: 5px 0 !important;
        background: white !important;
    }

    .col-eng-date {
        flex: 0 0 80px !important;
        border-right: 2px solid #333 !important;
    }

    .col-eng-date .date-val {
        font-size: 20pt !important;
        color: black !important;
    }

    .col-mm-date {
        flex: 0 0 110px !important;
        font-size: 13pt !important;
        font-weight: 800 !important;
        color: black !important;
        border-right: 2px solid #333 !important;
    }

    .col-donors {
        padding: 10px 15px !important;
    }

    .mobile-donor-item {
        font-size: 14pt !important; 
        font-weight: 700 !important;
        color: black !important;
        margin-bottom: 5px !important;
        white-space: normal !important; 
    }

    .badge-morning, .badge-day { color: black !important; font-weight: 900 !important; }
}

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Footer */
.footer { border-top: 2px dashed #e0e0e0; padding-top: 15px; margin-top: 20px; text-align: center; }
.app-branding-footer { margin-top: 15px; font-size: 11px; color: var(--text-low); display: flex; flex-direction: column; gap: 8px; }

/* --- Donor View Modal Styles --- */
.donor-details-view {
    padding: 10px 0;
}

.view-header-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.view-date-badge {
    background: var(--primary-accent);
    color: white;
    padding: 8px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
    box-shadow: var(--shadow-md);
}

.view-day {
    font-size: 24px;
    font-weight: 900;
    line-height: 1;
}

.view-month {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.view-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.view-mm-date {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-mid);
}

.view-type-label {
    font-size: 12px;
    font-weight: 800;
    padding: 2px 10px;
    border-radius: 20px;
    background: #f1f5f9;
    align-self: flex-start;
}

.view-divider {
    border: none;
    height: 1px;
    background: #e2e8f0;
    margin: 15px 0;
}

.view-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.view-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.view-row label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-low);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.view-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-high);
}

.name-value {
    font-size: 20px;
    color: var(--primary-accent);
}

.view-status-banner {
    padding: 12px;
    border-radius: 12px;
    text-align: center;
    font-weight: 800;
    margin-bottom: 15px;
}

.view-status-banner.pending {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fcd34d;
}

.view-status-banner.available {
    background: #f0fff4;
    color: #15803d;
    border: 1px solid #86efac;
}

.view-help-text {
    font-size: 13px;
    color: var(--text-mid);
    text-align: center;
}

.view-masked-msg {
    text-align: center;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    font-size: 14px;
    color: var(--text-mid);
}

.margin-top-10 {
    margin-top: 10px;
}

/* --- Holiday Styling --- */
.holiday-label {
    font-size: 9px;
    background: #FFEDD5;
    color: #9A3412;
    padding: 1px 4px;
    border-radius: 4px;
    font-weight: bold;
    margin-bottom: 2px;
    text-align: center;
    border: 1px solid #FED7AA;
}

.mobile-holiday-label {
    font-size: 10px;
    color: #B45309;
    font-weight: 800;
    margin-top: 2px;
    background: #FFFBEB;
    padding: 1px 4px;
    border-radius: 4px;
    display: inline-block;
}

.holiday-row {
    border-left: 4px solid #F59E0B !important;
    background-color: #FFFBF0 !important;
}

.holiday-badge-main {
    display: block;
    font-size: 11px;
    background: #F59E0B;
    color: white;
    padding: 2px 8px;
    border-radius: 6px;
    margin-top: 4px;
    font-weight: bold;
    text-align: center;
}

.holiday-card {
    border-color: #F59E0B !important;
    background: linear-gradient(to bottom, #FFFFFF, #FFFBEB) !important;
}
