/* 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-sm {
    padding: 6px 10px;
    font-size: 0.9rem;
    line-height: 1.2;
    border-radius: 6px;
}

.btn-light {
    background-color: #f1f5f9;
    color: #0f172a;
    border: 1px solid #e5e7eb;
}

.btn-light:hover {
    background-color: #e2e8f0;
}

.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;
}

.parent-announcement-banner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 52px 14px 12px 14px;
    margin: 6px 0 16px 0;
    border-radius: 12px;
    border: 2px solid rgba(243, 156, 18, 0.55);
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.18), rgba(52, 152, 219, 0.10));
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);

    position: sticky;
    top: 8px;
    z-index: 50;
}

.parent-announcement-banner--info {
    border-color: rgba(52, 152, 219, 0.55);
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.14), rgba(46, 204, 113, 0.08));
}

.parent-announcement-banner--warn {
    border-color: rgba(243, 156, 18, 0.70);
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.20), rgba(255, 255, 255, 0.06));
}

.parent-announcement-banner--urgent {
    border-color: rgba(231, 76, 60, 0.70);
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.16), rgba(243, 156, 18, 0.08));
}

.parent-announcement-banner__actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.parent-announcement-banner__toggle {
    flex: 0 0 auto;
    border: 1px solid rgba(52, 73, 94, 0.18);
    background: rgba(255, 255, 255, 0.72);
    border-radius: 10px;
    padding: 8px 10px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

.parent-announcement-banner__toggle:hover {
    background: rgba(255, 255, 255, 0.92);
}

.parent-announcement-banner__toggle:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

.parent-announcement-banner__content {
    flex: 1;
    font-size: 0.98rem;
    line-height: 1.45;
    color: var(--dark-color);
    padding-right: 108px;
}

.parent-announcement-banner--collapsed .parent-announcement-banner__content {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

.parent-announcement-banner__content a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: underline;
    word-break: break-word;
}

.parent-announcement-banner__close {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(52, 73, 94, 0.2);
    background: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.parent-announcement-banner__close:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-1px);
}

.parent-announcement-banner__close:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

.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;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tab.active {
    background-color: #fff;
    border-color: #ddd;
    border-radius: 5px 5px 0 0;
    margin-bottom: -1px;
}

.tab .icon {
    width: 16px;
    height: 16px;
    color: #64748b;
}

.tab.active .icon {
    color: var(--primary-color, #3498db);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Attendance table */
.attendance-table td {
    text-align: center;
}

.attendance-table {
    border-collapse: separate;
    border-spacing: 0;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 12px;
    overflow: hidden;
}

.attendance-table th {
    background-color: rgba(255, 255, 255, 0.85);
}

.attendance-table.attendance-table--group {
    border: none;
    border-radius: 0;
    background: transparent;
}

.attendance-table.attendance-table--group th {
    background-color: rgba(255, 255, 255, 0.70);
}

.attendance-table.attendance-table--group th:first-child {
    padding-left: calc(4px + 0.75rem);
}

.attendance-table tbody tr.attendance-group-row:hover,
.attendance-table tbody tr.attendance-group-header:hover {
    background-color: transparent;
}

.attendance-group-row td:first-child {
    border-left: 4px solid var(--cg-color, #94a3b8);
}

.attendance-group-row td {
    background: transparent;
}

.attendance-group-row:hover td {
    background: #f5f5f5;
}

.attendance-group-row--first td {
    border-top: 1px solid rgba(15, 23, 42, 0.12);
}

.attendance-group-row--last td {
    border-bottom: 1px solid rgba(15, 23, 42, 0.12);
}

.attendance-group-card {
    margin: 14px 0;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: rgba(255, 255, 255, 0.72);
    overflow: hidden;
}

.attendance-group-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: var(--cg-bg, rgba(241, 245, 249, 0.9));
    border-left: 8px solid var(--cg-color, #64748b);
    border-bottom: 1px solid rgba(15, 23, 42, 0.10);
}

.attendance-group-card__title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #0f172a;
    font-size: 12px;
}

.attendance-group-card__title::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--cg-color, #64748b);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85);
}

.attendance-group-card__count {
    min-width: 28px;
    height: 22px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-weight: 800;
    font-size: 12px;
    color: #ffffff;
    background: var(--cg-color, #64748b);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.attendance-group-card__table-wrap {
    padding: 0;
}

.cg-pill {
    --cg-color: #64748b;
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1.4;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: var(--cg-color);
    color: #fff;
}

.cg-pill--neutral {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #e5e7eb;
}

.cg-color-cell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cg-color-swatch {
    --cg-color: #64748b;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    background: var(--cg-color);
    border: 1px solid rgba(0, 0, 0, 0.12);
}

.cg-color-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    color: #475569;
}

.child-group-select-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.child-group-swatch {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    background: transparent;
}

.child-group-select-wrap.child-group-select-wrap--has-color .child-group-swatch {
    background: var(--cg-color);
}

.child-group-select {
    min-width: 160px;
}

/* --- 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%; }

/* Attendance history button (children tab) */
.attendance-history-btn {
    margin-left: 4px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    vertical-align: middle;
    opacity: 0.65;
    transition: opacity 0.2s ease, transform 0.1s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    min-height: 26px;
    padding: 2px;
    border-radius: 4px;
}
.attendance-history-btn:hover { opacity: 1; transform: translateY(-1px); background: rgba(52,152,219,0.08); }
.attendance-history-btn:focus { outline: 2px solid var(--secondary-color); outline-offset: 2px; }

/* Attendance history modal */
.attendance-history-modal {
    padding: 24px !important;
    max-width: 520px;
    width: 90%;
}
.attendance-history-modal h3 { margin-bottom: 4px; }
.attendance-history-modal #attendance-history-child-name {
    color: #555;
    font-size: 14px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

/* Attendance history modal tabs */
.attendance-history-tabs { margin-bottom: 20px !important; }
.attendance-history-tab {
    background: #fff;
    border: 1px solid #ddd;
    color: #555;
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 4px;
    transition: all 0.15s ease;
}
.attendance-history-tab:hover:not(.active) {
    background: #f8f9fa;
    border-color: #ccc;
    color: #333;
}
.attendance-history-tab.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* Attendance history table */
.attendance-history-modal table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.attendance-history-modal table th {
    text-align: left;
    padding: 10px 12px;
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
}
.attendance-history-modal table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
}
.attendance-history-modal table tr:hover td {
    background: #f8f9fa;
}

/* Plan absence section */
#attendance-plan-content {
    padding-top: 8px;
}
.absence-plan-desc {
    color: #666;
    font-size: 13px;
    margin-bottom: 16px;
}
.absence-date-inputs {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}
.absence-date-field label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #555;
    margin-bottom: 6px;
}
.absence-date-field input[type="date"] {
    width: 160px;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}
.absence-date-field input[type="date"]:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(52,152,219,0.15);
}
#absence-plan-info {
    min-height: 20px;
    font-size: 13px;
    color: #666;
    margin-bottom: 16px;
}
#attendance-history-list {
    max-height: 280px;
    overflow-y: auto;
}
.attendance-history-modal .confirm-modal-buttons {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

/* 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-day-nav-tooltip="1"] {
    max-height: none;
    overflow: visible;
}
.note-tooltip[data-day-nav-tooltip="1"] .tooltip-arrow {
    display: 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; }

/* Broadcast form redesign (demo) */
.broadcast-messages {
    margin-top: 8px;
}

.broadcast-messages__nav {
    display: inline-flex;
    gap: 6px;
    padding: 6px;
    border-radius: 14px;
    background: #f1f5f9;
    border: 1px solid #d6e4f2;
    margin-bottom: 16px;
}

.broadcast-messages__nav-btn {
    position: relative;
    background: transparent;
    border: 1px solid transparent;
    color: #334155;
    padding: 10px 16px;
    border-radius: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.broadcast-messages__nav-btn--active {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.12);
}

.broadcast-messages__nav-btn--active .icon {
    color: var(--primary-color, #3498db);
}

.broadcast-messages__nav-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.25);
}

.broadcast-messages__content {
    margin-top: 8px;
}

.icon {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: 0 0 auto;
}

.icon--sm {
    width: 16px;
    height: 16px;
}

.icon--xs {
    width: 14px;
    height: 14px;
}

.broadcast-form--redesign {
    max-width: 760px;
    padding: 20px 20px 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f6fbff 100%);
    border: 1px solid #dfe9f3;
    border-radius: 16px;
    box-shadow: 0 18px 35px rgba(52, 152, 219, 0.12);
    position: relative;
    overflow: visible;
    animation: broadcast-form-rise 0.35s ease;
}

.broadcast-form--redesign::before {
    content: "";
    position: absolute;
    top: -80px;
    right: -120px;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(52, 152, 219, 0.18) 0%, rgba(52, 152, 219, 0) 70%);
    pointer-events: none;
}

.broadcast-form--redesign::after {
    content: "";
    position: absolute;
    bottom: -90px;
    left: -90px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(46, 204, 113, 0.18) 0%, rgba(46, 204, 113, 0) 70%);
    pointer-events: none;
}

.broadcast-form--redesign > * {
    position: relative;
    z-index: 1;
}

.broadcast-form--redesign .form-group {
    margin-bottom: 18px;
}

.broadcast-form--redesign .form-group label {
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #5c6b7a;
}

.broadcast-recipients-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f2f7ff;
    border: 1px solid #d6e4f2;
    border-radius: 12px;
    margin-bottom: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.broadcast-recipients-label {
    font-weight: 600;
    color: #495057;
    margin: 0;
    min-width: 30px;
}

.broadcast-recipients-row:focus-within {
    border-color: rgba(52, 152, 219, 0.6);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.broadcast-recipient-select {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #c8d6e5;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    background: #fff;
    cursor: pointer;
}

.broadcast-recipient-select:focus {
    outline: none;
    border-color: var(--primary-color, #007bff);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.broadcast-recipient-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #3498db, #2ecc71);
    color: #fff;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: default;
    box-shadow: 0 6px 14px rgba(52, 152, 219, 0.25);
}

.broadcast-recipient-badge .badge-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    padding: 2px 6px;
}

.broadcast-subject-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
    position: relative;
    z-index: 20;
}

.broadcast-subject-row .form-control {
    flex: 1;
    min-height: 44px;
    border-radius: 10px;
    border-color: #d6e4f2;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
}

.broadcast-subject-row .form-control:focus {
    outline: none;
    border-color: rgba(52, 152, 219, 0.7);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.16);
}

.broadcast-template-dropdown {
    position: relative;
    z-index: 30;
}

.broadcast-template-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.broadcast-template-edit-btn {
    border: 1px dashed #cbd5e1;
    background: #f8fafc;
    color: #1f2a37;
}

.broadcast-template-edit-btn:hover {
    background: #eef2f7;
    border-color: #b8c4d4;
}

.broadcast-template-edit-btn .icon {
    color: #64748b;
}

.broadcast-template-panel {
    margin-top: 8px;
}

.broadcast-template-dropdown .btn {
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #d6e4f2;
    background: #ffffff;
    color: #1f2a37;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.broadcast-template-dropdown .btn:hover {
    background: #eef6ff;
    border-color: #c1d3e8;
    transform: translateY(-1px);
}

.broadcast-template-menu {
    display: none;
    position: static;
    margin-top: 6px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
    width: 100%;
    max-width: 520px;
    z-index: auto;
    overflow: hidden;
}

.broadcast-template-menu.show {
    display: grid;
    animation: broadcast-menu-in 0.18s ease;
}

.broadcast-template-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.15s;
}

.broadcast-template-item .icon {
    color: #64748b;
}

.broadcast-template-item:hover {
    background: #eef6ff;
}

.broadcast-editor-wrapper {
    position: relative;
    z-index: 1;
}

.broadcast-editor {
    border: 1px solid #d6e4f2;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    background: #fff;
    position: relative;
    z-index: 1;
}

.broadcast-editor .ql-toolbar {
    border: none !important;
    background: #f3f8ff !important;
}

.broadcast-editor .ql-container {
    border: none !important;
    min-height: 220px;
    font-size: 15px;
}

.broadcast-editor-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
    background: #f3f8ff;
    border: 1px solid #d6e4f2;
    border-top: none;
    border-radius: 0 0 12px 12px;
    font-size: 12px;
    color: #6c757d;
}

.broadcast-char-count {
    font-variant-numeric: tabular-nums;
}

.broadcast-attachment-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    opacity: 0.7;
    cursor: help;
    transition: opacity 0.2s;
}

.broadcast-attachment-hint:hover {
    opacity: 1;
}

.broadcast-options-row {
    margin: 16px 0;
    padding: 10px 12px;
    background: #f8fbff;
    border: 1px dashed #d6e4f2;
    border-radius: 12px;
}

.broadcast-copy-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #495057;
}

.broadcast-copy-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color, #3498db);
}

.broadcast-form__actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding: 12px;
    border-radius: 14px;
    background: #f8fbff;
    border: 1px solid #dfe9f3;
    align-items: stretch;
}

.broadcast-form__actions .btn {
    height: 48px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.broadcast-form__actions .btn.btn-outline-secondary {
    padding: 0 18px;
}

.btn-outline-secondary {
    background: #fff;
    color: #1f2a37;
    border: 1px solid #d1d9e6;
}

.btn-outline-secondary:hover {
    background: #f1f5f9;
    border-color: #b8c4d4;
}

.btn-send-prominent {
    flex: 1;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #3498db, #2ecc71);
    box-shadow: 0 12px 20px rgba(52, 152, 219, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 48px;
}

.btn-send-prominent:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(52, 152, 219, 0.28);
}

/* Broadcast confirmation modal (demo) */
.broadcast-confirm-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
}

.broadcast-confirm-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.broadcast-confirm-modal__content {
    position: relative;
    background: linear-gradient(180deg, #ffffff 0%, #f6fbff 100%);
    border-radius: 16px;
    border: 1px solid #dfe9f3;
    padding: 24px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
}

.broadcast-confirm-modal__content h3 {
    margin: 0 0 16px;
    font-size: 20px;
    color: #212529;
}

.broadcast-confirm-summary {
    background: #f3f8ff;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 1px solid #d6e4f2;
}

.broadcast-confirm-summary p {
    margin: 6px 0;
    font-size: 14px;
}

.broadcast-confirm-warning {
    color: #1f2a37;
    background: #fff7e0;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 14px;
    margin-bottom: 20px;
}

.broadcast-confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.broadcast-confirm-actions .btn {
    min-width: 100px;
}

.broadcast-template-editor {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
}

.broadcast-template-editor__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
}

.broadcast-template-editor__content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #dfe9f3;
    width: min(760px, 92vw);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
    z-index: 1;
}

.broadcast-template-editor__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
}

.broadcast-template-editor__header h3 {
    margin: 0;
    font-size: 18px;
}

.broadcast-template-editor__close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #64748b;
    padding: 4px;
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease;
}

.broadcast-template-editor__close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.broadcast-template-editor__body {
    padding: 16px 20px;
    overflow: auto;
}

.broadcast-template-editor__hint {
    margin: 0 0 12px;
    color: #64748b;
    font-size: 13px;
}

.broadcast-template-editor__list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.broadcast-template-editor__item {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.broadcast-template-editor__title {
    font-weight: 600;
    color: #0f172a;
}

.broadcast-template-editor__item label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.broadcast-template-editor__item .form-control {
    border-radius: 10px;
    border-color: #d6e4f2;
    font-size: 14px;
}

.broadcast-template-editor__quill {
    border: 1px solid #d6e4f2;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.broadcast-template-editor__quill .ql-toolbar {
    border: none !important;
    background: #f3f8ff !important;
}

.broadcast-template-editor__quill .ql-container {
    border: none !important;
    min-height: 160px;
    font-size: 14px;
}

.broadcast-template-editor__footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 12px 20px 20px;
    border-top: 1px solid #e2e8f0;
}

/* Broadcast form mobile responsiveness */
@media (max-width: 576px) {
    .broadcast-messages__nav {
        width: 100%;
    }

    .broadcast-messages__nav-btn {
        flex: 1;
        justify-content: center;
    }

    .broadcast-recipients-row {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .broadcast-recipients-label {
        min-width: auto;
    }
    
    .broadcast-recipient-select {
        order: 3;
        width: 100%;
    }
    
    .broadcast-recipient-badge {
        margin-left: auto;
    }
    
    .broadcast-subject-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .broadcast-template-dropdown {
        width: 100%;
    }
    
    .broadcast-template-dropdown .btn {
        width: 100%;
    }
    
    .broadcast-template-menu {
        right: auto;
        left: 0;
        width: 100%;
    }
    
    .broadcast-editor-footer {
        flex-direction: column;
        gap: 4px;
        text-align: center;
    }
    
    .broadcast-form__actions {
        flex-direction: column;
    }
    
    .btn-send-prominent {
        order: -1;
    }
    
    .broadcast-confirm-modal__content {
        padding: 16px;
        margin: 16px;
    }
    
    .broadcast-confirm-actions {
        flex-direction: column-reverse;
    }
    
    .broadcast-confirm-actions .btn {
        width: 100%;
    }

    .broadcast-template-editor__footer {
        flex-direction: column-reverse;
    }

    .broadcast-template-editor__footer .btn {
        width: 100%;
    }
}

@keyframes broadcast-form-rise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes broadcast-menu-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .broadcast-form--redesign,
    .broadcast-template-menu.show {
        animation: none;
    }

    .btn-send-prominent,
    .broadcast-template-dropdown .btn {
        transition: none;
    }
}

/* Parent Messages Admin Panel */
.pm-admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.pm-admin-header h2 {
    margin: 0;
}

.pm-admin-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 16px;
    align-items: start;
}

.pm-admin-sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pm-admin-search-box {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}

.pm-admin-inbox {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    max-height: 560px;
    overflow-y: auto;
}

.pm-inbox-item {
    width: 100%;
    text-align: left;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
    margin: 6px 0;
}

.pm-inbox-item__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pm-inbox-item__name {
    font-weight: 600;
}

.pm-inbox-item__meta {
    font-size: 12px;
    opacity: 0.75;
}

.pm-inbox-item--active {
    background: #2563eb;
    border-color: #1d4ed8;
    color: #fff;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.25);
}

.pm-inbox-item--active .pm-inbox-item__meta {
    opacity: 0.85;
    color: #e0e7ff;
}

.pm-admin-thread-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
    gap: 16px;
    flex-wrap: wrap;
}

.pm-admin-thread-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 220px;
}

.pm-admin-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #dbeafe 0%, #e2e8f0 100%);
    color: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.pm-admin-thread-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.pm-admin-thread-label {
    font-weight: 600;
    color: #0f172a;
}

.pm-admin-thread-meta {
    font-size: 13px;
    color: #64748b;
}

.pm-admin-thread-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-left: auto;
}

.pm-admin-main {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pm-admin-thread-action {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #0f172a;
    font-size: 12px;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.pm-admin-thread-action.is-visible {
    display: inline-flex;
}

.pm-admin-thread-action:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.pm-chat {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 12px;
    max-height: 480px;
    overflow-y: auto;
    min-height: 200px;
    background-color: #f8fafc;
    background-image:
        radial-gradient(circle at 15% 20%, rgba(59, 130, 246, 0.08), rgba(59, 130, 246, 0) 48%),
        radial-gradient(circle at 85% 0%, rgba(16, 185, 129, 0.08), rgba(16, 185, 129, 0) 40%),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.pm-chat-row {
    display: flex;
    margin: 10px 0;
}

.pm-chat-row--start {
    justify-content: flex-start;
}

.pm-chat-row--end {
    justify-content: flex-end;
}

.pm-chat-message {
    max-width: min(720px, 92%);
    padding: 10px 12px;
    border-radius: 16px;
    border: 1px solid #dbe3ee;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    background: #ffffff;
}

.pm-chat-message--admin {
    border-bottom-left-radius: 6px;
    background: #ffffff;
}

.pm-chat-message--parent {
    border-color: #86efac;
    background: #e9f9f1;
    border-bottom-right-radius: 6px;
}

.pm-chat-row--grouped {
    margin-top: 4px;
    margin-bottom: 4px;
}

.pm-chat-message--group-top {
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

.pm-chat-message--group-middle {
    border-radius: 10px;
}

.pm-chat-message--group-bottom {
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.pm-chat-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 6px;
}

.pm-chat-role {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #334155;
}

.pm-chat-time {
    font-size: 12px;
    color: #475569;
    white-space: nowrap;
}

.pm-chat-body {
    line-height: 1.45;
    color: #0f172a;
}

.pm-chat-status {
    margin-top: 6px;
    font-size: 11px;
    text-align: right;
    color: #64748b;
}

.pm-chat-status--read {
    color: #64748b;
}

.pm-chat-status--unread {
    color: #b91c1c;
}

.pm-chat-role .icon {
    width: 12px;
    height: 12px;
}

.pm-admin-thread-action .icon {
    width: 14px;
    height: 14px;
}

.pm-chat-separator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
}

.pm-chat-separator::before,
.pm-chat-separator::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.pm-admin-chat {
    min-height: 220px;
}

.pm-reply-box,
.pm-admin-reply-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
    margin-top: 12px;
}

.pm-reply-box textarea,
.pm-admin-reply-box textarea {
    width: 100%;
    min-width: 260px;
}

.pm-reply-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pm-attach-input {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.pm-attach-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 10px;
    padding: 6px 12px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #1f2937;
    font-weight: 600;
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.08);
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.pm-attach-btn:hover {
    background: #eef2f7;
    border-color: #b8c6d8;
}

.pm-attach-btn:active {
    transform: translateY(1px);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
}

.pm-attach-preview {
    display: none;
}

.pm-attach-preview.is-visible {
    display: block;
}

.pm-attach-preview__card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px dashed #cbd5e1;
    background: #ffffff;
    max-width: 100%;
}

.pm-attach-preview__image {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    object-fit: cover;
}

.pm-attach-preview__meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pm-attach-preview__name {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    word-break: break-word;
}

.pm-attach-preview__remove {
    border: none;
    background: transparent;
    padding: 0;
    color: #b91c1c;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

.pm-attach-preview__remove:hover {
    color: #991b1b;
}

@media (max-width: 520px) {
    .pm-attach-preview__card {
        flex-direction: column;
        align-items: flex-start;
    }

    .pm-attach-preview__image {
        width: 100%;
        height: auto;
        max-width: 240px;
    }
}

.pm-attach-status {
    font-size: 12px;
    color: #64748b;
    margin-right: auto;
}

.pm-attach-status[data-tone="error"] {
    color: #b91c1c;
}

.pm-attach-status[data-tone="success"] {
    color: #15803d;
}

.pm-send-btn {
    align-self: flex-end;
    min-width: 120px;
    height: 40px;
    border-radius: 10px;
    padding: 0 18px;
}

.pm-attachment {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pm-attachment__image-link {
    display: inline-flex;
}

.pm-attachment__image {
    max-width: 260px;
    width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.pm-attachment__download {
    font-size: 12px;
    color: #2563eb;
    text-decoration: none;
}

.pm-attachment__download:hover {
    text-decoration: underline;
}

/* Parent Messages Modal */
.pm-modal {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pm-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
}

.pm-modal__content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.15);
    width: 100%;
    max-width: 520px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    margin: 16px;
}

.pm-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.pm-modal__header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.pm-modal__close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #64748b;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}

.pm-modal__close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.pm-modal__body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
}

.pm-parent-search {
    margin-bottom: 16px;
}

.pm-parent-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.pm-parent-list__loading,
.pm-parent-list__empty {
    text-align: center;
    padding: 24px 16px;
    color: #64748b;
}

.pm-parent-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.pm-parent-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.pm-parent-item:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
    border-color: #3b82f6;
}

.pm-parent-item--loading {
    opacity: 0.6;
    pointer-events: none;
}

.pm-parent-item__main {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pm-parent-item__name {
    font-weight: 600;
    color: #0f172a;
}

.pm-parent-item__badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 500;
}

.pm-parent-item__badge--existing {
    background: #dbeafe;
    color: #1d4ed8;
}

.pm-parent-item__children {
    font-size: 13px;
    color: #64748b;
}

@media (max-width: 768px) {
    .pm-admin-layout {
        grid-template-columns: 1fr;
    }

    .pm-admin-inbox {
        max-height: 300px;
    }

    .pm-chat {
        max-height: 350px;
    }

    .pm-modal__content {
        max-width: none;
        margin: 8px;
        max-height: 90vh;
    }
}

/* FAQ Section Styles */
.faq-container {
    max-width: 900px;
    margin: 20px auto;
    padding: 30px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.faq-title {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 2rem;
}

.faq-intro {
    text-align: center;
    color: #666;
    margin-bottom: 40px;
    font-size: 1.1rem;
}

.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.faq-item {
    border: 2px solid #f0f7ff;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.1);
}

.faq-question {
    width: 100%;
    padding: 18px 25px;
    background: #fff;
    border: none;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease;
    font-family: inherit;
}

.faq-question::after {
    content: '▼';
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    color: var(--primary-color);
}

.faq-item.active .faq-question::after {
    transform: rotate(180deg);
}

.faq-item.active .faq-question {
    background: #f0f7ff;
    color: var(--primary-color);
}

.faq-answer {
    padding: 0 25px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #fff;
}

.faq-item.active .faq-answer {
    padding: 15px 25px 25px 25px;
    max-height: 500px;
}

.faq-answer p {
    color: #555;
    line-height: 1.7;
    margin: 0;
}

.faq-answer strong {
    color: var(--primary-color);
}
