/* ========================================
   CICO v1.1 — Theme & Variables
   ======================================== */
:root {
    --navy: #183153;
    --blue: #2d5f9a;
    --gold: #d8b24c;
    --cream: #fffaf2;
    --sky: #eef6ff;
    --mint: #eaf8ef;
    --rose: #fff0f2;
    --card: #ffffff;
    --text: #1f2937;
    --border: #dbe5f0;
    --shadow: 0 10px 28px rgba(24, 49, 83, 0.10);
    --danger: #d94841;
    --success: #2d8f4e;
}

body.dark {
    --cream: #101827;
    --sky: #162132;
    --mint: #16271c;
    --rose: #2c1a23;
    --card: #182434;
    --text: #eef3fb;
    --border: #30455f;
    --shadow: none;
}

/* ========================================
   Reset & Base
   ======================================== */
*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(180deg, var(--sky), var(--cream));
    color: var(--text);
    min-height: 100vh;
}

/* ========================================
   Login Page
   ======================================== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--navy), var(--blue));
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: var(--card);
    border-radius: 24px;
    padding: 36px 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    text-align: center;
}

.login-logo {
    margin: 0 auto 16px;
    text-align: center;
}

.login-logo img {
    max-width: 180px;
    height: auto;
}

.login-footer-link {
    margin-top: 20px;
    margin-bottom: -20px;
    text-align: center;
    font-size: 0.8rem;
}

.login-footer-link a {
    color: #9aa5b4;
    text-decoration: none;
}

.login-footer-link a:hover {
    color: #6b7c93;
    text-decoration: underline;
}

.login-card h1 {
    margin: 0 0 4px;
    font-size: 1.3rem;
    color: var(--navy);
}

.login-subtitle {
    margin: 0 0 24px;
    opacity: 0.7;
    font-size: 0.9rem;
}

.login-card .form-group {
    text-align: left;
    margin-bottom: 16px;
}

/* ========================================
   Alerts & Toasts
   ======================================== */
.alert {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    font-weight: 600;
}

.alert-error {
    background: #ffe1df;
    color: #a22c26;
    border: 1px solid #f5c6c3;
}

.alert-success {
    background: #dff5e5;
    color: #22663a;
    border: 1px solid #b8e6c8;
}

.alert-info {
    background: #deeeff;
    color: #1a4a7a;
    border: 1px solid #b8d4f0;
}

#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 14px 20px;
    border-radius: 16px;
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease;
    max-width: 360px;
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--blue); }

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

/* ========================================
   Navigation
   ======================================== */
nav {
    background: linear-gradient(135deg, var(--navy), var(--blue));
    color: #fff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    flex-wrap: wrap;
}

.nav-logo {
    flex: 0 0 auto;
    height: 46px;
    display: flex;
    align-items: center;
}
.nav-logo img {
    height: 100%;
    width: auto;
    display: block;
}

.badge-initials {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--navy);
    letter-spacing: 0.04em;
    line-height: 1;
}

.nav-title { flex: 1; min-width: 200px; }
.nav-title h1 { margin: 0; font-size: 1.25rem; letter-spacing: 0.2px; }
.nav-title p { margin: 4px 0 0; font-size: 0.82rem; opacity: 0.9; }

/* Profile avatar button & dropdown */
.profile-menu-wrap { position: relative; }

.profile-avatar-btn {
    width: 46px !important;
    height: 46px !important;
    border-radius: 50% !important;
    background: #e6eaf0 !important;
    border: 2px solid rgba(255, 255, 255, 0.55) !important;
    padding: 0 !important;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto;
    overflow: hidden !important;
    position: relative !important;
    transition: background 0.15s, border-color 0.15s;
}
.profile-avatar-btn:hover {
    background: #d4dae4 !important;
    border-color: rgba(255, 255, 255, 0.85) !important;
}
.profile-avatar-img {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    border-radius: 50%;
    background: #fff;
    opacity: 0.35;
    z-index: 0;
}
.profile-avatar-btn .badge-initials {
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.85);
}

.profile-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
    min-width: 210px;
    z-index: 300;
    overflow: hidden;
}
.profile-dropdown.show { display: block; }

.profile-dropdown-name {
    padding: 12px 16px 10px;
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--navy);
    border-bottom: 1px solid #dbe5f0;
    white-space: nowrap;
}
.profile-dropdown-role {
    font-weight: 400;
    font-size: 0.78rem;
    opacity: 0.7;
}
.profile-dropdown-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 16px;
    font-size: 0.87rem;
    color: #4a6785;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.12s;
}
.profile-dropdown-item:hover {
    background: #f0f4fa;
    color: var(--navy);
}

nav button,
.nav-btn {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.28);
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.85rem;
    white-space: nowrap;
}

nav button:hover,
.nav-btn:hover { background: rgba(255, 255, 255, 0.22); }

/* Close button — shown only when admin opens form from tile */
.nav-close-btn {
    background: rgba(255, 255, 255, 0.92) !important;
    color: var(--navy) !important;
    border-color: rgba(255, 255, 255, 0.7) !important;
    font-weight: 700 !important;
}
.nav-close-btn:hover {
    background: #fff !important;
    opacity: 0.9;
}

/* ========================================
   Tab Bar
   ======================================== */
/* Day Navigation Strip */
#day-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
}
body.dark #day-nav { background: var(--card); }

/* Left group: icon + name + tags */
#day-nav-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

#day-nav-icon { font-size: 1.3rem; line-height: 1; }

#day-nav-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--navy);
    white-space: nowrap;
}
body.dark #day-nav-name { color: var(--text); }

#day-nav-tags {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.info-bar-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.74rem;
    font-weight: 600;
    color: #6b7c93;
    background: var(--sky);
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
}
.info-bar-tag i { font-size: 0.68rem; color: var(--blue); }
body.dark .info-bar-tag { background: #1e3350; color: #a8c5e8; }
.info-bar-goal { background: #dff5e5; color: #22663a; }
body.dark .info-bar-goal { background: #1a3326; color: #6ee7b7; }

/* Right group: prev + date + next */
#day-nav-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

#day-nav-date {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--navy);
    white-space: nowrap;
    padding: 0 2px;
}
body.dark #day-nav-date { color: var(--text); }

#day-nav button {
    background: none;
    border: 2px solid var(--border);
    border-radius: 999px;
    padding: 0.4rem 0.8rem;
    font-weight: 700;
    font-size: 0.78rem;
    color: var(--navy);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    transition: all 0.15s;
}
#day-nav button:hover:not(:disabled) {
    background: var(--sky);
    border-color: var(--blue);
    color: var(--blue);
}
#day-nav button:disabled { opacity: 0.3; cursor: not-allowed; }
body.dark #day-nav button { color: var(--text); border-color: var(--border); }
body.dark #day-nav button:hover:not(:disabled) { background: #1e3350; }

/* Absent Today button */
.absent-btn {
    background: none;
    border: 2px solid #e53e3e !important;
    color: #e53e3e !important;
}
.absent-btn:hover:not(:disabled) {
    background: #fff5f5 !important;
    border-color: #c53030 !important;
    color: #c53030 !important;
}
.absent-btn.absent-active {
    background: #22c55e !important;
    border-color: #16a34a !important;
    color: #fff !important;
}
.absent-btn.absent-active:hover:not(:disabled) {
    background: #16a34a !important;
}
body.dark .absent-btn { border-color: #fc8181 !important; color: #fc8181 !important; }
body.dark .absent-btn.absent-active { background: #16a34a !important; border-color: #15803d !important; color: #fff !important; }

/* Panel — absent state: grey out all cards and block interaction */
.panel-absent .card {
    opacity: 0.4;
    pointer-events: none;
    user-select: none;
    transition: opacity 0.2s;
}

/* Score wrap — absent state */
.score-wrap.absent-day {
    background: linear-gradient(135deg, #f0f4f8, #fff);
    border-color: #cbd5e0;
}
.score-wrap.absent-day .score-head { color: #718096; }
.absent-day-notice {
    text-align: center;
    padding: 10px 0 4px;
    font-weight: 700;
    font-size: 0.95rem;
    color: #718096;
    letter-spacing: 0.02em;
}
body.dark .score-wrap.absent-day { background: linear-gradient(135deg, #1a2535, var(--card)); }

/* ========================================
   Main Content
   ======================================== */
#main {
    max-width: 1080px;
    margin: 0 auto;
    padding: 18px;
}

.student-panel { display: none; }
.student-panel.active { display: block; }

#archive-panel { display: none; }
#archive-panel.active { display: block; }

#empty-state {
    display: none;
    text-align: center;
    padding: 4rem 1rem;
}

#empty-state h2 { color: var(--navy); }

#empty-add-btn {
    background: var(--gold);
    border: none;
    padding: 0.9rem 1.5rem;
    border-radius: 999px;
    font-weight: 800;
    cursor: pointer;
}

/* ========================================
   Cards & Forms
   ======================================== */
/* Hero removed — student info now in day-nav strip */

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 18px;
    margin-bottom: 18px;
    box-shadow: var(--shadow);
}

.card h3 {
    margin: 0 0 14px;
    color: var(--navy);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

body.dark .card h3 { color: #a8c5e8; }

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

.mood-sel {
    width: 100%;
    padding: 0.85rem 2.4rem 0.85rem 1.1rem;
    border: 2px solid var(--border);
    border-radius: 50px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7c93' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 1rem center;
    -webkit-appearance: none;
    appearance: none;
    color: #1f2937;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.mood-sel:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(45, 95, 154, 0.15);
}

body.dark .mood-sel {
    background-color: #0f1825;
    color: #eef3fb;
    border-color: #2a3f5a;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239aa5b4' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 6px;
    opacity: 0.8;
}

.form-group input,
.form-group select,
textarea {
    width: 100%;
    padding: 0.75rem 0.85rem;
    border: 2px solid var(--border);
    border-radius: 16px;
    background: #fff;
    color: #1f2937;
    font-size: 0.92rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
textarea:focus {
    outline: none;
    border-color: var(--blue);
}

.form-group input.invalid,
.form-group select.invalid,
textarea.invalid {
    border-color: var(--danger);
}

body.dark .form-group input,
body.dark .form-group select,
body.dark textarea {
    background: #0f1825;
    color: #eef3fb;
}

textarea { min-height: 88px; resize: vertical; }

/* ========================================
   Expectations Chips
   ======================================== */
.exp-chips { display: flex; flex-wrap: wrap; gap: 10px; }

.exp-chip {
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    border: 2px solid transparent;
    background: linear-gradient(135deg, var(--navy), var(--blue));
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
}

body.dark .exp-chip { background: linear-gradient(135deg, var(--navy), var(--blue)); color: #fff; }
    cursor: pointer;
    font-weight: 700;
}

/* ========================================
   Score Bar
   ======================================== */
.score-wrap {
    background: linear-gradient(135deg, var(--mint), #fff);
    padding: 14px;
    border-radius: 18px;
    border: 1px solid var(--border);
    margin-bottom: 14px;
}

body.dark .score-wrap { background: linear-gradient(135deg, var(--mint), var(--card)); }

.score-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 8px;
}

body.dark .score-head { color: #a8c5e8; }

.score-bar-bg {
    height: 20px;
    border-radius: 999px;
    background: #fff0b3;
    overflow: hidden;
}

body.dark .score-bar-bg { background: #4a3d00; }

.score-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff6b6b, #ffd166, #6bcB77);
    border-radius: 999px;
    transition: width 0.35s ease;
}

/* ========================================
   Period Table
   ======================================== */
.table-scroll { overflow-x: auto; }

table { width: 100%; border-collapse: separate; border-spacing: 0 8px; font-size: 0.9rem; }

th {
    background: var(--navy);
    color: #fff;
    padding: 0.7rem 0.75rem;
    text-align: left;
    white-space: nowrap;
}

th:first-child { border-radius: 14px 0 0 14px; }
th:last-child { border-radius: 0 14px 14px 0; }

td {
    background: #fff;
    padding: 0.65rem 0.55rem;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

body.dark td { background: #132033; }

td:first-child { border-left: 1px solid var(--border); border-radius: 14px 0 0 14px; }
td:last-child { border-right: 1px solid var(--border); border-radius: 0 14px 14px 0; }

.editable { border-radius: 10px; }
.editable:hover { outline: 2px dashed var(--gold); }

/* ========================================
   Rating Buttons
   ======================================== */
.rating-btns { display: flex; gap: 6px; justify-content: center; }

.rating-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: #fff;
    cursor: pointer;
    font-weight: 800;
    font-size: 0.85rem;
    transition: all 0.15s;
}

body.dark .rating-btn { background: #0f1825; color: #eef3fb; }

.rating-btn.sel-0 { background: #7f1d1d; color: #fff; border-color: #7f1d1d; }
.rating-btn.sel-1 { background: #ff6b6b; color: #fff; border-color: #ff6b6b; }
.rating-btn.sel-2 { background: #ffb703; color: #fff; border-color: #ffb703; }
.rating-btn.sel-3 { background: #6bcB77; color: #fff; border-color: #6bcB77; }

.del-row {
    background: none;
    border: none;
    color: #9aa7b3;
    font-size: 1rem;
    cursor: pointer;
}

.del-row:hover { color: var(--danger); }

.add-row-btn {
    width: 100%;
    margin-top: 10px;
    border: 2px dashed #bfd2ea;
    background: #f8fbff;
    color: var(--navy);
    padding: 0.8rem;
    border-radius: 18px;
    cursor: pointer;
    font-weight: 800;
}

body.dark .add-row-btn { background: #162540; border-color: #2d4a70; color: #a8c5e8; }

/* ========================================
   Celebrations
   ======================================== */
.celebrations-grid { display: flex; flex-wrap: wrap; gap: 28px; justify-content: center; }

.cel-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 18px;
    border-radius: 20px;
    cursor: default;
    background: #f0f5ff;
    border: 2px solid #cfe0fa;
    transition: all 0.2s;
    min-width: 90px;
    opacity: 0.45;
}

.cel-item.cel-on {
    background: linear-gradient(135deg, #fffbe6, #fff3b0);
    border-color: var(--gold);
    box-shadow: 0 4px 14px rgba(216, 178, 76, 0.35);
    transform: scale(1.07);
    opacity: 1;
}

body.dark .cel-item { background: #162540; border-color: #2d4a70; }
body.dark .cel-item.cel-on { background: linear-gradient(135deg, #3a2e00, #4e3d00); border-color: var(--gold); opacity: 1; }

.cel-emoji { font-size: 2rem; margin-bottom: 6px; }
.cel-label { font-size: 0.8rem; font-weight: 700; color: var(--navy); text-align: center; }
body.dark .cel-label { color: #a8c5e8; }

/* ========================================
   Signatures
   ======================================== */
.sig-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.sig-line { border-bottom: 2px dashed #9fb1c7; height: 30px; }
.sig-label { font-size: 0.76rem; opacity: 0.7; margin-top: 6px; }

/* ========================================
   Action Buttons
   ======================================== */
.action-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

.btn {
    border: none;
    border-radius: 18px;
    padding: 0.8rem 1.15rem;
    font-weight: 800;
    cursor: pointer;
    font-size: 0.88rem;
    transition: opacity 0.15s;
}

.btn:hover { opacity: 0.88; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Tooltip shown on hover when Send to Parents is disabled */
.send-btn-wrap { position: relative; display: inline-block; }
.send-btn-wrap::after {
    content: 'Save before sending to parents';
    position: absolute;
    bottom: calc(100% + 7px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #fff;
    font-size: 0.72rem;
    padding: 4px 10px;
    border-radius: 5px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s;
    z-index: 20;
}
.send-btn-wrap.send-disabled:hover::after { opacity: 1; }

.btn-primary { background: var(--navy); color: #fff; }
.btn-accent { background: var(--gold); color: #1d2430; }
.btn-success { background: var(--success); color: #fff; }
.btn-warn { background: var(--danger); color: #fff; }
.btn-block { display: block; width: 100%; }

/* ========================================
   Archive Table
   ======================================== */
.archive-table { width: 100%; border-collapse: collapse; }
.archive-table th,
.archive-table td { border: 1px solid var(--border); padding: 0.7rem; }
.archive-table th { background: var(--navy); color: #fff; }
body.dark .archive-table td { background: var(--card); }

.archive-table tbody tr { cursor: pointer; transition: background 0.15s; }
.archive-table tbody tr:hover td { background: var(--sky); }
body.dark .archive-table tbody tr:hover td { background: #1e3350; }

.archive-filters {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.archive-filters .form-group { margin: 0; }

/* ========================================
   Badges
   ======================================== */
.badge {
    display: inline-block;
    padding: 0.28rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
}

.badge-green { background: #dff5e5; color: #22663a; }
.badge-amber { background: #fff3d6; color: #9b6500; }
.badge-red { background: #ffe1df; color: #a22c26; }
.badge-role { background: rgba(255,255,255,0.2); color: #fff; font-size: 0.72rem; }

/* ========================================
   Modal
   ======================================== */
#modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

#modal.show { display: flex; }

#modal-box {
    background: var(--card);
    width: min(92vw, 600px);
    max-height: 80vh;
    overflow: auto;
    border-radius: 24px;
    padding: 22px;
    box-shadow: var(--shadow);
    position: relative;
}

#modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
}

/* ── Send to Parents confirm modal ── */
#send-confirm-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 200;
    align-items: center;
    justify-content: center;
}
#send-confirm-modal.show { display: flex; }

#send-confirm-box {
    background: var(--card);
    width: min(92vw, 400px);
    border-radius: 24px;
    padding: 32px 28px 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    animation: scaleIn 0.18s ease;
}

@keyframes scaleIn {
    from { transform: scale(0.92); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

.send-confirm-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--navy), var(--blue));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.3rem;
    margin-bottom: 4px;
}

.send-confirm-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--navy);
}

.send-confirm-body {
    margin: 0;
    font-size: 0.88rem;
    color: #4a6785;
    line-height: 1.6;
    max-width: 320px;
}

.send-confirm-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    width: 100%;
}

.send-confirm-actions button {
    flex: 1;
    padding: 11px 0;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: opacity 0.15s;
}
.send-confirm-actions button:hover { opacity: 0.85; }

#send-confirm-ok {
    background: linear-gradient(135deg, var(--navy), var(--blue));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

#send-confirm-cancel {
    background: var(--bg);
    color: #6b7c93;
    border: 1.5px solid var(--border) !important;
}

/* ========================================
   Utility
   ======================================== */
.muted { opacity: 0.65; }

.note-input {
    width: 130px;
    padding: 5px 8px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 0.82rem;
    background: #fff;
    color: #1f2937;
    font-family: inherit;
}

body.dark .note-input { background: #0f1825; color: #eef3fb; }

.saving-indicator {
    font-size: 0.75rem;
    opacity: 0.6;
    margin-left: 8px;
}

/* ========================================
   Print
   ======================================== */
#print-header { display: none; }

@media print {
    nav, #day-nav, .action-bar, .add-exp, .add-row-btn, .del-row,
    #toast-container, .archive-filters, #logout-btn { display: none !important; }

    #print-header {
        display: flex !important;
        align-items: center;
        gap: 14px;
        margin-bottom: 16px;
    }

    body { background: #fff; }
    .card { box-shadow: none; }
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 640px) {
    nav { padding: 10px 12px; gap: 10px; }
    .nav-title h1 { font-size: 1.05rem; }
    .school-badge { width: 38px; height: 38px; border-radius: 10px; }
    .badge-initials { font-size: 0.9rem; }
    #day-nav { padding: 10px 14px; flex-wrap: wrap; gap: 8px; }
    #day-nav-left { flex: 1 1 100%; }
    #day-nav-right { flex: 1 1 100%; justify-content: center; }
    #day-nav-left, #day-nav-tags { flex-wrap: wrap; }
    #day-nav-name { font-size: 0.95rem; }
    .day-btn-label { display: none; }
    .day-btn-label { display: none; }
    #main { padding: 12px; }
    .card { padding: 14px; }
    .form-grid { grid-template-columns: 1fr; }
    .sig-grid { grid-template-columns: 1fr; }
}

/* ========================================
   Split Auth Card  (change_password.php)
   ----------------------------------------
   A deliberately horizontal counterpart to the vertical .login-card, so an
   authenticated task is not mistaken for the sign-in screen. Additive only —
   .login-card and the five other pages using it are untouched.
   ======================================== */
.auth-split-wrapper {
    width: 100%;
    max-width: 900px;
    padding: 20px;
}

.auth-split {
    display: grid;
    grid-template-columns: 0.85fr 1fr;
    background: var(--card);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

/* ── Left: brand + context ─────────────────────────────────────────────── */
.auth-brand {
    background: linear-gradient(150deg, var(--navy), var(--blue));
    color: #fff;
    padding: 40px 34px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* The logo artwork is dark navy, so it needs a light chip to sit on. */
.auth-brand-logo {
    background: #fff;
    border-radius: 14px;
    padding: 10px 14px;
    align-self: flex-start;
    margin-bottom: 24px;
    line-height: 0;
}

.auth-brand-logo img {
    max-width: 150px;
    height: auto;
}

.auth-brand h1 {
    margin: 0 0 10px;
    font-size: 1.5rem;
    line-height: 1.25;
    color: #fff;
}

.auth-brand p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.82);
}

.auth-brand-points {
    list-style: none;
    margin: 24px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.auth-brand-points li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.84rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.9);
}

.auth-brand-points svg {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin-top: 1px;
    stroke: var(--gold);
}

/* ── Right: the form ───────────────────────────────────────────────────── */
.auth-form-panel {
    padding: 40px 34px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-form-panel .form-group {
    text-align: left;
    margin-bottom: 16px;
}

/* Room for the reveal button inside the field. */
.auth-field {
    position: relative;
}

.auth-field input {
    padding-right: 3rem;
}

.auth-reveal {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    color: #6b7c93;
    border-radius: 12px;
}

.auth-reveal:hover { color: var(--navy); }

.auth-reveal svg {
    width: 19px;
    height: 19px;
    pointer-events: none;
}

.auth-hint {
    margin: 6px 0 0;
    font-size: 0.76rem;
    line-height: 1.4;
    color: #5f6e84; /* 5.19:1 on white — #6b7c93 measured 4.26 and failed AA */
}

.auth-actions {
    margin-top: 22px;
}

/* The shared .btn is 42px tall; nudge it over the 44px touch minimum here
   rather than changing .btn globally, which every other page depends on. */
.auth-actions .btn {
    min-height: 46px;
}

.auth-cancel {
    display: block;
    margin-top: 4px;
    padding: 14px 8px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--blue);
    text-decoration: none;
}

.auth-cancel:hover { text-decoration: underline; }

/* Keyboard focus must stay obvious on both panels. */
.auth-split a:focus-visible,
.auth-split button:focus-visible,
.auth-split input:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

/* ── Success state ─────────────────────────────────────────────────────── */
.auth-done {
    text-align: center;
}

.auth-done-mark {
    width: 54px;
    height: 54px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: #dff5e5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-done-mark svg {
    width: 27px;
    height: 27px;
    stroke: var(--success);
}

.auth-done h2 {
    margin: 0 0 8px;
    font-size: 1.15rem;
    color: var(--navy);
}

.auth-done p {
    margin: 0 0 22px;
    font-size: 0.88rem;
    line-height: 1.55;
    color: #5f6e84; /* 5.19:1 on white */
}

/* .btn is written for <button>; as an <a> it keeps the underline and baseline
   alignment of a link, so reset both here. */
.auth-done .btn {
    text-decoration: none;
    text-align: center;
    box-sizing: border-box;
}

/* ── Stacked layout on small screens ───────────────────────────────────── */
@media (max-width: 860px) {
    .auth-split {
        grid-template-columns: 1fr;
        border-radius: 22px;
    }

    .auth-brand {
        padding: 30px 26px;
    }

    .auth-brand-logo {
        margin-bottom: 18px;
    }

    /* Supporting copy is reassurance, not instruction — drop it on mobile
       so the fields stay above the fold rather than pushing them down. */
    .auth-brand-points {
        display: none;
    }

    .auth-form-panel {
        padding: 26px 24px 30px;
    }
}

body.dark .auth-split { background: #16202e; }
body.dark .auth-form-panel .auth-hint { color: #94a3b8; }
body.dark .auth-done h2 { color: #eef3fb; }

@media (prefers-reduced-motion: reduce) {
    .auth-split *,
    .auth-split *::before,
    .auth-split *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
