/* ==========================================================================
   Theme: red + skin (warm beige) + black.
   Light: skin pages, white-ish cards, black sidebar, red accents.
   Dark : black pages, charcoal cards, red accents.
   ========================================================================== */
:root {
  --sidebar-w: 250px;
  --app-red: #c8102e;
  --app-red-dark: #9d0c24;
  --app-black: #141414;
  --app-skin: #f3e6d8;
  --app-skin-light: #fbf5ee;
  --app-skin-dark: #e6d2bd;
}

[data-bs-theme='light'] {
  --bs-body-bg: #fffaf5;
  --bs-body-bg-rgb: 255, 250, 245;
  --bs-body-color: #1c1917;
  --bs-secondary-bg: #ecdcc9;
  --bs-tertiary-bg: var(--app-skin);
  --bs-border-color: #e3d0bb;
  --bs-link-color: var(--app-red);
  --bs-link-color-rgb: 200, 16, 46;
  --bs-link-hover-color: var(--app-red-dark);
  --bs-link-hover-color-rgb: 157, 12, 36;
  --bs-focus-ring-color: rgba(var(--bs-primary-rgb), 0.25);
  --page-bg: var(--app-skin);
  --side-bg: var(--app-black);
}
[data-bs-theme='dark'] {
  --bs-body-bg: #181818;
  --bs-body-bg-rgb: 24, 24, 24;
  --bs-body-color: #f1ebe4;
  --bs-secondary-bg: #262626;
  --bs-tertiary-bg: #1f1f1f;
  --bs-border-color: #333;
  --bs-link-color: #ff6b7f;
  --bs-link-color-rgb: 255, 107, 127;
  --bs-link-hover-color: #ff93a1;
  --bs-link-hover-color-rgb: 255, 147, 161;
  --bs-focus-ring-color: rgba(255, 107, 127, 0.3);
  --page-bg: #0e0e0e;
  --side-bg: #000;
}

html,
body {
  font-family: 'Tajawal', system-ui, sans-serif;
}
body {
  background: var(--page-bg);
}

/* ---- Red primary everywhere Bootstrap hard-codes blue ---- */
.btn-primary {
  --bs-btn-bg: var(--app-red);
  --bs-btn-border-color: var(--app-red);
  --bs-btn-hover-bg: var(--app-red-dark);
  --bs-btn-hover-border-color: var(--app-red-dark);
  --bs-btn-active-bg: var(--app-red-dark);
  --bs-btn-active-border-color: var(--app-red-dark);
  --bs-btn-disabled-bg: var(--app-red);
  --bs-btn-disabled-border-color: var(--app-red);
  --bs-btn-color: #fff;
  --bs-btn-hover-color: #fff;
  --bs-btn-active-color: #fff;
}
.btn-outline-primary {
  --bs-btn-color: var(--app-red);
  --bs-btn-border-color: var(--app-red);
  --bs-btn-hover-bg: var(--app-red);
  --bs-btn-hover-border-color: var(--app-red);
  --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--app-red-dark);
  --bs-btn-active-border-color: var(--app-red-dark);
  --bs-btn-active-color: #fff;
  --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}
[data-bs-theme='dark'] .btn-outline-primary {
  --bs-btn-color: #ff6b7f;
  --bs-btn-border-color: #ff6b7f;
}
.btn-outline-secondary {
  --bs-btn-color: #3a332c;
  --bs-btn-border-color: #a8957f;
  --bs-btn-hover-bg: var(--app-black);
  --bs-btn-hover-border-color: var(--app-black);
  --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--app-black);
  --bs-btn-active-border-color: var(--app-black);
  --bs-btn-active-color: #fff;
}
[data-bs-theme='dark'] .btn-outline-secondary {
  --bs-btn-color: #d9cfc4;
  --bs-btn-border-color: #555;
  --bs-btn-hover-bg: #e9e2d9;
  --bs-btn-hover-color: #000;
}
.text-bg-primary,
.bg-primary {
  background-color: var(--app-red) !important;
  color: #fff !important;
}
.text-primary {
  color: var(--app-red) !important;
}
[data-bs-theme='dark'] .text-primary {
  color: #ff6b7f !important;
}
.border-primary {
  border-color: var(--app-red) !important;
}
.form-check-input:checked {
  background-color: var(--app-red);
  border-color: var(--app-red);
}
.form-control:focus,
.form-select:focus {
  border-color: var(--app-red);
  box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.18);
}
.btn-check:checked + .btn-outline-primary,
.btn-check:checked + .btn-outline-secondary {
  color: #fff;
}
.btn-check:checked + .btn-outline-secondary {
  background: var(--app-black);
  border-color: var(--app-black);
}
.page-item.active .page-link {
  background: var(--app-red);
  border-color: var(--app-red);
  color: #fff;
}
.page-link {
  color: var(--app-red);
}
.table-hover > tbody > tr:hover > * {
  --bs-table-hover-bg: rgba(var(--bs-primary-rgb), 0.05);
}

/* ---- Layout ---- */
.app-shell {
  display: flex;
  min-height: 100vh;
}
.app-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--side-bg);
  color: #e9e2d9;
  padding: 1rem;
  border-inline-end: 3px solid var(--app-red);
}
.app-sidebar .brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  text-decoration: none;
  margin-bottom: 1.5rem;
}
.app-sidebar .brand .bi {
  color: var(--app-red);
  font-size: 1.5rem;
}
/* An uploaded logo may be dark: it sits on a light plate so it shows on the black sidebar */
.app-sidebar .brand .brand-logo {
  max-height: 40px;
  max-width: 96px;
  object-fit: contain;
  background: #fff;
  border-radius: 6px;
  padding: 3px 5px;
}
.auth-logo {
  max-height: 64px;
  max-width: 220px;
  object-fit: contain;
}
.brand-preview {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-conic-gradient(#e9e2d9 0 25%, #fff 0 50%) 50% / 16px 16px;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.5rem;
  padding: 0.5rem;
}
.brand-preview img {
  max-height: 64px;
  max-width: 100%;
  object-fit: contain;
}
.brand-preview .favicon-preview {
  width: 32px;
  height: 32px;
}
.app-sidebar .nav-link {
  color: #d8cfc5;
  border-radius: 0.5rem;
  display: flex;
  gap: 0.6rem;
  align-items: center;
}
.app-sidebar .nav-link.active,
.app-sidebar .nav-link:hover {
  background: var(--app-red);
  color: #fff;
}
.app-sidebar .nav-section {
  font-size: 0.75rem;
  color: #9a8f84;
  margin: 1rem 0.5rem 0.25rem;
}
.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.app-topbar {
  display: flex;
  align-items: center;
  padding: 0.6rem 1rem;
  background: var(--bs-body-bg);
  border-bottom: 1px solid var(--bs-border-color);
}
.app-content {
  padding: 1.25rem;
}
.card {
  border-color: var(--bs-border-color);
  box-shadow: 0 1px 2px rgba(20, 20, 20, 0.04);
}
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--page-bg);
  padding: 1rem;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  border-top: 4px solid var(--app-red);
}
.lang-switch .btn {
  font-size: 0.8rem;
  padding-block: 0.15rem;
}

@media (max-width: 991.98px) {
  .app-sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    z-index: 1040;
    transition: transform 0.2s;
  }
  html[dir='rtl'] .app-sidebar {
    transform: translateX(100%);
  }
  html[dir='ltr'] .app-sidebar {
    transform: translateX(-100%);
  }
  .app-sidebar.open {
    transform: none !important;
  }
}

.pre-wrap {
  white-space: pre-wrap;
}
.company-results {
  z-index: 1050;
  max-height: 280px;
  overflow-y: auto;
}
.side-card {
  top: 1rem;
}
.badge[class*='type-'] {
  color: #fff;
}
.status-planned {
  background: var(--bs-secondary-bg);
  color: var(--bs-body-color);
}
.status-confirmed {
  background: #1f1f1f;
  color: #fff;
}
.status-completed {
  background: #198754;
  color: #fff;
}
.status-cancelled {
  background: var(--app-red);
  color: #fff;
}

/* ---- Calendar: big, readable event cards that show everything, each clearly separate from the next ---- */
.fc {
  --fc-border-color: #cdb79f;
  --fc-page-bg-color: var(--bs-body-bg);
  --fc-neutral-bg-color: var(--bs-tertiary-bg);
  --fc-today-bg-color: rgba(var(--bs-primary-rgb), 0.1);
  --fc-button-bg-color: var(--app-black);
  --fc-button-border-color: var(--app-black);
  --fc-button-hover-bg-color: var(--app-red);
  --fc-button-hover-border-color: var(--app-red);
  --fc-button-active-bg-color: var(--app-red-dark);
  --fc-button-active-border-color: var(--app-red-dark);
}
[data-bs-theme='dark'] .fc {
  --fc-border-color: #4a4a4a;
  --fc-today-bg-color: rgba(255, 107, 127, 0.14);
  --fc-button-bg-color: #2b2b2b;
  --fc-button-border-color: #5a5a5a;
}
[data-bs-theme='dark'] .fc .weekend-day {
  background: repeating-linear-gradient(135deg, #1b1b1b, #1b1b1b 8px, #272727 8px, #272727 16px);
}
.fc .fc-toolbar-title {
  font-size: 1.35rem;
  font-weight: 700;
}
/* Day-name row: a solid black band with a red underline */
.fc .fc-col-header-cell {
  background: var(--app-black);
  border-color: #3a3a3a;
}
.fc .fc-col-header {
  border-bottom: 3px solid var(--app-red);
}
.fc .fc-col-header-cell-cushion {
  color: #fff !important;
  padding: 0.5rem 0.25rem;
  font-weight: 700;
}
.fc .weekend-day {
  background: var(--bs-tertiary-bg);
}
[data-bs-theme='light'] .fc .weekend-day {
  background: repeating-linear-gradient(
    135deg,
    var(--app-skin),
    var(--app-skin) 8px,
    #efdfcd 8px,
    #efdfcd 16px
  );
}
.fc .fc-daygrid-day-frame {
  min-height: 140px;
}
.fc .fc-daygrid-day-top {
  border-bottom: 1px solid var(--fc-border-color);
  margin-bottom: 4px;
  background: rgba(0, 0, 0, 0.035);
}
.fc .fc-daygrid-day-number {
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.2rem 0.5rem;
}
.fc .fc-day-today .fc-daygrid-day-number {
  background: var(--app-red);
  color: #fff !important;
  border-radius: 0 0 0.5rem 0;
  padding-inline: 0.6rem;
}
.fc .fc-daygrid-day-events {
  padding-bottom: 6px;
}
/* Each audit is its own card: a white ring + shadow cuts it off from the neighbours */
.fc .fc-daygrid-event {
  white-space: normal;
  border-radius: 8px;
  margin: 0 4px 6px;
  padding: 0;
  box-shadow:
    0 0 0 2px var(--fc-page-bg-color),
    0 2px 5px rgba(0, 0, 0, 0.4);
}
.fc .fc-event {
  cursor: pointer;
  border-width: 0;
  border-inline-start: 6px solid rgba(0, 0, 0, 0.4);
}
.fc .fc-event:hover {
  box-shadow:
    0 0 0 2px var(--fc-page-bg-color),
    0 0 0 4px var(--app-red),
    0 3px 8px rgba(0, 0, 0, 0.45);
}
.fc .fc-event-main {
  padding: 0;
  color: #fff;
}
.fc .holiday-event {
  background: #fbe3e4;
  color: #842029;
  border-color: #f1aeb5;
}
.fc .holiday-event .fc-event-main {
  color: #842029;
  padding: 3px 8px;
}
[data-bs-theme='dark'] .fc .holiday-event {
  background: #3a1d20;
  border-color: #842029;
}
[data-bs-theme='dark'] .fc .holiday-event .fc-event-main {
  color: #ea868f;
}
.fc .audit-cancelled {
  opacity: 0.55;
  text-decoration: line-through;
}
.fc-ev {
  line-height: 1.35;
  font-size: 0.85rem;
}
.fc-ev-title {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: normal;
}
/* Audit cards: the audit type is a white pill with an icon, in the type colour */
.fc-ev-audit .fc-ev-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.fc-ev-type {
  background: #fff;
  border-radius: 999px;
  padding: 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.fc-ev-dates {
  font-size: 0.82rem;
  letter-spacing: 0.01em;
}
/* Audit cards: company name on a darker band, details underneath */
.fc-ev-audit .fc-ev-title {
  background: rgba(0, 0, 0, 0.28);
  padding: 4px 8px;
  border-start-start-radius: 2px;
  border-start-end-radius: 6px;
}
.fc-ev-body {
  padding: 4px 8px 6px;
}
.fc-ev-row {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  white-space: normal;
}
.fc-ev-row + .fc-ev-row {
  margin-top: 2px;
}
.fc-ev-row .bi {
  opacity: 0.85;
  flex-shrink: 0;
  margin-top: 0.15rem;
}
.fc-ev-tag {
  display: inline-block;
  background: rgba(255, 255, 255, 0.24);
  border-radius: 4px;
  padding: 0 0.35rem;
  margin-inline-end: 0.2rem;
  font-size: 0.75rem;
}
.fc-ev-foot {
  opacity: 0.95;
  font-size: 0.75rem;
  margin-top: 3px;
  padding-top: 3px;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
}
/* List view: events have no coloured background there, so the card parts use neutral tints */
.fc-list-event .fc-ev-audit .fc-ev-title {
  background: none;
  padding-inline: 0;
}
.fc-list-event .fc-ev-body {
  padding-inline: 0;
}
.fc-list-event .fc-ev-tag {
  background: var(--bs-secondary-bg);
}
.fc-list-event .fc-ev-foot {
  border-top-color: var(--bs-border-color);
}
/* Phones: the month / week grid keeps a readable width and scrolls sideways (the list view fits as is) */
@media (max-width: 767.98px) {
  #calendar-page .card-body {
    overflow-x: auto;
  }
  #calendar.cal-wide {
    min-width: 760px;
  }
}
/* Legend: a clear key for the colours */
#legend > span {
  display: inline-flex;
  align-items: center;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 999px;
  padding: 0.15rem 0.7rem 0.15rem 0.5rem;
  font-weight: 500;
}
.legend-dot {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border-radius: 4px;
  margin-inline-end: 0.4rem;
  vertical-align: middle;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.legend-dot.holiday-event {
  background: #f1aeb5;
}
.swal2-html-container {
  white-space: pre-line;
}
.swal2-confirm {
  background-color: var(--app-red) !important;
}

/* ---- Print: logo + name on top, company footer (phone, email, address...) at the bottom of every page ---- */
/* on screen the print header / footer never show; the print rules below turn them on */
@media screen {
  .print-only {
    display: none !important;
  }
  /* the print-sheet table only exists for printing: on screen it behaves like plain blocks */
  .print-sheet,
  .print-sheet > tbody,
  .print-sheet > tbody > tr,
  .print-sheet > tbody > tr > td {
    display: block;
    padding: 0;
    border: 0;
  }
}
.print-footer {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  border-top: 2px solid var(--app-red);
  padding-top: 0.4rem;
  font-size: 0.8rem;
  line-height: 1.55;
}
.print-footer-col {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-width: 0;
}
.print-footer-contact {
  align-items: center;
  text-align: center;
}
.print-footer-extra {
  align-items: flex-end;
}
.print-footer .bi {
  color: var(--app-red);
}
.print-footer-preview {
  background: #fff;
  color: #1c1917;
  border: 1px dashed var(--bs-border-color);
  border-top: 2px solid var(--app-red);
  padding: 0.6rem 0.8rem;
  border-radius: 0.25rem;
}
/* Landscape suits the calendar, the audit lists and the auditor board. The page margin is 0 on purpose:
   Chrome clips whatever is pushed into a page margin, so the margins are made by two spacer boxes that
   behave like a table header / footer and therefore repeat on EVERY printed page; the footer itself
   is `position: fixed` (also repeated) and sits inside the bottom spacer. */
@page {
  size: A4 landscape;
  margin: 0;
}
@media print {
  .app-sidebar,
  .app-topbar,
  .no-print,
  .btn,
  .pagination,
  form[method='get'],
  .modal {
    display: none !important; /* buttons, filters and paging are for the screen only */
  }
  /* a scroll box would cut a long table at the page end (rows would be lost): let it flow */
  .table-responsive {
    overflow: visible !important;
  }
  html,
  body {
    margin: 0;
    background: #fff;
    color: #000;
  }
  .app-shell {
    display: block;
  }
  .app-main {
    display: block;
    padding-inline: 10mm;
  }
  .app-content {
    padding: 0;
  }
  .print-sheet {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
  }
  .print-sheet > tbody > tr > td,
  .print-sheet > thead > tr > td,
  .print-sheet > tfoot > tr > td {
    padding: 0;
    border: 0;
    vertical-align: top;
  }
  .print-space-top > tr > td > div {
    height: 10mm;
  }
  .print-space-bottom > tr > td > div {
    height: 27mm;
  }
  .print-footer.print-only {
    display: flex;
    position: fixed;
    inset-inline: 10mm;
    bottom: 8mm;
    background: #fff;
    color: #000;
  }
  .print-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border-bottom: 3px solid var(--app-red);
    padding-bottom: 0.5rem;
    margin-bottom: 0.8rem;
  }
  .print-logo {
    max-height: 48px;
    max-width: 170px;
    object-fit: contain;
  }
  .print-title {
    font-size: 1.3rem;
    font-weight: 700;
  }
  .card {
    box-shadow: none;
  }
  #calendar-page .card {
    border: 0;
  }
  #calendar-page .card-body {
    padding: 0 !important;
    overflow: visible;
  }
  #calendar.cal-wide {
    min-width: 0;
  }
  .fc .fc-daygrid-event-harness,
  .fc .fc-daygrid-event,
  .fc-daygrid-body tr,
  .table tr {
    break-inside: avoid;
  }
  .fc .fc-daygrid-day-frame {
    min-height: 0;
  }
  /* the grid must shrink to the paper width, whatever width it had on screen */
  .fc,
  .fc .fc-view-harness,
  .fc .fc-scrollgrid,
  .fc .fc-col-header,
  .fc .fc-daygrid-body,
  .fc .fc-scrollgrid-sync-table {
    width: 100% !important;
    max-width: 100%;
  }
  .fc .fc-toolbar .fc-button,
  .fc .fc-toolbar .fc-button-group {
    display: none;
  }
  .fc-event,
  .fc-ev-title,
  .fc .fc-col-header-cell,
  .fc .weekend-day,
  .fc .fc-daygrid-day-top,
  #legend .legend-dot,
  .print-footer .bi,
  .print-header {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ---- Dashboard ---- */
.chart-box {
  position: relative;
  height: 260px;
}
.chart-box.tall {
  height: 340px;
}
.kpi .fs-2 {
  color: var(--app-red);
}
[data-bs-theme='dark'] .kpi .fs-2 {
  color: #ff6b7f;
}

/* ---- Notification bell ---- */
.bell-menu {
  width: 340px;
  max-width: 92vw;
}
#bell-list {
  max-height: 340px;
  overflow-y: auto;
}
.bell-item.unread {
  background: var(--bs-tertiary-bg);
  font-weight: 600;
}

/* ---- Import ---- */
.import-rows td,
.import-rows th {
  font-size: 0.85rem;
}
.import-ok {
  background: rgba(25, 135, 84, 0.08);
}
.import-dup {
  background: rgba(255, 193, 7, 0.14);
}
.import-err {
  background: rgba(var(--bs-primary-rgb), 0.1);
}

/* FullCalendar renders day names / numbers as links: keep them plain and readable */
.fc a,
.fc .fc-col-header-cell-cushion,
.fc .fc-daygrid-day-number {
  color: var(--bs-body-color);
  text-decoration: none;
}
.fc .fc-day-other .fc-daygrid-day-number {
  opacity: 0.45;
}
.fc a.fc-event {
  color: #fff;
}

/* Black audit types (Surv1) must stay visible on the black dark theme */
[data-bs-theme='dark'] .fc .fc-event,
[data-bs-theme='dark'] .legend-dot {
  outline: 1px solid rgba(255, 255, 255, 0.28);
}

/* Auditors already booked on the chosen dates */
.btn.auditor-busy {
  border-style: dashed;
  border-color: var(--app-red);
  color: var(--app-red);
  text-decoration: line-through;
}
.btn-check:disabled + .btn.auditor-busy {
  opacity: 0.6;
}

/* Notes inside calendar cards (first lines; the full text is in the tooltip and the details window) */
.fc-ev-notes {
  font-size: 0.75rem;
  opacity: 0.95;
  white-space: pre-line;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- Auditor availability board ---- */
.schedule-table {
  min-width: 1000px;
}
.schedule-table th:not(.sch-day):not(.sch-name) {
  white-space: nowrap;
}
.schedule-table th.sch-day,
.schedule-table td.sch-free,
.schedule-table td.sch-clash {
  min-width: 26px;
  width: 26px;
  padding: 2px;
}
.schedule-table .sch-name {
  position: sticky;
  inset-inline-start: 0;
  background: var(--bs-body-bg);
  z-index: 2;
  white-space: nowrap;
  min-width: 140px;
}
.schedule-table .sch-weekend {
  background-color: var(--bs-tertiary-bg);
}
.schedule-table .sch-holiday {
  background-color: #fbe3e4;
}
[data-bs-theme='dark'] .schedule-table .sch-holiday {
  background-color: #3a1d20;
}
.sch-today {
  outline: 2px solid var(--app-red);
  outline-offset: -2px;
}
.sch-book {
  color: #fff;
  padding: 2px 6px;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.sch-book a {
  color: #fff;
  text-decoration: none;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.78rem;
}
.sch-done {
  opacity: 0.6;
}
td.sch-clash {
  background: repeating-linear-gradient(45deg, #c8102e, #c8102e 6px, #7a0a1d 6px, #7a0a1d 12px);
  color: #fff;
  font-weight: 700;
}
.sch-weekend-dot {
  background: var(--app-skin-dark);
}
.sch-holiday-dot {
  background: #f1aeb5;
}
@media print {
  .schedule-table {
    min-width: 0;
    font-size: 0.7rem;
  }
}

/* The "you have an audit soon" pop-up */
.audit-alert-popup {
  border-top: 6px solid var(--app-red);
}
.audit-alert-item {
  background: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color);
  border-inline-start: 5px solid var(--app-red);
  border-radius: 0.5rem;
  padding: 0.5rem 0.8rem;
  margin-top: 0.5rem;
  color: var(--bs-body-color);
  text-align: start;
}
.audit-alert-item:hover {
  background: var(--bs-secondary-bg);
}

/* Dashboard */
#widget-menu {
  min-width: 270px;
  max-height: 70vh;
  overflow-y: auto;
}
.kpi .fs-2 {
  line-height: 1.1;
}

/* Admin hub tiles */
.admin-tile {
  color: var(--bs-body-color);
  border-top: 3px solid transparent;
  transition:
    border-color 0.15s,
    transform 0.15s;
}
.admin-tile:hover {
  border-top-color: var(--app-red);
  transform: translateY(-2px);
}

/* ---- Side menu: collapse to icons, drag to resize, dock on either side (public/js/sidebar.js) ---- */
:root {
  --sidebar-collapsed-w: 68px;
}
.app-sidebar {
  transition: width 0.18s ease;
}
.sidebar-options {
  min-width: 270px;
}
.ring-list {
  max-height: 180px;
  overflow-y: auto;
}
.ring-body {
  white-space: pre-line;
  text-align: start;
}
@media (min-width: 992px) {
  .app-sidebar {
    position: relative;
  }
  .sidebar-resizer {
    position: absolute;
    top: 0;
    bottom: 0;
    inset-inline-end: -6px;
    width: 12px;
    cursor: col-resize;
    z-index: 5;
  }
  .sidebar-resizer:hover,
  .sidebar-dragging .sidebar-resizer {
    background: linear-gradient(
      to right,
      transparent 4px,
      rgba(var(--bs-primary-rgb), 0.55) 4px,
      rgba(var(--bs-primary-rgb), 0.55) 8px,
      transparent 8px
    );
  }
  .sidebar-dragging,
  .sidebar-dragging * {
    cursor: col-resize !important;
    user-select: none;
  }
  .sidebar-dragging .app-sidebar {
    transition: none;
  }
  html[data-sidebar='collapsed'] .app-sidebar {
    width: var(--sidebar-collapsed-w);
    padding-inline: 0.5rem;
  }
  html[data-sidebar='collapsed'] .app-sidebar .brand {
    justify-content: center;
  }
  html[data-sidebar='collapsed'] .app-sidebar .brand span,
  html[data-sidebar='collapsed'] .app-sidebar .nav-section {
    display: none;
  }
  html[data-sidebar='collapsed'] .app-sidebar .brand-logo {
    max-width: 44px;
  }
  html[data-sidebar='collapsed'] .app-sidebar .nav-link {
    font-size: 0;
    justify-content: center;
    gap: 0;
    padding-inline: 0;
  }
  html[data-sidebar='collapsed'] .app-sidebar .nav-link .bi {
    font-size: 1.25rem;
  }
  /* docked on the other side from the language's default */
  html[dir='rtl'][data-dock='left'] .app-shell,
  html[dir='ltr'][data-dock='right'] .app-shell {
    flex-direction: row-reverse;
  }
  html[dir='rtl'][data-dock='left'] .app-sidebar,
  html[dir='ltr'][data-dock='right'] .app-sidebar {
    border-inline-end: 0;
    border-inline-start: 3px solid var(--app-red);
  }
  html[dir='rtl'][data-dock='left'] .sidebar-resizer,
  html[dir='ltr'][data-dock='right'] .sidebar-resizer {
    inset-inline-end: auto;
    inset-inline-start: -6px;
  }
  /* forced sides the same as the default: nothing to change */
}
@media print {
  .sidebar-resizer {
    display: none !important;
  }
}

/* Sign-in page: with the picture on one side (Settings -> login layout "split") the card moves to the other */
@media (min-width: 992px) {
  .auth-split {
    justify-content: flex-end;
    padding-inline-end: 8vw;
  }
}
.auth-card {
  position: relative;
  z-index: 1;
}

/* Global search box in the top bar */
.gs-form {
  max-width: 380px;
}
.gs-results {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 4px);
  z-index: 1055;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 0.5rem;
  max-height: 70vh;
  overflow-y: auto;
}
.gs-item {
  color: var(--bs-body-color);
}
.gs-item:hover,
.gs-all:hover {
  background: var(--bs-tertiary-bg);
}
