/* UWC International, Integrated Application Manager — custom styles */

:root {
  /* Brand palette — brightened, sampled from the UWC logo */
  --uwc-blue:        #1668A0;   /* the logo's ring blue */
  --uwc-blue-light:  #2E9BD0;
  --uwc-teal:        #0F9C8D;   /* the logo's continent teal */
  --uwc-gold:        #F5A623;

  /* ── Semantic tokens — LIGHT theme (default) ─────────────────── */
  --bg:            #eef4fb;
  --surface:       #ffffff;
  --surface-2:     #f4f8fd;
  --surface-3:     #eaf1f8;
  --border:        #dbe6f0;
  --border-strong: #c4d4e4;
  --text:          #16273c;
  --text-muted:    #566a83;
  --text-subtle:   #8598ad;
  --accent:        #1668A0;   /* headings / stat values */
  --input-bg:      #f4f8fd;
  --chip-bg:       #e9f2fa;

  /* Login (landing) — light-first, theme-aware */
  --login-card-bg:     rgba(255,255,255,0.82);
  --login-card-border: rgba(255,255,255,0.95);
  --login-ink:         #16273c;
  --login-muted:       #4a5d76;
  --login-faint:       #7c8ea6;
  --login-input-bg:    rgba(255,255,255,0.92);
  --login-input-border:#cbdcec;
  --login-input-ink:   #16273c;
  --login-hint-bg:     rgba(255,255,255,0.55);

  /* Sidebar rail — LIGHT theme */
  --sidebar-bg:          #ffffff;
  --sidebar-hover:       #eef2f7;
  --sidebar-text:        #475569;
  --sidebar-text-strong: #0F2744;
  --sidebar-text-muted:  #94a3b8;
  --sidebar-border:      rgba(15,39,68,0.08);
  --sidebar-active-bg:   rgba(23,165,137,0.12);

  /* Logo ring colours (light sidebar → dark rings) */
  --logo-ring-1: #1B4F72;
  --logo-ring-2: #17A589;

  /* Bright, airy landing gradient for the light (default) theme. */
  --login-grad: linear-gradient(135deg, #eaf5fc 0%, #cfe9f5 45%, #d6f2ec 100%);

  --chat-user-bg:  #1668A0;

  --radius:        0.75rem;
  --shadow:        0 4px 24px rgba(27,79,114,0.10);
  --shadow-lg:     0 8px 40px rgba(27,79,114,0.18);

  /* Back-compat aliases (older rules referenced these) */
  --uwc-sidebar:       var(--sidebar-bg);
  --uwc-sidebar-hover: var(--sidebar-hover);
  --chat-bg:           var(--surface-2);
  --chat-bot-bg:       var(--surface);
}

:root[data-theme="dark"] {
  --bg:            #0b1220;
  --surface:       #141d30;
  --surface-2:     #1b2740;
  --surface-3:     #212f4a;
  --border:        #2b3a57;
  --border-strong: #3a4b6d;
  --text:          #e6ecf5;
  --text-muted:    #9fb0c9;
  --text-subtle:   #7386a3;
  --accent:        #6fb3d4;
  --input-bg:      #0f1828;
  --chip-bg:       #1b2740;

  /* Sidebar rail — DARK theme (deep navy, light text/rings) */
  --sidebar-bg:          #070e1b;
  --sidebar-hover:       #14233c;
  --sidebar-text:        rgba(255,255,255,0.65);
  --sidebar-text-strong: #ffffff;
  --sidebar-text-muted:  rgba(255,255,255,0.45);
  --sidebar-border:      rgba(255,255,255,0.08);
  --sidebar-active-bg:   rgba(23,165,137,0.18);

  --logo-ring-1: #ffffff;
  --logo-ring-2: #2EC4B6;

  --login-grad:    linear-gradient(135deg, #050a13 0%, #0F2744 55%, #143a52 100%);

  /* Login (landing) — dark theme keeps the deep-blue glass look. */
  --login-card-bg:     rgba(255,255,255,0.10);
  --login-card-border: rgba(255,255,255,0.20);
  --login-ink:         #ffffff;
  --login-muted:       rgba(255,255,255,0.75);
  --login-faint:       rgba(255,255,255,0.5);
  --login-input-bg:    rgba(255,255,255,0.15);
  --login-input-border:rgba(255,255,255,0.30);
  --login-input-ink:   #ffffff;
  --login-hint-bg:     rgba(255,255,255,0.07);

  --shadow:        0 4px 24px rgba(0,0,0,0.40);
  --shadow-lg:     0 8px 40px rgba(0,0,0,0.55);
}

/* ── Base ───────────────────────────────────────────────────── */
* { box-sizing: border-box; }

html { color-scheme: light dark; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background 0.25s ease, color 0.25s ease;
}

/* ── Login backgrounds ──────────────────────────────────────── */
.bg-gradient-blue  { background: var(--login-grad); }
.bg-gradient-teal  { background: linear-gradient(135deg, #0D4F4F 0%, #17A589 50%, #1ABC9C 100%); }
.bg-gradient-warm  { background: linear-gradient(135deg, #7B341E 0%, #C0392B 50%, #E67E22 100%); }
.bg-gradient-earth { background: linear-gradient(135deg, #2C3E50 0%, #3D6B57 50%, #27AE60 100%); }

/* ── Login card (theme-aware) ───────────────────────────────── */
.login-card {
  background: var(--login-card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--login-card-border);
  border-radius: 1.5rem;
  box-shadow: var(--shadow-lg);
}

/* The UWC logo on the login sits on the (light) gradient directly. */
.login-logo-img { width: 190px; max-width: 70%; height: auto; display: block; margin: 0 auto 0.25rem; }
.sidebar-logo .uwc-logo-img { width: 42px; height: 42px; object-fit: contain; flex-shrink: 0; }

.login-input {
  background: var(--login-input-bg);
  border: 1px solid var(--login-input-border);
  color: var(--login-input-ink);
  border-radius: 0.6rem;
  padding: 0.75rem 1rem;
  width: 100%;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  font-size: 0.95rem;
}
.login-input::placeholder { color: var(--login-faint); }
.login-input:focus {
  border-color: var(--uwc-blue-light);
  background: var(--surface);
}

.login-btn {
  background: linear-gradient(90deg, var(--uwc-teal), var(--uwc-blue-light));
  color: #fff;
  border: none;
  border-radius: 0.6rem;
  padding: 0.8rem;
  width: 100%;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: opacity 0.2s, transform 0.15s;
}
.login-btn:hover  { opacity: 0.9; transform: translateY(-1px); }
.login-btn:active { transform: translateY(0); }

/* Quote fade animation */
@keyframes fadeQuote {
  0%   { opacity: 0; transform: translateY(8px); }
  15%  { opacity: 1; transform: translateY(0); }
  85%  { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-8px); }
}
.quote-anim { animation: fadeQuote 6s ease-in-out infinite; }

/* ── Dashboard layout ───────────────────────────────────────── */
.app-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: 64px 1fr auto;
  grid-template-areas:
    "sidebar topbar"
    "sidebar main"
    "sidebar chatbar";
  min-height: 100vh;
}

@media (max-width: 768px) {
  .app-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 56px 1fr auto auto;
    grid-template-areas:
      "topbar"
      "main"
      "chatbar"
      "sidebar";
  }
  .sidebar { position: fixed; bottom: 0; width: 100%; z-index: 50; }
}

/* ── Sidebar (light in light theme, deep navy in dark theme) ── */
.sidebar {
  grid-area: sidebar;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow-y: auto;
  transition: background 0.25s ease, color 0.25s ease;
}

.sidebar-logo {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.sidebar-logo img, .sidebar-logo .uwc-logo { width: 40px; height: 40px; flex-shrink: 0; }
.sidebar-logo span {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--sidebar-text-muted);
  line-height: 1.3;
}

.sidebar-nav { flex: 1; padding: 1rem 0; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1.5rem;
  color: var(--sidebar-text);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 0;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
  border-left: 3px solid transparent;
}
.nav-item:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-strong);
  border-left-color: var(--uwc-teal);
}
.nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-text-strong);
  border-left-color: var(--uwc-teal);
}
.nav-icon { width: 18px; text-align: center; opacity: 0.8; }

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--sidebar-border);
  font-size: 0.8rem;
  color: var(--sidebar-text-muted);
}

/* ── Inline UWC logo (two interlinked circles, CSS-coloured) ── */
.uwc-logo .lr1, .uwc-logo .lrw { stroke: var(--logo-ring-1); }
.uwc-logo .lr2 { stroke: var(--logo-ring-2); }
/* On the login gradient the rings are always light, regardless of theme */
.login-bg .uwc-logo .lr1, .login-bg .uwc-logo .lrw { stroke: #ffffff; }
.login-bg .uwc-logo .lr2 { stroke: #2EC4B6; }
.logo-area .uwc-logo { width: 90px; height: 90px; display: block; margin: 0 auto; }

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar {
  grid-area: topbar;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--chip-bg);
  border-radius: 2rem;
  padding: 0.35rem 1rem 0.35rem 0.35rem;
}
.user-pill span { color: var(--text); }

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--uwc-blue), var(--uwc-teal));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.role-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 1rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.role-NC_MEMBER    { background: #dbeafe; color: #1d4ed8; }
.role-SCHOOL_ADMIN { background: #d1fae5; color: #065f46; }
.role-SUPER_ADMIN  { background: #fef3c7; color: #92400e; }

/* ── Main content ───────────────────────────────────────────── */
.main-content {
  grid-area: main;
  padding: 1.5rem;
  overflow-y: auto;
  background: var(--bg);
}

/* ── Stat cards ─────────────────────────────────────────────── */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 1rem;
}
/* Clickable stat cards drill into the matching list. */
.stat-card.clickable {
  cursor: pointer;
  position: relative;
  transition: transform .15s, box-shadow .2s, border-color .2s;
}
.stat-card.clickable:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--teal);
}
.stat-card.clickable::after {
  content: "→";
  position: absolute; top: .7rem; right: .9rem;
  color: var(--faint, var(--text-subtle));
  opacity: 0; transform: translateX(-3px);
  transition: opacity .15s, transform .15s;
  font-size: .9rem;
}
.stat-card.clickable:hover::after { opacity: .8; transform: translateX(0); }
.stat-card.clickable:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.2rem;
}

/* ── Density preference (V0.5 #5) ───────────────────────────── */
:root[data-density="compact"] .app-card { padding: 0.6rem 0.85rem; }
:root[data-density="compact"] .stat-card { padding: 0.75rem 1rem; }
:root[data-density="compact"] .main-content { padding: 0.9rem; }
:root[data-density="compact"] #appGrid { gap: 0.5rem !important; }

/* ── Application cards ──────────────────────────────────────── */
.app-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--border);
  transition: box-shadow 0.2s, transform 0.15s, border-color 0.2s;
  cursor: pointer;
}
.app-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.app-card.state-submitted        { border-left-color: #94a3b8; }
.app-card.state-under_review     { border-left-color: #3b82f6; }
.app-card.state-nominated        { border-left-color: #14b8a6; }
.app-card.state-waitlisted       { border-left-color: #f59e0b; }
.app-card.state-not_selected     { border-left-color: #94a3b8; }
.app-card.state-school_pending   { border-left-color: #f97316; }
.app-card.state-school_accepted  { border-left-color: #22c55e; }
.app-card.state-school_rejected  { border-left-color: #ef4444; }
.app-card.state-more_info_needed { border-left-color: #a855f7; }
.app-card.state-withdrawn        { border-left-color: #64748b; }

/* State badges (light chips read on either theme) */
.state-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 1rem;
  letter-spacing: 0.02em;
}
.badge-gray   { background: #f1f5f9; color: #64748b; }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-teal   { background: #ccfbf1; color: #0f766e; }
.badge-yellow { background: #fef9c3; color: #854d0e; }
.badge-slate  { background: #f1f5f9; color: #475569; }
.badge-orange { background: #ffedd5; color: #9a3412; }
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-red    { background: #fee2e2; color: #b91c1c; }
.badge-purple { background: #f3e8ff; color: #7e22ce; }
.badge-stone  { background: #f5f5f4; color: #57534e; }
.badge-indigo { background: #e0e7ff; color: #4338ca; }
.badge-cyan   { background: #cffafe; color: #0e7490; }

/* ── List / board view toggle ───────────────────────────────── */
.view-toggle { display: inline-flex; gap: 0.3rem; }
.view-btn {
  font-size: 0.8rem; padding: 0.3rem 0.7rem; border-radius: 7px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); cursor: pointer; transition: all 0.12s;
}
.view-btn:hover { background: var(--surface-2); color: var(--text); }
.view-btn.active { background: var(--uwc-blue); color: #fff; border-color: var(--uwc-blue); }

/* ── Multi-select cards ─────────────────────────────────────── */
.card-check-wrap { display: inline-flex; align-items: center; padding-top: 0.1rem; }
.card-check { width: 16px; height: 16px; cursor: pointer; accent-color: var(--uwc-blue); }
.app-card.card-selected {
  outline: 2px solid var(--uwc-blue); outline-offset: -1px;
  box-shadow: 0 0 0 3px rgba(22,104,160,0.12);
}

/* ── Pipeline board (Kanban) ────────────────────────────────── */
.board-loading { padding: 2rem; text-align: center; color: var(--text-muted); }
.board-scroll {
  display: flex; gap: 0.8rem; overflow-x: auto; padding-bottom: 0.8rem;
  scroll-snap-type: x proximity;
}
.board-col {
  flex: 0 0 260px; min-width: 260px; scroll-snap-align: start;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; display: flex; flex-direction: column; max-height: 72vh;
}
.board-col-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface-2); border-radius: 12px 12px 0 0;
}
.board-col-n { font-size: 0.78rem; font-weight: 700; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.board-col-body { padding: 0.5rem; overflow-y: auto; display: flex; flex-direction: column; gap: 0.5rem; }
.board-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 9px;
  padding: 0.55rem 0.6rem; cursor: pointer; transition: border-color 0.12s, box-shadow 0.12s;
}
.board-card:hover { border-color: var(--uwc-blue-light); box-shadow: var(--shadow-sm, 0 1px 4px rgba(0,0,0,0.06)); }
.board-card-name { font-weight: 600; font-size: 0.84rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-card-sub { font-size: 0.74rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-empty { color: var(--text-subtle, #94a3b8); font-size: 0.8rem; text-align: center; padding: 0.6rem 0; }
.board-more { font-size: 0.74rem; color: var(--text-muted); text-align: center; padding: 0.3rem 0; }

/* ── Selection round bar ────────────────────────────────────── */
.round-bar {
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 0.55rem 0.9rem; margin-bottom: 1rem;
  box-shadow: var(--shadow, 0 1px 3px rgba(0,0,0,0.05));
}
.round-bar-label {
  font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 700;
}
#roundFilter {
  font-size: 0.85rem; padding: 0.35rem 0.6rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--input-bg); color: var(--text);
  min-width: 180px; font-weight: 600;
}

/* ── Round creation modal bits ──────────────────────────────── */
.round-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.2rem; border-bottom: 1px solid var(--border);
}
.round-field-label {
  display: block; font-size: 0.75rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.35rem;
}
.round-input {
  width: 100%; border: 1px solid var(--border); border-radius: 0.5rem;
  padding: 0.5rem 0.7rem; font-size: 0.9rem; background: var(--input-bg); color: var(--text);
}
.round-prog-list {
  max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 0.15rem;
  border: 1px solid var(--border); border-radius: 0.5rem; padding: 0.4rem;
}
.round-prog {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.4rem;
  font-size: 0.86rem; border-radius: 6px; cursor: pointer;
}
.round-prog:hover { background: var(--surface-2); }
.round-prog input { accent-color: var(--uwc-blue); }
.modal-x { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--text-subtle); }

/* ── Analytics overlay ──────────────────────────────────────── */
.analytics-overlay {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(15,39,68,0.5); backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 2.5rem 1rem; overflow-y: auto;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.analytics-overlay.open { opacity: 1; pointer-events: all; }
.an-loading { color: #fff; padding: 3rem; font-size: 1rem; }
.an-panel {
  background: var(--surface); border-radius: 1.1rem; width: 100%; max-width: 1000px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35); overflow: hidden;
}
.an-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--border);
}
.an-eyebrow { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--uwc-teal); font-weight: 700; margin-bottom: 0.3rem; }
.an-round-select {
  font-size: 1rem; font-weight: 700; border: 1px solid var(--border);
  border-radius: 8px; padding: 0.35rem 0.6rem; background: var(--input-bg); color: var(--text);
}
.an-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.8rem; padding: 1.2rem 1.4rem 0; }
.an-tile { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 0.9rem 1rem; }
.an-tile-n { font-size: 1.7rem; font-weight: 750; color: var(--uwc-blue); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.an-tile-l { font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); font-weight: 700; }
.an-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding: 1.2rem 1.4rem 1.4rem; }
.an-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.1rem; }
.an-card-title { font-size: 0.85rem; font-weight: 700; color: var(--text); margin-bottom: 0.7rem; }
.an-sub { font-weight: 500; color: var(--text-muted); font-size: 0.78rem; }
.an-row { display: grid; grid-template-columns: 8.5rem 1fr 3.2rem; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; }
.an-row-label { font-size: 0.78rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-bar-track { background: var(--border); border-radius: 999px; height: 0.7rem; overflow: hidden; }
.an-bar-fill { height: 100%; border-radius: 999px; min-width: 2px; }
.an-row-val { font-size: 0.8rem; font-weight: 700; text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.an-pct { font-weight: 500; color: var(--text-subtle); font-size: 0.72rem; }
.an-empty { color: var(--text-subtle); font-size: 0.82rem; padding: 0.5rem 0; }
.an-hist { display: flex; align-items: flex-end; gap: 3px; height: 110px; padding-top: 0.4rem; }
.an-hist-col { flex: 1; display: flex; align-items: flex-end; height: 100%; }
.an-hist-fill { width: 100%; background: var(--uwc-teal); border-radius: 3px 3px 0 0; min-height: 2px; }
.an-hist-axis { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--text-subtle); margin-top: 0.3rem; }
.an-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.an-table th { text-align: left; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-subtle); padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--border); }
.an-table td { padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.an-table td:first-child { font-variant-numeric: normal; }
@media (max-width: 760px) {
  .an-tiles { grid-template-columns: repeat(2, 1fr); }
  .an-grid { grid-template-columns: 1fr; }
}

/* ── Notifications bell ─────────────────────────────────────── */
.notif-bell { position: relative; }
.notif-badge {
  position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: 999px; background: var(--uwc-blue); color: #fff;
  font-size: 0.66rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.notif-badge.urgent { background: #ef4444; }

/* ── Tasks / deadlines ──────────────────────────────────────── */
.task-tabs { display: flex; gap: 0.3rem; margin-top: 0.3rem; }
.task-tab {
  font-size: 0.76rem; padding: 0.2rem 0.6rem; border-radius: 7px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); cursor: pointer;
}
.task-tab.active { background: var(--uwc-blue); color: #fff; border-color: var(--uwc-blue); }
.task-add { display: flex; gap: 0.4rem; margin-bottom: 0.8rem; }
.task-list { display: flex; flex-direction: column; gap: 0.1rem; }
.task-item { display: flex; align-items: center; gap: 0.55rem; padding: 0.45rem 0.2rem; border-bottom: 1px solid var(--border); }
.task-item input[type=checkbox] { accent-color: var(--uwc-teal); width: 16px; height: 16px; cursor: pointer; }
.task-main { flex: 1; min-width: 0; }
.task-title { font-size: 0.88rem; color: var(--text); }
.task-item.done .task-title { text-decoration: line-through; color: var(--text-subtle); }
.task-who { font-size: 0.76rem; color: var(--text-muted); }
.task-due { font-size: 0.72rem; color: var(--text-subtle); }
.task-due.overdue { color: #ef4444; font-weight: 700; }
.task-due.soon { color: #b45309; font-weight: 600; }
.task-due.none { font-style: italic; opacity: 0.7; }
.task-del { background: none; border: none; cursor: pointer; color: var(--text-subtle); font-size: 0.9rem; opacity: 0.6; }
.task-del:hover { opacity: 1; color: #ef4444; }

/* ── Tags / flags ───────────────────────────────────────────── */
.tags-bar { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.5rem; align-items: center; }
.tag-chip {
  display: inline-flex; align-items: center; gap: 0.25rem;
  font-size: 0.72rem; font-weight: 600; padding: 0.15rem 0.55rem;
  background: var(--chip-bg, var(--surface-2)); color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 999px;
}
.tag-chip.tag-flagged { background: #fef9c3; color: #854d0e; border-color: #fde68a; }
.tag-x { background: none; border: none; cursor: pointer; color: inherit; font-size: 0.9rem; line-height: 1; padding: 0; opacity: 0.6; }
.tag-x:hover { opacity: 1; }
.tag-add, .tag-flag {
  font-size: 0.72rem; padding: 0.15rem 0.5rem; border-radius: 999px;
  border: 1px dashed var(--border); background: transparent; color: var(--text-muted); cursor: pointer;
}
.tag-add:hover { border-style: solid; color: var(--text); }
.tag-flag { border-style: solid; }
.tag-flag.on { background: #fef9c3; border-color: #fde68a; }

/* Card evaluation meta line */
.card-meta { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.5rem; align-items: center; }
.card-rubric { font-size: 0.72rem; font-weight: 700; color: #0f766e; background: #ccfbf1; border-radius: 999px; padding: 0.1rem 0.45rem; }
.card-flag { font-size: 0.8rem; }
.card-tag { font-size: 0.68rem; color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 0.05rem 0.4rem; }

/* ── Rubric panel ───────────────────────────────────────────── */
.rubric-panel { border: 1px solid var(--border); border-radius: 0.6rem; padding: 0.8rem 0.9rem; }
.rubric-loading { color: var(--text-muted); font-size: 0.85rem; }
.rubric-agg { font-weight: 400; font-size: 0.78rem; margin-left: 0.4rem; }
.rubric-agg-pill { background: #ccfbf1; color: #0f766e; border-radius: 999px; padding: 0.1rem 0.5rem; font-weight: 700; }
.rubric-agg-pill.muted { background: var(--surface-2); color: var(--text-subtle); font-weight: 500; }
.rubric-row { display: grid; grid-template-columns: 12rem 1fr 3.2rem; align-items: center; gap: 0.6rem; margin-bottom: 0.5rem; }
.rubric-crit { display: flex; flex-direction: column; }
.rubric-crit-label { font-size: 0.82rem; color: var(--text); }
.rubric-weight { font-size: 0.68rem; color: var(--text-subtle); }
.rubric-range { width: 100%; accent-color: var(--uwc-teal); }
.rubric-val { font-size: 0.8rem; font-weight: 700; text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.rubric-comment { width: 100%; margin-top: 0.5rem; border: 1px solid var(--border); border-radius: 0.5rem; padding: 0.5rem 0.6rem; font-size: 0.85rem; background: var(--input-bg); color: var(--text); resize: vertical; min-height: 44px; }
.rubric-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 0.6rem; }
.rubric-total { font-size: 0.9rem; color: var(--text); }
.rubric-total b { font-size: 1.15rem; color: var(--uwc-teal); }

/* ── Internal notes ─────────────────────────────────────────── */
.notes-thread { display: flex; flex-direction: column; gap: 0.5rem; max-height: 200px; overflow-y: auto; margin-bottom: 0.5rem; }
.note-item { background: var(--surface-2); border: 1px solid var(--border); border-radius: 0.5rem; padding: 0.5rem 0.65rem; }
.note-meta { font-size: 0.7rem; color: var(--text-subtle); margin-bottom: 0.2rem; }
.note-body { font-size: 0.85rem; color: var(--text); white-space: pre-wrap; }

/* ── Version history ────────────────────────────────────────── */
.hist-block { margin-bottom: 0.8rem; }
.hist-title { font-size: 0.78rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.3rem; }
.hist-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.3rem 0; border-bottom: 1px solid var(--border); font-size: 0.82rem; }
.hist-name { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-hash { font-family: var(--mono, ui-monospace, monospace); font-size: 0.72rem; color: var(--text-subtle); }
.hist-when { font-size: 0.74rem; color: var(--text-subtle); white-space: nowrap; }
.hist-note { font-size: 0.75rem; color: var(--text-subtle); margin-top: 0.4rem; }

/* ── Bulk action bar (floats below the top bar; clears the chat dock) ── */
.bulk-bar {
  position: fixed; left: 50%; transform: translate(-50%, -160%);
  top: 4.9rem; z-index: 1000;
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 0.55rem 0.9rem;
  box-shadow: 0 8px 30px rgba(6,12,22,0.18);
  transition: transform 0.2s ease; opacity: 0; pointer-events: none;
}
.bulk-bar.open { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.bulk-count { font-weight: 700; font-size: 0.85rem; color: var(--uwc-blue); }
.bulk-label { font-size: 0.82rem; color: var(--text-muted); }
.bulk-select {
  font-size: 0.82rem; padding: 0.3rem 0.5rem; border-radius: 7px;
  border: 1px solid var(--border); background: var(--input-bg); color: var(--text);
}

/* ── Modals / panels ────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,39,68,0.5);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal-box {
  background: var(--surface);
  color: var(--text);
  border-radius: 1.25rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  max-width: 640px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s;
}
.modal-overlay.open .modal-box {
  transform: translateY(0) scale(1);
}

/* ── Chat panel ─────────────────────────────────────────────── */
.chatbar {
  grid-area: chatbar;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 16px rgba(0,0,0,0.06);
  z-index: 30;
  position: sticky;
  bottom: 0;
}

.chat-history {
  max-height: 260px;
  overflow-y: auto;
  padding: 1rem 1rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  transition: max-height 0.3s ease;
}
.chat-history.collapsed { max-height: 0; padding: 0; overflow: hidden; }

.chat-bubble {
  max-width: 78%;
  padding: 0.6rem 0.9rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  word-break: break-word;
}
.chat-bubble.user {
  align-self: flex-end;
  background: var(--chat-user-bg);
  color: #ffffff;
  border-bottom-right-radius: 0.2rem;
}
.chat-bubble.bot {
  align-self: flex-start;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 0.2rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}
.chat-bubble .author {
  font-size: 0.7rem;
  font-weight: 600;
  opacity: 0.7;
  margin-bottom: 0.2rem;
}

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: var(--surface-2);
}
.suggestion-chip {
  background: var(--chip-bg);
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s;
}
.suggestion-chip:hover { background: var(--surface-3); }

.chat-widgets {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.5rem 1rem 0;
  scrollbar-width: none;
}
.chat-widgets::-webkit-scrollbar { display: none; }

.widget-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--chip-bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 0.5rem;
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.widget-btn:hover {
  background: var(--uwc-blue);
  color: #ffffff;
  border-color: var(--uwc-blue);
}

.chat-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
}

#chatInput {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  padding: 0.6rem 1.1rem;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
  background: var(--input-bg);
  color: var(--text);
}
#chatInput:focus { border-color: var(--uwc-blue); background: var(--surface); }

.chat-send-btn, .chat-voice-btn, .chat-toggle-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s, background 0.2s;
  font-size: 0.95rem;
}
.chat-send-btn {
  background: var(--uwc-blue);
  color: #fff;
}
.chat-send-btn:hover { background: var(--uwc-blue-light); }

.chat-voice-btn {
  background: var(--chip-bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.chat-voice-btn:hover { background: #fef2f2; color: #dc2626; }
.chat-voice-btn.recording {
  background: #dc2626;
  color: #fff;
  animation: pulse-red 1s ease-in-out infinite;
}

.chat-toggle-btn {
  background: var(--chip-bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-size: 0.75rem;
}

@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.5); }
  50%       { box-shadow: 0 0 0 6px rgba(220,38,38,0); }
}

/* ── Typing indicator ───────────────────────────────────────── */
.typing-dots span {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-subtle);
  animation: dotBounce 1.2s ease-in-out infinite;
  margin: 0 2px;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%            { transform: translateY(-5px); }
}

/* ── Search & filters ───────────────────────────────────────── */
.search-bar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.search-bar input, .search-bar select {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.45rem 0.8rem;
  font-size: 0.875rem;
  outline: none;
  background: var(--input-bg);
  color: var(--text);
  transition: border-color 0.2s;
}
.search-bar input:focus,
.search-bar select:focus { border-color: var(--uwc-blue); }
.search-bar input { flex: 1; min-width: 180px; }

/* ── Tables (admin log) ─────────────────────────────────────── */
.log-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; color: var(--text); }
.log-table th {
  text-align: left;
  padding: 0.6rem 0.8rem;
  background: var(--surface-2);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border);
}
.log-table td {
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.log-table tr:hover td { background: var(--surface-2); }

/* ── Scrollbar polish ───────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-subtle); }

/* ── Utility ────────────────────────────────────────────────── */
.section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
  margin-bottom: 0.75rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, transform 0.1s;
}
.btn:hover { opacity: 0.88; }
.btn-primary  { background: var(--uwc-blue);  color: #fff; }
.btn-teal     { background: var(--uwc-teal);  color: #fff; }
.btn-success  { background: #22c55e; color: #fff; }
.btn-danger   { background: #ef4444; color: #fff; }
.btn-warning  { background: #f59e0b; color: #fff; }
.btn-ghost    { background: var(--chip-bg); color: var(--text); border: 1px solid var(--border); }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; }

.divider { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }

/* fade-in for page load */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.4s ease forwards; }

/* Notification toast (always a dark chip so it reads on either theme) */
.toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 200;
  background: #1e293b;
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 340px;
  animation: slideInRight 0.3s ease;
}
.toast.success { border-left: 4px solid #22c55e; }
.toast.error   { border-left: 4px solid #ef4444; }
.toast.info    { border-left: 4px solid #3b82f6; }
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);   opacity: 1; }
}

/* Voice transcript overlay on input */
.voice-active-label {
  position: absolute;
  right: 58px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.72rem;
  color: #dc2626;
  font-weight: 600;
  pointer-events: none;
  animation: blink 1s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* ── Welcome / guide modal ──────────────────────────────────── */
.welcome-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 39, 68, 0.55);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
}
.welcome-overlay.open { display: flex; }
.welcome-box {
  background: var(--surface);
  color: var(--text);
  border-radius: 1.25rem;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: welcomePop 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes welcomePop {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.welcome-hero {
  background: linear-gradient(135deg, #0F2744 0%, #1B4F72 55%, #17A589 100%);
  color: #fff;
  padding: 1.6rem 1.75rem 1.4rem;
  position: relative;
}
.welcome-hero .welcome-eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.7;
  margin-bottom: 0.35rem;
}
.welcome-hero h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}
.welcome-hero p {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  line-height: 1.55;
  opacity: 0.9;
}
.welcome-close {
  position: absolute;
  top: 0.9rem;
  right: 1rem;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: background 0.15s;
}
.welcome-close:hover { background: rgba(255,255,255,0.3); }
.welcome-body {
  padding: 1.25rem 1.75rem;
  overflow-y: auto;
}
.welcome-step {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 0.6rem 0;
}
.welcome-step + .welcome-step { border-top: 1px solid var(--border); }
.welcome-step .ws-icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 0.7rem;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}
.welcome-step .ws-title {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
}
.welcome-step .ws-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 0.1rem;
}
.welcome-footer {
  padding: 1rem 1.75rem 1.4rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.welcome-dontshow {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  user-select: none;
}

/* Guide + theme toggle buttons in the topbar */
.guide-btn, .theme-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 0.5rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: background 0.15s, border-color 0.15s;
}
.guide-btn:hover, .theme-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.theme-btn { padding: 0.35rem 0.55rem; }

/* Theme toggle on the login page (chip over the gradient, theme-aware) */
.theme-btn-login {
  position: fixed;
  top: 1.1rem;
  right: 1.25rem;
  z-index: 5;
  background: var(--login-card-bg);
  border: 1px solid var(--login-card-border);
  color: var(--login-ink);
  border-radius: 2rem;
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  backdrop-filter: blur(6px);
  transition: opacity 0.15s;
}
.theme-btn-login:hover { opacity: 0.85; }

/* ── List loading / empty / pagination ──────────────────────── */
.skel {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  border-radius: 4px;
  animation: skelPulse 1.2s ease-in-out infinite;
}
@keyframes skelPulse {
  0%   { background-position: 100% 0; }
  100% { background-position: 0 0; }
}
.grid-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-subtle);
}
.load-more-wrap {
  display: none;
  justify-content: center;
  margin-top: 1.25rem;
}
.app-meta {
  font-size: 0.8rem;
  color: var(--text-subtle);
  margin: 0 0 0.75rem;
}

/* ── Document rows + media lightbox ─────────────────────────── */
.doc-row {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.45rem 0.4rem; border-bottom: 1px solid var(--border);
  cursor: pointer; border-radius: 6px;
  transition: background 0.12s;
}
.doc-row:hover { background: var(--surface-2); }
.doc-name { font-size: 0.85rem; color: var(--text); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-open { font-size: 0.72rem; color: var(--uwc-blue-light); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.doc-act {
  flex: none; width: 26px; height: 26px; line-height: 1;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface-2); color: var(--text-muted);
  font-size: 0.9rem; cursor: pointer; transition: all 0.12s;
}
.doc-act:hover { background: var(--uwc-blue); color: #fff; border-color: var(--uwc-blue); }
.doc-act-danger:hover { background: #ef4444; color: #fff; border-color: #ef4444; }

.lightbox-overlay {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(6, 12, 22, 0.86);
  backdrop-filter: blur(4px);
  display: flex; flex-direction: column;
  padding: 3.2rem 1rem 1rem;
}
.lightbox-bar {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.6rem 1rem;
  color: #fff;
}
.lightbox-cap { font-size: 0.85rem; opacity: 0.9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox-btn {
  background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.25);
  color: #fff; text-decoration: none; border-radius: 0.5rem;
  padding: 0.35rem 0.75rem; font-size: 0.82rem; cursor: pointer; white-space: nowrap;
}
.lightbox-btn:hover { background: rgba(255,255,255,0.26); }
.lightbox-body {
  flex: 1; display: flex; align-items: center; justify-content: center;
  overflow: auto;
}

/* ── Application ↔ NC conversation thread ────────────────────── */
.msg-thread {
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.6rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  margin-bottom: 0.5rem;
}
.msg-empty {
  color: var(--text-subtle);
  font-size: 0.85rem;
  text-align: center;
  padding: 0.75rem 0;
}
.msg { max-width: 82%; display: flex; flex-direction: column; gap: 0.15rem; }
.msg-left  { align-self: flex-start; align-items: flex-start; }
.msg-right { align-self: flex-end;   align-items: flex-end; }
.msg-meta {
  font-size: 0.68rem;
  color: var(--text-subtle);
  padding: 0 0.35rem;
}
.msg-body {
  font-size: 0.86rem;
  line-height: 1.45;
  padding: 0.45rem 0.7rem;
  border-radius: 0.7rem;
  white-space: pre-wrap;
  word-break: break-word;
}
.msg-left  .msg-body {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 0.2rem;
}
.msg-right .msg-body {
  background: var(--uwc-teal);
  color: #ffffff;
  border-bottom-right-radius: 0.2rem;
}

/* ── Report password modal ──────────────────────────────────────────────────── */
.report-pw-overlay {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(11, 18, 32, 0.55);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.report-pw-box {
  background: var(--surface, #fff); border: 1px solid var(--border, #dbe6f0);
  border-radius: 0.8rem; padding: 1.3rem 1.4rem; max-width: 420px; width: 100%;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
}
.report-pw-title { font-weight: 700; font-size: 1.02rem; color: var(--accent, #1668a0); margin-bottom: 0.5rem; }
.report-pw-desc { font-size: 0.83rem; color: var(--text-muted, #566a83); margin: 0 0 0.85rem; line-height: 1.5; }
.report-pw-code {
  background: var(--surface-2, #f1f6fc); border: 1px dashed var(--border-strong, #c4d4e4);
  border-radius: 0.5rem; padding: 0.7rem 0.9rem; text-align: center; margin-bottom: 0.9rem;
}
.report-pw-code code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 1.15rem; font-weight: 700; letter-spacing: 0.06em;
  color: var(--text, #16273c); user-select: all; word-break: break-all;
}
.report-pw-actions { display: flex; gap: 0.5rem; justify-content: flex-end; }
