/* Frontistirio -- πρώτη κάθετη αποδειξη (login + TEACHER dashboard).
   Vanilla CSS, κανένα framework -- βλ. NOTES_ENVIRONMENT.md για το γιατί. */

:root {
    /* Brand palette -- matches the "Επίπεδο" logo exactly:
       #117CA4 (wordmark teal), #82BED3 (diamond accent),
       #8B8B8B / #BBBBBB (the two cube grays). Semantic colors
       (danger/success/warning below) are left as plain red/green/
       amber on purpose -- those follow universal UX convention and
       aren't part of the brand identity. */
    --color-surface: #ffffff;
    --color-border: #d3d3d3;
    --color-text: #1c2b33;
    --color-text-muted: #767676;
    --color-primary: #117ca4;
    --color-primary-dark: #0d6180;
    --color-accent: #82bed3;
    --color-accent-bg: #f2f8fb;
    --color-gray: #8b8b8b;
    --color-gray-bg: #e0e0e0;
    --color-gray-bg-hover: #d6d6d6;
    --color-gray-border: #cccccc;
    --color-danger: #d33a3a;
    --color-danger-bg: #fdecec;
    --color-success: #1f8a4c;
    --color-success-bg: #e9f7ef;
    --color-warning-bg: #fff6e0;
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    /* A seamlessly-tiling grid of small, evenly-spaced, same-size dots in
       the logo's two blue tones over white, each with a soft drop
       shadow -- applied site-wide. The outer SVG tile is 402x402 (3px
       dot spacing); internally it only authors one small 60x60 repeat
       unit and lets SVG's native <pattern> tiling fill the rest, which
       is what keeps the file small despite the density. background-
       repeat tiles the outer SVG edge-to-edge with no seam, so every dot
       everywhere on the page is the same size and equally spaced from
       its neighbors, at any viewport size. background-attachment: fixed
       keeps the grid anchored to the window instead of the page, so it
       doesn't shift as content scrolls. See images/bg-dots.svg. */
    background-color: #ffffff;
    background-image: url("/images/bg-dots.svg");
    background-repeat: repeat;
    background-attachment: fixed;
    color: var(--color-text);
}

a {
    color: var(--color-primary);
}

/* ---------- Login page ---------- */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.login-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 32px;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.login-card h1 {
    font-size: 1.3rem;
    margin: 0 0 4px;
}

.login-card p.subtitle {
    margin: 0 0 24px;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* task #159, George: "Ξέχασα το όνομα χρήστη / τον κωδικό μου" link on
   the login page -- toggles a small info box (js/login.js) explaining
   the process and the frontistirio's phone number. */
.forgot-link {
    text-align: center;
    margin: 16px 0 0;
    font-size: 0.85rem;
}

.forgot-link a {
    color: var(--color-primary);
    text-decoration: none;
}

.forgot-link a:hover {
    text-decoration: underline;
}

#forgot-info {
    margin-top: 12px;
}

#forgot-info p {
    margin: 0 0 10px;
    text-align: justify;
}

#forgot-info p:last-child {
    margin-bottom: 0;
}

/* ---------- Forms ---------- */

.field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--color-surface);
    color: var(--color-text);
}

.field textarea {
    resize: vertical;
    min-height: 60px;
}

/* George: "Δεν φαίνεται το checkbox" -- the "Επανάληψη – Εισαγωγικές
   γνώσεις" checkbox (create-topic-form in admin-dashboard.html/super-
   admin-dashboard.html, and the curriculum-topic inline-edit row built by
   js/admin-catalog.js) is the first actual <input type="checkbox"> inside
   a .field anywhere in this app -- every prior .field input has been a
   text/number/date field, so the `.field input { width:100%; padding:9px
   10px; border:1px solid ...}` rule above, meant for those, was silently
   also stretching the checkbox itself into a large, blank, unrecognizable
   box (no visible tick square at all) instead of leaving it at its normal
   small native size. This override, being more specific than the plain
   `.field input` selector, wins regardless of source order and restores
   the checkbox's normal appearance -- every other .field input is
   unaffected. */
.field input[type="checkbox"] {
    width: auto;
    height: auto;
    padding: 0;
    border: none;
    vertical-align: middle;
    margin: 0 6px 0 0;
}

button {
    font-family: inherit;
    cursor: pointer;
}

/* George (μορφοποίηση κουμπιών, επιλογή C «Στρογγυλά»): κουμπιά-«χάπια»
   όπως τα κουμπιά των παιδιών στον γονέα, ίδια χρώματα με πριν (μπλε του
   λογότυπου). Ένα ύψος ανά μέγεθος (κανονικό ~36px, μικρό 30px, εικονίδιο
   30×30 στρογγυλό), ώστε μπλε και λευκά δίπλα-δίπλα να ευθυγραμμίζονται. */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s, color 0.15s, transform 0.05s;
}

.btn:hover:not(:disabled) {
    background: var(--color-primary-dark);
    box-shadow: 0 3px 8px rgba(13, 97, 128, 0.25);
}

.btn:active:not(:disabled) {
    transform: translateY(1px);
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(17, 124, 164, 0.28);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn.btn-block {
    width: 100%;
}

.btn.btn-secondary {
    background: #fff;
    color: var(--color-text);
    border-color: #cfd8de;
    box-shadow: none;
}

.btn.btn-secondary:hover:not(:disabled) {
    background: var(--color-accent-bg);
    border-color: var(--color-primary);
    color: var(--color-primary-dark);
    box-shadow: none;
}

.btn.btn-small {
    padding: 5px 12px;
    min-height: 30px;
    font-size: 0.82rem;
}

/* Κουμπί-εικονίδιο (✏️ 📥 🔑 🗑️ …): ΕΝΑ μέγεθος παντού, στρογγυλό 30×30.
   Συνοδεύεται πάντα από btn-secondary btn-small. */
.btn.btn-icon {
    width: 30px;
    height: 30px;
    min-height: 30px;
    padding: 0;
    border-radius: 50%;
    font-size: 0.95rem;
    line-height: 1;
}

/* Μόνο για τις πραγματικά μη αναστρέψιμες ενέργειες (π.χ. οριστική διαγραφή). */
.btn.btn-danger {
    background: #fff;
    color: #b3261e;
    border-color: #efb3b0;
    box-shadow: none;
}

.btn.btn-danger:hover:not(:disabled) {
    background: #b3261e;
    border-color: #b3261e;
    color: #fff;
}

/* Κουμπιά κεφαλίδας 🔔 ✉ 📢 👤 */
.btn.btn-notifications {
    background: #fff;
    color: var(--color-primary);
    border-color: #9cc5d6;
    box-shadow: none;
}

.btn.btn-notifications:hover:not(:disabled) {
    background: var(--color-accent-bg);
    border-color: var(--color-primary);
    color: var(--color-primary-dark);
    box-shadow: none;
}

/* ---------- Alerts ---------- */

.alert {
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 0.88rem;
    margin-bottom: 16px;
}

.alert-error {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

.alert-success {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.alert-info {
    background: var(--color-warning-bg);
    color: #8a6d1f;
}

/* George: Caps Lock warning on the login page's password fields (see
   login.html/js/login.js) -- same .alert-info amber look, just tightened
   up since it sits directly under a field that already has its own
   bottom margin, instead of standing alone like a normal page-level
   alert. */
.caps-lock-warning {
    margin: 8px 0 0;
    font-size: 0.82rem;
    padding: 6px 10px;
}

[hidden] {
    display: none !important;
}

/* ---------- Dashboard shell ---------- */

.app-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.app-header .brand {
    font-weight: 700;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
}

/* task #148, George: "Θέλω αυτό το logo να τοποθετηθεί σε κάθε header
   στα αριστερά αντί της λέξης Frontistirio" -- the "Επίπεδο eclass"
   logo (images/logo-epipedo.png) replaces the plain-text "Frontistirio"
   brand in every dashboard's .app-header, left-aligned as before.
   height caps it to a sane header size regardless of the source image's
   own resolution; width:auto keeps its aspect ratio.
   task #151 follow-up, George: "Μπορούμε να μεγαλώσουμε λίγο το logo?"
   -- bumped from 36px to 44px (still comfortably inside .app-header's
   own 12px top/bottom padding). */
.app-header .brand-logo {
    height: 44px;
    width: auto;
    display: block;
}

/* Same swap on the login page's card title, which isn't inside
   .app-header (different layout: centered card, not a left/right bar)
   but still literally showed the word "Frontistirio".
   task #151 follow-up: bumped from 48px to 60px alongside the header
   logo, same reasoning. */
.login-card .brand-logo {
    height: 60px;
    width: auto;
    display: block;
    margin: 0 auto 4px;
}

.app-header .user-info {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.app-nav {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 0 24px;
    /* George (screenshot, admin): το μενού έβγαινε από τα όρια της οθόνης και
       κυλούσε οριζόντια· τώρα τα κουμπιά περνούν σε δεύτερη γραμμή όταν δεν
       χωράνε, ώστε να φαίνονται πάντα όλα. */
    flex-wrap: wrap;
}

.app-nav button {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 12px 14px;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.app-nav button:hover:not(.active) {
    background: var(--color-gray-bg);
    color: var(--color-text);
}

.app-nav button.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    font-weight: 600;
}

/* Second-level nav row for a category's individual tabs (see
   super-admin-dashboard.html, task #117) -- visually a notch smaller
   and tinted, so it reads as "inside" the category above it rather than
   a second identical-looking menu. */
.app-nav.sub-app-nav {
    background: var(--color-accent-bg);
    gap: 2px;
    /* George (screenshot, Εποπτεία): με 8 υπομενού η γραμμή κόβονταν και
       κυλούσε οριζόντια· τώρα τα κουμπιά περνούν σε δεύτερη γραμμή αν δεν
       χωράνε, ώστε να φαίνονται πάντα όλα (και μένουν κεντραρισμένα). */
    flex-wrap: wrap;
    overflow-x: visible;
    padding: 0 12px;
}

.app-nav.sub-app-nav button {
    padding: 8px 8px;
    font-size: 0.8rem;
}

/* George (screenshot): sub-menu strips with 6-7 tabs did not fit in the
   old 960px frame -- widened to 1040px (still centred; narrower screens
   simply use the available width, and the strips wrap if needed). */
.app-main {
    max-width: 1040px;
    margin: 0 auto;
    padding: 24px;
}

/* George (Μελέτη μαθητή/γονέα → Διαγωνίσματα): πίνακες με πολλές στήλες
   παίρνουν φαρδύτερο πλαίσιο. Ισχύει για όποια καρτέλα έχει data-wide. */
.app-main:has(> .tab-panel[data-wide]:not([hidden])) {
    max-width: 1280px;
}

/* George (screenshot, Ύλη ανά Μάθημα/Τάξη): "μπορούμε να μειώσουμε την
   απόσταση από το header για να μην συμβαίνει αυτό" -- the Δομικά
   Στοιχεία sub-tab strip (Παραρτήματα/Σχολικά Έτη/Βαθμίδες/Μαθήματα/Ύλη
   ανά Μάθημα/Τάξη -- #catalog-subnav) wraps its <nav> in a full .panel,
   which stacked that panel's normal 20px padding + 20px margin-bottom on
   top of the <nav>'s own 16px margin, pushing every catalog sub-tab's
   FIRST panel (e.g. "Επιλογή μαθήματος/βαθμίδας", with its "Μάθημα"/
   "Βαθμίδα" <select>s) unusually far down the page. On a shorter browser
   window that left those <select>s too low for their (long) option
   lists to fit below, so the browser flipped them upward instead of
   opening down -- native <select> behavior that can't be controlled
   directly, but reducing this dead space gives it far more room to open
   downward like normal. The exact same wrap-a-<nav>-in-a-.panel pattern
   turned out to be used by three other sub-tab strips too (#content-
   subnav, #monitoring-subnav, #messages-subnav), with the identical
   excess spacing -- all four now share this same `panel-subnav` class
   (added alongside `panel` on each one's wrapping <div>, in both
   admin-dashboard.html and super-admin-dashboard.html) for consistency,
   rather than fixing only the one screen George happened to notice it
   on. This is its own class, NOT a change to `.panel` itself, so every
   OTHER panel in the app (the large majority) is unaffected. */
.panel.panel-subnav {
    padding: 8px 20px;
    margin-bottom: 10px;
}

/* George (screenshot, Εποπτεία Τάξης / Εποπτεία Τμημάτων): "Δεν φαίνονται
   όλα τα υπομενού" -- with 6-7 sub-tabs the strip overflowed and hid the
   rest behind a horizontal scrollbar. Inside a .panel-subnav the buttons
   now wrap onto a second row instead, so every sub-menu is always
   visible. The top-level .app-nav keeps its normal scrolling behaviour. */
.panel-subnav > .app-nav {
    flex-wrap: wrap;
    overflow-x: visible;
    justify-content: flex-start;
    padding: 0;
    border-bottom: none;
}

.panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.panel h2 {
    margin-top: 0;
    font-size: 1.1rem;
}

.panel h3 {
    font-size: 0.95rem;
    margin: 18px 0 8px;
}

/* ---------- Tables / lists ---------- */

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th, td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--color-border);
}

th {
    color: var(--color-text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

tr:last-child td {
    border-bottom: none;
}

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-PRESENT { background: var(--color-success-bg); color: var(--color-success); }
.status-ABSENT  { background: var(--color-danger-bg); color: var(--color-danger); }
.status-LATE    { background: var(--color-warning-bg); color: #8a6d1f; }
.status-EXCUSED { background: var(--color-gray-bg); color: var(--color-text); }

.muted {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border);
}

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

.list-item.unread {
    background: var(--color-accent-bg);
    margin: 0 -20px;
    padding: 10px 20px;
}

/* task #183: same "unread" background highlight as .list-item.unread
   above, for a plain <tr> in a <table> (super-admin-announcements.js) --
   a separate rule because .list-item.unread requires the .list-item
   class too, and a table row is not one. */
tr.unread-row {
    background: var(--color-accent-bg);
}

/* George: "Μπορούμε να βάλουμε εισαγωγικές γνώσεις (ένθετο) για κάθε
   κεφάλαιο αν υπάρχουν?" -- a Υποενότητα marked is_introductory
   (js/admin-catalog.js's Ύλη ανά Μάθημα/Τάξη sub-tab; displayed as
   "Υποενότητα" since George's later rename of Ενότητα -> Υποενότητα)
   gets the same highlighted background as tr.unread-row above, so it
   visually reads as an "ένθετο" (inset) set apart from that chapter's
   ordinary, numbered Υποενότητες -- reuses the same token rather than
   introducing a second highlight color for what is, visually, the same
   kind of "this row is different" callout. */
tr.introductory-row {
    background: var(--color-accent-bg);
}

.badge-count {
    background: var(--color-danger);
    color: #fff;
    border-radius: 999px;
    font-size: 0.72rem;
    padding: 1px 7px;
    margin-left: 4px;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.score-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
    gap: 12px;
}

/* George: "Γίνεται να μπορώ να δημιουργήσω προς εκτύπωση ένα report για
   την ύλη ενός μαθήματος?" -- #print-report is filled by
   js/admin-catalog.js's print-curriculum-btn handler and is otherwise
   never shown on screen. The @media print block below removes every
   other top-level element from the page ENTIRELY (display:none, not
   just visibility:hidden -- a visibility-only hide still occupies its
   full layout height, which was making the print/"Save as PDF" output
   paginate through the whole hidden dashboard's height and show extra
   blank pages after the report, per George: "μου εμφανίζει περισσότερες
   σελίδες (κενές σελίδες) από ότι χρειάζεται". display:none collapses
   that height to zero, so only #print-report's own (short) content
   determines the page count. This only ever applies during printing,
   so it never disturbs the on-screen app layout. */
@media print {
    body > *:not(#print-report) {
        display: none !important;
    }
}

#print-report {
    display: none;
}

@media print {
    #print-report {
        display: block;
    }
}

#print-report h1 {
    font-size: 1.4rem;
    margin: 0 0 4px;
}

#print-report .print-date {
    color: #555;
    font-size: 0.85rem;
    margin-bottom: 18px;
}

/* One block per Βιβλίο (or, when a course/grade level has no Βιβλία at
   all, per Ενότητα, or the whole flat chapter list -- js/admin-catalog.js
   picks whichever nesting actually applies, same fallback logic as the
   on-screen Ύλη table). page-break-inside:avoid keeps a short group's
   heading from being stranded alone at the bottom of a printed page. */
#print-report .print-group {
    margin-bottom: 18px;
}

#print-report .print-group > h3 {
    font-size: 1.15rem;
    background: #eef1f5;
    padding: 6px 10px;
    margin: 0 0 8px;
    page-break-inside: avoid;
    page-break-after: avoid;
}

#print-report .print-part {
    margin: 0 0 14px 12px;
}

#print-report .print-part > h4 {
    font-size: 1rem;
    margin: 0 0 6px;
    page-break-inside: avoid;
    page-break-after: avoid;
}

#print-report .print-topic {
    margin: 0 0 10px 12px;
    page-break-inside: avoid;
}

#print-report .print-topic-title {
    font-size: 0.95rem;
}

#print-report .print-sections {
    margin: 6px 0 0 18px;
    padding: 0;
    list-style: none;
}

#print-report .print-sections li {
    margin-bottom: 6px;
    page-break-inside: avoid;
}

#print-report .print-section-title {
    font-size: 0.9rem;
}

/* George, Ενότητες: "ένα ακόμα πλαίσιο κειμένου το οποίο θα αφορά τυχόν
   μέρη της ενότητας που είναι εκτός ύλης" -- same out_of_syllabus_notes
   field as the on-screen Υποενότητες editor, printed here too since
   George asked for "πλήρη στοιχεία" in the report. */
#print-report .print-desc,
#print-report .print-out-of-syllabus {
    font-size: 0.85rem;
    color: #444;
    margin: 2px 0 0 2px;
    white-space: pre-wrap;
}

#print-report .print-out-of-syllabus {
    font-style: italic;
}

/* George: τακτικά με δείκτη (1<sup>ο</sup> τετράμηνο) -- το line-height:0
   κρατά το ύψος της γραμμής ίδιο, ώστε τα labels/κεφαλίδες που έχουν
   δείκτη να μην ανεβαίνουν/κατεβαίνουν σε σχέση με τα διπλανά τους. */
sup {
    line-height: 0;
}

/* George (ανασχεδιασμός μενού super admin): τρίτη γραμμή πλοήγησης -- οι
   καρτέλες μιας ενότητας (π.χ. Διαχείριση Λογαριασμών → Διαχειριστές,
   Εκπαιδευτικοί...) κάτω από τη γραμμή των ενοτήτων. Λευκό φόντο και λίγο
   μικρότερα γράμματα ώστε να διαβάζεται ως «μέσα» στη γραμμή από πάνω. */
.app-nav.sub-app-nav-2 {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
}

.app-nav.sub-app-nav-2 button {
    padding: 6px 12px;
    font-size: 0.78rem;
}

/* George (screenshot, Εποπτεία): η τρίτη γραμμή πλοήγησης (Επισκόπηση
   τάξης, Στατιστικά τάξης...) ήταν κάρτα με απόσταση από τη γραμμή πάνω
   της, ενώ στα Στοιχεία Φροντιστηρίου είναι κολλημένη. Στο super admin
   (όπου υπάρχει .sub-app-nav) οι καρτέλες αυτές εμφανίζονται πλέον ως
   ίδια ολόκληρη λωρίδα, κολλημένη κάτω από τη γραμμή των υπομενού, με το
   ίδιο μέγεθος γραμμάτων όπως η .sub-app-nav-2. Το dashboard του admin δεν
   επηρεάζεται. */
body { overflow-x: hidden; }

.sub-app-nav ~ .app-main > .tab-panel > .panel-subnav:first-child {
    margin: -24px calc(50% - 50vw) 24px;
    padding: 0 24px;
    border-radius: 0;
    border-width: 0 0 1px 0;
    box-shadow: none;
}

.sub-app-nav ~ .app-main .panel-subnav > .app-nav {
    justify-content: center;
}

.sub-app-nav ~ .app-main .panel-subnav > .app-nav button {
    padding: 6px 12px;
    font-size: 0.78rem;
}

/* George: παράθυρο στοιχείων λογαριασμού μετά τη δημιουργία, με εκτύπωση
   (js/account-credentials.js). Το φύλλο εκτύπωσης μπαίνει στο #print-report
   (βλ. @media print παραπάνω). */
.cred-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 30, 40, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 2000;
}

.cred-card {
    background: var(--color-surface, #fff);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    padding: 24px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
}

.cred-card h2 {
    margin: 0 0 14px;
    font-size: 1.2rem;
}

.cred-table {
    width: 100%;
    border-collapse: collapse;
}

.cred-table td {
    padding: 8px 6px;
    border-bottom: 1px solid var(--color-border, #d3d3d3);
    vertical-align: middle;
    text-transform: none;
}

.cred-table td.cred-label {
    width: 42%;
    color: var(--color-text-muted, #555);
    font-size: 0.9rem;
}

.cred-secret {
    font-family: Consolas, "Courier New", monospace;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: var(--color-accent-bg, #f2f8fb);
    padding: 3px 8px;
    border-radius: 6px;
    user-select: all;
    word-break: break-all;
}

.cred-warning {
    background: var(--color-warning-bg, #fff6e0);
    border-radius: 8px;
    padding: 10px 12px;
    margin: 14px 0 0;
    font-size: 0.9rem;
}

.cred-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 18px;
}

#print-report .cred-sheet {
    max-width: 640px;
    margin: 0 auto;
}

#print-report .cred-logo {
    height: 64px;
    margin-bottom: 10px;
}

#print-report .cred-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #999;
    font-size: 1.05rem;
}

#print-report .cred-table td.cred-label {
    color: #333;
    font-size: 0.95rem;
}

#print-report .cred-secret {
    background: none;
    padding: 0;
    font-size: 1.2rem;
}

#print-report .cred-print-note {
    margin-top: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ── Κάρτες επιλογής (George: "Κάρτες αντί για σκόρπια checkboxes σε λίστες,
   καθολικά στην εφαρμογή"). Κάθε λίστα επιλογής (μαθητές, τμήματα, ώρες,
   επίπεδα τάξεων…) είναι ένα πλέγμα `.pick-grid` από `label.pick-card` που
   περιέχουν ένα checkbox. Η κάρτα φωτίζεται όταν είναι τσεκαρισμένη
   (:has) και γκριζάρει όταν το checkbox είναι disabled. Το δεύτερο, πιο
   αχνό κείμενο μπαίνει σε `<span class="pick-sub">`. ── */
.pick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr));
    gap: 8px;
    margin-bottom: 8px;
}

.pick-grid.pick-grid-wide {
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
}

.pick-grid.pick-scroll {
    max-height: 320px;
    overflow: auto;
    padding: 2px;
}

label.pick-card,
.field label.pick-card {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 8px 10px;
    border: 1px solid #cfd6dc;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.3;
}

label.pick-card:hover {
    border-color: #117ca4;
}

label.pick-card:has(input:checked) {
    background: #e3f1f7;
    border-color: #117ca4;
}

label.pick-card:has(input:disabled) {
    background: #f5f6f7;
    border-color: #e1e5e8;
    color: #7a828a;
    cursor: not-allowed;
}

label.pick-card input[type="checkbox"],
.field label.pick-card input[type="checkbox"] {
    flex: none;
    width: auto;
    margin: 0;
}

label.pick-card .pick-sub {
    display: block;
    font-size: 0.8rem;
    color: #667;
}

/* George (μορφοποίηση, 1β): καρτέλες ΜΕΣΑ σε μια οθόνη (αλλαγή «προβολής»,
   π.χ. Επισκόπηση | Τεστ | Διαγωνίσματα στα Στατιστικά, Διαγωνίσματα |
   Online τεστ | Αξιολογήσεις στις Βαθμολογίες, Σειρά διδασκαλίας | Όλη η
   ύλη) = «διακόπτης», ίδιο στυλ με το «Όλες | Αδιάβαστες» των Μηνυμάτων.
   Έτσι δεν μοιάζουν με τα μενού και δεν είναι μεγαλύτερες από αυτά. */
.app-nav.view-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0;
    padding: 0;
    background: #fff;
    border: 1px solid var(--color-border, #d5dde3);
    border-radius: 8px;
    overflow: hidden;
    max-width: 100%;
}
.app-nav.view-tabs button {
    border: 0;
    border-right: 1px solid var(--color-border, #d5dde3);
    border-bottom: 0;
    padding: 6px 14px;
    font-size: 0.85rem;
    color: #33414a;
    background: #fff;
}
.app-nav.view-tabs button:last-child {
    border-right: 0;
}
.app-nav.view-tabs button:hover:not(.active) {
    background: #f2f8fb;
    color: #33414a;
}
.app-nav.view-tabs button.active {
    background: var(--color-primary);
    color: #fff;
    font-weight: 600;
    border-bottom: 0;
}

/* George (μορφοποίηση εικονιδίων, επιλογή D «Γραμμικά με χρώμα σημασίας»):
   δικά μας γραμμικά εικονίδια (js/icons.js αντικαθιστά τα emoji). Μπλε του
   λογοτύπου παντού· μέσα σε μπλε κουμπιά λευκά· σε έγχρωμο κείμενο (ειδοποίηση,
   ετικέτα κατάστασης, κόκκινος τίτλος) παίρνουν το χρώμα του κειμένου. */
.ic {
    width: 1.1em;
    height: 1.1em;
    flex: 0 0 auto;
    vertical-align: -0.18em;
    color: var(--color-primary);
}
.btn .ic,
.btn.btn-icon .ic,
.btn.btn-notifications .ic {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}
.btn:not(.btn-secondary):not(.btn-notifications) .ic,
.btn:not(.btn-secondary):not(.btn-notifications):hover .ic,
.alert .ic,
.status-badge .ic,
.badge .ic,
[style*="color:"] > .ic,
[style*="color :"] > .ic {
    color: currentColor;
}
/* χρώμα σημασίας μέσα στα λευκά κουμπιά */
.btn.btn-secondary .ic-trash,
.btn.btn-secondary .ic-x,
.btn.btn-secondary .ic-xcircle,
.btn.btn-secondary .ic-ban {
    color: #b3261e;
}
.btn.btn-secondary .ic-archive,
.btn.btn-secondary .ic-lock,
.btn.btn-secondary .ic-pause {
    color: #b26a00;
}
.btn.btn-secondary .ic-check,
.btn.btn-secondary .ic-checkcircle,
.btn.btn-secondary .ic-publish,
.btn.btn-secondary .ic-restore {
    color: #1b7a3a;
}
/* εικονίδια με δικό τους χρώμα σημασίας (εκτός αν το κείμενο γύρω έχει χρώμα) */
.ic-alert,
.ic-trenddown {
    color: #b3261e;
}
.ic-warning {
    color: #b26a00;
}
/* πεδίο αναζήτησης: φακός ως φόντο (js/icons.js) */
input.has-search-ic {
    padding-left: 32px !important;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23117ca4' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-5-5'/%3E%3C/svg%3E") no-repeat 10px center / 16px 16px;
}

/* ── George (μορφοποίηση, λίστες επιλογής & κουτάκια, επιλογή A «Στρογγυλά»):
   λίστες-«χάπια» με μπλε βελάκι, ίδιο ύψος με τα κουμπιά· πεδία με
   στρογγυλεμένες γωνίες· κουτάκια με στρογγυλεμένες γωνίες, μπλε με λευκό ✓
   όταν τσεκάρονται· κουκκίδες (radio) με μπλε κέντρο. Μπλε περίγραμμα
   «εστίασης» σε κάθε πεδίο. ── */
select:not([multiple]):not([size]) {
    -webkit-appearance: none;
    appearance: none;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23117ca4' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 14px 14px;
    border: 1px solid #cfd8de;
    border-radius: 999px;
    padding: 6px 32px 6px 12px;
    min-height: 32px;
    max-width: 100%;
    font: inherit;
    font-size: 0.88rem;
    color: var(--color-text);
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.field select:not([multiple]):not([size]) {
    width: 100%;
    padding: 9px 34px 9px 12px;
    min-height: 38px;
    font-size: 0.95rem;
    border-radius: 10px;
    background-position: right 12px center;
}
select:not([multiple]):not([size]):hover:not(:disabled) {
    border-color: var(--color-primary);
}
select:disabled {
    background-color: #f3f5f7;
    color: var(--color-text-muted);
    cursor: not-allowed;
}

.field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.field textarea {
    border-color: #cfd8de;
    border-radius: 10px;
}
input[type="text"]:not(.field input),
input[type="search"]:not(.field input),
input[type="number"]:not(.field input),
input[type="date"]:not(.field input),
input[type="datetime-local"]:not(.field input),
input[type="time"]:not(.field input),
input[type="email"]:not(.field input),
input[type="tel"]:not(.field input),
input[type="password"]:not(.field input),
input:not([type]):not(.field input),
textarea:not(.field textarea) {
    border: 1px solid #cfd8de;
    border-radius: 8px;
    padding: 5px 9px;
    font: inherit;
    font-size: 0.9rem;
    background-color: #fff;
    color: var(--color-text);
}
select:focus,
input:not([type="checkbox"]):not([type="radio"]):focus,
textarea:focus {
    outline: none;
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 3px rgba(17, 124, 164, 0.22);
}

input[type="checkbox"],
input[type="radio"] {
    -webkit-appearance: none;
    appearance: none;
    display: inline-block;
    flex: none;
    width: 18px !important;
    height: 18px !important;
    margin: 0 6px 0 0;
    padding: 0 !important;
    border: 1.5px solid #8fb9cb !important;
    background: #fff;
    vertical-align: -4px;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
input[type="checkbox"] {
    border-radius: 5px;
}
input[type="radio"] {
    border-radius: 50%;
}
input[type="checkbox"]:hover:not(:disabled),
input[type="radio"]:hover:not(:disabled) {
    border-color: var(--color-primary) !important;
}
input[type="checkbox"]:checked {
    background: var(--color-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") no-repeat center / 13px 13px;
    border-color: var(--color-primary) !important;
}
input[type="radio"]:checked {
    background: var(--color-primary);
    border-color: var(--color-primary) !important;
    box-shadow: inset 0 0 0 4px #fff;
}
input[type="checkbox"]:disabled,
input[type="radio"]:disabled {
    background-color: #eef1f4;
    border-color: #d5dbe0 !important;
    cursor: not-allowed;
}
input[type="checkbox"]:checked:disabled {
    background-color: #9fbfcd;
}
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
    box-shadow: 0 0 0 3px rgba(17, 124, 164, 0.25);
}
label.pick-card input[type="checkbox"],
.field label.pick-card input[type="checkbox"] {
    margin: 0;
}
input[type="radio"]:checked:focus-visible {
    box-shadow: inset 0 0 0 4px #fff, 0 0 0 3px rgba(17, 124, 164, 0.25);
}


/* ============================================================
   §76 Συγκαταθέσεις (js/consent.js)
   ============================================================ */
.cs-strip{display:flex;align-items:center;gap:10px;flex-wrap:wrap;border-radius:8px;padding:10px 14px;margin-top:12px;font-size:.92rem}
.cs-ok{background:var(--color-success-bg);border:1px solid #b9e2c8}
.cs-no{background:var(--color-warning-bg);border:1px solid #f0d58c}
.cs-strip .grow,.cs-card .grow{flex:1;min-width:220px}
.cs-card{border:1px solid var(--color-border);border-radius:8px;padding:12px 14px;margin:10px 0;display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.cs-pill{display:inline-block;border-radius:999px;padding:1px 10px;font-size:.8rem;font-weight:600}
.cs-pill.ok{background:var(--color-success-bg);color:var(--color-success)}
.cs-pill.no{background:var(--color-warning-bg);color:#8a5a00}
.cs-pill.wd{background:var(--color-danger-bg);color:var(--color-danger)}
.cs-text{background:var(--color-accent-bg);border-radius:6px;padding:9px 12px;font-size:.9rem;line-height:1.5}
.cs-check{display:flex;gap:8px;align-items:flex-start;margin:8px 0}
.cs-check input{margin-top:3px}
.cs-hist{width:100%;border-collapse:collapse;font-size:.86rem;margin-top:6px}
.cs-hist td,.cs-hist th{border-bottom:1px solid var(--color-border);padding:4px 6px;text-align:left;vertical-align:top}
.cs-hist th{color:var(--color-text-muted);font-weight:600}
.cs-overlay .cred-card h2{font-size:1.1rem}


/* ============================================================
   Κινητό (George: «Το eclass είναι responsive?» → μαθητής & γονέας
   πρώτα). Οι κανόνες ισχύουν σε πλάτος έως 700px· στον υπολογιστή δεν
   αλλάζει τίποτα. Οι πίνακες τυλίγονται σε .table-scroll (js/responsive.js)
   και σέρνονται οριζόντια μέσα στην κάρτα, όχι όλη η σελίδα.
   ============================================================ */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

@media (max-width: 700px) {
    /* Κεφαλίδα: λογότυπο αριστερά, στρογγυλά εικονίδια δεξιά· το όνομα
       χρήστη κρύβεται (φαίνεται στο «Το προφίλ μου») */
    .app-header {
        padding: 6px 10px;
        gap: 8px;
    }
    .app-header .brand-logo {
        height: 32px;
    }
    .app-header .user-info {
        gap: 6px;
        min-width: 0;
    }
    #user-label {
        display: none;
    }
    .app-header .btn.btn-notifications,
    .app-header #logout-btn {
        position: relative;
        width: 36px;
        height: 36px;
        min-height: 36px;
        padding: 0;
        border-radius: 50%;
        flex: none;
    }
    .app-header .badge-count {
        position: absolute;
        top: -6px;
        right: -7px;
        margin: 0;
        min-width: 18px;
        padding: 0 5px;
        line-height: 18px;
        font-size: 0.66rem;
        text-align: center;
        box-shadow: 0 0 0 2px #fff;
    }
    /* «Αποσύνδεση» γίνεται εικονίδιο (πόρτα με βέλος) */
    .app-header #logout-btn {
        font-size: 0;
        color: var(--color-text-muted);
    }
    .app-header #logout-btn::before {
        content: "";
        width: 17px;
        height: 17px;
        background: currentColor;
        -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 4h4v16h-4'/%3E%3Cpath d='M10 17l5-5-5-5'/%3E%3Cpath d='M15 12H3'/%3E%3C/svg%3E") center / contain no-repeat;
        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 4h4v16h-4'/%3E%3Cpath d='M10 17l5-5-5-5'/%3E%3Cpath d='M15 12H3'/%3E%3C/svg%3E") center / contain no-repeat;
    }

    /* Μενού: πιο σφιχτά, ώστε να χωρούν σε 1–2 γραμμές */
    .app-nav {
        padding: 0 4px;
        gap: 0;
    }
    .app-nav button {
        padding: 10px 7px;
        font-size: 0.84rem;
    }
    .app-nav.sub-app-nav {
        padding: 0 4px;
    }
    .app-nav.sub-app-nav button {
        padding: 8px 7px;
    }

    /* Περιεχόμενο */
    .app-main {
        padding: 12px 10px;
    }
    .panel {
        padding: 14px 12px;
        margin-bottom: 14px;
    }
    .panel h2 {
        font-size: 1.02rem;
    }
    .list-item.unread {
        margin: 0 -12px;
        padding: 10px 12px;
    }
    .sub-app-nav ~ .app-main > .tab-panel > .panel-subnav:first-child {
        margin-top: -12px;
        margin-bottom: 14px;
        padding: 0 8px;
    }
    table {
        font-size: 0.84rem;
    }
    th, td {
        padding: 6px 7px;
    }

    /* Φόρμες: 16px για να μη μεγεθύνει το iPhone όταν πατάς σε πεδίο */
    input:not([type="checkbox"]):not([type="radio"]),
    select,
    textarea {
        font-size: 16px;
        max-width: 100%;
    }
    .field input,
    .field select,
    .field textarea {
        max-width: 100% !important;
    }

    /* Παράθυρα (νέο μήνυμα, αιτήσεις, συγκαταθέσεις κ.λπ.) */
    .cred-overlay {
        padding: 8px;
        align-items: flex-start;
    }
    .cred-card {
        padding: 16px 14px;
        max-height: calc(100vh - 16px);
        max-height: calc(100dvh - 16px);
    }

    /* Γραφήματα: μικραίνουν ώστε να χωρούν στο πλάτος */
    .app-main svg:not(.ic) {
        max-width: 100%;
        height: auto;
    }

    /* Μακριές λέξεις/συνδέσμοι να σπάνε αντί να σπρώχνουν τη σελίδα */
    .panel, .cred-card {
        overflow-wrap: anywhere;
    }
    .panel table, .cred-card table {
        overflow-wrap: normal;
    }
}
@media print {
    .table-scroll {
        overflow: visible;
    }
}


/* ============================================================
   Admin / super admin στο κινητό: κατακόρυφο μενού «βήμα-βήμα»
   (js/mobile-menu.js). Στον υπολογιστή δεν εμφανίζεται.
   ============================================================ */
.mm-burger,
.mm-bar,
.mm-overlay {
    display: none;
}
@media (max-width: 700px) {
    body.mm-enabled > nav.app-nav,
    body.mm-enabled .mm-covered {
        display: none !important;
    }
    body.mm-enabled .app-header .brand {
        margin-right: auto;
    }
    .app-header .mm-burger {
        display: inline-flex;
        width: 36px;
        height: 36px;
        min-height: 36px;
        padding: 0;
        border-radius: 50%;
        flex: none;
    }
    .mm-burger-ic,
    .mm-burger-ic::before,
    .mm-burger-ic::after {
        display: block;
        width: 16px;
        height: 2px;
        border-radius: 2px;
        background: currentColor;
        position: relative;
    }
    .mm-burger-ic::before,
    .mm-burger-ic::after {
        content: "";
        position: absolute;
        left: 0;
    }
    .mm-burger-ic::before {
        top: -5px;
    }
    .mm-burger-ic::after {
        top: 5px;
    }
    .mm-bar {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
        padding: 9px 12px;
        background: var(--color-accent-bg);
        border: 0;
        border-bottom: 1px solid var(--color-border);
        font: inherit;
        font-size: 0.86rem;
        text-align: left;
        color: var(--color-text-muted);
        cursor: pointer;
    }
    .mm-crumb {
        flex: 1;
        min-width: 0;
        line-height: 1.4;
    }
    .mm-crumb .mm-sep {
        margin: 0 5px;
        opacity: 0.6;
    }
    .mm-crumb .mm-here {
        color: var(--color-primary);
        font-weight: 700;
    }
    .mm-bar-ic {
        color: var(--color-primary);
        font-size: 1.1rem;
    }
    .mm-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 2500;
        background: rgba(15, 30, 40, 0.45);
        opacity: 0;
        transition: opacity 0.18s;
    }
    .mm-overlay[hidden] {
        display: none;
    }
    .mm-overlay.mm-show {
        opacity: 1;
    }
    .mm-panel {
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(86vw, 340px);
        background: var(--color-surface, #fff);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
        display: flex;
        flex-direction: column;
        transform: translateX(-100%);
        transition: transform 0.18s;
    }
    .mm-show .mm-panel {
        transform: none;
    }
    .mm-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 14px 12px 18px;
        border-bottom: 1px solid var(--color-border);
        font-size: 1.05rem;
    }
    .mm-list {
        flex: 1;
        overflow-y: auto;
    }
    .mm-item,
    .mm-back {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        width: 100%;
        padding: 13px 18px;
        border: 0;
        border-bottom: 1px solid #edf1f4;
        background: none;
        font: inherit;
        font-size: 0.98rem;
        text-align: left;
        color: var(--color-text);
        cursor: pointer;
    }
    .mm-back {
        justify-content: flex-start;
        background: #f5f8fa;
        color: var(--color-primary);
        font-weight: 600;
    }
    .mm-item.mm-on {
        background: var(--color-accent-bg);
        color: var(--color-primary);
        font-weight: 600;
        box-shadow: inset 4px 0 0 var(--color-primary);
    }
    .mm-lbl {
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }
    .mm-arrow {
        color: var(--color-text-muted);
        font-size: 1.25rem;
        line-height: 1;
    }
    body.mm-open {
        overflow: hidden;
    }
}

/* Πίνακες ως κάρτες (js/responsive.js βάζει .rt-on + data-label):
   κάθε γραμμή μια κάρτα, αριστερά η επικεφαλίδα της στήλης.
   .rt-on μπαίνει: στο κινητό (έως 700px) σε κάθε πίνακα με 3+ στήλες·
   σε tablet (οθόνη αφής) μόνο στους πίνακες που ΔΕΝ χωράνε στο πλάτος.
   Στον υπολογιστή με ποντίκι οι πίνακες μένουν όπως είναι. */
table.rt-on {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    width: 100%;
}
table.rt-on > tbody,
table.rt-on > tfoot {
    display: contents;
}
table.rt-on > tbody > tr,
table.rt-on > tfoot > tr {
    display: block;
    min-width: 0;
}
/* tablet: οι κάρτες σε 2 (ή περισσότερες) στήλες */
@media (min-width: 701px) {
    table.rt-on {
        grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
        align-items: start;
    }
    /* γραμμή-τίτλος ομάδας (π.χ. «Ενότητα 1») σε όλο το πλάτος */
    table.rt-on tr:has(> [colspan][data-label=""]) {
        grid-column: 1 / -1;
    }
}
table.rt-on > thead {
    display: none;
}
table.rt-on > tbody > tr,
table.rt-on > tfoot > tr {
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 6px 12px;
    margin: 0;
    background: var(--color-surface, #fff);
}
table.rt-on > tbody > tr > td,
table.rt-on > tbody > tr > th,
table.rt-on > tfoot > tr > td,
table.rt-on > tfoot > tr > th {
    display: block;
    position: relative;
    border: none;
    padding: 5px 0 5px 40%;
    min-height: calc(var(--rt-l, 1) * 1.03rem + 10px);
    text-align: left !important;
    white-space: normal !important;
    width: auto !important;
    overflow-wrap: anywhere;
}
table.rt-on > tbody > tr > td + td,
table.rt-on > tfoot > tr > td + td {
    border-top: 1px dashed #e3e9ed;
}
table.rt-on td[data-label]::before,
table.rt-on th[data-label]::before {
    content: attr(data-label);
    position: absolute;
    left: 0;
    top: 5px;
    width: 37%;
    color: var(--color-text-muted);
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.35;
}
table.rt-on td[data-label=""],
table.rt-on th[data-label=""] {
    padding-left: 0;
}
table.rt-on td[data-label=""]::before,
table.rt-on th[data-label=""]::before {
    display: none;
}
table.rt-on td:empty,
table.rt-on td.rt-empty {
    display: none;
}
table.rt-on td.rt-long {
    padding-left: 0;
}
table.rt-on td.rt-long::before {
    position: static;
    display: block;
    width: auto;
    margin-bottom: 2px;
}

/* Καθηγητής → Παρουσίες: οι 4 καταστάσεις σε 2×2, μεγάλα κουμπιά για το δάχτυλο */
table.rt-on td:has(> .att-seg) {
    padding-left: 0;
}
table.rt-on td:has(> .att-seg)::before {
    display: none;
}
table.rt-on .att-seg {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    width: 100%;
}
table.rt-on .att-seg button {
    min-height: 40px;
    font-size: 0.9rem;
}


/* Οθόνες αφής (κινητό, tablet): λίγο μεγαλύτερα κουμπιά-εικονίδια και
   κουμπιά παρουσιών, για το δάχτυλο. */
@media (pointer: coarse) {
    .btn.btn-icon {
        width: 36px;
        height: 36px;
        min-height: 36px;
    }
    .att-seg button {
        min-height: 36px;
    }
}
