@import url('_v2additions.css');

/* ─────────────────────────────────────────────────────────────────────────
   Akatsuki App Suite – UI v2 (trial)
   Layout: sidebar + topbar + content area
   ───────────────────────────────────────────────────────────────────────── */

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  --primary:    #1890ff;
  --primary-dk: #0f6fcc;
  --purple:     #722ed1;
  --pink:       #eb2f96;
  --teal:       #13c2c2;
  --gold:       #faad14;
  --green:      #52c41a;
  --red:        #f5222d;
  --orange:     #fa8c16;

  --bg:         #0f1318;
  --sidebar-bg: #0c1016;
  --surface:    #161c23;
  --surface-2:  #1d2430;
  --text:       #dde3ec;
  --text-muted: #6b7a8d;
  --border:     #242d38;

  --sidebar-w:  220px;
  --topbar-h:   48px;
  --radius:     8px;
  --transition: 0.18s ease;

  /* UI spacing / control scale (shared across cards, tables, buttons) */
  --ui-btn-pad-y:       0.45rem;
  --ui-btn-pad-x:       0.95rem;
  --ui-btn-font:        0.875rem;
  --ui-btn-sm-pad-y:    0.3rem;
  --ui-btn-sm-pad-x:    0.6rem;
  --ui-btn-sm-font:     0.8rem;
  --ui-card-pad:        1rem;
  --ui-card-head-pad-y: 0.65rem;
  --ui-card-head-pad-x: 1rem;
  --ui-table-pad-y:     0.55rem;
  --ui-table-pad-x:     0.75rem;
  --ui-section-gap:     1rem;
  --ui-page-gap:        1.25rem;
}

/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", "Inter", "Roboto", sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  display: flex;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
/* Dark scrollbars app-wide (default white ones look broken on the dark theme). */
* { scrollbar-width: thin; scrollbar-color: #3a3a4a transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #3a3a4a; border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #50506a; background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }
/* Card / button / nav links are interactive COMPONENTS, not text links - they must never get the
   hover underline (it bleeds onto their inner text). Applies app-wide across every portal. */
.btn:hover, a.btn:hover, .fin-card:hover, .wg-card:hover, .ui-hero:hover, a.ui-card:hover,
.sidebar-link:hover, .sidebar-logo:hover, .stat-card:hover, .kpi-card:hover, .qa-btn:hover,
a[class*="-card"]:hover, a[class*="-link"]:hover, a[class*="-btn"]:hover,
.fin-card:hover *, .wg-card:hover *, .ui-hero:hover * { text-decoration: none !important; }
h1,h2,h3,h4 { margin: 0 0 0.5rem; font-weight: 600; }

/* Fallback dark styling for bare text inputs / selects / textareas that don't carry .form-control
   (e.g. quick admin forms). .form-control + page-specific rules are more specific and still win,
   so this only catches the otherwise-white browser defaults on the dark theme. */
.list-page input[type="text"], .list-page input[type="email"], .list-page input[type="url"],
.list-page input[type="password"], .list-page select, .list-page textarea,
.section-card input[type="text"], .section-card input[type="email"], .section-card input[type="url"],
.section-card input[type="password"], .section-card select, .section-card textarea {
  background: var(--surface, #1a1a2e); color: var(--text, #e0e0f0);
  border: 1px solid var(--border, #2a2a3a); border-radius: 6px;
  padding: 0.4rem 0.6rem; font-size: 0.88rem; color-scheme: dark; max-width: 100%;
}
.list-page input:focus, .list-page select:focus, .list-page textarea:focus,
.section-card input:focus, .section-card select:focus, .section-card textarea:focus {
  outline: none; border-color: var(--primary, #7c6fff);
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width var(--transition);
  z-index: 100;
}
/* Dark thin scrollbar — no white */
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: #2a2a3a; border-radius: 2px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: #3a3a52; }
.sidebar { scrollbar-width: thin; scrollbar-color: #2a2a3a transparent; }

/* Collapsed state */
body.sidebar-collapsed .sidebar { width: 48px; }
body.sidebar-collapsed .slt,
body.sidebar-collapsed .sidebar-group-label,
body.sidebar-collapsed .sidebar-logo-text,
body.sidebar-collapsed .sidebar-user-name { display: none; }
body.sidebar-collapsed .sidebar-logout { justify-content: center; padding: 0.4rem 0; width: 100%; }
body.sidebar-collapsed .sidebar-logout-label { display: none; }
body.sidebar-collapsed .sidebar-link { justify-content: center; padding: 0.6rem 0; }
body.sidebar-collapsed .sidebar-logo { justify-content: center; }
body.sidebar-collapsed .sidebar-user { justify-content: center; padding: 0.5rem 0; }
body.sidebar-collapsed .sidebar-user-btn { flex-direction: column; gap: 0; }
body.sidebar-collapsed .sidebar-collapse-btn { align-self: center; margin: 0; }

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.5rem 0 0.75rem;
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  flex: 1;
  overflow: hidden;
}
.sidebar-logo-icon { font-size: 1.15rem; color: var(--primary); flex-shrink: 0; }
.sidebar-logo-text { font-weight: 700; font-size: 1rem; white-space: nowrap; color: var(--primary); }

.sidebar-collapse-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  flex-shrink: 0;
  line-height: 1;
}
.sidebar-collapse-btn:hover { color: var(--text); background: rgba(255,255,255,0.06); }

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0;
  gap: 1px;
  overflow-y: auto;
  overflow-x: hidden;
  /* min-height:0 lets this flex child actually SCROLL its overflow instead of
     growing the column past 100vh (the default min-height:auto). Without it,
     a long expanded section made flexbox compress every link - the top items
     got squished instead of the list scrolling. */
  min-height: 0;
}
/* Each nav row keeps its natural height; flexbox must not shrink them to fit a
   long list (that was squashing the top Dashboard/My Day/Inbox/Approvals rows). */
.sidebar-nav > a,
.sidebar-nav > .sidebar-link,
.sidebar-nav > .sidebar-group-label,
.sidebar-nav > .sidebar-section-label,
.sidebar-nav > .sidebar-sub-label,
.sidebar-nav > div { flex-shrink: 0; }

.sidebar-group-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0.9rem 0.9rem 0.2rem;
  white-space: nowrap;
  opacity: 0.7;
}
.sidebar-sub-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 0.55rem 1.1rem 0.15rem;
  white-space: nowrap;
  opacity: 0.45;
}
body.sidebar-collapsed .sidebar-sub-label { display: none; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 6px;
  margin: 0 0.35rem;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
  overflow: hidden;
  font-size: 0.9rem;
}
.sidebar-link:hover { background: rgba(255,255,255,0.05); color: var(--text); text-decoration: none; }
.sidebar-link.active {
  background: rgba(24,144,255,0.12);
  color: var(--primary);
  font-weight: 600;
  border-left: 3px solid var(--primary);
  padding-left: calc(0.85rem - 3px);
}
.sli { font-size: 1rem; flex-shrink: 0; width: 1.1rem; text-align: center; }
.slt { overflow: hidden; text-overflow: ellipsis; }

.sidebar-badge {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.05rem 0.35rem;
  vertical-align: middle;
  line-height: 1.4;
}

/* ── Sidebar accordion groups ─────────────────────────────────────────── */
.sidebar-accordion { border: none; }
.sidebar-accordion > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.85rem;
  color: var(--text-muted);
  border-radius: 6px;
  margin: 0 0.35rem;
  cursor: pointer;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  user-select: none;
  transition: background var(--transition), color var(--transition);
  position: relative;
}
.sidebar-accordion > summary::-webkit-details-marker { display: none; }
.sidebar-accordion > summary::after {
  content: '›';
  position: absolute;
  right: 0.7rem;
  font-size: 0.85rem;
  transition: transform 0.2s;
  opacity: 0.5;
}
.sidebar-accordion[open] > summary::after { transform: rotate(90deg); }
.sidebar-accordion > summary:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.sidebar-accordion[open] > summary { color: var(--text); }
.sidebar-accordion-head { /* alias */ }
.sidebar-accordion-body { padding: 0 0 0.25rem 0; }
/* Indented child links */
.sidebar-link.sla { padding-left: 1.6rem; font-size: 0.85rem; }
.sidebar-link.sla.active { padding-left: calc(1.6rem - 3px); }
/* Sub-labels inside accordion */
.sidebar-sub-label.sla-sub { padding-left: 1.6rem; }
/* Collapsed sidebar hides accordion text but keeps icons */
body.sidebar-collapsed .sidebar-accordion > summary .slt { display: none; }
body.sidebar-collapsed .sidebar-accordion > summary::after { display: none; }
body.sidebar-collapsed .sidebar-accordion-body { display: none; }

/* Sidebar user area */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 0.5rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-user-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  text-decoration: none;
  flex: 1;
  overflow: hidden;
  border-radius: 6px;
  padding: 0.3rem 0.4rem;
  transition: background var(--transition);
}
.sidebar-user-btn:hover { background: rgba(255,255,255,0.05); text-decoration: none; }
.sidebar-user-btn.active { color: var(--primary); }
.sidebar-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sidebar-user-name { font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  text-decoration: none;
  transition: color var(--transition), background var(--transition);
}
.sidebar-logout-icon { flex-shrink: 0; display: flex; }
.sidebar-logout:hover { color: var(--red); background: rgba(245,34,45,0.08); text-decoration: none; }

/* ── App body ────────────────────────────────────────────────────────────── */
.app-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.app-body.full-width { width: 100%; }

/* ── Topbar ──────────────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  gap: 1rem;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 90;
}
.topbar-menu-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.15rem;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
  display: none; /* shown on mobile via media query */
}
.topbar-menu-btn:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.topbar-title { font-size: 0.95rem; color: var(--text-muted); flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 0.75rem; margin-left: auto; }
.topbar-user { color: var(--text-muted); font-size: 0.85rem; }
.topbar-user:hover { color: var(--text); text-decoration: none; }
.topbar-logout { color: var(--text-muted); font-size: 0.85rem; }
.topbar-logout:hover { color: var(--red); text-decoration: none; }
.topbar-logout-btn {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.8rem; color: var(--text-muted);
  padding: 0.25rem 0.5rem; border-radius: 6px;
  text-decoration: none;
  transition: color var(--transition), background var(--transition);
}
.topbar-logout-btn:hover { color: var(--red); background: rgba(245,34,45,0.08); text-decoration: none; }

/* ── Main content ────────────────────────────────────────────────────────── */
.app-main {
  padding: 1.5rem;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

/* ── Flash messages ──────────────────────────────────────────────────────── */
.flash-messages { list-style: none; margin: 0.75rem 1.5rem 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.flash { padding: 0.5rem 0.85rem; border-radius: var(--radius); font-size: 0.9rem; }
.flash.error   { background: rgba(245,34,45,0.12);  color: #ff7875; border: 1px solid rgba(245,34,45,0.3); }
.flash.info    { background: rgba(24,144,255,0.1);  color: #69c0ff; border: 1px solid rgba(24,144,255,0.25); }
.flash.success { background: rgba(82,196,26,0.1);   color: #95de64; border: 1px solid rgba(82,196,26,0.25); }
.alert { padding: 0.6rem 0.9rem; border-radius: var(--radius); margin-bottom: 0.75rem; font-size: 0.9rem; }
.alert-info    { background: rgba(24,144,255,0.1);  color: #69c0ff; border: 1px solid rgba(24,144,255,0.25); }
.alert-success { background: rgba(82,196,26,0.1);   color: #95de64; border: 1px solid rgba(82,196,26,0.25); }
.alert-warning { background: rgba(250,173,20,0.1);  color: #ffc53d; border: 1px solid rgba(250,173,20,0.25); }
.alert-danger  { background: rgba(245,34,45,0.1);   color: #ff7875; border: 1px solid rgba(245,34,45,0.25); }

/* ── Page header ─────────────────────────────────────────────────────────── */
.page-header { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: var(--ui-page-gap); }
.page-header h1 { margin: 0; font-size: 1.35rem; color: var(--text); }
.page-desc, .page-header p { margin: 0; color: var(--text-muted); font-size: 0.9rem; }

/* ── Dashboard ───────────────────────────────────────────────────────────── */
.dash-page { display: flex; flex-direction: column; gap: 1rem; }

/* KPI strip */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--ui-card-pad) calc(var(--ui-card-pad) + 0.1rem);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition), background var(--transition);
}
.kpi-card:hover { border-color: var(--primary); background: rgba(24,144,255,0.06); text-decoration: none; }
.kpi-icon { font-size: 1.15rem; margin-bottom: 0.2rem; }
.kpi-icon--gold   { color: var(--gold); }
.kpi-icon--pink   { color: var(--pink); }
.kpi-icon--purple { color: var(--purple); }
.kpi-icon--teal   { color: var(--teal); }
.kpi-value { font-size: 1.9rem; font-weight: 700; color: var(--text); line-height: 1; }
.kpi-label { font-size: 0.8rem; color: var(--text-muted); }

/* Dash grid */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  align-items: flex-start;
}
.dash-col { display: flex; flex-direction: column; gap: 0.75rem; }

.dash-section-head {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
  padding: 0 0.1rem;
}
.dash-subhead {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0.6rem 0 0.3rem;
}

.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--ui-card-pad);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.dash-card--tasks { gap: 0; }
.dash-card-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}
.dash-empty { color: var(--text-muted); font-size: 0.9rem; margin: 0; }
.dash-link { font-size: 0.85rem; color: var(--primary); }
.dash-link:hover { text-decoration: underline; }

/* Attendance stats */
.attendance-stat-row { display: flex; gap: 1rem; }
.attendance-stat { display: flex; flex-direction: column; gap: 0.1rem; }
.attendance-stat-label { font-size: 0.75rem; color: var(--text-muted); }
.attendance-stat-val { font-size: 1.1rem; font-weight: 600; }

/* Leave balance */
.leave-balance-big { display: flex; align-items: baseline; gap: 0.3rem; }
.leave-balance-num { font-size: 2rem; font-weight: 700; color: var(--green); line-height: 1; }
.leave-balance-unit { color: var(--text-muted); font-size: 0.9rem; }
.leave-balance-sub { font-size: 0.8rem; }

/* Week stats */
.week-stat-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.week-stat-num { font-size: 1.2rem; font-weight: 700; display: block; }
.week-stat-lbl { font-size: 0.75rem; }
.inline-alert { font-size: 0.82rem; padding: 0.3rem 0.5rem; border-radius: 4px; background: rgba(250,173,20,0.1); border: 1px solid rgba(250,173,20,0.2); }

/* Task quick list */
.task-quick-list { list-style: none; padding: 0; margin: 0; }
.task-quick-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
}
.task-quick-item:last-child { border-bottom: none; }
.task-quick-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 0.35rem;
  background: var(--text-muted);
}
.task-dot--wip        { background: var(--primary); }
.task-dot--in-review  { background: var(--gold); }
.task-dot--done,
.task-dot--final,
.task-dot--published  { background: var(--green); }
.task-dot--on-hold    { background: var(--red); }
.task-dot--not-started { background: var(--text-muted); }
.task-quick-body { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.task-quick-name { font-size: 0.9rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-quick-meta { font-size: 0.78rem; }

/* Quick actions grid */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.qa-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  text-align: center;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.qa-btn:hover { border-color: var(--primary); color: var(--primary); background: rgba(24,144,255,0.06); text-decoration: none; }
.qa-icon { font-size: 1.1rem; }

/* Who's in */
.whosin-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.whosin-item { display: flex; align-items: center; gap: 0.6rem; }
.whosin-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--primary));
  color: #fff; font-size: 0.75rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.whosin-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.whosin-name { font-size: 0.9rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.whosin-since { font-size: 0.78rem; }
.whosin-dot { font-size: 0.6rem; }

/* Team stats */
.team-stats-row { display: flex; gap: 1.25rem; margin-bottom: 0.5rem; }
.team-stat { display: flex; flex-direction: column; }
.team-stat-num { font-size: 1.25rem; font-weight: 700; }

.simple-rank-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.simple-rank-list li { display: flex; align-items: center; gap: 0.5rem; font-size: 0.88rem; }
.rank-num { width: 18px; height: 18px; background: rgba(255,255,255,0.08); border-radius: 50%; font-size: 0.7rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rank-val { margin-left: auto; }

.attention-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.attention-item { font-size: 0.82rem; padding: 0.2rem 0; }

/* ── Colour utilities ────────────────────────────────────────────────────── */
.clr-primary { color: var(--primary); }
.clr-green   { color: var(--green); }
.clr-gold    { color: var(--gold); }
.clr-red     { color: var(--red); }
.clr-muted   { color: var(--text-muted); }
.muted       { color: var(--text-muted); font-size: 0.85rem; }

/* ── Week strip ──────────────────────────────────────────────────────────── */
.myweek-strip { display: flex; gap: 0.4rem; }
.myweek-day { flex: 1; text-align: center; font-size: 0.72rem; display: flex; flex-direction: column; align-items: center; gap: 0.2rem; }
.myweek-label { color: var(--text-muted); }
.myweek-bar { width: 100%; height: 6px; border-radius: 999px; background: rgba(255,255,255,0.06); }
.myweek-day.myweek-present .myweek-bar { background: rgba(82,196,26,0.65); }
.myweek-day.myweek-today   .myweek-bar { background: rgba(24,144,255,0.9); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: var(--ui-btn-pad-y) var(--ui-btn-pad-x);
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--ui-btn-font);
  line-height: 1.35;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition);
}
.btn:hover { background: #222b36; text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dk); border-color: var(--primary-dk); filter: none; }
.btn-sm { padding: var(--ui-btn-sm-pad-y) var(--ui-btn-sm-pad-x); font-size: var(--ui-btn-sm-font); line-height: 1.35; }
.btn-checkin  { background: var(--green);  border-color: var(--green);  color: #fff; }
.btn-checkout { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn-checkin:hover  { filter: brightness(1.1); background: var(--green); }
.btn-checkout:hover { filter: brightness(1.1); background: var(--orange); }

/* ── Filter bar ──────────────────────────────────────────────────────────── */
.filter-bar { margin-bottom: var(--ui-section-gap); }
.filter-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.filter-form select,
.filter-form input[type="search"],
.filter-form input[type="text"] {
  padding: 0.4rem 0.7rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.875rem;
}
.filter-form select:focus,
.filter-form input[type="search"]:focus,
.filter-form input[type="text"]:focus { outline: none; border-color: var(--primary); }
.filter-form input[type="search"] { min-width: 180px; }
.filter-form input[type="text"] { min-width: 80px; }
.filter-form label { color: var(--text-muted); font-size: 0.85rem; }

.view-toggle { display: inline-flex; align-items: center; gap: 0.25rem; margin-right: 0.5rem; }
.view-toggle label { margin: 0; font-size: 0.9rem; color: var(--text-muted); }

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.data-table { width: 100%; border-collapse: collapse; background: var(--surface); }
.data-table th, .data-table td { padding: var(--ui-table-pad-y) var(--ui-table-pad-x); text-align: left; border-bottom: 1px solid var(--border); font-size: var(--ui-btn-font); }
.data-table th {
  background: var(--surface-2);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--primary);
}
.data-table.table-header-pink th { border-bottom-color: var(--pink); }
.data-table tbody tr:hover { background: rgba(255,255,255,0.025); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* Table grouped rows */
.task-group-seq td { background: rgba(255,255,255,0.04); font-weight: 600; }
.task-group-shot td { background: rgba(255,255,255,0.02); }
.task-group-shot .indent-1 { padding-left: 1.5rem; }
.indent-2 { padding-left: 2.5rem; }

/* Task list utility */
.task-name-link a, a.task-name-link { color: var(--primary); text-decoration: none; font-weight: 500; }
.task-name-link a:hover, a.task-name-link:hover { text-decoration: underline; }
.task-notes-preview { font-size: 0.78rem; margin-top: 0.15rem; line-height: 1.4; }
.task-shot-tag { display: inline-block; font-size: 0.72rem; padding: 0.1rem 0.4rem; background: rgba(255,255,255,0.07); border-radius: 4px; margin-left: 0.25rem; color: var(--text-muted); }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge { display: inline-block; padding: 0.15rem 0.45rem; border-radius: 4px; font-size: 0.75rem; }
.badge-ot        { background: #e67e22; color: #fff; }
.badge-draft     { background: rgba(255,255,255,0.1);  color: var(--text-muted); }
.badge-submitted { background: rgba(24,144,255,0.25);  color: #69c0ff; }
.badge-approved  { background: rgba(82,196,26,0.25);   color: #95de64; }
.badge-rejected  { background: rgba(245,34,45,0.25);   color: #ff7875; }

.task-status-badge {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  background: rgba(255,255,255,0.07);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.task-status-badge--wip                { background: rgba(24,144,255,0.2);  color: #69c0ff;  border-color: rgba(24,144,255,0.35); }
.task-status-badge--in-review         { background: rgba(250,173,20,0.15); color: #ffc53d;  border-color: rgba(250,173,20,0.3); }
.task-status-badge--approved          { background: rgba(82,196,26,0.18);  color: #b7eb8f;  border-color: rgba(82,196,26,0.4); }
.task-status-badge--done,
.task-status-badge--final,
.task-status-badge--published         { background: rgba(82,196,26,0.2);   color: #95de64;  border-color: rgba(82,196,26,0.35); }
.task-status-badge--not-started,
.task-status-badge--ready             { background: rgba(255,255,255,0.05); color: var(--text-muted); }
.task-status-badge--on-hold           { background: rgba(245,34,45,0.12);  color: #ff7875; border-color: rgba(245,34,45,0.3); }
.task-status-badge--dep-done          { background: rgba(114,46,209,0.2);  color: #d3adf7; border-color: rgba(114,46,209,0.35); }
.task-status-badge--sent-for-dailies  { background: rgba(114,46,209,0.15); color: #d3adf7; border-color: rgba(114,46,209,0.3); }
.task-status-badge--changes-requested { background: rgba(250,140,22,0.15); color: #ffa940; border-color: rgba(250,140,22,0.3); }

.task-priority-badge { display: inline-block; font-size: 0.72rem; padding: 0.12rem 0.4rem; border-radius: 4px; }
.task-priority--high   { background: rgba(245,34,45,0.15);  color: #ff7875; }
.task-priority--low    { background: rgba(255,255,255,0.05); color: var(--text-muted); }
.task-priority--normal { background: rgba(250,173,20,0.12); color: #ffc53d; }

/* ── Status colours ──────────────────────────────────────────────────────── */
.status-pending  { color: var(--gold); }
.status-approved { color: var(--green); }
.status-rejected { color: var(--red); }
.day-status-off  { color: var(--red); font-weight: 600; }

/* Due row accents */
.data-table tbody tr.task-row-due-overdue td:first-child { border-left: 3px solid rgba(245,34,45,0.5); }
.data-table tbody tr.task-row-due-today   td:first-child { border-left: 3px solid rgba(24,144,255,0.5); }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.card.section { margin-top: 1.25rem; }
.card.section h2 { font-size: 0.95rem; margin: 0 0 0.75rem; color: var(--text); }
.card.section h3 { font-size: 0.9rem; margin: 0 0 0.5rem; }
.simple-list { list-style: none; padding-left: 0; margin: 0 0 0.75rem; }
.simple-list li { margin-bottom: 0.35rem; font-size: 0.9rem; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-card {
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem auto 0;
}
.form-card label { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.5rem; }
.form-card label:first-of-type { margin-top: 0; }
.form-card input,
.form-card select,
.form-card textarea {
  padding: 0.45rem 0.7rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  width: 100%;
  font-size: 0.875rem;
}
.form-card input:focus,
.form-card select:focus,
.form-card textarea:focus { outline: none; border-color: var(--primary); }
.form-actions { margin-top: 1rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.form-card .checkbox-label { display: flex; align-items: center; gap: 0.5rem; margin: 0.75rem 0; }
.form-card .checkbox-label input { width: auto; }

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 0.25rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tabs .tab {
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid var(--border);
  font-size: 0.875rem;
}
.tabs .tab:hover { color: var(--text); text-decoration: none; }
.tabs .tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Progress bar ────────────────────────────────────────────────────────── */
.progress-bar { width: 100%; max-width: 380px; height: 6px; border-radius: 999px; background: rgba(255,255,255,0.06); overflow: hidden; border: 1px solid var(--border); margin-top: 0.25rem; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--green), var(--gold)); transition: width 0.25s ease-out; }

/* ── Login ───────────────────────────────────────────────────────────────── */
.no-sidebar { display: block; }
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.login-box { width: 100%; max-width: 360px; padding: 2rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.login-box h1 { margin: 0 0 0.2rem; font-size: 1.4rem; color: var(--primary); }
.login-subtitle { margin: 0 0 1.5rem; color: var(--text-muted); font-size: 0.9rem; }
.login-form label { display: block; margin-top: 0.9rem; margin-bottom: 0.25rem; color: var(--text-muted); font-size: 0.82rem; }
.login-form input[type="email"],
.login-form input[type="password"],
.password-field input {
  width: 100%; padding: 0.5rem 0.75rem;
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); font-size: 1rem;
}
.login-form .checkbox-label { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.75rem; font-size: 0.85rem; color: var(--text-muted); }
.login-form .btn { margin-top: 1.25rem; width: 100%; padding: 0.6rem; font-size: 1rem; cursor: pointer; border-radius: 6px; border: none; }
.login-hint { margin-top: 1rem; font-size: 0.75rem; color: var(--text-muted); }

/* Password toggle */
.password-field { position: relative; }
.password-field input { padding-right: 2.25rem; }
.password-toggle-btn { position: absolute; top: 50%; right: 0.6rem; transform: translateY(-50%); border: none; background: transparent; color: var(--text-muted); cursor: pointer; padding: 0; display: inline-flex; align-items: center; font-size: 1rem; }
.password-toggle-btn:focus-visible { outline: 2px solid var(--primary); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.copyable-url { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.5rem; }
.copyable-url input.full-width { flex: 1; min-width: 0; }

/* ── Modals ──────────────────────────────────────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.65); display: flex; align-items: center; justify-content: center; z-index: 999; }
.modal-dialog { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); padding: 1.25rem; width: 100%; max-width: 440px; }
.modal-dialog h2 { margin-top: 0; margin-bottom: 0.75rem; font-size: 1.1rem; }

/* ── Task quick modal ────────────────────────────────────────────────────── */
.task-quick-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 1200; align-items: center; justify-content: center; padding: 1rem; }
.task-quick-modal.is-open { display: flex; }
.task-quick-modal-inner { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; max-width: 420px; width: 100%; }
.task-quick-modal-inner h3 { margin: 0 0 0.75rem; font-size: 1.05rem; }
.task-quick-modal-inner label { display: block; margin-top: 0.5rem; font-size: 0.82rem; color: var(--text-muted); }
.task-quick-modal-inner select,
.task-quick-modal-inner textarea { width: 100%; margin-top: 0.25rem; padding: 0.4rem 0.6rem; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; color: var(--text); }
.task-quick-modal-actions { margin-top: 1rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ── Attendance ──────────────────────────────────────────────────────────── */
.attendance-actions { margin-bottom: 1.25rem; display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.today-done { color: var(--text-muted); margin: 0.5rem 0 0; font-size: 0.9rem; }
.attendance-layout { display: grid; grid-template-columns: minmax(0,2fr) minmax(0,1.4fr); gap: 1.5rem; align-items: flex-start; }

/* Check-in strip */
.checkin-strip { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.85rem 1.25rem; margin-bottom: 1rem; }
.btn-checkin-lg { font-size: 1rem; padding: 0.55rem 1.5rem; font-weight: 700; border-radius: var(--radius); }
.checkin-hint   { color: var(--text-muted); font-size: 0.875rem; }
.checkin-done   { display: flex; align-items: center; gap: 0.5rem; font-size: 0.95rem; }
.checkin-done-icon { font-size: 1.25rem; }

/* Day status tags */
.day-tag { display: inline-block; padding: 0.1rem 0.45rem; border-radius: 4px; font-size: 0.72rem; font-weight: 600; }
.day-tag--work    { background: rgba(255,255,255,0.06); color: var(--text-muted); }
.day-tag--leave   { background: rgba(250,173,20,0.15); color: #ffc53d; }
.day-tag--holiday { background: rgba(245,34,45,0.12); color: #ff7875; }
.day-tag--off     { background: rgba(255,255,255,0.04); color: var(--text-muted); }
.attendance-main .card.section + .card.section { margin-top: 1rem; }
.attendance-side .card.section { margin-top: 0; margin-bottom: 1rem; }
.week-nav { display: flex; gap: 0.5rem; margin-top: 0.5rem; }

/* ── Heatmap ─────────────────────────────────────────────────────────────── */
.heatmap-month { display: inline-block; border: 1px solid var(--border); border-radius: 6px; padding: 0.5rem 0.75rem; background: var(--surface); }
.heatmap-week { display: grid; grid-template-columns: repeat(7, 1.75rem); gap: 0.25rem; margin-bottom: 0.25rem; }
.heatmap-header { margin-bottom: 0.35rem; }
.heatmap-day-label { text-align: center; font-size: 0.7rem; color: var(--text-muted); }
.heatmap-day { width: 1.75rem; height: 1.75rem; border-radius: 4px; font-size: 0.75rem; display: flex; align-items: center; justify-content: center; cursor: default; }
.heatmap-day.empty   { background: transparent; }
.heatmap-day.none    { background: rgba(255,255,255,0.03); }
.heatmap-day.zero    { background: rgba(245,34,45,0.22); }
.heatmap-day.low     { background: rgba(250,173,20,0.3); }
.heatmap-day.normal  { background: rgba(82,196,26,0.35); }
.heatmap-day.high    { background: rgba(24,144,255,0.45); }
.heatmap-day.today   { background: rgba(24,144,255,0.9); }
.heatmap-day.holiday { background: rgba(245,34,45,0.55); }

/* ── Timesheet ───────────────────────────────────────────────────────────── */
.timesheet-grid thead tr:first-child th { background: var(--surface); color: var(--text); border-bottom: 1px solid var(--border); }
.timesheet-grid thead tr.subhead th { background: rgba(255,255,255,0.03); color: var(--text-muted); font-weight: normal; font-size: 0.78rem; padding: 0.3rem 0.75rem; text-transform: none; letter-spacing: 0; }
.timesheet-grid .day-cell { min-width: 4.5rem; }
.timesheet-grid .day-cell .day-hrs-wrap { display: flex; flex-direction: column; gap: 0.25rem; align-items: flex-start; }
.timesheet-grid .day-hrs-label { font-size: 0.7rem; color: var(--text-muted); }
.timesheet-grid input[type="number"] { width: 3.2rem; padding: 0.3rem 0.4rem; background: var(--surface, #1a1a2e); color: var(--text, #e0e0f0); border: 1px solid var(--border, #2a2a3a); border-radius: 4px; }
.timesheet-grid .day-ot-label { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.78rem; color: var(--text-muted); margin: 0; }
.timesheet-grid .row-total { font-weight: 600; min-width: 2.5rem; }
.timesheet-actions-wrap { display: flex; flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem; margin-top: 1rem; }
.timesheet-actions-wrap > .timesheet-form { flex: 1; min-width: 0; }
.timesheet-actions-wrap .form-actions,
.timesheet-form .form-actions { margin-top: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.timesheet-form .form-actions { margin-top: 1rem; }
.approval-form-inline { display: inline-flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.reject-week-wrap { display: inline-flex; align-items: center; gap: 0.35rem; margin-left: 0.25rem; }

/* ── Task board ──────────────────────────────────────────────────────────── */
.task-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; align-items: flex-start; }
.task-board-column { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem; min-height: 120px; }
.task-board-column h3 { margin: 0 0 0.5rem; font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.task-board-card { background: rgba(0,0,0,0.18); border: 1px solid var(--border); border-radius: 6px; padding: 0.5rem 0.65rem; margin-bottom: 0.5rem; font-size: 0.875rem; }
.task-board-card a { color: var(--primary); text-decoration: none; }
.task-board-card a:hover { text-decoration: underline; }
.task-board-card.task-row-due-overdue { border-left: 3px solid rgba(245,34,45,0.5); }
.task-board-card.task-row-due-today   { border-left: 3px solid rgba(24,144,255,0.5); }

/* Task mobile cards */
.task-cards-mobile { display: none; flex-direction: column; gap: 0.75rem; }
.task-card-mobile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.85rem 1rem; }
.task-card-mobile.task-row-due-overdue { border-left: 3px solid rgba(245,34,45,0.5); }
.task-card-mobile.task-row-due-today   { border-left: 3px solid rgba(24,144,255,0.5); }
.task-card-mobile h3 { margin: 0 0 0.35rem; font-size: 1rem; }
.task-card-mobile .task-card-meta { display: flex; flex-wrap: wrap; gap: 0.35rem 0.75rem; font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.task-card-mobile .task-card-actions { margin-top: 0.5rem; display: flex; flex-wrap: wrap; gap: 0.35rem; }

/* ── Task flow hint ──────────────────────────────────────────────────────── */
.task-flow-hint { font-size: 0.82rem; margin: 0 0 1rem; padding: 0.45rem 0.75rem; background: rgba(24,144,255,0.07); border: 1px solid rgba(24,144,255,0.2); border-radius: 6px; max-width: 56rem; }

/* ── Production hub ──────────────────────────────────────────────────────── */
.production-hub { display: flex; flex-direction: column; gap: 1.25rem; }
.hub-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.hub-section h2 { margin: 0 0 0.75rem; font-size: 1.05rem; color: var(--text); display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.hub-section h2 .count { font-weight: 400; color: var(--text-muted); }
.hub-section .btn { margin-right: 0.5rem; margin-bottom: 0.5rem; }
.hub-section .table-wrap { margin-top: 0.5rem; }

/* ── Pipeline context ────────────────────────────────────────────────────── */
.pipeline-context-panel { background: rgba(19,194,194,0.07); border: 1px solid rgba(19,194,194,0.3); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.pipeline-context-panel pre { margin: 0.5rem 0 0; padding: 0.75rem; background: var(--bg); border-radius: 6px; font-size: 0.8rem; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.integration-docs pre { background: var(--bg); padding: 1rem; border-radius: var(--radius); overflow-x: auto; font-size: 0.8rem; }

/* ── Dashboard columns (legacy pages still using old pattern) ────────────── */
.dashboard-columns { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr); gap: 1.5rem; align-items: flex-start; margin-top: 1rem; }
.dashboard-column h2 { margin: 0 0 0.75rem; font-size: 1.05rem; color: var(--text-muted); }
.dashboard-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.summary-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem; text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 0.25rem; }
.summary-card:hover { border-color: var(--primary); background: rgba(24,144,255,0.07); }
.card-value { font-size: 1.75rem; font-weight: 700; color: var(--text); }
.card-label { font-size: 0.82rem; color: var(--text-muted); }
.card-users .card-value    { color: var(--gold); }
.card-clients .card-value  { color: var(--pink); }
.card-projects .card-value { color: var(--purple); }
.card-tasks .card-value    { color: var(--teal); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: 1fr 1fr; }
  .dash-col:last-child { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 200px; }
  .task-responsive-table-wrap { display: none; }
  .task-cards-mobile { display: flex; }
  .dash-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  body { display: block; }
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    transition: transform var(--transition), width var(--transition);
    z-index: 200;
    width: 260px;
  }
  body.sidebar-open .sidebar { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,0.6); }
  body.sidebar-open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 199;
    pointer-events: auto;
  }
  .app-body { min-height: 100vh; }
  /* Topbar: keep it a single tight row — hide items redundant with sidebar */
  .topbar { height: var(--topbar-h); overflow: hidden; flex-wrap: nowrap; padding: 0 0.75rem; gap: 0.6rem; }
  .topbar-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-user { display: none; }
  .topbar-logout-btn { display: none; }
  .topbar-menu-btn { display: flex; flex-shrink: 0; }
  .app-main { padding: 1rem; }
  .quick-actions-grid { grid-template-columns: repeat(2, 1fr); }
  .attendance-layout { grid-template-columns: 1fr; }
  .dashboard-columns { grid-template-columns: 1fr; }
}

/* ── Approvals ────────────────────────────────────────────────────────────── */
.btn-approve   { background: rgba(82,196,26,0.18); color: #95de64; border: 1px solid rgba(82,196,26,0.35); }
.btn-approve:hover { background: rgba(82,196,26,0.28); }
.btn-danger    { background: rgba(245,34,45,0.15); color: #ff7875; border: 1px solid rgba(245,34,45,0.3); }
.btn-danger:hover { background: rgba(245,34,45,0.25); }

/* ── Dailies ──────────────────────────────────────────────────────────────── */
.dailies-action-form { display: flex; flex-direction: column; gap: 0.4rem; }
.dailies-note-input  { width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 0.28rem 0.5rem; color: var(--text); font-size: 0.78rem; }
.dailies-note-input:focus { outline: none; border-color: var(--primary); }
.dailies-btns { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.dailies-avatar { display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--primary); color: #fff; font-size: 0.65rem; font-weight: 700; margin-right: 0.1rem; }
.inline-input  { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 0.3rem 0.5rem; color: var(--text); font-size: 0.82rem; }
.ts-detail-row td { background: rgba(0,0,0,0.12); font-size: 0.82rem; }

/* ── Profile ──────────────────────────────────────────────────────────────── */
.profile-layout { display: grid; grid-template-columns: 260px 1fr; gap: 1.5rem; align-items: flex-start; }
.profile-info-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; display: flex; flex-direction: column; gap: 0.75rem; }
.profile-avatar-lg { width: 3rem; height: 3rem; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; font-weight: 700; }
.profile-name { font-size: 1.05rem; font-weight: 600; }
.profile-details { display: flex; flex-direction: column; gap: 0.35rem; }
.profile-detail-row { display: flex; justify-content: space-between; font-size: 0.82rem; gap: 0.5rem; }
@media (max-width: 680px) { .profile-layout { grid-template-columns: 1fr; } }

/* ── Reports ──────────────────────────────────────────────────────────────── */
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.report-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; }
.report-card-icon  { font-size: 1.5rem; }
.report-card-title { font-size: 1rem; font-weight: 600; }
.report-card-desc  { font-size: 0.82rem; flex: 1; }

/* ── Pills (badges) ───────────────────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pill-success { background: rgba(82,196,26,0.15); color: #95de64; border: 1px solid rgba(82,196,26,0.35); }
.pill-warning { background: rgba(250,173,20,0.15); color: var(--gold); border: 1px solid rgba(250,173,20,0.35); }

/* ── Interactive onboarding ───────────────────────────────────────────────── */
.onboarding-profile-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, rgba(24,144,255,0.12) 0%, rgba(114,46,209,0.1) 100%);
  border: 1px solid rgba(24,144,255,0.35);
  border-radius: var(--radius);
}
.onboarding-profile-banner .btn-sm { flex-shrink: 0; }

.onboarding-shell { max-width: 960px; margin: 0 auto; padding-bottom: 2rem; }
.onboarding-shell--done .onboarding-hero {
  text-align: center;
  padding: 2rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 1.25rem;
}
.onboarding-hero-badge {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--green);
  border: 1px solid rgba(82,196,26,0.4);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}
.onboarding-hero-title { font-size: 1.65rem; margin-bottom: 0.35rem; }
.onboarding-hero-lead { max-width: 520px; margin: 0 auto 1rem; }
.onboarding-hero-actions { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; }
.onboarding-recap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.onboarding-header {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 1.5rem;
}
@media (max-width: 820px) { .onboarding-header { grid-template-columns: 1fr; } }
.onboarding-kicker { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin: 0 0 0.25rem; }
.onboarding-title { font-size: 1.5rem; margin: 0 0 0.35rem; }
.onboarding-sub { margin: 0; max-width: 560px; }

.onboarding-progress-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
}
.onboarding-progress-meta { display: flex; justify-content: space-between; font-size: 0.82rem; margin-bottom: 0.35rem; }
.onboarding-progress-bar {
  height: 6px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.85rem;
}
.onboarding-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--purple));
  border-radius: 999px;
  transition: width 0.35s ease;
}
.onboarding-stepper {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.onboarding-stepper li {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.2rem;
  padding: 0.35rem;
  border-radius: 8px;
  transition: background var(--transition), color var(--transition);
}
.onboarding-stepper li span:first-child {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.7rem;
}
.onboarding-stepper li.is-active {
  background: rgba(24,144,255,0.12);
  color: var(--text);
}
.onboarding-stepper li.is-active span:first-child {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.onboarding-stepper li.is-done { color: var(--green); }
.onboarding-stepper li.is-done span:first-child {
  border-color: rgba(82,196,26,0.5);
  background: rgba(82,196,26,0.2);
  color: var(--green);
}
.onboarding-stepper li.is-behind { color: #d4a017; }
.onboarding-stepper li.is-behind span:first-child {
  border-color: rgba(212,160,23,0.55);
  background: rgba(212,160,23,0.12);
  color: #d4a017;
}
.onboarding-stepper--7 {
  grid-template-columns: repeat(4, 1fr);
  font-size: 0.66rem;
}
@media (max-width: 900px) {
  .onboarding-stepper--7 { grid-template-columns: repeat(3, 1fr); }
}

.onboarding-dept-preview { margin-bottom: 1rem; }
.onboarding-dept-chips {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.onboarding-dept-chips li { margin: 0; }
.onboarding-pill {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.78rem;
}

.onboarding-form { position: relative; }
.onboarding-panel {
  display: none;
  animation: onboardingFade 0.35s ease both;
}
.onboarding-panel.is-active { display: block; }
@keyframes onboardingFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.onboarding-panel-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1rem;
}
@media (max-width: 800px) { .onboarding-panel-grid { grid-template-columns: 1fr; } }

.onboarding-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.15rem;
}
.onboarding-card--accent {
  border-color: rgba(24,144,255,0.35);
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}
.onboarding-card h2, .onboarding-card h3 { margin-top: 0; }
.onboarding-list { margin: 0.5rem 0 0; padding-left: 1.1rem; color: var(--text-muted); font-size: 0.88rem; }
.onboarding-stat-row { display: flex; gap: 1rem; margin-top: 1rem; flex-wrap: wrap; }
.onboarding-stat {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  min-width: 72px;
}
.onboarding-stat span { display: block; font-weight: 700; font-size: 1rem; }
.onboarding-stat small { color: var(--text-muted); font-size: 0.68rem; }

.onboarding-dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 1rem; font-size: 0.85rem; }
.onboarding-dl dt { color: var(--text-muted); margin: 0; }
.onboarding-dl dd { margin: 0; }

.onboarding-section-title { margin: 0 0 0.5rem; font-size: 1.2rem; }

.pipeline-map {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.65rem;
  margin-top: 1rem;
}
.pipeline-node {
  text-align: left;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem;
  background: var(--surface-2);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition), transform 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.pipeline-node:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(24,144,255,0.15);
}
.pipeline-node.is-done {
  border-color: rgba(82,196,26,0.55);
  background: rgba(82,196,26,0.08);
  box-shadow: 0 0 0 1px rgba(82,196,26,0.2);
}
.pipeline-node-index {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pipeline-node-title { font-weight: 600; font-size: 0.88rem; }
.pipeline-node-body { font-size: 0.75rem; color: var(--text-muted); line-height: 1.4; }
.pipeline-map-hint { margin: 0.75rem 0 0; font-size: 0.82rem; }

.policy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}
.policy-tile {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.policy-tile:hover { border-color: rgba(24,144,255,0.4); }
.policy-tile:has(.policy-cb:checked) {
  border-color: rgba(82,196,26,0.45);
  background: rgba(82,196,26,0.06);
}
.policy-tile--inline { flex-direction: row; align-items: flex-start; gap: 0.65rem; margin-top: 1rem; }
.policy-cb { margin-top: 0.2rem; accent-color: var(--primary); }
.policy-tile-head { font-weight: 600; font-size: 0.9rem; }
.policy-tile-body { font-size: 0.8rem; }

.checklist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}
.checklist-card {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  align-items: flex-start;
  transition: border-color var(--transition);
}
.checklist-card:hover { border-color: rgba(24,144,255,0.35); }
.checklist-card:has(.checklist-cb:checked) { border-color: rgba(82,196,26,0.4); }
.checklist-cb { margin-top: 0.25rem; accent-color: var(--primary); flex-shrink: 0; }
.checklist-card .btn-sm { margin-top: 0.35rem; }

.onboarding-org-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.5rem; }

.onboarding-completion {
  text-align: center;
  padding: 2rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.onboarding-completion-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 0.75rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.onboarding-summary {
  text-align: left;
  max-width: 360px;
  margin: 1rem auto;
  padding: 0 0 0 1.1rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}
.onboarding-form-actions { margin-top: 1rem; }
.btn-lg { padding: 0.65rem 1.25rem; font-size: 0.95rem; }

.onboarding-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, transparent, var(--bg) 25%);
}
.onboarding-nav-spacer { flex: 1; }

/* ── Select option dropdown — force dark on Windows Chrome ──────────────── */
select option {
  background: var(--surface, #1a1a2e);
  color: var(--text, #e0e0f0);
}

/* ── Global dark inputs: number, date, time, datetime-local ─────────────── */
input[type="number"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"] {
  background: var(--surface, #1a1a2e);
  color: var(--text, #e0e0f0);
  border: 1px solid var(--border, #2a2a3a);
  border-radius: 4px;
  color-scheme: dark;
}
/* Standalone search boxes (list filters via initListSearch). Without this they render as
   bare white browser-default boxes on the dark theme. Scoped to type=search so the topbar
   global search (type=text) is unaffected. */
input[type="search"] {
  background: var(--surface, #1a1a2e);
  color: var(--text, #e0e0f0);
  border: 1px solid var(--border, #2a2a3a);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  color-scheme: dark;
}
input[type="search"]::placeholder { color: var(--muted, #888); }
input[type="search"]:focus { outline: none; border-color: var(--primary, #7c6fff); }
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="datetime-local"]:focus,
input[type="month"]:focus,
input[type="week"]:focus {
  outline: none;
  border-color: var(--primary, #7c6fff);
}

/* ── Batch A-D new pages UI polish (additive) ─────────────────────────── */

.list-page .list-page-actions {
  margin-left: auto;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.list-page .empty-state-block {
  text-align: center;
  padding: 2.5rem 1.5rem;
}
.list-page .empty-state-block .empty-state-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.75rem;
  line-height: 1;
}
.list-page .empty-state-block .empty-state-msg {
  font-size: 0.95rem;
  color: var(--muted, #888);
  margin: 0 0 1rem;
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}

.list-page .detail-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem 1rem;
  font-size: 0.88rem;
}
.list-page .detail-field-grid .lbl {
  font-size: 0.72rem;
  color: var(--muted, #888);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.list-page .detail-field-grid .val {
  font-weight: 600;
  margin-top: 0.15rem;
}
.list-page .detail-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}
.list-page .dep-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.list-page .dep-list li {
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border, #2a2a3a);
  font-size: 0.85rem;
}
.list-page .dep-list li:last-child { border-bottom: none; }

.list-page.form-page .form-card {
  max-width: 520px;
}
.list-page.form-page .form-card-wide {
  max-width: 720px;
}
.list-page.form-page .section-card.form-card-wide {
  max-width: 720px;
}
.list-page.form-page .section-card .form-card {
  max-width: none;
  border: none;
  background: transparent;
  padding: 0.85rem 1.1rem;
  box-shadow: none;
}

/* Render farm */
.list-page.render-page .rnd-farm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}
.list-page.render-page .rnd-farm-card {
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  background: var(--surface, #161622);
  border: 1px solid var(--border, #2a2a3a);
  text-align: center;
}
.list-page.render-page .rnd-farm-card .lbl {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted, #888);
}
.list-page.render-page .rnd-farm-card .val {
  font-size: 1.35rem;
  font-weight: 800;
  margin-top: 0.2rem;
}
.list-page.render-page .rnd-farm-card--online .val { color: #81c784; }
.list-page.render-page .rnd-farm-card--busy .val { color: #ffb74d; }
.list-page.render-page .rnd-farm-card--idle .val { color: #64b5f6; }
.list-page.render-page .rnd-farm-card--offline .val { color: #888; }
.list-page.render-page .rnd-progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  min-width: 4rem;
}
.list-page.render-page .rnd-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: #7c6fff;
  transition: width 0.2s;
}
.list-page.render-page .rnd-progress-fill.is-done { background: #4caf50; }
.list-page.render-page .rnd-progress-fill.is-failed { background: #e53935; }
.list-page.render-page .rnd-worker-stale { opacity: 0.55; }
.list-page.render-page .rnd-poll-hint {
  font-size: 0.72rem;
  color: var(--muted, #888);
}
.list-page.render-page .rnd-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.65);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.list-page.render-page .rnd-modal-backdrop.is-open { display: flex; }
.list-page.render-page .rnd-modal {
  width: min(480px, 100%);
  background: var(--surface, #161622);
  border: 1px solid var(--border, #2a2a3a);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}
.list-page.render-page .rnd-modal-head {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.list-page.render-page .rnd-modal-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.list-page.render-page .rnd-modal-foot {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.45rem;
  justify-content: flex-end;
}
.list-page.render-page .rnd-modal-close {
  background: transparent;
  border: none;
  color: var(--muted, #888);
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
}

/* Security dashboard */
.list-page.sec-page .sec-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.list-page.sec-page .sec-tpn-ring {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.list-page.sec-page .sec-tpn-score {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 800;
  border: 3px solid #4caf50;
  color: #81c784;
  background: rgba(76, 175, 80, 0.08);
}
.list-page.sec-page .sec-tpn-score.warn {
  border-color: #fa8c16;
  color: #ffb74d;
  background: rgba(250, 140, 22, 0.08);
}
.list-page.sec-page .sec-tpn-meta { font-size: 0.8rem; line-height: 1.5; }
.list-page.sec-page .sec-tpn-meta strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}
.list-page.sec-page .sec-gap-list {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.78rem;
  color: var(--muted, #888);
}
.list-page.sec-page .sec-wm-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.82rem;
}
.list-page.sec-page .sec-wm-row:last-child { border-bottom: none; }
.list-page.sec-page .sec-wm-label { flex: 1; min-width: 8rem; font-weight: 600; }
.list-page.sec-page .sec-wm-stat { font-size: 0.75rem; color: var(--muted, #888); }
.list-page.sec-page .sec-level {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
}
.list-page.sec-page .sec-level--client { background: rgba(124, 111, 255, 0.15); color: #a89fff; }
.list-page.sec-page .sec-level--internal { background: rgba(38, 198, 218, 0.12); color: #4dd0e1; }
.list-page.sec-page .sec-level--staff { background: rgba(76, 175, 80, 0.12); color: #81c784; }
.list-page.sec-page .sec-level--blocked { background: rgba(229, 57, 53, 0.12); color: #ef9a9a; }
.list-page.sec-page .sec-event { font-family: ui-monospace, monospace; font-size: 0.72rem; }

/* Help center */
.list-page.kb-page .kb-bc {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--muted, #888);
  margin-bottom: 0.85rem;
}
.list-page.kb-page .kb-bc a { color: var(--primary, #7c6fff); text-decoration: none; }
.list-page.kb-page .kb-bc a:hover { text-decoration: underline; }
.list-page.kb-page .kb-bc-sep { opacity: 0.5; }
.list-page.kb-page .kb-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1rem;
  align-items: start;
}
.list-page.kb-page .kb-sidebar {
  position: sticky;
  top: 0.75rem;
  background: var(--surface, #161622);
  border: 1px solid var(--border, #2a2a3a);
  border-radius: 10px;
  padding: 0.65rem 0;
  overflow: hidden;
}
.list-page.kb-page .kb-sidebar-head {
  padding: 0 0.85rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted, #888);
}
.list-page.kb-page .kb-cat-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  color: var(--text, #e0e0f0);
  text-decoration: none;
  border-left: 3px solid transparent;
}
.list-page.kb-page .kb-cat-link:hover { background: rgba(124, 111, 255, 0.06); }
.list-page.kb-page .kb-cat-link.is-active {
  background: rgba(124, 111, 255, 0.1);
  border-left-color: var(--primary, #7c6fff);
  color: #c5beff;
  font-weight: 600;
}
.list-page.kb-page .kb-cat-count { font-size: 0.68rem; color: var(--muted, #888); }
.list-page.kb-page .kb-main { min-width: 0; }
.list-page.kb-page .kb-search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface, #161622);
}
.list-page.kb-page .kb-search-bar input[type="search"] {
  flex: 1;
  min-width: 10rem;
}
.list-page.kb-page .kb-articles {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.list-page.kb-page .kb-article-card {
  display: block;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: var(--surface, #161622);
  border: 1px solid var(--border, #2a2a3a);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.12s, background 0.12s;
}
.list-page.kb-page .kb-article-card:hover {
  border-color: rgba(124, 111, 255, 0.4);
  background: rgba(124, 111, 255, 0.04);
}
.list-page.kb-page .kb-article-card.is-hidden { display: none; }
.list-page.kb-page .kb-article-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
}
.list-page.kb-page .kb-article-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0;
  flex: 1;
}
.list-page.kb-page .kb-article-desc {
  font-size: 0.78rem;
  color: var(--muted, #888);
  line-height: 1.45;
  margin: 0;
}
.list-page.kb-page .kb-article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.45rem;
  font-size: 0.72rem;
  color: var(--muted, #888);
}

/* Announcements */
.list-page.ann-page .ann-card {
  background: var(--surface, #1a1a28);
  border: 1px solid var(--border, #2a2a3a);
  border-radius: var(--radius, 8px);
  padding: 1rem 1.15rem;
  margin-bottom: 0.75rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.list-page.ann-page .ann-card:hover { border-color: rgba(124, 111, 255, 0.35); }
.list-page.ann-page .ann-card.pinned {
  border-color: #7c6fff;
  box-shadow: 0 0 0 1px rgba(124, 111, 255, 0.22);
  background: linear-gradient(135deg, rgba(124, 111, 255, 0.06) 0%, var(--surface, #1a1a28) 55%);
}
.list-page.ann-page .ann-head {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.45rem;
}
.list-page.ann-page .ann-icon {
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.list-page.ann-page .ann-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text, #eee);
  line-height: 1.35;
}
.list-page.ann-page .ann-meta {
  font-size: 0.72rem;
  color: var(--muted, #888);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: center;
  margin-bottom: 0.55rem;
}
.list-page.ann-page .ann-meta-sep { opacity: 0.45; }
.list-page.ann-page .ann-body {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text, #ccc);
  overflow: hidden;
  max-height: 8.5rem;
}
.list-page.ann-page .ann-body.is-expanded { max-height: none; }
.list-page.ann-page .ann-body p { margin: 0 0 0.5rem; }
.list-page.ann-page .ann-body p:last-child { margin-bottom: 0; }
.list-page.ann-page .ann-expand-btn {
  margin-top: 0.45rem;
  padding: 0;
  border: none;
  background: none;
  color: #7c6fff;
  font-size: 0.72rem;
  cursor: pointer;
  font-weight: 600;
}
.list-page.ann-page .ann-expand-btn:hover { text-decoration: underline; }
.list-page.ann-page .ann-actions {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border, #2a2a3a);
}
.list-page.ann-page .ann-mobile-toggle { display: none; align-items: center; gap: 0.35rem; margin-bottom: 0.65rem; }

/* Expense detail */
.list-page .exp-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 340px);
  gap: 1rem;
  align-items: start;
}
.list-page .exp-flag {
  font-size: 0.82rem;
  color: #ffb020;
  font-weight: 600;
  margin-bottom: 0.65rem;
}
.list-page .exp-dup-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(255, 176, 32, 0.12);
  border: 1px solid rgba(255, 176, 32, 0.35);
  color: #ffb020;
}
.list-page .exp-dup-badge a { color: inherit; text-decoration: underline; }
.list-page .exp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

@media (max-width: 860px) {
  .list-page .exp-detail-grid { grid-template-columns: 1fr; }
  .list-page .detail-two-col { grid-template-columns: 1fr; }
  .list-page .detail-field-grid { grid-template-columns: 1fr; }
  .list-page.sec-page .sec-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .list-page.kb-page .kb-layout { grid-template-columns: 1fr; }
  .list-page.kb-page .kb-sidebar {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.55rem;
  }
  .list-page.kb-page .kb-sidebar-head { width: 100%; padding: 0 0.25rem 0.35rem; }
  .list-page.kb-page .kb-cat-link {
    border-left: none;
    border-radius: 999px;
    padding: 0.35rem 0.65rem;
    border: 1px solid var(--border);
  }
  .list-page.kb-page .kb-cat-link.is-active { border-color: rgba(124, 111, 255, 0.45); }
}
@media (max-width: 700px) {
  .list-page.ann-page .mobile-collapsible-panel { display: none; }
  .list-page.ann-page .mobile-collapsible-panel.is-open {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }
  .list-page.ann-page .ann-mobile-toggle { display: inline-flex !important; }
}

/* Shared form polish (documents, announcements) */
.list-page.form-page .form-ux-scope label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
  font-size: 0.85rem;
}
.list-page.form-page .form-ux-scope .req {
  color: #e05252;
  margin-left: 0.15rem;
  font-weight: 600;
}
.list-page.form-page .form-ux-scope .field-hint {
  font-size: 0.72rem;
  color: #8b9aae;
  margin: 0.2rem 0 0.75rem;
  line-height: 1.45;
}
.list-page.form-page .form-ux-scope .form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.list-page.form-page .doc-upload-zone {
  border: 2px dashed var(--border, #2a2a3a);
  border-radius: 8px;
  padding: 1rem;
  background: rgba(124, 111, 255, 0.04);
  transition: border-color 0.15s, background 0.15s;
}
.list-page.form-page .doc-upload-zone.is-dragover {
  border-color: #7c6fff;
  background: rgba(124, 111, 255, 0.1);
}
.list-page.form-page .doc-or-divider {
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted, #888);
  margin: 0.75rem 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.list-page.form-page .doc-or-divider::before,
.list-page.form-page .doc-or-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border, #2a2a3a);
}
.list-page.form-page .doc-current-file {
  font-size: 0.75rem;
  color: var(--muted, #888);
  margin-top: 0.5rem;
  padding: 0.5rem 0.65rem;
  background: var(--surface-2, #151520);
  border-radius: 6px;
}
.list-page.form-page .form-ux-scope .char-count {
  font-size: 0.68rem;
  color: var(--muted, #888);
  text-align: right;
  margin-top: 0.25rem;
}

/* Expense receipt panel */
.exp-receipt-img img {
  display: block;
  max-width: 100%;
  max-height: 420px;
  border-radius: 8px;
  border: 1px solid var(--border, #2a2a3a);
  background: #111;
  object-fit: contain;
}
.exp-receipt-img-compact img { max-height: 72px; max-width: 96px; }
.exp-receipt-caption { margin-top: 0.5rem; }
.exp-receipt-pdf { padding: 0.35rem 0; }
.exp-no-receipt { font-size: 0.78rem; font-weight: 600; }
.exp-no-receipt-sm { font-size: 0.68rem; padding: 0.1rem 0.45rem; }
.exp-inbox-receipt { display: inline-flex; vertical-align: middle; margin-right: 0.35rem; }
.exp-inbox-receipt img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border, #2a2a3a);
}
.list-page.form-page .form-ux-scope .pin-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  background: rgba(124, 111, 255, 0.06);
  border: 1px solid rgba(124, 111, 255, 0.2);
  border-radius: 6px;
  flex-wrap: wrap;
}
@media (max-width: 700px) {
  .list-page.form-page .form-ux-scope .form-row-2 { grid-template-columns: 1fr !important; }
}

/* List filter stack + saved views (Task G polish) */
.list-page .filter-stack {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: var(--ui-section-gap, 1rem);
}
.list-page .filter-stack .filter-bar { margin-bottom: 0; }
.list-page .filter-form select {
  width: auto;
  min-width: 9.5rem;
  max-width: 14rem;
}
.list-page .filter-form input[type="text"] {
  width: auto;
  min-width: 8rem;
  max-width: 12rem;
}
.list-page .saved-views-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.list-page .saved-views-bar__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 0.15rem;
}
.list-page .saved-views-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}
.list-page .saved-views-delete-form { display: inline; margin: 0; }
.list-page .saved-views-delete-btn {
  min-width: 1.75rem;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
  line-height: 1;
}
.list-page .saved-views-save-form {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0 auto;
}
.list-page .saved-views-name-input {
  padding: 0.35rem 0.6rem;
  background: var(--surface-2, var(--surface));
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.8125rem;
  min-width: 7.5rem;
  max-width: 10rem;
}
.list-page .saved-views-name-input:focus {
  outline: none;
  border-color: var(--primary);
}
.list-page .review-cycle-form {
  padding: 0.75rem 1rem;
}
@media (max-width: 900px) {
  .list-page .saved-views-save-form {
    margin-left: 0;
    width: 100%;
  }
  .list-page .saved-views-name-input { max-width: none; flex: 1; }
}

/* ── Add Project form (Task J) ─────────────────────────────────────────── */
.list-page.add-project-page .add-project-form {
  max-width: 720px;
}
.list-page.add-project-page .add-project-section {
  margin-bottom: 0.85rem;
}
.list-page.add-project-page .add-project-section .form-card {
  max-width: none;
  border: none;
  background: transparent;
  padding: 0.85rem 1.1rem;
  box-shadow: none;
}
.list-page.add-project-page .field-hint-inline {
  color: var(--muted, #888);
  font-weight: 400;
  font-size: 0.78rem;
}
.list-page.add-project-page .add-project-code-input {
  text-transform: uppercase;
  font-family: monospace;
  letter-spacing: 0.1em;
}
.list-page.add-project-page .add-project-code-row {
  align-items: flex-end;
}
.list-page.add-project-page .add-project-suggest-col {
  padding-bottom: 2px;
}
.list-page.add-project-page .add-project-suggest-btn {
  width: 100%;
}
.list-page.add-project-page .add-project-code-chips {
  display: none;
  margin-top: 6px;
  margin-bottom: 4px;
}
.list-page.add-project-page .add-project-desc-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  padding: 5px 8px;
  background: #1a1f26;
  border: 1px solid #333;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
}
.list-page.add-project-page .add-project-tb-sep {
  width: 1px;
  height: 18px;
  background: #444;
  margin: 0 4px;
}
.list-page.add-project-page .add-project-ai-btn {
  padding: 3px 10px;
  font-size: 0.8rem;
  margin-left: 2px;
}
.list-page.add-project-page .add-project-ai-status {
  font-size: 0.75rem;
  color: #8b9aae;
  margin-left: 6px;
}
.list-page.add-project-page .add-project-desc-editor {
  min-height: 90px;
  padding: 10px 12px;
  background: #0f1317;
  border: 1px solid #333;
  border-radius: 0 0 6px 6px;
  color: #e6e6e6;
  font-size: 0.92rem;
  line-height: 1.6;
  outline: none;
}
.list-page.add-project-page .add-project-desc-editor:empty:before {
  content: attr(data-placeholder);
  color: #4a5568;
  pointer-events: none;
}
.list-page.add-project-page .add-project-desc-editor:focus {
  border-color: #555;
}
.list-page.add-project-page .add-project-client-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.list-page.add-project-page .add-project-client-row select {
  flex: 1;
}
.list-page.add-project-page .add-project-new-client-btn {
  white-space: nowrap;
  padding: 6px 10px;
  font-size: 0.82rem;
}
.list-page.add-project-page .add-project-nc-panel {
  display: none;
  margin-top: 8px;
  padding: 12px;
  background: #151b22;
  border: 1px solid #2a3a4a;
  border-radius: 6px;
}
.list-page.add-project-page .add-project-nc-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #8b9aae;
  margin: 0 0 8px;
}
.list-page.add-project-page .add-project-nc-field {
  margin-bottom: 6px;
}
.list-page.add-project-page .add-project-nc-actions {
  display: flex;
  gap: 8px;
}
.list-page.add-project-page .add-project-nc-save {
  font-size: 0.82rem;
  padding: 5px 14px;
}
.list-page.add-project-page .add-project-nc-cancel {
  font-size: 0.82rem;
  padding: 5px 10px;
}
.list-page.add-project-page .add-project-nc-error {
  color: #f5222d;
  font-size: 0.78rem;
  margin: 6px 0 0;
  display: none;
}
.list-page.add-project-page .add-project-role-notes {
  margin-top: 0.75rem;
}
.list-page.add-project-page .add-project-role-notes-head {
  font-size: 0.8rem;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}
.list-page.add-project-page .add-project-form-actions {
  margin-top: 0.25rem;
}
.list-page.add-project-page .multi-listbox {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 6px;
  background: var(--bg, #0f0f0f);
  outline: none;
}
.list-page.add-project-page .multi-listbox:focus-within {
  border-color: var(--primary, #6247ef);
}
.list-page.add-project-page .mlb-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.42rem 0.75rem;
  cursor: pointer;
  user-select: none;
  color: var(--text, #e8e8e8);
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border, #2a2a2a);
}
.list-page.add-project-page .mlb-item:last-child {
  border-bottom: none;
}
.list-page.add-project-page .mlb-item:hover {
  background: var(--surface-alt, #1c1c1c);
}
.list-page.add-project-page .mlb-item.is-selected {
  background: #3a6bc4;
  color: #fff;
}
.list-page.add-project-page .mlb-item.is-selected:hover {
  background: #2d5dba;
  color: #fff;
}
.list-page.add-project-page .mlb-chk {
  display: none;
}
.list-page.add-project-page .mlb-tick {
  width: 14px;
  height: 14px;
  border: 1.5px solid #555;
  border-radius: 3px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}
.list-page.add-project-page .mlb-item.is-selected .mlb-tick {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.2);
}
.list-page.add-project-page .tb-btn {
  background: #252c36;
  border: 1px solid #333;
  border-radius: 4px;
  color: #ccc;
  padding: 2px 8px;
  font-size: 0.85rem;
  cursor: pointer;
  line-height: 1.5;
}
.list-page.add-project-page .tb-btn:hover {
  background: #2e3a49;
  color: #fff;
}
.list-page.add-project-page .tb-btn.active {
  background: #177ddc;
  border-color: #177ddc;
  color: #fff;
}

/* ── Intake response (Task J) ──────────────────────────────────────────── */
.intake-response-page .intake-resp-header {
  margin-bottom: 1rem;
}
.intake-response-page .intake-resp-title-block {
  flex: 1;
  min-width: 0;
}
.intake-response-page .intake-resp-meta {
  font-size: 0.82rem;
  margin-top: 0.3rem;
}
.intake-response-page .intake-resp-token {
  font-size: 0.78rem;
  color: #555;
}
.intake-response-page .intake-resp-pending-label {
  color: #fbbf24;
}
.intake-response-page .intake-resp-actions-card {
  margin-bottom: 1.25rem;
}
.intake-response-page .intake-resp-actions-inner {
  padding: 0.85rem 1.1rem 1rem;
}
.intake-response-page .intake-resp-status-row {
  margin-bottom: 0.75rem;
}
.intake-response-page .intake-resp-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.intake-response-page .intake-resp-link-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.intake-response-page .intake-resp-project-select {
  min-width: 180px;
  font-size: 0.82rem;
  padding: 0.35rem 0.6rem;
}
.intake-response-page .intake-resp-import-btn {
  background: rgba(76, 175, 80, 0.15);
  color: #4caf50;
  border: 1px solid rgba(76, 175, 80, 0.3);
}
.intake-response-page .intake-resp-create-btn {
  font-weight: 600;
}
.intake-response-page .intake-resp-hint {
  font-size: 0.78rem;
  color: #555;
  margin: 0.65rem 0 0;
}
.intake-response-page .intake-resp-imported-meta {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: #555;
}
.intake-response-page .intake-resp-project-link {
  color: #a89fff;
  text-decoration: none;
}
.intake-response-page .intake-resp-answers {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.intake-response-page .intake-resp-section .section-card-head .section-key {
  font-size: 0.7rem;
  background: rgba(124, 111, 255, 0.12);
  color: #a89fff;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-family: monospace;
  margin-right: 0.4rem;
}
.intake-response-page .intake-resp-fields {
  padding: 0;
  overflow: hidden;
}
.intake-response-page .resp-field {
  padding: 0.6rem 1.1rem;
  border-bottom: 1px solid var(--border, #2a2a3e);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.intake-response-page .resp-field:last-child {
  border-bottom: none;
}
.intake-response-page .resp-field-label {
  min-width: 220px;
  max-width: 240px;
  font-size: 0.78rem;
  color: #888;
  padding-top: 0.1rem;
}
.intake-response-page .resp-field-value {
  flex: 1;
  min-width: 0;
  font-size: 0.88rem;
  color: #e0e0f0;
  white-space: pre-wrap;
  word-break: break-word;
}
.intake-response-page .resp-field-value.empty {
  color: #444;
  font-style: italic;
}
.intake-response-page .import-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(76, 175, 80, 0.1);
  border: 1px solid rgba(76, 175, 80, 0.3);
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  color: #4caf50;
  font-weight: 600;
}
.intake-response-page .pending-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  color: #fbbf24;
  font-weight: 600;
}
.intake-response-page .awaiting-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(80, 80, 120, 0.1);
  border: 1px solid #2a2a3e;
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  color: #555;
}
.intake-response-page .intake-resp-empty {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: #555;
}
.intake-response-page .intake-resp-empty p {
  margin: 0 0 0.75rem;
}
@media (max-width: 900px) {
  .intake-response-page .intake-resp-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .intake-response-page .intake-resp-btn-group {
    flex-direction: column;
    align-items: stretch;
  }
  .intake-response-page .intake-resp-link-form {
    flex-direction: column;
    align-items: stretch;
  }
  .intake-response-page .intake-resp-project-select {
    min-width: 0;
    width: 100%;
  }
  .intake-response-page .resp-field {
    flex-direction: column;
    gap: 0.35rem;
  }
  .intake-response-page .resp-field-label {
    min-width: 0;
    max-width: none;
  }
}

/* ── Task add form (Task J) ────────────────────────────────────────────── */
.list-page.task-add-page .task-add-form {
  max-width: 680px;
  border: none;
  background: transparent;
  padding: 0;
  box-shadow: none;
}
.list-page.task-add-page .task-add-section {
  margin-bottom: 0.85rem;
}
.list-page.task-add-page .task-add-section .form-card {
  max-width: none;
  border: none;
  background: transparent;
  padding: 0.85rem 1.1rem;
  box-shadow: none;
}
.list-page.task-add-page .task-add-pipeline-head {
  display: block;
  margin-top: 0.5rem;
}
.list-page.task-add-page .task-add-custom-stage {
  display: none;
  margin-top: 0.35rem;
}
.list-page.task-add-page .task-add-roster-note {
  font-size: 0.78rem;
  font-weight: 400;
}
.list-page.task-add-page .task-add-form-actions {
  margin-top: 0.25rem;
}
.list-page.task-add-page .form-ux-scope .req {
  color: var(--clr-danger, #e53935);
  font-weight: 600;
  margin-left: 0.12em;
}
.list-page.task-add-page .form-ux-scope .field-hint {
  display: block;
  font-size: 0.78rem;
  color: var(--muted, var(--text-muted, #888));
  margin: 0.2rem 0 0.45rem;
  line-height: 1.35;
}
.list-page.task-add-page .form-ux-scope input:focus,
.list-page.task-add-page .form-ux-scope select:focus,
.list-page.task-add-page .form-ux-scope textarea:focus {
  outline: none;
  border-color: var(--primary, #7c6fff);
  box-shadow: 0 0 0 2px rgba(124, 111, 255, 0.22);
}
@media (max-width: 700px) {
  .list-page.add-project-page .form-row-2,
  .list-page.task-add-page .form-row-2 {
    grid-template-columns: 1fr !important;
  }
}

/* Site-wide file inputs: the native "Choose File" button renders bright white on every
   browser, which clashes with the dark UI. Style the input shell + the file-selector button
   to match (dark surface, themed accent on hover). Applies everywhere automatically. */
input[type="file"] {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.84rem;
  padding: 0.3rem 0.5rem 0.3rem 0.35rem;
  max-width: 100%;
}
input[type="file"]::file-selector-button {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.4rem 0.9rem;
  margin-right: 0.7rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.12s, background 0.12s;
}
input[type="file"]::file-selector-button:hover { filter: brightness(1.12); }
/* Older WebKit fallback (same look). */
input[type="file"]::-webkit-file-upload-button {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.4rem 0.9rem;
  margin-right: 0.7rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

/* Render farm alive polish (P7): shared motion, hover, density across farm pages */
@keyframes rnd-farm-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes rnd-poll-pulse {
  0%, 100% { opacity: 0.62; }
  50% { opacity: 1; }
}
.render-farm-alive {
  animation: rnd-farm-fade-in 0.32s ease-out;
}
.render-farm-alive .rnd-poll-hint {
  animation: rnd-poll-pulse 2.4s ease-in-out infinite;
}
.render-farm-alive .rnd-farm-card,
.render-farm-alive .rwk .kpi {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.render-farm-alive .rnd-farm-card:hover,
.render-farm-alive .rwk .kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}
.render-farm-alive .rnd-farm-card--online:hover { border-color: rgba(129, 199, 132, 0.45); }
.render-farm-alive .rnd-farm-card--busy:hover { border-color: rgba(255, 183, 77, 0.45); }
.render-farm-alive .rnd-farm-card--idle:hover { border-color: rgba(100, 181, 246, 0.45); }
.render-farm-alive .rnd-farm-card--offline:hover { border-color: rgba(136, 136, 136, 0.45); }
.render-farm-alive .kpi.util:hover { border-color: rgba(76, 175, 80, 0.4); }
.render-farm-alive .section-card.ui-card,
.render-farm-alive .rw-workers-card,
.render-farm-alive .rnd-queue-card {
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.render-farm-alive .section-card.ui-card:hover,
.render-farm-alive .rw-workers-card:hover,
.render-farm-alive .rnd-queue-card:hover {
  box-shadow: 0 4px 20px rgba(124, 111, 255, 0.08);
}
.render-farm-alive .rnd-job-row,
.render-farm-alive .rw-slot-row,
.render-farm-alive .rnd-chunk-row {
  transition: background 0.15s ease, border-color 0.15s ease;
}
.render-farm-alive #rnd-workers-table tbody tr {
  transition: background 0.15s ease;
}
.render-farm-alive #rnd-workers-table tbody tr:hover {
  background: rgba(124, 111, 255, 0.06);
}
.render-farm-alive .rnd-status-pill,
.render-farm-alive .rnd-priority-pill,
.render-farm-alive .cap-chip,
.render-farm-alive .rnd-task-chip {
  transition: transform 0.12s ease;
}
.render-farm-alive tr:hover .rnd-status-pill {
  transform: scale(1.03);
}
.render-farm-alive .rnd-progress-fill {
  transition: width 0.35s ease, background 0.2s ease;
}
.render-farm-alive .btn-sm,
.render-farm-alive .list-page-actions .btn,
.render-farm-alive .page-header .btn {
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}
.render-farm-alive .btn-sm:hover:not(:disabled),
.render-farm-alive .list-page-actions .btn:hover,
.render-farm-alive .page-header .btn:hover {
  transform: translateY(-1px);
}
.render-farm-alive .rnd-activity-item {
  transition: background 0.15s ease, padding-left 0.15s ease;
}
.render-farm-alive .rnd-activity-item:hover {
  background: rgba(124, 111, 255, 0.06);
  padding-left: 0.15rem;
}
.render-farm-alive .rnd-chunk-log-summary {
  transition: color 0.15s ease;
}
.render-farm-alive .rnd-chunk-log-details[open] .rnd-chunk-log-summary {
  color: var(--primary, #7c6fff);
}
.render-farm-alive .rw-machine-row {
  transition: background 0.15s ease;
}
.render-farm-alive .rw-machine-row:hover {
  background: rgba(255, 255, 255, 0.04);
}
.render-farm-alive .pools .p {
  transition: border-color 0.15s ease, background 0.15s ease;
}
.render-farm-alive .pools .p:hover {
  border-color: rgba(124, 111, 255, 0.35);
  background: rgba(124, 111, 255, 0.06);
}
.render-farm-alive .rnd-ctl,
.render-farm-alive .rw-ctl {
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.render-farm-alive .rnd-ctl:focus,
.render-farm-alive .rw-ctl:focus {
  box-shadow: 0 0 0 2px rgba(124, 111, 255, 0.2);
}
@media (prefers-reduced-motion: reduce) {
  .render-farm-alive,
  .render-farm-alive .rnd-poll-hint {
    animation: none;
  }
  .render-farm-alive .rnd-farm-card:hover,
  .render-farm-alive .rwk .kpi:hover,
  .render-farm-alive .btn-sm:hover:not(:disabled),
  .render-farm-alive .list-page-actions .btn:hover,
  .render-farm-alive .page-header .btn:hover {
    transform: none;
  }
}

/* Farm checkboxes: dark theme, purple accent (not stark white boxes) */
.render-farm-alive input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  border: 1.5px solid rgba(124, 111, 255, 0.5);
  border-radius: 4px;
  background: var(--surface-2, #1a1a28);
  cursor: pointer;
  vertical-align: middle;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.render-farm-alive input[type="checkbox"]:hover {
  border-color: var(--primary, #7c6fff);
  box-shadow: 0 0 0 2px rgba(124, 111, 255, 0.14);
}
.render-farm-alive input[type="checkbox"]:checked {
  background: var(--primary, #7c6fff);
  border-color: var(--primary, #7c6fff);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%23fff' d='M4.5 9 1.5 6l1.2-1.2 1.8 1.8 4.8-4.8L10.5 3z'/%3E%3C/svg%3E");
  background-size: 0.72rem;
  background-position: center;
  background-repeat: no-repeat;
}
.render-farm-alive input[type="checkbox"]:focus-visible {
  outline: 2px solid rgba(124, 111, 255, 0.45);
  outline-offset: 2px;
}

.render-farm-alive .rnd-queue-row,
.render-farm-alive .rc-cost-row {
  transition: background 0.15s ease;
}
.render-farm-alive .rnd-queue-row:hover,
.render-farm-alive .rc-cost-row:hover {
  background: rgba(124, 111, 255, 0.05);
}
.render-farm-alive .rnd-priority-bulk {
  display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center;
  padding: 0.55rem 1rem; border-bottom: 1px solid var(--border, #2a2a3a);
  background: rgba(124, 111, 255, 0.04); margin: 0; font-size: 0.78rem;
}
.render-farm-alive .rc-kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.55rem; margin-bottom: 0.85rem;
}
.render-farm-alive .rc-kpi {
  padding: 0.75rem 0.85rem; border-radius: 10px;
  background: var(--surface, #161622); border: 1px solid var(--border, #2a2a3a);
  text-align: center; transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.render-farm-alive .rc-kpi:hover {
  transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}
.render-farm-alive .rc-kpi .k {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted, #888);
}
.render-farm-alive .rc-kpi .v {
  font-size: 1.25rem; font-weight: 800; margin-top: 0.2rem; font-variant-numeric: tabular-nums;
}
.render-farm-alive .rc-kpi--cost .v { color: #81c784; }
.render-farm-alive .rc-filter-bar {
  display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; margin-bottom: 0.85rem;
}
.render-farm-alive .rc-cost-table { font-size: 0.78rem; }
.render-farm-alive .rc-cost-table td { font-variant-numeric: tabular-nums; }
.render-farm-alive .rc-cost-amt { color: #81c784; font-weight: 600; }
.render-farm-alive .rnd-queue-row--pos td:nth-child(2) {
  font-family: monospace; font-size: 0.78rem; font-weight: 700; color: #e8c547;
}
.render-farm-alive .rnd-job-link {
  font-size: 0.8rem; font-weight: 700; text-decoration: none; color: inherit;
}
.render-farm-alive .rnd-job-link:hover { color: var(--primary, #7c6fff); }
.render-farm-alive .rnd-col-shot {
  font-family: monospace; font-size: 0.74rem; color: #e8c547;
}
.render-farm-alive .rnd-col-show { font-family: monospace; font-size: 0.74rem; }
.render-farm-alive .rnd-col-owner { font-size: 0.74rem; color: var(--text-muted, #8b97a8); }
.render-farm-alive .rnd-bulk-check {
  display: inline-flex; align-items: center; gap: 0.28rem;
  font-size: 0.76rem; color: var(--text-muted, #8b97a8); cursor: pointer;
}
.render-farm-alive .rnd-status-pill {
  display: inline-block; padding: 0.15rem 0.55rem; border-radius: 4px;
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
}
.render-farm-alive .rnd-status-pill--done { background: rgba(76, 175, 80, 0.15); color: #4caf50; }
.render-farm-alive .rnd-status-pill--failed { background: rgba(229, 57, 53, 0.12); color: #e57373; }
.render-farm-alive .rnd-status-pill--rendering,
.render-farm-alive .rnd-status-pill--assigned,
.render-farm-alive .rnd-status-pill--busy { background: rgba(255, 167, 38, 0.12); color: #ffa726; }
.render-farm-alive .rnd-status-pill--paused,
.render-farm-alive .rnd-status-pill--held,
.render-farm-alive .rnd-status-pill--stopped { background: rgba(124, 111, 255, 0.12); color: #a89fff; }
.render-farm-alive .rnd-status-pill--stale { background: rgba(255, 193, 7, 0.12); color: #ffca28; }
.render-farm-alive .rnd-status-pill--queued,
.render-farm-alive .rnd-status-pill--idle,
.render-farm-alive .rnd-status-pill--online,
.render-farm-alive .rnd-status-pill--offline { background: rgba(136, 136, 136, 0.12); color: #aaa; }
