/* =========================================================
   SPE BUE Portal — Design System
   Premium university student-organization platform
   ========================================================= */

:root {
  /* --- Brand --- */
  --navy-deep: #001A4D;
  --navy: #003B7A;
  --navy-strong: #0046A8;
  --navy-light: #0e5cc4;
  --navy-lighter: #2f7fd6;
  --gold: #F5B400;
  --gold-dark: #9c6f00;
  --gold-darker: #7a5600;
  --gold-light: #ffd166;
  --gold-tint: #fff6e0;

  /* --- Topbar brand palette (fixed dark-blue-to-gold, same in both themes) --- */
  --brand-navy-dark: #061F4F;
  --brand-navy-darkest: #000D2A;
  --brand-gold: #F0AB00;


  /* --- Neutrals --- */
  --bg: #F5F7FB;
  --surface: #ffffff;
  --surface-2: #FAFBFD;
  --surface-sunken: #EEF1F8;
  --text: #172033;
  --muted: #667085;
  --muted-2: #98A2B3;
  --border: #E4E8F1;
  --border-strong: #D3D9E8;

  /* --- Semantic --- */
  --danger: #D64545;
  --danger-bg: #FDECEC;
  --success: #1A8F5E;
  --success-bg: #E8F7F0;
  --whatsapp: #25D366;
  --whatsapp-dark: #1da851;

  /* --- Shape --- */
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  /* --- Elevation --- */
  --shadow-xs: 0 1px 2px rgba(15, 35, 75, 0.05);
  --shadow-sm: 0 2px 10px rgba(15, 35, 75, 0.06);
  --shadow: 0 10px 30px rgba(10, 31, 68, 0.08);
  --shadow-lg: 0 24px 60px rgba(8, 22, 51, 0.16);
  --shadow-modal: 0 30px 80px rgba(0, 0, 0, 0.42);

  /* --- Motion --- */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --fast: 150ms;
  --med: 220ms;
}

/* Dark mode — same layout, badges, spacing and radii everywhere;
   only the color variables change. Default theme is dark (see the
   inline script in index.html's <head>, which sets this before first
   paint so there's no flash of light mode). */
[data-theme="dark"] {
  /* navy-deep and navy stay genuinely dark — they're button
     BACKGROUNDS (white text sits on top of them), not text colors.
     Only navy-lighter needs to be bright, since that one actually is
     used as text/outline color against the dark page background. */
  --navy-deep: #041b3d;
  --navy: #2D6FC4;
  --navy-strong: #3C82DE;
  --navy-light: #5B9AE8;
  --navy-lighter: #8FC0F5;
  --gold: #F5B400;
  --gold-dark: #ffce4d;
  --gold-darker: #ffdb7a;
  --gold-light: #ffe08a;
  --gold-tint: #362a10;

  --bg: #0b1220;
  --surface: #121a2b;
  --surface-2: #0f1626;
  --surface-sunken: #1a2338;
  --text: #E6E9F0;
  --muted: #9aa4b8;
  --muted-2: #6b7488;
  --border: #263049;
  --border-strong: #33405c;

  --danger: #ff6b6b;
  --danger-bg: #3a1414;
  --success: #4ade80;
  --success-bg: #12301f;
  --whatsapp: #25D366;
  --whatsapp-dark: #1da851;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
  --shadow-modal: 0 30px 80px rgba(0, 0, 0, 0.7);
}

/* Theme toggle button in the nav bar */
.theme-toggle-btn {
  background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--radius-pill);
  width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 17px; color: var(--text); flex-shrink: 0;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.theme-toggle-btn:hover { border-color: var(--border-strong); }
.theme-toggle-btn:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

* { box-sizing: border-box; }

/* Prevents the whole page from being horizontally pannable on phones
   when any inner element (a wide table, canvas, or flex row) is
   momentarily wider than the viewport — those elements keep their
   own overflow-x:auto where needed (tables, canvases below), but the
   page itself should never scroll sideways. */
html, body { height: 100%; overflow-x: hidden; max-width: 100%; }

body {
  margin: 0;
  font-family: 'Inter', 'Manrope', 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.011em;
  line-height: 1.5;
}

button, input, select, textarea { font-family: inherit; }

::selection { background: rgba(245, 180, 0, 0.35); }

a { color: var(--navy-strong); }

/* Focus visibility (accessibility) */
:focus-visible {
  outline: 2.5px solid var(--navy-lighter);
  outline-offset: 2px;
  border-radius: 4px;
}
button:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2.5px solid var(--navy-lighter);
  outline-offset: 2px;
}

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

h1, h2, h3 { font-family: 'Manrope', 'Inter', sans-serif; letter-spacing: -0.02em; }

/* =========================================================
   Page shell / headers
   ========================================================= */

.page-wrap { max-width: 1280px; margin: 0 auto; padding: 32px 24px 72px; animation: fadeSlideIn .35s var(--ease); }

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-header { margin-bottom: 24px; }
.page-header .eyebrow {
  font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--gold-dark); margin: 0 0 6px;
}
.page-header h1 {
  font-size: clamp(22px, 3vw, 30px); font-weight: 800; color: var(--navy); margin: 0 0 6px;
}
.page-header p { font-size: 14.5px; color: var(--muted); margin: 0; }

/* Generic section title used inside cards (keeps old .card h2 usage) */
.card h2 { margin-top: 0; font-size: 17px; font-weight: 800; letter-spacing: -0.01em; color: var(--navy); }
.card h2 .gold-underline { display: block; width: 34px; height: 3px; background: var(--gold); margin-top: 7px; border-radius: 2px; }

/* =========================================================
   Top navigation
   ========================================================= */

.topbar {
  background: var(--surface);
  color: var(--text);
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(10,31,68,0.02);
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.01em; font-size: 15.5px; color: var(--navy); flex-shrink: 0; }
.topbar .brand img { height: 30px; width: auto; object-fit: contain; }
.topbar .brand span { white-space: nowrap; }

.topbar nav {
  display: flex; gap: 2px; align-items: center;
  flex: 1;
  justify-content: center;
  min-width: 0;
}

.topbar nav#nav-links { flex-wrap: nowrap; }

.topbar button.nav-btn {
  position: relative;
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 9px 15px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.topbar button.nav-btn:hover:not(.active) { background: var(--surface-sunken); color: var(--navy); }
.topbar button.nav-btn.active { background: var(--navy); color: #fff; font-weight: 700; }

.topbar button.nav-btn.logout-btn {
  color: var(--danger);
  margin-left: 6px;
  border-left: 1px solid var(--border);
  border-radius: 0;
  padding-left: 16px;
}
.topbar button.nav-btn.logout-btn:hover { background: var(--danger-bg); }

.topbar-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.nav-toggle-btn {
  display: none;
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; align-items: center; justify-content: center;
  flex-direction: column; gap: 4px;
}
.nav-toggle-btn span { display: block; width: 18px; height: 2px; background: var(--navy); border-radius: 2px; transition: transform var(--fast) var(--ease), opacity var(--fast) var(--ease); }
.nav-toggle-btn.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle-btn.open span:nth-child(2) { opacity: 0; }
.nav-toggle-btn.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.topbar-profile {
  display: flex; align-items: center; gap: 9px; padding: 5px 6px 5px 5px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--surface-2); cursor: default;
}
.topbar-profile-avatar {
  width: 30px; height: 30px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-strong) 100%);
  color: #fff; font-size: 11.5px; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.topbar-profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.topbar-profile-name { font-size: 12.5px; font-weight: 700; color: var(--text); line-height: 1.15; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-profile-role { font-size: 10.5px; color: var(--muted); font-weight: 600; }

#eval-nav-badge {
  display: inline-block;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  margin-left: 5px;
  vertical-align: middle;
}

@media (max-width: 980px) {
  .topbar { padding: 0 14px; height: 60px; }
  .nav-toggle-btn { display: flex; }
  .topbar nav#nav-links {
    position: fixed;
    top: 60px; left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px 12px 16px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: max-height var(--med) var(--ease), opacity var(--med) var(--ease);
    z-index: 39;
  }
  .topbar nav#nav-links.open { max-height: 70vh; opacity: 1; pointer-events: auto; overflow-y: auto; }
  .topbar button.nav-btn { width: 100%; text-align: left; padding: 12px 14px; border-radius: 10px; }
  .topbar button.nav-btn.logout-btn { border-left: none; border-top: 1px solid var(--border); margin-left: 0; margin-top: 6px; padding-top: 14px; border-radius: 10px; }
  .topbar-profile-name { display: none; }
}

/* =========================================================
   Auth screen
   ========================================================= */

.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
}

.auth-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 900px 500px at 20% 100%, rgba(245,180,0,0.14), transparent 60%),
    linear-gradient(160deg, #000d29 0%, var(--navy-deep) 45%, var(--navy-strong) 100%);
  padding: 44px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
}
.auth-hero-noise {
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.025) 0 2px, transparent 2px 46px);
  pointer-events: none;
}
.auth-hero-content { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: space-between; flex: 1; }

.auth-hero-brand { display: flex; align-items: baseline; gap: 10px; }
.auth-hero-brand span { font-size: 22px; font-weight: 900; letter-spacing: 4px; color: var(--gold); }
.auth-hero-brand small { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: rgba(255,255,255,0.55); }

.auth-hero-mid { max-width: 480px; }
.auth-hero-mid h1 { font-size: clamp(34px, 4vw, 50px); line-height: 1.08; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 18px; }
.auth-hero-mid p { font-size: 15.5px; line-height: 1.6; color: rgba(255,255,255,0.68); margin: 0; }

.auth-hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  backdrop-filter: blur(6px);
  padding: 9px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: #fff;
}

.auth-form-side { background: var(--surface); display: flex; align-items: center; justify-content: center; padding: 40px 32px; }
.auth-form-inner { width: 100%; max-width: 380px; }
.auth-form-inner h2 { font-size: 25px; font-weight: 800; margin: 0 0 6px; color: var(--text); letter-spacing: -0.02em; }
.auth-form-sub { font-size: 13.5px; color: var(--muted); margin: 0 0 22px; }

.auth-toggle { display: flex; background: var(--bg); border-radius: 12px; padding: 4px; margin-bottom: 24px; border: 1px solid var(--border); }
.auth-toggle button {
  flex: 1; border: none; background: transparent; padding: 9px 0; border-radius: 9px;
  font-size: 13.5px; font-weight: 700; color: var(--muted); cursor: pointer;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.auth-toggle button.active { background: var(--surface); color: var(--navy); box-shadow: var(--shadow-sm); }

@media (max-width: 860px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-form-side { min-height: 100vh; }
}

/* =========================================================
   Forms
   ========================================================= */

label { display: block; font-size: 12.5px; font-weight: 700; color: var(--navy); margin: 14px 0 6px; }
label:first-child { margin-top: 0; }

input, select, textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14.5px;
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease), background var(--fast) var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy-lighter); box-shadow: 0 0 0 4px rgba(47,127,214,0.14); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-sunken); color: var(--muted); cursor: not-allowed; }

/* =========================================================
   Buttons
   ========================================================= */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 12px 18px; border-radius: 11px; border: none;
  font-size: 14.5px; font-weight: 700; cursor: pointer; margin-top: 18px;
  transition: transform 90ms var(--ease), background var(--fast) var(--ease), filter var(--fast) var(--ease), box-shadow var(--fast) var(--ease), border-color var(--fast) var(--ease), opacity var(--fast) var(--ease);
  letter-spacing: -0.005em;
}
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.99); }

.btn-primary { background: var(--navy); color: #fff; box-shadow: 0 4px 14px rgba(0, 59, 122, 0.25); }
.btn-primary:hover:not(:disabled) { background: var(--navy-strong); box-shadow: 0 6px 18px rgba(0, 59, 122, 0.32); }

.btn-cta, .btn-gold { background: var(--gold); color: var(--navy-deep); box-shadow: 0 4px 14px rgba(245, 180, 0, 0.30); }
.btn-cta:hover:not(:disabled), .btn-gold:hover:not(:disabled) { background: var(--gold-light); box-shadow: 0 6px 18px rgba(245, 180, 0, 0.4); }

.btn-secondary { background: var(--navy-deep); color: #fff; }
.btn-secondary:hover:not(:disabled) { filter: brightness(1.15); }

.btn-outline { background: var(--surface); color: var(--navy); border: 1.5px solid var(--border-strong); }
.btn-outline:hover:not(:disabled) { border-color: var(--navy); background: var(--surface-2); }

.btn-danger { background: var(--surface); color: var(--danger); border: 1.5px solid rgba(214,69,69,0.35); }
.btn-danger:hover:not(:disabled) { background: var(--danger-bg); border-color: var(--danger); }

.btn-whatsapp { background: var(--whatsapp); color: #fff; width: auto; }
.btn-whatsapp:hover:not(:disabled) { background: var(--whatsapp-dark); }

.btn-small { width: auto; padding: 8px 15px; font-size: 13px; margin-top: 0; border-radius: 9px; }
.btn-block { width: 100%; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; transform: none; }

.btn.is-loading { color: transparent !important; pointer-events: none; position: relative; }
.btn.is-loading::after {
  content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff;
  animation: btnSpin 0.7s linear infinite;
}
.btn-outline.is-loading::after { border-color: rgba(0,59,122,0.25); border-top-color: var(--navy); }
@keyframes btnSpin { to { transform: rotate(360deg); } }

.link-btn { background: none; border: none; color: var(--navy-lighter); font-size: 13.5px; cursor: pointer; text-decoration: underline; padding: 0; font-weight: 600; }
.link-btn:hover { color: var(--navy); }

.msg { font-size: 13.5px; margin-top: 12px; padding: 10px 13px; border-radius: 9px; display: none; }
.msg.error { display: block; background: var(--danger-bg); color: var(--danger); }
.msg.success { display: block; background: var(--success-bg); color: var(--success); }

.switch-row { text-align: center; margin-top: 18px; font-size: 13.5px; color: var(--muted); }

.otp-input { letter-spacing: 10px; font-size: 22px; text-align: center; font-weight: 700; }

/* =========================================================
   Cards
   ========================================================= */

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  padding: 24px 26px;
  margin-bottom: 20px;
  transition: box-shadow var(--med) var(--ease), transform var(--med) var(--ease), border-color var(--med) var(--ease);
}
.card.hoverable:hover, a.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--border-strong); }

.profile-header { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.profile-avatar-wrap { position: relative; flex-shrink: 0; }
.profile-avatar {
  width: 58px; height: 58px; border-radius: 50%;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-strong) 100%);
  color: #fff; font-weight: 800; font-size: 19px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(0,59,122,0.28);
  overflow: hidden;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-edit {
  position: absolute; bottom: -2px; right: -2px;
  width: 21px; height: 21px; border-radius: 50%;
  background: var(--gold); color: var(--navy-deep);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; cursor: pointer; border: 2px solid var(--surface);
  transition: transform var(--fast) var(--ease);
}
.profile-avatar-edit:hover { transform: scale(1.1); }
.profile-header-sub { margin: 3px 0 0; font-size: 13px; color: var(--muted); font-weight: 600; }
.profile-header-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.help-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.help-row span { font-size: 12.5px; color: var(--muted); }
.help-row .btn-whatsapp { padding: 6px 12px; font-size: 12.5px; }

/* --- Dashboard welcome header --- */
.welcome-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.welcome-header h1 { font-size: clamp(22px, 3vw, 28px); font-weight: 800; color: var(--navy); margin: 0 0 5px; }
.welcome-header p { font-size: 14.5px; color: var(--muted); margin: 0; }

/* --- Stat cards --- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-xs); padding: 16px 16px 15px;
  display: flex; align-items: center; gap: 12px;
  transition: box-shadow var(--med) var(--ease), transform var(--med) var(--ease);
}
.stat-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.stat-card-icon {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  background: var(--surface-sunken); color: var(--navy);
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.stat-card.accent-gold .stat-card-icon { background: var(--gold-tint); color: var(--gold-darker); }
.stat-card-num { font-size: 19px; font-weight: 800; color: var(--text); line-height: 1.15; letter-spacing: -0.02em; }
.stat-card-label { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 1px; }

@media (max-width: 1080px) { .stats-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .stats-row { grid-template-columns: repeat(2, 1fr); } .stat-card { padding: 13px; } }

/* --- Recent activity --- */
.dash-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; align-items: start; }
.dash-two-col .card { margin-bottom: 0; }
@media (max-width: 860px) { .dash-two-col { grid-template-columns: 1fr; } }

.card-compact { padding: 16px 18px; }
.card-compact h2 { font-size: 15.5px; margin-bottom: 10px; }

.activity-list { display: flex; flex-direction: column; max-height: 230px; overflow-y: auto; }
.activity-row { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.activity-row:last-child { border-bottom: none; }
.activity-icon {
  width: 24px; height: 24px; border-radius: 7px; flex-shrink: 0; margin-top: 1px;
  background: var(--surface-sunken); color: var(--navy);
  display: flex; align-items: center; justify-content: center; font-size: 11.5px;
}
.activity-row .activity-text { font-size: 13px; color: var(--text); line-height: 1.3; }
.activity-row .activity-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

.card-compact .empty-state { padding: 16px 10px; font-size: 13px; }
.card-compact .empty-state-rich { padding: 18px 10px; gap: 4px; }
.card-compact .empty-state-rich .es-icon { width: 38px; height: 38px; font-size: 17px; margin-bottom: 4px; }
.card-compact .empty-state-rich .es-title { font-size: 14px; }
.card-compact .empty-state-rich .es-desc { font-size: 12.5px; }

.eval-question-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.eval-question-row select { width: 110px; flex-shrink: 0; }
.eval-question-row input { flex: 1; }

.mini-stat {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 16px; text-align: center; transition: background var(--fast) var(--ease);
}
.mini-stat .num { font-size: 22px; font-weight: 800; color: var(--navy); }
.mini-stat .label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; margin-top: 2px; }

.card-h-layout { display: flex; gap: 24px; align-items: flex-start; text-align: left; }
.card-h-layout .photo-col { flex-shrink: 0; width: 190px; }
.card-h-layout .info-col { flex: 1; min-width: 0; }
@media (max-width: 640px) {
  .card-h-layout { flex-direction: column; align-items: center; text-align: center; }
  .card-h-layout .photo-col { width: auto; }
}

.rating-breakdown { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.rating-breakdown-row { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.rating-breakdown-row .star-label { width: 26px; flex-shrink: 0; }
.rating-breakdown-row .criteria-label { width: 110px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rating-breakdown-row .bar-track { flex: 1; height: 6px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.rating-breakdown-row .bar-fill { height: 100%; background: var(--gold); border-radius: 999px; }
.rating-breakdown-row .count { width: 18px; flex-shrink: 0; text-align: right; }

/* =========================================================
   Toast
   ========================================================= */

.global-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: #fff;
  padding: 13px 20px; border-radius: 12px;
  font-size: 13.5px; font-weight: 600;
  box-shadow: var(--shadow-modal);
  opacity: 0; pointer-events: none;
  transition: opacity var(--med) var(--ease), transform var(--med) var(--ease);
  z-index: 999; max-width: 90vw;
  display: flex; align-items: center; gap: 8px;
}
.global-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.global-toast.success { background: var(--success); }
.global-toast.error { background: var(--danger); }

/* =========================================================
   Profile grid / badges
   ========================================================= */

.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 22px; }
.profile-field { padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.profile-field .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; }
.profile-field .v { font-size: 15px; font-weight: 700; margin-top: 3px; color: var(--text); }

.badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.01em; }
.badge-gold { background: var(--gold-tint); color: var(--gold-darker); }
.badge-navy { background: rgba(0,59,122,0.08); color: var(--navy); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-banned { background: var(--danger-bg); color: var(--danger); }
.badge-timeout { background: var(--gold-tint); color: var(--gold-darker); }
.badge-muted { background: var(--surface-sunken); color: var(--muted); }
.badge-success { background: var(--success-bg); color: var(--success); }

#members-table { overflow-x: auto; }
#members-table table { min-width: 960px; }
#rate-members-table { overflow-x: auto; }

/* =========================================================
   Rate members — swipe-style star rating experience
   ========================================================= */

.rate-toolbar-card { display: flex; flex-direction: column; gap: 4px; }
.rate-event-select-wrap { margin-top: 4px; }

.rate-closed-banner {
  background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(214,69,69,0.22);
  border-radius: var(--radius-sm); padding: 12px 16px; font-size: 13.5px; font-weight: 600;
  margin-bottom: 16px;
}

.rate-progress-wrap { margin-bottom: 18px; }
.rate-progress { font-size: 12.5px; color: var(--navy); font-weight: 800; text-align: center; margin-bottom: 8px; letter-spacing: 0.2px; }
.rate-progress-bar { height: 7px; border-radius: 999px; background: var(--surface-sunken); overflow: hidden; max-width: 380px; margin: 0 auto; }
.rate-progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--gold) 0%, var(--gold-light) 100%); border-radius: 999px; transition: width var(--med) var(--ease); }

.swipe-stage { position: relative; width: 100%; max-width: 400px; margin: 0 auto; touch-action: pan-y; }

.swipe-card {
  position: relative;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 28px 24px 24px;
  text-align: center;
  user-select: none;
  transition: transform .25s var(--ease), opacity .25s var(--ease);
  animation: cardPop .3s var(--ease);
}
@keyframes cardPop { from { opacity: 0; transform: scale(0.97) translateY(6px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.swipe-card.dragging { transition: none; }
.swipe-card .sc-photo-wrap { display: flex; justify-content: center; margin-bottom: 14px; }
.swipe-card .profile-avatar { width: 160px; height: 200px; font-size: 44px; border-radius: 14px; }
.swipe-card .sc-photo-wrap img { width: 160px; height: 200px; border-radius: 14px; object-fit: contain; background: var(--surface-sunken); border: 1px solid var(--border); box-shadow: 0 8px 20px rgba(0,59,122,0.2); }
.swipe-card .sc-name { font-size: 19px; font-weight: 800; color: var(--text); margin: 0; }
.swipe-card .sc-sub { font-size: 12.5px; color: var(--muted); margin: 4px 0 4px; }
.swipe-card .sc-overall { font-size: 12.5px; color: var(--gold-dark); font-weight: 700; margin-bottom: 6px; }

/* Desktop: the single narrow mobile column, just centered on a wide
   screen, reads as an unfinished mobile view rather than a real
   desktop layout. From here up, the card becomes a proper two-column
   composition — a fixed identity panel (photo, name, title) on the
   left, and the rating form (questions + comment) flowing naturally
   on the right — using plain flexbox rather than matching up grid
   rows between the two sides, so it stays correct no matter how many
   questions a given card has. */
@media (min-width: 860px) {
  .swipe-stage { max-width: 800px; }
  .swipe-card { display: flex; flex-wrap: wrap; align-items: flex-start; column-gap: 36px; text-align: left; padding: 36px 40px; }
  .sc-identity { flex: 0 0 240px; text-align: center; }
  .sc-formbody { flex: 1 1 380px; min-width: 0; }
  .swipe-card .sc-photo-wrap { justify-content: center; margin-bottom: 18px; }
  .swipe-card .profile-avatar { width: 220px; height: 260px; font-size: 60px; }
  .swipe-card .sc-photo-wrap img { width: 220px; height: 260px; }
  .swipe-card .sc-name { font-size: 21px; margin-top: 0; }
  .swipe-card .sc-badge-row { justify-content: center; margin-top: 8px; }
  .swipe-card .sc-question:first-child { margin-top: 0; }
  .swipe-card .sc-nav { flex-basis: 100%; margin-top: 28px; }
  .sc-question .sc-stars button { width: 42px; height: 42px; font-size: 29px; }
}

.sc-rate-label { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin: 14px 0 8px; }
.required-mark { color: var(--danger); margin-left: 3px; font-weight: 700; }

.sc-stars { display: flex; justify-content: center; gap: 6px; margin: 4px 0 14px; }
.sc-stars button {
  width: 46px; height: 46px; border-radius: 50%; border: none;
  background: transparent; color: var(--border-strong); font-size: 30px; line-height: 1;
  cursor: pointer; transition: color .12s var(--ease), transform .12s var(--ease);
  display: flex; align-items: center; justify-content: center;
}
.sc-stars button:hover { color: var(--gold-light); transform: scale(1.12); }
.sc-stars button.picked { color: var(--gold); animation: starPop .28s var(--ease); }
@keyframes starPop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1.08); } }

/* Multi-question rating: larger stars + clearer question labels */
.sc-question { margin-bottom: 2px; }
.sc-question .sc-rate-label {
  text-align: left;
  margin: 10px 0 5px;
  color: var(--navy);
  font-size: 13px;
  font-weight: 800;
  text-transform: none;
  letter-spacing: 0;
}
.sc-question .sc-stars { justify-content: flex-start; gap: 5px; margin: 0 0 7px; }
.sc-question .sc-stars button { width: 38px; height: 38px; font-size: 27px; }
.sc-stars-locked button { cursor: default; }

/* Rate Members / Monthly — form-style: every member listed at once
   in a scrollable form, one Submit button at the end, instead of a
   swipe-one-at-a-time flow. */
.rate-form-list { display: flex; flex-direction: column; gap: 14px; max-width: 620px; margin: 0 auto; }
.rate-form-card {
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface);
  box-shadow: var(--shadow-xs); padding: 18px 20px;
}
.rate-form-card-locked { background: var(--surface-2); opacity: 0.85; }
.rate-form-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.rate-form-card-head img, .rate-form-card-head .profile-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; font-size: 15px; }
.rate-form-name { font-size: 15px; font-weight: 800; color: var(--text); }
.rate-form-sub { font-size: 12px; color: var(--muted); }
.rate-form-card textarea { margin-top: 6px; }
.sc-stars-locked button:hover { transform: none; }
.sc-stars-locked button:disabled { opacity: 1; }

.sc-note-label { text-align: left; font-size: 12px; font-weight: 700; color: var(--navy); margin: 4px 0 6px; }

.swipe-card textarea {
  width: 100%; min-height: 60px; padding: 10px 12px; border: 1.5px solid var(--border);
  border-radius: 10px; font-size: 13.5px; font-family: inherit; resize: vertical;
}

.sc-actions { display: flex; gap: 10px; margin-top: 16px; }
.sc-actions .btn { margin-top: 0; }

.sc-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.sc-nav .btn { margin-top: 0; width: auto; flex: 1; }
.sc-nav .btn-primary { flex: 1.4; }

.sc-badge-row { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; min-height: 22px; }

.swipe-empty { text-align: center; padding: 44px 20px; color: var(--muted); }

@media (max-width: 480px) {
  .swipe-card { padding: 22px 16px 20px; }
  .sc-stars button { width: 40px; height: 40px; font-size: 25px; }
}

/* =========================================================
   Evaluate — same visual system as Rate Members
   ========================================================= */
.eval-meta { font-size:12px; color:var(--muted); margin-top:6px; line-height:1.6; }
/* Vice always stacks below Head — not side-by-side — regardless of
   screen width, so Head and Vice each get the full card width to
   breathe (matches how a single person gets full width in Rate
   Members/Rate Board) instead of being squeezed into a half-width
   column next to each other. */
.eval-rate-grid { display:grid; grid-template-columns:1fr; gap:18px; }
.eval-rate-card {
  display:flex; align-items:flex-start; gap:28px;
  border:1px solid var(--border); border-radius:var(--radius-lg);
  background:var(--surface); box-shadow:var(--shadow-xs); padding:24px;
  min-width:0;
}
.eval-rate-card .sc-identity { flex:0 0 180px; text-align:center; }
.eval-rate-card .sc-formbody { flex:1 1 auto; min-width:0; }
.eval-rate-card .sc-photo-wrap { margin-bottom:14px; }
.eval-rate-card .profile-avatar,
.eval-rate-card .sc-photo-wrap img { width:160px; height:200px; border-radius:14px; object-fit:contain; background:var(--surface-sunken); border:1px solid var(--border); box-shadow:0 8px 20px rgba(0,59,122,.12); }
.eval-rate-card .sc-name { font-size:18px; font-weight:800; color:var(--text); margin:0; line-height:1.25; }
.eval-rate-card .sc-sub { font-size:12px; color:var(--muted); margin:5px 0 0; }
.eval-rate-card .sc-badge-row { justify-content:center; margin-top:8px; }
.eval-rate-card .sc-rate-label { margin-top:0; margin-bottom:6px; font-size:12.5px; color:var(--navy); text-transform:none; letter-spacing:0; font-weight:800; }
.eval-rate-card .sc-question { margin-bottom:10px; }
.eval-rate-card .sc-question + .sc-question { padding-top:10px; border-top:1px solid var(--border); }
.eval-rate-card .sc-stars { justify-content:flex-start; gap:4px; margin:0; }
.eval-rate-card .sc-stars button { width:36px; height:36px; font-size:26px; }
.eval-rate-card-empty { align-items:center; min-height:285px; background:var(--surface-2); }
.eval-rate-card-empty .eval-empty-body { display:flex; align-items:center; min-height:100%; }
.eval-avatar-muted { color:var(--muted-2); font-weight:800; }
.eval-empty-note { font-size:13.5px; color:var(--muted); }
.eval-submit-wrap { display:flex; justify-content:flex-end; margin-top:18px; }
.eval-submit { width:auto; min-width:180px; margin-top:0; }

@media (max-width: 680px) {
  .eval-card { padding:16px; }
  .eval-card-head { align-items:flex-start; }
  .eval-rate-card { flex-direction:column; align-items:stretch; gap:16px; padding:18px; }
  .eval-rate-card .sc-identity { flex-basis:auto; display:grid; grid-template-columns:84px 1fr; column-gap:14px; align-items:center; text-align:left; }
  .eval-rate-card .sc-photo-wrap { grid-row:span 3; margin:0; }
  .eval-rate-card .profile-avatar,
  .eval-rate-card .sc-photo-wrap img { width:84px; height:96px; border-radius:12px; }
  .eval-rate-card .sc-badge-row { justify-content:flex-start; margin-top:4px; }
  .eval-rate-card .sc-name { font-size:16px; }
  .eval-rate-card .sc-stars button { width:34px; height:34px; font-size:24px; }
  .eval-submit-wrap { display:block; }
  .eval-submit { width:100%; }
}

/* =========================================================
   Tables
   ========================================================= */

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
/* Every table here is rendered into a wrapping <div id="...">. Rather
   than chase down each container id individually (easy to miss one,
   as happened with the committee roster on mobile), this catches
   every div that directly holds a table, current or future, and lets
   it scroll sideways instead of blowing out the page width. */
div:has(> table) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 700; background: var(--surface-2); }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--navy); }
tbody tr { transition: background var(--fast) var(--ease); }
tbody tr:hover td { background: var(--surface-2); }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar input[type=text] { max-width: 260px; }
.toolbar select { width: auto; }

.filter-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.filter-bar .search-input-wrap { position: relative; flex: 1; min-width: 200px; max-width: 320px; }
.filter-bar .search-input-wrap input { padding-left: 34px; }
.filter-bar .search-input-wrap::before {
  content: '⚲'; position: absolute; left: 12px; top: 50%; transform: translateY(-50%) rotate(90deg);
  color: var(--muted-2); font-size: 14px; pointer-events: none;
}
.filter-bar select { width: auto; min-width: 130px; }

.pill-select { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 18px; }
.pill-select button {
  border: 1px solid var(--border); background: var(--surface); border-radius: 999px; color: var(--muted);
  padding: 8px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.pill-select button:hover { border-color: var(--navy-lighter); color: var(--navy); }
.pill-select button.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* =========================================================
   Empty states
   ========================================================= */

.empty-state { text-align: center; color: var(--muted); padding: 30px 10px; font-size: 14px; }
.empty-state-rich {
  text-align: center; padding: 48px 20px; display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.empty-state-rich .es-icon {
  width: 52px; height: 52px; border-radius: 16px; background: var(--surface-sunken); color: var(--navy);
  display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 8px;
}
.empty-state-rich .es-title { font-size: 15.5px; font-weight: 800; color: var(--text); }
.empty-state-rich .es-desc { font-size: 13.5px; color: var(--muted); max-width: 320px; margin: 2px 0 6px; }

/* =========================================================
   Skeleton loaders
   ========================================================= */

.skeleton { position: relative; overflow: hidden; background: var(--surface-sunken); border-radius: 8px; }
.skeleton::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.7), transparent);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.skeleton-row { height: 16px; margin-bottom: 10px; }
.skeleton-card { height: 96px; border-radius: var(--radius); margin-bottom: 14px; }

/* =========================================================
   Events
   ========================================================= */

.announce-card { padding: 0; overflow: hidden; }
.announce-img { width: 100%; max-height: 340px; object-fit: contain; object-position: center; display: block; background: var(--surface-sunken); }
.announce-body { padding: 22px 24px; }
.announce-body h2 { margin: 10px 0 4px; font-size: 19px; color: var(--navy); }

.event-poster-thumb { width: 100%; max-height: 300px; object-fit: contain; object-position: center; border-radius: 12px; margin-bottom: 10px; background: var(--surface-sunken); }
.event-poster-mini { width: 46px; height: 46px; object-fit: cover; border-radius: 6px; vertical-align: middle; }

.event-row {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 12px;
  transition: box-shadow var(--med) var(--ease), transform var(--med) var(--ease), border-color var(--med) var(--ease);
  background: var(--surface);
}
.event-row:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--border-strong); }
.event-row.expired { opacity: 0.62; }
.event-row-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }

.file-input-row { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
#ev-image-preview img { max-width: 160px; border-radius: 8px; display: block; margin-top: 8px; }

.attend-toggle {
  width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--border); cursor: pointer; background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.attend-toggle.on { background: var(--success); border-color: var(--success); color: #fff; font-weight: 700; }

/* =========================================================
   Suspension notices
   ========================================================= */

.ban-card { border-left: 4px solid var(--danger); }
.ban-card .badge { margin-bottom: 4px; }
.ban-countdown { display: inline-block; font-weight: 700; color: var(--gold-dark); background: var(--gold-tint); padding: 4px 10px; border-radius: 999px; font-size: 13px; margin-top: 6px; }
.ban-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.ban-actions .btn { margin-top: 0; }

.ban-control { display: flex; gap: 6px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
.ban-control select { width: auto; padding: 6px 8px; font-size: 12.5px; }

/* =========================================================
   Loading
   ========================================================= */

.spinner-row { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; padding: 10px 0; }

/* =========================================================
   Admin — sidebar-style layout
   ========================================================= */

.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: start;
}

.admin-sidebar.pill-select {
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  margin: 0;
  position: sticky;
  top: 84px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: var(--shadow-xs);
}
.admin-sidebar.pill-select button {
  text-align: left; border-radius: 9px; border: none; padding: 10px 12px; font-weight: 600;
}
.admin-sidebar.pill-select button.active { background: var(--navy); color: #fff; }
.admin-sidebar.pill-select button:hover:not(.active) { background: var(--surface-sunken); border-color: transparent; }

.admin-content { min-width: 0; }

.admin-stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px;
}

@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar.pill-select { position: static; flex-direction: row; overflow-x: auto; padding: 6px; }
  .admin-sidebar.pill-select button { white-space: nowrap; }
  .admin-stats-row { grid-template-columns: repeat(2, 1fr); }
}

/* =========================================================
   Member report overlay (modal)
   ========================================================= */

#member-report-overlay { animation: modalFade .18s var(--ease); }
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }
#member-report-card { animation: modalPop .22s var(--ease); }
@keyframes modalPop { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }


/* =========================================================
   Unified rating experience
   Event, Monthly, and Board ratings intentionally share the same
   single-person card and Save & Next interaction.
   ========================================================= */
.unified-rating-stage { max-width: 860px; }
.unified-rating-card { min-height: 420px; }
.unified-rating-actions { align-items: stretch; }
.unified-rating-actions .btn { min-height: 44px; }
.rating-status-note {
  border-radius: 10px; padding: 10px 12px; margin-bottom: 12px;
  font-size: 12.5px; font-weight: 700; border: 1px solid var(--border);
}
.rating-status-note.locked { background: var(--surface-2); color: var(--muted); }
.rating-status-note.closed { background: var(--danger-bg); color: var(--danger); border-color: rgba(214,69,69,.22); }
.rating-status-meta { font-size: 12px; color: var(--muted); margin-left: 8px; }
.monthly-window-fields {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px; align-items: end;
}
.monthly-window-fields input { width: 100%; box-sizing: border-box; }
.ranking-preview-status {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  padding: 10px 12px; margin: 0 0 12px;
  border: 1px solid var(--border); border-radius: 10px;
  font-size: 12.5px; line-height: 1.45;
}
.ranking-preview-status.live { background: var(--surface-2); color: var(--muted); }
.ranking-preview-status.finalized { background: var(--gold-tint); color: var(--text); border-color: rgba(245,180,0,.28); }
@media (max-width: 640px) {
  .ranking-preview-status { align-items: flex-start; }
}


@media (max-width: 859px) {
  .unified-rating-stage { max-width: 100%; }
  .unified-rating-card { padding: 22px 18px 18px; }
}

@media (max-width: 640px) {
  .unified-rating-card { display: block; text-align: center; }
  .unified-rating-card .sc-identity { text-align: center; }
  .unified-rating-card .sc-formbody { margin-top: 16px; }
  .unified-rating-card .sc-badge-row { justify-content: center; flex-wrap: wrap; }
  .unified-rating-card .sc-question .sc-rate-label { text-align: left; }
  .unified-rating-card .sc-question .sc-stars { justify-content: flex-start; }
  .unified-rating-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; margin-top: 18px; }
  .unified-rating-actions .btn { width: 100%; }
  .monthly-window-fields { grid-template-columns: 1fr; gap: 8px; }
  .rating-status-meta { display: block; margin: 7px 0 0; }
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 900px) {
  .profile-grid { grid-template-columns: 1fr; }
  .page-wrap { padding: 22px 16px 56px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .card { padding: 18px 16px; border-radius: 14px; }
  .announce-img { max-height: 200px; }
  .event-poster-thumb { max-height: 180px; }
  .welcome-header { flex-direction: column; align-items: flex-start; }
  table { font-size: 12.5px; }
  th, td { padding: 9px 6px; }
  .toolbar input[type=text] { max-width: 100%; width: 100%; }
  .filter-bar .search-input-wrap { max-width: 100%; }
}

/* Tables become horizontally scrollable cards on small screens */
@media (max-width: 560px) {
  #members-table, #rate-members-table, .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* =========================================================
   Large member lists — contained scrolling
   Keep long member lists inside their panel instead of making
   the whole page grow. Horizontal scrolling is still available
   when the table has more columns than the viewport.
   ========================================================= */
#members-table,
#rate-roster-table {
  max-height: min(620px, 68vh);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border: 1px solid var(--border);
  border-radius: 10px;
}

#members-table > table,
#rate-roster-table > table {
  min-width: 860px;
  margin: 0;
}

#members-table thead th,
#rate-roster-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: 0 1px 0 var(--border);
}

@media (max-width: 640px) {
  #members-table,
  #rate-roster-table {
    max-height: 58vh;
    max-width: 100%;
  }
}

/* =========================================================
   Desktop admin/member roster scrolling
   Keep long lists inside the visible Admin panel so the browser
   page does not need to be scrolled down just to reach the list.
   ========================================================= */
@media (min-width: 901px) {
  #admin-members #members-table,
  #admin-members #rate-roster-table,
  #admin-members .table-scroll,
  #admin-members div:has(> table) {
    max-height: calc(100vh - 350px);
    min-height: 260px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-gutter: stable both-edges;
  }

  #admin-members #members-table > table,
  #admin-members #rate-roster-table > table,
  #admin-members .table-scroll > table {
    margin-top: 0;
  }

  #admin-members #members-table thead th,
  #admin-members #rate-roster-table thead th,
  #admin-members .table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--surface);
    box-shadow: 0 1px 0 var(--border);
  }
}

/* =========================================================
   Unified Evaluation & Rating hub
   Keeps existing rating/evaluation screens intact while giving
   users one consistent place to enter them.
   ========================================================= */
.evaluation-center-header {
  display:flex; align-items:flex-end; justify-content:space-between; gap:18px;
  margin-bottom:18px;
}
.evaluation-center-header .eyebrow {
  color:var(--gold-dark); font-size:11px; font-weight:800; text-transform:uppercase;
  letter-spacing:.8px; margin-bottom:6px;
}
.evaluation-center-header h1 { margin:0 0 5px; }
.evaluation-center-header p { margin:0; }
.evaluation-center-role {
  border:1px solid var(--border); background:var(--surface); color:var(--muted);
  border-radius:var(--radius-pill); padding:8px 12px; font-size:12px; font-weight:800;
  white-space:nowrap;
}
.evaluation-center-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.evaluation-center-card {
  appearance:none; border:1px solid var(--border); border-radius:var(--radius-lg); background:var(--surface);
  box-shadow:var(--shadow-sm); padding:20px; text-align:left; color:var(--text); cursor:pointer;
  display:grid; grid-template-columns:auto 1fr auto; gap:14px; align-items:center;
  transition:transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.evaluation-center-card:hover { transform:translateY(-2px); box-shadow:var(--shadow); border-color:var(--border-strong); }
.evaluation-center-card:focus-visible { outline:2px solid var(--navy-lighter); outline-offset:2px; }
.evaluation-center-card-icon {
  width:46px; height:46px; border-radius:14px; display:flex; align-items:center; justify-content:center;
  background:var(--gold-tint); color:var(--gold-dark); font-size:22px; font-weight:900;
}
.evaluation-center-card-copy { min-width:0; display:flex; flex-direction:column; gap:5px; }
.evaluation-center-card-title { font-size:16px; font-weight:850; color:var(--navy); }
.evaluation-center-card-desc { font-size:12.5px; color:var(--muted); line-height:1.45; }
.evaluation-center-card-meta { display:flex; flex-direction:column; align-items:flex-end; gap:8px; white-space:nowrap; }
.evaluation-center-card-badge { font-size:10.5px; font-weight:800; color:var(--muted); text-transform:uppercase; letter-spacing:.45px; }
.evaluation-center-card-cta { font-size:12px; font-weight:850; color:var(--navy); }
.evaluation-center-safety {
  margin-top:14px; display:flex; gap:12px; align-items:flex-start; padding:14px 16px;
  background:var(--surface-2); border:1px solid var(--border);
}
.evaluation-center-safety-icon { flex:0 0 auto; width:30px; height:30px; border-radius:50%; display:flex; align-items:center; justify-content:center; background:var(--success-bg); color:var(--success); font-weight:900; }
.evaluation-center-safety strong { display:block; color:var(--text); font-size:13px; margin-bottom:3px; }
.evaluation-center-safety p { margin:0; color:var(--muted); font-size:12.5px; }
.evaluation-center-empty { text-align:center; padding:36px 22px; grid-column:1/-1; }
.evaluation-center-empty-icon { width:48px; height:48px; margin:0 auto 12px; border-radius:50%; display:flex; align-items:center; justify-content:center; background:var(--surface-sunken); color:var(--success); font-size:22px; font-weight:900; }
.evaluation-center-empty h2 { margin:0 0 6px; }
.evaluation-center-empty p { margin:0; color:var(--muted); font-size:13px; }

@media (max-width: 760px) {
  .evaluation-center-header { align-items:flex-start; flex-direction:column; }
  .evaluation-center-grid { grid-template-columns:1fr; }
  .evaluation-center-card { grid-template-columns:auto 1fr; }
  .evaluation-center-card-meta { grid-column:2; align-items:flex-start; }
}

/* =========================================================
   Website visual refresh — soft gold/blue gradient background
   No pixel-texture image — just gentle brand-color gradients so
   the page never looks flat while content is loading in.
   ========================================================= */
#view-app {
  position: relative;
  min-height: 100vh;
  isolation: isolate;
  background:
    radial-gradient(circle at 12% 0%, rgba(17, 105, 235, 0.16), transparent 32%),
    radial-gradient(circle at 90% 12%, rgba(245, 180, 0, 0.14), transparent 30%),
    radial-gradient(circle at 50% 100%, rgba(17, 105, 235, 0.08), transparent 45%),
    var(--bg);
}
#view-app::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(160deg, rgba(0,67,168,0.10), rgba(245,180,0,0.06) 45%, transparent 75%);
  pointer-events: none;
}
[data-theme="dark"] #view-app {
  background:
    radial-gradient(circle at 12% 0%, rgba(45, 111, 196, 0.22), transparent 32%),
    radial-gradient(circle at 90% 12%, rgba(245, 180, 0, 0.12), transparent 30%),
    radial-gradient(circle at 50% 100%, rgba(45, 111, 196, 0.10), transparent 45%),
    var(--bg);
}
[data-theme="dark"] #view-app::before {
  background: linear-gradient(160deg, rgba(18,82,170,0.20), rgba(245,180,0,0.06) 45%, transparent 75%);
}

.page-wrap {
  position: relative;
}
.page-wrap::before {
  content: "";
  display: block;
  height: 3px;
  width: 78px;
  margin: -6px 0 24px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--navy-strong), var(--gold));
  box-shadow: 0 5px 18px rgba(0,59,122,0.14);
}

.evaluation-center-card {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
}
.evaluation-center-card-icon {
  box-shadow: inset 0 0 0 1px rgba(245,180,0,0.18);
}
.evaluation-center-header {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
}

.card {
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(6px);
}

@media (max-width: 760px) {
  #view-app::before {
    background: linear-gradient(160deg, rgba(0,67,168,0.08), rgba(245,180,0,0.05) 45%, transparent 75%);
  }
  [data-theme="dark"] #view-app::before {
    background: linear-gradient(160deg, rgba(18,82,170,0.16), rgba(245,180,0,0.05) 45%, transparent 75%);
  }
}

/* =========================================================
   Organized button groups
   Keep related actions aligned and visually predictable.
   ========================================================= */
.button-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
}
.button-row .btn {
  width: auto;
  min-width: 132px;
  margin-top: 0;
}
.button-row .btn-primary,
.button-row .btn-cta,
.button-row .btn-gold {
  order: 0;
}
.button-row .btn-secondary,
.button-row .btn-outline,
.button-row .btn-danger {
  order: 1;
}
.button-row-schedule {
  row-gap: 10px;
}
.button-row-schedule input {
  flex: 1 1 220px;
  min-width: 190px;
}
.button-row-schedule > span {
  flex: 0 0 auto;
}

@media (max-width: 640px) {
  .button-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  .button-row .btn {
    width: 100%;
    min-width: 0;
  }
  .button-row-schedule {
    display: flex;
  }
  .button-row-schedule input {
    flex-basis: 100%;
  }
  .button-row-schedule .btn {
    flex: 1 1 calc(50% - 5px);
  }
}

/* =========================================================
   v66.5 visual polish — energetic but restrained
   ========================================================= */

/* The temporary "Evaluation & Rating" hub is hidden from the main UI.
   Evaluation, member rating, Board rating and rankings keep their
   existing routes/panels and permissions. */
#tab-evaluation-center,
#panel-evaluation-center { display: none !important; }

/* Centered app shell. */
.page-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 30px 30px 72px;
}

/* Give the dashboard/content some visual rhythm without over-decorating. */
.page-header {
  position: relative;
}
.page-header h1 {
  text-shadow: 0 2px 18px rgba(0, 55, 130, 0.08);
}

.card,
.evaluation-center-header,
.eval-card,
.eval-person-card,
.swipe-card {
  box-shadow: 0 12px 34px rgba(0, 55, 130, 0.10);
  border-color: rgba(0, 70, 170, 0.12);
}

.card {
  background: rgba(255,255,255,0.91);
}
[data-theme="dark"] .card {
  background: rgba(18,26,43,0.90);
}

/* Keep controls organized: consistent alignment, height and spacing. */
.toolbar,
.button-row,
.filter-bar {
  align-items: center;
  justify-content: flex-start;
}

.btn,
button.nav-btn,
.pill-select button,
.theme-toggle-btn {
  min-height: 40px;
}

.btn {
  box-shadow: 0 4px 12px rgba(0,55,130,0.08);
}

/* Make the main navigation feel more like a clean command bar. */
.topbar nav {
  justify-content: flex-start;
  overflow-x: auto;
  scrollbar-width: none;
}
.topbar nav::-webkit-scrollbar { display: none; }

.topbar button.nav-btn {
  white-space: nowrap;
}

/* Subtle colored accents instead of a large visual overload. */
.card h2 .gold-underline {
  box-shadow: 0 2px 10px rgba(245,180,0,0.25);
}

@media (max-width: 760px) {
  .page-wrap {
    margin: 0 auto;
    padding: 22px 16px 56px;
  }
}

/* =========================================================
   v66.6 — Head/Vice evaluation visual unification
   Keep the existing evaluation logic and markup, but make the
   Head/Vice screen use the same visual language as the Member
   and Board rating cards.
   ========================================================= */
.eval-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(47,127,214,.20);
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  box-shadow: 0 14px 34px rgba(0,59,122,.10);
  position: relative;
  overflow: hidden;
}
.eval-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--navy-strong), var(--gold));
}
.eval-card-head {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.eval-card-head strong { font-size: 18px; }
.eval-persons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.eval-person-card {
  position: relative;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: transform var(--med) var(--ease), box-shadow var(--med) var(--ease), border-color var(--med) var(--ease);
}
.eval-person-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: rgba(47,127,214,.28);
}
.eval-person-card-empty:hover { transform: none; box-shadow: var(--shadow-xs); }
.eval-person-head {
  display: grid;
  grid-template-columns: 104px 1fr;
  align-items: center;
  gap: 14px;
  border-bottom: 0;
  padding-bottom: 10px;
  margin-bottom: 8px;
}
.eval-person-photo,
.eval-person-photo-fallback {
  width: 104px;
  height: 132px;
  border-radius: 14px;
  object-fit: contain;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(0,59,122,.10);
}
.eval-person-photo-fallback {
  display:flex;
  align-items:center;
  justify-content:center;
  color: var(--navy);
  font-weight: 800;
  font-size: 28px;
}
.eval-role {
  color: var(--gold-dark);
  font-size: 11px;
  letter-spacing: .08em;
  font-weight: 850;
}
.eval-person-name {
  color: var(--text);
  font-size: 18px;
  line-height: 1.25;
  margin-top: 4px;
}
.eval-question {
  padding: 12px 0 13px;
}
.eval-question + .eval-question { border-top: 1px solid var(--border); }
.eval-question-text {
  font-size: 14px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 7px;
}
.eval-question .star-rating {
  gap: 3px;
  margin-top: 0;
}
.eval-question .star-rating button {
  width: 36px;
  height: 36px;
  font-size: 27px;
}
.eval-submit {
  margin-top: 18px;
  min-height: 46px;
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(0,70,168,.14);
}

@media (max-width: 760px) {
  .eval-card { padding: 20px 16px; }
  .eval-persons { grid-template-columns: 1fr; }
  .eval-person-head { grid-template-columns: 88px 1fr; }
  .eval-person-photo,
  .eval-person-photo-fallback { width: 88px; height: 112px; }
}


/* Mobile fixes: keep the signed-in profile visible at the top-right and
   stack the HR QR member details/photo instead of squeezing them into
   two narrow columns. */
@media (max-width: 640px) {
  .topbar {
    padding: 0 10px;
    gap: 7px;
  }
  .topbar .brand {
    min-width: 0;
    gap: 7px;
    font-size: 14px;
  }
  .topbar .brand img { height: 28px; }
  .topbar .brand span {
    max-width: 145px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar-actions {
    margin-left: auto;
    gap: 5px;
  }
  .theme-toggle-btn { width: 34px; height: 34px; font-size: 15px; }
  .topbar-profile {
    min-width: 34px;
    height: 40px;
    padding: 3px;
    gap: 0;
  }
  .topbar-profile-avatar { width: 32px; height: 32px; }
  .topbar-profile > div:last-child { display: none; }
  .nav-toggle-btn { width: 38px; height: 38px; flex-shrink: 0; }

  .hr-scan-profile-grid {
    grid-template-columns: 1fr !important;
    gap: 18px !important;
  }
  .hr-scan-details {
    min-width: 0 !important;
    width: 100%;
  }
  .hr-scan-details h2 {
    font-size: 21px !important;
    overflow-wrap: anywhere;
  }
  .hr-scan-details > div {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .hr-scan-photo {
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
  }
  .hr-scan-photo img,
  .hr-scan-photo .profile-avatar {
    width: 100% !important;
    height: 300px !important;
    max-width: 100%;
    object-fit: cover;
  }
}

@media (max-width: 390px) {
  .topbar .brand span { max-width: 105px; }
  .theme-toggle-btn { width: 32px; height: 32px; }
  .topbar-profile { min-width: 32px; }
  .topbar-profile-avatar { width: 30px; height: 30px; }
}
