/* css/global_topbar.css */

/* ── Global font-size lock ──
   Το template (style.css) ορίζει --bs-body-font-size: 0.88rem.
   Το Τεφτέρι φορτώνει Bootstrap CDN που κάνει reset σε 1rem.
   Κλειδώνουμε σε 1rem ώστε ΟΛΑ τα modules να δείχνουν ίδια.  */
:root {
  --bs-body-font-size: 1rem;
  --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";

  /* ── Global background lock ──
     Ελαφρύ γκρι φόντο ώστε τα λευκά cards/sections να "αιωρούνται"
     πάνω του με shadow (3D εφέ).  */
  --bs-body-bg: #f0f2f5;
  --bs-body-bg-rgb: 240, 242, 245;
}
/* Override template body font ώστε να μη χρησιμοποιεί Outfit
   (το Τεφτέρι χρησιμοποιεί system-ui λόγω CDN Bootstrap override) */
body {
  font-family: var(--bs-body-font-family) !important;
  font-size: var(--bs-body-font-size) !important;
}
/* Override .bg-body-bg — hardcoded γκρι, νικάει Bootstrap CDN variable */
body.bg-body-bg {
  background-color: #f0f2f5 !important;
  background-image: none !important;
}
/* Bootstrap utility classes που το template αλλάζει σε μικρότερες τιμές */
.fs-5 { font-size: 1.25rem !important; }    /* template=0.88rem, Bootstrap=1.25rem */
.fs-6 { font-size: 1rem !important; }       /* template=0.88rem, Bootstrap=1rem    */

/* Brand μπλε */
#itefteriBrand span.fw-bold{ color:#0d6efd !important; }
#itefteriBrand i{ color:#0d6efd !important; }

/* Topbar look (κλειδωμένο) */
.global-topbar{
  position: sticky !important;
  top: 0;
  z-index: 1000 !important;
  background:#fff !important;
  border-bottom:1px solid #e5e7eb !important;
  margin-bottom: 0 !important;
  font-size: 1rem !important;       /* Lock: δεν κληρονομεί από body (template=0.88rem) */
  line-height: 1.5 !important;      /* Lock: Bootstrap default */
}

.global-topbar .container-fluid{
  gap: 10px 16px;
}

.global-topbar .right-info{
  font-size: .875rem !important;
  color:#6c757d !important;
  min-width: 0;
}
.global-topbar .text-muted{ color:#6c757d !important; }
.global-topbar .badge{
  font-size:.75rem !important;
  line-height:1 !important;
}

.global-topbar .gtb-meta-row{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:.35rem;
  min-width:0;
  line-height:1.35;
}
.global-topbar .gtb-meta-row + .gtb-meta-row{
  margin-top: 2px;
}
.global-topbar .gtb-meta-label,
.global-topbar .gtb-meta-tail,
.global-topbar .gtb-flag,
.global-topbar .gtb-plan-chip,
.global-topbar .gtb-days-remaining{
  flex:0 0 auto;
  white-space:nowrap;
}
.global-topbar .gtb-meta-tail{
  display:inline-flex;
  align-items:center;
  gap:.35rem;
}
.global-topbar .gtb-meta-scroll{
  min-width:0;
}
.global-topbar .gtb-days-remaining{
  font-weight:700;
}

/* Sidebar πάνω από topbar */
.sidebar-area,
#layout-menu.layout-menu{
  z-index: 1100 !important;
}

/* Modals πάνω από όλα */
.modal{ z-index: 3000 !important; }
.modal-backdrop{ z-index: 2990 !important; }
.dropdown-menu{ z-index: 3050 !important; }
.tooltip{ z-index: 3060 !important; }
.popover{ z-index: 3060 !important; }

/* ── ΡΙΖΑ ΤΟΥ INPUT-BLOCKING BUG ──
   Το compiled style.css δεν έχει pointer-events:none στο .tooltip / .popover
   (αντίθετα με το default Bootstrap 5). Αποτέλεσμα: μετά το hide ενός tooltip,
   το element μένει στο DOM με opacity:0 αλλά display:block — και χωρίς το
   pointer-events:none πιάνει αόρατα τα taps στα inputs που τυχαίνει να
   βρίσκονται από κάτω (π.χ. amount, due_date). Επαναφέρουμε το default. */
.tooltip,
.popover {
  pointer-events: none !important;
}
.popover .popover-body,
.popover .popover-header {
  pointer-events: auto;
}

/* Legacy header: κρυφό παντού — πλέον χρησιμοποιείται μόνο global_topbar */
#header-area {
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
}

/* Tickets: όταν είναι d-none, να μην εμφανίζεται ποτέ */
#openTicketCenterTop.d-none{ display:none !important; }

@media (max-width: 767.98px){
  .global-topbar .container-fluid{
    flex-wrap:nowrap !important;
    align-items:flex-start !important;
    justify-content:space-between !important;
  }

  .global-topbar .tc-left-group{
    width:auto;
    flex:0 0 auto;
    justify-content:flex-start;
    align-self:flex-start;
    margin-right:.75rem;
  }

  .global-topbar .right-info{
    width:auto;
    flex:1 1 auto;
    min-width:0;
    display:flex;
    flex-direction:column;
    align-items:flex-end;
    justify-content:flex-start;
    text-align:right !important;
    margin-top:0 !important;
    overflow:hidden;
  }

  .global-topbar .gtb-meta-row{
    justify-content:flex-end;
    flex-wrap:nowrap;
    gap:.3rem;
    width:100%;
    overflow:hidden;
  }

  .global-topbar .gtb-meta-scroll{
    flex:0 1 auto;
    min-width:0;
    max-width:100%;
    display:block;
    overflow-x:auto;
    overflow-y:hidden;
    white-space:nowrap;
    text-align:left;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior-x:contain;
    scrollbar-width:none;
  }

  .global-topbar .gtb-meta-scroll::-webkit-scrollbar{
    display:none;
  }
}

/* ── Lock μεγεθών topbar (extra safety) ── */
.global-topbar #itefteriBrand span.fw-bold {
  font-size: 1rem !important;
  font-weight: 700 !important;
}

/* ── 3D shadow effect ──
   Πιο έντονο εφέ σκιάς + border-radius σε cards, sections, πίνακες.
   Το γκρι background (#f0f2f5) δίνει αντίθεση ώστε τα λευκά cards
   να "αιωρούνται" σαν το Ημερολόγιο.  */
:root {
  --it-card-shadow: 0 2px 6px 0 rgba(0,0,0,0.10), 0 4px 16px 0 rgba(0,0,0,0.08);
  --it-card-radius: 10px;
}

/* Page-card containers — max-width none, λευκό bg + shadow + radius */
.page-card,
.ledger-page-card,
.calendar-page-card {
  background: #fff !important;
  border: 1px solid rgba(0,0,0,0.08) !important;
  border-radius: var(--it-card-radius) !important;
  box-shadow: var(--it-card-shadow) !important;
  max-width: none !important;
}

/* Cards στο main content & tefteri-wrapper
   Εξαίρεση .module-card: τα dashboard tiles έχουν δικό τους gradient
   background στο dashboard.php — δεν πρέπει να τα σκεπάσει το λευκό. */
.main-content .card:not(.module-card),
.tefteri-wrapper .card:not(.module-card),
.main-content-container .card:not(.module-card) {
  background: #fff !important;
  box-shadow: var(--it-card-shadow) !important;
  border: 1px solid rgba(0,0,0,0.08) !important;
  border-radius: var(--it-card-radius) !important;
}

/* Table-responsive wrappers — shadow + rounded corners (standalone)
   overflow-x: auto  → επιτρέπει horizontal scroll σε πλατιούς πίνακες
   overflow-y: hidden → κλείνει τις rounded γωνίες κατακόρυφα */
.table-responsive {
  background: #fff;
  border-radius: var(--it-card-radius);
  overflow-x: auto;
  overflow-y: hidden;
  box-shadow: var(--it-card-shadow);
  border: 1px solid rgba(0,0,0,0.08);
}
/* Μέσα σε card / container-frame: ελαφρύ border μόνο, χωρίς shadow */
.card .table-responsive,
.tefteri-wrapper > .container-fluid .table-responsive,
.tefteri-wrapper > .container .table-responsive,
.tefteri-wrapper > .containerOLD .table-responsive {
  box-shadow: none;
  border: 1px solid #e5e7eb;
  border-radius: var(--it-card-radius);
}

/* Standalone tables (χωρίς .table-responsive wrapper, εκτός card) */
.main-content > .table,
.tefteri-wrapper > .container-fluid > .table {
  background: #fff;
  box-shadow: var(--it-card-shadow);
  border-radius: var(--it-card-radius);
  overflow: hidden;
}

/* ── Card frame για module content ──
   Κάθε module container γίνεται λευκή κάρτα με shadow (σαν Ημερολόγιο).
   Horizontal padding = 0 ώστε τα cards μέσα να πιάνουν ίδιο πλάτος
   με τα tefteri-wrapper containers.  */
/* Main-content modules: consistent spacing
   padding: 16px 0 → ίδιο top gap με tefteri-wrapper (margin-top: 16px) */
.main-content-container {
  padding: 16px 0 !important;
}
/* Cards μέσα σε main-content: ίδιο margin με tefteri-wrapper containers */
.main-content-container > .card {
  margin-left: 0;
  margin-right: 0;
}

/* Calendar page-wrap — χωρίς extra horizontal padding
   ώστε το calendar card να πιάνει ίδιο πλάτος με τα υπόλοιπα modules */
.calendar-page-wrap {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Tefteri-wrapper modules: container children → card frame
   margin-left/right: 12px ώστε η απόσταση sidebar↔card & card↔δεξί άκρο
   να ταιριάζει με τα main-content modules (container-fluid gutter = 12px) */
.tefteri-wrapper > .container-fluid,
.tefteri-wrapper > .container,
.tefteri-wrapper > .containerOLD {
  background: #fff !important;
  border-radius: var(--it-card-radius) !important;
  box-shadow: var(--it-card-shadow) !important;
  border: 1px solid rgba(0,0,0,0.08) !important;
  padding: 24px !important;
  margin-top: 16px;
  margin-bottom: 16px;
  margin-left: 12px;
  margin-right: 12px;
}


/* ── Sidebar — λευκή + shadow εφέ ── */
.sidebar-area,
#layout-menu.layout-menu {
  background: #fff !important;
  box-shadow: 2px 0 12px 0 rgba(0,0,0,0.08) !important;
  border-right: 1px solid rgba(0,0,0,0.06) !important;
}

/* Αφαίρεση γραμμής μεταξύ logo και μενού στο sidebar */
.sidebar-area .logo {
  border-bottom: none !important;
}

/* ── Mobile: αφαίρεση card frame σε μικρές οθόνες ──
   Σε κινητά (<768px) τα containers γίνονται full-width χωρίς πλαίσιο
   ώστε το content να καταλαμβάνει το μέγιστο πλάτος οθόνης.  */
@media (max-width: 767.98px) {
  /* Layout A — tefteri-wrapper containers */
  .tefteri-wrapper > .container-fluid,
  .tefteri-wrapper > .container,
  .tefteri-wrapper > .containerOLD {
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding: 12px !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: none !important;
  }

  /* Layout B — main-content cards (εξαίρεση .module-card dashboard tiles) */
  .main-content .card:not(.module-card),
  .main-content-container .card:not(.module-card) {
    border-radius: 0 !important;
    box-shadow: none !important;
    border: none !important;
  }

  /* Page-card containers */
  .page-card,
  .ledger-page-card,
  .calendar-page-card {
    border-radius: 0 !important;
    box-shadow: none !important;
    border: none !important;
  }

  /* Table-responsive: full-width, χωρίς radius */
  .table-responsive {
    border-radius: 0 !important;
    box-shadow: none !important;
    border-left: none !important;
    border-right: none !important;
  }

  /* Αφαίρεση Bootstrap container-fluid 12px gutter στο κινητό ώστε
     το content να πιάνει πλήρες πλάτος χωρίς γκρι "πλαίσιο" περιμετρικά.
     Αφορά κυρίως το main-content layout (Calendar, Commissions, admin). */
  body > .container-fluid,
  .main-content > .container-fluid {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* ── Κουμπιά σε κινητό: ένα ανά σειρά ──
     Στοχεύει τα action bars των σελίδων δεδομένων (.top-actions στις
     σελίδες suppliers/categories/suppl_items/banks/paymentmethods/employees)
     και το footer του seedModal. Η στοίβαξη αποτρέπει περιπτώσεις όπου
     floating badges (π.χ. QR counters στους εργαζομένους) καλύπτουν
     τμήμα κουμπιού και εμποδίζουν το tap. */
  .top-actions {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
  }
  .top-actions > .btn,
  .top-actions > a.btn,
  .top-actions > button {
    width: 100% !important;
  }

  /* Το parent row του header (title + top-actions) σπάει σε δύο
     γραμμές πλήρους πλάτους, ώστε το .top-actions να πιάσει 100%. */
  .top-actions {
    margin-top: 8px;
  }

  /* seedModal footer — κάθε κουμπί σε δική του σειρά */
  #seedModal .modal-footer .d-flex,
  #seedModal .modal-footer > .d-flex {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
  #seedModal .modal-footer .btn {
    width: 100% !important;
  }
}

/* ── seedModal: accordion behaviour ──
   Στο κινητό (<768px) κάθε ενότητα είναι collapsible accordion-item και
   μόνο η πρώτη (Κατηγορίες Εσόδων) είναι ανοιχτή by default. Στα tablet/
   desktop (≥768px) ξεκλειδώνουμε όλα τα panels ώστε να δείχνονται μόνιμα
   ανοιχτά και οι headers να συμπεριφέρονται σαν απλοί τίτλοι.

   Η ενότητα αυτή βρίσκεται ΕΞΩ από το mobile media query επίτηδες: τα
   overrides για desktop πρέπει να ισχύουν πάνω από 768px. */
@media (min-width: 768px) {
  #seedModal .seed-accordion .accordion-collapse {
    display: block !important;
    height: auto !important;
  }
  #seedModal .seed-accordion .accordion-button {
    pointer-events: none;
    background-color: transparent !important;
    box-shadow: none !important;
    color: inherit !important;
  }
  #seedModal .seed-accordion .accordion-button::after {
    display: none !important;
  }
}

/* Κοινά στυλ accordion για το seedModal */
#seedModal .seed-accordion .accordion-item {
  border: 1px solid rgba(0, 0, 0, 0.125);
  border-radius: 0.375rem;
  margin-bottom: 0.5rem;
  background-color: #fff;
}
#seedModal .seed-accordion .accordion-button {
  font-weight: 700;
  padding: 0.625rem 0.875rem;
  border-radius: 0.375rem;
}
#seedModal .seed-accordion .accordion-button:not(.collapsed) {
  background-color: rgba(13, 110, 253, 0.06);
  color: inherit;
}
#seedModal .seed-accordion .accordion-body {
  padding: 0.75rem;
}
#seedModal .seed-accordion .seed-count-badge {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  background-color: rgba(0, 0, 0, 0.08);
  margin-left: 8px;
}

/* ── seedModal banner στο τεφτέρι ──
   Banner που εμφανίζεται για νέα καταστήματα χωρίς αρχικά δεδομένα.
   Αντικαθιστά το παλιό auto-open του seedModal μετά από 5 δευτ. */
.seed-hint-banner {
  border: 1px solid rgba(13, 110, 253, 0.25);
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.06), rgba(13, 110, 253, 0.02));
  border-radius: 0.5rem;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.seed-hint-banner .seed-hint-title {
  font-weight: 700;
  margin-bottom: 4px;
}
.seed-hint-banner .seed-hint-text {
  color: #555;
  font-size: 0.925rem;
  margin-bottom: 10px;
}
.seed-hint-banner .seed-hint-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
@media (max-width: 767.98px) {
  .seed-hint-banner .seed-hint-actions {
    flex-direction: column;
  }
  .seed-hint-banner .seed-hint-actions .btn {
    width: 100%;
  }
}

/* ──────────────────────────────────────────────────────────────
   Σύνολα Επί Πιστώσει (credit panel) — κουμπί, badge, πίνακες.
   Ακολουθεί το styling των υπολοίπων "Σύνολα ανά X" (btn-secondary + collapse).
   Μπαίνει ΕΔΩ (global_topbar.css) — ποτέ στο style.css.
   ────────────────────────────────────────────────────────────── */

/* Κόκκινο badge στο κουμπί όταν υπάρχουν ληξιπρόθεσμα */
.tef-credit-btn {
  position: relative;
}
.tef-credit-overdue-badge {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.1rem 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  background: #dc3545;
  border-radius: 0.75rem;
  vertical-align: middle;
  box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.15);
}

/* Panel περιέχον τις δύο ενότητες */
.tef-credit-panel {
  background: #ffffff;
  border: 1px solid #e3e6ea;
  border-radius: 6px;
  padding: 14px 16px;
}
.tef-credit-section-header h5 {
  font-weight: 600;
}

/* Πίνακας credit: group headers + entry rows */
.tef-credit-table tr.tef-credit-group-header > td {
  background: #f5f7fa;
  border-top: 2px solid #dee2e6;
  font-weight: 500;
}
.tef-credit-table tr.tef-credit-entry-row {
  cursor: pointer;
}
.tef-credit-table tr.tef-credit-entry-row:hover > td {
  background: #eef5ff;
}

/* Χρωματισμοί ημερών */
.tef-credit-days-overdue {
  color: #c62828;
  font-weight: 600;
}
.tef-credit-days-today {
  color: #ef6c00;
  font-weight: 600;
}
.tef-credit-days-upcoming {
  color: #616161;
}

/* Highlight εγγραφής στο κύριο τεφτέρι μετά από διπλό κλικ στο panel */
@keyframes tefCreditJumpFlash {
  0%   { background-color: #fff3cd; }
  50%  { background-color: #ffe69c; }
  100% { background-color: transparent; }
}
#mainTable tr.tef-credit-jump-highlight > td {
  animation: tefCreditJumpFlash 2.4s ease-out;
}

/* =========================================================================
 * Tefteri column customization (gear → modal → show/hide + drag reorder).
 * Paired with:
 *   - /public/js/tefteri_columns.js
 *   - /public/js/vendor/Sortable.min.js
 *   - /app/controllers/TefteriController.php  (POST /tefteri/column_prefs)
 * Only defensive + modal-scoped rules live here — we do not touch the
 * existing tefteri grid or topbar buttons.
 * ========================================================================= */

/* Make `hidden` bullet-proof on table parts: some default table CSS sets
   `display: table-cell / table-column` which would otherwise trump the
   native `hidden` attribute. */
col[data-col][hidden],
th[data-col][hidden],
td[data-col][hidden] {
  display: none !important;
}

/* Modal: column list rows */
#tefColumnsModal .tef-columns-list {
  /* ride on top of Bootstrap .list-group — just spacing tweaks */
  margin-bottom: 0;
}
#tefColumnsModal .tef-columns-item {
  /* li is already .list-group-item via Bootstrap */
  transition: background-color .12s ease, border-color .12s ease;
}
#tefColumnsModal .tef-columns-item:hover:not(.tef-columns-item-locked) {
  background: #f7f9fc;
}
#tefColumnsModal .tef-columns-drag-handle {
  color: #9aa0a6;
  cursor: grab;
  user-select: none;
  line-height: 1;
  font-size: 1.05rem;
  padding: 0 2px;
}
#tefColumnsModal .tef-columns-drag-handle:active {
  cursor: grabbing;
}
#tefColumnsModal .tef-columns-item .form-check-input:disabled {
  opacity: 0.55;
}

/* Locked rows (Α/Α πρώτη / Ενέργειες τελευταία) — no drag, no hide */
#tefColumnsModal .tef-columns-item-locked {
  background: #f3f4f6;
  color: #5f6368;
}
#tefColumnsModal .tef-columns-item-locked .tef-columns-drag-handle {
  cursor: not-allowed;
}

/* ── Print buttons δίπλα στα "Σύνολα ανά..." collapse triggers ──
   Icon-only, μικρό padding, vertical alignment με το γκρι κουμπί.
   Η εκτύπωση γίνεται μέσω tefteri_print.js (νέο window). */
.tef-print-btn {
  vertical-align: middle;
  padding: 0.25rem 0.5rem;
  line-height: 1;
}
.tef-print-btn .bi {
  font-size: 1rem;
  vertical-align: middle;
}
/* Σε browser-native εκτύπωση (Ctrl+P) τα print κουμπιά πρέπει να είναι αόρατα.
   Η κανονική εκτύπωση πινάκων γίνεται από το script σε νέο window. */
@media print {
  .tef-print-btn {
    display: none !important;
  }
}

/* Στιλ για τη γραμμή συνόλου των "Σύνολα ανά..." πινάκων — λίγο πιο έντονο. */
.tef-totals-row td {
  background-color: #f1f3f5;
  border-top: 2px solid #adb5bd !important;
}

/* SortableJS states during drag */
#tefColumnsModal .tef-columns-item-ghost {
  opacity: 0.35;
  background: #eef3fb;
}
#tefColumnsModal .tef-columns-item-chosen {
  background: #eef3fb;
}
#tefColumnsModal .sortable-drag {
  cursor: grabbing;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Στήλη "Σχόλια" στο Σύνολα Επί Πιστώσει — single line + horizontal scroll στο κελί */
.tef-credit-table td.tef-credit-comment {
  vertical-align: middle;
  padding: 0.4rem 0.5rem;
}
.tef-credit-table td.tef-credit-comment .tef-credit-comment-inner {
  max-width: 320px;
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  line-height: 1.4;
}
.tef-credit-table td.tef-credit-comment .tef-credit-comment-inner::-webkit-scrollbar {
  height: 4px;
}
.tef-credit-table td.tef-credit-comment .tef-credit-comment-inner::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 4px;
}
@media (max-width: 992px) {
  .tef-credit-table td.tef-credit-comment .tef-credit-comment-inner {
    max-width: 220px;
  }
}
@media (max-width: 768px) {
  .tef-credit-table td.tef-credit-comment .tef-credit-comment-inner {
    max-width: 160px;
  }
}
@media (max-width: 480px) {
  .tef-credit-table td.tef-credit-comment .tef-credit-comment-inner {
    max-width: 120px;
  }
}

/* ── Sidebar: ομαδοποίηση "ΑΝΑΦΟΡΕΣ" ──
   Διαχωριστική γραμμή + section label πάνω από τα reports modules
   (yearly_stats / forecast / compare). Δουλεύει σε light & dark theme. */
#layout-menu .menu-sub > li.menu-divider {
  list-style: none;
  height: 1px;
  margin: 8px 16px;
  padding: 0;
  background: rgba(0, 0, 0, 0.08);
  border: 0;
  pointer-events: none;
}
[data-theme="dark"] #layout-menu .menu-sub > li.menu-divider,
[sidebar-data-theme="sidebar-hide"] #layout-menu .menu-sub > li.menu-divider {
  background: rgba(255, 255, 255, 0.08);
}
#layout-menu .menu-sub > li.menu-section-label {
  list-style: none;
  padding: 4px 16px 6px;
  margin: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.45);
  cursor: default;
  user-select: none;
  pointer-events: none;
}
[data-theme="dark"] #layout-menu .menu-sub > li.menu-section-label {
  color: rgba(255, 255, 255, 0.5);
}
#layout-menu .menu-sub > li.menu-section-label > span {
  display: inline-block;
}

/* ── iOS auto-zoom prevention σε form fields ──
   Όταν στο iOS Safari κάνεις focus σε <input>/<select>/<textarea> με
   computed font-size < 16px, κάνει αυτόματο zoom in στο πεδίο και δεν
   επιστρέφει — ο χρήστης πρέπει να κάνει pinch-zoom out. Αναγκάζουμε
   16px ΜΟΝΟ σε touch devices ώστε να μην τριγκάρει το zoom. Δεν
   αλλάζει η εμφάνιση σε desktop / fine pointer (mouse). Δεν αγγίζουμε
   το viewport meta — το pinch-zoom παραμένει διαθέσιμο.
   Date: 2026-04-30 */
@media (hover: none) and (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
  select,
  textarea,
  .form-control,
  .form-select {
    font-size: 16px !important;
  }
}

/* ── Override global .btn-primary για καλύτερη αντίθεση ──
   Καθολικό override σε γαλάζιο (Tailwind blue-600 #2563eb) με λευκό
   κείμενο και font-weight 600. Contrast ≈5.05:1 → WCAG AA για normal
   text. Στο hover πέφτουμε δύο σκαλιά (blue-800 #1e40af) ώστε η
   διαφορά να γίνεται αμέσως αντιληπτή. Active σε blue-900. !important
   επειδή το style.css ορίζει τα ίδια custom properties με ίδια
   specificity. */
.btn-primary,
.btn-primary:focus-visible {
  --bs-btn-color: #ffffff !important;
  --bs-btn-bg: #2563eb !important;
  --bs-btn-border-color: #2563eb !important;
  --bs-btn-hover-color: #ffffff !important;
  --bs-btn-hover-bg: #1e40af !important;
  --bs-btn-hover-border-color: #1e40af !important;
  --bs-btn-focus-shadow-rgb: 37, 99, 235 !important;
  --bs-btn-active-color: #ffffff !important;
  --bs-btn-active-bg: #1e3a8a !important;
  --bs-btn-active-border-color: #1e3a8a !important;
  --bs-btn-disabled-color: #ffffff !important;
  --bs-btn-disabled-bg: #2563eb !important;
  --bs-btn-disabled-border-color: #2563eb !important;
  color: #ffffff !important;
  background-color: #2563eb !important;
  border-color: #2563eb !important;
  font-weight: 600 !important;
  transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}
.btn-primary:hover,
.btn-primary:focus {
  color: #ffffff !important;
  background-color: #1e40af !important;
  border-color: #1e40af !important;
}
.btn-primary:active,
.btn-primary.active,
.btn-check:checked + .btn-primary {
  color: #ffffff !important;
  background-color: #1e3a8a !important;
  border-color: #1e3a8a !important;
}
.btn-primary:disabled,
.btn-primary.disabled {
  color: #ffffff !important;
  background-color: #2563eb !important;
  border-color: #2563eb !important;
  opacity: 0.65 !important;
}

/* ──────────────────────────────────────────────────────────────────────
   Tefteri — tooltip κελιού ημερομηνίας (ακριβής ώρα καταχώρησης)
   2026-05-25
   - cursor: help κάνει το element «interactive» ώστε σε iOS Safari το tap
     να εμφανίζει το Bootstrap tooltip.
   - underline dotted δείχνει στον χρήστη ότι το κελί κρύβει επιπλέον info.
   ────────────────────────────────────────────────────────────────────── */
.tef-date-cell {
  cursor: help;
  text-decoration: underline dotted rgba(0, 0, 0, 0.25);
  text-underline-offset: 2px;
}

/* ──────────────────────────────────────────────────────────────────────
   Manual (User guide) modal — styling των άρθρων
   2026-05-28
   Όλο το styling του in-app εγχειριδίου χρήσης ζει εδώ. Τα άρθρα
   αποθηκεύονται ως HTML στη βάση (manual_articles.content) και
   σανιτάρονται με DOMPurify πριν εμφανιστούν.
   Βλ. /manual/_db/ για το content + SQL scripts.
   ────────────────────────────────────────────────────────────────────── */
.manual-article-title {
  font-size: 1.15rem;
  color: #0f172a;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: .35rem;
  margin-bottom: .85rem !important;
}

.manual-article-body {
  font-size: .95rem;
  line-height: 1.65;
  color: #1f2937;
}

.manual-article-body h2,
.manual-article-body h3,
.manual-article-body h4 {
  color: #0f172a;
  margin-top: 1.25rem;
  margin-bottom: .5rem;
  font-weight: 600;
  line-height: 1.3;
}

.manual-article-body h2 { font-size: 1.15rem; border-bottom: 1px solid #e2e8f0; padding-bottom: .25rem; }
.manual-article-body h3 { font-size: 1.05rem; color: #1e3a8a; }
.manual-article-body h4 { font-size: .98rem; color: #1e293b; }

.manual-article-body p { margin: .55rem 0; }

.manual-article-body ul,
.manual-article-body ol {
  padding-left: 1.4rem;
  margin: .4rem 0 .8rem;
}
.manual-article-body li { margin: .2rem 0; }

.manual-article-body strong { color: #0f172a; font-weight: 600; }
.manual-article-body em { color: #334155; }

.manual-article-body code {
  background: #f1f5f9;
  color: #be123c;
  padding: .08rem .35rem;
  border-radius: 3px;
  font-size: .88em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.manual-article-body hr {
  border: 0;
  border-top: 1px dashed #cbd5e1;
  margin: 1rem 0;
}

.manual-article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: .75rem 0 1rem;
  font-size: .9rem;
  background: #ffffff;
}
.manual-article-body th,
.manual-article-body td {
  border: 1px solid #e2e8f0;
  padding: .45rem .6rem;
  vertical-align: top;
  text-align: left;
}
.manual-article-body th {
  background: #f8fafc;
  color: #0f172a;
  font-weight: 600;
}
.manual-article-body tr:nth-child(even) td { background: #fafbfc; }

/* Callout boxes — χρωματιστά κουτιά για info / προσοχή / κίνδυνο / επιτυχία */
.manual-tip,
.manual-info,
.manual-warn,
.manual-danger,
.manual-success {
  border-left: 4px solid;
  padding: .6rem .85rem;
  margin: .85rem 0;
  border-radius: 4px;
  font-size: .93rem;
}
.manual-tip,
.manual-info       { background: #eff6ff; border-color: #3b82f6; color: #1e3a8a; }
.manual-warn       { background: #fffbeb; border-color: #f59e0b; color: #78350f; }
.manual-danger     { background: #fef2f2; border-color: #ef4444; color: #7f1d1d; }
.manual-success    { background: #f0fdf4; border-color: #22c55e; color: #14532d; }

.manual-tip strong,
.manual-info strong       { color: #1e3a8a; }
.manual-warn strong       { color: #78350f; }
.manual-danger strong     { color: #7f1d1d; }
.manual-success strong    { color: #14532d; }

/* Subscription / feature badges */
.manual-badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: .12rem .5rem;
  border-radius: 10px;
  vertical-align: middle;
  text-transform: uppercase;
  margin: 0 .15rem;
  line-height: 1.4;
}
.badge-basic   { background: #e0f2fe; color: #075985; border: 1px solid #7dd3fc; }
.badge-pro     { background: #fef3c7; color: #78350f; border: 1px solid #fbbf24; }
.badge-tenant  { background: #ede9fe; color: #5b21b6; border: 1px solid #c4b5fd; }
.badge-free    { background: #ecfdf5; color: #065f46; border: 1px solid #6ee7b7; }
.badge-admin   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* Σύνοψη συνδρομής στην κορυφή κάθε άρθρου */
.manual-subscription-tag {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: .35rem .65rem;
  margin: 0 0 .85rem;
  font-size: .85rem;
  color: #475569;
}
.manual-subscription-tag::before {
  content: "🔓";
  font-size: 1rem;
}
.manual-subscription-tag.is-locked::before { content: "🔒"; }

/* ──────────────────────────────────────────────────────────────────────
   Manual modal — Full layout (responsive)
   2026-05-28
   Replaces the legacy left-list / right-content split with a sectioned
   sidebar (collapsible groups + article list inside) and a content pane
   that includes search, breadcrumb, top/bottom prev-next, and a search
   results view. Mobile: sidebar becomes an off-canvas drawer.
   ────────────────────────────────────────────────────────────────────── */

.itf-manual-modal .modal-dialog {
  max-width: 1100px;
}
.itf-manual-modal .modal-content {
  border-radius: 12px;
  overflow: hidden;
  background: #f8fafc;
}
.itf-manual-modal .modal-body {
  padding: 0;
}

/* ─── Header ─────────────────────────────────────────────────────── */
.itf-manual-header {
  display: block;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: .75rem 1rem;
}
.itf-manual-header-row {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.itf-manual-header-row .modal-title {
  flex: 1 1 auto;
  font-size: 1.05rem;
  color: #0f172a;
}
.itf-manual-header-row .btn-close {
  flex: 0 0 auto;
}

/* Hamburger (mobile) — icon + visible label "Ενότητες" */
.itf-manual-burger {
  flex: 0 0 auto;
  min-height: 38px;
  padding: .3rem .65rem .3rem .55rem;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .85rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.itf-manual-burger:hover,
.itf-manual-burger:focus-visible {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1e3a8a;
  outline: none;
}
.itf-manual-burger-icon {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 3px;
  width: 18px;
  height: 14px;
}
.itf-manual-burger-icon span {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}
.itf-manual-burger-label {
  white-space: nowrap;
}

/* Search bar */
.itf-manual-search-row {
  margin-top: .65rem;
}
.itf-manual-search {
  position: relative;
  display: flex;
  align-items: center;
}
.itf-manual-search-icon {
  position: absolute;
  left: .65rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: .95rem;
  color: #64748b;
}
.itf-manual-search input[type="search"] {
  border-radius: 10px;
  padding-left: 2.2rem;
  padding-right: 2.2rem;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  height: 42px;
  font-size: .95rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.itf-manual-search input[type="search"]:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .15);
  outline: none;
}
.itf-manual-search input[type="search"]::-webkit-search-decoration,
.itf-manual-search input[type="search"]::-webkit-search-cancel-button { display: none; }
.itf-manual-search-clear {
  position: absolute;
  right: .55rem;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: 0;
  background: #e2e8f0;
  color: #475569;
  border-radius: 50%;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.itf-manual-search-clear:hover { background: #cbd5e1; color: #0f172a; }

/* ─── Body layout ─────────────────────────────────────────────────── */
.itf-manual-body {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 520px;
  position: relative;
  background: #f8fafc;
}

/* Sidebar */
.itf-manual-sidebar {
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  overflow-y: auto;
  max-height: calc(100vh - 220px);
}
.itf-manual-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .65rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  position: sticky;
  top: 0;
  z-index: 2;
}

.itf-manual-sections {
  padding: .5rem;
}
.itf-manual-section-list,
.itf-manual-article-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.itf-manual-section-item {
  margin-bottom: .25rem;
}
.itf-manual-section-toggle {
  width: 100%;
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: .4rem;
  padding: .55rem .65rem;
  background: transparent;
  border: 0;
  border-radius: 8px;
  text-align: left;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
  transition: background .15s ease;
}
.itf-manual-section-toggle:hover { background: #f1f5f9; }
.itf-manual-section-item.has-active > .itf-manual-section-toggle {
  background: #eff6ff;
  color: #1e3a8a;
}
.itf-manual-section-chevron {
  font-size: .8rem;
  color: #64748b;
  transition: transform .18s ease;
  width: 18px;
  text-align: center;
}
.itf-manual-section-item.is-expanded .itf-manual-section-chevron {
  transform: rotate(90deg);
}
.itf-manual-section-title {
  font-size: .88rem;
  letter-spacing: .01em;
  line-height: 1.3;
}
.itf-manual-section-count {
  font-size: .72rem;
  color: #64748b;
  background: #f1f5f9;
  padding: .1rem .45rem;
  border-radius: 10px;
  white-space: nowrap;
}

.itf-manual-article-list {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
  padding-left: 1.4rem;
}
.itf-manual-section-item.is-expanded .itf-manual-article-list {
  max-height: 2000px;   /* enough for any realistic count */
  padding-top: .15rem;
  padding-bottom: .35rem;
}
.itf-manual-article-link {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .4rem .6rem;
  font-size: .88rem;
  color: #475569;
  text-decoration: none;
  border-radius: 6px;
  line-height: 1.35;
}
.itf-manual-article-link:hover {
  background: #f1f5f9;
  color: #1e3a8a;
}
.itf-manual-article-link.is-current {
  background: #1e3a8a;
  color: #ffffff;
}
.itf-manual-article-link.is-current .itf-manual-article-dot { background: #ffffff; }
.itf-manual-article-dot {
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #cbd5e1;
}
.itf-manual-article-link:hover .itf-manual-article-dot { background: #1e3a8a; }

/* Sidebar backdrop (mobile only) */
.itf-manual-sidebar-backdrop {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .35);
  z-index: 10;
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: none;
}
.itf-manual-sidebar-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ─── Main pane ──────────────────────────────────────────────────── */
.itf-manual-main {
  position: relative; /* anchor for .itf-manual-back-to-top */
  background: #f8fafc;
  overflow-y: auto;
  max-height: calc(100vh - 220px);
  padding: 1rem 1.25rem 1.25rem;
}
.itf-manual-view { width: 100%; }

/* Breadcrumb */
.itf-manual-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem .4rem;
  font-size: .82rem;
  color: #64748b;
  margin-bottom: .5rem;
}
.itf-manual-breadcrumb-section { color: #475569; }
.itf-manual-breadcrumb-sep { color: #cbd5e1; }
.itf-manual-breadcrumb-article { color: #0f172a; font-weight: 600; }

/* Breadcrumb as button (mobile: opens drawer) */
.itf-manual-breadcrumb-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: default;
}
.itf-manual-breadcrumb-link .itf-manual-breadcrumb-hint {
  display: none;
  color: #2563eb;
  font-size: .72rem;
  margin-left: .25rem;
}
@media (max-width: 767.98px) {
  .itf-manual-breadcrumb-link {
    cursor: pointer;
    padding: .35rem .55rem;
    border-radius: 8px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    width: 100%;
    transition: background .15s ease, border-color .15s ease;
  }
  .itf-manual-breadcrumb-link:hover,
  .itf-manual-breadcrumb-link:focus-visible {
    background: #eff6ff;
    border-color: #3b82f6;
    outline: none;
  }
  .itf-manual-breadcrumb-link .itf-manual-breadcrumb-hint {
    display: inline-flex;
    align-items: center;
    margin-left: auto;
    flex: 0 0 auto;
  }
}

/* Quick-jump dropdown (mobile only) */
.itf-manual-quickjump {
  margin: 0 0 .75rem;
}
.itf-manual-quickjump .form-select {
  border-radius: 10px;
  border-color: #cbd5e1;
  background-color: #ffffff;
  color: #0f172a;
  font-size: .9rem;
  padding: .5rem 2rem .5rem .75rem;
  height: 42px;
}
.itf-manual-quickjump .form-select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .15);
}

/* Back-to-top floating button — mobile only (στο desktop υπάρχει prev/next inline) */
.itf-manual-back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: #1e3a8a;
  color: #ffffff;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1;
  display: none; /* hidden by default — mobile-only override below */
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .3);
  cursor: pointer;
  z-index: 1080; /* πάνω από modal-body, κάτω από modal close trap (1100) */
  opacity: .94;
  transition: opacity .15s ease, transform .15s ease, background .15s ease;
}
.itf-manual-back-to-top:hover,
.itf-manual-back-to-top:focus-visible {
  background: #1d4ed8;
  opacity: 1;
  transform: translateY(-2px);
  outline: none;
}
.itf-manual-back-to-top[hidden] { display: none !important; }

@media (max-width: 767.98px) {
  .itf-manual-back-to-top { display: inline-flex; }
  .itf-manual-back-to-top[hidden] { display: none !important; }
}

/* Top nav (compact prev/next) */
.itf-manual-nav-top { margin-bottom: .65rem; }
.itf-manual-nav-compact {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
}
.itf-manual-nav-mini {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .65rem;
  font-size: .78rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #1e3a8a;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.itf-manual-nav-mini:hover { background: #eff6ff; border-color: #3b82f6; }
.itf-manual-nav-mini.is-disabled {
  color: #94a3b8;
  background: transparent;
  border-color: transparent;
  cursor: default;
}

/* Article body container */
.itf-manual-article {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.1rem 1.25rem 1.5rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
}
.itf-manual-article-head { margin-bottom: .6rem; padding-bottom: .55rem; border-bottom: 2px solid #e2e8f0; }
.itf-manual-article-title-large {
  font-size: 1.3rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  line-height: 1.3;
}

/* Bottom nav (large prev/next cards) */
.itf-manual-nav-bottom { margin-top: 1rem; }
.itf-manual-nav-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .65rem;
}
.itf-manual-nav-card {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  padding: .75rem .9rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  text-align: left;
  color: #1e3a8a;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.itf-manual-nav-card:hover {
  border-color: #3b82f6;
  background: #eff6ff;
  transform: translateY(-1px);
}
.itf-manual-nav-card-prev { text-align: left; }
.itf-manual-nav-card-next { text-align: right; }
.itf-manual-nav-card-hint {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #64748b;
}
.itf-manual-nav-card-title {
  font-size: .92rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.3;
}
.itf-manual-nav-card.is-disabled {
  background: transparent;
  border: 1px dashed #e2e8f0;
  pointer-events: none;
}

/* Back-to-search bar */
.itf-manual-back-to-search {
  margin: -0.3rem 0 .65rem;
}
.itf-manual-back-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .7rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  color: #1e3a8a;
  font-size: .82rem;
  cursor: pointer;
  transition: background .15s ease;
}
.itf-manual-back-btn:hover { background: #dbeafe; }
.itf-manual-back-btn em { font-style: normal; font-weight: 600; }

/* Empty / skeleton states */
.itf-manual-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  color: #64748b;
  text-align: center;
}
.itf-manual-empty-icon { font-size: 2.5rem; margin-bottom: .65rem; opacity: .85; }
.itf-manual-empty-small { padding: .75rem; color: #64748b; font-size: .85rem; }
.itf-manual-skeleton { padding: .75rem; }
.itf-manual-skeleton-line {
  height: 14px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  border-radius: 6px;
  margin-bottom: .55rem;
  animation: itfManualSkeleton 1.4s ease infinite;
}
@keyframes itfManualSkeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Search results view ────────────────────────────────────────── */
.itf-manual-search-meta {
  margin-bottom: .85rem;
  font-size: .9rem;
  color: #334155;
}
.itf-manual-search-meta-text strong { color: #0f172a; }
.itf-manual-result-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.itf-manual-result {
  width: 100%;
  display: block;
  text-align: left;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: .8rem 1rem;
  cursor: pointer;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.itf-manual-result:hover {
  border-color: #3b82f6;
  box-shadow: 0 2px 6px rgba(59, 130, 246, .12);
  transform: translateY(-1px);
}
.itf-manual-result-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .4rem;
  margin-bottom: .35rem;
}
.itf-manual-result-title {
  font-weight: 700;
  color: #0f172a;
  font-size: .98rem;
}
.itf-manual-result-section {
  font-size: .76rem;
  color: #64748b;
  background: #f1f5f9;
  padding: .12rem .55rem;
  border-radius: 10px;
}
.itf-manual-result-snippet {
  font-size: .85rem;
  color: #475569;
  line-height: 1.55;
}
.itf-manual-result mark,
.manual-article-body mark {
  background: #fef3c7;
  color: #78350f;
  padding: 0 .15rem;
  border-radius: 3px;
}

/* ─── Mobile (< 768px) — drawer behaviour ────────────────────────── */
body.itf-manual-no-scroll { overflow: hidden; }

@media (max-width: 767.98px) {
  .itf-manual-modal .modal-content { border-radius: 0; }
  .itf-manual-header { padding: .65rem .75rem; }
  .itf-manual-header-row .modal-title { font-size: 1rem; }
  .itf-manual-search input[type="search"] { height: 40px; font-size: 16px; /* avoid iOS zoom */ }

  .itf-manual-body {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .itf-manual-sidebar {
    position: absolute;
    top: 0;
    left: 0;
    width: min(86vw, 320px);
    height: 100%;
    max-height: 100%;
    transform: translateX(-105%);
    transition: transform .25s ease;
    z-index: 20;
    box-shadow: 4px 0 18px rgba(15, 23, 42, .18);
  }
  .itf-manual-sidebar.is-open { transform: translateX(0); }
  .itf-manual-sidebar-backdrop { display: block; }

  .itf-manual-main {
    max-height: none;
    padding: .85rem .9rem 1.1rem;
  }
  .itf-manual-article { padding: .9rem 1rem 1.1rem; }
  .itf-manual-article-title-large { font-size: 1.15rem; }

  /* Stack prev/next cards vertically */
  .itf-manual-nav-cards { grid-template-columns: 1fr; }
  .itf-manual-nav-card { padding: .8rem 1rem; }

  /* Compact top-nav buttons (still side-by-side) */
  .itf-manual-nav-mini { padding: .45rem .65rem; font-size: .85rem; }

  /* Tables become scrollable horizontally */
  .manual-article-body table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  .manual-article-body table td,
  .manual-article-body table th { white-space: normal; }

  /* Search results spacing */
  .itf-manual-result-head {
    flex-direction: column;
    align-items: flex-start;
    gap: .25rem;
  }
}

/* iPad / small tablets fine-tune */
@media (min-width: 768px) and (max-width: 991.98px) {
  .itf-manual-body { grid-template-columns: 240px 1fr; }
  .itf-manual-main { padding: .9rem 1rem 1.1rem; }
}

