/* ============================================================
   SMS Biga Campus - Grade 7 Admissions Tracker
   Stylesheet
   ============================================================ */

/* -- CSS Variables -- */
:root {
    --primary:        #003DA5;
    --primary-dark:   #002B75;
    --primary-light:  #1A5BC4;
    --primary-subtle: #E8F0FE;
    --accent-green:   #16A34A;
    --accent-red:     #DC2626;
    --accent-yellow:  #CA8A04;
    --accent-blue:    #2563EB;
    --accent-gray:    #6B7280;
    --bg:             #F5F7FA;
    --white:          #FFFFFF;
    --border:         #D1D5DB;
    --text:           #1A1A2E;
    --text-light:     #555770;
    --shadow:         0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg:      0 4px 14px rgba(0,0,0,0.12);
    --radius:         8px;
    --font:           "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

/* -- Reset -- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; letter-spacing: 0.01em; }
h1, h2, h3, h4, h5, h6 { letter-spacing: normal; }

/* Placeholder contrast — #767676 on white is 4.54:1, passes WCAG AA */
::placeholder { color: #767676; opacity: 1; }

/* -- UTILITY -- */
.hidden { display: none !important; }

/* -- ANIMATIONS -- */
@keyframes gradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@keyframes cardFadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* -- LOGIN SCREEN -- */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(150deg, var(--primary-dark), var(--primary), var(--primary-light));
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
}
.login-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 400px;
    animation: cardFadeIn 0.5s ease both;
}
.login-header { text-align: center; margin-bottom: 1.25rem; }
.login-logo {
    width: 100px;
    height: auto;
    display: block;
    margin: 0 auto 1rem;
}
.login-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.3;
    margin-bottom: 0.35rem;
}
/* Campus subtitle */
.login-header > p:first-of-type { color: var(--text-light); font-size: 0.9rem; }
/* School year line — #555770 on white is 7.04:1, passes WCAG AA */
.login-school-year { font-size: 0.8rem; color: var(--text-light); margin-top: 0.3rem; }

/* Divider: negative horizontal margin bleeds to card edges (matches 2rem card padding) */
.login-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 0 -2rem 1.75rem;
}


.error-msg {
    background: #FEF2F2;
    color: var(--accent-red);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    border: 1px solid #FECACA;
}

/* -- TOP NAV -- */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--primary-dark);
    color: var(--white);
    padding: 0.75rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}
.top-nav h2 { font-size: 1.1rem; font-weight: 600; }
.nav-right { display: flex; align-items: center; gap: 0.75rem; }
.user-email { font-size: 0.85rem; opacity: 0.85; }

/* -- SUMMARY BAR -- */
.summary-bar {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.75rem;
    padding: 1rem 1.5rem;
}
.summary-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem;
    text-align: center;
    border-top: 3px solid var(--border);
}
.summary-count { font-size: 2rem; font-weight: 700; letter-spacing: normal; }
.summary-label { font-size: 0.8rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.5px; }
.card-total     { border-top-color: var(--primary); }
.card-total     .summary-count { color: var(--primary); }
.card-pending   { border-top-color: var(--accent-yellow); }
.card-pending   .summary-count { color: var(--accent-yellow); }
.card-accepted  { border-top-color: var(--accent-green); }
.card-accepted  .summary-count { color: var(--accent-green); }
.card-waitlisted{ border-top-color: var(--accent-blue); }
.card-waitlisted .summary-count { color: var(--accent-blue); }
.card-declined  { border-top-color: var(--accent-red); }
.card-declined  .summary-count { color: var(--accent-red); }
.card-withdrawn { border-top-color: var(--accent-gray); }
.card-withdrawn .summary-count { color: var(--accent-gray); }

/* -- FILTER BAR -- */
.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.filter-left, .filter-right { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.filter-bar input[type="text"] {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    width: 260px;
    font-family: var(--font);
    color: var(--text);
    background: var(--white);
}
.filter-bar input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,61,165,0.3);
}
.filter-bar select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: var(--font);
    background: var(--white);
    color: var(--text);
}
.filter-bar select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,61,165,0.3);
}

/* -- BUTTONS -- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: var(--font);
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
    text-decoration: none;
    gap: 0.35rem;
}
.btn:hover  { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,61,165,0.4);
}
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);        /* overrides generic btn:hover -1px */
    box-shadow: 0 6px 16px rgba(0,61,165,0.35);
}
.btn-success { background: var(--accent-green); color: var(--white); }
.btn-success:hover { background: #15803D; }
.btn-danger  { background: var(--accent-red); color: var(--white); }
.btn-danger:hover  { background: #B91C1C; }
.btn-outline {
    background: var(--white);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--bg); }
.btn-sm   { padding: 0.35rem 0.65rem; font-size: 0.8rem; }
.btn-full { width: 100%; }
.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.1rem;
    color: var(--text-light);
    transition: color 0.15s;
    border-radius: 4px;
}
.btn-icon:hover            { color: var(--primary); }
.btn-icon.delete:hover     { color: var(--accent-red); }
.btn-icon:focus-visible    { outline: none; box-shadow: 0 0 0 3px rgba(0,61,165,0.3); }

/* -- TABLE -- */
.table-container {
    padding: 0 1.5rem 1.5rem;
    overflow-x: auto;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    box-shadow: var(--shadow);
}
thead {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
th {
    padding: 0.7rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { background: var(--primary-light); }
/* Restore rounded top corners now that overflow:hidden is removed from table */
thead th:first-child { border-radius: var(--radius) 0 0 0; }
thead th:last-child  { border-radius: 0 var(--radius) 0 0; }
td {
    padding: 0.8rem 0.75rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: nowrap;
}
/* Zebra striping — #F0F4FA on white gives 1.03:1 bg shift; text (#1A1A2E) is 16.7:1 on it */
tbody tr:nth-child(even) td { background: #F0F4FA; }
/* Hover overrides zebra (same specificity, declared later so it wins) */
tbody tr:hover td { background: var(--primary-subtle); }
/* Left-border accent via inset shadow — no layout shift */
tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
/* Row number column */
td:first-child { color: var(--text-light); font-size: 0.8rem; }
/* Full Name column (JS wraps name in <strong>, override bold to 600) */
td:nth-child(2) { font-size: 0.95rem; }
td:nth-child(2) strong { font-weight: 600; }
/* Empty state — used in tbody and by JS renderTable() */
.empty-state {
    text-align: center;
    padding: 3rem !important;
    vertical-align: middle;
}
.empty-state-emoji {
    display: block;
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 0.75rem;
}
.empty-state-title {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.35rem;
}
.empty-state-sub {
    display: block;
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--primary-subtle);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}
.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}
/* White spinner inside primary buttons */
.btn-primary .spinner {
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
}
/* Table loading spinner — centered above where the table will appear */
#loading-spinner { margin: 3rem auto; }

/* Fade-in for rendered table rows */
.fade-in { animation: fadeIn 0.3s ease both; }

/* -- STUDENT LINK (table name cell) -- */
.student-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}
.student-link:hover { text-decoration: underline; }

/* -- STATUS BADGES --
   Text colors verified against their backgrounds for WCAG AA (4.5:1 minimum) */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.badge-pending    { background: #FEF9C3; color: #854D0E; } /* 5.8:1 */
.badge-accepted   { background: #DCFCE7; color: #166534; } /* 6.2:1 */
.badge-waitlisted { background: #DBEAFE; color: #1E3A8A; } /* 6.7:1 */
.badge-declined   { background: #FEE2E2; color: #991B1B; } /* 5.9:1 */
.badge-withdrawn  { background: #F3F4F6; color: #374151; } /* 7.3:1 */

/* -- DOCS PROGRESS -- */
.docs-progress { display: flex; align-items: center; gap: 0.4rem; }
.docs-bar {
    width: 60px;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}
.docs-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}
/* Map old getProgressColor() inline hex values to the current palette without touching JS */
.docs-bar-fill[style*="#38a169"] { background: #16A34A !important; } /* 100% */
.docs-bar-fill[style*="#d69e2e"] { background: #CA8A04 !important; } /* 60-99% */
.docs-bar-fill[style*="#e53e3e"] { background: #DC2626 !important; } /* <60% */
.docs-count { font-size: 0.8rem; color: var(--text-light); font-weight: 500; }

/* -- VIEW MODAL -- */
.modal-view { max-width: 640px; }

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-section {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}
.view-section:last-child { border-bottom: none; }
.view-section > .section-title { margin-bottom: 0.75rem; }

.view-grid {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 0.5rem 1rem;
    align-items: baseline;
}
.view-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
}
.view-value {
    font-size: 0.9rem;
    color: var(--text);
    word-break: break-word;
}

.view-checklist {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
}
.view-checklist-item {
    font-size: 0.875rem;
    color: var(--text);
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
}
.check-yes { color: #16A34A; font-weight: 700; flex-shrink: 0; }
.check-no  { color: #DC2626; font-weight: 700; flex-shrink: 0; }

/* -- MODAL -- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 200;
    padding: 2rem 1rem;
    overflow-y: auto;
}
.modal {
    background: var(--white);
    border-radius: 12px;
    border-top: 4px solid var(--primary);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 720px;
    animation: modalIn 0.2s ease;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 4rem);
}
.modal-sm { max-width: 420px; border-radius: 12px; }
@keyframes modalIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 2px solid var(--primary);
}
.modal-header h3 { font-size: 1.1rem; color: var(--primary); font-weight: 700; }
.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    line-height: 1;
    border-radius: 4px;
}
.modal-close:hover { color: var(--accent-red); }
.modal-close:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(0,61,165,0.3); }
.modal-body { padding: 0.5rem 1rem; overflow-y: auto; flex: 1; background: var(--white); }
.modal-footer {
    position: sticky;
    bottom: 0;
    background: var(--white);
    padding: 0.75rem 1.5rem;
    border-top: 1px solid var(--border);
    border-radius: 0 0 12px 12px;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    z-index: 1;
    flex-shrink: 0;
}

/* -- FORM SECTIONS -- */
.form-section {
    padding: 1rem;
    margin-bottom: 0.25rem;
}
.form-section-tinted { background: rgba(232, 240, 254, 0.4); }
.form-section > .section-title { margin-top: 0; }

.req { color: #DC2626; font-weight: 700; }

/* -- FORM -- */
.section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    margin: 1.25rem 0 0.5rem;
    padding-left: 0.75rem;
    border-left: 3px solid var(--primary);
    letter-spacing: normal;
}
.section-title:first-of-type { margin-top: 0; }
.form-group { margin-bottom: 0.75rem; }
.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: var(--font);
    color: var(--text);
    background: var(--white);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,61,165,0.3);
}
.form-row   { display: grid; gap: 0.75rem; }
.two-col    { grid-template-columns: 1fr 1fr; }
.three-col  { grid-template-columns: 1fr 1fr 1fr; }
.age-display {
    padding: 0.5rem 0.65rem;
    background: var(--primary-subtle);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
}
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* -- CHECKLIST TOGGLES -- */
.checklist-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}
.checklist-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.65rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 0.85rem;
}
.checklist-item:hover  { background: var(--primary-subtle); }
.checklist-item.optional { border-style: dashed; }
.checklist-item em     { color: var(--text-light); font-size: 0.75rem; }

/* Toggle switch — checked state stays green for clear visual distinction */
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle input:focus-visible + .slider { box-shadow: 0 0 0 3px rgba(0,61,165,0.3); }
.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #9CA3AF;
    transition: 0.25s;
    border-radius: 24px;
}
.slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: var(--white);
    transition: 0.25s;
    border-radius: 50%;
}
.toggle input:checked + .slider { background: var(--accent-green); }
.toggle input:checked + .slider::before { transform: translateX(20px); }

.checklist-item { min-height: 44px; }
.checklist-progress { font-size: 0.8rem; color: var(--text-light); margin-bottom: 0.75rem; font-weight: 500; }

/* -- TOAST -- */
#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.toast {
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    color: var(--white);
    font-size: 0.9rem;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
    max-width: 360px;
}
.toast-success { background: var(--accent-green); }
.toast-error   { background: var(--accent-red); }
.toast-info    { background: var(--primary); }
@keyframes toastIn  { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; } }

/* -- RESPONSIVE -- */

/* Tablet: 769px–900px — collapse form grids only */
@media (max-width: 900px) {
    .checklist-grid { grid-template-columns: 1fr; }
    .three-col      { grid-template-columns: 1fr; }
    .two-col        { grid-template-columns: 1fr; }
}

/* ============================================================
   Mobile: ≤768px
   ============================================================ */
@media (max-width: 768px) {

    /* ISSUE 9 — General horizontal padding reduction */
    .summary-bar { padding: 0.5rem 1rem; }
    .filter-bar  { padding: 0.5rem 1rem; }

    /* ISSUE 2 — Top nav: compact, stacked, centered */
    .top-nav {
        flex-direction: column;
        align-items: center;
        gap: 0.4rem;
        padding: 0.6rem 1rem;
        text-align: center;
    }
    .top-nav h2  { font-size: 0.95rem; }
    .nav-right   { justify-content: center; }
    .user-email  { font-size: 0.75rem; }
    /* Sign Out: compact pill that doesn't dominate the nav */
    .top-nav .btn-sm {
        font-size: 0.75rem;
        padding: 0.3rem 0.75rem;
        min-height: unset;
        height: auto;
    }

    /* ISSUE 1 — Summary bar: 3×2 grid */
    .summary-bar {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
        padding: 0.75rem 1rem;
        overflow-x: visible;
    }
    .summary-card {
        min-width: 0;
        flex-shrink: unset;
        scroll-snap-align: unset;
        padding: 0.6rem 0.5rem;
    }
    .summary-count { font-size: 1.4rem; }
    .summary-label { font-size: 0.7rem; }

    /* ISSUE 3 — Filter bar: fully stacked; Add Student gets its own row */
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    .filter-left {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    .filter-left input[type="text"],
    .filter-left select {
        width: 100%;
        min-height: 44px;
        font-size: 1rem;
    }
    .filter-right {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .filter-right .btn-success {
        order: -1;
        flex: 1 1 100%;  /* own full-width row */
        min-height: 44px;
    }
    .filter-right .btn-outline {
        flex: 1 1 auto;  /* export buttons share the second row */
        min-height: 44px;
    }

    /* ISSUE 4 — Table: scroll hint, compact cells */
    .table-container {
        padding: 0 0 1rem;
        position: relative;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .table-container::after {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 40px;
        background: linear-gradient(to right, transparent, var(--bg));
        pointer-events: none;
        z-index: 5;
    }
    td {
        padding: 0.5rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    /* ISSUE 5 — Sticky table header */
    thead {
        position: sticky;
        top: 0;
        z-index: 10;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    /* ISSUE 6 — Touch targets: 44px minimum */
    .btn         { min-height: 44px; }
    .btn-sm      { min-height: 44px; padding: 0.35rem 0.75rem; }
    .modal-close { min-width: 44px; min-height: 44px; font-size: 1.75rem; }
    .form-group input,
    .form-group select,
    .form-group textarea { min-height: 44px; font-size: 1rem; }
    .filter-bar select   { min-height: 44px; }
    /* Toggles: slightly taller for easier tapping */
    .toggle { width: 44px; height: 26px; }
    .slider { border-radius: 26px; }
    .slider::before { bottom: 4px; }
    /* Checklist row: more tap surface */
    .checklist-item { padding: 0.75rem; min-height: 44px; }

    /* ISSUE 7 — Modal: full screen */
    .modal-overlay {
        padding: 0;
        align-items: flex-start;
    }
    .modal {
        width: 100%;
        max-width: 100%;
        min-height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        border-top: none;
        margin: 0;
    }
    .modal-footer {
        border-radius: 0;
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
    }
    .modal-body { padding-bottom: env(safe-area-inset-bottom); }

    /* ISSUE 8 — Safe area: app container bottom */
    .app { padding-bottom: env(safe-area-inset-bottom); }
    .table-container { padding-bottom: calc(1rem + env(safe-area-inset-bottom)); }
}
