/* Main styles for the preschool meal management system */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Touch-specific spacing to reduce accidental taps */
@media (hover: none) and (pointer: coarse) {
  .note-btn {
    margin-left: 10px;
    margin-right: 4px;
  }
}

:root {
    --primary-color: #3498db;      /* Ocean blue */
    --secondary-color: #f39c12;    /* Gold/treasure */
    --accent-color: #2ecc71;       /* Island green */
    --dark-color: #34495e;         /* Deep sea */
    --light-color: #ecf0f1;        /* Sand/beach */
    --success-color: #2ecc71;
    --error-color: #e74c3c;
}

body {
    font-family: 'Baloo 2', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--light-color);
    background-image: url('data:image/svg+xml;utf8,<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><circle cx="20" cy="20" r="10" fill="%234ecdc4" opacity="0.2"/><circle cx="60" cy="60" r="15" fill="%23ff6b6b" opacity="0.1"/><circle cx="80" cy="30" r="8" fill="%23ffe66d" opacity="0.15"/></svg>');
    background-size: 200px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    min-height: 100vh;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Header styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 3px dashed var(--accent-color);
}

header h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
    position: relative;
    padding: 0 10px;
}

.user-info {
    text-align: right;
    font-size: 0.9rem;
}

.user-info a {
    margin-left: 10px;
    color: #3498db;
    text-decoration: none;
}

.user-info a:hover {
    text-decoration: underline;
}

.user-info .refresh-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    margin-left: 10px;
    color: var(--primary-color);
    text-decoration: none;
    transition: transform 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
    opacity: 0.9;
}

.user-info .refresh-link:hover {
    transform: rotate(90deg);
    background-color: rgba(52, 152, 219, 0.12);
    text-decoration: none;
}

.user-info .refresh-link:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* Main content area */
main {
    min-height: 400px;
}

/* Footer styles */
footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 2px dashed var(--secondary-color);
    color: #888;
    font-size: 0.9rem;
}

/* Form styles */
.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="time"],
select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
}

.btn:hover {
    background-color: #2980b9;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.35);
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-danger {
    background-color: #e74c3c;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-danger:focus {
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.35);
}

.btn-success {
    background-color: #2ecc71;
}

.btn-success:hover {
    background-color: #27ae60;
}

/* Login form */
#login-container {
    max-width: 450px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: white;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    border: 6px solid var(--secondary-color);
}

#login-container h2 {
    font-size: 1.8rem;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 1.5rem;
}

#login-container::before {
    content: '';
    position: absolute;
    top: -15px;
    left: -15px;
    width: 30px;
    height: 30px;
    background-color: var(--accent-color);
    border-radius: 50%;
    z-index: 0;
}

#login-container::after {
    content: '';
    position: absolute;
    bottom: -15px;
    right: -15px;
    width: 30px;
    height: 30px;
    background-color: var(--primary-color);
    border-radius: 50%;
    z-index: 0;
}

#login-form .form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

#login-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: var(--dark-color);
    font-size: 1rem;
    transition: all 0.3s ease;
}

#login-form input {
    width: 100%;
    padding: 12px 15px;
    border: 3px solid #e1e1e1;
    border-radius: 15px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #f9f9f9;
}

#login-form input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.2);
}

#login-form button {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 0 darken(var(--primary-color), 10%);
}

#login-form button:hover {
    background-color: #ff5252;
    transform: translateY(-2px);
}

#login-form button:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 darken(var(--primary-color), 10%);
}

/* Decorative elements for the login form */
.login-decoration {
    position: absolute;
    z-index: -1;
}

.login-decoration.pencil {
    width: 60px;
    height: 10px;
    background-color: var(--accent-color);
    top: 20px;
    right: -20px;
    transform: rotate(45deg);
}

.login-decoration.crayon {
    width: 10px;
    height: 50px;
    background-color: var(--secondary-color);
    bottom: 30px;
    left: -5px;
    transform: rotate(-20deg);
}

/* Password field with a fun icon */
.password-container {
    position: relative;
}

.password-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #777;
}

/* Alert styles for login */
#login-alert {
    padding: 10px 15px;
    margin-bottom: 15px;
    border-radius: 10px;
    display: none;
}

#login-alert.error {
    background-color: rgba(231, 76, 60, 0.2);
    color: #E74C3C;
    border: 1px solid #E74C3C;
    display: block;
}

/* Alert messages */
.alert {
    padding: 10px 15px;
    margin-bottom: 15px;
    border-radius: 4px;
    border-left: 4px solid;
}

.alert-info {
    background-color: #e3f2fd;
    border-color: #2196F3;
    color: #0d47a1;
}

.alert-warning {
    background-color: #fff8e1;
    border-color: #ffc107;
    color: #ff6f00;
}

.alert strong {
    font-weight: 600;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Improved Attendance toggle */
.attendance-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
    border: 1px solid #ddd;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.attendance-toggle:hover {
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.toggle-slider {
    width: 50px;
    height: 24px;
    border-radius: 12px;
    margin-right: 12px;
    position: relative;
    transition: background-color 0.3s;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-text {
    font-weight: 500;
    font-size: 14px;
    transition: color 0.3s;
}

/* Present state */
.attendance-toggle.present {
    background-color: rgba(76, 175, 80, 0.05);
    border-color: #4CAF50;
}

.attendance-toggle.present .toggle-slider {
    background-color: #4CAF50;
}

.attendance-toggle.present .toggle-slider:after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    top: 2px;
    right: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    transition: all 0.3s;
}

.attendance-toggle.present .toggle-text {
    color: #388E3C;
}

/* Absent state */
.attendance-toggle.absent {
    background-color: rgba(244, 67, 54, 0.05);
    border-color: #F44336;
}

.attendance-toggle.absent .toggle-slider {
    background-color: #F44336;
}

.attendance-toggle.absent .toggle-slider:after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    transition: all 0.3s;
}

.attendance-toggle.absent .toggle-text {
    color: #D32F2F;
}

/* Status colors */
.present {
    color: #4CAF50;
}

.absent {
    color: #F44336;
}

/* Status badge */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 14px;
}

.status-badge.present {
    background-color: rgba(76, 175, 80, 0.2);
    color: #388E3C;
    border: 1px solid #4CAF50;
}

.status-badge.absent {
    background-color: rgba(244, 67, 54, 0.2);
    color: #D32F2F;
    border: 1px solid #F44336;
}

/* User action buttons styling */
td .btn {
    margin: 2px;
    white-space: nowrap;
}

/* Action column styling */
table td:last-child {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    gap: 5px;
}

/* Ensure buttons don't break into multiple lines */
.edit-user-btn,
.delete-user-btn,
.reset-password-btn,
.add-child-for-parent-btn {
    flex-shrink: 0;
}

/* Countdown Timer Styles */
.timer-container {
    margin: 15px 0;
    text-align: center;
}

.timer-label {
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: #555;
}

.timer-display {
    font-size: 1.8rem;
    font-weight: bold;
    padding: 8px 15px;
    background-color: #e8f5e9;
    border-radius: 6px;
    display: inline-block;
    min-width: 160px;
    color: #2e7d32;
}

.timer-display.warning {
    background-color: #fff3e0;
    color: #e65100;
}

.timer-display.critical {
    background-color: #ffebee;
    color: #c62828;
    animation: pulse 1s infinite;
}

.time-value {
    display: inline-block;
    min-width: 34px;
    text-align: center;
}

.timer-expired {
    font-size: 1.1rem;
    font-weight: bold;
    color: #c62828;
    padding: 10px 15px;
    background-color: #ffebee;
    border-radius: 6px;
    border-left: 4px solid #c62828;
}

.special-note {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #ff6f00;
    font-style: italic;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
    100% {
        opacity: 1;
    }
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

table th,
table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

table th {
    background-color: #f2f2f2;
    font-weight: 600;
}

table tr:hover {
    background-color: #f5f5f5;
}

/* Tab styling fixes */
.tab-nav {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    border-bottom: 2px solid var(--primary-color);
}

.tab-nav li {
    margin-right: 5px;
}

.tab-nav a {
    display: block;
    padding: 10px 15px;
    color: var(--dark-color);
    text-decoration: none;
    border-radius: 8px 8px 0 0;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    border-bottom: none;
}

.tab-nav a:hover,
.tab-nav a.active {
    background-color: var(--primary-color);
    color: white;
}

.tab-nav .header-icons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-nav .tab-icon {
    font-size: 1rem;
}

.tab-nav .tab-text {
    margin: 0 5px;
}

/* Tabs */
.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.tab {
    padding: 10px 15px;
    cursor: pointer;
    border: 1px solid transparent;
    border-bottom: none;
    margin-right: 5px;
}

.tab.active {
    background-color: #fff;
    border-color: #ddd;
    border-radius: 5px 5px 0 0;
    margin-bottom: -1px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Attendance table */
.attendance-table td {
    text-align: center;
}

/* --- Child Notes UI --- */
.note-btn {
    margin-left: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;              /* avoid vertical stacking within button */
    white-space: nowrap;         /* keep glyphs on one line */
    vertical-align: middle;
    opacity: 0.7;
    transition: opacity 0.2s ease, transform 0.1s ease;
    position: relative;
    /* Larger, consistent hit area */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;                 /* keep width */
    min-height: 48px;            /* larger touch size (~WCAG target) */
    height: auto;                /* allow stretching with row */
    align-self: stretch;         /* stretch to row height when possible */
    padding-block: 2px;          /* small inner breathing room */
    box-sizing: content-box;
    border-radius: 6px;
}
.note-btn:hover { opacity: 1; transform: translateY(-1px); }
.note-btn:focus { outline: 2px solid var(--secondary-color); outline-offset: 2px; }
.note-btn.has-note { opacity: 1; color: var(--success-color, #2ecc71); filter: drop-shadow(0 0 2px rgba(0,0,0,0.12)); }
.note-btn.has-note::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--success-color, #2ecc71);
    border-radius: 50%; /* daily default: circle */
    right: 4px;         /* keep inside the button corner */
    top: 6px;           /* better for taller buttons */
}

/* Shape-coded by scope (Option B) */
.note-btn--daily.has-note::after {
    border-radius: 50%; /* circle */
    background: var(--success-color, #2ecc71);
}
.note-btn--global.has-note::after {
    border-radius: 0;              /* square */
    background: var(--info-color, #3498db);
    transform: rotate(45deg);      /* diamond */
    right: 4px;
    top: 6px;
}

/* Layout wrapper in status column */
.status-cell { display: inline-flex; gap: 8px; align-items: stretch; justify-content: center; }
.status-cell .attendance-toggle { align-self: center; }
.status-cell .note-btn { height: 100%; }

/* Popper tooltip for note preview */
.note-tooltip {
    position: absolute;
    z-index: 2050;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.35;
    color: #333;
    max-width: 520px;
    max-height: 60vh;
    overflow: auto;
    opacity: 0;
    transition: opacity .08s ease-out; /* fast fade in place */
    will-change: opacity;
    pointer-events: none;
}
.note-tooltip[data-show="1"] {
    opacity: 1;
    pointer-events: auto;
}
.note-tooltip .tooltip-content {
    white-space: pre-wrap; /* preserve new lines */
    overflow: visible;
    word-wrap: break-word;
    max-width: 320px; /* Add touch-specific spacing around note buttons */
    font-size: 13px;
    color: #333;
}
.note-tooltip .tooltip-badge {
    display: inline-block;
    font-size: 10px;
    line-height: 1;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: #555;
    background: #f1f5f9;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 3px 6px;
    margin-bottom: 6px;
}
.note-tooltip .tooltip-arrow {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #fff;
    border-left: 1px solid #ddd;
    border-top: 1px solid #ddd;
    transform: rotate(45deg);
}
/* Arrow placement adjustments for Popper */
.note-tooltip[data-popper-placement^="top"] .tooltip-arrow { bottom: -4px; }
.note-tooltip[data-popper-placement^="bottom"] .tooltip-arrow { top: -4px; }
.note-tooltip[data-popper-placement^="left"] .tooltip-arrow { right: -4px; }
.note-tooltip[data-popper-placement^="right"] .tooltip-arrow { left: -4px; }

.note-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2100; /* above image lightbox (2000) */
    padding: 16px;
}

.note-dialog {
    width: min(680px, 92vw);
    max-height: 80vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.note-dialog h3 { margin: 0 0 4px 0; color: var(--primary-color); }
.note-scope-hint { color: #6b7280; font-size: 12px; margin-left: 8px; }

.note-textarea {
    width: 100%;
    min-height: 120px;
    max-height: 50vh;
    resize: vertical;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    line-height: 1.4;
}

.note-meta { font-size: 12px; color: #666; text-align: right; }
.note-actions { display: flex; gap: 8px; justify-content: flex-end; }

@media (max-width: 480px) {
    .note-dialog { width: 96vw; max-height: 86vh; }
    .note-textarea { min-height: 160px; }
}

/* Meal summary box */
.meal-summary {
    margin-top: 20px;
}

.meal-summary-box {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    margin-top: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.meal-summary-box h4 {
    margin-top: 0;
    font-weight: bold;
    color: #333;
}

.large-text {
    font-size: 18px;
    margin-top: 10px;
}

.large-text strong {
    color: #4CAF50;
    font-size: 20px;
}

/* Responsive styles */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
    }
    
    .user-info {
        margin-top: 10px;
        text-align: center;
    }
    
    table, thead, tbody, th, td, tr {
        display: block;
    }
    
    table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    table tr {
        border: 1px solid #ccc;
        margin-bottom: 10px;
    }
    
    table td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 50%;
    }
    
    table td:before {
        position: absolute;
        top: 10px;
        left: 10px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: bold;
    }
    
    /* Add data attributes in JavaScript for responsive tables */
    
    .tabs {
        flex-direction: column;
    }
    
    .tab {
        border: 1px solid #ddd;
        margin-bottom: 5px;
        border-radius: 5px;
    }
    
    .tab.active {
        border-radius: 5px;
    }
}

/* New preschool-themed styles */
.logo-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.tagline {
    color: var(--secondary-color);
    font-size: 1rem;
    margin-top: -5px;
    font-style: italic;
}

.preschool-decoration {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    position: relative;
    height: 60px;
}

.decoration-item {
    position: absolute;
}

.crayon-red {
    width: 12px;
    height: 80px;
    background: linear-gradient(to bottom, #3498db 80%, #2980b9 20%); /* Ocean blue */
    border-radius: 3px 3px 0 0;
    transform: rotate(-15deg);
    left: calc(50% - 60px);
    top: -10px;
}

.crayon-blue {
    width: 12px;
    height: 70px;
    background: linear-gradient(to bottom, #f39c12 80%, #e67e22 20%); /* Gold/treasure */
    border-radius: 3px 3px 0 0;
    transform: rotate(5deg);
    left: calc(50% - 20px);
    top: -5px;
}

.crayon-yellow {
    width: 12px;
    height: 90px;
    background: linear-gradient(to bottom, #2ecc71 80%, #27ae60 20%); /* Island green */
    border-radius: 3px 3px 0 0;
    transform: rotate(-5deg);
    left: calc(50% + 40px);
    top: -15px;
}

.pencil {
    width: 10px;
    height: 100px;
    background: linear-gradient(to bottom, #e74c3c 80%, #c0392b 10%, #111111 10%); /* Coral red */
    border-radius: 3px 3px 0 0;
    transform: rotate(15deg);
    left: calc(50% + 80px);
    top: -10px;
}

.welcome-message {
    max-width: 450px;
    margin: 2rem auto;
    text-align: center;
    padding: 1.5rem;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border-left: 5px solid var(--accent-color);
}

.welcome-message h3 {
    color: var(--primary-color);
    margin-bottom: 0.8rem;
}

.welcome-message p {
    color: var(--dark-color);
    line-height: 1.6;
}

.footer-decoration {
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
    gap: 1rem;
}

.footer-icon {
    font-size: 1.3rem;
    margin: 0 0.5rem;
    display: inline-block; /* Ensure proper display */
    animation: bounce 2s infinite alternate;
    line-height: 1; /* Fix vertical alignment */
}

@keyframes bounce {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-5px);
    }
}

.footer-icon:nth-child(1) { animation-delay: 0s; }
.footer-icon:nth-child(2) { animation-delay: 0.2s; }
.footer-icon:nth-child(3) { animation-delay: 0.4s; }
.footer-icon:nth-child(4) { animation-delay: 0.6s; }
.footer-icon:nth-child(5) { animation-delay: 0.8s; }

/* Login form button update */
#login-form button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    font-weight: bold;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

#login-form button:hover {
    background-color: #ff5252;
    transform: translateY(-2px);
}

#login-form button:active {
    transform: translateY(2px);
}

/* Weekly meal menu styles */
.tab-content h2 {
    color: var(--primary-color);
    border-bottom: 2px dashed var(--secondary-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

#weekly_menu-tab {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    position: relative;
}

#weekly_menu-tab::before {
    content: '🏝️';
    font-size: 3rem;
    position: absolute;
    top: -1.5rem;
    right: -1rem;
    opacity: 0.2;
    transform: rotate(15deg);
}

.weekly-menu-container {
    display: grid;
    grid-gap: 1.5rem;
}

.menu-day-container {
    border: 2px solid var(--secondary-color);
    border-radius: 10px;
    padding: 1rem;
    background-color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
    position: relative;
}

.menu-day-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.menu-day-container h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    border-bottom: 1px dashed var(--secondary-color);
    padding-bottom: 0.5rem;
}

.menu-day-container textarea {
    width: 100%;
    min-height: 100px;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    background-color: #fff;
    transition: all 0.3s ease;
}

.menu-day-container textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

/* Date picker styling */
input[type="date"] {
    padding: 0.6rem 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    background-color: #fff;
    transition: all 0.3s ease;
}

input[type="date"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

/* Date picker with Monday restriction styling */
#menu-week-date {
    position: relative;
    cursor: pointer;
}

#menu-week-date::after {
    content: "📅 Wybierasz cały tydzień (pon–pt)";
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    font-size: 0.8rem;
    color: var(--primary-color);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#menu-week-date:hover::after,
#menu-week-date:focus::after {
    opacity: 1;
}

/* Week summary text below date input */
.week-summary {
    margin-top: 6px;
    font-size: 0.95rem;
    color: var(--dark-color);
}

/* Flatpickr: highlight Monday–Friday of selected week */
.flatpickr-calendar .flatpickr-day.week-range {
    background-color: rgba(52, 152, 219, 0.18);
}

.flatpickr-calendar .flatpickr-day.week-range-start {
    background-color: rgba(52, 152, 219, 0.28);
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.flatpickr-calendar .flatpickr-day.week-range-end {
    background-color: rgba(52, 152, 219, 0.28);
    border-top-right-radius: 8px;
}

.flatpickr-calendar .flatpickr-day.week-range:hover {
background-color: rgba(52, 152, 219, 0.28);
}

/* Excluded-days Flatpickr: single-month view */
.excluded-days-calendar.flatpickr-calendar {
width: fit-content;
max-width: 100%;
position: relative;
display: block;
margin: 0 auto; /* center calendar */
}

.excluded-days-calendar .flatpickr-prev-month,
.excluded-days-calendar .flatpickr-next-month {
display: inline-block !important; /* show navigation arrows */
}

.excluded-days-calendar .flatpickr-months,
.excluded-days-calendar .flatpickr-weekdays,
.excluded-days-calendar .flatpickr-days {
display: block;
width: 100%;
}

/* Clearfix not required for single-month view; keeping structure safe */
.excluded-days-calendar .flatpickr-months::after,
.excluded-days-calendar .flatpickr-weekdays::after,
.excluded-days-calendar .flatpickr-days::after {
    content: "";
    display: block;
}

/* Ensure the days container fits naturally */
.excluded-days-calendar .flatpickr-days {
    width: auto;
}

/* Multi-month float layout removed for single-month view */

/* 3-column margin reset no longer needed */

/* Slight polish */
.excluded-days-calendar .flatpickr-month {
    padding: 4px 6px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.excluded-days-calendar .flatpickr-current-month {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.excluded-days-calendar .dayContainer {
    box-shadow: none;
    border: 1px solid #eee;
    border-radius: 8px;
    background: #fff;
    width: auto;
    min-width: 0;
}

.excluded-days-calendar .flatpickr-weekdays .flatpickr-weekdaycontainer {
    min-height: 28px;
}

/* Headers and weekday containers use default widths */

/* Responsive rules for multi-month layout removed */

/* Excluded (selected) days in red */
.excluded-days-calendar .flatpickr-day.selected,
.excluded-days-calendar .flatpickr-day.selected:hover {
    background: var(--error-color);
    border-color: var(--error-color);
    color: #fff;
}

/* Holidays: visually highlight without forcing selection */
.excluded-days-calendar .flatpickr-day.holiday-highlight:not(.selected) {
    background: rgba(243, 156, 18, 0.12); /* soft gold */
    border-color: var(--secondary-color);
}

/* When a holiday is also selected (excluded), keep red fill and add a gold ring */
.excluded-days-calendar .flatpickr-day.selected.holiday-highlight {
    box-shadow: 0 0 0 2px var(--secondary-color) inset;
}

.excluded-days-calendar .flatpickr-day:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: -2px;
}

/* Center month header and enlarge navigation arrows */
.excluded-days-calendar .flatpickr-months {
    display: flex; /* ensure flex for proper arrow + title layout */
    align-items: center;
    justify-content: center; /* center month name */
}

.excluded-days-calendar .flatpickr-months .flatpickr-prev-month,
.excluded-days-calendar .flatpickr-months .flatpickr-next-month {
    width: 44px;
    height: 44px;
    cursor: pointer;
    opacity: 1;
}

.excluded-days-calendar .flatpickr-months .flatpickr-prev-month svg,
.excluded-days-calendar .flatpickr-months .flatpickr-next-month svg {
    width: 24px;
    height: 24px;
    fill: var(--primary-color);
    stroke: var(--primary-color);
    transition: transform 0.15s ease;
}

.excluded-days-calendar .flatpickr-months .flatpickr-prev-month:hover svg,
.excluded-days-calendar .flatpickr-months .flatpickr-next-month:hover svg {
    transform: scale(1.2);
}

/* Hide the excluded-days input; we only show the inline calendar */
#excluded-attendance-days {
    display: none;
}

/* Button styling */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    margin-top: 1rem;
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(1px);
}

#zapisz-jadlospis {
    background-color: var(--accent-color);
    color: white;
    font-weight: bold;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    margin-top: 1.5rem;
    position: relative;
    overflow: hidden;
}

#zapisz-jadlospis:hover {
    background-color: #27ae60;
    transform: translateY(-2px);
}

#zapisz-jadlospis:active {
    transform: translateY(1px);
}

/* Weekly menu parent view styling */
#weekly-menu-list-parent {
    margin: 1rem 0;
}

#weekly-menu-list-parent table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

#weekly-menu-list-parent th {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem;
    text-align: left;
}

#weekly-menu-list-parent td {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

#weekly-menu-list-parent tr:nth-child(even) {
    background-color: rgba(52, 152, 219, 0.05);
}

#weekly-menu-list-parent tr:hover {
    background-color: rgba(243, 156, 18, 0.1);
}

/* Additional Treasure Island themed elements for weekly menu */
.menu-day-container::before {
    position: absolute;
    font-size: 1.5rem;
    opacity: 0.2;
    top: -0.5rem;
    right: 0.5rem;
}

.menu-day-container:nth-child(1)::before {
    content: '🍳';
}

.menu-day-container:nth-child(2)::before {
    content: '🥗';
}

.menu-day-container:nth-child(3)::before {
    content: '🍕';
}

.menu-day-container:nth-child(4)::before {
    content: '🍜';
}

.menu-day-container:nth-child(5)::before {
    content: '🍰';
}

#weekly_menu-tab h2 {
    position: relative;
    display: inline-block;
    margin-bottom: 2rem;
}



.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
    font-weight: bold;
}

/* Island background effect */
#weekly_menu-tab {
    background-image: 
        radial-gradient(circle at 90% 10%, rgba(46, 204, 113, 0.1) 20%, transparent 20%),
        radial-gradient(circle at 10% 90%, rgba(52, 152, 219, 0.1) 20%, transparent 20%),
        radial-gradient(circle at 50% 50%, rgba(243, 156, 18, 0.05) 25%, transparent 25%);
    background-size: 30% 30%, 20% 20%, 40% 40%;
    background-position: 0 0, 0 0, 0 0;
}

/* Hide per-day manual entry sections (admin) and per-day items (parent)
   Keep elements in DOM for potential future toggling. */
#weekly_menu-tab .weekly-menu-container,
#weekly_menu-tab #save-weekly-menu,
.menu-parent-view .weekly-menu-items,
.menu-parent-view .menu-day-item {
    display: none !important;
}

.demo-page .menu-parent-view .weekly-menu-items {
    display: grid !important;
}

.demo-page .menu-parent-view .menu-day-item {
    display: block !important;
}

/* Weekly image upload styles */
#weekly_menu-tab .weekly-image-section {
    margin: 1rem 0 1.5rem;
}

.weekly-image-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    background: #f7fbff;
    border: 2px dashed #e3eef9;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 0.75rem;
    position: relative;
}

.weekly-image-preview img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Hover delete button inside preview (top-right) */
.weekly-image-preview .preview-delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(231, 76, 60, 0.95);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease, background-color 0.2s ease;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.weekly-image-preview:hover .preview-delete-btn {
    opacity: 1;
    transform: translateY(0);
}

.weekly-image-preview .preview-delete-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.35), 0 2px 6px rgba(0, 0, 0, 0.2);
    opacity: 1;
    transform: translateY(0);
}

.weekly-image-preview .preview-delete-btn:hover {
    background: #c0392b;
}

/* On touch devices (no hover), keep the button visible */
@media (hover: none) {
    .weekly-image-preview .preview-delete-btn {
        opacity: 1;
        transform: none;
    }
}

.weekly-image-preview .no-image {
    color: #888;
    font-style: italic;
}

.weekly-image-dropzone {
    margin-top: 0.75rem;
    border: 2px dashed var(--primary-color);
    background: rgba(52, 152, 219, 0.06);
    border-radius: 12px;
    text-align: center;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.25s ease;
}

.weekly-image-dropzone .dz-icon {
    font-size: 2rem;
}

.weekly-image-dropzone .dz-text {
    margin-top: 0.25rem;
    font-weight: 600;
    color: var(--dark-color);
}

.weekly-image-dropzone .dz-subtext {
    margin-top: 0.25rem;
    font-size: 0.9rem;
    color: #666;
}

.weekly-image-dropzone:hover {
    background: rgba(52, 152, 219, 0.1);
    transform: translateY(-1px);
}

.weekly-image-dropzone:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.35);
}

.weekly-image-dropzone.is-dragover {
    background: rgba(243, 156, 18, 0.12);
    border-color: var(--secondary-color);
    transform: scale(1.01);
}

.weekly-image-dropzone.is-uploading {
    opacity: 0.7;
    cursor: progress;
}

.upload-progress {
    position: relative;
    background: #eef4fb;
    border-radius: 6px;
    height: 10px;
    margin-top: 0.75rem;
    overflow: hidden;
}

.upload-progress[aria-hidden="true"] {
    display: none;
}

.upload-progress .bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #74b9ff);
    transition: width 0.2s ease;
}

.upload-progress .label {
    position: absolute;
    top: -22px;
    right: 0;
    font-size: 0.85rem;
    color: var(--dark-color);
}

.weekly-image-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    position: relative;
    z-index: 10; /* Keep actions above scaled image */
    flex-wrap: wrap;
}

 

/* Parent view image */
.weekly-image-parent img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    position: relative; /* allow z-index layering */
    z-index: 1;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .weekly-image-preview {
        min-height: 140px;
    }
    .weekly-image-dropzone {
        padding: 1rem;
    }
    .weekly-image-dropzone .dz-icon {
        font-size: 1.8rem;
    }
    .upload-progress .label {
        top: -20px;
        font-size: 0.8rem;
    }
}

/* Weekly menu parent view styling */
.menu-parent-view {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.menu-parent-view::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 90% 10%, rgba(46, 204, 113, 0.05) 20%, transparent 20%),
        radial-gradient(circle at 10% 90%, rgba(52, 152, 219, 0.05) 20%, transparent 20%),
        radial-gradient(circle at 50% 50%, rgba(243, 156, 18, 0.025) 25%, transparent 25%);
    background-size: 30% 30%, 20% 20%, 40% 40%;
    background-position: 0 0, 0 0, 0 0;
    z-index: 0;
    pointer-events: none; /* never intercept clicks */
}

.menu-parent-view h2 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.weekly-menu-items {
    display: grid;
    grid-gap: 1.5rem;
    position: relative;
    z-index: 1;
}

.menu-day-item {
    background-color: rgba(255, 255, 255, 0.7);
    border: 2px solid var(--secondary-color);
    border-radius: 10px;
    padding: 1.2rem;
    transition: all 0.3s ease;
    position: relative;
}

.menu-day-item::before {
    position: absolute;
    font-size: 1.5rem;
    opacity: 0.1;
    top: 0.5rem;
    right: 0.5rem;
}

.menu-day-item:nth-child(1)::before {
    content: '🍳';
}

.menu-day-item:nth-child(2)::before {
    content: '🥗';
}

.menu-day-item:nth-child(3)::before {
    content: '🍕';
}

.menu-day-item:nth-child(4)::before {
    content: '🍜';
}

.menu-day-item:nth-child(5)::before {
    content: '🍰';
}

.menu-day-item h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed var(--secondary-color);
}

.day-date {
    font-size: 0.9rem;
    opacity: 0.8;
    font-weight: normal;
}

.menu-content ul {
    list-style-type: none;
    padding-left: 0;
}

.menu-content li {
    padding: 0.5rem 0;
    border-bottom: 1px dotted rgba(0, 0, 0, 0.1);
    position: relative;
    padding-left: 1.5rem;
}

.menu-content li::before {
    content: '🔹';
    position: absolute;
    left: 0;
    color: var(--secondary-color);
}

.menu-content li:last-child {
    border-bottom: none;
}

.no-menu {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

.weekly-menu-empty {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.empty-state {
    text-align: center;
    padding: 2rem;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #777;
}

/* Loading indicator */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--primary-color);
    font-weight: bold;
}

.loading::before {
    content: "🏝️";
    display: block;
    font-size: 2rem;
    margin-bottom: 1rem;
    animation: bounce 1s infinite alternate;
}

@keyframes bounce {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-10px);
    }
}

/* Fix for overlapping icons in jadłospis heading */
.tab-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 1.5rem;
}

.tab-header h2 {
    margin: 0;
    font-size: 1.8rem;
}

.tab-header .header-icons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tab-header .header-icon {
    font-size: 1.5rem;
    color: var(--secondary-color);
}

/* Expanded style for menu items */
.menu-day-container {
    transition: all 0.3s ease;
    overflow: hidden;
}

.menu-day-container h3 {
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    display: flex;
    align-items: center;
}

.menu-day-container h3::after {
    content: "↓";
    margin-left: auto;
    font-size: 0.9rem;
    opacity: 0.7;
    transition: transform 0.3s ease;
}

.menu-day-container h3:hover {
    color: var(--secondary-color);
}

.menu-day-container.expanded h3::after {
    transform: rotate(180deg);
}

.menu-day-container textarea {
    transition: all 0.3s ease;
    max-height: 80px;
    resize: none;
}

.menu-day-container.expanded textarea {
    max-height: 300px;
}

/* Fix for menu header icon positioning */
.tab-content h2 {
    position: relative;
    z-index: 1;
}

#weekly_menu-tab h2::before,
#weekly_menu-tab h2::after {
    top: 50%;
    transform: translateY(-50%);
}

/* Remove decorative elements from tab header since we now have icons */
#weekly_menu-tab .tab-header {
    position: relative;
    z-index: 1;
}

/* Tabs styling for weekly menu */
a[href="#weekly_menu"] .header-icons {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

a[href="#weekly_menu"] .tab-icon {
    font-size: 1rem;
    position: relative;
    top: -1px;
}

a[href="#weekly_menu"] .tab-text {
    margin: 0 8px;
    position: relative;
}

/* Make sure textarea shows focus state clearly */
.menu-day-container textarea:focus {
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
    border-color: var(--primary-color);
}

/* Improved header icon positioning */
.header-icons {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.header-icon {
    position: relative;
    z-index: 2;
    font-size: 1.2rem;
}

/* Clear fix for tab navigation with icons */
.tab-nav .nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.tab-nav .nav-link .header-icons {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.tab-nav .nav-link .tab-icon,
.tab-nav .nav-link .tab-text {
    display: inline-block;
    vertical-align: middle;
    position: relative;
}

.tab-nav .nav-link .tab-text {
    margin: 0 4px;
}

/* Fix for small screens */
@media (max-width: 768px) {
    .tab-nav .nav-link .tab-text {
        font-size: 0.9rem;
    }
    
    .tab-nav .nav-link .tab-icon {
        font-size: 0.9rem;
    }
}

/* Improved footer icon styling */
.footer-decoration {
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
    gap: 1rem;
}

.footer-icon {
    font-size: 1.3rem;
    margin: 0 0.5rem;
    display: inline-block; /* Ensure proper display */
    animation: bounce 2s infinite alternate;
    line-height: 1; /* Fix vertical alignment */
}

/* Define bounce animation if it doesn't exist */
@keyframes bounce {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-5px);
    }
}

.footer-icon:nth-child(1) { animation-delay: 0s; }
.footer-icon:nth-child(2) { animation-delay: 0.2s; }
.footer-icon:nth-child(3) { animation-delay: 0.4s; }
.footer-icon:nth-child(4) { animation-delay: 0.6s; }
.footer-icon:nth-child(5) { animation-delay: 0.8s; }

/* Improved header icon styling - fix overlap */
.header-icons {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

/* Give more space between icons and text */
a[href="#weekly_menu"] .tab-text {
    margin: 0 8px !important;
    position: relative;
}

/* Fix tabs with header icons */
.tab-nav .nav-link {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 8px 10px;
}

.tab-nav .nav-link .header-icons {
    flex-wrap: nowrap;
    white-space: nowrap;
}

.tab-nav .nav-link .tab-icon {
    font-size: 1.1rem;
    margin: 0 2px;
}

/* Date navigation styles */
.date-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    background-color: var(--light-color);
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.date-picker-container {
    flex: 1;
    margin: 0 1rem;
    text-align: center;
}

.btn-nav {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    font-weight: 600;
}

.btn-nav:hover {
    background-color: var(--dark-color);
    transform: translateY(-2px);
}

.btn-nav:active {
    transform: translateY(0);
}

.nav-icon {
    font-size: 1.2rem;
    margin: 0 0.3rem;
}

@media (max-width: 768px) {
    .date-navigation {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .date-picker-container {
        width: 100%;
        margin: 0.5rem 0;
    }
    
    .btn-nav {
        width: 100%;
        justify-content: center;
    }
}

/* Confirm modal styles */
.confirm-modal-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    padding: 1rem;
}

.confirm-modal-overlay.show {
    display: flex;
}

.confirm-modal {
    width: min(520px, 92vw);
    max-height: 90vh;
    overflow: hidden;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    transform: translateY(-10px);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.confirm-modal-overlay.show .confirm-modal {
    transform: translateY(0);
    opacity: 1;
}

.confirm-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background-color: var(--light-color);
    border-bottom: 1px solid #eee;
}

.confirm-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--dark-color);
}

.confirm-modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--dark-color);
}

.confirm-modal-body {
    padding: 1rem 1.25rem;
    color: var(--dark-color);
}

.confirm-modal-footer {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    padding: 0.75rem 1.25rem;
    background: #fafafa;
    border-top: 1px solid #eee;
}

.confirm-modal .btn {
    min-width: 110px;
}

body.modal-open {
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
    .confirm-modal {
        transition: none;
    }
}

/* Secondary button style for modal cancel button */
.btn-secondary {
    background-color: var(--dark-color);
    color: #fff;
    border: none;
}

.btn-secondary:hover {
    background-color: #2c3e50;
}

/* Report styles */
.report-summary-container {
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
    margin-top: 20px;
}

.summary-card {
    display: flex;
    justify-content: space-between;
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.summary-item {
    text-align: center;
    padding: 0 15px;
    flex: 1;
}

.summary-label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.summary-value {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: #0066cc;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.report-table th, 
.report-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.report-table th {
    background-color: #f0f0f0;
    font-weight: bold;
}

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

.report-table tr:hover {
    background-color: #f0f7ff;
}

/* Monthly report: paid column + checkbox styling */
#monthly-report-summary .report-table td.paid-cell {
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
}
#monthly-report-summary .report-table th:nth-child(4) {
    text-align: center;
}
.paid-checkbox {
    width: 18px;
    height: 18px;
    transform: translateY(1px);
    accent-color: var(--success-color, #2ecc71);
    cursor: pointer;
}
.paid-checkbox:focus-visible {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}
.paid-checkbox:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Themed highlight for paid rows */
#monthly-report-summary .report-table tr.paid-row {
    background-color: rgba(46, 204, 113, 0.14); /* uses success green tint */
}
#monthly-report-summary .report-table tr.paid-row:hover {
    background-color: rgba(46, 204, 113, 0.18);
}

/* Global search UI */
.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.sr-only:focus,
.sr-only:active {
    position: static !important;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

.global-search {
    width: 100%;
}
.global-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 560px;
}
.global-search-icon {
    position: absolute;
    left: 12px;
    color: #7a8794;
    line-height: 1;
    pointer-events: none;
    font-size: 16px;
    top: 50%;
    transform: translateY(-50%);
}
.global-search-input {
    width: 100%;
    height: 38px;
    padding: 8px 34px 8px 36px; /* right for clear, left for icon */
    border: 1px solid #d9e1ea;
    border-radius: 999px;
    background: #fff;
    font-size: 14px;
    color: #2c3e50;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04) inset;
}
.global-search-input::placeholder {
    color: #97a6b4;
}
.global-search-input:focus {
    border-color: var(--primary-color, #3498db);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.25);
    background-color: #fff;
}
/* Hide native search clear/cancel buttons so only our custom clear shows */
.global-search-input::-webkit-search-decoration,
.global-search-input::-webkit-search-cancel-button,
.global-search-input::-webkit-search-results-button,
.global-search-input::-webkit-search-results-decoration {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}
.global-search-input::-ms-clear {
    display: none;
    width: 0;
    height: 0;
}
.global-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #6b7785;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, background-color 0.15s ease, color 0.15s ease;
    line-height: 1;
    font-size: 18px;
}
.global-search-wrap[data-has-value="1"] .global-search-clear {
    opacity: 0.85;
    pointer-events: auto;
}
.global-search-clear:hover {
    background: #eef2f6;
    color: #2c3e50;
}
.global-search-clear:focus-visible {
    outline: 2px solid var(--secondary-color, #8e44ad);
    outline-offset: 2px;
}
@media (max-width: 768px) {
    .global-search-wrap { max-width: 100%; }
    .global-search-input { height: 42px; font-size: 16px; padding: 10px 38px 10px 38px; }
    .global-search-icon { left: 10px; font-size: 18px; }
    .global-search-clear { right: 6px; }
}


/* Zoomable images (subtle hover on desktop) */
.zoomable-image {
    cursor: zoom-in;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    will-change: transform;
}

@media (hover: hover) and (pointer: fine) {
    .zoomable-image:hover {
        transform: scale(1.02);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    }
    /* Avoid image hover overlap blocking clicks in parent view */
    .menu-parent-view .zoomable-image:hover {
        transform: none;
        box-shadow: none;
    }
}

/* Fullscreen image lightbox */
.image-lightbox {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    padding: 2vw;
}

.image-lightbox.show {
    display: flex;
}

.image-lightbox .lightbox-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
.image-lightbox .lightbox-close:hover {
    background: rgba(0, 0, 0, 0.75);
}

.image-lightbox .lightbox-content {
    position: relative;
    display: inline-block; /* shrink-wrap to image */
    max-width: 96vw;
    max-height: 92vh;
    overflow: visible; /* allow controls to sit below the image */
}

.image-lightbox .lightbox-img {
    max-width: 96vw;
    max-height: 92vh;
    user-select: none;
    -webkit-user-drag: none;
    touch-action: none; /* enable custom panning */
    transition: transform 0.15s ease;
    cursor: zoom-out;
}

.image-lightbox .lightbox-img.zoomed {
    cursor: move;
}

/* Controls row under the image */
.image-lightbox .lightbox-controls {
    position: absolute;
    left: 50%;
    top: calc(115%); /* directly below the image */
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 5;
}

.image-lightbox .zoom-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
    transition: background 0.2s ease, transform 0.1s ease;
}

.image-lightbox .zoom-btn:hover { background: rgba(0, 0, 0, 0.75); }
.image-lightbox .zoom-btn:active { transform: scale(0.97); }
.image-lightbox .zoom-btn:focus { outline: 2px solid #fff; outline-offset: 2px; }

/* Download button */
.image-lightbox .download-btn {
    height: 44px;
    padding: 0 14px;
    border-radius: 22px;
    border: none;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
    transition: background 0.2s ease, transform 0.1s ease;
}

.image-lightbox .download-btn:hover { background: rgba(0, 0, 0, 0.75); }
.image-lightbox .download-btn:active { transform: scale(0.98); }
.image-lightbox .download-btn:focus { outline: 2px solid #fff; outline-offset: 2px; }

@media (max-width: 480px) {
    .image-lightbox .zoom-btn { width: 40px; height: 40px; font-size: 20px; }
    .image-lightbox .download-btn { height: 40px; padding: 0 12px; font-size: 15px; }
    .image-lightbox .lightbox-controls { gap: 10px; }
}

/* Prevent page scroll when modal open */
body.modal-open { overflow: hidden; }