/* ── Design tokens ──────────────────────────────────────────────────────── */
:root {
  --navy:      #1E3A5F;
  --navy-dark: #152B47;
  --navy-mid:  #2A4F7C;
  --steel:     #4A7FA5;
  --sky:       #E8F2FA;
  --white:     #FFFFFF;

  --urgent:    #DC2626;
  --high:      #D97706;
  --normal:    #2563EB;

  --grey-50:   #F9FAFB;
  --grey-100:  #F3F4F6;
  --grey-200:  #E5E7EB;
  --grey-400:  #9CA3AF;
  --grey-600:  #4B5563;
  --grey-800:  #1F2937;

  --success-bg: #ECFDF5;
  --success:    #059669;
  --error-bg:   #FEF2F2;
  --error:      #DC2626;
  --info-bg:    #EFF6FF;
  --info:       #2563EB;
  --warn-bg:    #FFFBEB;
  --warn:       #D97706;

  --radius:    8px;
  --radius-lg: 14px;
  --shadow:    0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.10), 0 2px 4px rgba(0,0,0,.06);

  --font:  'Inter', system-ui, sans-serif;
  --mono:  'JetBrains Mono', 'Fira Code', monospace;
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; padding: 0;
  font-family: var(--font);
  background: var(--grey-50);
  color: var(--grey-800);
  line-height: 1.6;
  font-size: 15px;
}
a { color: var(--navy-mid); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navigation ─────────────────────────────────────────────────────────── */
.nav {
  background: var(--navy-dark);
  border-bottom: 2px solid var(--navy-mid);
  position: sticky; top: 0; z-index: 100;
}
.nav-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  height: 58px;
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--white); font-weight: 700; font-size: 16px;
  text-decoration: none; letter-spacing: -.2px;
}
.nav-brand:hover { text-decoration: none; }
.nav-brand-icon {
  font-size: 22px; color: var(--steel);
  line-height: 1;
}
.nav-links { display: flex; gap: 4px; }
.nav-link {
  color: #93b4d4; padding: 6px 14px; border-radius: var(--radius);
  font-size: 14px; font-weight: 500;
  transition: background .15s, color .15s;
  text-decoration: none;
}
.nav-link:hover { background: rgba(255,255,255,.08); color: var(--white); text-decoration: none; }
.nav-link--accent {
  background: var(--steel); color: var(--white) !important;
}
.nav-link--accent:hover { background: var(--navy-mid); }

/* ── Flash messages ─────────────────────────────────────────────────────── */
.flash-wrap { padding: 0 24px; }
.flash {
  max-width: 1100px; margin: 12px auto 0;
  padding: 12px 18px; border-radius: var(--radius);
  font-size: 14px; font-weight: 500;
}
.flash--success { background: var(--success-bg); color: var(--success);  border: 1px solid #a7f3d0; }
.flash--error   { background: var(--error-bg);   color: var(--error);    border: 1px solid #fecaca; }
.flash--info    { background: var(--info-bg);     color: var(--info);     border: 1px solid #bfdbfe; }
.flash--warning { background: var(--warn-bg);     color: var(--warn);     border: 1px solid #fde68a; }

/* ── Page container ─────────────────────────────────────────────────────── */
.page { max-width: 1100px; margin: 0 auto; padding: 28px 24px 60px; }
.page--narrow { max-width: 680px; }
.page--wide   { max-width: 1200px; }

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy-mid) 100%);
  color: var(--white); padding: 36px 24px 40px;
  text-align: center;
}
.hero h1 { font-size: 2rem; font-weight: 700; margin: 0 0 10px; letter-spacing: -.5px; }
.hero p  { font-size: 1rem; color: #93b4d4; margin: 0 auto 24px; max-width: 520px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ── Card grid ──────────────────────────────────────────────────────────── */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; align-items: stretch; }
.card {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 20px 22px;
  border: 1px solid var(--grey-200);
  transition: box-shadow .2s, transform .2s;
  display: flex; flex-direction: column;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-icon { font-size: 32px; margin-bottom: 14px; }
.card h3   { margin: 0 0 8px; font-size: 17px; color: var(--navy); }
.card p    { margin: 0 0 20px; color: var(--grey-600); font-size: 14px; line-height: 1.5; flex: 1; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; border-radius: var(--radius);
  font-family: var(--font); font-size: 14px; font-weight: 600;
  cursor: pointer; border: none;
  text-decoration: none; transition: background .15s, transform .1s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.98); }

.btn--primary   { background: var(--white); color: var(--navy); }
.btn--primary:hover   { background: var(--sky); color: var(--navy-dark); }
.btn--secondary { background: var(--white); color: var(--navy); border: 1px solid var(--grey-200); }
.btn--secondary:hover { background: var(--grey-100); color: var(--navy); }
.btn--danger    { background: var(--error); color: var(--white); }
.btn--danger:hover    { background: #b91c1c; color: var(--white); }
.btn--success   { background: var(--success); color: var(--white); }
.btn--success:hover   { background: #047857; color: var(--white); }
.btn--lg { padding: 14px 32px; font-size: 15px; }
.btn--sm { padding: 6px 14px; font-size: 13px; }

/* ── Forms ──────────────────────────────────────────────────────────────── */
.form-card {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); padding: 36px;
  border: 1px solid var(--grey-200);
}
.form-title { font-size: 22px; font-weight: 700; color: var(--navy); margin: 0 0 6px; }
.form-sub   { color: var(--grey-600); font-size: 14px; margin: 0 0 28px; }
.form-group { margin-bottom: 20px; }
.form-row   { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
label { display: block; font-size: 13px; font-weight: 600;
        color: var(--grey-600); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password],
select, textarea {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--grey-200); border-radius: var(--radius);
  font-family: var(--font); font-size: 14px; color: var(--grey-800);
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--steel);
  box-shadow: 0 0 0 3px rgba(74,127,165,.18);
}
textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
.form-hint { font-size: 12px; color: var(--grey-400); margin-top: 5px; }

/* Priority radio buttons */
.priority-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.priority-option { position: relative; }
.priority-option input[type=radio] { position: absolute; opacity: 0; }
.priority-label {
  display: block; padding: 12px 10px; text-align: center;
  border: 2px solid var(--grey-200); border-radius: var(--radius);
  cursor: pointer; transition: all .15s; font-size: 13px; font-weight: 600;
}
.priority-option input:checked + .priority-label {
  border-color: currentColor;
  background: color-mix(in srgb, currentColor 10%, white);
}
.priority-label--urgent { color: var(--urgent); }
.priority-label--high   { color: var(--high); }
.priority-label--normal { color: var(--normal); }
.priority-sla { display: block; font-size: 11px; font-weight: 400;
                margin-top: 2px; opacity: .8; }

/* ── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase;
}
.badge--urgent  { background: #fee2e2; color: var(--urgent); }
.badge--high    { background: #fef3c7; color: var(--high); }
.badge--normal  { background: #dbeafe; color: var(--normal); }
.badge--open        { background: #dbeafe; color: #1d4ed8; }
.badge--in_progress { background: #fef3c7; color: #92400e; }
.badge--waiting     { background: #ede9fe; color: #5b21b6; }
.badge--resolved    { background: var(--success-bg); color: var(--success); }
.badge--closed      { background: var(--grey-100); color: var(--grey-600); }

/* ── Ticket reference display ───────────────────────────────────────────── */
.ticket-ref {
  font-family: var(--mono); font-size: 18px; font-weight: 600;
  color: var(--navy); letter-spacing: .5px;
}

/* ── SOS code box ───────────────────────────────────────────────────────── */
.sos-code-box {
  background: #fef3c7; border: 2px solid #f59e0b;
  border-radius: var(--radius-lg); padding: 24px;
  text-align: center; margin: 24px 0;
}
.sos-code-box .lbl { font-size: 12px; font-weight: 700; text-transform: uppercase;
                      color: #92400e; letter-spacing: 1px; }
.sos-code-box .code {
  font-family: var(--mono); font-size: 2.4rem; font-weight: 700;
  color: var(--navy-dark); letter-spacing: 6px; margin: 8px 0;
}

/* ── Steps ──────────────────────────────────────────────────────────────── */
.steps { list-style: none; padding: 0; margin: 0; counter-reset: steps; }
.steps li {
  counter-increment: steps;
  display: flex; gap: 16px; padding: 16px 0;
  border-bottom: 1px solid var(--grey-200);
}
.steps li:last-child { border-bottom: none; }
.steps li::before {
  content: counter(steps);
  flex-shrink: 0; width: 32px; height: 32px;
  background: var(--navy); color: var(--white);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.steps li p { margin: 4px 0 0; font-size: 14px; color: var(--grey-600); }
.steps li strong { font-size: 15px; display: block; }

/* ── Admin table ────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: 10px 14px; background: var(--grey-50);
     font-size: 12px; font-weight: 600; text-transform: uppercase;
     letter-spacing: .5px; color: var(--grey-600);
     border-bottom: 2px solid var(--grey-200); }
td { padding: 12px 14px; border-bottom: 1px solid var(--grey-100);
     vertical-align: middle; }
tr:hover td { background: var(--sky); }

/* ── Stat cards (admin) ─────────────────────────────────────────────────── */
.stats { display: flex; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.stat {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--grey-200); padding: 16px 22px;
  min-width: 140px;
}
.stat-value { font-size: 28px; font-weight: 700; color: var(--navy); line-height: 1; }
.stat-label { font-size: 12px; color: var(--grey-400); margin-top: 4px; text-transform: uppercase;
              letter-spacing: .5px; }
.stat--urgent .stat-value { color: var(--urgent); }

/* ── Activity timeline ──────────────────────────────────────────────────── */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline-item {
  display: flex; gap: 14px; padding: 14px 0;
  border-bottom: 1px solid var(--grey-100);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-dot {
  flex-shrink: 0; width: 10px; height: 10px; border-radius: 50%;
  background: var(--steel); margin-top: 5px;
}
.timeline-dot--private { background: var(--grey-400); }
.timeline-meta { font-size: 12px; color: var(--grey-400); margin-bottom: 4px; }
.timeline-body { font-size: 14px; line-height: 1.5; }

/* ── Confirmation / success page ────────────────────────────────────────── */
.confirm-icon { font-size: 56px; margin-bottom: 16px; }
.confirm-card {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); padding: 48px 40px;
  text-align: center; border: 1px solid var(--grey-200);
}
.confirm-card h1 { font-size: 1.8rem; color: var(--navy); margin: 0 0 10px; }
.confirm-card p  { color: var(--grey-600); margin: 0 0 12px; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.footer {
  background: var(--navy-dark); border-top: 1px solid var(--navy-mid);
  padding: 20px 24px;
}
.footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; gap: 12px; align-items: center; justify-content: center;
  flex-wrap: wrap; font-size: 13px; color: #93b4d4;
}
.footer a { color: #93b4d4; }
.footer a:hover { color: var(--white); }
.footer-sep { opacity: .4; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .hero h1 { font-size: 1.8rem; }
  .form-row { grid-template-columns: 1fr; }
  .priority-grid { grid-template-columns: 1fr; }
  .form-card { padding: 24px 18px; }
  .confirm-card { padding: 36px 24px; }
  .nav-links { gap: 0; }
  .nav-link { padding: 6px 10px; font-size: 13px; }
}

/* ── Nav icon (inline SVG alongside link text) ──────────────────────────── */
.nav-icon {
  width: 15px; height: 15px;
  vertical-align: middle;
  margin-right: 5px;
  opacity: 0.75;
  flex-shrink: 0;
}
.nav-link { display: inline-flex; align-items: center; }

/* ── Hero logo ───────────────────────────────────────────────────────────── */
.hero-logo {
  margin-bottom: 14px;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.35));
}
.hero-logo svg {
  border-radius: 18px;
}

/* ── Card SVG icons (replaces emoji card-icon) ───────────────────────────── */
.card-icon-svg {
  width: 52px; height: 52px;
  background: var(--sky);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  color: var(--navy-mid);
}
.card-icon-svg svg {
  width: 28px; height: 28px;
}

/* ── SOS download banner ─────────────────────────────────────────────────── */
.sos-download-banner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  background: var(--success-bg);
  border: 1.5px solid #a7f3d0;
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin: 24px 0 0;
  overflow: hidden;
}
.sos-download-info {
  display: flex; align-items: center; gap: 10px;
  flex: 1; min-width: 0; flex-wrap: wrap;
}
.sos-download-label {
  font-weight: 700; font-size: 15px; color: #065f46;
  white-space: nowrap; flex-shrink: 0;
}
.sos-download-meta {
  font-size: 12px; color: #047857;
  font-family: var(--mono);
  white-space: nowrap;
  padding: 2px 8px;
  background: rgba(5,150,105,.08);
  border-radius: 4px;
}
.sos-download-btn {
  flex-shrink: 0; white-space: nowrap;
}

/* ── Traffic light indicator ─────────────────────────────────────────────── */
.traffic-light {
  width: 14px; height: 14px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(0,0,0,.08);
}
.traffic-light--green { background: #22c55e; }
.traffic-light--amber { background: #f59e0b; }
.traffic-light--red   { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,.5); }
.traffic-light--off   { background: var(--grey-200); }

/* Flash red rows very subtly */
.row--urgent td { background: #fff8f8; }
.row--urgent:hover td { background: #fff0f0; }

/* ── SLA meter bar (ticket detail header) ────────────────────────────────── */
.sla-meter { display:flex; align-items:center; gap:10px; }
.sla-meter-track {
  width: 120px; height: 8px; background: var(--grey-200);
  border-radius: 4px; overflow: hidden;
}
.sla-meter-fill {
  height: 100%; border-radius: 4px; transition: width .3s;
}
.sla-meter-fill--green { background: #22c55e; }
.sla-meter-fill--amber { background: #f59e0b; }
.sla-meter-fill--red   { background: #ef4444; }
.sla-meter-label { font-size: 12px; color: var(--grey-400); white-space: nowrap; }

/* ── Ticket detail three-column layout ───────────────────────────────────── */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 14px;
  align-items: start;
}
.detail-main    { min-width: 0; }
.detail-sidebar { min-width: 0; }

@media (max-width: 860px) {
  .detail-layout { grid-template-columns: 1fr; }
  .detail-sidebar { order: -1; }
}

/* ── Client reply badge ──────────────────────────────────────────────────── */
.badge--client-reply {
  background: #ede9fe;
  color: #5b21b6;
  border: 1px solid #c4b5fd;
  animation: reply-pulse 2s ease-in-out infinite;
}
@keyframes reply-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(139,92,246,0); }
  50%       { box-shadow: 0 0 0 4px rgba(139,92,246,.2); }
}

/* ── File drop zone ──────────────────────────────────────────────────────── */
.file-drop-zone {
  position: relative;
  border: 2px dashed var(--grey-200);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.file-drop-zone:hover,
.file-drop-zone--over {
  border-color: var(--steel);
  background: var(--sky);
}

/* ── File list (below drop zone after selection) ─────────────────────────── */
.file-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.file-list-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; background: var(--grey-50);
  border: 1px solid var(--grey-200); border-radius: var(--radius);
  font-size: 13px;
}
.file-list-name { color: var(--grey-800); font-weight: 500; }
.file-list-size { color: var(--grey-400); font-size: 12px; }

/* ── Attachment list (ticket detail / status) ────────────────────────────── */
.attachment-list { display: flex; flex-direction: column; gap: 8px; }
.attachment-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--grey-50); border: 1px solid var(--grey-200);
  border-radius: var(--radius);
}
.attachment-icon { font-size: 22px; flex-shrink: 0; line-height: 1; }
.attachment-info { flex: 1; min-width: 0; }
.attachment-name {
  font-size: 13px; font-weight: 600; color: var(--navy-mid);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: block;
}
a.attachment-name:hover { text-decoration: underline; }
.attachment-meta { font-size: 11px; color: var(--grey-400); margin-top: 2px; }

/* ── Hero CTA button (Log a Ticket — standout on dark background) ────────── */
.btn--hero-cta {
  background: #4A9ED6;
  color: var(--white);
  border: none;
}
.btn--hero-cta:hover { background: #3A8FD4; color: var(--white); }

/* ── Card button (navy on white card background) ─────────────────────────── */
.btn--card {
  background: var(--navy);
  color: var(--white);
  margin-top: auto;   /* pushes to bottom of flex card */
  align-self: flex-start;
}
.btn--card:hover { background: var(--navy-dark); color: var(--white); }

/* ── Mobile overhaul (max 640px) ─────────────────────────────────────────── */
@media (max-width: 640px) {

  /* Nav — hamburger-style collapse */
  .nav-inner { flex-wrap: wrap; height: auto; padding: 12px 16px; gap: 10px; }
  .nav-brand  { font-size: 15px; }
  .nav-links  {
    width: 100%; display: flex; flex-wrap: wrap;
    gap: 4px; padding: 6px 0 4px;
    border-top: 1px solid rgba(255,255,255,.08);
  }
  .nav-link   { font-size: 12px; padding: 5px 8px; }
  .nav-icon   { display: none; }   /* hide icons on mobile to save space */

  /* Hero */
  .hero         { padding: 40px 16px; }
  .hero h1      { font-size: 1.6rem; }
  .hero p       { font-size: 0.95rem; }
  .hero-logo svg { width: 60px; height: 60px; }
  .hero-actions { flex-direction: column; align-items: stretch; gap: 10px; }
  .hero-actions .btn { justify-content: center; }

  /* Page padding */
  .page { padding: 24px 14px 60px; }

  /* Cards — single column, no hover lift on touch */
  .cards { grid-template-columns: 1fr; gap: 14px; }
  .card:hover { transform: none; }

  /* SLA response grid */
  .sla-grid { grid-template-columns: 1fr !important; }

  /* Forms */
  .form-card    { padding: 20px 16px; }
  .form-row     { grid-template-columns: 1fr; gap: 0; }
  .priority-grid { grid-template-columns: 1fr; }

  /* Ticket status page */
  .sos-code-box .code { font-size: 1.8rem; letter-spacing: 3px; }

  /* Admin table — horizontal scroll */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table       { min-width: 700px; }

  /* Detail layout — stack vertically, sidebar goes on top */
  .detail-layout { grid-template-columns: 1fr; }
  .detail-sidebar { order: -1; }

  /* SOS download banner — stack vertically */
  .sos-download-banner { flex-direction: column; align-items: stretch; }
  .sos-download-info   { flex-direction: column; gap: 4px; }
  .sos-download-btn    { width: 100%; justify-content: center; }

  /* Attachment items */
  .attachment-name { font-size: 12px; }

  /* Buttons */
  .btn--lg { padding: 12px 20px; font-size: 14px; }

  /* Footer */
  .footer-inner { flex-direction: column; gap: 6px; text-align: center; }
  .footer-sep   { display: none; }

  /* Stat cards */
  .stats { gap: 10px; }
  .stat  { min-width: 100px; padding: 12px 16px; }
  .stat-value { font-size: 22px; }

  /* Confirm page */
  .confirm-card { padding: 28px 16px; }
  .confirm-icon { font-size: 40px; }
}

/* ── Tablet (641px – 860px) ──────────────────────────────────────────────── */
@media (min-width: 641px) and (max-width: 860px) {
  .nav-link { font-size: 13px; padding: 6px 10px; }
  .hero { padding: 48px 24px; }
  .hero h1 { font-size: 2rem; }
  .cards { grid-template-columns: 1fr 1fr; }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-sidebar { order: -1; }
  .table-wrap { overflow-x: auto; }
  table { min-width: 640px; }
}

/* ── Portal ticket cards ─────────────────────────────────────────────────── */
.portal-ticket-card {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  background: var(--white); border-radius: var(--radius-lg);
  border: 1px solid var(--grey-200); box-shadow: var(--shadow);
  padding: 20px 24px;
  transition: box-shadow .2s;
}
.portal-ticket-card:hover { box-shadow: var(--shadow-md); }
.portal-ticket-left  { flex: 1; min-width: 200px; }
.portal-ticket-right { min-width: 160px; text-align: right; }

@media (max-width: 640px) {
  .portal-ticket-card  { flex-direction: column; }
  .portal-ticket-right { width: 100%; text-align: left; }
}

/* ── Clickable stat tiles ─────────────────────────────────────────────────── */
.stat--link {
  text-decoration: none; cursor: pointer;
  transition: box-shadow .15s, transform .15s, border-color .15s;
  border: 2px solid transparent;
}
.stat--link:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
  border-color: var(--steel);
}
.stat--link:hover .stat-value,
.stat--link:hover .stat-label { color: inherit; }
.stat--active {
  border-color: var(--navy) !important;
  background: var(--sky);
}
.stat--active .stat-value { color: var(--navy); }
.stat--reply .stat-value  { color: #5b21b6; }
.stat--reply.stat--active { border-color: #5b21b6 !important; background: #ede9fe; }
.stat--urgent.stat--active { border-color: var(--urgent) !important; background: #fee2e2; }

/* ── Collapsible card sections ───────────────────────────────────────────── */
.collapsible-card {
  background: var(--white); border-radius: var(--radius-lg);
  border: 1px solid var(--grey-200); box-shadow: var(--shadow);
  overflow: hidden;
}
.collapsible-toggle {
  width: 100%; display: flex; align-items: center;
  justify-content: space-between; gap: 12px;
  padding: 16px 20px; background: none; border: none;
  cursor: pointer; font-family: var(--font);
  font-size: 15px; font-weight: 600; color: var(--navy);
  text-align: left; transition: background .15s;
}
.collapsible-toggle:hover { background: var(--grey-50); }
.collapsible-arrow { flex-shrink:0; transition: transform .2s; color: var(--grey-400); }
.collapsible-body  { padding: 0 20px 20px; border-top: 1px solid var(--grey-200); padding-top: 16px; }

/* ── Client timeline dot colour ──────────────────────────────────────────── */
.timeline-dot--client { background: var(--navy-mid); }

/* ── Admin tabs ──────────────────────────────────────────────────────────── */
.admin-tabs {
  display: flex; gap: 4px;
  background: var(--grey-100); border-radius: var(--radius);
  padding: 4px;
}
.admin-tab {
  padding: 8px 18px; border: none; border-radius: 6px;
  font-family: var(--font); font-size: 14px; font-weight: 500;
  color: var(--grey-600); background: none; cursor: pointer;
  transition: background .15s, color .15s;
}
.admin-tab:hover { background: var(--white); color: var(--navy); }
.admin-tab--active {
  background: var(--white); color: var(--navy);
  box-shadow: var(--shadow); font-weight: 600;
}

/* ── Appointment cards ───────────────────────────────────────────────────── */
.appt-card {
  display: flex; align-items: flex-start; gap: 20px;
  background: var(--white); border-radius: var(--radius-lg);
  border: 1px solid var(--grey-200); box-shadow: var(--shadow);
  padding: 18px 22px; flex-wrap: wrap;
}
.appt-card--upcoming { border-left: 4px solid var(--navy-mid); }
.appt-card--past     { border-left: 4px solid var(--grey-200); opacity: .85; }

.appt-date {
  text-align: center; min-width: 54px; flex-shrink: 0;
}
.appt-day   { font-size: 28px; font-weight: 700; color: var(--navy); line-height: 1; }
.appt-month { font-size: 11px; color: var(--grey-400); text-transform: uppercase;
              letter-spacing: .5px; margin-top: 2px; }
.appt-time  { font-family: var(--mono); font-size: 13px; color: var(--steel);
              margin-top: 4px; font-weight: 600; }

.appt-body  { flex: 1; min-width: 200px; }
.appt-title { font-size: 15px; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.appt-meta  { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px;
              color: var(--grey-600); }

.appt-actions {
  display: flex; flex-direction: column; gap: 6px;
  align-items: flex-end; flex-shrink: 0;
}

@media (max-width: 640px) {
  .appt-card    { flex-direction: column; }
  .appt-actions { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
}

/* ── Clickable table rows ────────────────────────────────────────────────── */
.row--clickable { cursor: pointer; }
.row--clickable:hover td { background: var(--sky); }

/* ── Word break for long URLs in activity timeline ───────────────────────── */
.timeline-body { word-break: break-word; overflow-wrap: anywhere; }
