/* =============================================================
   Internship Cell — Sandip University
   Light theme · Red primary · System fonts
   ============================================================= */

/* Top progress bar — see js/core/api.js. Hidden (0 width) until an
   in-flight foreground request adds .active, which starts an indeterminate
   sliding-fill animation; removing .active snaps it back to hidden rather
   than fading, since a request finishing IS the "done" signal. */
#top-loading-bar {
  position: fixed;
  top: 0; left: 0;
  width: 0;
  height: 3px;
  background: var(--red);
  z-index: 3000;
  opacity: 0;
}
#top-loading-bar.active {
  opacity: 1;
  animation: top-loading-bar-slide 1.1s ease-in-out infinite;
}
@keyframes top-loading-bar-slide {
  0%   { left: 0;    width: 0%; }
  50%  { left: 0;    width: 75%; }
  100% { left: 100%; width: 10%; }
}

:root {
  --red: #a6192e;
  --red-dark: #83141f;
  --red-pale: #fbeef0;
  --bg: #f4f5f7;
  --bg-light: #f7f8fa;
  --surface: #ffffff;
  --border: #dfe3e8;
  --text: #1f2933;
  --text-2: #5b6771;
  --text-3: #8a949e;
  --green: #1e7d43;
  --green-pale: #e8f5ee;
  --blue: #1a5dab;
  --blue-pale: #e9f1fa;
  --amber: #9a6700;
  --amber-pale: #fdf3dc;
  /* Overdue used to just reuse --amber, making it visually identical to
     Pending. Its own distinct, more urgent burnt-orange keeps the two
     statuses tellable apart at a glance. */
  --overdue: #c2410c;
  --overdue-bg: #fdece0;
  /* Sent-back — recoverable, the intern can redo and resubmit. */
  --rejected: #6a1b9a;
  --rejected-bg: #f3e5f5;
  /* Declined — a self-reported task rejected outright as invalid, terminal
     (no resubmission). Deliberately red rather than purple so it reads as
     more final than "Sent Back". */
  --declined: #83141f;
  --declined-bg: #fbeef0;
  /* Paler variants used only for a task card's whole-background wash — kept
     visibly lighter than the badge pill's own *-bg so the badge never
     blends invisibly into a card tinted the exact same colour. */
  --overdue-card-bg: #fef3ec;
  --rejected-card-bg: #f9f2fa;
  --declined-card-bg: #fdf2f2;
  --green-card-bg: #f3faf6;
  /* Warning callouts (e.g. "make sure before marking done") — consolidates
     what onboarding-note hardcoded so every warning box matches. */
  --warn-bg: #fdf3dc;
  --warn-border: #f0dfa0;
  --warn-text: #7a5f00;
  /* Danger callouts for permanent/irreversible actions — tied to the brand
     red family instead of an unrelated pure red. */
  --danger-bg: #fbe4e2;
  --danger-border: #e8b4ae;
  --danger-text: #83141f;
  --radius: 5px;
  --topbar-h: 58px;
}

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

html, body { height: 100%; }

body {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

h1, h2, h3 { font-weight: 600; }

a { color: var(--red); }

/* ---------------- Logo ---------------- */

.su-emblem { flex-shrink: 0; display: block; }
.su-emblem-sm { flex-shrink: 0; display: block; }
.login-logo { border-radius: 50%; object-fit: cover; }

/* Header brand mark: the plain circle+"SU" glyph reads fine at desktop
   size, but on a phone-width header the real university logo looks far
   less placeholder-ish in the same small space — swapped in purely by
   viewport width, same element position either way. */
.brand-logo-mobile { display: none; flex-shrink: 0; border-radius: 50%; object-fit: cover; }
@media (max-width: 560px) {
  .brand-emblem-desktop { display: none; }
  .brand-logo-mobile { display: block; }
}

/* keep old class in case anything still references it */
.logo-mark {
  width: 44px; height: 44px;
  background: var(--red); color: #fff;
  font-weight: 700; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; flex-shrink: 0;
}
.logo-mark-sm { width: 36px; height: 36px; font-size: 14px; }

/* ---------------- Login ---------------- */

.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--bg);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--red);
  border-radius: var(--radius);
  padding: 32px 28px 24px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.login-university { font-size: 19px; font-weight: 700; color: var(--red-dark); }
.login-sub-2 { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.login-sub { font-size: 12.5px; color: var(--text-2); margin-top: 3px; }

/* Trust signal — a bank-grade "shield verified" mark, never a blocker.
   Present on every login step since it lives in .login-brand, outside the
   swapped .auth-step panels. */
.login-secure-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
  padding: 4px 11px 4px 9px;
  border-radius: 999px;
  background: linear-gradient(180deg, #F2FBF6, #E7F6EE);
  border: 1px solid #cbe7d6;
  color: #157347;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .45px;
  text-transform: uppercase;
  box-shadow: 0 1px 2px rgba(21, 115, 71, .08);
}
.login-secure-badge svg { flex-shrink: 0; }
.login-secure-badge span { white-space: nowrap; }
.login-secure-sep {
  width: 1px;
  height: 11px;
  background: #cbe7d6;
  flex-shrink: 0;
}
.login-secure-sub {
  font-weight: 600;
  color: #3f8f68;
  letter-spacing: .35px;
}
/* Narrow phones: keep the badge on one clean line by dropping the detail
   segment — the shield + "Secured Sign-In" is the part that matters. */
@media (max-width: 560px) {
  .login-secure-sep, .login-secure-sub { display: none; }
}

.login-note {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
}

.login-footer { margin-top: 18px; font-size: 12px; color: var(--text-3); }

/* Forgot/reset-password steps — swapped in-body within the login card
   instead of a popup modal, so the flow reads as part of the same page. */
.auth-step { animation: authStepIn .2s ease; }
@keyframes authStepIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.auth-back-link {
  display: inline-block;
  background: none;
  border: none;
  padding: 0;
  margin-bottom: 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--blue);
  cursor: pointer;
}
.auth-step-title { font-size: 17px; font-weight: 700; color: var(--red-dark); margin: 0 0 8px; }
.auth-step-desc { font-size: 13px; color: var(--text-2); line-height: 1.5; margin: 0 0 16px; }
.auth-step-desc-success { color: var(--green); }

/* ---------------- Forms ---------------- */

/* Base look for every <select> in the app, in or out of a .field wrapper —
   without this, a select left out of .field (the allocation-row percentage
   picker, the Mark as Paid status picker) falls back to the raw OS default
   box instead of matching every other input's theme. */
select {
  padding: 9px 11px;
  font-size: 14px;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  cursor: pointer;
}
select:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(166, 25, 46, 0.12);
}

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 9px 11px;
  font-size: 14px;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
}

.field textarea { resize: vertical; min-height: 80px; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(166, 25, 46, 0.12);
}

.field-row { display: flex; gap: 14px; }
.field-row .field { flex: 1; }

/* Password input with an eye toggle sitting inside its right edge, and an
   optional inline "Generate" action to its left — used on Add/Edit Officer
   and Add Admin. */
.password-field-wrap { position: relative; display: flex; align-items: center; gap: 8px; }
.password-field-wrap input { flex: 1; padding-right: 38px; }
.password-eye-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}
.password-eye-btn:hover { background: var(--surface-2, #f1f0ea); }
.password-eye-btn svg { width: 18px; height: 18px; }

/* Gmail-style chip input for To/Cc/Bcc — a bordered box holding removable
   name pills plus an inline text field for typing the next one, with a
   directory-search suggestion dropdown anchored beneath it. */
.chip-field {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 36px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}
.chip-field:focus-within {
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(166, 25, 46, 0.12);
}
/* Momentary feedback when Enter/comma/blur is hit on text that isn't a
   real address — no chip gets created, this just flags why. */
.chip-field-invalid {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 2px rgba(166, 25, 46, 0.25);
}
.chip-list { display: contents; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--red-pale);
  color: var(--red-dark);
  border-radius: 999px;
  padding: 3px 6px 3px 3px;
  font-size: 13px;
  font-weight: 500;
  max-width: 100%;
  transition: background 0.12s ease;
}
.chip:hover { background: #f4d9dd; }
.chip-avatar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.chip-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.chip-remove {
  background: none;
  border: none;
  color: var(--red-dark);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 50%;
}
.chip-remove:hover { background: rgba(166, 25, 46, 0.2); }
.chip-input {
  flex: 1 1 120px;
  min-width: 120px;
  border: none;
  outline: none;
  font-size: 14px;
  font-family: inherit;
  padding: 4px;
  color: var(--text);
  background: transparent;
}

.recipient-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 20px rgba(15, 23, 32, 0.14);
  z-index: 60;
  overflow: hidden;
}
.recipient-suggestion {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
}
.recipient-suggestion:hover { background: var(--red-pale); }
.recipient-suggestion + .recipient-suggestion { border-top: 1px solid var(--border); }
.recipient-suggestion .chip-avatar { width: 26px; height: 26px; font-size: 11px; }

.form-error {
  background: var(--red-pale);
  border: 1px solid #eccdd2;
  color: var(--red-dark);
  padding: 9px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  cursor: pointer;
}
.checkbox-line input { width: 15px; height: 15px; accent-color: var(--red); }

.check-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 160px;
  overflow-y: auto;
}
.check-list .checkbox-line {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.check-list .checkbox-line:last-child { border-bottom: none; }
.check-list-empty { padding: 10px 12px; color: var(--text-3); font-size: 13px; }

/* ---------------- Buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }

.btn-outline { background: #fff; color: var(--text); border-color: var(--border); }
.btn-outline:hover { background: var(--bg); }

.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #166535; }

.btn-danger-text { background: none; border: none; color: var(--red); font-weight: 600; cursor: pointer; font-size: 13px; padding: 4px 6px; font-family: inherit; }
.btn-danger-text:hover { text-decoration: underline; }
.btn-link { background: none; border: none; color: var(--blue); font-weight: 600; cursor: pointer; font-size: 13px; padding: 4px 6px; font-family: inherit; }
.btn-link:hover { text-decoration: underline; }

.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: default; }

/* Small circular "i" info button — top-right of a form, opens a popup
   explaining something about the form (e.g. the Email Template editor's
   {{variable}} placeholders) without cluttering the page with inline text. */
.info-btn {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, 'Times New Roman', serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.info-btn:hover { border-color: var(--red); color: var(--red); background: var(--red-pale); }

.var-help-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.var-help-list li { display: flex; align-items: baseline; gap: 10px; }
.var-help-list code {
  flex: 0 0 auto;
  background: var(--red-pale);
  color: var(--red-dark);
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.var-help-list span { font-size: 13px; color: var(--text-2); line-height: 1.4; }

/* ---------------- Topbar ---------------- */

.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 3px solid var(--red);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 8px;
  cursor: pointer;
  color: var(--text);
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; cursor: pointer; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 700; font-size: 15px; }
.brand-sub { font-size: 11.5px; color: var(--text-2); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }

.user-chip { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.user-name { font-weight: 600; font-size: 13px; }
.user-role { font-size: 11.5px; color: var(--text-2); }

/* Bell — recent-activity indicator, left of the avatar. The web topbar is a
   white surface, so the glyph is the theme's text colour (a white bell would
   vanish); the unread dot is brand red. */
.topbar-bell {
  position: relative;
  background: none;
  border: none;
  padding: 6px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.topbar-bell:hover { background: var(--bg, #f4f5f7); color: var(--text); }
.topbar-bell-dot {
  position: absolute;
  top: 4px; right: 5px;
  width: 9px; height: 9px;
  background: var(--red);
  border: 2px solid var(--surface);
  border-radius: 50%;
}

/* Avatar — the user's photo, or their initials on a red disc as a clean
   placeholder when no photo is set. */
.topbar-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--red) center/cover no-repeat;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
}

/* Profile page — normal header (avatar + name), no separate edit section.
   A small pencil badge sits on the avatar itself; tapping it (or the
   avatar) opens the photo sheet below instead. */
.profile-header { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.profile-avatar-btn {
  position: relative;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
  margin-bottom: 4px;
}
.profile-photo {
  width: 110px; height: 110px;
  border-radius: 50%;
  border: 3px solid var(--red-pale, #FBEEF0);
  background: var(--red) center/cover no-repeat;
  color: #fff;
  font-weight: 700;
  font-size: 38px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.profile-avatar-pencil {
  position: absolute;
  bottom: -2px; right: -2px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  border: 2px solid var(--surface);
  display: flex; align-items: center; justify-content: center;
}
.profile-header-name { font-size: 17px; font-weight: 700; color: var(--text); }
.profile-header-sub { font-size: 13px; color: var(--text-3); margin-top: -4px; }
.profile-incomplete-note {
  display: flex; align-items: center; gap: 8px;
  background: var(--amber-pale, #FFF7E6);
  color: #8a6100;
  border: 1px solid #f0dfb8;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.45;
  margin-top: 6px;
}

/* WhatsApp-style photo sheet — big preview + plain bottom action buttons
   (rendered inside the shared modal), and the guideline list shown before
   the file picker opens. */
.profile-photo-big {
  width: 220px; height: 220px;
  max-width: 100%;
  border-radius: 50%;
  border: 3px solid var(--red-pale, #FBEEF0);
  background: var(--red) center/cover no-repeat;
  color: #fff;
  font-weight: 700;
  font-size: 72px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  margin: 4px auto 6px;
}
.photo-guidelines {
  margin: 0 0 4px;
  padding-left: 20px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-2);
}
/* Crop dialog — a light, square selection window (not a dark circular one)
   so the visible frame reads as exactly the square portion that gets saved. */
.crop-stage {
  position: relative;
  width: 100%; max-width: 320px;
  aspect-ratio: 1;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 12px;
  border: 2px solid var(--red);
  background: #eee;
  touch-action: none;
  cursor: grab;
}
.crop-stage:active { cursor: grabbing; }
.crop-stage img { position: absolute; transform-origin: 0 0; user-select: none; pointer-events: none; }
.crop-range { width: 100%; max-width: 320px; margin: 12px auto 0; display: block; }

/* ---------------- Layout ---------------- */

.layout { display: flex; height: calc(100vh - var(--topbar-h)); overflow: hidden; }
/* On mobile, 100vh doesn't shrink when the on-screen keyboard opens (only
   the visual viewport does), so .main's height — and therefore how far it
   can scroll a focused field into view — stayed pinned to the keyboard-
   covered height, leaving fields hidden underneath it. dvh tracks the
   actual visible area instead; browsers that don't support it (nothing
   current) simply ignore this line and keep the vh value above. */
@supports (height: 100dvh) {
  .layout { height: calc(100dvh - var(--topbar-h)); }
}

.sidebar {
  width: 220px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 16px 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar ul { list-style: none; flex: 1; }

.sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  border-left: 3px solid transparent;
}

.sidebar a svg { flex-shrink: 0; }

.sidebar a:hover { background: var(--bg); color: var(--text); }

.sidebar a.active {
  color: var(--red);
  border-left-color: var(--red);
  background: var(--red-pale);
  font-weight: 600;
}

.sidebar-foot {
  padding: 14px 20px 4px;
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.5;
  border-top: 1px solid var(--border);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: var(--topbar-h) 0 0 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 29;
}

.main {
  flex: 1;
  padding: 24px;
  min-width: 0;
  overflow-y: auto;
}

/* ---------------- Page header ---------------- */

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.page-title { font-size: 19px; }
.page-desc { font-size: 13px; color: var(--text-2); margin-top: 3px; }

/* ---------------- Cards / stats ---------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.card-pad { padding: 18px 20px; }

.card-title {
  font-size: 14px;
  font-weight: 600;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.stat-label { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.stat-value { font-size: 26px; font-weight: 700; margin-top: 4px; }

/* Dashboard quick-link cards (Tasks, Calendar, Users Management, etc.) —
   same .stat-card shell, but a clickable <a> with a description line
   instead of a big number. */
.quick-link-card { text-decoration: none; color: inherit; cursor: pointer; display: block; }
.quick-link-desc { font-size: 13px; color: var(--text-3); margin-top: 6px; line-height: 1.45; }
.stat-value.red { color: var(--red); }
.stat-value.green { color: var(--green); }
.stat-value.blue { color: var(--blue); }
.stat-value.amber { color: var(--amber); }

/* ---------------- Tables ---------------- */

.table-wrap { overflow-x: auto; }

/* Row-per-record list pages (Users Management, Interns, Officers, ...):
   cards on phones/tablets, the table once there's room — same pattern as
   .task-view-table/.task-view-cards, so a multi-column table never forces
   horizontal scrolling on a phone. Both views render from the same data;
   CSS alone decides which is visible, so resizing needs no re-fetch. */
.list-view-table { display: none; }
@media (min-width: 921px) {
  .list-view-cards { display: none; }
  .list-view-table { display: block; }
}
.list-card {
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(20,20,30,.08);
  padding: 13px 16px;
  cursor: pointer;
}
.list-card + .list-card { margin-top: 10px; }
.list-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.list-card-name { font-weight: 600; font-size: 14px; }
.list-card-sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; word-break: break-word; }
.list-card-badges { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.list-card-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; font-size: 12.5px; color: var(--text-2); }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

th, td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  white-space: nowrap;
}

td.wrap { white-space: normal; min-width: 200px; }

th {
  background: #f9fafb;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbfc; }

.cell-main { font-weight: 600; }
.cell-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; white-space: normal; }

#main.view-fade-in { animation: viewFadeIn .22s ease; }
@keyframes viewFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.empty-state {
  padding: 36px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 13.5px;
}

/* ---------------- Badges ---------------- */

.badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  white-space: nowrap;
}

.badge-pending { background: var(--amber-pale); color: var(--amber); }
.badge-submitted { background: var(--blue-pale); color: var(--blue); }
.badge-completed { background: var(--green-pale); color: var(--green); }
.badge-overdue { background: var(--overdue-bg); color: var(--overdue); }
.badge-rejected { background: var(--rejected-bg); color: var(--rejected); }
.badge-declined { background: var(--declined-bg); color: var(--declined); }
.badge-muted { background: #eef0f2; color: var(--text-2); }
.badge-unverified { background: var(--amber-pale); color: var(--amber); border: 1px dashed #d8b671; }
/* Document-not-submitted status pill — same visual language as the other
   status badges above rather than the old plain red/green inline text. */
.badge-doc-no { background: var(--red-pale); color: var(--red-dark); }

/* iOS-style toggle switch — used for the two-step verification setting. */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; cursor: pointer; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track {
  position: absolute; inset: 0;
  background: #cfd6dd; border-radius: 999px;
  transition: background .18s ease;
}
.switch-track::before {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: transform .18s ease;
}
.switch input:checked + .switch-track { background: var(--green, #1e8e5a); }
.switch input:checked + .switch-track::before { transform: translateX(20px); }
/* A flat opacity fade on the whole track washed the thumb and track toward
   the same pale value on this app's light background, so a disabled switch
   stopped reading as a switch at all. Keep both track and thumb at full
   opacity/contrast and only mute the checked color + show not-allowed. */
.switch input:disabled + .switch-track { cursor: not-allowed; }
.switch input:disabled:checked + .switch-track { background: #9fb7ac; }
.switch input:disabled + .switch-track::before { box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.switch:has(input:disabled) { cursor: not-allowed; }

/* Boolean form fields rendered as a toggle row: label on the left, the same
   .switch component from above on the right — used wherever an intern form
   used to show a plain checkbox (consent, NOC, joining report, offer
   letter, etc). Stacks the switch under the label on narrow screens, same
   breakpoint .field-row already collapses at. */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 0;
}
.toggle-row .toggle-label { font-size: 13.5px; font-weight: 600; color: var(--text); }
.toggle-row .switch input:checked + .switch-track { background: var(--red, #a6192e); }
@media (max-width: 560px) {
  .toggle-row { flex-wrap: wrap; }
}

.late-note { font-size: 11.5px; color: var(--red-dark); font-weight: 600; margin-top: 3px; }
.ontime-note { font-size: 11.5px; color: var(--green); font-weight: 600; margin-top: 3px; }

.doc-yes { color: var(--green); font-weight: 600; font-size: 12.5px; }
.doc-no { color: var(--red); font-weight: 600; font-size: 12.5px; }
/* Inline "Download form" affordance sitting right beside a Not-Submitted
   status, rather than a standalone full-width button below it — mirrors the
   small download icon on the Android profile's document rows. */
.btn-link-sm {
  background: none; border: none; padding: 0 0 0 6px;
  color: var(--blue); font-weight: 600; font-size: 12px;
  cursor: pointer; font-family: inherit; text-decoration: none;
}
.btn-link-sm:hover { text-decoration: underline; }

.origin-tag { font-size: 11.5px; color: var(--text-3); }
.origin-tag.self { color: var(--amber); font-weight: 600; }

/* ---------------- Filters ---------------- */

.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }

.filter-chip {
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
}

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

/* ---------------- Page-level sub-navigation (Workspace's Calendar/Emails/
   Schools, Emails' own Directory/Templates) ---------------- */
/* Underlined tabs, not pill/filter chips — chips read as "narrow this
   list down" (a data filter); these switch between entire sub-pages, which
   needed a visually distinct, more conventional tab bar instead of two
   stacked rows of pills that read as duplicate filter bars. */
.page-tabs {
  display: flex;
  gap: 22px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  overflow-x: auto;
}
.page-tabs + .page-tabs { margin-top: -8px; }
.page-tabs button {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 10px 1px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}
.page-tabs button:hover { color: var(--text); }
.page-tabs button.active { color: var(--red); border-bottom-color: var(--red); }

/* ---------------- Sessions ---------------- */

.session-row { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.session-row:last-child { border-bottom: none; }
.session-icon {
  width: 38px; height: 38px; border-radius: var(--radius);
  background: var(--bg); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; color: var(--text-2); flex-shrink: 0;
}
.session-info { flex: 1; min-width: 0; }
.session-device { font-weight: 600; font-size: 13.5px; }
.session-meta { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.session-current { font-size: 11.5px; color: var(--green); font-weight: 700; }

/* ---------------- Modal ---------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 32, 0.45);
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%;
  max-width: 540px;
  border-top: 4px solid var(--red);
}

/* The approval-email composer's form (To/Cc/Bcc, template, subject, a
   multi-line message, attachments) is much richer than every other modal in
   the app — the shared 540px width cramps it, so it gets more room. */
.modal-wide { max-width: 760px; }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
}

.modal-title { font-size: 15.5px; font-weight: 600; }

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-3);
  padding: 4px;
}
.modal-close:hover { color: var(--text); }

.modal-body { padding: 20px 22px; }

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: #fafbfc;
  border-radius: 0 0 var(--radius) var(--radius);
}

/* ---------------- Toast ---------------- */

#toast-root {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: #1f2933;
  color: #fff;
  padding: 11px 18px;
  border-radius: var(--radius);
  font-size: 13.5px;
  max-width: 340px;
}
.toast.error { background: var(--red-dark); }

/* ---------------- Calendar ---------------- */

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.cal-month { font-size: 15px; font-weight: 600; }
.cal-nav { display: flex; gap: 8px; }

.cal-grid-wrap { overflow-x: auto; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  min-width: 640px;
}

.cal-dow {
  padding: 8px 6px;
  text-align: center;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: #f9fafb;
  border-bottom: 1px solid var(--border);
}

.cal-cell {
  min-height: 88px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 6px;
  font-size: 12px;
  cursor: default;
}
.cal-cell:nth-child(7n) { border-right: none; }

.cal-cell.has-tasks { cursor: pointer; }
.cal-cell.has-tasks:hover { background: #fafbfc; }
.cal-cell.other { background: #fafbfc; color: var(--text-3); }
.cal-cell.selected { outline: 2px solid var(--red); outline-offset: -2px; }

.cal-daynum {
  font-weight: 600;
  font-size: 12px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-bottom: 4px;
}
.cal-cell.today .cal-daynum { background: var(--red); color: #fff; }

.cal-chip {
  display: block;
  background: var(--red-pale);
  color: var(--red-dark);
  border-left: 3px solid var(--red);
  border-radius: 3px;
  padding: 2px 6px;
  margin-bottom: 3px;
  font-size: 11px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-more { font-size: 11px; color: var(--text-2); font-weight: 600; }

.cal-day-detail { border-top: 1px solid var(--border); }

/* The grid's 640px min-width (needed so 7 columns stay readable on desktop)
   forced horizontal scrolling to see the whole week on a phone — shrink
   everything instead of scrolling, so the full month fits the screen. */
@media (max-width: 560px) {
  .cal-head { padding: 10px 12px; flex-wrap: wrap; gap: 8px; }
  .cal-nav { gap: 5px; }
  .cal-nav .btn { padding: 5px 8px; font-size: 11px; }
  .cal-grid-wrap { overflow-x: visible; }
  .cal-grid { min-width: 0; }
  .cal-dow { padding: 5px 2px; font-size: 9.5px; }
  .cal-cell { min-height: 52px; padding: 3px; font-size: 10px; }
  .cal-daynum { width: 18px; height: 18px; font-size: 10.5px; margin-bottom: 2px; }
  .cal-chip { font-size: 8.5px; padding: 1px 3px; margin-bottom: 2px; }
  .cal-more { font-size: 9px; }
}

/* ---------------- Dashboard extras ---------------- */

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.info-list { list-style: none; }
.info-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.info-list li:last-child { border-bottom: none; }
/* A fixed label column with the value following right after it — value
   used to be pushed to the row's far right edge (justify-content:
   space-between), which read as visually disconnected from its own label
   once these rows sat inside a full-width card instead of a narrow one. */
.info-list .k { flex: 0 0 130px; color: var(--text-2); font-size: 13px; }
.info-list .v { font-weight: 600; text-align: left; color: var(--text); }

/* Detail pages no longer wrap this in a bordered .card (see .detail-grid
   .card above) — flush the rows to the same left edge as the section
   title instead of keeping the inset that a boxed container needed. */
.detail-grid .info-list li { padding: 11px 0; }

/* ---------------- Responsive ---------------- */

@media (max-width: 920px) {
  .menu-btn { display: inline-flex; }

  .sidebar {
    position: fixed;
    top: var(--topbar-h);
    bottom: 0;
    left: 0;
    z-index: 30;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }

  .main { padding: 16px; }
  .two-col { grid-template-columns: 1fr; }
  .brand-sub { display: none; }
}

@media (max-width: 560px) {
  /* The user's name/role and the Sign Out button crowded the header on a
     phone-width screen — the avatar (still shown) already opens the
     Profile page, which has its own "Sign Out" action on the current
     session, so nothing is lost by dropping these here. */
  .user-chip { display: none; }
  #logout-btn { display: none; }
  .brand-name { font-size: 13.5px; }
  .field-row { flex-direction: column; gap: 0; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .page-head .btn { width: 100%; }
  .modal-backdrop { padding: 16px 10px; }
}

/* =============================================================
   Design system additions — breadcrumb, detail pages, onboarding
   badge, compact tables, popover-style edit controls.
   Reused across every list/detail view for a consistent look.
   ============================================================= */

/* ---------------- Breadcrumb (file-explorer style path) ---------------- */

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 10px;
}

.breadcrumb a {
  color: var(--text-2);
  text-decoration: none;
  font-weight: 600;
  padding: 2px 4px;
  border-radius: 3px;
}
.breadcrumb a:hover { background: var(--bg); color: var(--red); }

.breadcrumb .crumb-sep { color: var(--text-3); }
.breadcrumb .crumb-current { color: var(--text); font-weight: 600; padding: 2px 4px; }
.breadcrumb .crumb-icon { display: inline-flex; color: var(--text-3); }

/* ---------------- Compact / clickable list tables ---------------- */

.row-link { cursor: pointer; }
.row-link:hover { background: var(--red-pale) !important; }

.table-compact th, .table-compact td { white-space: nowrap; }
.table-compact td.wrap { white-space: normal; }

.col-actions { white-space: nowrap; text-align: right; }

/* Fixed row height regardless of content length — a one-word title and a
   two-line description both take up exactly the same row, so the table
   reads as an even grid instead of rows visibly resizing per task. */
.table-compact tbody tr { height: 58px; }
.table-compact td { vertical-align: middle; }

/* Truncates to a single line with an ellipsis instead of wrapping or
   stretching the column — this, combined with the fixed row height above,
   is what keeps every row the same size and stops any one long value (a
   long description, a long list of intern names) from forcing the whole
   table into horizontal scroll. */
.cell-clamp {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: nowrap;
}

/* ---------------- Detail page ---------------- */

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.detail-identity { display: flex; align-items: center; gap: 14px; }

.detail-avatar {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  background: var(--red-pale);
  color: var(--red-dark);
  font-weight: 700;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.detail-name-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-name { font-size: 19px; font-weight: 700; }
.detail-sub { font-size: 13px; color: var(--text-2); margin-top: 2px; }

.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.tmpl-list { display: flex; flex-direction: column; gap: 10px; }
.tmpl-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.tmpl-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* Floating Send/Edit actions — bottom-right of the viewport, not tucked into
   the page-head/breadcrumb row, and bigger than any other icon on the page. */
.fab-stack {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: flex;
  flex-direction: column-reverse;
  gap: 14px;
  z-index: 40;
}
.fab-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  box-shadow: 0 6px 16px rgba(15, 23, 32, 0.28);
  transition: transform 0.12s ease;
}
.fab-btn:hover { transform: translateY(-2px); }
.fab-btn svg { width: 26px; height: 26px; }
.fab-send { background: var(--red); }
.fab-edit { background: var(--blue); width: 48px; height: 48px; }
.fab-edit svg { width: 22px; height: 22px; }
.fab-delete { background: var(--red-dark); width: 48px; height: 48px; }
.fab-delete svg { width: 21px; height: 21px; }
@media (max-width: 700px) {
  .fab-stack { right: 16px; bottom: 16px; }
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px 40px;
  max-width: 1100px;
}

/* Plain content, not a bordered/shadowed panel — the section title's own
   bottom rule is the only separator each column needs. */
.detail-grid .card {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.detail-section-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--text-2);
  padding: 0 0 9px;
  margin-bottom: 2px;
  border-bottom: 1px solid var(--border);
}

.detail-section-title::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--red);
  margin-right: 8px;
  vertical-align: middle;
}

/* A detail-grid column that stacks two flush sections on top of each other
   (e.g. Contact + Documents) instead of one — used where a page has more
   sections than fit evenly as single-section columns, so pairing keeps
   both columns' total row-count close and their bottom edges roughly level. */
.detail-col { display: flex; flex-direction: column; }
.detail-col .detail-subcard { margin-top: 20px; }

/* ---------------- Task compact cards ---------------- */

.task-card-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  align-items: start;
}

/* Cards on phones/tablets, a proper table once there's room for one — same
   data in both, switched purely by viewport width so resizing needs no
   re-fetch (see renderTaskListBody in tasks.js, which populates both). */
.task-view-table { display: none; }
@media (min-width: 921px) {
  .task-view-cards { display: none; }
  .task-view-table { display: block; }
}

.task-compact-card {
  background: var(--surface);
  border-radius: 14px;
  border: none;
  border-left: 4px solid transparent; /* colour set inline per-card by JS */
  box-shadow: 0 1px 3px rgba(20,20,30,.08);
  padding: 13px 16px;
  transition: box-shadow .15s, transform .1s;
  user-select: none;
}
.task-compact-card:hover {
  box-shadow: 0 6px 16px rgba(20,20,30,.12);
  transform: translateY(-1px);
}
/* Background reflects status at a glance — light yellow for overdue,
   purple for sent-back/rejected, green once fully completed. */
.task-card-overdue { background: var(--overdue-card-bg); }
.task-card-rejected { background: var(--rejected-card-bg); }
.task-card-declined { background: var(--declined-card-bg); }
.task-card-completed { background: var(--green-card-bg); }

.task-card-desc {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-3);
  margin: 4px 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-card-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 2px;
}

.task-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.task-card-divider {
  border: none;
  border-top: 1px solid rgba(20,20,30,.07);
  margin: 9px 0;
}

.task-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-3);
  flex-wrap: wrap;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Extra button variants used in task views */
.btn-danger { background: var(--red); color: #fff; border: 1px solid var(--red); }
.btn-danger:hover { background: #8b1220; }
.btn-danger-outline { background: none; color: var(--red); border: 1px solid var(--red); }
.btn-danger-outline:hover { background: var(--red-pale); }

/* ---------------- Onboarding status ---------------- */

.badge-onboarding { background: #fff7d6; color: #8a6d00; border: 1px dashed #e0c04d; }

.onboarding-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  color: var(--warn-text);
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 16px;
}

.onboarding-note svg { flex-shrink: 0; margin-top: 2px; }

/* ---------------- Icon buttons (used for row-level edit actions) ---------------- */

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-2);
  cursor: pointer;
}
.icon-btn:hover { background: var(--bg); color: var(--red); border-color: var(--red); }

/* ---------------- Read-only status pill row in tables (stipend etc.) ---------------- */

.status-cell { display: flex; align-items: center; gap: 8px; }

/* ---------------- Disabled checklist row (e.g. onboarding incomplete) ---------------- */

.checkbox-line.disabled { opacity: 0.5; cursor: not-allowed; }
.checkbox-line.disabled input { cursor: not-allowed; }

@media (max-width: 700px) {
  .detail-head { flex-direction: column; }
  .detail-actions { width: 100%; }
  .detail-actions .btn { flex: 1; }
}

/* ============================================================
   Stipend — batch workflow (Summary / Issue Stipend tabs,
   wizard modals, batch detail, intern payment record).
   Mirrors the Android app's stipend screens.
   ============================================================ */

/* Headline figure tiles — the web twin of Android's StipendTotalTile. */
.stipend-tiles { display: flex; gap: 10px; flex-wrap: wrap; }
.stipend-tile { flex: 1 1 150px; border-radius: 12px; padding: 12px 14px; }
.stipend-tile-label { font-size: 11px; }
.stipend-tile-value { font-size: 19px; font-weight: 700; margin-top: 2px; }
.stipend-tile-sub { font-size: 10.5px; opacity: 0.75; }
.stipend-tile-green    { background: var(--green-pale); color: var(--green); }
.stipend-tile-amber    { background: var(--amber-pale); color: var(--amber); }
.stipend-tile-rejected { background: var(--rejected-bg); color: var(--rejected); }
.stipend-tile-plain    { background: #f4f6f8; color: var(--text); }

/* Issued-month cards */
.batch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.batch-card { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.batch-card:hover { border-color: var(--red); box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.batch-card-head { display: flex; align-items: center; justify-content: space-between; }
.batch-card-month { font-size: 15px; font-weight: 700; }

/* Wizard: month navigator */
.month-nav { display: flex; align-items: center; justify-content: center; gap: 18px; }
.month-nav-label { text-align: center; min-width: 130px; }
.month-nav-month { font-size: 20px; font-weight: 700; }

/* Wizard: eligible-intern list. Scrolls inside the modal so the footer
   buttons stay reachable however many interns qualify. */
.elig-list { max-height: 320px; overflow-y: auto; margin-top: 6px; border: 1px solid var(--border); border-radius: var(--radius); }
.elig-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-bottom: 1px solid var(--border-light, #eee); }
.elig-row:last-child { border-bottom: none; }
.elig-right { display: flex; align-items: center; gap: 10px; }
.elig-count { font-size: 12px; font-weight: 600; color: var(--text-2); }
.elig-count.ok { color: var(--green); }
/* Fixed width so the tick column doesn't shift rows that don't qualify. */
.elig-tick { width: 16px; text-align: center; color: var(--green); font-weight: 700; }
.zero-toggle { width: 100%; background: #f7f8f9; border: none; border-top: 1px solid var(--border);
  padding: 10px 12px; font-size: 12.5px; font-weight: 600; color: var(--text-2); cursor: pointer; text-align: left; }

/* Wizard / edit: per-intern allocation card. The percentage select takes the
   row and the amount box only what a rupee figure needs — same proportions as
   the Android card. */
.alloc-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.alloc-rate { display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid var(--border-light, #eee); margin-top: 8px; padding-top: 8px; font-size: 11.5px; color: var(--text-2); }
.alloc-controls { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.alloc-controls select { flex: 1; }
.alloc-amount, .alloc-amount-box { width: 120px; flex: 0 0 120px; }
.alloc-amount-box { background: var(--green-pale); color: var(--green); font-weight: 700;
  border-radius: 8px; padding: 9px 10px; text-align: center; font-size: 14px; }

.wz-footnote { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 13.5px; }
.confirm-payout { text-align: center; padding: 6px 0 14px; }
.confirm-amount { font-size: 30px; font-weight: 700; color: var(--green); margin: 4px 0 10px; }
.mark-select { min-width: 120px; }

/* Intern's own record */
.hero-amount { font-size: 32px; font-weight: 700; color: var(--green); margin-top: 2px; }
.stipend-stat-row { display: flex; gap: 16px; flex-wrap: wrap; }
.stipend-stat-row > div { flex: 1 1 120px; }
.stat-val { font-size: 14px; font-weight: 700; margin-top: 2px; }

/* Bar chart. Scrolls horizontally rather than squeezing bars to hairlines
   once an internship runs many months — same call as the Android chart. */
.stipend-chart { display: flex; gap: 10px; align-items: flex-end; height: 190px;
  margin-top: 14px; overflow-x: auto; padding-bottom: 4px; }
.chart-col { flex: 0 0 42px; display: flex; flex-direction: column; align-items: center; height: 100%; }
.chart-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.chart-bar { width: 22px; background: var(--green); border-radius: 4px 4px 0 0; min-height: 3px; }
.chart-bar.partial { background: var(--amber); }
.chart-x { font-size: 9.5px; color: var(--text-2); text-align: center; line-height: 1.25; margin-top: 6px; }

@media (max-width: 700px) {
  .alloc-controls { flex-wrap: wrap; }
  .alloc-amount, .alloc-amount-box { width: 100%; flex: 1 1 100%; }
}

@media (max-width: 560px) {
  .field-row { flex-direction: column; gap: 0; }
}

.field .chip-field .chip-input,
.field .chip-field .chip-input:focus {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 4px 6px !important;
  width: auto !important;
}

