/* Palette inspired by Batangas State University branding (maroon + gold). */
:root {
  --maroon-dark: #3a0d14;
  --maroon: #7a1128;
  --maroon-light: #fbeef0;
  --gold: #d4a017;
  --gold-dark: #a97b0d;
  --ink: #241b1c;
  --muted: #6c5b5c;
  --border: #e8dcdb;
  --bg: #faf6f3;
  --white: #ffffff;
  --danger: #b3261e;
  --danger-bg: #fdecea;
  --success: #1e7a4c;
  --success-bg: #e9f7ef;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--maroon); text-decoration: none; }
a:hover { text-decoration: underline; }

.auth-shell {
  min-height: 100vh;
  display: flex;
}

.auth-illustration {
  flex: 1 1 46%;
  max-width: 560px;
  background:
    radial-gradient(circle at 85% 12%, rgba(212,160,23,.16), transparent 42%),
    radial-gradient(rgba(255,255,255,.09) 1.4px, transparent 1.4px) 0 0/22px 22px,
    linear-gradient(160deg, var(--maroon-dark), #260810 75%);
  color: #fff;
  padding: 52px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth-illustration .brand { margin-bottom: 40px; }
.auth-illustration .brand .name { color: #fff; }
.auth-illustration .brand .name small { color: #d9b8bd; }
.auth-illustration .name-lg { font-size: 22px; }
.mark-lg { width: 56px; height: 56px; }

.illustration-headline {
  color: #fff;
  font-size: 27px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 14px;
  max-width: 400px;
}
.illustration-lede {
  color: #e9d3d6;
  font-size: 14.5px;
  line-height: 1.6;
  margin: 0 0 32px;
  max-width: 380px;
}

.feature-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; max-width: 380px; }
.feature-list li { display: flex; align-items: flex-start; gap: 12px; font-size: 14px; color: #f3e3e5; line-height: 1.5; }
.feature-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--maroon-dark);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.institution-line-dark { color: #c9a1a6; border-bottom: none; padding-bottom: 0; margin: 0; }

.auth-form-side {
  flex: 1 1 54%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(58, 13, 20, 0.08);
  padding: 40px 36px;
}

.auth-card-brand { display: none; }

@media (max-width: 900px) {
  .auth-illustration { display: none; }
  .auth-card-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
  }
  .auth-card-brand .mark { width: 36px; height: 36px; }
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.public-shell { min-height: 100vh; display: flex; flex-direction: column; }
.public-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 40px; border-bottom: 1px solid var(--border); background: var(--white); position: sticky; top: 0; z-index: 30; }
.public-main { flex: 1; max-width: 1100px; width: 100%; margin: 0 auto; padding: 32px 24px; }

.error-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.error-card { width: 100%; max-width: 440px; background: var(--white); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 10px 30px rgba(58, 13, 20, 0.08); padding: 40px 36px; text-align: center; }
.error-card .brand { flex-direction: column; margin-bottom: 20px; }
.error-card .brand .name small { display: block; }
.error-code { font-size: 15px; font-weight: 700; letter-spacing: .08em; color: var(--gold-dark); margin-bottom: 6px; }
.error-title { font-size: 22px; font-weight: 700; color: var(--maroon-dark); margin: 0 0 10px; }
.error-message { font-size: 14px; color: var(--muted); line-height: 1.6; margin: 0 0 26px; }
.error-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.brand .mark {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
}

.brand .name { font-weight: 700; font-size: 18px; color: var(--maroon-dark); }
.brand .name small { display: block; font-weight: 400; font-size: 11px; color: var(--muted); letter-spacing: .04em; }

.institution-line {
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  letter-spacing: .02em;
}

h1.title { font-size: 20px; margin: 0 0 4px; color: var(--maroon-dark); }
p.subtitle { margin: 0 0 22px; color: var(--muted); font-size: 13.5px; }

.tabs { display: flex; gap: 6px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 4px; margin-bottom: 22px; }
.tabs button, .tabs a { flex: 1; text-align: center; border: none; background: transparent; padding: 9px 10px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; text-decoration: none; }
.tabs button.active, .tabs a.active { background: var(--white); color: var(--maroon-dark); box-shadow: 0 1px 3px rgba(58,13,20,.12); }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--maroon-dark); margin-bottom: 6px; }
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--white);
  color: var(--ink);
  font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--maroon);
  box-shadow: 0 0 0 3px rgba(122,17,40,.12);
}
.field .error { color: var(--danger); font-size: 12px; margin-top: 5px; }

.radio-row { display: flex; gap: 10px; }
.radio-card {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 13px;
}
.radio-card input { width: auto; margin-right: 6px; }
.radio-card.checked { border-color: var(--maroon); background: var(--maroon-light); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 11px 16px;
  border-radius: 8px;
  border: none;
  background: var(--maroon);
  color: #fff;
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
}
.btn:hover { background: var(--maroon-dark); }
.btn.secondary { background: var(--white); color: var(--maroon-dark); border: 1px solid var(--border); }
.btn.secondary:hover { background: var(--maroon-light); }
.btn.gold { background: var(--gold); color: var(--maroon-dark); }
.btn.gold:hover { background: var(--gold-dark); color: #fff; }

.foot-link { text-align: center; margin-top: 18px; font-size: 13px; color: var(--muted); }

.alert { padding: 11px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 18px; }
.alert.error { background: var(--danger-bg); color: var(--danger); border: 1px solid #f3c8c4; }
.alert.success { background: var(--success-bg); color: var(--success); border: 1px solid #bfe3cd; }

fieldset { border: none; padding: 0; margin: 0; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* App shell (post-login) */
.app-shell { display: flex; height: 100vh; }
.sidebar { width: 240px; height: 100vh; overflow-y: auto; background: linear-gradient(180deg, var(--maroon-dark), #260810); color: #fff; padding: 22px 16px; flex-shrink: 0; display: flex; flex-direction: column; transition: width .15s ease, padding .15s ease; }
.sidebar .brand .name { color: #fff; }
.sidebar .brand .name small { color: #d9b8bd; }

.sidebar-toggle { margin-left: auto; background: transparent; border: 1px solid rgba(255,255,255,.25); color: #fff; border-radius: 8px; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.sidebar-toggle:hover { background: rgba(255,255,255,.1); }

.collapsed-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -32px -40px 28px;
  padding: 14px 40px;
  background: linear-gradient(180deg, var(--maroon-dark), #260810);
  color: #fff;
  position: sticky;
  top: -32px; /* cancels .main's own padding-top, which is where sticky's "top: 0" is anchored */
  z-index: 30;
}
.collapsed-header-left { display: flex; align-items: center; gap: 12px; }
.collapsed-header-toggle { background: transparent; border: 1px solid rgba(255,255,255,.25); color: #fff; border-radius: 8px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.collapsed-header-toggle:hover { background: rgba(255,255,255,.1); }
.collapsed-header-mark { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.collapsed-header-brand { font-weight: 600; letter-spacing: .02em; }
.collapsed-header-right { display: flex; align-items: center; gap: 18px; font-size: 13px; }
.collapsed-header-notif { position: relative; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.1); color: #fff; }
.collapsed-header-notif:hover { background: rgba(255,255,255,.2); text-decoration: none; }
.collapsed-header-notif-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--maroon-dark);
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  animation: badgePop .4s cubic-bezier(.34,1.56,.64,1) both;
}
.collapsed-header-right a { color: #fff; }
.collapsed-header-right a:hover { text-decoration: underline; }
.collapsed-header-right form { margin: 0; }
.collapsed-header-right button { background: transparent; border: 1px solid rgba(255,255,255,.25); color: #fff; padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.collapsed-header-right button:hover { background: rgba(255,255,255,.1); }

body.sidebar-collapsed .app-shell .sidebar { width: 0; padding-left: 0; padding-right: 0; overflow: hidden; border: none; }
body.sidebar-collapsed .collapsed-header { display: flex; }
body.sidebar-collapsed .main > :not(.collapsed-header) { max-width: 1100px; margin-left: auto; margin-right: auto; }
.sidebar .institution-line { color: #d9b8bd; border-bottom-color: rgba(255,255,255,.14); }
.role-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 14px;
}
.role-card-icon {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--gold);
  color: var(--maroon-dark);
  display: flex;
  align-items: center;
  justify-content: center;
}
.role-card-title { font-size: 13.5px; font-weight: 700; color: #fff; }
.role-card-sub { font-size: 11px; color: #d9b8bd; }

.role-switch { margin-top: 18px; display: flex; flex-direction: column; gap: 6px; }
.role-switch form button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid rgba(255,255,255,.16);
  color: #e9d3d6;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 12.5px;
  cursor: pointer;
  display: block;
}
.role-switch form button:hover { background: rgba(255,255,255,.08); }
.role-switch form button.active { background: var(--gold); color: var(--maroon-dark); border-color: var(--gold); font-weight: 600; }

.nav-list { display: flex; flex-direction: column; gap: 3px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  color: #e9d3d6;
  font-size: 13px;
  text-decoration: none;
}
.nav-link svg { flex-shrink: 0; opacity: .8; }
.nav-link:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.nav-link.active { background: var(--gold); color: var(--maroon-dark); font-weight: 600; }
.nav-link.active svg { opacity: 1; }
.sidebar .logout { margin-top: auto; padding-top: 28px; }
.sidebar .logout button { background: transparent; border: 1px solid rgba(255,255,255,.16); color: #e9d3d6; width: 100%; padding: 9px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.sidebar .logout button:hover { background: rgba(255,255,255,.08); }

.main { flex: 1; padding: 32px 40px; height: 100vh; overflow-y: auto; }
.main h1 { color: var(--maroon-dark); margin-top: 0; }
.card { background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 22px; margin-bottom: 18px; }
.card strong { color: var(--maroon-dark); }
.muted { color: var(--muted); }
code.copy { background: var(--maroon-light); color: var(--maroon-dark); padding: 2px 7px; border-radius: 5px; font-size: 13px; }

.nav-section-label { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #b98790; margin: 18px 0 6px; padding: 0 10px; }

.data-table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; margin: 1px 2px 1px 0; }
.badge-role { background: var(--maroon-light); color: var(--maroon-dark); }
.badge-active { background: var(--success-bg); color: var(--success); }
.badge-inactive { background: var(--danger-bg); color: var(--danger); }
.badge-draft { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.badge-in-review { background: #fdf1d9; color: var(--gold-dark); }
.badge-needs-you { background: var(--maroon-light); color: var(--maroon); }
.badge-dot { display: inline-block; width: 6px; height: 6px; border-radius: 999px; background: currentColor; margin-right: 5px; vertical-align: middle; }
.badge-lg { font-size: 12.5px; padding: 5px 14px; }

.kv-list { margin-top: 14px; }
.kv-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.kv-row:last-child { border-bottom: none; }
.kv-row-right { display: flex; align-items: center; gap: 12px; }
.kv-subheader { margin: 22px 0 2px; font-size: 14.5px; color: var(--maroon-dark); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.stat-tile { background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.stat-tile .num { font-size: 26px; font-weight: 700; color: var(--maroon-dark); }
.stat-tile .lbl { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat-tile-label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.stat-tile-value { margin-top: 10px; }
.stat-tile-caption { font-size: 12.5px; color: var(--muted); margin-top: 8px; }

.two-col-grid-wide { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: stretch; }
@media (max-width: 860px) { .two-col-grid-wide { grid-template-columns: 1fr; } }

.queue-card { display: flex; flex-direction: column; }
.queue-card .data-table-wrap { flex: 1; display: flex; flex-direction: column; }
.queue-card .data-table-wrap .empty-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }

.workflow-stepper { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 16px; }
.workflow-step { display: flex; flex-direction: column; align-items: center; gap: 7px; width: 74px; text-align: center; }
.workflow-step-circle { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.workflow-step.done .workflow-step-circle { background: var(--success-bg); color: var(--success); border-color: #bfe3cd; }
.workflow-step.current .workflow-step-circle { background: var(--gold); color: var(--maroon-dark); border-color: var(--gold); }
.workflow-step-label { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.workflow-step.done .workflow-step-label, .workflow-step.current .workflow-step-label { color: var(--maroon-dark); }

.notification-item { padding: 10px 0; border-bottom: 1px dashed var(--border); }
.notification-item:last-child { border-bottom: none; }
.notification-item .msg { font-size: 13px; font-weight: 500; color: var(--muted); line-height: 1.4; }
.notification-item.unread .msg { font-weight: 600; color: var(--ink); }
.notification-item .when { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

.unread-badge { display: inline-block; background: var(--gold); color: var(--maroon-dark); font-size: 10.5px; font-weight: 700; border-radius: 999px; padding: 1px 7px; margin-left: 6px; vertical-align: middle; animation: badgePop .4s cubic-bezier(.34,1.56,.64,1) both; }

.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.bar-row .bar-label { width: 130px; flex-shrink: 0; color: var(--ink); }
.bar-row .bar-track { flex: 1; background: var(--bg); border-radius: 999px; height: 10px; overflow: hidden; }
.bar-row .bar-fill { background: var(--maroon); height: 100%; border-radius: 999px; }
.bar-row .bar-count { width: 30px; text-align: right; flex-shrink: 0; color: var(--muted); font-size: 12px; }

.search-form { display: flex; gap: 8px; margin-bottom: 18px; max-width: 360px; }
.search-form input { flex: 1; }
.search-form .field { margin-bottom: 0; flex: 1; }

.page-header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 22px; }
.page-header-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--maroon-dark), var(--maroon));
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
}
.page-header h1 { margin: 0; line-height: 1.25; }
.page-header p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }

/* Guest-facing repository hero — no logged-in equivalent, so it's the one
   place a first-time visitor forms an impression of the whole platform. */
.repo-hero {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  padding: 40px 36px;
  margin-bottom: 24px;
  color: #fff;
  background:
    radial-gradient(circle at 88% 6%, rgba(212,160,23,.3), transparent 45%),
    radial-gradient(rgba(255,255,255,.08) 1.4px, transparent 1.4px) 0 0/22px 22px,
    linear-gradient(145deg, var(--maroon-dark), var(--maroon) 68%, #5a1420);
}
.repo-hero-content { position: relative; max-width: 620px; }
.repo-hero-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); margin-bottom: 10px; }
.repo-hero h1 { font-size: 30px; margin: 0 0 12px; color: #fff; line-height: 1.2; }
.repo-hero-content p { color: #f0dde0; margin: 0 0 26px; font-size: 14.5px; line-height: 1.6; }
.repo-hero-stats { display: flex; gap: 32px; flex-wrap: wrap; }
.repo-hero-stat .num { font-size: 26px; font-weight: 700; color: #fff; }
.repo-hero-stat .lbl { font-size: 12px; color: #e9d3d6; margin-top: 2px; }
.repo-hero-building {
  position: absolute;
  right: -10px;
  bottom: -16px;
  width: 280px;
  height: auto;
  fill: rgba(255,255,255,.1);
  pointer-events: none;
}
@media (max-width: 720px) { .repo-hero-building { display: none; } }

.card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.card-header-icon {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--maroon-light);
  color: var(--maroon);
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-header strong { font-size: 14.5px; }

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--maroon-light);
  color: var(--maroon-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.name-cell { display: flex; align-items: center; gap: 10px; }

.data-table tbody tr:hover { background: var(--maroon-light); }

.stat-tile { position: relative; overflow: hidden; transition: transform .12s ease, box-shadow .12s ease; }
.stat-tile:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(58,13,20,.08); }
.stat-tile-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--maroon-light);
  color: var(--maroon);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.empty-state {
  text-align: center;
  padding: 36px 20px;
  color: var(--muted);
}
.empty-state .empty-icon {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--maroon-light);
  color: var(--maroon);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}
.empty-state p { margin: 0; font-size: 13.5px; }

.action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.action-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  text-decoration: none;
  color: inherit;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.action-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(58,13,20,.1); border-color: var(--maroon); text-decoration: none; }
.action-card-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 9px;
  background: var(--maroon-light);
  color: var(--maroon);
  display: flex;
  align-items: center;
  justify-content: center;
}
.action-card-title { font-weight: 700; color: var(--maroon-dark); font-size: 14px; }
.action-card-desc { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.5; }

.welcome-banner {
  background: linear-gradient(135deg, var(--maroon-dark), var(--maroon));
  color: #fff;
  border-radius: 14px;
  padding: 26px 28px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}
.welcome-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 90% 0%, rgba(212,160,23,.22), transparent 55%);
}
.welcome-banner h1 { color: #fff; position: relative; }
.welcome-banner p { color: #e9d3d6; position: relative; margin: 6px 0 0; font-size: 13.5px; }
.welcome-banner .badge { position: relative; }

.attention-card { border-left: 4px solid var(--danger); }
.attention-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.attention-row:last-child { border-bottom: none; }
.attention-row-title { font-weight: 600; font-size: 13.5px; color: var(--ink); }
.attention-row-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.attention-row-days { font-size: 12px; color: var(--danger); font-weight: 600; white-space: nowrap; }

.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.chart-wrap { position: relative; height: 220px; }
.chart-center-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.chart-center-text .num { font-size: 24px; font-weight: 700; color: var(--maroon-dark); }
.chart-center-text .lbl { font-size: 11px; color: var(--muted); }

.insight-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 18px; }
.insight-card .eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.insight-card .num { font-size: 32px; font-weight: 700; color: var(--maroon-dark); margin: 6px 0 4px; }
.insight-card p { margin: 0; font-size: 12.5px; color: var(--muted); }

.page-header-actions { margin-left: auto; }

.report-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(36, 27, 28, .55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  z-index: 100;
  overflow-y: auto;
}
.report-modal-overlay[hidden] { display: none; }
.report-modal-overlay { opacity: 0; transition: opacity .18s ease; }
.report-modal-overlay.is-open { opacity: 1; }
.report-modal {
  background: var(--white);
  border-radius: 14px;
  width: 100%;
  max-width: 640px;
  box-shadow: 0 20px 50px rgba(0,0,0,.3);
  transform: translateY(12px) scale(.97);
  transition: transform .18s ease;
}
.report-modal-overlay.is-open .report-modal { transform: translateY(0) scale(1); }
.report-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.report-modal-header strong { font-size: 15px; color: var(--maroon-dark); }
.report-modal-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 4px;
  display: flex;
  border-radius: 6px;
}
.report-modal-close:hover { background: var(--bg); color: var(--ink); }
.report-modal-body { padding: 24px; max-height: 70vh; overflow-y: auto; }
.report-modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--border); }
.report-modal-footer .btn { width: auto; padding-left: 20px; padding-right: 20px; }

.confirm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(36, 27, 28, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 110;
}
.confirm-modal-overlay[hidden] { display: none; }
.confirm-modal-overlay { opacity: 0; transition: opacity .18s ease; }
.confirm-modal-overlay.is-open { opacity: 1; }
.confirm-modal {
  background: var(--white);
  border-radius: 14px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 50px rgba(0,0,0,.3);
  padding: 28px 26px 24px;
  text-align: center;
  transform: translateY(12px) scale(.97);
  transition: transform .18s ease;
}
.confirm-modal-overlay.is-open .confirm-modal { transform: translateY(0) scale(1); }

/* Public sign-in modal — a branded variant of .confirm-modal with its own
   header band instead of the generic centered-icon layout. */
.login-modal { max-width: 400px; padding: 0; overflow: hidden; text-align: left; }
.login-modal-header {
  position: relative;
  padding: 26px 26px 20px;
  color: #fff;
  background:
    radial-gradient(circle at 88% 0%, rgba(212,160,23,.3), transparent 45%),
    radial-gradient(rgba(255,255,255,.08) 1.4px, transparent 1.4px) 0 0/18px 18px,
    linear-gradient(135deg, var(--maroon-dark), var(--maroon));
}
.login-modal-header .brand { margin-bottom: 0; }
.login-modal-header .brand .name { color: #fff; }
.login-modal-header .brand .name small { color: #e9d3d6; }
.login-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(255,255,255,.14);
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.login-modal-close:hover { background: rgba(255,255,255,.26); }
.login-modal-body { padding: 24px 26px 26px; }

.field-input-wrap { position: relative; }
.field-input-wrap .field-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  display: flex;
}
.field-input-wrap input { padding-left: 38px; }
.field-input-wrap.has-toggle input { padding-right: 40px; }
.field-toggle-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  border-radius: 6px;
}
.field-toggle-btn:hover { background: var(--bg); color: var(--ink); }

.confirm-modal-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fdf1d9;
  color: var(--gold-dark);
  margin: 0 auto 16px;
}
.confirm-modal-message { font-size: 14.5px; color: var(--ink); line-height: 1.55; margin: 0 0 22px; }
.confirm-modal-actions { display: flex; gap: 10px; justify-content: center; }

.modal-header { margin-bottom: 14px; }
.modal-header h2 { margin: 0 0 2px; font-size: 18px; color: var(--maroon-dark); }
.modal-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

.report-doc-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--maroon); }
.report-doc-title { font-size: 21px; font-weight: 700; color: var(--maroon-dark); margin: 4px 0 6px; }
.report-doc-meta { font-size: 12.5px; color: var(--muted); margin: 0 0 18px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }

.report-section { margin-bottom: 20px; }
.report-section h3 { font-size: 13px; color: var(--maroon-dark); margin: 0 0 8px; text-transform: uppercase; letter-spacing: .03em; }
.report-mini-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.report-mini-table th, .report-mini-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.report-mini-table th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; }

.comment-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.comment-item:last-child { border-bottom: none; }
.comment-meta { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.comment-text { font-size: 13.5px; white-space: pre-wrap; }

.annotation-quote { background: var(--maroon-light); color: var(--maroon-dark); padding: 8px 10px; border-radius: 6px; font-size: 13px; font-style: italic; margin-bottom: 6px; border-left: 3px solid var(--maroon); }

.sig-pad { border: 1px dashed var(--border); border-radius: 8px; background: #fff; touch-action: none; cursor: crosshair; display: block; }
.sig-preview { max-width: 220px; max-height: 90px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }

.stage-track { display: flex; gap: 6px; margin: 14px 0 0; flex-wrap: wrap; }
.stage-pill { padding: 4px 12px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.stage-pill.done { background: var(--success-bg); color: var(--success); border-color: #bfe3cd; }
.stage-pill.current { background: var(--gold); color: var(--maroon-dark); border-color: var(--gold); }

.readonly-content { white-space: pre-wrap; font-size: 13.5px; line-height: 1.7; max-height: 420px; overflow-y: auto; padding: 14px; background: var(--bg); border-radius: 8px; border: 1px solid var(--border); user-select: text; }

.journal-viewer-wrap { position: relative; margin-top: 12px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.journal-viewer-frame { width: 100%; height: 70vh; border: none; display: block; }
.journal-viewer-docx { margin: 0; max-height: 70vh; border: none; border-radius: 0; }
.journal-viewer-watermark { position: absolute; inset: 0; pointer-events: none; background-repeat: repeat; }

.two-col-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 820px) { .two-col-grid { grid-template-columns: 1fr; } }

.upload-zone {
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  padding: 22px 16px;
  text-align: center;
  background: var(--bg);
  transition: border-color .15s ease, background-color .15s ease, transform .15s ease;
}
.upload-zone.is-dragover { border-color: var(--maroon); background: var(--maroon-light); transform: scale(1.01); }
.upload-zone .filename { font-weight: 700; color: var(--maroon-dark); font-size: 13.5px; }
.upload-zone .hint { font-size: 11.5px; color: var(--muted); margin: 4px 0 12px; }
.upload-zone input[type="file"] { display: none; }

@media print {
  body * { visibility: hidden; }
  .report-modal-overlay, .report-modal-overlay * { visibility: visible; }
  .report-modal-overlay { position: absolute; inset: 0; background: #fff; padding: 0; display: block; }
  .report-modal { box-shadow: none; max-width: 100%; }
  .report-modal-header, .report-modal-footer { display: none !important; }
  .report-modal-body { max-height: none; overflow: visible; padding: 20px; }
}

/* ---------------------------------------------------------------------
 * Motion: shared keyframes, page-load reveal, top progress bar, button
 * loading state, and skeleton loaders. Kept in one block so every page
 * built on the three layouts picks it up without per-view wiring.
 * ------------------------------------------------------------------- */

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@keyframes badgePop { 0% { transform: scale(0); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }

.public-main { animation: fadeIn .25s ease both; }
.auth-card { animation: fadeInUp .4s ease both; }

.main > * { animation: fadeInUp .35s ease both; }
.main > *:nth-child(1) { animation-delay: 0s; }
.main > *:nth-child(2) { animation-delay: .04s; }
.main > *:nth-child(3) { animation-delay: .08s; }
.main > *:nth-child(4) { animation-delay: .12s; }
.main > *:nth-child(n+5) { animation-delay: .16s; }

.alert { animation: fadeInUp .3s ease both; }

/* Slim top-of-page progress bar driven by js/animations.js — shown while a
   full-page navigation or form submit is in flight, since every action in
   this app is a real page load rather than an in-page AJAX swap. */
.page-loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--maroon));
  z-index: 999;
  opacity: 0;
  transition: width .25s ease, opacity .2s ease;
}
.page-loading-bar.active { opacity: 1; }

.spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  opacity: .85;
  animation: spin .6s linear infinite;
  margin-right: 7px;
  vertical-align: -2px;
}

button.is-loading, input[type="submit"].is-loading { cursor: wait; opacity: .85; }

.skeleton-block { padding: 2px 0; }
.skeleton-line {
  height: 13px;
  border-radius: 6px;
  margin-bottom: 10px;
  background: linear-gradient(90deg, var(--border) 25%, #f6eeed 37%, var(--border) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
