/* Lesson Planner — Bootstrap 5 theme overrides. Mobile-first, desktop-ready. */
:root {
    --brand: #1f5f4f;
    --brand-dark: #164437;
    --brand-tint: #e8f2ef;
    --ink: #1b2127;
    --muted: #6b7580;
    --line: #e3e8ec;
}

body {
    background: #f5f7f9;
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
}

/* ---------------- Navbar ---------------- */
.app-navbar { background: var(--brand); }
.navbar-brand { font-weight: 700; letter-spacing: .2px; }

/* ---------------- Cards ---------------- */
.card {
    border: none;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
}
.card-header {
    background: #fff;
    border-bottom: 1px solid var(--line);
    border-radius: 14px 14px 0 0 !important;
    font-weight: 600;
}

.page-head {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px; margin-bottom: 18px;
}
.page-head h1 { font-size: 1.5rem; margin: 0; font-weight: 700; }
.page-head .subtitle { color: var(--muted); font-size: .9rem; margin: 4px 0 0; }

.btn-brand { background: var(--brand); color: #fff; }
.btn-brand:hover, .btn-brand:focus { background: var(--brand-dark); color: #fff; }

/* Comfortable tap targets on phones. */
.btn, .form-control, .form-select { min-height: 42px; }
.form-select-sm { min-height: 36px; }

/* ---------------- Timetable day cards ---------------- */
.day-card { height: 100%; }
.day-card .card-header {
    background: var(--brand-tint);
    color: var(--brand-dark);
    text-align: center;
}
.day-row {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 0; border-bottom: 1px dashed var(--line);
}
.day-row:last-child { border-bottom: 0; }
.day-row .period-tag {
    flex: 0 0 34px; text-align: center; font-size: .75rem; font-weight: 700;
    color: var(--muted); background: #f1f4f6; border-radius: 6px; padding: 4px 0;
}
.day-row select { flex: 1 1 auto; }

/* ---------------- Setup checklist ---------------- */
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 0; border-bottom: 1px solid var(--line);
}
.checklist li:last-child { border-bottom: 0; }
.checklist .bi-check-circle-fill { color: #198754; }
.checklist .bi-circle { color: #c3ccd4; }

/* ---------------- Plan list ---------------- */
.day-heading {
    background: var(--brand-tint); color: var(--brand-dark);
    font-weight: 700; padding: 8px 12px; border-radius: 8px;
    margin: 18px 0 8px; font-size: .95rem;
}
.buffer-row { color: var(--muted); font-style: italic; }
.topic-part { color: var(--muted); font-size: .85em; }

/* Stack table rows into cards on narrow screens. */
@media (max-width: 575.98px) {
    table.stack-sm thead { display: none; }
    table.stack-sm tr {
        display: block; padding: 10px 12px; border-bottom: 1px solid var(--line);
    }
    table.stack-sm td {
        display: flex; justify-content: space-between; gap: 14px;
        border: 0; padding: 3px 0;
    }
    table.stack-sm td::before {
        content: attr(data-label);
        color: var(--muted); font-size: .8rem; font-weight: 600;
    }
}

/* ---------------- Login ---------------- */
.login-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(160deg, var(--brand) 0%, var(--brand-dark) 100%);
    padding: 20px;
}
.login-card { width: 100%; max-width: 380px; }

/* ---------------- Print ---------------- */
@media print {
    .app-navbar, .no-print, .btn, nav, footer, .alert { display: none !important; }
    body { background: #fff; }
    .card { box-shadow: none; border: 1px solid #ccc; }
    .day-heading { background: #eee !important; color: #000 !important; }
    .month-block { page-break-after: always; }
    .month-block:last-child { page-break-after: auto; }
    a[href]::after { content: ""; }
}
