/* === RESET & BASE === */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #374151;
    background-color: #f9fafb;
    font-size: 14px;
}

/* === LAYOUT === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    background-color: #ffffff;
    min-height: 100vh;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.main-content {
    padding-top: 160px; /* Space for fixed nav + progress bar */
}

.main-content.no-progress {
    padding-top: 100px; /* Space for just the nav when no progress bar */
}

/* === NAVIGATION === */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
}

.nav-date {
    font-size: 1rem;
    color: #111827;
    font-weight: 600;
    display: block;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: #6b7280;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: #374151;
}

.nav-link.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

/* === HAMBURGER MENU === */
.nav-hamburger {
    display: none;
    flex-direction: column;
    gap: 3px;
    cursor: pointer;
    padding: 0.75rem;
    position: relative;
    width: 44px;
    height: 44px;
    justify-content: center;
    align-items: center;
}

.nav-hamburger span {
    width: 20px;
    height: 2px;
    background-color: #374151;
    transition: all 0.3s ease;
    transform-origin: center;
    position: absolute;
}

/* === USER MENU === */
.nav-user {
    position: relative;
}

.user-menu {
    position: relative;
}

.user-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: #374151;
    transition: all 0.2s ease;
}

.user-toggle:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
}

.user-name {
    font-weight: 500;
}

.user-icon {
    transition: transform 0.2s ease;
}

.user-toggle[aria-expanded="true"] .user-icon {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 280px;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    margin-top: 0.25rem;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-section {
    padding: 1rem;
}

.dropdown-section h4 {
    font-size: 0.75rem;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.dropdown-divider {
    height: 1px;
    background-color: #e5e7eb;
    margin: 0.5rem 0;
}

.dropdown-link {
    display: block;
    padding: 0.75rem 1rem;
    color: #374151;
    text-decoration: none;
    font-size: 0.875rem;
    transition: background-color 0.2s ease;
}

.dropdown-link:hover {
    background-color: #f3f4f6;
}

.test-date-current {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background-color: #fffbeb;
    border-radius: 0.25rem;
}

.test-date-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-text {
    background: none;
    border: none;
    color: #3b82f6;
    font-size: 0.75rem;
    cursor: pointer;
    text-decoration: underline;
}

.btn-text:hover {
    color: #2563eb;
}

.form-input-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.25rem;
    flex: 1;
}

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

.reset-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.logout-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #dc2626 !important;
    font-weight: 500;
}

.logout-link:hover {
    background-color: #fef2f2;
}

/* === PROGRESS BAR === */
.progress-bar {
    background-color: #f9fafb;
    border-top: 1px solid #e5e7eb;
    padding: 1rem 0;
}

.progress-steps {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.progress-step-number {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    background-color: #e5e7eb;
    color: #6b7280;
    transition: all 0.3s ease;
}

.progress-step.active .progress-step-number {
    background-color: #3b82f6;
    color: #ffffff;
}

.progress-step.completed .progress-step-number {
    background-color: #10b981;
    color: #ffffff;
}

.progress-step-title {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.5rem;
    text-align: center;
}

.progress-step.active .progress-step-title {
    color: #3b82f6;
    font-weight: 500;
}

.progress-step.completed .progress-step-title {
    color: #10b981;
    font-weight: 500;
}

.progress-connector {
    flex: 1;
    height: 2px;
    background-color: #e5e7eb;
    margin: 0 1rem;
    min-width: 3rem;
}

.progress-step.completed + .progress-connector {
    background-color: #10b981;
}

/* === STEP CONTAINER === */
.step-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.step-header {
    text-align: center;
    margin-bottom: 3rem;
}

.step-header h1 {
    font-size: 2rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
}

.step-description {
    color: #6b7280;
    font-size: 1rem;
}

.step-content {
    margin-bottom: 3rem;
}

.step-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.btn-large {
    padding: 0.75rem 2rem;
    font-size: 1rem;
}

.btn-icon {
    margin-left: 0.5rem;
}

.btn-outline .btn-icon {
    margin-left: 0;
    margin-right: 0.5rem;
}

/* === STEP-SPECIFIC STYLES === */

/* Selection Form */
.selection-form {
    background-color: #f9fafb;
    padding: 2rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.form-input-large {
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: 500;
}

.form-help {
    color: #6b7280;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.checkbox-large {
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background-color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.checkbox-large:hover {
    border-color: #d1d5db;
    background-color: #f9fafb;
}

.checkbox-large input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.75rem;
}

.checkbox-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.checkbox-text strong {
    color: #111827;
    font-size: 0.875rem;
}

.checkbox-text small {
    color: #6b7280;
    font-size: 0.75rem;
}

/* Selection Preview */
.selection-preview {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 0.5rem;
}

.selection-preview h3 {
    color: #166534;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.copy-ids-actions {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
}

.selected-children-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
}

.selected-child-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background-color: #dcfce7;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.selected-child-item.priority {
    background-color: #fed7aa;
    border: 1px solid #fb923c;
}

.priority-badge {
    font-size: 0.65rem;
    background-color: #ea580c;
    color: #ffffff;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Adjustment Summary */
.selection-summary {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: #f9fafb;
    border-radius: 0.5rem;
}

.summary-item {
    text-align: center;
}

.summary-label {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.summary-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin-top: 0.25rem;
}

/* Finalization Styles */
.finalization-summary {
    margin-bottom: 2rem;
}

.summary-card {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
}

.summary-card h3 {
    font-size: 1.25rem;
    color: #111827;
    margin-bottom: 1.5rem;
}

.summary-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #3b82f6;
}

.stat-label {
    display: block;
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.final-children-lists {
    display: grid;
    gap: 2rem;
    margin-bottom: 2rem;
}

.children-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1rem;
}

.final-children-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.75rem;
}

.final-child-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background-color: #ffffff;
}

.final-child-item.selected {
    background-color: #f0fdf4;
    border-color: #22c55e;
}

.final-child-item.priority {
    background-color: #fff7ed;
    border-color: #fb923c;
}

.final-child-item.absent {
    background-color: #fef2f2;
    border-color: #fecaca;
    opacity: 0.7;
}

.final-child-item.not-selected {
    background-color: #fffbeb;
    border-color: #fed7aa;
    opacity: 0.8;
}

.skip-indicators {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.finalize-actions {
    background-color: #f9fafb;
    padding: 2rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

.copy-ids-actions .btn {
    min-width: 200px;
}

.confirm-section {
    margin-bottom: 1.5rem;
    text-align: center;
}

.finalize-form .checkbox-label {
    justify-content: center;
    font-size: 0.875rem;
    gap: 0.75rem;
}

.finalize-form .checkbox-label input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
}

#finalize-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#finalize-btn:disabled:hover {
    background-color: #10b981;
    transform: none;
}

/* === LOGIN PAGE === */
.login-container {
    max-width: 400px;
    margin: 10rem auto;
    padding: 2rem;
    background-color: #ffffff;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.login-container h1 {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 2rem;
}

.login-container form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-container label {
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
}

.login-container input {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
}

.login-container input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.login-container button {
    padding: 0.75rem;
    background-color: #3b82f6;
    color: #ffffff;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-top: 1rem;
}

.login-container button:hover {
    background-color: #2563eb;
}

.setup-info {
    padding: 1rem;
    background-color: #fffbeb;
    border: 1px solid #fed7aa;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: #92400e;
    margin-bottom: 1.5rem;
}

.flashes {
    list-style: none;
    padding: 0;
    margin-bottom: 1.5rem;
}

.flashes li {
    padding: 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.flashes .success {
    background-color: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

.flashes .danger {
    background-color: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
}

.flashes .info {
    background-color: #cff4fc;
    color: #055160;
    border: 1px solid #b6effb;
}

/* === ARCHIVE PAGE === */
.archive-layout {
    display: flex;
    height: calc(100vh - 160px);
    gap: 0;
    background-color: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.archive-sidebar {
    width: 300px;
    background-color: #f9fafb;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background-color: #ffffff;
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
}

.sidebar-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

.archive-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.archive-item {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.archive-item:hover {
    background-color: #ffffff;
    border-color: #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.archive-item.active {
    background-color: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 1px 3px rgba(59, 130, 246, 0.2);
}

.archive-date {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.archive-summary {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.summary-stat {
    font-size: 0.75rem;
    opacity: 0.8;
}

.archive-item.active .summary-stat {
    opacity: 0.9;
}

.sidebar-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #6b7280;
    font-size: 0.875rem;
}

.archive-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.archive-viewer {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.no-selection-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 50vh;
    text-align: center;
    color: #6b7280;
}

.no-selection-message h3 {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #374151;
}

.archive-entry-detail {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.entry-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.entry-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1rem;
}

.entry-stats {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.rotation-info {
    font-size: 0.75rem;
    color: #6b7280;
}

.rotation-detail {
    font-family: monospace;
    background-color: #f3f4f6;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

/* Legacy styles for compatibility */
.archive-entry {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: #ffffff;
}

.archive-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.archive-meta h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
}

.archive-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.stat-item {
    padding: 0.25rem 0.75rem;
    background-color: #f3f4f6;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #374151;
}

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

.category-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.child-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.archive-entry .child-item {
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.skip-reasons {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.skip-marker {
    font-size: 0.875rem;
    opacity: 0.8;
    cursor: help;
}

.nest-skip {
    filter: sepia(1) saturate(2) hue-rotate(25deg);
}

.sibling-skip {
    filter: sepia(1) saturate(2) hue-rotate(200deg);
}

.child-item.present {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.child-item.absent {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.child-item.not-selected {
    background-color: #fffbeb;
    border: 1px solid #fed7aa;
    color: #92400e;
}

.child-item.priority {
    border-left: 4px solid #f59e0b;
    background-color: #fff7ed;
}

.child-item.nest-excluded {
    border-left: 4px solid #6b7280;
}

.priority-indicator,
.nest-indicator {
    font-size: 0.65rem;
    background-color: #374151;
    color: #ffffff;
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    font-weight: 600;
}

.priority-indicator {
    background-color: #f59e0b;
}

.nest-indicator {
    background-color: #6b7280;
}

.empty-message {
    color: #6b7280;
    font-style: italic;
    font-size: 0.875rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

/* === PUBLIC VIEW === */
.public-container {
    max-width: 500px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: #ffffff;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.public-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #10b981;
    margin-bottom: 0.5rem;
}

.public-date {
    font-size: 1rem;
    color: #6b7280;
    margin-bottom: 2rem;
}

.public-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.child-count {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: #f0fdf4;
    color: #166534;
    border-radius: 0.375rem;
    font-weight: 500;
    border: 1px solid #bbf7d0;
}

.whatsapp-copy-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background-color: #25d366;
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.whatsapp-copy-btn:hover {
    background-color: #22c55e;
    transform: translateY(-1px);
}

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

.whatsapp-icon {
    flex-shrink: 0;
}

.public-children-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.public-child-item {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
}

.public-child-item .child-id {
    font-weight: 600;
    font-size: 1.125rem;
    color: #111827;
    font-family: monospace;
}

/* Small ID displays for debugging */
.child-id-small {
    font-size: 0.75rem;
    color: #6b7280;
    font-family: monospace;
    font-weight: normal;
    margin-left: 0.5rem;
}

.child-id {
    font-size: 0.875rem;
    color: #6b7280;
    font-family: monospace;
    font-weight: 500;
}

.child-id-prefix {
    font-size: 0.75rem;
    color: #6b7280;
    font-family: monospace;
    font-weight: 600;
    margin-right: 0.5rem;
}

.child-info-left {
    display: flex;
    align-items: center;
    flex: 1;
}

.public-empty-state {
    padding: 3rem 1rem;
}

.public-empty-state p {
    font-size: 1.125rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.public-empty-state small {
    color: #9ca3af;
}

/* === TYPOGRAPHY === */
.page-header {
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: #6b7280;
    font-size: 1rem;
}

/* === WORKFLOW SECTIONS === */
.workflow-section {
    margin-bottom: 3rem;
}

.section-header {
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
}

.section-description {
    color: #6b7280;
    font-size: 0.875rem;
}

/* === CHILDREN LIST === */
.children-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.child-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background-color: #ffffff;
    transition: all 0.2s ease;
}

.child-item:hover {
    border-color: #d1d5db;
    background-color: #f9fafb;
}

.child-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.child-name {
    font-weight: 500;
    color: #111827;
    font-size: 0.875rem;
}

.child-meta {
    font-size: 0.75rem;
    color: #6b7280;
}

.child-status {
    flex-shrink: 0;
}

/* === CHILD STATES === */
.child-absent {
    opacity: 0.6;
    background-color: #fef2f2;
    border-color: #fecaca;
}

.child-absent:hover {
    background-color: #fef2f2;
    border-color: #f87171;
}

.child-excluded {
    opacity: 0.5;
    background-color: #f3f4f6;
    border-color: #d1d5db;
}

.child-selected {
    background-color: #f0fdf4;
    border-color: #22c55e;
}

.child-selected:hover {
    background-color: #ecfdf5;
    border-color: #16a34a;
}

.child-priority {
    background-color: #fff7ed;
    border-color: #fb923c;
}

.child-priority:hover {
    background-color: #fef3c7;
    border-color: #f59e0b;
}

.child-available {
    cursor: default;
}

/* Only selected children are clickable in selection grid */
#selection-grid .child-selected {
    cursor: pointer;
}

#absence-grid .child-item {
    cursor: pointer;
}

.child-freed {
    border: 2px dashed #f59e0b;
    background-color: #fffbeb;
}

/* === STATUS BADGES === */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.status-available {
    background-color: #f3f4f6;
    color: #6b7280;
}

.status-absent {
    background-color: #fee2e2;
    color: #dc2626;
}

.status-excluded {
    background-color: #f3f4f6;
    color: #6b7280;
}

.status-selected {
    background-color: #dcfce7;
    color: #16a34a;
}

.status-priority {
    background-color: #fed7aa;
    color: #ea580c;
}

.status-freed {
    background-color: #fef3c7;
    color: #b45309;
}

.rotation-note {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: #4b5563;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rotation-note-warning {
    color: #b91c1c;
    font-weight: 600;
}

/* === FORMS === */
.form-row {
    display: flex;
    align-items: end;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
}

.form-input {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background-color: #ffffff;
    transition: border-color 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
}

/* === WARNING BANNER === */
.warning-banner {
    background-color: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.warning-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.warning-icon {
    color: #d97706;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.warning-text {
    color: #92400e;
    font-size: 0.875rem;
    line-height: 1.5;
}

.warning-text strong {
    font-weight: 600;
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-small {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
}

.btn-primary {
    background-color: #3b82f6;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #2563eb;
}

.btn-secondary {
    background-color: #6b7280;
    color: #ffffff;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

.btn-success {
    background-color: #10b981;
    color: #ffffff;
}

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

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

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

.btn-warning {
    background-color: #f59e0b;
    color: #ffffff;
}

.btn-warning:hover {
    background-color: #d97706;
}

.btn-outline {
    background-color: #ffffff;
    color: #374151;
    border-color: #d1d5db;
}

.btn-outline:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

/* === SECTION ACTIONS === */
.section-actions {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

/* === PLACEHOLDER === */
.placeholder-message {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

.placeholder-message p {
    font-size: 1rem;
}

/* === FOOTER === */
.page-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.footer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.action-group {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* === ADMIN TOOLS === */
.admin-tools {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
}

.admin-tools-toggle {
    padding: 0.75rem 1rem;
    background-color: #f9fafb;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
}

.admin-tools-toggle:hover {
    background-color: #f3f4f6;
}

.admin-tools-content {
    padding: 1rem;
    background-color: #ffffff;
}

.test-date-info {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background-color: #fffbeb;
    border-radius: 0.375rem;
    border: 1px solid #fed7aa;
}

.test-date-info p {
    font-size: 0.875rem;
    color: #92400e;
    margin-bottom: 0.5rem;
}

.test-date-form {
    display: flex;
    gap: 1rem;
    align-items: end;
}

/* === TOAST NOTIFICATIONS === */
#toast-container {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 20rem;
}

.toast {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #ffffff;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease-out, fadeOut 0.3s 4.7s ease-out forwards;
}

.toast.info {
    background-color: #3b82f6;
}

.toast.success {
    background-color: #10b981;
}

.toast.warning {
    background-color: #f59e0b;
    color: #92400e;
}

.toast.error {
    background-color: #ef4444;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .form-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .footer-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .action-group {
        justify-content: center;
    }
    
    .test-date-form {
        flex-direction: column;
        align-items: stretch;
    }
}

/* === MODAL STYLES (for child management) === */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #ffffff;
    margin: auto;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 500px;
    position: relative;
}

.close-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: #6b7280;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.25rem;
}

.close-button:hover {
    color: #374151;
}

/* === MANAGEMENT PAGE === */
.management-section {
    margin-bottom: 3rem;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background-color: #ffffff;
}

.management-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

/* Child management specific styles */
.add-child-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
}

.add-child-form .form-group:last-child {
    display: flex;
    align-items: end;
}

.child-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.child-list-item:last-child {
    border-bottom: none;
}

.child-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.child-name {
    font-weight: 500;
    font-size: 1rem;
    color: #111827;
}

.child-group,
.child-siblings {
    font-size: 0.875rem;
    color: #6b7280;
}

/* === MOBILE RESPONSIVE === */
@media (max-width: 768px) {
    /* Show hamburger menu on mobile */
    .nav-hamburger {
        display: flex !important;
    }
    
    /* Navigation - Hamburger Menu */
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #ffffff;
        border-top: 1px solid #e5e7eb;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
        z-index: 999;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-link {
        padding: 0.75rem 2rem;
        border-bottom: none;
        border-left: 3px solid transparent;
    }
    
    .nav-link.active {
        border-left-color: #3b82f6;
        border-bottom: none;
        background-color: #f8fafc;
    }
    
    .nav-hamburger {
        display: flex;
        flex-direction: column;
        gap: 3px;
        cursor: pointer;
        padding: 0.5rem;
    }
    
    .nav-hamburger span {
        width: 20px;
        height: 2px;
        background-color: #374151;
        transition: all 0.3s ease;
    }
    
    .nav-hamburger span:nth-child(1) {
        top: calc(50% - 5px);
    }
    
    .nav-hamburger span:nth-child(2) {
        top: 50%;
        transform: translateY(-50%);
    }
    
    .nav-hamburger span:nth-child(3) {
        top: calc(50% + 3px);
    }
    
    .nav-hamburger.active span:nth-child(1) {
        transform: rotate(45deg);
        top: 50%;
    }
    
    .nav-hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-hamburger.active span:nth-child(3) {
        transform: rotate(-45deg);
        top: 50%;
    }
    
    /* Progress Bar - Mobile */
    .progress-bar {
        padding: 0.75rem 1rem;
    }
    
    .progress-steps {
        gap: 0.5rem;
    }
    
    .progress-step {
        min-width: auto;
        flex: 1;
        padding: 0.5rem;
        font-size: 0.75rem;
    }
    
    .progress-step-title {
        display: none;
    }
    
    .progress-step-number {
        font-size: 0.875rem;
    }
    
    /* Container and Layout */
    .container {
        padding: 1rem;
        margin: 0;
        max-width: 100%;
    }
    
    .main-content {
        padding-top: 140px; /* Adjusted for mobile nav height */
    }
    
    .main-content.no-progress {
        padding-top: 80px;
    }
    
    /* Navigation Container */
    .nav-container {
        padding: 1rem;
        position: relative;
        display: grid;
        grid-template-columns: 44px 1fr 44px;
        align-items: center;
    }
    
    .nav-brand {
        justify-self: center;
        text-align: center;
    }
    
    .nav-user {
        justify-self: end;
    }
    
    /* Forms and Grids */
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .add-child-form {
        grid-template-columns: 1fr;
    }
    
    .selected-children-list,
    .final-children-grid,
    .child-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    /* Archive Layout */
    .archive-layout {
        flex-direction: column;
        height: auto;
    }
    
    .archive-sidebar {
        width: 100%;
        height: auto;
        max-height: 40vh;
        overflow-y: auto;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .archive-content {
        width: 100%;
        overflow: visible;
    }
    
    .archive-list {
        display: flex;
        gap: 0.5rem;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
    
    .archive-item {
        min-width: 150px;
        flex-shrink: 0;
    }
    
    /* Step Navigation */
    .step-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .step-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Cards and Sections */
    .summary-card {
        padding: 1rem;
    }
    
    .summary-stats {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    }
    
    .stat-item {
        text-align: center;
    }
    
    /* Child Management */
    .child-list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1rem;
    }
    
    .child-actions {
        width: 100%;
        display: flex;
        gap: 0.5rem;
    }
    
    .child-actions .btn {
        flex: 1;
    }
    
    /* Modal */
    .modal-content {
        margin: 1rem;
        width: calc(100% - 2rem);
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }
    
    /* Tables and Lists */
    .absence-grid {
        grid-template-columns: 1fr;
    }
    
    .entry-stats {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .stat-item {
        font-size: 0.75rem;
    }
    
    /* Form Inputs */
    .form-input-large {
        font-size: 1rem;
    }
    
    /* Public View */
    .public-container {
        padding: 1rem;
    }
    
    .public-header h1 {
        font-size: 1.5rem;
    }
    
    /* Navigation Date */
    .nav-date {
        font-size: 0.875rem;
    }
    
    /* User Menu */
    .user-dropdown {
        right: 0;
        left: auto;
        min-width: 150px;
    }
    
    /* Finalization Step - Shorter Labels */
    .stat-label {
        font-size: 0.6rem;
        line-height: 1.2;
    }
    
    /* Override long German labels with shorter versions on mobile */
    .stat-item:nth-child(1) .stat-label::after {
        content: "Ausgewählt";
    }
    
    .stat-item:nth-child(2) .stat-label::after {
        content: "Abwesend";
    }
    
    .stat-item:nth-child(3) .stat-label::after {
        content: "Maximum";
    }
    
    .stat-item .stat-label {
        font-size: 0;
    }
    
    .stat-item .stat-label::after {
        font-size: 0.65rem;
        line-height: 1.2;
    }
}

.child-actions {
    display: flex;
    gap: 0.5rem;
}

/* Sibling management in modal */
#sibling-selector-container {
    position: relative;
    margin-top: 0.5rem;
}

#sibling-search-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

#sibling-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    max-height: 150px;
    overflow-y: auto;
    z-index: 1001;
}

.search-result-item {
    padding: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
}

.search-result-item:hover {
    background-color: #f3f4f6;
}

#selected-siblings-container {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    min-height: 40px;
}

.sibling-pill {
    display: flex;
    align-items: center;
    background-color: #3b82f6;
    color: #ffffff;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.sibling-pill .remove-sibling {
    margin-left: 0.5rem;
    cursor: pointer;
    font-weight: bold;
    line-height: 1;
}

.sibling-pill .remove-sibling:hover {
    color: #dbeafe;
}

.modal-actions {
    margin-top: 1.5rem;
    text-align: right;
}

#edit-child-form label {
    font-weight: 500;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    display: block;
    color: #374151;
}

#edit-child-form input[type="text"] {
    width: 100%;
}
