/* Teacher Portal — its own clean UI, separate from the admin pages. */

:root { --tp-navy: #0f1a2e; --tp-blue: #1f5b8a; --tp-deep: #003366; }

.tp-body { margin: 0; background: #f0f4f9; font-family: "Segoe UI", system-ui, sans-serif; color: #1a2d4a; }

/* ── Login ── */
.tp-login-body {
    margin: 0; min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #0f1a2e, #1f5b8a); padding: 20px;
    font-family: "Segoe UI", system-ui, sans-serif;
}
.tp-login-card {
    width: 100%; max-width: 400px; background: #fff; border-radius: 16px;
    padding: 32px 30px; box-shadow: 0 18px 48px rgba(0,0,0,.3);
}
.tp-login-head { text-align: center; margin-bottom: 22px; }
.tp-login-logo { width: 60px; height: 60px; object-fit: contain; border-radius: 10px; margin-bottom: 10px; }
.tp-login-head h1 { margin: 0; font-size: 20px; color: var(--tp-deep); }
.tp-login-head p { margin: 4px 0 0; color: #6c7a8a; font-size: 13px; font-weight: 600; letter-spacing: .5px; }

.tp-login-form { display: flex; flex-direction: column; gap: 14px; }
.tp-field { display: flex; flex-direction: column; gap: 6px; }
.tp-field label { font-size: 12px; font-weight: 700; color: #1a2d4a; text-transform: uppercase; letter-spacing: .4px; }
.tp-field input {
    padding: 11px 13px; border: 1.5px solid #d0dbe8; border-radius: 9px;
    font-size: 14px; color: #1a2d4a;
}
.tp-field input:focus { outline: none; border-color: var(--tp-blue); box-shadow: 0 0 0 3px rgba(31,91,138,.12); }

.tp-login-btn {
    margin-top: 6px; padding: 12px; border: 0; border-radius: 9px;
    background: var(--tp-deep); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer;
}
.tp-login-btn:hover { background: var(--tp-blue); }
.tp-login-note { margin: 16px 0 0; text-align: center; color: #8a9aab; font-size: 12px; }
.tp-login-note a { color: var(--tp-blue); font-weight: 600; }

/* ── Top bar ── */
.tp-topbar {
    display: flex; align-items: center; gap: 20px;
    padding: 10px 22px; background: linear-gradient(135deg, #0f1a2e, #1a2d4a);
    color: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.15); flex-wrap: wrap;
}
.tp-brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; }
.tp-brand-logo { width: 32px; height: 32px; border-radius: 6px; object-fit: contain; background: #fff; padding: 2px; }
.tp-nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.tp-nav a {
    padding: 8px 14px; border-radius: 7px; color: #c5d8eb; text-decoration: none;
    font-size: 14px; font-weight: 600;
}
.tp-nav a:hover, .tp-nav a.active { color: #fff; background: rgba(255,255,255,.12); }
.tp-user { display: flex; align-items: center; gap: 12px; }
.tp-user-name { font-size: 13px; font-weight: 600; color: #c5d8eb; }
.tp-logout {
    padding: 7px 14px; border: 1px solid rgba(255,255,255,.3); border-radius: 7px;
    background: transparent; color: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.tp-logout:hover { background: rgba(255,255,255,.12); }

/* ── Main ── */
.tp-main { width: min(1200px, 100%); margin: 24px auto 48px; padding: 0 18px; }
.tp-page-title { color: var(--tp-deep); font-size: 24px; margin: 0 0 20px; }

.tp-welcome {
    padding: 24px 28px; border-radius: 14px; margin-bottom: 22px;
    background: linear-gradient(120deg, #003366, #1f5b8a); color: #fff;
}
.tp-welcome h1 { margin: 0 0 6px; font-size: 24px; }
.tp-welcome p { margin: 0; color: #cfe3f5; font-size: 14px; }

.tp-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 16px; margin-bottom: 26px; }
.tp-stat {
    padding: 20px; border-radius: 13px; background: #fff; border: 1px solid #e4edf6;
    box-shadow: 0 2px 10px rgba(0,51,102,.05);
}
.tp-stat-label { display: block; color: #6c7a8a; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.tp-stat strong { display: block; margin-top: 6px; font-size: 30px; color: var(--tp-deep); }

.tp-section-title { color: var(--tp-deep); font-size: 17px; margin: 0 0 14px; }
.tp-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 16px; }
.tp-tile {
    display: flex; flex-direction: column; gap: 4px; padding: 20px;
    border-radius: 13px; background: #fff; border: 1px solid #e4edf6;
    text-decoration: none; color: #1a2d4a; transition: transform .12s, box-shadow .12s;
}
.tp-tile:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,51,102,.12); border-color: #c5d5e8; }
.tp-tile span { font-size: 28px; }
.tp-tile strong { color: var(--tp-deep); font-size: 15px; }
.tp-tile small { color: #6c7a8a; font-size: 12px; }

/* ── Tables ── */
.tp-table-wrap { overflow-x: auto; border: 1px solid #d0dce8; border-radius: 11px; background: #fff; }
.tp-routine-table, .tp-students-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tp-routine-table th, .tp-students-table th {
    background: var(--tp-deep); color: #fff; padding: 10px 12px; text-align: left; font-size: 12px; white-space: nowrap;
}
.tp-routine-table td, .tp-students-table td { padding: 9px 12px; border-bottom: 1px solid #eef2f6; }
.tp-students-table tr:hover td { background: #f6fbff; }
.tp-day { font-weight: 700; color: var(--tp-deep); background: #f6f9fc; }
.tp-cell strong { display: block; color: var(--tp-deep); font-size: 13px; }
.tp-cell small { color: #6c7a8a; font-size: 11px; }
.tp-free { color: #cbd5e0; }
.tp-roll { background: #e8f4ff; color: var(--tp-blue); font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 12px; }

/* ── Class tabs & search ── */
.tp-class-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tp-class-tab {
    padding: 8px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    text-decoration: none; border: 1.5px solid #d0dbe8; color: #1a3b55; background: #fff;
}
.tp-class-tab:hover, .tp-class-tab.active { background: var(--tp-deep); color: #fff; border-color: var(--tp-deep); }
.tp-search-bar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.tp-search-bar input {
    flex: 1; min-width: 180px; max-width: 320px; padding: 9px 13px;
    border: 1.5px solid #d0dbe8; border-radius: 8px; font-size: 14px;
}
.tp-search-bar input:focus { outline: none; border-color: var(--tp-blue); }
.tp-btn { padding: 9px 18px; border: 0; border-radius: 8px; background: var(--tp-deep); color: #fff; font-weight: 700; cursor: pointer; }
.tp-btn:hover { background: var(--tp-blue); }
.tp-count { margin: 12px 2px; color: #6c7a8a; font-size: 13px; }

.tp-empty {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    padding: 48px 20px; text-align: center; color: #6c7a8a;
    border: 1px dashed #d0dce8; border-radius: 12px; background: #fff;
}
.tp-empty span { font-size: 36px; }
.tp-empty p { margin: 0; }

/* Hamburger — hidden on desktop */
.tp-nav-toggle {
    display: none;
    width: 42px; height: 38px; padding: 0; margin-left: auto;
    border: 1px solid rgba(255,255,255,.25); border-radius: 8px;
    background: rgba(255,255,255,.08); cursor: pointer;
    flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.tp-nav-toggle span { display: block; width: 20px; height: 2px; background: #c5d8eb; border-radius: 2px; }

@media (max-width: 820px) {
    .tp-nav-toggle { display: flex; }
    .tp-topbar { gap: 10px; flex-wrap: wrap; }
    .tp-brand { margin-right: 0; }
    /* collapsed by default */
    .tp-nav { display: none; order: 4; width: 100%; flex-direction: column; gap: 2px; }
    .tp-user { display: none; order: 5; width: 100%; justify-content: space-between; }
    .tp-topbar.tp-nav-open .tp-nav,
    .tp-topbar.tp-nav-open .tp-user { display: flex; }
    .tp-nav a { padding: 10px 14px; }
}


/* ── Attendance ── */
.tp-att-status {
    padding: 6px 10px; border: 1.5px solid #d0dbe8; border-radius: 7px; font-size: 13px;
    background: #fff; color: #1a2d4a;
}
.tp-att-status:focus { outline: none; border-color: var(--tp-blue); }

/* Present / Absent toggle — two buttons instead of a dropdown */
.tp-pa { display: inline-flex; border: 1.5px solid #d0dbe8; border-radius: 8px; overflow: hidden; }
.tp-pa-btn {
    appearance: none; -webkit-appearance: none; cursor: pointer;
    min-width: 40px; padding: 6px 0; font-size: 14px; font-weight: 800;
    border: none; background: #fff; color: #8698ab; line-height: 1;
    transition: background .12s, color .12s;
}
.tp-pa-btn + .tp-pa-btn { border-left: 1.5px solid #d0dbe8; }
.tp-pa-btn:focus-visible { outline: 2px solid var(--tp-blue); outline-offset: -2px; }
.tp-pa-btn.p.on { background: #1b7a3a; color: #fff; }
.tp-pa-btn.a.on { background: #c0392b; color: #fff; }
.tp-pa-btn:hover:not(.on) { background: #f0f4f9; color: #1a2d4a; }
.tp-att-remarks {
    width: 100%; max-width: 240px; padding: 6px 10px; border: 1.5px solid #d0dbe8;
    border-radius: 7px; font-size: 13px;
}
.tp-att-remarks:focus { outline: none; border-color: var(--tp-blue); }

/* ── Marks entry ── */
.tp-marks-pickers { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 18px; }
.tp-pick { display: flex; flex-direction: column; gap: 5px; }
.tp-pick label { font-size: 12px; font-weight: 700; color: #1a2d4a; text-transform: uppercase; letter-spacing: .4px; }
.tp-pick select {
    min-width: 180px; padding: 9px 12px; border: 1.5px solid #d0dbe8; border-radius: 8px;
    font-size: 14px; background: #fff; color: #1a2d4a;
}
.tp-pick select:focus { outline: none; border-color: var(--tp-blue); }

.tp-marks-info {
    padding: 11px 16px; margin-bottom: 14px; border-radius: 9px;
    background: #eef5fc; border: 1px solid #cfe3f5; color: #1a3b55; font-size: 13px;
}
.tp-marks-info strong { color: var(--tp-deep); }
.tp-autosave-note { margin-left: 10px; color: #6c7a8a; font-style: italic; }

.tp-mark {
    width: 72px; padding: 6px 8px; border: 1.5px solid #d0dbe8; border-radius: 7px;
    font-size: 13px; text-align: center;
}
.tp-mark:focus { outline: none; border-color: var(--tp-blue); box-shadow: 0 0 0 2px rgba(31,91,138,.12); }
.tp-mark:disabled { background: #f0f4f8; color: #b0bbc6; }
.tp-absent { width: 18px; height: 18px; accent-color: var(--tp-deep); }

.tp-save-status { font-size: 12px; font-weight: 600; white-space: nowrap; }
.tp-save-status.saving { color: #d97706; }
.tp-save-status.ok { color: #1b7a3a; }
.tp-save-status.err { color: #c0392b; }


/* ── My Profile ── */
.tp-profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.tp-profile-photo {
    width: 68px; height: 68px; border-radius: 50%; object-fit: cover;
    border: 2px solid #d0dbe8; background: #eaf1f8;
}
.tp-profile-photo.none {
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; font-weight: 800; color: var(--tp-blue);
}
.tp-profile-name { margin: 0; color: var(--tp-deep); font-size: 20px; }
.tp-profile-sub { margin: 2px 0 0; color: #6c7a8a; font-size: 13px; font-weight: 600; }

.tp-profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 820px) { .tp-profile-grid { grid-template-columns: 1fr; } }
.tp-profile-card {
    background: #fff; border: 1px solid #d0dce8; border-radius: 12px; padding: 18px 20px;
}
.tp-profile-card h3 { margin: 0 0 14px; color: var(--tp-deep); font-size: 15px; }
.tp-profile-card h3 small { font-weight: 500; color: #8698ab; font-size: 12px; }

.tp-profile-dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.tp-profile-dl dt { font-size: 12px; font-weight: 700; color: #6c7a8a; }
.tp-profile-dl dd { margin: 0; font-size: 14px; color: #1a2d4a; word-break: break-word; }

.tp-profile-form { display: flex; flex-direction: column; gap: 12px; }
.tp-profile-form select, .tp-profile-form textarea, .tp-profile-form input {
    width: 100%; padding: 10px 12px; border: 1.5px solid #d0dbe8; border-radius: 9px;
    font-size: 14px; color: #1a2d4a; font-family: inherit; box-sizing: border-box;
}
.tp-profile-form select:focus, .tp-profile-form textarea:focus, .tp-profile-form input:focus {
    outline: none; border-color: var(--tp-blue); box-shadow: 0 0 0 3px rgba(31,91,138,.12);
}
.tp-profile-actions { margin-top: 6px; }
.tp-profile-note { margin: 12px 0 0; color: #8698ab; font-size: 12px; }


/* Leave status badges */
.tp-badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.tp-badge.pend { background: #fff6e6; color: #b26a00; border: 1px solid #e0a44a; }
.tp-badge.ok   { background: #e8f6ee; color: #1b7a3a; border: 1px solid #b9e3c8; }
.tp-badge.no   { background: #fdecea; color: #b71c1c; border: 1px solid #f3c2bd; }

/* Holiday page: year picker sits on the right of the welcome banner. */
.tp-welcome { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.tp-year-pick { display: flex; align-items: center; gap: 8px; margin: 0; }
.tp-year-pick label { color: #cfe3f5; font-size: 13px; font-weight: 600; }
.tp-year-pick select {
    padding: 7px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,.4);
    background: rgba(255,255,255,.12); color: #fff; font-size: 14px;
}
.tp-year-pick select option { color: #1a2d4a; }

/* Small inline label used for "Vacation" on a holiday row. */
.tp-chip {
    display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px;
    font-size: 11px; font-weight: 700; background: #fff3dc; color: #8a5a00;
}

/* ── Routine sheet: the week as the office prints it ── */
.tp-sheet { margin-bottom: 22px; }
.tp-sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.tp-sheet-head h2, .tp-sheet-sub { margin: 0; font-size: 16px; color: #1a3b55; }
.tp-sheet-sub { margin: 0 0 10px; }
.tp-sheet-head a {
    padding: 8px 14px; border-radius: 8px; background: #1a3b55; color: #fff;
    text-decoration: none; font-size: 13px; font-weight: 700;
}
.tp-sheet img, .rs-sheet img {
    display: block; width: 100%; height: auto; border-radius: 10px;
    border: 1px solid #dfe7ef; background: #fff; box-shadow: 0 4px 14px rgba(20, 40, 70, .08);
}
