/* ══════════════════════════════════════════════════════════════════════════════
   Arkway Refrigeration — Service Desk
   Design system: "Corporate Trust" — indigo/violet, dimensional depth, gradients
   ══════════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Corporate Trust core palette */
  --indigo:         #4F46E5;   /* Indigo 600 — primary brand */
  --indigo-dark:    #4338CA;   /* Indigo 700 — hover / depth */
  --indigo-deep:    #312E81;   /* Indigo 900 — dark sections */
  --violet:         #7C3AED;   /* Violet 600 — secondary / gradient end */
  --indigo-soft:    #EEF2FF;   /* Indigo 50  — soft tint backgrounds */
  --violet-soft:    #F5F3FF;   /* Violet 50  — soft tint backgrounds */

  /* Signature gradients */
  --grad:      linear-gradient(135deg, var(--indigo) 0%, var(--violet) 100%);
  --grad-soft: linear-gradient(135deg, var(--indigo-soft) 0%, var(--violet-soft) 100%);
  --grad-dark: linear-gradient(160deg, var(--indigo-deep) 0%, #1E1B4B 100%);

  /* Legacy brand aliases now mapped onto the new palette so every existing
     rule (var(--ink)/var(--arctic)/var(--glacier)…) rebrands from one place. */
  --ink:            #0F172A;   /* Slate 900 — main text */
  --arctic:         var(--indigo);
  --arctic-deep:    var(--indigo-dark);
  --glacier:        var(--violet);
  --glacier-pale:   #DDD6FE;   /* Violet 200 */
  --frost:          #F1F5F9;   /* Slate 100 — muted block */

  /* Semantic aliases */
  --color-primary:      var(--indigo);
  --color-primary-dark: var(--indigo-dark);
  --color-danger:       #E11D48;   /* Rose 600 */
  --color-success:      #10B981;   /* Emerald 500 */
  --color-warning:      #F59E0B;   /* Amber 500 */
  --color-bg:           #F8FAFC;   /* Slate 50 */
  --color-surface:      #FFFFFF;
  --color-border:       #E2E8F0;   /* Slate 200 */
  --color-border-soft:  #EEF2F6;
  --color-muted-fill:   #F1F5F9;   /* Slate 100 — input fill */
  --color-text:         var(--ink);
  --color-muted:        #64748B;   /* Slate 500 */
  --color-nav-bg:       var(--indigo-deep);
  --color-nav-text:     #C7D2FE;   /* Indigo 200 */

  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius:    12px;   /* rounded-xl for cards */
  --radius-sm: 8px;    /* rounded-lg for inputs/buttons */

  /* Coloured shadows — the visual signature. Indigo-tinted, never neutral grey. */
  --shadow:     0 4px 20px -2px rgba(79,70,229,.10);
  --shadow-md:  0 10px 25px -5px rgba(79,70,229,.15), 0 8px 10px -6px rgba(79,70,229,.10);
  --shadow-lg:  0 20px 40px -8px rgba(79,70,229,.22);
  --shadow-pop: 0 20px 40px -8px rgba(79,70,229,.22);
  --shadow-btn: 0 4px 14px 0 rgba(79,70,229,.30);
  --rail: var(--grad);
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -.006em;
  position: relative;
}

/* Signature: the gradient rail across the top */
body::before {
  content: '';
  position: fixed; top: 0; left: 0; right: 0;
  height: 3px; background: var(--rail); z-index: 500;
}

/* Atmospheric depth: soft blurred gradient orbs fixed behind all content */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(420px circle at 12% 8%, rgba(79,70,229,.10), transparent 60%),
    radial-gradient(480px circle at 88% 92%, rgba(124,58,237,.08), transparent 60%);
}

a { color: var(--indigo); text-decoration: none; transition: color .2s; }
a:hover { color: var(--indigo-dark); text-decoration: none; }
img { max-width: 100%; height: auto; }
::selection { background: var(--glacier-pale); color: var(--indigo-deep); }

:focus-visible { outline: 2px solid var(--arctic); outline-offset: 2px; border-radius: 4px; }

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.page-wrapper { display: flex; flex-direction: column; min-height: 100vh; }
.main-content { flex: 1; padding: 32px 24px 56px; max-width: 1400px; margin: 0 auto; width: 100%; }
.container { max-width: 880px; margin: 0 auto; }

/* ─── Nav ─────────────────────────────────────────────────────────────────── */
.navbar {
  background: var(--grad-dark);
  color: var(--color-nav-text);
  display: flex; align-items: center;
  padding: 0 24px; height: 62px; gap: 28px;
  position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid rgba(199,210,254,.14);
}
.navbar-brand {
  font-weight: 800; font-size: 1.02rem; color: #fff;
  white-space: nowrap; letter-spacing: -.02em;
  display: flex; align-items: center; gap: 10px;
}
.navbar-brand:hover { color: #fff; }
.navbar-logo {
  height: 34px; width: auto; display: block; flex-shrink: 0;
  border-radius: 4px;
}
@media (max-width: 480px) { .navbar-brand span { display: none; } }
.navbar-nav { display: flex; align-items: center; gap: 2px; list-style: none; }
.navbar-nav a {
  color: var(--color-nav-text); padding: 8px 14px; border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 500; transition: background .15s, color .15s;
  position: relative;
}
.navbar-nav a:hover { background: rgba(255,255,255,.09); color: #fff; }
.navbar-nav a.active { background: rgba(139,92,246,.22); color: #fff; }
.navbar-nav a.active::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: -1px;
  height: 2px; background: var(--violet); border-radius: 2px 2px 0 0;
}
.navbar-spacer { flex: 1; }
.navbar-user {
  font-size: .85rem; color: #8FADC7;
  display: flex; align-items: center; gap: 14px; white-space: nowrap;
}
.navbar-user span { font-weight: 500; color: #C3DAEC; }
.navbar-user a { color: #8FADC7; font-size: .85rem; }
.navbar-user a:hover { color: var(--glacier); }
.navbar-hamburger {
  display: none; background: none; border: none; color: var(--color-nav-text);
  cursor: pointer; padding: 8px; font-size: 1.35rem; line-height: 1;
}
.navbar-menu { display: flex; align-items: center; gap: 8px; flex: 1; }

@media (max-width: 768px) {
  .navbar { padding: 0 16px; }
  .navbar-hamburger { display: block; margin-left: auto; }
  .navbar-menu {
    display: none; position: absolute; top: 62px; left: 0; right: 0;
    background: var(--ink); flex-direction: column; align-items: stretch;
    padding: 12px 16px 16px; gap: 4px; box-shadow: var(--shadow-pop);
    border-bottom: 1px solid rgba(111,201,232,.18); z-index: 99;
  }
  .navbar-menu.open { display: flex; }
  .navbar-nav { flex-direction: column; width: 100%; align-items: stretch; }
  .navbar-nav a { display: block; padding: 11px 14px; }
  .navbar-nav a.active::after { display: none; }
  .navbar-spacer { display: none; }
  .navbar-user {
    flex-direction: row; justify-content: space-between; width: 100%;
    border-top: 1px solid rgba(255,255,255,.08); padding-top: 12px; margin-top: 6px;
  }
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.footer {
  background: var(--grad-dark); color: #A5B4FC; text-align: center;
  padding: 22px 16px; font-size: .78rem; margin-top: auto;
  border-top: 1px solid rgba(199,210,254,.12);
}

/* ─── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px; border-bottom: 1px solid var(--color-border-soft);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; background: #FCFDFE;
}
.card-header h2, .card-header h3 { margin: 0; font-size: .98rem; font-weight: 700; letter-spacing: -.01em; }
.card-body { padding: 20px; }

/* ─── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 18px; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: .875rem; font-weight: 600;
  cursor: pointer; border: 1px solid transparent; text-decoration: none;
  transition: transform .2s, box-shadow .2s, background .2s, border-color .2s, color .2s;
  white-space: nowrap; line-height: 1.4; letter-spacing: -.005em;
}
/* Corporate Trust feedback: subtle upward lift + deepened shadow */
.btn:active { transform: translateY(0); }
/* Primary: signature indigo→violet gradient with coloured shadow */
.btn-primary { background: var(--grad); color: #fff; box-shadow: var(--shadow-btn); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 22px 0 rgba(79,70,229,.42); color: #fff; }
/* Secondary: white with border, tints on hover */
.btn-secondary { background: #fff; color: #334155; border-color: var(--color-border); }
.btn-secondary:hover { background: var(--indigo-soft); border-color: #C7D2FE; color: var(--indigo-dark); transform: translateY(-1px); }
.btn-danger { background: var(--color-danger); color: #fff; box-shadow: 0 4px 14px 0 rgba(225,29,72,.28); }
.btn-danger:hover { transform: translateY(-2px); box-shadow: 0 8px 22px 0 rgba(225,29,72,.38); color: #fff; }
.btn-success { background: var(--color-success); color: #fff; box-shadow: 0 4px 14px 0 rgba(16,185,129,.26); }
.btn-success:hover { transform: translateY(-2px); box-shadow: 0 8px 22px 0 rgba(16,185,129,.36); color: #fff; }
.btn-warning { background: var(--color-warning); color: #fff; box-shadow: 0 4px 14px 0 rgba(245,158,11,.26); }
.btn-warning:hover { transform: translateY(-2px); box-shadow: 0 8px 22px 0 rgba(245,158,11,.36); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: .78rem; border-radius: 7px; box-shadow: none; }
.btn-sm:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-icon {
  padding: 7px; border-radius: var(--radius-sm); background: transparent;
  border: 1px solid var(--color-border); cursor: pointer; font-size: .9rem; color: var(--color-muted);
  transition: background .2s, border-color .2s;
}
.btn-icon:hover { background: var(--indigo-soft); border-color: #C7D2FE; }

/* ─── Forms ───────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; font-size: .8rem; font-weight: 600; margin-bottom: 6px;
  color: var(--ink); letter-spacing: -.005em;
}
.form-label .required { color: var(--color-danger); margin-left: 2px; }
.form-control {
  display: block; width: 100%; padding: 10px 13px;
  font-family: var(--font); font-size: .9rem; color: var(--ink);
  border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  background: #fff; transition: border-color .2s, box-shadow .2s; min-height: 42px;
}
.form-control::placeholder { color: #94A3B8; }
.form-control:hover { border-color: #CBD5E1; }
/* Corporate Trust focus: indigo border + soft offset ring */
.form-control:focus {
  outline: none; border-color: var(--indigo);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(79,70,229,.45);
}
textarea.form-control { min-height: 110px; resize: vertical; line-height: 1.6; }
select.form-control {
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748B' d='M6 8.5L1.5 4h9z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px;
}
.form-control[multiple] { background-image: none; padding-right: 13px; min-height: 100px; }
.form-hint { font-size: .78rem; color: var(--color-muted); margin-top: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 600px) { .form-row, .form-row-3 { grid-template-columns: 1fr; } }
.form-check { display: flex; align-items: center; gap: 9px; font-size: .875rem; margin-bottom: 10px; cursor: pointer; }
.form-check input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--arctic); }
.form-actions {
  display: flex; gap: 10px; align-items: center; margin-top: 24px;
  padding-top: 20px; border-top: 1px solid var(--color-border-soft); flex-wrap: wrap;
}

/* ─── Tables ──────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th {
  background: var(--frost); text-align: left; padding: 11px 14px;
  font-weight: 700; color: #5B7793; font-size: .72rem;
  text-transform: uppercase; letter-spacing: .07em;
  border-bottom: 1px solid var(--color-border); white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--color-border-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table-hover tbody tr { transition: background .12s; }
.table-hover tbody tr:hover td { background: #FAFCFE; }
.table-clickable tbody tr { cursor: pointer; }
.table-clickable tbody tr:hover td { background: var(--frost); }
.table-empty { text-align: center; padding: 48px 20px; color: var(--color-muted); font-size: .9rem; }
/* Ticket numbers read as data — tabular figures keep columns aligned */
.table td strong { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

/* ─── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: .73rem; font-weight: 600; white-space: nowrap; letter-spacing: -.003em;
}
.badge-low { background: #EEF3F8; color: #5B7793; }
.badge-normal { background: #DDEEFB; color: #0C6BB8; }
.badge-high { background: #FDE6CE; color: #B4620A; }
.badge-urgent { background: #FBE0E0; color: #C63333; }
.badge-state-open { background: #D7F2E9; color: #0E7358; }
.badge-state-pending { background: #FCF0CE; color: #96690B; }
.badge-state-resolved { background: #E1E7FB; color: #3A3F9E; }
.badge-state-closed { background: #EEF3F8; color: #5B7793; }
.badge-js-progress { background: #DDEEFB; color: #0C6BB8; }
.badge-js-customer { background: #FCEDD3; color: #96690B; }
.badge-js-parts { background: #D9EFFA; color: #0B6A9C; }
.badge-js-third { background: #EBE3FB; color: #6B3FC4; }
.badge-js-urgent { background: #FBE0E0; color: #C63333; }

/* ─── Flash messages ─────────────────────────────────────────────────────── */
.flash {
  padding: 13px 17px; border-radius: var(--radius-sm); margin-bottom: 20px;
  display: flex; align-items: center; gap: 10px; font-size: .88rem; font-weight: 500;
  border: 1px solid transparent; border-left-width: 3px;
}
.flash-success { background: #EAF8F3; color: #0E7358; border-color: #B9E5D6; border-left-color: var(--color-success); }
.flash-error   { background: #FDEEEE; color: #C63333; border-color: #F5CFCF; border-left-color: var(--color-danger); }
.flash-warning { background: #FDF6E4; color: #96690B; border-color: #F2E0B5; border-left-color: var(--color-warning); }
.flash-info    { background: var(--frost); color: var(--arctic-deep); border-color: #C7E0F1; border-left-color: var(--arctic); }
.flash-icon { font-weight: 700; flex-shrink: 0; }

/* ─── Page header ─────────────────────────────────────────────────────────── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; margin-bottom: 26px; flex-wrap: wrap;
}
.page-header h1 { font-size: 1.55rem; font-weight: 800; color: var(--ink); letter-spacing: -.03em; }
.breadcrumb { font-size: .8rem; color: var(--color-muted); margin-bottom: 6px; font-weight: 500; }
.breadcrumb a { color: var(--color-muted); }
.breadcrumb a:hover { color: var(--arctic); }

/* ─── Tabs ────────────────────────────────────────────────────────────────── */
.tabs {
  display: flex; gap: 4px; border-bottom: 1px solid var(--color-border);
  margin-bottom: 22px; overflow-x: auto;
  -ms-overflow-style: none; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  padding: 11px 18px; font-family: var(--font); font-size: .89rem; font-weight: 600;
  border: none; background: none; cursor: pointer; color: var(--color-muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  white-space: nowrap; transition: color .15s, border-color .15s;
  display: inline-flex; align-items: center;
}
.tab-btn.active { color: var(--ink); border-bottom-color: var(--arctic); }
.tab-btn:hover:not(.active) { color: var(--ink); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ─── Timeline ────────────────────────────────────────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: 16px; }
.timeline-item { display: flex; gap: 14px; }
.timeline-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .74rem; font-weight: 700; flex-shrink: 0; margin-top: 2px;
  letter-spacing: -.02em; box-shadow: 0 0 16px rgba(79,70,229,.35);
}
.timeline-avatar.system { background: var(--indigo-soft); color: var(--indigo); font-size: .62rem; box-shadow: none; }
.timeline-body { flex: 1; min-width: 0; }
.timeline-meta { font-size: .78rem; color: var(--color-muted); margin-bottom: 5px; }
.timeline-meta strong { color: var(--ink); font-weight: 600; }
.timeline-content {
  background: #fff; border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); padding: 11px 15px;
  font-size: .89rem; line-height: 1.6;
}
.timeline-content.system {
  background: transparent; border-color: var(--color-border-soft);
  font-size: .82rem; color: var(--color-muted); font-style: normal;
  border-left: 2px solid var(--glacier); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ─── Attachments ─────────────────────────────────────────────────────────── */
.attachment-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.attachment-item {
  border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  overflow: hidden; position: relative; background: #fff;
}
.attachment-item { transition: transform .2s, box-shadow .2s; }
.attachment-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--color-border-soft); }
.attachment-item img { width: 100%; height: 124px; object-fit: cover; display: block; background: var(--frost); }
.attachment-pdf {
  height: 124px; display: flex; align-items: center; justify-content: center;
  background: var(--frost); font-size: 2rem;
}
.attachment-meta { padding: 8px 10px; font-size: .74rem; color: var(--color-muted); line-height: 1.4; }
.attachment-meta div:first-child { color: var(--ink); font-weight: 600; word-break: break-word; }
.attachment-actions { display: flex; gap: 5px; padding: 0 10px 10px; }
.attachment-delete-form { position: absolute; top: 6px; right: 6px; }

/* ─── Stat cards ──────────────────────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 28px; }
.stat-card {
  background: #fff; border: 1px solid var(--color-border-soft);
  border-radius: var(--radius); padding: 20px 22px;
  box-shadow: var(--shadow); text-decoration: none; color: var(--ink);
  display: block; position: relative; overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
/* gradient seam down the left edge of every metric */
.stat-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--grad);
}
/* Corporate Trust feedback: lift + deepened coloured shadow */
.stat-card:hover {
  transform: translateY(-4px); box-shadow: var(--shadow-md); text-decoration: none;
}
/* Signature gradient text on the metric number */
.stat-card-num {
  font-size: 2.2rem; font-weight: 800;
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--indigo);
  line-height: 1; margin-bottom: 6px; letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
}
.stat-card-label { font-size: .78rem; color: var(--color-muted); font-weight: 500; }
.stat-card.urgent::before { background: var(--color-danger); }
.stat-card.urgent .stat-card-num {
  background: none; -webkit-text-fill-color: var(--color-danger); color: var(--color-danger);
}
.stat-card.warning::before { background: var(--color-warning); }
.stat-card.warning .stat-card-num {
  background: none; -webkit-text-fill-color: var(--color-warning); color: var(--color-warning);
}

/* ─── Filters ────────────────────────────────────────────────────────────── */
.filter-bar {
  background: #fff; border: 1px solid var(--color-border-soft);
  border-radius: var(--radius); padding: 18px; margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
/* Advanced filters: transparent to layout on desktop, removed entirely on phones */
.filter-advanced { display: contents; }
.filter-row .form-group { margin: 0; flex: 1; min-width: 150px; }
.filter-tags { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--color-border-soft); }
.filter-tag {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--frost); color: var(--arctic-deep);
  border: 1px solid #C7E0F1; border-radius: 999px;
  padding: 3px 6px 3px 11px; font-size: .76rem; font-weight: 600;
}
.filter-tag button {
  background: none; border: none; cursor: pointer; color: #6D93B4;
  font-size: .95rem; line-height: 1; padding: 0 3px; border-radius: 50%;
}
.filter-tag button:hover { color: var(--color-danger); }

/* ─── Filter dropdown ────────────────────────────────────────────────────── */
.flt-drop { position: relative; user-select: none; }
.flt-drop-trigger {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 13px; border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); background: #fff; cursor: pointer;
  font-size: .875rem; min-height: 42px; gap: 8px; white-space: nowrap;
  transition: border-color .2s, box-shadow .2s;
}
.flt-drop-trigger:hover { border-color: #CBD5E1; }
.flt-drop.open .flt-drop-trigger { border-color: var(--indigo); box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(79,70,229,.45); }
.flt-drop-arrow { font-size: .68rem; color: var(--color-muted); transition: transform .18s; flex-shrink: 0; }
.flt-drop.open .flt-drop-arrow { transform: rotate(180deg); }
.flt-drop-label { color: var(--ink); overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.flt-drop-menu {
  visibility: hidden; opacity: 0; pointer-events: none;
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 190px;
  background: #fff; border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-pop);
  z-index: 200; padding: 5px 0; transition: opacity .14s, transform .14s;
  transform: translateY(-4px);
}
.flt-drop.open .flt-drop-menu { visibility: visible; opacity: 1; pointer-events: auto; transform: translateY(0); }
.flt-drop-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 13px;
  font-size: .86rem; cursor: pointer; white-space: nowrap;
}
.flt-drop-item:hover { background: var(--frost); }
.flt-drop-item input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; accent-color: var(--arctic); flex-shrink: 0; }

/* ─── Toggle switch ──────────────────────────────────────────────────────── */
.toggle-wrap { display: flex; align-items: center; gap: 12px; font-size: .89rem; }
.toggle { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; background: #CBDCE9; border-radius: 999px;
  transition: background .2s; cursor: pointer;
}
.toggle-slider::before {
  content: ''; position: absolute; left: 3px; top: 3px;
  width: 18px; height: 18px; background: #fff; border-radius: 50%;
  transition: transform .2s; box-shadow: 0 1px 3px rgba(10,43,78,.2);
}
.toggle input:checked + .toggle-slider { background: var(--arctic); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ─── Session modal ──────────────────────────────────────────────────────── */
.session-modal {
  display: none; position: fixed; bottom: 24px; right: 24px;
  background: #fff; border: 1px solid var(--color-border);
  border-radius: var(--radius); box-shadow: var(--shadow-pop);
  padding: 18px 20px; z-index: 9999; max-width: 330px; width: calc(100% - 48px);
  border-top: 3px solid var(--color-warning);
}
.session-modal.visible { display: block; animation: slideUp .25s ease-out; }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.session-modal h4 { font-size: .9rem; margin-bottom: 7px; color: var(--color-warning); font-weight: 700; }
.session-modal p { font-size: .84rem; margin-bottom: 14px; color: var(--color-muted); }

/* ─── Login ───────────────────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: var(--color-bg); position: relative;
}
/* Atmospheric blur-orbs behind the login card — the Corporate Trust signature */
.login-wrap::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 55% 45% at 22% 15%, rgba(79,70,229,.30), transparent 65%),
    radial-gradient(ellipse 55% 45% at 82% 88%, rgba(124,58,237,.26), transparent 65%);
  filter: blur(8px);
  pointer-events: none;
}
.login-card {
  background: #fff; border: 1px solid var(--color-border-soft);
  border-radius: 16px; box-shadow: var(--shadow-lg);
  padding: 44px 40px; width: 100%; max-width: 410px;
  position: relative; overflow: hidden;
}
.login-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: var(--rail);
}
.login-logo { height: 64px; width: auto; display: block; margin: 0 0 22px; }
.login-card h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: 6px; letter-spacing: -.035em; color: var(--ink); }
.login-card .tagline { color: var(--color-muted); font-size: .875rem; margin-bottom: 30px; }

/* ─── Detail rows ─────────────────────────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
@media (max-width: 600px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-row {
  padding: 13px 20px; border-bottom: 1px solid var(--color-border-soft);
  display: flex; flex-direction: column; gap: 4px;
}
.detail-row:last-child { border-bottom: none; }
.detail-label {
  font-size: .7rem; font-weight: 700; color: #5B7793;
  text-transform: uppercase; letter-spacing: .07em;
}
.detail-value { font-size: .9rem; color: var(--ink); }

/* ─── Pagination ─────────────────────────────────────────────────────────── */
.pagination-wrap {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; margin-top: 20px; padding: 0 4px;
}
.pagination-info { font-size: .82rem; color: var(--color-muted); }
.pagination { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.pagination a, .pagination span {
  display: inline-block; padding: 7px 12px; border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); font-size: .85rem; color: var(--ink); font-weight: 500;
  text-decoration: none; transition: background .15s, border-color .15s;
}
.pagination a:hover { background: var(--indigo-soft); border-color: var(--indigo); color: var(--indigo); }
.pagination .current { background: var(--indigo); color: #fff; border-color: var(--indigo); }
.pagination .disabled { color: var(--color-muted); border-color: var(--color-border-soft); cursor: default; }
.pagination .ellipsis { border: none; padding: 7px 4px; color: var(--color-muted); }
@media (max-width: 640px) {
  .pagination-wrap { flex-direction: column; align-items: flex-start; }
  .pagination a, .pagination span { padding: 6px 10px; font-size: .8rem; }
}

/* ─── Utilities ───────────────────────────────────────────────────────────── */
/* Tag cloud card spans two columns in the reports grid; collapses on narrow screens */
@media (max-width: 680px) { .tag-cloud-card { grid-column: span 1 !important; } }
.text-muted { color: var(--color-muted); }
.text-danger { color: var(--color-danger); }
.text-success { color: var(--color-success); }
.text-right { text-align: right; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 16px; } .mt-4 { margin-top: 26px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 18px; } .mb-4 { margin-bottom: 26px; }
.gap-2 { gap: 10px; }
.d-flex { display: flex; } .align-center { align-items: center; } .justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.w-100 { width: 100%; }
.hidden { display: none !important; }
.divider { border: none; border-top: 1px solid var(--color-border-soft); margin: 24px 0; }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
  .filter-advanced { display: none !important; }
  .filter-row .form-group { min-width: 0; }
  .main-content { padding: 20px 14px 40px; }
  .page-header h1 { font-size: 1.3rem; }
  .stat-card-num { font-size: 1.8rem; }
}
@media (max-width: 900px) { .hide-tablet { display: none !important; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ─── Tag picker widget ──────────────────────────────────────────────────────── */
.tag-picker {
  position: relative;
}
.tag-pills {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  min-height: 42px; padding: 6px 10px;
  border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  background: #fff; cursor: text;
  transition: border-color .2s, box-shadow .2s;
}
.tag-picker:focus-within .tag-pills {
  border-color: var(--indigo);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(79,70,229,.45);
}
.tag-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px 3px 10px; border-radius: 999px;
  background: var(--indigo-soft); color: var(--indigo-dark);
  font-size: .8rem; font-weight: 600; white-space: nowrap;
}
.tag-pill-remove {
  background: none; border: none; cursor: pointer; padding: 0;
  font-size: 1rem; line-height: 1; color: var(--indigo);
  opacity: .6; transition: opacity .15s;
}
.tag-pill-remove:hover { opacity: 1; }
.tag-input {
  border: none; outline: none; flex: 1; min-width: 120px;
  font-family: var(--font); font-size: .9rem; color: var(--ink);
  background: transparent; padding: 2px 0;
}
.tag-input::placeholder { color: #94A3B8; }
.tag-dropdown {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  background: #fff; border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-pop);
  max-height: 200px; overflow-y: auto; z-index: 50;
  list-style: none; padding: 4px 0; margin: 0;
}
.tag-dropdown li {
  padding: 8px 14px; font-size: .88rem; cursor: pointer;
  transition: background .12s;
}
.tag-dropdown li:hover { background: var(--indigo-soft); color: var(--indigo-dark); }

/* ─── Job note picker — reuses .tag-picker styles from above ─────────────────── */
.jn-pill { background: var(--indigo-soft); color: var(--indigo-dark); }

/* ─── Mobile ticket view — paired rows stay side-by-side ─────────────────── */
@media (max-width: 768px) {
  .detail-row-pair { display: grid !important; grid-template-columns: 1fr 1fr !important; }
}

/* ─── WYSIWYG rendered output (ticket view) ─────────────────────────────────── */
.wysiwyg-render h2 { font-size:1.05rem; font-weight:700; margin:10px 0 4px; color:var(--ink); }
.wysiwyg-render h3 { font-size:.92rem;  font-weight:700; margin:8px  0 3px; color:var(--ink); }
.wysiwyg-render ul, .wysiwyg-render ol { padding-left:22px; margin:4px 0; }
.wysiwyg-render li  { margin:2px 0; }
.wysiwyg-render hr  { border:none; border-top:2px solid var(--color-border); margin:10px 0; }
.wysiwyg-render p   { margin:0 0 4px; }
