/* ==========================================================================
   OTS ICT Learning Academy - Portal design system
   Flat surfaces, Outfit typography, royal blue and gold brand palette.
   ========================================================================== */

:root {
  --ots-navy: #031f42;
  --ots-navy-deep: #02152e;
  --ots-blue: #071cbb;
  --ots-blue-deep: #0113a5;
  --ots-gold: #ffcc29;
  --ots-gold-soft: #fff7db;
  --ots-ink: #161821;
  --ots-muted: #57595f;
  --ots-line: #e4e6ec;
  --ots-line-soft: #eff1f5;
  --ots-canvas: #f7f8fa;
  --ots-white: #ffffff;
  --sidebar-width: 272px;
}

* {
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Outfit", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  background-color: var(--ots-canvas);
  color: var(--ots-muted);
  font-size: 14px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, .font-display {
  font-family: "Outfit", ui-sans-serif, system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: -0.022em;
}

/*
 * Headings default to the document ink, but elements that only borrow the
 * display face keep their inherited colour so light text stays light when
 * they sit on navy panels.
 */
h1, h2, h3, h4, h5, h6 {
  color: var(--ots-ink);
}

::selection {
  background: rgba(255, 204, 41, 0.45);
  color: var(--ots-ink);
}

:focus-visible {
  outline: 2px solid var(--ots-blue);
  outline-offset: 2px;
}

/* Overflow safety -------------------------------------------------------- */
/* Pasted links, long emails and unbroken words must never spill outside a
   card, table cell or modal. */
p,
li,
dd,
dt,
figcaption,
blockquote,
label,
td,
th,
.alert,
.empty-state,
.modal-panel,
.card {
  overflow-wrap: anywhere;
  word-break: break-word;
}

a,
.break-anywhere {
  overflow-wrap: anywhere;
}

pre,
code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Scrollbars ------------------------------------------------------------- */
* {
  scrollbar-width: thin;
  scrollbar-color: #cfd3dc transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: #cfd3dc;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.sidebar ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Accessibility ---------------------------------------------------------- */
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 200;
  border-radius: 8px;
  background: #fff;
  color: var(--ots-navy);
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px -16px rgba(22, 24, 33, 0.6);
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 16px;
}

/* Sidebar ---------------------------------------------------------------- */
.sidebar {
  background: var(--ots-navy);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-glow {
  display: none;
}

.brand-logo {
  display: block;
  width: auto;
  height: 34px;
  max-width: 100%;
}

.brand-logo--sm {
  height: 30px;
}

.nav-group-label {
  padding: 0 12px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.62);
  transition: background 0.18s ease, color 0.18s ease;
}

.nav-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke-width: 1.8;
  transition: color 0.18s ease;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}

.nav-link:hover svg {
  color: var(--ots-gold);
}

.nav-link.is-active {
  background: var(--ots-blue);
  color: #ffffff;
}

.nav-link.is-active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 50%;
  height: 20px;
  width: 3px;
  transform: translateY(-50%);
  border-radius: 0 3px 3px 0;
  background: var(--ots-gold);
}

.nav-link.is-active svg {
  color: #ffffff;
}

.nav-badge {
  margin-left: auto;
  display: inline-flex;
  min-width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--ots-gold);
  color: var(--ots-ink);
  font-size: 10.5px;
  font-weight: 700;
}

.sidebar-user {
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.045);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.sidebar-user:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Typography helpers ----------------------------------------------------- */
.eyebrow {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ots-blue);
}

.page-title {
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  line-height: 1.18;
  font-weight: 600;
  letter-spacing: -0.028em;
  color: var(--ots-navy);
}

.page-subtitle {
  margin-top: 6px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ots-muted);
}

.muted {
  color: var(--ots-muted);
}

/* Cards ------------------------------------------------------------------ */
.card {
  border-radius: 12px;
  border: 1px solid var(--ots-line);
  background: #fff;
  box-shadow: 0 1px 2px rgba(22, 24, 33, 0.04);
}

.hero-card {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--ots-navy);
  background: var(--ots-navy);
  color: #fff;
}

.hero-orb {
  display: none;
}

.card-hover {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card-hover:hover {
  border-color: #cdd2dd;
  box-shadow: 0 10px 24px -22px rgba(22, 24, 33, 0.45);
}

.stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid transparent;
}

.stat-icon svg {
  width: 19px;
  height: 19px;
  stroke-width: 2;
}

.stat-value {
  font-family: "Outfit", sans-serif;
  font-size: 28px;
  line-height: 1;
  font-weight: 600;
  color: var(--ots-navy);
  letter-spacing: -0.035em;
  white-space: nowrap;
}

@media (max-width: 639px) {
  .stat-icon {
    display: none;
  }
}

.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ots-muted);
}

/* Buttons ---------------------------------------------------------------- */
.btn {
  position: relative;
  display: inline-flex;
  height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  cursor: pointer;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

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

.btn-primary {
  background: var(--ots-blue);
  color: #fff;
}

.btn-primary:hover {
  background: var(--ots-blue-deep);
}

.btn-dark {
  background: var(--ots-navy);
  color: #fff;
}

.btn-dark:hover {
  background: var(--ots-navy-deep);
}

.btn-white {
  background: #fff;
  color: var(--ots-navy);
  border-color: var(--ots-line);
}

.btn-white:hover {
  border-color: #cdd2dd;
  background: #f7f8fa;
}

.btn-ghost {
  background: transparent;
  color: #4b4e57;
}

.btn-ghost:hover {
  background: #f1f2f6;
  color: var(--ots-navy);
}

.btn-soft {
  background: #eef0ff;
  color: var(--ots-blue);
  border-color: #dfe3ff;
}

.btn-soft:hover {
  background: #e2e6ff;
}

.btn-gold {
  background: var(--ots-gold);
  color: var(--ots-ink);
}

.btn-gold:hover {
  background: #f5bd0c;
}

.btn-danger {
  background: #d92d4f;
  color: #fff;
}

.btn-danger:hover {
  background: #b91f3f;
}

.btn-danger-soft {
  background: #fff1f3;
  color: #b91f3f;
  border-color: #fbd0d8;
}

.btn-danger-soft:hover {
  background: #ffe4e8;
}

.btn-sm {
  height: 36px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: 8px;
  gap: 6px;
}

.btn-sm svg {
  width: 14px;
  height: 14px;
}

.btn-xs {
  height: 30px;
  padding: 0 10px;
  font-size: 11.5px;
  border-radius: 7px;
  gap: 5px;
}

.btn-xs svg {
  width: 13px;
  height: 13px;
}

.btn-lg {
  height: 50px;
  padding: 0 24px;
  font-size: 13px;
  border-radius: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 9px;
}

.btn-loading {
  pointer-events: none;
  opacity: 0.72;
}

.btn-loading svg {
  animation: spin 0.9s linear infinite;
}

/* Forms ------------------------------------------------------------------ */
.label {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 500;
  color: #3b3d44;
}

.label-hint {
  font-weight: 400;
  color: #5f6570;
}

.input,
.select,
.textarea {
  width: 100%;
  border-radius: 9px;
  border: 1px solid var(--ots-line);
  background: #fff;
  padding: 11px 14px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ots-ink);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.input {
  height: 46px;
}

.input::placeholder,
.textarea::placeholder {
  color: #5f6570;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: #cdd2dd;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--ots-blue);
  box-shadow: 0 0 0 3px rgba(7, 28, 187, 0.12);
}

.input[disabled],
.select[disabled],
.textarea[disabled] {
  background: #f4f5f8;
  color: #5f6570;
  cursor: not-allowed;
}

.input.is-invalid,
.select.is-invalid,
.textarea.is-invalid {
  border-color: #f2a2b0;
  box-shadow: 0 0 0 3px rgba(217, 45, 79, 0.1);
}

.select {
  height: 46px;
  appearance: none;
  padding-right: 38px;
  background-image: 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='%2357595f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  cursor: pointer;
}

.textarea {
  min-height: 108px;
  resize: vertical;
  line-height: 1.65;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: #5f6570;
  pointer-events: none;
}

.input-icon + .input {
  padding-left: 42px;
}

.has-icon .input:focus ~ .input-icon {
  color: var(--ots-blue);
}

.checkbox {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid #c4c8d2;
  accent-color: var(--ots-blue);
  cursor: pointer;
}

.helper {
  margin-top: 6px;
  font-size: 11.5px;
  color: #5f6570;
  line-height: 1.5;
}

/* Badges & chips --------------------------------------------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid var(--ots-line);
  background: #fff;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 500;
  color: #4b4e57;
}

.chip-cyan {
  border-color: #f2dda0;
  background: var(--ots-gold-soft);
  color: #7a5b00;
}

.filter-chip {
  display: inline-flex;
  height: 34px;
  align-items: center;
  gap: 7px;
  border-radius: 8px;
  border: 1px solid var(--ots-line);
  background: #fff;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ots-muted);
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
  cursor: pointer;
}

.filter-chip:hover {
  border-color: #cdd2dd;
  color: var(--ots-ink);
}

.filter-chip.is-active {
  border-color: var(--ots-blue);
  background: var(--ots-blue);
  color: #fff;
}

/* Tables ----------------------------------------------------------------- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-base {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.table-base thead th {
  padding: 11px 14px;
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #5f6570;
  background: #f7f8fa;
  border-bottom: 1px solid var(--ots-line);
  white-space: nowrap;
}

.table-base thead th:first-child {
  padding-left: 20px;
}

.table-base thead th:last-child {
  padding-right: 20px;
}

.table-base tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--ots-line-soft);
  vertical-align: middle;
  color: #4b4e57;
}

.table-base tbody td:first-child {
  padding-left: 20px;
}

.table-base tbody td:last-child {
  padding-right: 20px;
}

.table-base tbody tr:last-child td {
  border-bottom: 0;
}

.table-base tbody tr {
  transition: background 0.15s ease;
}

.table-base tbody tr:hover {
  background: #f7f8fa;
}

.table-base .row-static:hover {
  background: transparent;
}

/* Progress & charts ------------------------------------------------------ */
.progress-track {
  height: 8px;
  width: 100%;
  overflow: hidden;
  border-radius: 999px;
  background: #eceef2;
}

.progress-bar {
  position: relative;
  height: 100%;
  border-radius: 999px;
  background: var(--ots-blue);
  transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.progress-bar--emerald {
  background: #0f8a5f;
}

.progress-bar--gold {
  background: var(--ots-gold);
}

.chart-grid {
  background-image: linear-gradient(to top, #eef0f4 1px, transparent 1px);
  background-size: 100% 25%;
}

.chart-bar {
  position: relative;
  border-radius: 4px 4px 2px 2px;
  background: var(--ots-blue);
  transform-origin: bottom;
  transition: background 0.2s ease;
  min-height: 3px;
}

.chart-bar:hover {
  background: var(--ots-blue-deep);
}

.chart-bar.is-muted {
  background: #e2e5eb;
}

.chart-bar.is-current {
  background: var(--ots-gold);
}

.ring-track {
  stroke: #eceef2;
}

.ring-progress {
  stroke-linecap: round;
  transition: stroke-dashoffset 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Week grid -------------------------------------------------------------- */
.week-tile {
  position: relative;
  display: flex;
  cursor: pointer;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  border-radius: 9px;
  border: 1px solid var(--ots-line);
  background: #fff;
  padding: 10px 11px;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.week-tile:hover {
  border-color: #b9c0ff;
  background: #f8f9ff;
}

.week-tile input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.week-tile .week-no {
  font-size: 12.5px;
  font-weight: 600;
  color: #3b3d44;
}

.week-tile .week-meta {
  font-size: 10px;
  font-weight: 500;
  color: #5f6570;
  letter-spacing: 0.02em;
}

.week-tile:has(input:focus-visible) {
  outline: 2px solid var(--ots-blue);
  outline-offset: 2px;
}

.week-tile:has(input:checked) {
  border-color: var(--ots-blue);
  background: #eef0ff;
  box-shadow: 0 0 0 3px rgba(7, 28, 187, 0.1);
}

.week-tile:has(input:checked) .week-no {
  color: var(--ots-blue);
}

.week-tile.is-done .week-meta {
  color: #0f8a5f;
}

.week-tile.is-revise {
  border-color: #fbd0d8;
  background: #fffafa;
}

.week-tile.is-revise .week-meta {
  color: #c22745;
}

.week-tile.is-current {
  border-color: #f2dda0;
  box-shadow: 0 0 0 3px rgba(255, 204, 41, 0.18);
}

.week-tile.is-current .week-meta {
  color: #7a5b00;
}

.week-tile.is-locked {
  cursor: not-allowed;
  background: #f7f8fa;
  border-color: var(--ots-line-soft);
  opacity: 0.75;
}

.week-tile.is-locked:hover {
  border-color: var(--ots-line-soft);
  background: #f7f8fa;
}

/* Mini week strip -------------------------------------------------------- */
.week-dot {
  display: inline-flex;
  height: 30px;
  width: 30px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 10.5px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.18s ease;
}

.week-dot:hover {
  transform: translateY(-2px);
}

.week-dot--done {
  background: #eaf7f1;
  color: #0b6b4a;
  border-color: #b9e4d3;
}

.week-dot--pending {
  background: var(--ots-gold-soft);
  color: #7a5b00;
  border-color: #f2dda0;
}

.week-dot--revise {
  background: #fff1f3;
  color: #b91f3f;
  border-color: #fbd0d8;
}

.week-dot--missing {
  background: #fff;
  color: #5f6570;
  border-color: var(--ots-line);
  border-style: dashed;
}

.week-dot--current {
  background: var(--ots-navy);
  color: #fff;
  border-color: var(--ots-navy);
}

.week-dot--upcoming {
  background: #f7f8fa;
  color: #6b7280;
  border-color: var(--ots-line-soft);
}

/* Timeline --------------------------------------------------------------- */
.timeline {
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--ots-line);
}

.timeline-item {
  position: relative;
  padding-left: 44px;
}

.timeline-dot {
  position: absolute;
  left: 4px;
  top: 4px;
  display: inline-flex;
  height: 23px;
  width: 23px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 4px solid #fff;
  box-shadow: 0 0 0 1px var(--ots-line);
}

/* Empty state ------------------------------------------------------------ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.empty-icon {
  display: inline-flex;
  height: 54px;
  width: 54px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px dashed #c4c8d2;
  background: #f7f8fa;
  color: #5f6570;
  margin-bottom: 16px;
}

/* Live filter block ------------------------------------------------------ */
.live-toolbar {
  position: relative;
}

.live-search {
  position: relative;
}

.live-search .live-spinner {
  position: absolute;
  right: 12px;
  top: 50%;
  width: 15px;
  height: 15px;
  margin-top: -7.5px;
  border-radius: 999px;
  border: 2px solid rgba(7, 28, 187, 0.2);
  border-top-color: var(--ots-blue);
  opacity: 0;
  animation: spin 0.7s linear infinite;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.live-search.is-loading .live-spinner {
  opacity: 1;
}

.live-search .live-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  height: 24px;
  width: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: #5f6570;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.live-search .live-clear:hover {
  background: #f1f2f6;
  color: var(--ots-ink);
}

.live-search .input {
  padding-right: 42px;
}

.live-search.has-clear .live-spinner {
  right: 44px;
  margin-top: -7.5px;
}

.live-results {
  position: relative;
  transition: opacity 0.15s ease;
}

.live-results.is-fetching {
  opacity: 0.55;
}

.live-count {
  font-size: 11px;
  font-weight: 500;
  color: #5f6570;
}

.live-empty {
  padding: 34px 20px;
  text-align: center;
  font-size: 13px;
  color: #5f6570;
}

[data-live-results] [data-animate] {
  opacity: 1;
  transform: none;
}

.anim-done {
  opacity: 1 !important;
  transform: none !important;
}

/* Quick search (topbar) -------------------------------------------------- */
.quick-trigger {
  display: inline-flex;
  height: 38px;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  border: 1px solid var(--ots-line);
  background: #fff;
  padding: 0 10px 0 11px;
  color: #5f6570;
  font-size: 12px;
  font-weight: 500;
  transition: border-color 0.18s ease, color 0.18s ease;
  cursor: pointer;
}

.quick-trigger:hover {
  border-color: #cdd2dd;
  color: var(--ots-ink);
}

.quick-trigger kbd {
  display: none;
  align-items: center;
  height: 20px;
  border-radius: 4px;
  border: 1px solid var(--ots-line);
  background: #f7f8fa;
  padding: 0 5px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  color: #5f6570;
}

@media (min-width: 1280px) {
  .quick-trigger kbd {
    display: inline-flex;
  }
}

.quick-search {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
}

.quick-search.is-open {
  display: flex;
}

html.quick-open,
html.quick-open body {
  overflow: hidden;
}

.quick-group + .quick-group {
  margin-top: 6px;
  border-top: 1px solid var(--ots-line);
  padding-top: 6px;
}

.quick-item > span:last-child {
  min-width: 0;
  overflow: hidden;
}

.quick-search-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 31, 66, 0.55);
}

.quick-search-panel {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 620px;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--ots-line);
  background: #fff;
  box-shadow: 0 30px 70px -30px rgba(3, 31, 66, 0.6);
}

.quick-search-head {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--ots-line);
  padding: 12px 16px;
}

.quick-search-head input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  color: var(--ots-ink);
}

.quick-search-head input::placeholder {
  color: #5f6570;
}

.quick-search-body {
  max-height: min(56vh, 420px);
  overflow-y: auto;
  padding: 8px;
}

.quick-group-label {
  padding: 8px 10px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #5f6570;
}

.quick-item {
  display: flex;
  align-items: center;
  gap: 11px;
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--ots-ink);
  transition: background 0.12s ease;
}

.quick-item:hover,
.quick-item.is-focused {
  background: #f1f3fb;
}

.quick-item-icon {
  display: inline-flex;
  height: 32px;
  width: 32px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: #eef0ff;
  color: var(--ots-blue);
}

.quick-item-icon svg {
  width: 16px;
  height: 16px;
}

.quick-item-title {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ots-ink);
}

.quick-item-sub {
  display: block;
  font-size: 11px;
  color: #5f6570;
}

.quick-empty {
  padding: 30px 16px;
  text-align: center;
  font-size: 12.5px;
  color: #5f6570;
}

.quick-search-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--ots-line);
  padding: 9px 14px;
  font-size: 10.5px;
  color: #5f6570;
}

@media (max-width: 520px) {
  .quick-search-foot span:last-child {
    display: none;
  }
}

.quick-search-foot kbd {
  display: inline-flex;
  align-items: center;
  height: 19px;
  border-radius: 4px;
  border: 1px solid var(--ots-line);
  background: #f7f8fa;
  padding: 0 5px;
  font-family: inherit;
  font-size: 9.5px;
  font-weight: 600;
}

/* Modals ----------------------------------------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  overflow-y: auto;
  padding: 16px;
}

.modal.is-open {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 31, 66, 0.58);
}

.modal-panel {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 620px;
  margin: auto;
  border-radius: 14px;
  border: 1px solid var(--ots-line);
  background: #fff;
  box-shadow: 0 30px 80px -30px rgba(3, 31, 66, 0.6);
}

.modal-panel--lg {
  max-width: 780px;
}

.modal-panel--sm {
  max-width: 440px;
}

.modal-close {
  position: absolute;
  right: 16px;
  top: 16px;
  z-index: 2;
  display: inline-flex;
  height: 34px;
  width: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--ots-muted);
  background: #f7f8fa;
  border: 1px solid var(--ots-line);
  transition: background 0.18s ease, color 0.18s ease;
}

.modal-close:hover {
  background: #f1f2f6;
  color: var(--ots-ink);
}

body.modal-open {
  overflow: hidden;
}

/* Toasts ----------------------------------------------------------------- */
.toast-stack {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 120;
  display: flex;
  width: min(380px, calc(100vw - 32px));
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  position: relative;
  display: flex;
  gap: 12px;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--ots-line);
  background: #fff;
  padding: 13px 14px;
  box-shadow: 0 16px 40px -26px rgba(3, 31, 66, 0.5);
}

.toast::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--ots-blue);
}

.toast--success::before { background: #0f8a5f; }
.toast--error::before { background: #d92d4f; }
.toast--info::before { background: var(--ots-blue); }
.toast--warning::before { background: var(--ots-gold); }

.toast-icon {
  display: inline-flex;
  height: 34px;
  width: 34px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #eef0ff;
  color: var(--ots-blue);
}

.toast--success .toast-icon { background: #eaf7f1; color: #0b6b4a; }
.toast--error .toast-icon { background: #fff1f3; color: #b91f3f; }
.toast--info .toast-icon { background: #eef0ff; color: var(--ots-blue); }
.toast--warning .toast-icon { background: var(--ots-gold-soft); color: #7a5b00; }

.toast-icon svg {
  height: 17px;
  width: 17px;
}

/* Dropdown --------------------------------------------------------------- */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 60;
  min-width: 220px;
  border-radius: 10px;
  border: 1px solid var(--ots-line);
  background: #fff;
  padding: 6px;
  box-shadow: 0 20px 50px -26px rgba(3, 31, 66, 0.45);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.dropdown.is-open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.dropdown-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  border-radius: 7px;
  padding: 9px 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: #4b4e57;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.dropdown-item:hover {
  background: #f7f8fa;
  color: var(--ots-ink);
}

.dropdown-item svg {
  width: 15px;
  height: 15px;
  color: #5f6570;
}

.dropdown-divider {
  height: 1px;
  margin: 5px 4px;
  background: var(--ots-line-soft);
}

/* Breakpoints & drawer --------------------------------------------------- */
@media (max-width: 1023px) {
  #sidebar {
    box-shadow: 20px 0 50px -30px rgba(3, 31, 66, 0.6);
  }

  body.sidebar-open {
    overflow: hidden;
  }

  body.sidebar-open #sidebar {
    transform: translateX(0);
  }
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(3, 31, 66, 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

body.sidebar-open .drawer-backdrop {
  opacity: 1;
  visibility: visible;
}

/* Display heading (H3 component) ------------------------------------------ */
/* Responsive size, tight tracking and a per letter entrance: each glyph
   fades in, rises and resolves out of a blur. The character spans are added
   by assets/js/login-cover.js, so the plain heading still shows without JS. */
.h3 {
  font-size: clamp(1.7rem, 1.05rem + 1.95vw, 2.9rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: #fff;
  text-wrap: balance;
  transition: color 400ms ease;
}

.h3 .word {
  display: inline-block;
  white-space: nowrap;
}

.h3 .char {
  display: inline-block;
  white-space: pre;
  animation: charRise 880ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--char-index, 0) * 20ms + 240ms);
}

@keyframes charRise {
  from {
    opacity: 0;
    transform: translate3d(0, 0.6em, 0);
    filter: blur(14px);
  }
  55% {
    opacity: 1;
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    filter: blur(0);
  }
}

/* Login ------------------------------------------------------------------ */
.login-shell {
  display: flex;
  min-height: 100dvh;
  padding: 12px;
  background:
    radial-gradient(1100px 740px at 10% -10%, #ffffff 0%, rgba(255, 255, 255, 0) 58%),
    #e8eaef;
}

.login-frame {
  display: grid;
  width: 100%;
  max-width: 1420px;
  margin: auto;
  border-radius: 26px;
  background: #fff;
  padding: 10px;
  row-gap: 10px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 42px 90px -54px rgba(3, 31, 66, 0.55),
    0 2px 10px rgba(3, 31, 66, 0.04);
}

.login-form-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 28px 18px;
}

.login-card {
  border: 0;
  border-radius: 0;
  background: transparent;
}

/* Cover ------------------------------------------------------------------ */
.login-cover {
  position: relative;
  display: block;
  isolation: isolate;
  overflow: hidden;
  height: 172px;
  border-radius: 18px;
  background: var(--ots-navy-deep);
}

/* Image stack. The negative inset leaves room for the pointer parallax so
   the cover never shows an edge while the stack drifts. */
.login-cover-stack {
  position: absolute;
  inset: -12px;
  z-index: 0;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

.login-cover-slide {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  transform: scale(1.07) translate3d(2.2%, 1.3%, 0);
  filter: blur(9px) saturate(1.04);
  backface-visibility: hidden;
  transition:
    opacity 1100ms cubic-bezier(0.4, 0, 0.2, 1),
    transform 1700ms cubic-bezier(0.22, 1.18, 0.36, 1),
    filter 1400ms cubic-bezier(0.22, 0.9, 0.3, 1);
}

.login-cover-slide.is-active {
  z-index: 2;
  opacity: 1;
  transform: scale(1) translate3d(0, 0, 0);
  filter: blur(0) saturate(1.04);
}

.login-cover-slide.is-leaving {
  z-index: 1;
  opacity: 0;
  transform: scale(1.12) translate3d(-2.4%, -1.1%, 0);
  filter: blur(6px) saturate(1.04);
}

.login-cover-slide img {
  display: block;
  height: 100%;
  width: 100%;
  object-fit: cover;
  object-position: var(--focus, 50% 45%);
  animation: coverDrift 26s ease-in-out infinite alternate;
  animation-play-state: paused;
}

.login-cover-slide.is-active img {
  animation-play-state: running;
}

@keyframes coverDrift {
  from {
    transform: scale(1.02) translate3d(-0.5%, 0.4%, 0);
  }
  to {
    transform: scale(1.09) translate3d(1.1%, -0.9%, 0);
  }
}

/* Halftone field. Drawn below the scrim so the copy keeps its contrast. */
.login-cover-fx {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: block;
  height: 100%;
  width: 100%;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  transition: opacity 1200ms ease;
}

.login-cover-fx.is-ready {
  opacity: 0.34;
}

/* The brand corner carries a little extra density so the lockup always has
   a calm bed to sit on, whatever frame is showing. */
.login-cover-scrim {
  position: absolute;
  inset: 0;
  z-index: 4;
  background:
    radial-gradient(118% 82% at 0% 0%,
      rgba(2, 21, 46, 0.9) 0%,
      rgba(2, 21, 46, 0.52) 26%,
      rgba(2, 21, 46, 0) 58%),
    linear-gradient(to top,
      rgba(2, 21, 46, 0.97) 0%,
      rgba(2, 21, 46, 0.88) 20%,
      rgba(2, 21, 46, 0.52) 44%,
      rgba(2, 21, 46, 0.12) 64%,
      rgba(2, 21, 46, 0) 78%),
    linear-gradient(to bottom,
      rgba(2, 21, 46, 0.6) 0%,
      rgba(2, 21, 46, 0.16) 24%,
      rgba(2, 21, 46, 0) 44%);
}

.login-cover-inner {
  position: relative;
  z-index: 5;
  display: flex;
  height: 100%;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0;
  padding: 12px;
}

/* The banner keeps only the lockup on small screens. */
.login-cover-copy {
  display: none;
}

.login-cover-brand {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 13px;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(2, 21, 46, 0.46);
  padding: 9px 16px 9px 11px;
  box-shadow: 0 12px 30px -18px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.login-cover-brand img {
  height: 38px;
  width: auto;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45));
}

.login-cover-brand-divider {
  height: 26px;
  width: 1px;
  background: rgba(255, 255, 255, 0.22);
}

.login-cover-brand-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.76);
}

.login-cover-copy {
  max-width: 520px;
}

.login-cover-rule {
  display: block;
  height: 3px;
  width: 68px;
  border-radius: 999px;
  background: var(--ots-gold);
  box-shadow: 0 0 22px rgba(255, 204, 41, 0.28);
}

.login-cover-eyebrow {
  margin-top: 18px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

.cover-title {
  margin-top: 8px;
  max-width: 540px;
}

.login-cover-text {
  margin-top: 14px;
  max-width: 450px;
  font-size: 14px;
  line-height: 1.68;
  color: rgba(255, 255, 255, 0.76);
}

.login-cover-points {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.login-cover-points li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
}

.login-cover-points li::before {
  content: "";
  height: 5px;
  width: 5px;
  border-radius: 999px;
  background: var(--ots-gold);
  box-shadow: 0 0 0 3px rgba(255, 204, 41, 0.14);
}

@media (min-width: 640px) {
  .login-shell {
    padding: 20px;
  }

  .login-form-panel {
    padding: 40px 32px;
  }

  .login-cover {
    height: 204px;
  }

  .login-cover-inner {
    padding: 16px;
  }
}

@media (min-width: 1024px) {
  .login-shell {
    padding: 28px;
  }

  .login-frame {
    grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr);
    min-height: calc(100dvh - 56px);
    padding: 12px;
    row-gap: 0;
  }

  .login-form-panel {
    padding: 52px 44px;
  }

  .login-cover {
    height: auto;
    min-height: 600px;
  }

  .login-cover-inner {
    justify-content: space-between;
    padding: 30px;
  }

  .login-cover-copy {
    display: block;
  }
}

@media (min-width: 1280px) {
  .login-form-panel {
    padding: 64px 60px;
  }

  .login-cover-inner {
    padding: 34px;
  }
}

.login-creds {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--ots-line);
  background: #fff;
  padding: 8px 9px;
  text-align: left;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.login-creds:hover {
  border-color: #b9c0ff;
  background: #f8f9ff;
}

.login-creds-icon {
  display: inline-flex;
  height: 26px;
  width: 26px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--ots-navy);
  color: var(--ots-gold);
}

.login-creds-icon svg {
  width: 13px;
  height: 13px;
}

/* Alerts ----------------------------------------------------------------- */
.alert {
  display: flex;
  gap: 11px;
  border-radius: 9px;
  border: 1px solid;
  padding: 12px 14px;
  font-size: 12.5px;
  line-height: 1.55;
}

.alert svg {
  margin-top: 1px;
  height: 17px;
  width: 17px;
  flex-shrink: 0;
}

.alert-error {
  border-color: #fbd0d8;
  background: #fff1f3;
  color: #94203a;
}

.alert-success {
  border-color: #b9e4d3;
  background: #eaf7f1;
  color: #0b5c41;
}

.alert-info {
  border-color: #ccd2ff;
  background: #eef0ff;
  color: #051a8f;
}

.alert-warning {
  border-color: #f2dda0;
  background: var(--ots-gold-soft);
  color: #6b4f00;
}

/* Animation initial states ----------------------------------------------- */
.js [data-animate] {
  opacity: 0;
  transform: translateY(16px);
}

.js [data-animate="fade"] {
  transform: none;
}

.js [data-animate="left"] {
  transform: translateX(-16px);
}

/* Filters and toolbars opt out of the entrance animation but must stay visible. */
.js [data-animate][data-no-page-anim] {
  opacity: 1;
  transform: none;
}

.js .chart-bar {
  transform: scaleY(0);
}

.js [data-login-animate] {
  opacity: 0;
  transform: translateY(18px);
}

.js [data-login-scale] {
  opacity: 0;
  transform: scale(0.96);
}

/* Keyframes -------------------------------------------------------------- */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Utility ---------------------------------------------------------------- */
.hide-scrollbar {
  scrollbar-width: none;
}

.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Reduced motion --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .js [data-animate],
  .js [data-login-animate],
  .js [data-login-scale] {
    opacity: 1 !important;
    transform: none !important;
  }

  .js .chart-bar {
    transform: scaleY(1) !important;
  }
}

/* Print ------------------------------------------------------------------ */
@media print {
  .sidebar,
  .topbar,
  .toast-stack,
  .quick-search,
  .no-print {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .lg\:pl-\[272px\] {
    padding-left: 0 !important;
  }

  .card,
  .hero-card {
    box-shadow: none !important;
    border: 1px solid #e4e6ec !important;
    break-inside: avoid;
  }

  .attachment-drop,
  [data-attachment-preview] {
    display: none !important;
  }
}

/* Report attachments ----------------------------------------------------- */
.attachment-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--ots-line);
  border-radius: 12px;
  background: #fff;
  padding: 10px;
}

.attachment-preview img {
  display: block;
  height: 56px;
  width: 56px;
  flex: 0 0 auto;
  border-radius: 8px;
  object-fit: cover;
  background: var(--ots-line-soft);
}

.attachment-preview[hidden] {
  display: none;
}

.attachment-drop {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px dashed #c9ced9;
  border-radius: 12px;
  background: #fbfbfd;
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.attachment-drop:hover,
.attachment-drop.is-dragging {
  border-color: var(--ots-blue);
  background: #f4f6ff;
}

.attachment-drop:focus-within {
  outline: 2px solid var(--ots-blue);
  outline-offset: 2px;
}

.attachment-drop.is-invalid {
  border-color: #e11d48;
  background: #fff5f7;
}

.attachment-drop-icon {
  display: inline-flex;
  height: 38px;
  width: 38px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #eef0ff;
  color: var(--ots-blue);
}

.attachment-figure {
  overflow: hidden;
  border: 1px solid var(--ots-line);
  border-radius: 12px;
  background: #fff;
}

.attachment-figure a {
  display: block;
}

.attachment-figure img {
  display: block;
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  background: var(--ots-line-soft);
}

.attachment-figure figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--ots-line);
  padding: 8px 10px;
  font-size: 10.5px;
  color: #5f6570;
}

.attachment-thumb {
  display: block;
  height: 40px;
  width: 40px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--ots-line);
  border-radius: 8px;
  background: var(--ots-line-soft);
}

.attachment-thumb img {
  height: 100%;
  width: 100%;
  object-fit: cover;
}

/* Mobile drawer & full-height quick search -------------------------------- */
@media (max-width: 1023px) {
  #sidebar {
    width: min(282px, 88vw);
    padding-bottom: env(safe-area-inset-bottom);
  }
}

@media (max-width: 639px) {
  .quick-search {
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
  }

  .quick-search-panel {
    display: flex;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: 100dvh;
    flex-direction: column;
    border: 0;
    border-radius: 0;
  }

  .quick-search-head {
    padding: 14px 16px;
  }

  .quick-search-body {
    flex: 1 1 auto;
    max-height: none;
    overflow-y: auto;
  }

  .quick-search-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
}
