/* ============================================================================
   ADMIN SAMPLE — DESIGN SYSTEM STYLESHEET (2026)
   ----------------------------------------------------------------------------
   Companion to Tailwind CDN utilities. Everything here is either:
     a) a design token (CSS variable),
     b) a reusable component class (.input-flat, .btn, .switch …), or
     c) an override that themes a third-party plugin (Flatpickr, Tom Select)
        to match the design language.
   Full documentation: DESIGN_SYSTEM_2026.md

   TABLE OF CONTENTS
     1. Design tokens (CSS variables)
     2. Base & typography
     3. Global form-control typography
     4. Layout — sidebar, topbar, main column
     5. Forms — inputs, input groups, labels, checks, switches, validation
     6. Buttons — component classes
     7. Flatpickr — calendar theme + range presets + stacked mobile view
        (⚠ order-sensitive: day-state rules resolve !important ties by
         position; do not reorder inside this section)
     8. Tom Select — control, dropdown panel, multi-select chips
     9. Tables — sortable header
    10. Responsive notes — media queries live NEXT TO their component
        (component-local breakpoints beat one giant mobile block)
   ========================================================================== */


/* ============================================================================
   1. DESIGN TOKENS
   ========================================================================== */
:root {
  --accent:          #13464b;   /* theme colour (deep teal) */
  --accent-dark:     #0e3539;   /* hover/pressed accent */
  --accent-tint:     #e8f0f1;   /* light accent wash (range band, hovers) */
  --accent-border:   #bcd2d5;   /* border for tinted surfaces */
  --border:          #dde3e8;   /* THE 1px border colour, used everywhere */
  --radius:          0.375rem;  /* THE corner radius for all controls */
  --input-font-size: 14px;      /* ONE global size for every form control */

  --sidebar-bg:      #24323b;   /* dark slate sidebar */
  --card-header-bg:  #66707A;   /* card header grey */
  --page-bg:         #e9edf1;   /* app background */
  --danger:          #f43f5e;   /* rose-500 — validation errors */
  --success:         #10b981;   /* emerald-500 — validation success */
}


/* ============================================================================
   2. BASE & TYPOGRAPHY
   ========================================================================== */
html { scroll-behavior: smooth; }


/* ============================================================================
   3. GLOBAL FORM-CONTROL TYPOGRAPHY
   ----------------------------------------------------------------------------
   Controlled by the single --input-font-size variable (14px desktop AND
   mobile). Applies to text/password/number/search inputs, textareas,
   native selects, Tom Select controls and the date/range picker inputs.
   (Pinch-zoom is disabled via the viewport meta, so iOS does not
   auto-zoom on focus even below 16px.)
   ========================================================================== */
input, select, textarea,
.ts-control, .ts-control input, .ts-wrapper .ts-control > .item, .ts-dropdown .dropdown-input {
  font-size: var(--input-font-size) !important;
}


/* ============================================================================
   4. LAYOUT — SIDEBAR (mobile drawer + desktop icon-rail collapse)
   ========================================================================== */
#sidebar { transition: transform .2s ease, width .2s ease; }
#main-wrap { transition: padding-left .2s ease; }

/* Mobile drawer — hidden off-canvas by DEFAULT in plain CSS so the
   sidebar can never flash on first paint. (Tailwind Play generates
   utility classes at runtime — one frame too late for JS-injected
   markup, which made the sidebar appear and animate away on load.)
   body.sb-open slides it in over the backdrop. */
#sidebar-overlay { display: none; }
@media (max-width: 1023.98px) {
  #sidebar { transform: translateX(-100%); }
  body.sb-open #sidebar { transform: translateX(0); }
  body.sb-open #sidebar-overlay { display: block; }
}

@media (min-width: 1024px) {
  body.sb-collapsed #sidebar { width: 3.5rem; }
  body.sb-collapsed #main-wrap { padding-left: 3.5rem; }
  body.sb-collapsed #sidebar .sb-label,
  body.sb-collapsed #sidebar .sb-section { display: none; }
  body.sb-collapsed #sidebar nav a { justify-content: center; padding-left: 0; padding-right: 0; }
  body.sb-collapsed #sidebar .sb-brand { justify-content: center; padding-left: 0; padding-right: 0; }
}


/* ============================================================================
   5. FORMS
   ========================================================================== */

/* ---- Field label (uppercase micro-label above every control) ---- */
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .025em;
  color: #6b7280;
  margin-bottom: 4px;
}
.form-hint { font-size: 11px; color: #6b7280; margin-top: 4px; }

/* ---- Flat text input (28px desktop / 36px mobile) ---- */
.input-flat {
  width: 100%;
  height: 28px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 8px;
  color: #1f2937;
  outline: none;
  box-shadow: none !important;
}
.input-flat:focus { border-color: var(--accent); box-shadow: none !important; }
.input-flat::placeholder { color: #9ca3af; }
.input-flat:disabled, .input-flat[readonly] { background: #f3f5f7; color: #6b7280; cursor: not-allowed; }
.input-flat[readonly] { cursor: default; }
@media (max-width: 639px) { .input-flat { height: 36px; } }

/* ---- Multi-line variant ---- */
textarea.input-flat { height: auto; min-height: 72px; padding: 6px 8px; resize: vertical; line-height: 1.45; }

/* ---- Input group: icon/button cell attached LEFT of the input.
   .ig-btn  = interactive (opens the date picker WITHOUT focusing the
              text input, so no mobile keyboard)
   .ig-icon = decorative prefix (@, $, phone …) ---- */
.ig-btn, .ig-icon {
  flex: none;
  width: 32px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #f3f5f7;
  border: 1px solid var(--border);
  border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  color: #4b5563;
  font-size: 12px;
}
.ig-btn { cursor: pointer; }
.ig-btn:hover { background: #e9edf0; color: var(--accent); }
.ig-input { border-radius: 0 var(--radius) var(--radius) 0; }
@media (max-width: 639px) { .ig-btn, .ig-icon { height: 36px; width: 38px; } }

/* ---- Checkboxes & radios (native, accent-tinted) ---- */
input[type="checkbox"].check-flat,
input[type="radio"].check-flat {
  width: 15px; height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}
.check-row { display: flex; align-items: center; gap: 8px; min-height: 26px; font-size: 13px; color: #374151; cursor: pointer; }
.check-row:hover { color: #111827; }

/* ---- Toggle switch (pure CSS) ---- */
.switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  width: 34px; height: 19px;
  background: #cbd5e1;
  border-radius: 9999px;
  transition: background .15s ease;
  flex: none;
}
.switch .track::after {
  content: '';
  position: absolute; top: 2.5px; left: 3px;
  width: 14px; height: 14px;
  background: #fff; border-radius: 9999px;
  transition: transform .15s ease;
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent-border); }

/* ---- File input ---- */
.file-flat { width: 100%; font-size: 12px !important; color: #6b7280; }
.file-flat::file-selector-button {
  height: 28px; margin-right: 10px; padding: 0 12px;
  background: #f3f5f7; color: #374151;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 12px; font-weight: 600; font-family: inherit; cursor: pointer;
}
.file-flat::file-selector-button:hover { background: #e9edf0; }

/* ---- Range slider ---- */
input[type="range"].range-flat { width: 100%; accent-color: var(--accent); cursor: pointer; }

/* ---- Validation states ---- */
.is-invalid, .is-invalid:focus { border-color: var(--danger) !important; }
.is-valid, .is-valid:focus { border-color: var(--success) !important; }
.msg-invalid { font-size: 11px; color: var(--danger); margin-top: 4px; }
.msg-valid { font-size: 11px; color: var(--success); margin-top: 4px; }


/* ============================================================================
   6. BUTTONS — component classes (28px desktop / 36px mobile)
   ========================================================================== */
.btn {
  height: 28px;
  padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid;
  border-radius: var(--radius);
  font-family: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  text-decoration: none;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-secondary { background: #66707A; border-color: #66707A; color: #fff; }
.btn-secondary:hover:not(:disabled) { background: #57616b; border-color: #57616b; }
.btn-success { background: #059669; border-color: #059669; color: #fff; }
.btn-success:hover:not(:disabled) { background: #047857; border-color: #047857; }
.btn-warning { background: #f59e0b; border-color: #f59e0b; color: #fff; }
.btn-warning:hover:not(:disabled) { background: #d97706; border-color: #d97706; }
.btn-danger { background: #e11d48; border-color: #e11d48; color: #fff; }
.btn-danger:hover:not(:disabled) { background: #be123c; border-color: #be123c; }
.btn-outline { background: #fff; border-color: var(--border); color: #374151; }
.btn-outline:hover:not(:disabled) { background: #f3f5f7; }
.btn-tint { background: var(--accent-tint); border-color: var(--accent-border); color: var(--accent); }
.btn-tint:hover:not(:disabled) { background: var(--accent-border); }
.btn-icon { width: 28px; padding: 0; }             /* square icon-only button */
.btn-block { width: 100%; }
@media (max-width: 639px) { .btn { height: 36px; } .btn-icon { width: 36px; } }


/* ============================================================================
   7. FLATPICKR — compact, square-ish calendar.
   ----------------------------------------------------------------------------
   ⚠ ORDER-SENSITIVE SECTION. Day-state colours use !important because
   flatpickr's stock sheet styles :focus / .today / .inRange with higher
   specificity; equal-importance ties are resolved by source order, so
   keep .today rules BEFORE the .selected group, and the .fp-filler
   continuity rules AFTER the base .fp-filler rule.
   ========================================================================== */
.flatpickr-calendar {
  width: auto;
  box-shadow: none !important;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  z-index: 25 !important;   /* below the sticky top bar (z-30) so it can never cover it */
}
.flatpickr-calendar.ih-modal-calendar {
  z-index: 90 !important;   /* modal date filters must sit above backdrop z-80 */
}
.flatpickr-calendar.arrowTop:before, .flatpickr-calendar.arrowTop:after,
.flatpickr-calendar.arrowBottom:before, .flatpickr-calendar.arrowBottom:after { display: none; }

/* Grid: 7 × 32px columns, 28px-tall day cells (desktop).
   .flatpickr-days ships overflow:hidden and sizes itself to the FIRST
   month — a 6-week month beside a 5-week month got its last row
   clipped. Fix: auto height + consistent 6-row min-height. */
.flatpickr-days {
  width: auto;
  height: auto !important;
  overflow: visible !important;
  align-items: flex-start;
}
.dayContainer {
  width: 224px; min-width: 224px; max-width: 224px;
  padding: 2px 0 4px;
  min-height: 178px;                 /* 6 rows × 28px + padding */
  align-content: flex-start;
}
.flatpickr-day {
  max-width: 32px;
  height: 28px;
  line-height: 28px;
  font-size: 12px;
  border-radius: 3px;
}
@media (max-width: 639px) {
  .flatpickr-calendar { max-width: calc(100vw - 12px); }
  .dayContainer { width: 266px; min-width: 266px; max-width: 266px; min-height: 214px; }
  .flatpickr-day { max-width: 38px; height: 34px; line-height: 34px; font-size: 13px; }
  .fp-footer { flex-wrap: wrap; row-gap: 6px; }
}
span.flatpickr-weekday { font-size: 11px; font-weight: 600; color: #374151; }

/* Header row — month nav arrows vertically centred on the text */
.flatpickr-months { padding: 6px 2px 2px; align-items: center; position: relative; }
.flatpickr-months .flatpickr-month { height: 30px; }
.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 26px; width: 32px;
  padding: 0;
  display: flex; align-items: center; justify-content: center;
  color: #374151;
}
.flatpickr-months .flatpickr-prev-month svg,
.flatpickr-months .flatpickr-next-month svg { width: 10px; height: 10px; }
.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg { fill: var(--accent); }

.flatpickr-current-month {
  display: flex; align-items: center; justify-content: center;
  gap: 5px; padding: 0; height: 28px; font-size: 13px;
}
/* Single picker: month + year as bordered dropdown boxes */
.flatpickr-current-month .flatpickr-monthDropdown-months {
  -webkit-appearance: menulist; appearance: menulist;
  border: 1px solid var(--border) !important;
  border-radius: 3px;
  background: #fff;
  font-size: 12px !important; font-weight: 500; color: #1f2937;
  height: 24px; padding: 0 2px 0 5px; margin: 0;
}
.flatpickr-current-month .numInputWrapper {
  border: 1px solid var(--border);
  border-radius: 3px;
  background: #fff; height: 24px; width: 64px;
}
.flatpickr-current-month input.cur-year {
  font-size: 12px !important; font-weight: 500; color: #1f2937;
  height: 22px;
  text-align: center;                 /* year centred */
  padding: 0 14px 0 2px;              /* compensates the arrow column */
}
/* Year spinner arrows: ALWAYS visible on the single picker
   (stock only reveals them on hover) */
.flatpickr-calendar:not(.fp-range) .numInputWrapper span {
  opacity: 1 !important;
  border: 0;
  border-left: 1px solid var(--border);
  width: 14px;
}
.flatpickr-calendar:not(.fp-range) .numInputWrapper span:hover { background: var(--accent-tint); }
/* Range picker (.fp-range): plain bold "Jul 2026" text headers */
.fp-range .flatpickr-current-month .cur-month { font-size: 13px; font-weight: 600; color: #111827; }
.fp-range .flatpickr-current-month .numInputWrapper {
  border: none; background: transparent; width: 46px; height: auto;
}
.fp-range .flatpickr-current-month input.cur-year { font-weight: 600; color: #111827; text-align: left; padding: 0; }

/* Time picker (enableTime + noCalendar) */
.flatpickr-calendar.hasTime .flatpickr-time { border-top: 1px solid var(--border); }
.flatpickr-time input { font-size: 13px !important; color: #1f2937; }
.flatpickr-time input:focus { background: var(--accent-tint); }

/* ---------- Day states (all !important — see note above) ---------- */
.flatpickr-day:hover { background: #f3f4f6 !important; border-color: #f3f4f6 !important; }
.flatpickr-day.today { border-color: var(--accent) !important; }
.flatpickr-day.today:hover, .flatpickr-day.today:focus {
  background: var(--accent-tint) !important;
  border-color: var(--accent) !important;
  color: #1f2937 !important;
}
.flatpickr-day.inRange {
  background: var(--accent-tint) !important;
  border-color: var(--accent-tint) !important;
  color: #1f2937 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}
.flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange,
.flatpickr-day.selected:hover, .flatpickr-day.startRange:hover, .flatpickr-day.endRange:hover,
.flatpickr-day.selected:focus, .flatpickr-day.startRange:focus, .flatpickr-day.endRange:focus {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
  box-shadow: none !important;
}
.flatpickr-day.startRange { border-radius: 3px 0 0 3px !important; }
.flatpickr-day.endRange   { border-radius: 0 3px 3px 0 !important; }
.flatpickr-day.startRange.endRange { border-radius: 3px !important; }
.flatpickr-day.flatpickr-disabled, .flatpickr-day.flatpickr-disabled:hover {
  background: transparent !important; color: #d1d5db !important;
}
/* Full date grid: adjacent-month overflow days shown muted.
   In multi-month mode flatpickr collapses these cells entirely
   (they take no space, shifting the whole grid) — restore them
   as real grid cells, muted and display-only */
.flatpickr-calendar.multiMonth .flatpickr-day.hidden {
  display: inline-block !important;
  visibility: visible !important;
  color: #c3cbd3 !important;
  background: transparent !important;
  border-color: transparent !important;
  pointer-events: none;
}
.flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay { color: #c3cbd3; }
/* JS-appended filler cells completing the 6th week (display-only) */
.flatpickr-day.fp-filler {
  color: #c3cbd3 !important;
  background: transparent !important;
  border-color: transparent !important;
  pointer-events: none;
  cursor: default;
}
/* Keep the range band CONTINUOUS across month edges: overflow
   duplicates and filler cells inside the selected range carry the
   tint (muted text) instead of punching holes in the highlight */
.flatpickr-calendar.multiMonth .flatpickr-day.hidden.inRange,
.flatpickr-day.fp-filler.inRange {
  background: var(--accent-tint) !important;
  border-color: var(--accent-tint) !important;
  border-radius: 0 !important;
}
.flatpickr-calendar.multiMonth .flatpickr-day.hidden.startRange,
.flatpickr-calendar.multiMonth .flatpickr-day.hidden.endRange,
.flatpickr-day.fp-filler.startRange,
.flatpickr-day.fp-filler.endRange {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
}

/* Two-month view: no divider between the months */
.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer + .dayContainer {
  box-shadow: none !important;
  border-left: 0;
}

/* ---------- Range presets (enterprise dashboard style) ----------
   Desktop: preset list docked LEFT of the two months, footer
   spanning underneath (PrimeVue / Flowbite Pro arrangement).
   The calendar becomes a grid only while open. */
.flatpickr-calendar.fp-range.open {
  display: grid;
  grid-template-columns: 132px auto;
  grid-template-areas:
    "presets months"
    "presets days"
    "footer  footer";
  width: auto !important;
}
.fp-range .flatpickr-months { grid-area: months; }
.fp-range .flatpickr-innerContainer { grid-area: days; }
.fp-range .fp-footer { grid-area: footer; }
.fp-presets {
  grid-area: presets;
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px;
  border-right: 1px solid var(--border);
  background: #f8fafb;
  border-radius: 4px 0 0 0;
}
.fp-preset-btn {
  text-align: left;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px; font-weight: 500; color: #374151;
  background: none; border: none; border-radius: 3px;
  padding: 6px 9px; cursor: pointer; white-space: nowrap;
}
.fp-preset-btn:hover { background: var(--accent-tint); color: var(--accent-dark); }
.fp-preset-btn.active { background: var(--accent); color: #fff; }

/* ---------- Mobile: the two months STACK vertically ----------
   The second month gets a JS-inserted title + weekday row
   (.fp-stack-head); the top header keeps only the first month and
   the ‹ arrow, › moves beside the second title.
   Fixed popup width = day grid (266px) + 1px border each side —
   width:auto sized the popup to the footer's PREFERRED one-line
   width and left dead space on the right after a selection. */
.flatpickr-calendar.fp-stacked { width: 268px !important; max-width: 268px !important; }
.fp-stacked .flatpickr-days { width: 266px !important; max-width: 266px !important; flex-wrap: wrap; }
.fp-stacked .flatpickr-innerContainer,
.fp-stacked .flatpickr-rContainer,
.fp-stacked .flatpickr-weekdays { width: 266px !important; max-width: 266px !important; }
.fp-stacked .flatpickr-months .flatpickr-month + .flatpickr-month,
.fp-stacked .flatpickr-weekdaycontainer + .flatpickr-weekdaycontainer,
.fp-stacked .flatpickr-months .flatpickr-next-month { display: none; }
.fp-stack-head { flex-basis: 100%; width: 100%; }
.fp-stack-title {
  position: relative; display: flex; align-items: center; justify-content: center;
  padding: 10px 0 4px; font-size: 13px; font-weight: 600; color: #111827;
  font-family: 'Inter', system-ui, sans-serif;
}
.fp-stack-title button {
  position: absolute; right: 2px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 26px; display: flex; align-items: center; justify-content: center;
  background: none; border: none; color: #374151; cursor: pointer; font-size: 11px;
}
.fp-stack-title button:hover { color: var(--accent); }
.fp-stack-weekdays { display: flex; padding-bottom: 2px; }
.fp-stack-weekdays span { flex: 1; text-align: center; font-size: 11px; font-weight: 600; color: #374151; }
.fp-stacked .fp-footer { flex-wrap: wrap; }
.fp-stacked .fp-footer .fp-label { flex-basis: 100%; margin: 0 0 5px; }
.fp-stacked .fp-footer button { flex: 1; height: 34px; }
/* Presets become a chip row above the stacked months on mobile */
.flatpickr-calendar.fp-stacked.fp-range.open {
  grid-template-columns: 1fr;
  grid-template-areas: "presets" "months" "days" "footer";
  width: 268px !important;
  max-width: 268px !important;
}
.fp-stacked .fp-presets {
  flex-direction: row; flex-wrap: wrap; gap: 4px;
  border-right: 0; border-bottom: 1px solid var(--border);
  border-radius: 4px 4px 0 0;
}
.fp-stacked .fp-preset-btn { font-size: 11px; padding: 5px 8px; border: 1px solid var(--border); background: #fff; }
.fp-stacked .fp-preset-btn:hover { background: var(--accent-tint); }
.fp-stacked .fp-preset-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Button bar (PrimeVue-style footer: label left, buttons right) */
.fp-footer {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 10px; border-top: 1px solid var(--border); font-size: 12px;
  background: #f8fafb;
  border-radius: 0 0 4px 4px;
}
.fp-footer .fp-label { margin-right: auto; color: #374151; font-weight: 500; }
.fp-footer button {
  height: 28px; padding: 0 12px; border-radius: 3px;
  font-size: 12px; font-weight: 600; border: 1px solid; cursor: pointer;
  font-family: inherit;
}
.fp-btn-plain { background: #fff; border-color: var(--border); color: #374151; }
.fp-btn-plain:hover { background: #f3f4f6; }
.fp-btn-tint { background: var(--accent-tint); border-color: var(--accent-border); color: var(--accent); }
.fp-btn-tint:hover { background: var(--accent-border); }
.fp-btn-solid { background: var(--accent); border-color: var(--accent); color: #fff; }
.fp-btn-solid:hover { background: var(--accent-dark); }


/* ============================================================================
   8. TOM SELECT — flat borders, theme accent, no shadows
   ========================================================================== */
.ts-wrapper .ts-control {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: none !important;
  min-height: 28px;
  padding: 2px 8px;
  background: #fff;
  color: #1f2937;
  display: flex;
  align-items: center;     /* vertical centring for text + chips */
  flex-wrap: wrap;
}
@media (max-width: 639px) {
  .ts-wrapper .ts-control { min-height: 36px; padding: 3px 9px; }
}
.ts-wrapper.focus .ts-control,
.ts-wrapper.dropdown-active .ts-control {
  border-color: var(--accent);
  box-shadow: none !important;
  border-radius: var(--radius);
}
/* Full 1px border incl. TOP — stock ships border-top:0, which
   left the panel's top corners looking broken/unclosed */
.ts-dropdown {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius);
  box-shadow: none !important;
  margin-top: 4px;
  font-size: var(--input-font-size);
  font-family: 'Inter', system-ui, sans-serif;
  overflow: hidden;                  /* children respect the rounded corners */
}
/* Square search box inside the dropdown */
.ts-dropdown .dropdown-input-wrap { padding: 7px; border-bottom: 1px solid var(--border); background: #f8fafb; }
.ts-dropdown .dropdown-input {
  border: 1px solid var(--border) !important;
  border-radius: 0 !important;
  height: 28px; padding: 0 8px;
  box-shadow: none !important;
  background: #fff;
}
.ts-dropdown .dropdown-input:focus { border-color: var(--accent) !important; }
/* Compact 25px option rows (desktop); larger for touch on phones */
.ts-dropdown .option {
  display: flex; align-items: center;
  min-height: 25px;
  padding: 3px 10px;
  line-height: 1.3;
}
@media (max-width: 639px) {
  .ts-dropdown .option { min-height: 34px; padding: 6px 12px; }
}
/* Hover / keyboard highlight = solid teal; the CURRENTLY SELECTED
   value = light tint + bold + check mark, so the two states differ */
.ts-dropdown .option.active { background: var(--accent); color: #fff; }
.ts-dropdown .option.selected { background: var(--accent-tint); color: var(--accent-dark); font-weight: 600; }
.ts-dropdown .option.selected.active { background: var(--accent); color: #fff; }
.ts-dropdown .option.selected::after {
  content: '\e070';                       /* Lucide check */
  font-family: lucide;
  font-weight: 900;
  font-size: 9px;
  margin-left: auto;
  opacity: .8;
}
/* "Create …" row when Tom Select is used in tags mode */
.ts-dropdown .create { padding: 6px 10px; font-size: 12px; color: #6b7280; }
.ts-dropdown .create:hover, .ts-dropdown .create.active { background: var(--accent-tint); color: var(--accent-dark); }

/* ---------- Multi-select chips ----------
   [ label · rounded-square × ] — the × is a 15px flex-centred box
   with its own hover state; chip text matches input typography. */
.ts-wrapper.plugin-remove_button.multi .ts-control > .item {
  display: inline-flex !important;
  align-items: center;
  height: 22px;
  margin: 2px 6px 2px 0;
  padding: 0 5px 0 9px !important;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  font-weight: 400;   /* match standard input typography */
  line-height: 1;
  white-space: nowrap;
  box-shadow: none !important;
}
.ts-wrapper.plugin-remove_button.multi .ts-control > .item.active {
  background: var(--accent-dark);
  color: #fff;
}
.ts-wrapper.plugin-remove_button.multi .ts-control > .item .remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  margin: 0 0 0 6px !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 4px;
  background: rgba(255,255,255,.14);
  color: rgba(255,255,255,.85);
  line-height: 1;
  text-decoration: none;
}
.ts-wrapper.plugin-remove_button.multi .ts-control > .item .remove:hover {
  background: rgba(255,255,255,.3);
  color: #fff;
}
.ts-wrapper.plugin-remove_button.multi .ts-control > .item .remove i {
  display: block;
  font-size: 8px !important;
  line-height: 1;
  pointer-events: none;
}
.ts-wrapper.multi .ts-control > input { height: 22px; margin: 2px 0; }
@media (max-width: 639px) {
  .ts-wrapper.plugin-remove_button.multi .ts-control > .item { height: 26px; }
  .ts-wrapper.plugin-remove_button.multi .ts-control > .item .remove { width: 18px; height: 18px; }
  .ts-wrapper.multi .ts-control > input { height: 26px; }
}


/* ============================================================================
   9. TABLES — sortable header (enterprise alignment)
   ========================================================================== */
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]:hover { background: #d9dde2; }
/* Fixed-height cells with the label and sort icon flex-centred on one
   line; the fa-sort-up/down glyphs sit high/low in their em box, so
   each gets a counter-nudge to look optically centred */
#table-head th { height: 36px; padding-top: 0; padding-bottom: 0; vertical-align: middle; }
#table-head th > span { display: inline-flex; align-items: center; gap: 6px; line-height: 1; vertical-align: middle; }
#table-head th i { display: inline-flex; align-items: center; justify-content: center; width: 12px; height: 12px; }
#table-head th i.fa-sort-up { transform: translateY(2px); }
#table-head th i.fa-sort-down { transform: translateY(-2px); }


/* ============================================================================
   10. RESPONSIVE — intentionally no giant mobile block here.
   Every component keeps its own @media (max-width: 639px) rules next to
   its base rules (see sections 5–8), so a component can be understood
   and modified in one place. Breakpoints used:
     < 640px   phones  (stacked calendar, 36px controls, card-table)
     ≥ 640px   tablet/desktop (side-by-side months, 28px controls)
     ≥ 1024px  desktop (fixed sidebar + collapse)
   ========================================================================== */


/* ============================================================================
   11. COLOR INPUT & FLOATING LABEL
   ========================================================================== */
.color-flat {
  width: 42px; height: 28px;
  padding: 2px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}
.color-flat::-webkit-color-swatch-wrapper { padding: 0; }
.color-flat::-webkit-color-swatch { border: none; border-radius: 3px; }
.color-flat::-moz-color-swatch { border: none; border-radius: 3px; }
/* Addon variant: swatch cell attached left of a hex text input */
.ig-color { width: 42px; border-radius: var(--radius) 0 0 var(--radius); border-right: 0; }
/* Middle cell of a 3-part input group (icon | input | button) */
.ig-mid { border-radius: 0 !important; }
/* Right-side attached button (e.g. password visibility toggle) */
.ig-r {
  border-left: 0 !important;
  border-right: 1px solid var(--border) !important;
  border-radius: 0 var(--radius) var(--radius) 0 !important;
}
@media (max-width: 639px) { .color-flat, .ig-color { height: 36px; } }

/* Floating label: <div class="float-group"><input placeholder=" ">…<label> */
.float-group { position: relative; }
.float-group .input-flat { height: 38px; padding-top: 12px; }
.float-group label {
  position: absolute; left: 9px; top: 50%;
  transform: translateY(-50%);
  font-size: 13px; color: #9ca3af;
  pointer-events: none;
  transition: all .12s ease;
}
.float-group .input-flat:focus + label,
.float-group .input-flat:not(:placeholder-shown) + label {
  top: 5px; transform: none;
  font-size: 9px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .03em;
  color: var(--accent);
}


/* ============================================================================
   12. BADGES — status pills (emerald/slate/amber/rose/sky)
   ========================================================================== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border: 1px solid;
  border-radius: var(--radius);
  font-size: 11px; font-weight: 600; line-height: 1.4;
  white-space: nowrap;
}
.badge i { font-size: 10px; }
.badge-success    { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.badge-pending    { background: #f1f5f9; border-color: #e2e8f0; color: #475569; }
.badge-warning    { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.badge-error      { background: #fff1f2; border-color: #fecdd3; color: #e11d48; }
.badge-processing { background: #f0f9ff; border-color: #bae6fd; color: #0284c7; }


/* ============================================================================
   13. ALERTS — flat tinted panels with icon (role="alert" in markup)
   ========================================================================== */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px;
  border: 1px solid;
  border-radius: var(--radius);
  font-size: 12px; line-height: 1.5;
}
.alert > i { margin-top: 2px; font-size: 13px; }
.alert-title { display: block; font-weight: 700; margin-bottom: 1px; }
.alert-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.alert-success > i { color: #059669; }
.alert-error   { background: #fff1f2; border-color: #fecdd3; color: #9f1239; }
.alert-error > i { color: #e11d48; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-warning > i { color: #d97706; }
.alert-info    { background: #f0f9ff; border-color: #bae6fd; color: #075985; }
.alert-info > i { color: #0284c7; }


/* ============================================================================
   14. MODAL — opened via [data-modal-open="#id"], closed via
   [data-modal-close], backdrop click or Escape (wired in app.js)
   ========================================================================== */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 80;   /* above sidebar (50) and topbar (30) */
  display: none;
  align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .45);
  padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal {
  width: 100%; max-width: 400px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.modal-header {
  display: flex; align-items: center; gap: 8px;
  height: 39px; padding: 0 12px;
  background: var(--card-header-bg); color: #fff;
  border-radius: 5px 5px 0 0;
  font-size: 13px; font-weight: 700;
}
.modal-x {
  margin-left: auto;
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: 4px;
  color: rgba(255,255,255,.8); font-size: 12px; cursor: pointer;
}
.modal-x:hover { background: rgba(255,255,255,.15); color: #fff; }
.modal-body { padding: 12px; font-size: 13px; color: #374151; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: #f8fafb;
  border-radius: 0 0 5px 5px;
}


/* ============================================================================
   15. TABS — role="tablist"/"tab"/"tabpanel"; selection + arrow-key
   navigation wired in app.js via [data-tab-target]
   ========================================================================== */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); }
.tab-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  background: none; border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: inherit; font-size: 12px; font-weight: 600;
  color: #6b7280; cursor: pointer;
}
.tab-btn:hover { color: var(--accent); }
.tab-btn[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { padding: 12px 2px 2px; font-size: 12px; color: #4b5563; }
.tab-panel[hidden] { display: none; }


/* ============================================================================
   16. ACCORDION — native <details>/<summary> (keyboard + screen-reader
   accessible with zero JS)
   ========================================================================== */
.acc { border: 1px solid var(--border); border-radius: var(--radius); }
.acc + .acc { margin-top: 8px; }
.acc summary {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px;
  font-size: 12px; font-weight: 600; color: #374151;
  background: #f8fafb;
  border-radius: var(--radius);
  cursor: pointer;
  list-style: none;
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary .acc-chev { margin-left: auto; font-size: 10px; color: #9ca3af; transition: transform .15s ease; }
.acc[open] summary { border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; }
.acc[open] .acc-chev { transform: rotate(90deg); }
.acc-body { padding: 10px 12px; font-size: 12px; color: #4b5563; line-height: 1.6; }


/* ============================================================================
   17. LOADING — spinner + skeleton shimmer
   ========================================================================== */
.spinner {
  display: inline-block;
  width: 22px; height: 22px;
  border: 2px solid var(--accent-tint);
  border-top-color: var(--accent);
  border-radius: 9999px;
  animation: app-spin .7s linear infinite;
}
.spinner-sm { width: 14px; height: 14px; }
.spinner-lg { width: 32px; height: 32px; border-width: 3px; }
@keyframes app-spin { to { transform: rotate(360deg); } }

.skeleton {
  position: relative; overflow: hidden;
  background: #e9edf1;
  border-radius: 4px;
}
/* ============================================================================
   18. ONEHUB — SPA page transitions + toasts
   ========================================================================== */
#page-content { animation:none; }
#page-content.page-loading { opacity:1; pointer-events:none; transition:none; }
@keyframes page-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

.toast-in  { animation: toast-in .18s ease-out; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.toast-out { opacity: 0; transform: translateX(8px); transition: all .35s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }

/* ============================================================================
   19. INFOHUB — dropzone, collapse, lightbox, rich-note content, print
   ========================================================================== */
.ih-dragover { border-color: var(--accent) !important; background: var(--accent-tint) !important; }

.ih-collapsed .ih-collapse-body { display: none; }
.ih-collapsed .ih-chev { transform: rotate(0deg); }
[data-collapse-id]:not(.ih-collapsed) .ih-chev { transform: rotate(90deg); }

.ih-lightbox {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.82);
  cursor: zoom-out; padding: 16px;
}
.ih-lightbox img {
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 48px);
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
  cursor: default;
}
.ih-lightbox-close {
  position: fixed;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 999px;
  background: rgba(15,23,42,.85);
  color: #fff;
  cursor: pointer;
}
.ih-lightbox-close:hover { background: #fff; color: #111827; }

/* Rich-note display styling, scoped to .ih-rich.
   Quill uses zero paragraph margins; keep display output identical to editor.
   Empty paragraphs still create intentional blank lines through line-height. */
.ih-rich { line-height: 1.45; }
.ih-rich h1, .ih-rich h2, .ih-rich h3 { font-weight: 700; color: #111827; margin: 12px 0 6px; }
.ih-rich h1 { font-size: 17px; } .ih-rich h2 { font-size: 15px; } .ih-rich h3 { font-size: 14px; }
.ih-rich p { margin: 0; padding: 0; min-height: 0; line-height: inherit; }
.ih-rich ul { list-style: disc; padding-left: 20px; margin: 6px 0; }
.ih-rich ol { list-style: decimal; padding-left: 20px; margin: 6px 0; }
.ih-rich a { color: var(--accent); text-decoration: underline; }
.ih-rich blockquote { border-left: 3px solid var(--accent-border); background: #f8fafb; margin: 8px 0; padding: 6px 10px; color: #4b5563; }
.ih-rich table { border-collapse: collapse; margin: 8px 0; max-width: 100%; }
.ih-rich td, .ih-rich th { border: 1px solid var(--border); padding: 4px 8px; }
.ih-rich th { background: #f1f5f9; font-weight: 600; }
.ih-rich img {
  display: inline-block !important;
  max-width: 100%; height: auto;
  vertical-align: -0.15em !important;
  margin: 0 .08em !important;
  border-radius: 4px; cursor: zoom-in;
}
.ih-rich pre {
  position: relative;
  background: #24323b; color: #e2e8f0;
  border-radius: 4px; padding: 10px 12px; margin: 8px 0;
  font-size: 12px; line-height: 1.55;
  overflow-x: auto; white-space: pre-wrap; word-break: break-word;
}
.ih-rich code { background: #f1f5f9; border: 1px solid var(--border); border-radius: 3px; padding: 1px 4px; font-size: 12px; }
.ih-rich pre code { background: none; border: 0; padding: 0; color: inherit; }
.ih-code-copy {
  position: absolute; top: 6px; right: 6px;
  height: 22px; padding: 0 8px;
  background: rgba(255,255,255,.12); color: #cbd5e1;
  border: none; border-radius: 3px;
  font-size: 10px; font-weight: 600; font-family: inherit; cursor: pointer;
}
.ih-code-copy:hover { background: rgba(255,255,255,.25); color: #fff; }

/* Single-row popular-tags strip: horizontal scroll, slim scrollbar */
.ih-tagrow { scrollbar-width: thin; }
.ih-tagrow::-webkit-scrollbar { height: 4px; }
.ih-tagrow::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }

/* ---------- PRINT / PDF: clean professional A4 layout ---------- */
.ih-print-header { display: none; }
@media print {
  @page { size: A4; margin: 18mm 16mm; }
  #sidebar, #sidebar-overlay, header, #toasts, .modal-backdrop,
  .ih-no-print, #page-content > .flex:first-child { display: none !important; }
  #main-wrap { padding-left: 0 !important; }
  main { padding: 0 !important; }
  body { background: #fff !important; font-size: 12px; color: #111; }

  .ih-print-header { display: block !important; border-bottom: 2px solid #13464b; margin-bottom: 14px; padding-bottom: 8px; }
  .ih-print-header h1 { font-size: 20px; font-weight: 700; color: #13464b; margin: 0 0 4px; }
  .ih-print-meta { font-size: 10px; color: #555; margin: 0; }

  #page-content { display: block !important; animation: none !important; }
  #page-content .grid { display: block !important; }
  section { border: 1px solid #ddd !important; border-radius: 0 !important; margin: 0 0 12px !important; break-inside: avoid-page; }
  section > div:first-child { background: #f1f5f9 !important; color: #111 !important; border-bottom: 1px solid #ddd !important; }
  section h2 { color: #111 !important; }
  section h2 span { color: #555 !important; }
  section .fa, section .fas, section .far { color: #555 !important; }
  .ih-child { break-inside: avoid-page; }
  .ih-collapsed .ih-collapse-body { display: block !important; } /* print everything */
  .ih-rich pre { background: #f4f6f8 !important; color: #111 !important; border: 1px solid #ddd; }
  .ih-plain { background: #f8fafb !important; }
  a { color: #0e3539 !important; text-decoration: none !important; }
  img { max-width: 60% !important; }
}

.skeleton::after {
  content: '';
  position: absolute; inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent);
  animation: app-shimmer 1.4s infinite;
}
@keyframes app-shimmer { 100% { transform: translateX(100%); } }

/* ==========================================================================
   QUILL 2 (InfoHub rich note) — flat theme per DESIGN_SYSTEM_2026.md:
   1px --border only, no shadows, --radius, Inter at 13px.
   ========================================================================== */
.ih-quill { background: #fff; }
.ql-toolbar.ql-snow {
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  background: #f8fafb;
  font-family: inherit;
  padding: 5px 6px;
}
.ql-container.ql-snow {
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  font-family: inherit;
  font-size: 13px;
  box-shadow: none !important;
}
.ih-quill .ql-editor { min-height: 260px; line-height: 1.6; }
.ih-quill .ql-editor.ql-blank::before { color: #9ca3af; font-style: normal; }
.ql-snow .ql-tooltip {
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
  border-radius: var(--radius);
  font-family: inherit;
  z-index: 25; /* below the sticky topbar (z-30), same rule as Flatpickr */
}
.ql-snow .ql-picker-options {
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
  border-radius: var(--radius);
}
.ql-snow a, .ql-snow .ql-toolbar button:hover .ql-stroke { color: var(--accent); }
.ql-snow .ql-toolbar button:hover .ql-stroke,
.ql-snow.ql-toolbar button:hover .ql-stroke,
.ql-snow .ql-toolbar button.ql-active .ql-stroke,
.ql-snow.ql-toolbar button.ql-active .ql-stroke { stroke: var(--accent); }
.ql-snow .ql-toolbar button:hover .ql-fill,
.ql-snow.ql-toolbar button:hover .ql-fill,
.ql-snow .ql-toolbar button.ql-active .ql-fill,
.ql-snow.ql-toolbar button.ql-active .ql-fill { fill: var(--accent); }
.ql-editor img {
  display: inline-block !important;
  max-width: 100%;
  vertical-align: -0.15em !important;
  margin: 0 .08em !important;
  border-radius: var(--radius);
}

/* ---- Quill image resize overlay (flat, teal) ---- */
.ih-quill { position: relative; }
.ih-resize-overlay {
  position: absolute;
  border: 1px dashed var(--accent);
  pointer-events: none;
  z-index: 5;
}
.ih-resize-label {
  position: absolute;
  top: -22px; left: 0;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
}
.ih-resize-handle {
  position: absolute;
  right: -6px; bottom: -6px;
  width: 14px; height: 14px;
  background: #fff;
  border: 1px solid var(--accent);
  border-radius: 3px;
  cursor: nwse-resize;
  pointer-events: auto;
  touch-action: none;
}
@media (max-width: 639px) { .ih-resize-handle { width: 20px; height: 20px; right: -9px; bottom: -9px; } }

/* ---- Right-attached input-group button (e.g. main-picture Browse):
   mirror of .ig-btn but attached to the RIGHT edge, with its own right
   border and right-side radius. Auto width for a text label. ---- */
.ig-btn-r {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  height: 28px; padding: 0 12px;
  background: #f3f5f7;
  border: 1px solid var(--border);
  border-left: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 12px; font-weight: 600; color: #4b5563;
  cursor: pointer; white-space: nowrap;
}
.ig-btn-r:hover { background: #e9edf0; color: var(--accent); }
@media (max-width: 639px) { .ig-btn-r { height: 36px; } }

/* ---- InfoHub filter row: the multi Tom Select control grows to ~30px
   once a chip is present (22px chip + padding + border) — pin BOTH the
   search input and the tag control to 30px so the row lines up. ---- */
@media (min-width: 640px) {
  .ih-filter .input-flat { height: 30px; }
  .ih-filter .ts-wrapper .ts-control { min-height: 30px; }
  .ih-filter .btn { height: 30px; }
}
/* InfoHub DataTables: clear spreadsheet-style row and column boundaries. */
#infohub-table {
  border-collapse: collapse !important;
  border: 1px solid #b8c2ca !important;
}
#infohub-table thead th,
#infohub-table tbody td {
  border: 1px solid #c7d0d7 !important;
  vertical-align: middle;
  padding: 7px 9px;
}
#infohub-table thead th {
  background: #eef2f4;
  color: #263238;
}
#infohub-table tbody tr:nth-child(odd) > td {
  background: #ffffff !important;
}
#infohub-table tbody tr:nth-child(even) > td {
  background: #eaf1f3 !important;
}
#infohub-table tbody tr:hover > td {
  background: #dce9ec !important;
}

/* Attachment-library modal pagination is loaded after Tailwind's first scan. */
.ih-library-pagination {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: #fff;
}
.ih-library-pagination-info {
  color: #64748b;
  font-size: 11px;
}
.ih-library-pages {
  display: flex;
  align-items: center;
  gap: 4px;
}
.ih-library-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border: 1px solid #dde3e8;
  border-radius: 6px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 500;
}
.ih-library-page i {
  font-size: 10px;
}
.ih-library-page:hover:not(:disabled) {
  background: #e8f0f1;
  color: #13464b;
}
.ih-library-page.active {
  border-color: #13464b;
  background: #13464b;
  color: #fff;
}
.ih-library-page:disabled {
  cursor: not-allowed;
  border-color: #dde3e8;
  background: #f6f8fa;
  color: #cbd5e1;
}
@media (min-width: 640px) {
  .ih-library-pagination {
    padding-right: 12px;
    padding-left: 12px;
  }
  .ih-library-page {
    min-width: 28px;
    height: 28px;
  }
}

/* Compact navigation proportions from the supplied sidebar reference. */
#sidebar { width:232px; max-width:calc(100vw - 48px); }
#sidebar nav { padding:12px 8px; }
#sidebar nav>a,#sidebar nav>div>a { height:32px; gap:10px; padding-inline:10px; font-size:12px; }
#sidebar nav a>i { display:inline-flex; align-items:center; justify-content:center; width:16px; font-size:15px; }
#sidebar nav a>.sb-label { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#sidebar .sb-section { padding-inline:10px; font-size:10px; letter-spacing:.02em; text-transform:none; }
@media(min-width:1024px) { #main-wrap { padding-left:232px; } }

/* Keep normal dropdown borders without an extra focus halo. */
select:not([multiple]):focus,select:not([multiple]):focus-visible{outline:none;box-shadow:none!important}
.ts-wrapper.focus .ts-control,.ts-wrapper.dropdown-active .ts-control{border-color:var(--border);box-shadow:none!important;outline:none}

/* One chevron for native and searchable dropdowns; typography unchanged. */
:root{--dropdown-chevron:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23596675' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")}
select:not([multiple]),.ts-wrapper .ts-control{appearance:none!important;-webkit-appearance:none!important;background-image:var(--dropdown-chevron)!important;background-position:right 8px center!important;background-size:16px 16px!important;background-repeat:no-repeat!important;padding-right:30px!important}
.ts-wrapper.single .ts-control::after{display:none!important}
