/* Review later: a physical 00-23 section order requires moving CSS rule blocks. */

/* ==========================================================================
00. Reset / Base / Typography
========================================================================== */
/* Base typography defaults */
body {
    font-family: var(--ds-font-family);
    margin: 0;
    padding: 0;
    background-color: var(--ds-color-page);
    color: var(--ds-color-text);
    line-height: 1.6;
}

/* Heading defaults */
h1, h2, h3, h4 {
    color: var(--ds-color-heading);
    margin-bottom: 15px;
    font-weight: 600;
}

/* Page title defaults */
h1 {
    margin-top: 0;
    font-size: 2rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    display: inline-block;
}

/* Link defaults */
a {
    text-decoration: none;
    color: var(--ds-color-primary);
    transition: color 0.2s;
}

a:hover {
    color: var(--ds-color-primary-hover);
}

img {
    max-width: 100%;
    height: auto;
}

/* ==========================================================================
01. Navigation / Header / Footer
========================================================================== */
/* Navigation - navbar */
.navbar {
    background-color: #2c3e50;
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 1.2rem;
    font-weight: bold;
    color: #ecf0f1;
    display: flex;
    align-items: center;
    gap: 10px;
}

a.logo {
    text-decoration: none;
    color: #ecf0f1;
    transition: color 0.2s;
}

a.logo:hover {
    color: #3498db;
}

.navbar img, .logo img, .logo i {
    max-height: 30px;
    width: auto;
}

.nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 15px;
    align-items: center;
}

.nav-links li {
    display: inline;
}

.nav-links a {
    color: #ecf0f1;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.95rem;
}

.nav-links a:hover, .nav-links a.active {
    background-color: #34495e;
    color: #3498db;
}

/* Navigation - menu badges */
.nav-badge {
    align-items: center;
    background: var(--ds-color-danger);
    border: 1px solid var(--ds-color-danger-soft);
    border-radius: 999px;
    color: #ffffff;
    display: inline-flex;
    font-size: 0.72rem;
    font-weight: 700;
    justify-content: center;
    line-height: 1;
    margin-left: 6px;
    min-height: 18px;
    min-width: 18px;
    padding: 2px 5px;
    vertical-align: middle;
}

.dropdown-nav-badge {
    flex: 0 0 auto;
    margin-left: 10px;
}

.dropdown-content a.dropdown-link-with-badge {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

/* Navigation - appearance mode toggle */
.appearance-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    min-width: 38px;
    min-height: 36px;
    padding: 0;
    border: 1px solid rgba(236, 240, 241, 0.28);
    border-radius: 4px;
    background-color: #34495e;
    color: #ecf0f1;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.appearance-toggle:hover,
.appearance-toggle:focus-visible {
    background-color: #2c3e50;
    border-color: #3498db;
    color: #3498db;
}

.appearance-toggle i {
    width: 1em;
    text-align: center;
}

/* Legördülő menü (Dropdown) */
.dropdown { position: relative; display: inline-block; }
.dropdown-content { display: none; position: absolute; background-color: #34495e; min-width: 220px; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); z-index: 1001; border-radius: 4px; top: 100%; left: 0; }
.dropdown-content a { color: #ecf0f1; padding: 12px 16px; text-decoration: none; display: block; border-bottom: 1px solid #2c3e50; }
.dropdown-content a:last-child { border-bottom: none; }
.dropdown-content a:hover { background-color: #2c3e50; color: #3498db; }
.dropbtn i { margin-left: 5px; font-size: 0.8em; }

@media (min-width: 769px) {
    .dropdown:hover .dropdown-content { display: block; }
}

.dropdown-content.show { display: block; }

.logout-btn {
    background-color: #e74c3c !important;
    color: white !important;
    padding: 8px 15px !important;
    font-weight: bold;
    border: none;
    border-radius: 4px;
}

.logout-btn:hover {
    background-color: #c0392b !important;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 4px 0;
    transition: 0.4s;
}

/* ==========================================================================
02. Layout / Containers / Generic Grid
========================================================================== */
/* Layout - legacy container */
.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 20px;
    background-color: var(--ds-color-surface);
    color: var(--ds-color-text);
    box-shadow: var(--ds-shadow-md);
    border-radius: 8px;
    min-height: 80vh;
}

/* ==========================================================================
03. Dashboard
========================================================================== */
/* Dashboard - legacy card grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.card {
    background: var(--ds-color-surface);
    color: var(--ds-color-text);
    border: 1px solid var(--ds-color-border);
    border-radius: var(--ds-radius-lg);
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: var(--ds-shadow-sm);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--ds-shadow-md);
    border-color: var(--ds-color-primary);
}

.card img, .card i {
    max-width: 64px;
    font-size: 3rem;
    height: auto;
    margin-bottom: 20px;
    color: var(--ds-color-primary);
}

.card h2,
.card h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: var(--ds-color-heading);
}

.card p {
    color: var(--ds-color-text-muted);
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.card .btn {
    margin-top: auto;
}

.dashboard-grid .card .btn {
    color: #ffffff !important;
}

/* ==========================================================================
04. Buttons
========================================================================== */
/* Buttons - legacy entry point */
/* Az alap gombstílusok a design-system rétegben vannak központosítva. */

/* ==========================================================================
05. Legacy / Compatibility
========================================================================== */

/* Legacy / Compatibility - review later */

/* ==========================================================================
06. Tables
========================================================================== */

.table-responsive {
    overflow-x: auto;
    margin-top: 20px;
    border-radius: var(--ds-radius-lg);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--ds-color-surface);
    color: var(--ds-color-text);
}

table th, table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--ds-color-border);
    vertical-align: middle;
}

table th {
    background-color: var(--ds-color-surface-muted);
    color: var(--ds-color-heading);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    border-top: 1px solid var(--ds-color-border);
}

table tr:hover {
    background-color: var(--ds-color-surface-muted);
}

.table-striped tbody tr:nth-of-type(odd) { background-color: var(--ds-color-surface-muted); }
.table-striped tbody tr:nth-of-type(even) { background-color: var(--ds-color-surface); }
.table-striped tbody tr:hover { background-color: var(--ds-color-neutral-soft); }

/* Tables - generic helper classes */

.table-row-muted {
    opacity: 0.6;
    background-color: var(--ds-color-surface-muted);
}

.table-fixed-compact {
    margin: 0;
    table-layout: fixed;
    width: 100%;
}

.table-head-dark {
    background-color: #2c3e50;
    color: #ffffff;
}

.table-cell-middle {
    padding: 12px;
    vertical-align: middle;
}

.table-cell-name {
    font-weight: bold;
    text-align: left;
}

.table-muted-small {
    font-size: 0.8em;
    color: var(--ds-color-text-muted);
}

/* ==========================================================================
07. Badges
========================================================================== */

.badge {
    padding: 4px 8px;
    border-radius: var(--ds-radius-pill);
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
    display: inline-block;
    line-height: 1;
}

.badge-csaladi { background-color: #e67e22; }
.badge-napkozbeni { background-color: #3498db; }
.badge-aktiv { background-color: #27ae60; }
.badge-lezart { background-color: #95a5a6; }
.badge-success { background-color: #27ae60; }
.badge-warning {
    background-color: #f1c40f;
    color: #333;
}
.work-time-status-current { background-color: #27ae60; }
.work-time-status-future {
    background-color: #3498db;
}
.work-time-status-expired { background-color: #7f8c8d; }
.work-time-status-inactive { background-color: #95a5a6; }
.badge-danger { background-color: #e74c3c; }
.badge-info { background-color: #5dade2; }

/* ==========================================================================
08. Forms
========================================================================== */
/* Forms - legacy form styles */
.form-container {
    max-width: 600px;
    margin: 0 auto;
    background: var(--ds-color-surface);
    color: var(--ds-color-text);
    padding: 25px;
    border-radius: 8px;
    box-shadow: var(--ds-shadow-sm);
}

.form-section {
    background: var(--ds-color-surface);
    color: var(--ds-color-text);
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
    box-shadow: var(--ds-shadow-sm);
    border-left: 5px solid #2ecc71;
}

.form-section h3 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--ds-color-border);
    font-size: 1.2rem;
    color: var(--ds-color-heading);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* Form field defaults */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--ds-color-text);
}

.form-group input:not([type="checkbox"]):not([type="radio"]),
.form-group select,
.form-group textarea {
    width: 100%;
    min-height: 42px;
    padding: 10px;
    border: 1px solid var(--ds-color-border);
    border-radius: var(--ds-radius-md);
    box-sizing: border-box;
    font-size: 14px;
    line-height: 1.3;
    background-color: var(--ds-color-surface);
    color: var(--ds-color-text);
    transition: border-color 0.2s;
}

.form-group textarea {
    min-height: 84px;
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--ds-color-primary);
    box-shadow: var(--ds-focus-ring);
    outline: none;
}

.form-group label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    font-weight: normal;
    cursor: pointer;
}

.form-group input[type="checkbox"] {
    width: auto !important;
    margin: 0;
    transform: scale(1.2);
    flex-shrink: 0;
}

#editGyerekForm .form-group { margin-bottom: 8px !important; }
#editGyerekForm .form-section { margin-bottom: 15px !important; padding: 15px !important; background: var(--ds-color-surface); box-shadow: var(--ds-shadow-sm); border-radius: 4px; }
#editGyerekForm .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px !important; }

.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }

/* Forms - dark mode inline surface compatibility */
html[data-mode="dark"] .contract-surface-panel,
html[data-mode="dark"] .contract-current-days-panel {
    background: var(--ds-color-surface-muted) !important;
    color: var(--ds-color-text) !important;
    border: 1px solid var(--ds-color-border);
}

html[data-mode="dark"] .contract-current-days-panel div,
html[data-mode="dark"] .contract-current-days-panel span {
    color: var(--ds-color-text) !important;
}

html[data-mode="dark"] .contract-surface-close {
    border-left: 4px solid var(--ds-color-danger);
}

html[data-mode="dark"] .contract-surface-close h4 {
    color: var(--ds-color-danger) !important;
}

html[data-mode="dark"] .contract-surface-panel input[type="file"] {
    background: var(--ds-color-surface) !important;
    color: var(--ds-color-text) !important;
    border-color: var(--ds-color-border) !important;
}

/* ==========================================================================
09. Schedule / Beosztás Components
========================================================================== */
/* Schedule - legacy beosztas colors */
/* BEOSZTÁS NAPTÁR ÚJ SZÍNEK (beosztas.php) */
.grid-bg-contract { background-color: #27ae60 !important; color: white; }
.grid-bg-absent { background-color: #e74c3c !important; color: white; }
.grid-bg-extra { background-color: #f1c40f !important; color: #333; }
.grid-bg-beszoktatas { background-color: #5dade2 !important; color: white; }
.grid-bg-holiday { background-color: #7f8c8d !important; color: white; }
.grid-bg-empty { background-color: #ecf0f1 !important; color: #333; }
.grid-bg-no-contract { background-color: #bdc3c7 !important; color: white; opacity: 0.4; cursor: not-allowed; }

.schedule-table-wide .schedule-name-sticky-cell {
    position: sticky;
    left: 0;
    z-index: 1;
    padding: 10px;
    text-align: left;
    background: var(--ds-color-surface);
    color: var(--ds-color-text);
    border-right: 2px solid var(--ds-color-border);
}

.child-table-name {
    font-size: 0.9em;
    font-weight: 500;
    color: var(--ds-color-heading);
    text-decoration: none;
    border-bottom: 1px dotted var(--ds-color-primary);
    transition: color 0.2s;
}
.child-table-name:hover {
    color: var(--ds-color-primary-hover);
}

.schedule-table-wide .schedule-name-sticky-cell .child-table-name {
    color: var(--ds-color-heading);
}

.schedule-table-wide .schedule-name-sticky-cell .child-table-name:hover {
    color: var(--ds-color-primary-hover);
}

.schedule-table-wide .schedule-name-meta {
    margin-top: 2px;
    color: var(--ds-color-text-muted);
    font-size: 0.7em;
    font-weight: normal;
}


/* ==========================================================================
10. Modals
========================================================================== */
/* Modals - base overlay */
.modal {
    display: none; 
    position: fixed; 
    z-index: 10000; 
    left: 0; top: 0; width: 100%; height: 100%; 
    background-color: rgba(0,0,0,0.5); 
    align-items: center; justify-content: center;
}

.modal-content {
    background-color: var(--ds-color-surface);
    color: var(--ds-color-text);
    padding: 25px;
    border-radius: var(--ds-radius-lg);
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    position: relative;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: var(--ds-color-text-muted);
}
.modal-close:hover { color: var(--ds-color-text); }

/* Modals - title variants */

.modal-title-slate,
.modal-title-purple,
.modal-title-warning {
    margin-top: 0;
    padding-bottom: 10px;
    color: var(--ds-color-heading);
}

.modal-title-slate {
    border-bottom: 2px solid #34495e;
}

.modal-title-purple {
    border-bottom: 2px solid #9b59b6;
}

.modal-title-warning {
    border-bottom: 2px solid #f39c12;
}

/* Form helpers - info tooltip */
.field-help-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 4px;
    border: 1px solid var(--ds-color-border);
    border-radius: 50%;
    color: var(--ds-color-text-muted);
    background: var(--ds-color-surface-muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    cursor: help;
    vertical-align: middle;
}

.field-help-icon:focus {
    outline: 2px solid var(--ds-color-primary);
    outline-offset: 2px;
}

.field-help-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    display: none;
    width: max-content;
    max-width: min(260px, 78vw);
    padding: 7px 9px;
    border-radius: var(--ds-radius-sm);
    background: var(--ds-color-heading);
    color: var(--ds-color-surface);
    box-shadow: var(--ds-shadow-md);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.35;
    text-align: left;
    white-space: normal;
    z-index: 10020;
}

.field-help-icon:hover::after,
.field-help-icon:focus::after {
    display: block;
}

/* Modals - work time slot editor */
.work-time-slot-modal {
    align-items: flex-start;
    overflow-y: auto;
    padding: 5vh 16px;
}

.work-time-slot-modal-content {
    width: min(92vw, 760px);
    max-width: 760px;
    max-height: 90vh;
    padding: 18px 20px 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.work-time-slot-modal-content .modal-title-slate {
    margin-bottom: 10px;
    padding-right: 32px;
}

.work-time-slot-edit-form {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.work-time-slot-modal .modal-scroll-body {
    overflow-y: auto;
    max-height: calc(90vh - 150px);
    padding-right: 6px;
}

.work-time-slot-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
}

.work-time-slot-form-grid .form-group {
    margin-bottom: 0;
}

.work-time-slot-grid-full {
    grid-column: 1 / -1;
}

.work-time-slot-modal-note {
    margin: 0 0 12px;
    padding: 10px 12px;
}

.work-time-slot-create-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.work-time-slot-create-row {
    display: grid;
    gap: 12px 14px;
    align-items: start;
}

.work-time-slot-create-row .form-group {
    margin-bottom: 0;
}

.work-time-slot-create-row-2 {
    grid-template-columns: minmax(0, 2fr) minmax(150px, 1fr);
}

.work-time-slot-create-row-4 {
    grid-template-columns: minmax(110px, 0.8fr) minmax(180px, 1.4fr) minmax(120px, 1fr) minmax(120px, 1fr);
}

.work-time-slot-create-row-3 {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
}

.work-time-slot-modal-actions {
    flex-shrink: 0;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--ds-color-border);
}

.rotation-pattern-create-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.rotation-pattern-modal-content {
    width: min(94vw, 1100px);
    max-width: 1100px;
}

.rotation-pattern-active-toggle {
    align-self: flex-start;
    margin: 0;
}

.rotation-pattern-days {
    display: grid;
    gap: 14px;
}

.rotation-pattern-week {
    padding: 12px;
    border: 1px solid var(--ds-color-border);
    border-radius: 6px;
    background: var(--ds-color-surface);
}

.rotation-pattern-week h4 {
    margin: 0 0 10px;
    color: var(--ds-color-heading);
}

.rotation-pattern-day-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(130px, 1fr));
    gap: 10px;
}

.rotation-pattern-day-grid .form-group {
    margin-bottom: 0;
}

.rotation-pattern-summary {
    min-width: 260px;
    text-align: left;
    line-height: 1.45;
}

@media (max-width: 900px) {
    .work-time-slot-create-row-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rotation-pattern-day-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .work-time-slot-modal {
        padding: 4vh 10px;
    }

    .work-time-slot-modal-content {
        width: 94vw;
        max-height: 92vh;
        padding: 16px;
    }

    .work-time-slot-modal .modal-scroll-body {
        max-height: calc(92vh - 145px);
    }

    .work-time-slot-form-grid {
        grid-template-columns: 1fr;
    }

    .work-time-slot-create-row-2,
    .work-time-slot-create-row-4,
    .work-time-slot-create-row-3 {
        grid-template-columns: 1fr;
    }

    .rotation-pattern-day-grid {
        grid-template-columns: 1fr;
    }
}

/* Modals - dark mode inline title and content compatibility */
html[data-mode="dark"] .contract-edit-modal-content {
    background: var(--ds-color-surface) !important;
    color: var(--ds-color-text) !important;
    border: 1px solid var(--ds-color-border);
    box-shadow: var(--ds-shadow-md);
}

html[data-mode="dark"] .contract-edit-modal-content h3,
html[data-mode="dark"] .contract-edit-modal-content label,
html[data-mode="dark"] .contract-edit-modal-content p,
html[data-mode="dark"] .caregiver-contract-modal-title,
html[data-mode="dark"] .day-edit-modal-title {
    color: var(--ds-color-heading) !important;
}

html[data-mode="dark"] .contract-edit-modal-content input:not([type="checkbox"]),
html[data-mode="dark"] .contract-edit-modal-content select {
    background: var(--ds-color-surface) !important;
    color: var(--ds-color-text) !important;
    border-color: var(--ds-color-border) !important;
}

.caregiver-contract-modal {
    align-items: flex-start;
    overflow-y: auto;
    padding: 24px 12px;
}

.caregiver-contract-modal-content {
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 18px 20px;
}

.caregiver-contract-modal-content .form-group {
    margin-bottom: 12px;
}

.caregiver-contract-modal-actions {
    position: sticky;
    bottom: -18px;
    margin: 14px -20px -18px;
    padding: 12px 20px;
    background: var(--ds-color-surface);
    border-top: 1px solid var(--ds-color-border);
}

@media (max-width: 640px) {
    .caregiver-contract-modal {
        padding: 12px 8px;
    }

    .caregiver-contract-modal-content {
        max-height: calc(100vh - 24px);
        padding: 16px;
    }

    .caregiver-contract-modal-actions {
        bottom: -16px;
        margin: 12px -16px -16px;
        padding: 12px 16px;
    }
}

/* Modals - attendance add child modal */
html[data-mode="dark"] #addMissingKidModal > div {
    background: var(--ds-color-surface) !important;
    color: var(--ds-color-text) !important;
    border: 1px solid var(--ds-color-border);
}

html[data-mode="dark"] #addMissingKidModal h3 {
    color: var(--ds-color-heading) !important;
    border-bottom-color: var(--ds-color-primary) !important;
}

html[data-mode="dark"] #addMissingKidModal form {
    background: var(--ds-color-surface-muted) !important;
    color: var(--ds-color-text) !important;
    border-color: var(--ds-color-border) !important;
}

html[data-mode="dark"] #addMissingKidModal form > div:first-of-type {
    color: var(--ds-color-heading) !important;
}

html[data-mode="dark"] #addMissingKidModal form > div:first-of-type div {
    color: var(--ds-color-text-muted) !important;
}

html[data-mode="dark"] #addMissingKidModal input[type="text"] {
    background: var(--ds-color-surface) !important;
    color: var(--ds-color-text) !important;
    border-color: var(--ds-color-border-strong) !important;
}

.daily-swap-panel {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    background: var(--ds-color-primary-soft);
    color: var(--ds-color-text);
    padding: 10px;
    border-radius: 5px;
    border: 1px dashed var(--ds-color-primary);
}

.daily-swap-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.85em;
    color: var(--ds-color-text-muted);
    flex: 1;
    min-width: 180px;
}

.daily-swap-date-input {
    padding: 8px;
    border: 1px solid var(--ds-color-border);
    border-radius: 4px;
    background: var(--ds-color-surface);
    color: var(--ds-color-text);
}

.daily-swap-help,
.daily-swap-month {
    width: 100%;
    font-size: 0.78em;
    color: var(--ds-color-text-muted);
}

.daily-swap-month {
    font-weight: 700;
    color: var(--ds-color-heading);
}

.daily-swap-weekdays,
.daily-swap-calendar {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(7, minmax(28px, 1fr));
    gap: 4px;
}

.daily-swap-weekdays span {
    text-align: center;
    font-size: 0.72em;
    color: var(--ds-color-text-muted);
}

.daily-swap-day,
.daily-swap-day-spacer {
    min-height: 30px;
    border-radius: 4px;
}

.daily-swap-day {
    border: 1px solid var(--ds-color-border);
    background: var(--ds-color-surface);
    color: var(--ds-color-text-muted);
    cursor: pointer;
    font: inherit;
    line-height: 1;
}

.daily-swap-day.is-eligible {
    color: var(--ds-color-text);
    border-color: var(--ds-color-primary);
    font-weight: 700;
}

.daily-swap-day.is-selected {
    background: var(--ds-color-primary);
    color: #fff;
    border-color: var(--ds-color-primary);
}

.daily-swap-day.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

html[data-mode="dark"] .daily-swap-panel {
    background: var(--ds-color-primary-soft);
    border-color: var(--ds-color-primary);
}

/* ==========================================================================
11. Alerts
========================================================================== */
/* Alerts - flash messages */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: var(--ds-radius-md);
    box-shadow: var(--ds-shadow-sm);
}
.alert-success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-info { background-color: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }
.alert-warning { background-color: #fff3cd; color: #856404; border: 1px solid #ffeeba; }

/* Alerts - dark mode readable semantic surfaces */
html[data-mode="dark"] .alert-success {
    background-color: var(--ds-color-success-soft);
    color: #14532d;
    border-color: var(--ds-color-success);
}

html[data-mode="dark"] .alert-danger {
    background-color: var(--ds-color-danger-soft);
    color: #7f1d1d;
    border-color: var(--ds-color-danger);
}

html[data-mode="dark"] .alert-info {
    background-color: var(--ds-color-primary-soft);
    color: var(--ds-color-heading);
    border-color: var(--ds-color-primary);
}

html[data-mode="dark"] .alert-warning {
    background-color: var(--ds-color-warning-soft);
    color: #78350f;
    border-color: var(--ds-color-warning);
}

html[data-mode="dark"] .alert .form-group label,
html[data-mode="dark"] .alert .import-help-list {
    color: inherit;
}

/* ==========================================================================
12. Attendance / Jelenlét Components
========================================================================== */
/* Attendance - daily table styles */
#attendanceForm .table td, #attendanceForm .table th { padding: 4px 8px !important; }
.child-table td, .child-table th { padding: 10px !important; }

input[readonly] + .set-now-btn {
    opacity: 0.4;
    cursor: not-allowed !important;
}

.table input[type="text"] {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

.table-striped tbody tr.attendance-row:not(.row-absent):nth-child(odd) > td {
    background-color: var(--ds-color-surface-muted) !important; 
}
.table-striped tbody tr.attendance-row:not(.row-absent):nth-child(even) > td {
    background-color: var(--ds-color-surface) !important; 
}

.table-striped tbody tr.row-absent > td {
    background-color: #fafafa !important; 
    color: #a0a0a0 !important;
}

.row-absent .child-name-container {
    opacity: 0.4;
    filter: grayscale(100%);
}

.attendance-row > td {
    transition: background-color 0.3s ease, color 0.3s ease;
}

.child-profile-link {
    color: var(--ds-color-heading);
    text-decoration: none;
    border-bottom: 1px dotted var(--ds-color-primary);
    transition: color 0.2s;
}
.child-profile-link:hover {
    color: var(--ds-color-primary);
}

/* Attendance - dark mode toolbar and section headers */
html[data-mode="dark"] .attendance-date-header,
html[data-mode="dark"] .attendance-quote-card,
html[data-mode="dark"] .attendance-section-header,
html[data-mode="dark"] .attendance-stat-box {
    background: var(--ds-color-surface-muted) !important;
    color: var(--ds-color-text) !important;
    border-color: var(--ds-color-border) !important;
}

html[data-mode="dark"] .attendance-date-header h1,
html[data-mode="dark"] .date-nav-current,
html[data-mode="dark"] .attendance-date-weekday,
html[data-mode="dark"] .attendance-section-header .section-title-compact {
    color: var(--ds-color-heading) !important;
}

html[data-mode="dark"] .attendance-quote-card div,
html[data-mode="dark"] .attendance-quote-card p {
    color: var(--ds-color-text-muted) !important;
}

html[data-mode="dark"] .attendance-date-header .date-nav-row input[type="date"],
html[data-mode="dark"] .attendance-date-header .date-nav-row input[type="month"] {
    background: var(--ds-color-surface) !important;
    color: var(--ds-color-text) !important;
    border-color: var(--ds-color-border) !important;
}

html[data-mode="dark"] #attendanceForm .table thead tr {
    background-color: var(--ds-color-surface-muted) !important;
    color: var(--ds-color-heading) !important;
}

/* ==========================================================================
13. Caregiver / Gondozó Components
========================================================================== */
/* Caregiver - legacy schedule table colors */
.schedule-table th, .schedule-table td { border: 1px solid #ccc; vertical-align: middle; }
.schedule-cell { cursor: pointer; font-weight: bold; transition: 0.2s; position: relative; }
.schedule-cell:not(.bg-no-contract):not(.grid-bg-no-contract):hover { opacity: 0.8; transform: scale(1.05); z-index: 10; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.schedule-cell.has-attendance-time::after { content: ''; position: absolute; top: 2px; right: 2px; width: 6px; height: 6px; background-color: #f1c40f; border-radius: 50%; }

.bg-de { background-color: #e0f7fa; color: #00796b; }
.bg-du { background-color: #fff3e0; color: #e65100; }
.bg-re { background-color: #e8f5e9; color: #2e7d32; }
.bg-piheno { background-color: #f1f2f6; color: #a4b0be; font-weight: normal; }
.bg-fsz { background-color: #f3e5f5; color: #8e24aa; }
.bg-bsz { background-color: #ffebee; color: #c62828; }
.bg-fnsz { background-color: #eceff1; color: #455a64; text-decoration: line-through; }

/* ==========================================================================
14. Child / Gyerek Components
========================================================================== */
/* Child / Gyerek - legacy list and card styles */
.child-link { text-decoration: none; color: inherit; transition: color 0.2s; }
.child-link:hover { color: #3498db; text-decoration: underline; }
.child-grid { display: grid; grid-template-columns: 1fr; gap: 20px; margin-top: 20px; }
@media (min-width: 768px) { .child-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .child-grid { grid-template-columns: repeat(5, 1fr); } }

.child-card { 
    background: var(--ds-color-surface); color: var(--ds-color-text); border-radius: 10px; box-shadow: var(--ds-shadow-sm); 
    padding: 20px; display: flex; flex-direction: column; align-items: center; 
    transition: transform 0.2s; position: relative; border-top: 5px solid var(--ds-color-neutral-soft); 
}
.child-card:hover { transform: translateY(-5px); }
.card-active { border-top-color: #27ae60; }
.card-photo { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; margin-bottom: 15px; border: 3px solid var(--ds-color-surface-muted); }
.card-name { font-size: 1.2rem; font-weight: bold; margin-bottom: 5px; text-align: center; }
.card-info { font-size: 0.85rem; color: var(--ds-color-text-muted); margin-bottom: 15px; text-align: center; }
.card-actions { display: flex; gap: 10px; margin-top: auto; border-top: 1px solid var(--ds-color-border); padding-top: 15px; width: 100%; justify-content: center; }
.view-switcher a { color: var(--ds-color-text-muted); font-size: 1.2rem; margin-left: 10px; text-decoration: none; }
.view-switcher a.active { color: var(--ds-color-heading); }

/* ==========================================================================
15. Child Profile / CV Components
========================================================================== */

.cv-card { background: var(--ds-color-surface); color: var(--ds-color-text); border-radius: 6px; box-shadow: var(--ds-shadow-sm); margin-bottom: 20px; overflow: hidden; }
.cv-header { display: flex; gap: 15px; padding: 15px 20px; background: var(--ds-color-surface-muted); border-bottom: 1px solid var(--ds-color-border); align-items: center; flex-wrap: wrap; }
.cv-photo { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; border: 3px solid var(--ds-color-surface); box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.cv-photo-placeholder { width: 90px; height: 90px; border-radius: 50%; background: var(--ds-color-neutral-soft); display: flex; align-items: center; justify-content: center; font-size: 3em; color: var(--ds-color-text-muted); border: 3px solid var(--ds-color-surface); box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.cv-body { padding: 15px 20px; }
.cv-section { margin-bottom: 20px; }
.cv-section-title { font-size: 1.05em; color: var(--ds-color-heading); border-bottom: 2px solid var(--ds-color-primary); padding-bottom: 4px; margin-bottom: 12px; display: inline-block; font-weight: bold; text-transform: uppercase; letter-spacing: 0.5px;}
.cv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 15px; }
@media (max-width: 768px) { .cv-grid { grid-template-columns: 1fr; } }
.cv-data-group { display: flex; flex-direction: column; }
.cv-label { font-size: 0.7em; color: var(--ds-color-text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 1px; font-weight: 700; }
.cv-value { font-size: 0.9em; color: var(--ds-color-text); font-weight: 500; }
.cv-value a { color: var(--ds-color-primary); text-decoration: none; font-weight: bold; font-size: 1.05em; }
.cv-value a:hover { text-decoration: underline; }
.badge-allergy { background-color: #e74c3c; color: white; padding: 2px 6px; border-radius: 3px; font-size: 0.8em; margin-right: 4px; display: inline-block; box-shadow: 0 1px 2px rgba(231, 76, 60, 0.3);}

.parent-card { background: var(--ds-color-surface-muted); color: var(--ds-color-text); padding: 12px; border-radius: 6px; border-top: 3px solid #9b59b6; box-shadow: var(--ds-shadow-sm); }
.parent-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 10px; }
@media (max-width: 600px) { .parent-grid { grid-template-columns: 1fr; } }

/* Navigation / Footer - footer and fixed page controls */
.main-footer {
    text-align: center;
    padding: 40px 20px;
    margin-top: 50px;
    color: var(--ds-color-text-muted);
    border-top: 1px solid var(--ds-color-border);
    font-size: 0.9rem;
    background-color: var(--ds-color-surface);
}

.fixed-action-buttons {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 9999;
}

.back-button-fixed, #scrollToTopBtn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #3498db;
    color: white;
    border: none;
    font-size: 1.5em;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background-color 0.3s, transform 0.2s;
}

#scrollToTopBtn {
    display: none; 
    background-color: #2c3e50; 
}

.back-button-fixed:hover, #scrollToTopBtn:hover {
    background-color: #2980b9;
    transform: translateY(-3px);
}

/* ==========================================================================
16. Auth / Login
========================================================================== */
/* Auth / Login - login page */
body.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-card { 
    background: white; 
    padding: 40px; 
    border-radius: 10px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); 
    width: 100%; 
    max-width: 380px; 
}

.login-header { 
    text-align: center; 
    margin-bottom: 30px; 
}

.login-header i { 
    font-size: 3rem; 
    color: #3498db; 
    margin-bottom: 15px; 
}

.btn-login { 
    background: #3498db; 
    color: white; 
    border: none; 
    padding: 12px; 
    width: 100%; 
    border-radius: 5px; 
    cursor: pointer; 
    font-size: 1.1em; 
    font-weight: bold; 
    transition: background 0.3s; 
}

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

/* ==========================================================================
17. Responsive Rules
========================================================================== */

/* MOBIL NÉZET */
@media (max-width: 768px) {
    .navbar { flex-direction: column; align-items: flex-start; }
    .nav-links { display: none; width: 100%; flex-direction: column; margin-top: 10px; }
    .nav-links.active { display: flex; }
    .nav-links li { display: block; margin: 5px 0; }
    .hamburger { display: flex; position: absolute; top: 15px; right: 20px; }
    .form-grid { grid-template-columns: 1fr; }
    .dropdown-content { position: static; width: 100%; box-shadow: none; background-color: #22313f; }
    .dropdown-content a { padding-left: 30px; }
}

/* Review later: Theme tokens should move near the top in a CSS reordering-only pass. */

/* ==========================================================================
18. Theme Tokens / CSS Variables
========================================================================== */
/* Theme Tokens - design-system foundations */
:root {
    --ds-font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

    --ds-color-page: #f4f6f9;
    --ds-color-surface: #ffffff;
    --ds-color-surface-muted: #f8fafc;
    --ds-color-text: #263445;
    --ds-color-text-muted: #667085;
    --ds-color-heading: #24384c;
    --ds-color-border: #d9e2ec;
    --ds-color-border-strong: #b8c4d0;

    --ds-color-primary: #2563eb;
    --ds-color-primary-hover: #1d4ed8;
    --ds-color-primary-soft: #dbeafe;
    --ds-color-success: #16a34a;
    --ds-color-success-hover: #15803d;
    --ds-color-success-soft: #dcfce7;
    --ds-color-warning: #d97706;
    --ds-color-warning-hover: #b45309;
    --ds-color-warning-soft: #fef3c7;
    --ds-color-danger: #dc2626;
    --ds-color-danger-hover: #b91c1c;
    --ds-color-danger-soft: #fee2e2;
    --ds-color-neutral: #64748b;
    --ds-color-neutral-hover: #475569;
    --ds-color-neutral-soft: #e2e8f0;

    --ds-radius-sm: 4px;
    --ds-radius-md: 6px;
    --ds-radius-lg: 8px;
    --ds-radius-pill: 999px;

    --ds-space-1: 4px;
    --ds-space-2: 8px;
    --ds-space-3: 12px;
    --ds-space-4: 16px;
    --ds-space-5: 20px;
    --ds-space-6: 24px;

    --ds-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
    --ds-shadow-md: 0 8px 20px rgba(16, 24, 40, 0.1);

    --ds-focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.22);
    --ds-transition-fast: 0.16s ease;
}

/*
Theme and appearance mode tokens.
Controlled values:
theme: default, warm, calm, forest, contrast
mode: light, dark
No custom user-supplied colors are allowed.

Functional colors remain semantically stable in :root:
success, warning, danger, and info/status colors are not palette-shifted here.
*/

/* Theme/mode token overrides - default */
html[data-theme="default"][data-mode="light"] {
    --ds-color-page: #f4f6f9;
    --ds-color-surface: #ffffff;
    --ds-color-surface-muted: #f8fafc;
    --ds-color-text: #263445;
    --ds-color-text-muted: #667085;
    --ds-color-heading: #24384c;
    --ds-color-border: #d9e2ec;
    --ds-color-border-strong: #b8c4d0;
    --ds-color-primary: #2563eb;
    --ds-color-primary-hover: #1d4ed8;
    --ds-color-primary-soft: #dbeafe;
    --ds-color-neutral: #64748b;
    --ds-color-neutral-hover: #475569;
    --ds-color-neutral-soft: #e2e8f0;
    --ds-focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.22);
}

html[data-theme="default"][data-mode="dark"] {
    --ds-color-page: #16202a;
    --ds-color-surface: #202b36;
    --ds-color-surface-muted: #293744;
    --ds-color-text: #f1f5f9;
    --ds-color-text-muted: #b6c2cf;
    --ds-color-heading: #f8fafc;
    --ds-color-border: #3b4a59;
    --ds-color-border-strong: #526273;
    --ds-color-primary: #7aa7f7;
    --ds-color-primary-hover: #9abcf9;
    --ds-color-primary-soft: #223d66;
    --ds-color-neutral: #9aa8b6;
    --ds-color-neutral-hover: #c3ccd5;
    --ds-color-neutral-soft: #30404f;
    --ds-focus-ring: 0 0 0 3px rgba(122, 167, 247, 0.28);
}

/* Theme/mode token overrides - warm */
html[data-theme="warm"][data-mode="light"] {
    --ds-color-page: #f8f2e8;
    --ds-color-surface: #fffaf2;
    --ds-color-surface-muted: #f2e6d4;
    --ds-color-text: #3a2f29;
    --ds-color-text-muted: #75665a;
    --ds-color-heading: #3f2f27;
    --ds-color-border: #dfcfba;
    --ds-color-border-strong: #c8ad91;
    --ds-color-primary: #b65f3a;
    --ds-color-primary-hover: #94492b;
    --ds-color-primary-soft: #f4d8c8;
    --ds-color-neutral: #8b7868;
    --ds-color-neutral-hover: #675548;
    --ds-color-neutral-soft: #eadccb;
    --ds-focus-ring: 0 0 0 3px rgba(182, 95, 58, 0.22);
}

html[data-theme="warm"][data-mode="dark"] {
    --ds-color-page: #241d19;
    --ds-color-surface: #302620;
    --ds-color-surface-muted: #3b3028;
    --ds-color-text: #f7efe4;
    --ds-color-text-muted: #d0bdaa;
    --ds-color-heading: #fff7ed;
    --ds-color-border: #554236;
    --ds-color-border-strong: #715746;
    --ds-color-primary: #e09a73;
    --ds-color-primary-hover: #efb28f;
    --ds-color-primary-soft: #573423;
    --ds-color-neutral: #b69d87;
    --ds-color-neutral-hover: #d7c2af;
    --ds-color-neutral-soft: #46372d;
    --ds-focus-ring: 0 0 0 3px rgba(224, 154, 115, 0.28);
}

/* Theme/mode token overrides - calm */
html[data-theme="calm"][data-mode="light"] {
    --ds-color-page: #eef6f5;
    --ds-color-surface: #fbfffd;
    --ds-color-surface-muted: #e3f0ee;
    --ds-color-text: #243a3a;
    --ds-color-text-muted: #5e7473;
    --ds-color-heading: #1f3f42;
    --ds-color-border: #c9dcda;
    --ds-color-border-strong: #9ebfbc;
    --ds-color-primary: #3f8f8b;
    --ds-color-primary-hover: #2f7471;
    --ds-color-primary-soft: #cfebe8;
    --ds-color-neutral: #6b817f;
    --ds-color-neutral-hover: #4d6563;
    --ds-color-neutral-soft: #dbe9e7;
    --ds-focus-ring: 0 0 0 3px rgba(63, 143, 139, 0.22);
}

html[data-theme="calm"][data-mode="dark"] {
    --ds-color-page: #142424;
    --ds-color-surface: #1d3030;
    --ds-color-surface-muted: #273d3d;
    --ds-color-text: #eef8f6;
    --ds-color-text-muted: #b4ccca;
    --ds-color-heading: #f7fffd;
    --ds-color-border: #365251;
    --ds-color-border-strong: #4d706e;
    --ds-color-primary: #7fc6c1;
    --ds-color-primary-hover: #9bd8d4;
    --ds-color-primary-soft: #254f4d;
    --ds-color-neutral: #95aaa8;
    --ds-color-neutral-hover: #c1d0ce;
    --ds-color-neutral-soft: #2f4746;
    --ds-focus-ring: 0 0 0 3px rgba(127, 198, 193, 0.28);
}

/* Theme/mode token overrides - forest */
html[data-theme="forest"][data-mode="light"] {
    --ds-color-page: #f1f5ec;
    --ds-color-surface: #fdfef9;
    --ds-color-surface-muted: #e7eedf;
    --ds-color-text: #283427;
    --ds-color-text-muted: #657260;
    --ds-color-heading: #223a25;
    --ds-color-border: #cfdbc5;
    --ds-color-border-strong: #aabb9d;
    --ds-color-primary: #4f7f45;
    --ds-color-primary-hover: #3d6337;
    --ds-color-primary-soft: #d7e8cf;
    --ds-color-neutral: #718068;
    --ds-color-neutral-hover: #56644d;
    --ds-color-neutral-soft: #e0ead9;
    --ds-focus-ring: 0 0 0 3px rgba(79, 127, 69, 0.22);
}

html[data-theme="forest"][data-mode="dark"] {
    --ds-color-page: #172117;
    --ds-color-surface: #202c20;
    --ds-color-surface-muted: #2b3828;
    --ds-color-text: #f0f7eb;
    --ds-color-text-muted: #bdcdb6;
    --ds-color-heading: #f7fff1;
    --ds-color-border: #3f513a;
    --ds-color-border-strong: #5a6f52;
    --ds-color-primary: #99c58c;
    --ds-color-primary-hover: #b4d8a8;
    --ds-color-primary-soft: #334f2e;
    --ds-color-neutral: #a2b298;
    --ds-color-neutral-hover: #c7d3c0;
    --ds-color-neutral-soft: #35442f;
    --ds-focus-ring: 0 0 0 3px rgba(153, 197, 140, 0.28);
}

/* Theme/mode token overrides - contrast */
html[data-theme="contrast"][data-mode="light"] {
    --ds-color-page: #f3f5f7;
    --ds-color-surface: #ffffff;
    --ds-color-surface-muted: #edf1f5;
    --ds-color-text: #111827;
    --ds-color-text-muted: #4b5563;
    --ds-color-heading: #0f172a;
    --ds-color-border: #b8c2cc;
    --ds-color-border-strong: #7f8c99;
    --ds-color-primary: #1d4ed8;
    --ds-color-primary-hover: #173ea6;
    --ds-color-primary-soft: #d6e4ff;
    --ds-color-neutral: #475569;
    --ds-color-neutral-hover: #334155;
    --ds-color-neutral-soft: #d8dee6;
    --ds-focus-ring: 0 0 0 3px rgba(29, 78, 216, 0.28);
}

html[data-theme="contrast"][data-mode="dark"] {
    --ds-color-page: #111827;
    --ds-color-surface: #1f2937;
    --ds-color-surface-muted: #2b3645;
    --ds-color-text: #f9fafb;
    --ds-color-text-muted: #cbd5e1;
    --ds-color-heading: #ffffff;
    --ds-color-border: #566274;
    --ds-color-border-strong: #7b8797;
    --ds-color-primary: #8ab4ff;
    --ds-color-primary-hover: #abcaff;
    --ds-color-primary-soft: #243e66;
    --ds-color-neutral: #aab4c2;
    --ds-color-neutral-hover: #d5dbe4;
    --ds-color-neutral-soft: #374151;
    --ds-focus-ring: 0 0 0 3px rgba(138, 180, 255, 0.32);
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: none;
    box-shadow: var(--ds-focus-ring);
}

/* Buttons - design-system base */

.btn,
.btn-save,
.btn-secondary,
input[type="submit"].btn,
input[type="button"].btn,
input[type="submit"].btn-save,
input[type="button"].btn-save {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--ds-space-2);
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: var(--ds-radius-md);
    font-family: var(--ds-font-family);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition:
        background-color var(--ds-transition-fast),
        border-color var(--ds-transition-fast),
        color var(--ds-transition-fast),
        box-shadow var(--ds-transition-fast),
        transform var(--ds-transition-fast);
}

.btn:hover,
.btn-save:hover,
.btn-secondary:hover,
input[type="submit"].btn:hover,
input[type="button"].btn:hover,
input[type="submit"].btn-save:hover,
input[type="button"].btn-save:hover {
    text-decoration: none;
    box-shadow: var(--ds-shadow-sm);
}

.btn:active,
.btn-save:active,
.btn-secondary:active {
    transform: translateY(1px);
}

.btn:disabled,
.btn.disabled,
.btn-save:disabled,
.btn-secondary:disabled,
input:disabled.btn {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
}

.btn-primary {
    background-color: var(--ds-color-primary);
    border-color: var(--ds-color-primary);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--ds-color-primary-hover);
    border-color: var(--ds-color-primary-hover);
    color: #ffffff;
}

.btn-warning {
    background-color: var(--ds-color-warning);
    border-color: var(--ds-color-warning);
    color: #ffffff;
}

.btn-warning:hover {
    background-color: #d68910;
    border-color: #d68910;
    color: #ffffff;
    text-decoration: none;
}

.btn-success,
.btn-save {
    background-color: var(--ds-color-success);
    border-color: var(--ds-color-success);
    color: #ffffff;
}

.btn-success:hover,
.btn-save:hover {
    background-color: var(--ds-color-success-hover);
    border-color: var(--ds-color-success-hover);
    color: #ffffff;
}

.btn-save i { margin-right: 10px; }

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

.btn-danger:hover {
    background-color: #c0392b;
    border-color: #c0392b;
    color: #ffffff;
    text-decoration: none;
}

.btn-secondary {
    background-color: var(--ds-color-neutral);
    border-color: var(--ds-color-neutral);
    color: #ffffff;
}

.btn-secondary:hover {
    background-color: var(--ds-color-neutral-hover);
    border-color: var(--ds-color-neutral-hover);
    color: #ffffff;
}

.btn-sm {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 12px;
}

/*
Design-system helpers kept intentionally:

* .btn-block: reusable full-width button helper
* .btn-icon: reusable icon button helper
* .btn-info: reusable informational button variant
  These may not appear in current PHP templates yet, but are part of the shared UI system.
*/

.btn-block {
    width: 100%;
    justify-content: center;
}

/* Buttons - later design-system additions */

.btn-teal {
    background-color: #16a085;
    border-color: #16a085;
    color: #ffffff;
}

.btn-teal:hover {
    background-color: #117a65;
    border-color: #117a65;
    color: #ffffff;
}

.btn-info {
    background-color: #5dade2;
    border-color: #5dade2;
    color: #ffffff;
}

.btn-info:hover {
    background-color: #3498db;
    border-color: #3498db;
    color: #ffffff;
}

.btn-purple {
    background-color: #8e44ad;
    border-color: #8e44ad;
    color: #ffffff;
}

.btn-purple:hover {
    background-color: #71368a;
    border-color: #71368a;
    color: #ffffff;
}

.btn-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ==========================================================================
19. Cards
========================================================================== */

.form-container,
.form-section,
.cv-card,
.parent-card,
.child-card {
    border-radius: var(--ds-radius-lg);
}

/* Responsive - reduced motion preference */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* Child / Gyerek - action button helpers */

.child-action-buttons {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-action-icon {
    width: 38px;
    height: 34px;
    min-width: 38px;
    padding: 0;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    line-height: 1;
}

.btn-action-icon i {
    margin: 0;
    line-height: 1;
    font-size: 0.9rem;
}

.inline-action-form {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

.child-action-buttons .child-action-button,
.child-action-buttons a.child-action-button,
.child-action-buttons button.child-action-button {
    width: 38px !important;
    height: 34px !important;
    min-width: 38px !important;
    max-width: 38px !important;

    padding: 0 !important;
    margin: 0 !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    box-sizing: border-box !important;
    line-height: 1 !important;
    vertical-align: middle !important;

    border: none;
    border-radius: 4px;
    appearance: none;
    -webkit-appearance: none;

    text-decoration: none !important;
}

.child-action-buttons .child-action-button i {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    font-size: 0.9rem;
}

/* ==========================================================================
20. Utilities
========================================================================== */

.u-mb-sm {
    margin-bottom: 10px;
}

.u-mb-md {
    margin-bottom: 20px;
}

.u-mb-lg {
    margin-bottom: 30px;
}

.u-text-center {
    text-align: center;
}

.u-text-right {
    text-align: right;
}

.u-flex {
    display: flex;
}

.u-flex-between {
    justify-content: space-between;
}

.u-flex-center {
    align-items: center;
}

.u-gap-sm {
    gap: 10px;
}

.u-gap-md {
    gap: 20px;
}

.u-wrap {
    flex-wrap: wrap;
}

/* Forms - page-specific grid helpers */

.contract-form-grid,
.period-form-grid,
.validity-date-grid {
    display: grid;
    gap: 12px;
}

.contract-form-grid,
.period-form-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    align-items: end;
}

.contract-form-grid .form-group,
.period-form-grid .form-group,
.validity-date-grid .form-group,
.attendance-datetime-row .form-group {
    min-width: 0;
}

.contract-form-grid input,
.contract-form-grid select,
.contract-form-grid textarea,
.period-form-grid input,
.period-form-grid select,
.period-form-grid textarea,
.validity-date-grid input[type="date"] {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.contract-form-grid input[type="file"] {
    overflow: hidden;
}

@media (max-width: 640px) {
    .contract-form-grid,
    .period-form-grid,
    .validity-date-grid {
        grid-template-columns: 1fr;
    }
}

.attendance-datetime-row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    align-items: end;
}

.attendance-datetime-row,
.swap-date-field {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.attendance-datetime-row .form-group {
    margin-bottom: 0;
}

.attendance-datetime-row input[type="date"],
.attendance-datetime-row input[type="time"],
.swap-date-field input[type="date"] {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

@media (max-width: 560px) {
    .attendance-datetime-row {
        grid-template-columns: 1fr;
    }
}

/* Schedule / Beosztás - sticky table additions */

.schedule-table-scroll {
    max-height: calc(100vh - 220px);
    overflow: auto;
    position: relative;
    border: 1px solid var(--ui-border, #dee2e6);
    border-radius: 6px;
}

.schedule-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.schedule-table thead th {
    position: sticky;
    top: 0;
    z-index: 30;
    background: #f8f9fa;
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.06);
}

.schedule-table thead th:first-child {
    z-index: 35;
}

/* ==========================================================================
21. Pricing / Díjcsomag / Díjszabás
========================================================================== */

.validity-date-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    align-items: start;
}

.validity-date-grid .form-group {
    margin-bottom: 0;
}

.validity-date-grid .form-help,
.validity-date-grid small {
    display: block;
    margin-top: 6px;
    min-height: 1.2em;
    line-height: 1.2;
}

/* Dashboard - five-column grid */

.dashboard-grid-five {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

.dashboard-grid-five a {
    min-width: 0;
}

.dashboard-grid-five .card {
    min-width: 0;
    font-size: 0.875rem;
}

.dashboard-grid-five .card h2,
.dashboard-grid-five .card h3 {
    font-size: 1.275rem;
}

.dashboard-grid-five .card p {
    font-size: 0.825rem;
}

.dashboard-grid-five .card .btn {
    font-size: 12px;
}

@media (max-width: 1200px) {
    .dashboard-grid-five {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 992px) {
    .dashboard-grid-five {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .dashboard-grid-five {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .dashboard-grid-five {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
22. Import / Quote / Logs
========================================================================== */

.import-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    align-items: stretch;
}

.import-form-grid .form-container {
    max-width: none;
    margin: 0;
}

.import-form-grid input[type="file"] {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Child / Gyerek - report components */

.report-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    background: var(--ds-color-surface);
    color: var(--ds-color-text);
    padding: 15px;
    border-radius: 8px;
    box-shadow: var(--ds-shadow-sm);
}

.report-container {
    max-width: 1000px;
}

.report-title {
    border: none;
    color: var(--ds-color-heading);
    font-size: 1.2rem;
    margin: 0;
}

.report-child-link {
    border-bottom: 1px dotted var(--ds-color-primary);
    color: var(--ds-color-heading);
    font-weight: bold;
    text-decoration: none;
    transition: color 0.2s;
}

.report-toolbar-section {
    flex: 1;
    min-width: 250px;
}

.report-month-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.report-month-input {
    border: 1px solid var(--ds-color-primary);
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 1.1rem;
    text-align: center;
    color: var(--ds-color-text);
    cursor: pointer;
    background: var(--ds-color-surface);
    font-family: inherit;
}

.report-stats-grid {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.report-stat-card {
    flex: 1;
    min-width: 150px;
    background: var(--ds-color-surface);
    color: var(--ds-color-text);
    padding: 15px;
    border-radius: 8px;
    box-shadow: var(--ds-shadow-sm);
    border-left: 5px solid #95a5a6;
    text-align: center;
}

.report-stat-success {
    border-left-color: #27ae60;
}

.report-stat-warning {
    border-left-color: #f1c40f;
}

.report-stat-danger {
    border-left-color: #e74c3c;
}

.report-stat-value {
    font-size: 1.6em;
    font-weight: bold;
    color: #2c3e50;
    line-height: 1;
}

.report-stat-success .report-stat-value {
    color: #27ae60;
}

.report-stat-warning .report-stat-value {
    color: #f39c12;
}

.report-stat-danger .report-stat-value {
    color: #c0392b;
}

.report-stat-value span {
    font-size: 0.6em;
}

.report-stat-label {
    color: #7f8c8d;
    font-size: 0.85em;
    text-transform: uppercase;
    margin-top: 5px;
    font-weight: 600;
}

.report-empty-state {
    text-align: center;
    padding: 40px;
}

.report-empty-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.report-table-card {
    background: var(--ds-color-surface);
    color: var(--ds-color-text);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--ds-shadow-sm);
}

.report-table thead tr {
    background-color: #2c3e50;
    color: white;
}

.report-empty-cell {
    text-align: center;
    padding: 20px;
}

.report-row-muted {
    background-color: #fff0f0;
    color: #999;
}

.report-muted {
    color: #777;
}

/* Child Profile / CV - profile grid helpers */

.cv-header-main {
    flex: 1;
    min-width: 200px;
}

.cv-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.cv-compact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px 15px;
}

.cv-full-span {
    grid-column: 1 / -1;
}

.cv-span-2 {
    grid-column: span 2;
}

.cv-alert-danger {
    background: #fff5f5;
    padding: 10px;
    border-radius: 4px;
    border-left: 4px solid #e74c3c;
    margin-bottom: 15px;
}

@media (max-width: 768px) {
    .cv-span-2 {
        grid-column: span 1;
    }
}

/* Utilities - extended layout helpers */

.u-full-width {
    width: 100%;
}

.u-mt-sm {
    margin-top: 10px;
}

.u-mt-md {
    margin-top: 20px;
}

.u-mb-0 {
    margin-bottom: 0;
}

.u-flex-justify-center {
    justify-content: center;
}

.form-span-2 {
    grid-column: span 2;
}

.form-full-span {
    grid-column: 1 / -1;
}

@media (max-width: 768px) {
    .form-span-2 {
        grid-column: span 1;
    }
}

.u-gap-xs {
    gap: 5px;
}

.u-align-middle {
    vertical-align: middle;
}

.section-title-compact {
    margin: 0;
    border: none;
    padding: 0;
}

.empty-state-cell {
    text-align: center;
    padding: 40px;
    color: #777;
}

/* Attendance / Jelenlét - row helpers */

.attendance-name-cell {
    display: flex;
    align-items: center;
    transition: all 0.3s;
    word-wrap: break-word;
}

.note-cell {
    padding-right: 10px;
}

/* Schedule / Beosztás - toolbar and filter helpers */

.date-nav-row,
.schedule-filter-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
    min-width: 0;
}

.date-nav-row {
    justify-content: center;
    gap: 8px;
}

.schedule-filter-row {
    gap: 12px;
}

.date-nav-row-end,
.schedule-filter-row-end {
    justify-content: flex-end;
}

.date-nav-row-center {
    justify-content: center;
}

.date-nav-row .btn {
    flex: 0 0 auto;
}

.date-nav-row .inline-action-form {
    min-width: 0;
    max-width: 100%;
}

.date-nav-current,
.date-nav-row input[type="date"],
.date-nav-row input[type="month"] {
    min-width: 0;
    max-width: 220px;
}

.schedule-filter-row label,
.schedule-filter-row .filter-label {
    flex: 0 0 auto;
    white-space: nowrap;
}

.schedule-filter-row select,
.schedule-filter-row input:not([type="hidden"]) {
    min-width: 180px;
    max-width: 100%;
}

@media (max-width: 640px) {
    .date-nav-row,
    .date-nav-row-end,
    .date-nav-row-center,
    .schedule-filter-row,
    .schedule-filter-row-end {
        justify-content: flex-start;
    }

    .date-nav-current,
    .date-nav-row .inline-action-form,
    .date-nav-row input[type="date"],
    .date-nav-row input[type="month"],
    .schedule-filter-row select,
    .schedule-filter-row input:not([type="hidden"]) {
        width: 100%;
        max-width: 100%;
    }
}

.container-full {
    max-width: 100%;
}

.schedule-toolbar-card {
    background: var(--ds-color-surface);
    color: var(--ds-color-text);
    padding: 15px;
    border-radius: 8px;
    box-shadow: var(--ds-shadow-sm);
}

html[data-mode="dark"] .schedule-toolbar-card .page-title-muted {
    color: var(--ds-color-heading);
}

html[data-mode="dark"] .schedule-toolbar-card .report-month-input {
    background: var(--ds-color-surface);
    color: var(--ds-color-text);
    border-color: var(--ds-color-border-strong);
    color-scheme: dark;
}

.schedule-toolbar-section {
    flex: 1;
    min-width: 250px;
}

.date-nav-row.schedule-toolbar-section,
.schedule-filter-row.schedule-toolbar-section {
    min-width: 0;
}

.schedule-legend {
    justify-content: center;
    font-size: 0.9em;
    background: var(--ds-color-surface);
    color: var(--ds-color-text);
    padding: 10px;
    border-radius: 8px;
    box-shadow: var(--ds-shadow-sm);
}

.schedule-legend-swatch {
    width: 15px;
    height: 15px;
    border-radius: 3px;
}

.schedule-filter-row .filter-label {
    font-weight: bold;
    color: var(--ds-color-heading);
    margin: 0;
}

.schedule-table-card {
    background: var(--ds-color-surface);
    color: var(--ds-color-text);
    box-shadow: var(--ds-shadow-sm);
    border-radius: 8px;
}

.schedule-table-wide {
    min-width: 1400px;
    margin: 0;
}

.schedule-empty-cell {
    padding: 20px;
}

/* Modals - size variants */

.modal-content-wide {
    max-width: 500px;
}

.modal-content-medium {
    max-width: 450px;
}

/* Caregiver / Gondozó - management and settlement helpers */

.container-wide {
    max-width: 1100px;
}

.caregiver-toolbar {
    gap: 15px;
}

.caregiver-list-name {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-align: left;
}

.caregiver-list-avatar {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid var(--ds-color-border);
    flex: 0 0 auto;
}

.inline-warning-text {
    font-size: 0.8em;
    color: #e74c3c;
    font-weight: normal;
}

.container-extra-wide {
    max-width: 1300px;
}

.page-title-compact {
    margin: 0;
    font-size: 1.5rem;
    border: none;
}

.settlement-subtext {
    font-size: 0.85em;
    font-weight: normal;
    color: var(--ds-color-text-muted);
}

.settlement-absence-cell {
    font-size: 0.9em;
    text-align: left;
}

html[data-mode="dark"] td.settlement-total-col {
    background-color: var(--ds-color-primary-soft) !important;
    color: var(--ds-color-heading) !important;
}

html[data-mode="dark"] .caregiver-modal-name,
html[data-mode="dark"] .caregiver-current-shift {
    color: var(--ds-color-heading) !important;
}

html[data-mode="dark"] .caregiver-info-panel {
    background-color: var(--ds-color-surface-muted) !important;
    color: var(--ds-color-text) !important;
    border-color: var(--ds-color-primary) !important;
}

html[data-mode="dark"] .caregiver-info-panel h3,
html[data-mode="dark"] .caregiver-info-panel p {
    color: var(--ds-color-heading) !important;
}

html[data-mode="dark"] .caregiver-history-active-row {
    background-color: var(--ds-color-primary-soft) !important;
    color: var(--ds-color-heading) !important;
}

.page-title-muted {
    color: #555555;
}

.caregiver-schedule-table-wide {
    min-width: 1060px;
    margin: 0;
    table-layout: fixed;
}

.caregiver-schedule-table-wide th,
.caregiver-schedule-table-wide td {
    padding: 4px 5px;
    font-size: 0.82rem;
    line-height: 1.15;
}

.caregiver-schedule-table-wide .schedule-cell {
    height: 30px;
    padding: 3px 4px;
}

.caregiver-schedule-modal-info {
    margin-top: 8px;
    color: #34495e;
    font-size: 0.9rem;
    line-height: 1.35;
}

.caregiver-schedule-debug-block {
    margin-top: 10px;
    max-height: 260px;
    overflow: auto;
    padding: 10px;
    background: #f4f7fb;
    border: 1px solid #d8e1ec;
    border-radius: 6px;
    color: #2c3e50;
    font-size: 0.78rem;
    line-height: 1.45;
    text-align: left;
    white-space: pre-wrap;
}

/* Dashboard - icons and section headings */

.dashboard-intro-text {
    color: #7f8c8d;
    font-size: 1.1em;
}

.dashboard-section-title {
    margin-top: 50px;
    border-bottom: 2px solid #34495e;
    padding-bottom: 10px;
    color: #34495e;
}

.card .dashboard-icon-main {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.card .dashboard-icon-system {
    font-size: 2rem;
    margin-bottom: 10px;
}

.card .dashboard-icon-blue { color: #3498db; }
.card .dashboard-icon-yellow { color: #f39c12; }
.card .dashboard-icon-green { color: #27ae60; }
.card .dashboard-icon-teal { color: #16a085; }
.card .dashboard-icon-orange { color: #e67e22; }
.card .dashboard-icon-purple { color: #9b59b6; }
.card .dashboard-icon-purple-dark { color: #8e44ad; }
.card .dashboard-icon-red { color: #e74c3c; }
.card .dashboard-icon-blue-dark { color: #2980b9; }
.card .dashboard-icon-slate { color: #34495e; }
.card .dashboard-icon-gray { color: #7f8c8d; }

/* Child Profile / CV - detail variants */

.child-profile-container {
    max-width: 1000px;
}

.cv-profile-title {
    margin: 0;
    font-size: 1.8em;
    color: var(--ds-color-heading);
    border: none;
    padding-bottom: 0;
}

html[data-mode="dark"] .cv-profile-meta,
html[data-mode="dark"] .cv-profile-meta-label {
    color: var(--ds-color-heading) !important;
}

.cv-section-title-warning {
    border-bottom-color: #f39c12;
}

.cv-section-title-purple {
    border-bottom-color: #9b59b6;
}

.cv-section-title-danger {
    border-bottom-color: #e74c3c;
}

.cv-icon-blue { color: #3498db; }
.cv-icon-warning { color: #f39c12; }
.cv-icon-purple { color: #9b59b6; }
.cv-icon-danger { color: #e74c3c; }
.cv-icon-success { color: #27ae60; }

.parent-card-primary {
    border-top-color: #3498db;
}

.parent-card-purple {
    border-top-color: #9b59b6;
}

.parent-card-title {
    margin: 0 0 10px 0;
    font-size: 0.9em;
    text-transform: uppercase;
}

.parent-card-title-primary {
    color: #2980b9;
}

.parent-card-title-purple {
    color: #8e44ad;
}

.cv-label-danger {
    color: #c0392b;
}

.cv-allergy-list {
    margin-top: 4px;
}

.cv-value-success {
    color: #27ae60;
}

.page-icon-purple {
    color: #9b59b6;
}

/* ==========================================================================
23. System / Admin / User Management
========================================================================== */

/* System / Admin - appearance theme picker */
.appearance-theme-form {
    margin: 0;
}

.appearance-theme-options {
    display: grid;
    gap: var(--ds-space-3);
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.appearance-theme-card {
    align-items: center;
    background: var(--ds-color-surface);
    border: 1px solid var(--ds-color-border);
    border-radius: var(--ds-radius-lg);
    color: var(--ds-color-text);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: var(--ds-space-2);
    min-height: 118px;
    padding: var(--ds-space-4);
    text-align: center;
    transition: background-color var(--ds-transition-fast), border-color var(--ds-transition-fast), box-shadow var(--ds-transition-fast), transform var(--ds-transition-fast);
}

.appearance-theme-card:hover,
.appearance-theme-card:focus-visible {
    background: var(--ds-color-surface-muted);
    border-color: var(--ds-color-primary);
    box-shadow: var(--ds-focus-ring);
}

.appearance-theme-card:active {
    transform: translateY(1px);
}

.appearance-theme-card-active {
    background: var(--ds-color-primary-soft);
    border-color: var(--ds-color-primary);
    box-shadow: inset 0 0 0 1px var(--ds-color-primary);
}

.appearance-theme-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.appearance-theme-label {
    color: var(--ds-color-heading);
    font-weight: 700;
}

.appearance-theme-status {
    color: var(--ds-color-primary);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* System / Admin - leave request page */
.leave-selector-card {
    border-left-color: var(--ds-color-primary);
}

.leave-selector-form {
    align-items: flex-end;
    display: flex;
    flex-wrap: wrap;
    gap: var(--ds-space-3);
}

.leave-selector-field {
    flex: 1 1 280px;
    margin-bottom: 0;
}

.leave-balance-grid {
    display: grid;
    gap: var(--ds-space-3);
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.leave-balance-card {
    background: var(--ds-color-surface-muted);
    border: 1px solid var(--ds-color-border);
    border-radius: var(--ds-radius-md);
    color: var(--ds-color-text);
    padding: var(--ds-space-4);
}

.leave-balance-card strong {
    color: var(--ds-color-heading);
    display: block;
    font-size: 1.8rem;
    line-height: 1.1;
}

.leave-balance-label {
    color: var(--ds-color-text-muted);
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.leave-date-picker {
    background: var(--ds-color-surface);
    border: 1px solid var(--ds-color-border);
    border-radius: var(--ds-radius-lg);
    color: var(--ds-color-text);
    padding: var(--ds-space-4);
}

.leave-calendar-toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--ds-space-3);
    justify-content: space-between;
    margin-bottom: var(--ds-space-4);
}

.leave-calendar-month-control {
    align-items: center;
    display: flex;
    flex: 1 1 220px;
    gap: var(--ds-space-3);
    justify-content: center;
    min-width: 0;
}

.leave-calendar-month-control input {
    max-width: 180px;
}

.leave-calendar-weekdays,
.leave-calendar-grid {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.leave-calendar-weekdays {
    color: var(--ds-color-text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 6px;
    text-align: center;
}

.leave-calendar-day,
.leave-calendar-empty {
    min-height: 42px;
}

.leave-calendar-day {
    align-items: center;
    background: var(--ds-color-surface);
    border: 1px solid var(--ds-color-border);
    border-radius: var(--ds-radius-md);
    color: var(--ds-color-text);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    justify-content: center;
    transition: background-color var(--ds-transition-fast), border-color var(--ds-transition-fast), color var(--ds-transition-fast), transform var(--ds-transition-fast);
}

.leave-calendar-day:not(:disabled):hover,
.leave-calendar-day:not(:disabled):focus-visible {
    background: var(--ds-color-primary-soft);
    border-color: var(--ds-color-primary);
    color: var(--ds-color-heading);
}

.leave-calendar-day:not(:disabled):active {
    transform: translateY(1px);
}

.leave-calendar-selected {
    background: var(--ds-color-primary);
    border-color: var(--ds-color-primary);
    color: #ffffff;
    font-weight: 700;
}

.leave-calendar-forced-workday {
    border-color: var(--ds-color-primary);
}

.leave-calendar-weekend,
.leave-calendar-nonworkday {
    background: var(--ds-color-surface-muted);
    color: var(--ds-color-text-muted);
}

.leave-calendar-disabled {
    cursor: not-allowed;
    opacity: 0.52;
}

.leave-selected-summary {
    color: var(--ds-color-text-muted);
    font-weight: 600;
    margin: var(--ds-space-3) 0 0;
}

.leave-admin-list {
    display: grid;
    gap: var(--ds-space-4);
}

.leave-admin-card {
    display: grid;
    gap: var(--ds-space-4);
}

.leave-admin-card-header {
    align-items: flex-start;
    border-bottom: 1px solid var(--ds-color-border);
    display: flex;
    gap: var(--ds-space-3);
    justify-content: space-between;
    padding-bottom: var(--ds-space-3);
}

.leave-admin-card-header h2 {
    margin: 0;
}

.leave-admin-grid {
    display: grid;
    gap: var(--ds-space-3);
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.leave-admin-grid strong,
.leave-admin-grid span {
    display: block;
}

.leave-admin-grid strong {
    color: var(--ds-color-text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
}

.leave-admin-grid span {
    color: var(--ds-color-text);
}

.leave-admin-grid-wide {
    grid-column: 1 / -1;
}

.leave-admin-balance-grid {
    border-top: 1px solid var(--ds-color-border);
    padding-top: var(--ds-space-3);
}

.leave-admin-decision-form {
    border-top: 1px solid var(--ds-color-border);
    padding-top: var(--ds-space-3);
}

@media (max-width: 640px) {
    .leave-calendar-toolbar,
    .leave-calendar-month-control {
        justify-content: flex-start;
    }

    .leave-calendar-month-control input {
        max-width: 100%;
        width: 100%;
    }

    .leave-calendar-day,
    .leave-calendar-empty {
        min-height: 36px;
    }
}

.daycare-column {
    flex: 1;
    min-width: 350px;
}

.form-section-slate {
    border-left-color: #34495e;
}

.form-section-purple {
    border-left-color: #9b59b6;
}

.form-subsection-title {
    border-top: 1px solid #eeeeee;
    padding-top: 15px;
}

.password-field-wrapper {
    position: relative;
    width: 100%;
}

.password-field-wrapper-spaced {
    margin-bottom: 15px;
}

.password-field-wrapper-spaced-lg {
    margin-bottom: 20px;
}

.password-field-wrapper input[type="password"],
.password-field-wrapper input[type="text"] {
    box-sizing: border-box;
    padding-right: 44px;
    width: 100%;
}

.password-field-wrapper .password-toggle {
    align-items: center;
    background: transparent;
    border: 0;
    color: #7f8c8d;
    cursor: pointer;
    display: inline-flex;
    height: 32px;
    justify-content: center;
    padding: 0;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
}

.password-field-wrapper .password-toggle i {
    pointer-events: none;
}

/* System / Admin - dark mode inline surface compatibility */
html[data-mode="dark"] .day-management-panel,
html[data-mode="dark"] .user-list-panel,
html[data-mode="dark"] .user-log-panel,
html[data-mode="dark"] .user-maintenance-panel,
html[data-mode="dark"] .user-security-panel,
html[data-mode="dark"] .user-security-code,
html[data-mode="dark"] .user-password-help {
    background: var(--ds-color-surface-muted) !important;
    color: var(--ds-color-text) !important;
    border-color: var(--ds-color-border) !important;
    box-shadow: var(--ds-shadow-sm);
}

html[data-mode="dark"] .day-management-summary-panel,
html[data-mode="dark"] .user-list-header,
html[data-mode="dark"] .user-log-header {
    background: var(--ds-color-surface-muted) !important;
    color: var(--ds-color-heading) !important;
    border-color: var(--ds-color-border) !important;
}

html[data-mode="dark"] .day-management-panel h3,
html[data-mode="dark"] .day-management-panel p,
html[data-mode="dark"] .day-management-summary-panel li,
html[data-mode="dark"] .user-maintenance-panel h3,
html[data-mode="dark"] .user-maintenance-panel p,
html[data-mode="dark"] .user-security-panel h3,
html[data-mode="dark"] .user-security-panel p {
    color: var(--ds-color-heading) !important;
}

html[data-mode="dark"] .day-management-summary-panel li {
    background-color: var(--ds-color-surface) !important;
}

/* Child / Gyerek - archive page helpers */

.archive-header {
    border-bottom: 1px solid #eeeeee;
    padding-bottom: 10px;
}

.archived-photo-placeholder {
    background: #eeeeee;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cccccc;
}

.archived-table-photo {
    width: 45px;
    height: 45px;
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid #dddddd;
}

/* Utilities - text and margin helpers */

.u-text-left {
    text-align: left;
}

.u-mt-0 {
    margin-top: 0;
}

/* Import / Quote / Logs - import and quote helpers */

.import-heading-purple {
    color: #8e44ad;
}

.import-heading-teal {
    color: #16a085;
}

.import-manual-link {
    color: #16a085;
    font-size: 0.9em;
    font-weight: bold;
    text-decoration: underline;
}

.import-help-list {
    color: #34495e;
    font-size: 0.9em;
    line-height: 1.8;
}

.import-reset-fields {
    max-width: 400px;
}

.import-totp-input {
    font-size: 1.2em;
    letter-spacing: 2px;
    text-align: center;
}

.page-icon-warning {
    color: #f39c12;
}

.quote-table-text-col {
    width: 60%;
}

.quote-table-author-col {
    width: 25%;
}

.quote-table-actions-col {
    width: 15%;
}

.quote-text-cell {
    word-wrap: break-word;
}

.quote-author-cell {
    color: #7f8c8d;
    font-weight: bold;
}

.quote-textarea {
    min-height: 100px;
}

/* Import / Quote / Logs - log table helpers */

.page-icon-slate {
    color: #34495e;
}

.log-time-cell {
    font-size: 0.9em;
    white-space: nowrap;
}

.log-details-cell {
    color: #555555;
    font-size: 0.95em;
}

.log-details-text {
    color: #777777;
}

.log-ip-cell {
    color: #7f8c8d;
    font-family: monospace;
    font-size: 0.85em;
}

/* Child / Gyerek - list page helpers */

.child-list-header {
    border-bottom: 1px solid #eeeeee;
    padding-bottom: 10px;
}

.child-photo-placeholder {
    align-items: center;
    background: #eeeeee;
    color: #cccccc;
    display: flex;
    justify-content: center;
}

.child-table-photo {
    border: 1px solid #dddddd;
    border-radius: 50%;
    height: 45px;
    object-fit: cover;
    width: 45px;
}

/* Utilities - spacing additions */

.u-mt-lg {
    margin-top: 30px;
}

/* Pricing / Díjcsomag / Díjszabás - edit page helpers */

.pricing-edit-form {
    background: var(--ds-color-surface);
    border-radius: 8px;
    box-shadow: var(--ds-shadow-sm);
    color: var(--ds-color-text);
    margin: 0 auto;
    max-width: 800px;
    padding: 25px;
}

.pricing-edit-form .form-group label {
    color: var(--ds-color-heading);
}

.validity-date-panel {
    background: var(--ds-color-surface-muted);
    border: 1px solid var(--ds-color-border);
    border-radius: 4px;
    color: var(--ds-color-text);
    padding: 15px;
}

.pricing-total-label {
    color: var(--ds-color-success);
}

.pricing-total-input {
    font-weight: bold;
}

/* Caregiver / Gondozó - caregiver form helpers */

.caregiver-add-container {
    max-width: 1100px;
}

.caregiver-add-container .form-container {
    max-width: 100%;
}

#addGondozoForm .form-section {
    margin-bottom: 14px;
    padding: 16px;
}

#addGondozoForm .form-section h3 {
    margin-bottom: 12px;
    padding-bottom: 8px;
}

#addGondozoForm .form-group {
    margin-bottom: 10px;
}

#addGondozoForm .form-grid {
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.caregiver-profile-grid {
    align-items: start;
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(220px, 300px) 1fr;
}

.caregiver-photo-panel {
    margin-bottom: 0;
}

.caregiver-current-photo {
    margin-bottom: 12px;
}

.caregiver-current-photo img {
    aspect-ratio: 1 / 1;
    border: 2px solid var(--ds-color-border);
    border-radius: 8px;
    display: block;
    max-width: 160px;
    object-fit: cover;
    width: 100%;
}

.caregiver-profile-fields {
    align-content: start;
}

.caregiver-contact-grid {
    grid-template-columns: minmax(260px, 2fr) minmax(170px, 1fr) minmax(200px, 1fr);
}

.caregiver-compact-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.caregiver-save-button {
    font-size: 1.1em;
}

@media (max-width: 768px) {
    .caregiver-profile-grid,
    .caregiver-contact-grid {
        grid-template-columns: 1fr;
    }
}
