/* ============================================================
   WARD ADMIN — EFF Colour Scheme
   Palette: Black · Red · Forest Green · Gold (from EFF logo)
   Font: Oswald (headings) + Source Sans 3 (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@500;600;700&family=Source+Sans+3:wght@300;400;600;700&display=swap');

/* ── CSS VARIABLES ──────────────────────────────────── */
:root {
  --black:        #0d0d0d;
  --black-soft:   #1a1a1a;
  --black-mid:    #2c2c2c;
  --red:          #b01c1c;
  --red-mid:      #c0392b;
  --red-light:    #e05252;
  --red-pale:     #fdf2f2;
  --green-deep:   #0a3d2e;
  --green-mid:    #145740;
  --green-light:  #1e7a56;
  --green-accent: #27ae6e;
  --gold:         #c9a227;
  --gold-light:   #e8c44a;
  --gold-pale:    #fdf3d0;
  --charcoal:     #1c1c1e;
  --gray-dark:    #3a3a3c;
  --gray-mid:     #6e6e73;
  --gray-light:   #aeaeb2;
  --gray-pale:    #f0f0f0;
  --surface-alt:  #f5f5f5;
  --white:        #ffffff;
  --danger:       #b01c1c;
  --danger-light: #fdf2f2;
  --warning:      #c9a227;
  --info:         #1a5c9a;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.18), 0 1px 2px rgba(0,0,0,.12);
  --shadow-md:    0 4px 16px rgba(0,0,0,.20);
  --shadow-lg:    0 8px 32px rgba(0,0,0,.28);
  --radius:       8px;
  --radius-lg:    14px;
  --transition:   all .22s cubic-bezier(.4,0,.2,1);
}

/* ── RESET & BASE ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
html, body { overflow-x: hidden; }
body {
  font-family: 'Source Sans 3', sans-serif;
  background: var(--gray-pale);
  color: var(--charcoal);
  line-height: 1.6;
  min-height: 100vh;
  width: 100%;
}

/* ── LOGIN SCREEN ───────────────────────────────────── */
#login-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: var(--black);
  background-image:
    radial-gradient(ellipse at 15% 50%, rgba(176,28,28,.20) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 20%, rgba(10,61,46,.25) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 90%, rgba(201,162,39,.08) 0%, transparent 40%),
    repeating-linear-gradient(0deg, transparent, transparent 60px, rgba(255,255,255,.012) 60px, rgba(255,255,255,.012) 61px),
    repeating-linear-gradient(90deg, transparent, transparent 60px, rgba(255,255,255,.012) 60px, rgba(255,255,255,.012) 61px);
  padding: 1.5rem;
}

.login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(176,28,28,.25);
  width: 100%; max-width: 430px;
  overflow: hidden;
  animation: slideUp .5s cubic-bezier(.4,0,.2,1);
}

.login-header {
  background: var(--black);
  padding: 2rem 2rem 1.6rem;
  text-align: center;
  border-bottom: 3px solid var(--red);
  position: relative;
}
.login-header::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--red) 33.3%, var(--green-mid) 33.3% 66.6%, var(--gold) 66.6%);
}

.login-logo {
  width: 110px; height: 66px;
  margin: 0 auto .9rem;
  display: flex; align-items: center; justify-content: center;
}
.login-logo img {
  width: 100%; height: 100%;
  object-fit: contain;
  filter: brightness(1.1) drop-shadow(0 2px 8px rgba(176,28,28,.5));
}

.login-header h1 {
  font-family: 'Oswald', sans-serif;
  color: var(--white); font-size: 1.45rem;
  letter-spacing: .08em; text-transform: uppercase;
}
.login-header p {
  color: var(--gold-light); font-size: .76rem;
  letter-spacing: .1em; text-transform: uppercase; margin-top: .3rem;
}

.login-body { padding: 2rem; }

/* ── APP SHELL ──────────────────────────────────────── */
#app { display: none; min-height: 100vh; width: 100%; overflow-x: hidden; }
#app.active { display: flex; }

/* ── SIDEBAR ────────────────────────────────────────── */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: 252px; height: 100vh;
  background: var(--black);
  display: flex; flex-direction: column;
  z-index: 100;
  box-shadow: 4px 0 24px rgba(0,0,0,.4);
  transition: transform .3s ease;
  border-right: 1px solid rgba(176,28,28,.25);
}
.sidebar::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--red) 33.3%, var(--green-mid) 33.3% 66.6%, var(--gold) 66.6%);
  z-index: 1;
}

.sidebar-brand {
  padding: 1.2rem 1.1rem .9rem;
  border-bottom: 1px solid rgba(201,162,39,.18);
  display: flex; align-items: center; gap: .75rem;
  margin-top: 3px;
}

.brand-icon {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; border-radius: 8px;
  overflow: hidden; background: transparent;
}
.brand-icon img { width: 100%; height: 100%; object-fit: contain; }

.brand-text h2 {
  font-family: 'Oswald', sans-serif;
  color: var(--white); font-size: .95rem;
  letter-spacing: .07em; text-transform: uppercase; line-height: 1.2;
}
.brand-text span {
  color: var(--gold-light); font-size: .66rem;
  text-transform: uppercase; letter-spacing: .1em;
}

.sidebar-nav { flex: 1; padding: .5rem 0; overflow-y: auto; }

.nav-section {
  padding: .5rem 1rem .2rem;
  font-size: .63rem; text-transform: uppercase; letter-spacing: .14em;
  color: var(--red-light); font-weight: 700; margin-top: .5rem;
}

.nav-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem 1.2rem;
  color: rgba(255,255,255,.65);
  cursor: pointer; transition: var(--transition);
  border-left: 3px solid transparent;
  font-size: .88rem; font-weight: 400; user-select: none;
}
.nav-item:hover {
  background: rgba(176,28,28,.14); color: var(--white);
  border-left-color: rgba(201,162,39,.55);
}
.nav-item.active {
  background: rgba(176,28,28,.24); color: var(--white);
  border-left-color: var(--gold); font-weight: 600;
}
.nav-item .nav-icon { font-size: 1rem; width: 20px; text-align: center; }
.nav-item .nav-badge {
  margin-left: auto; background: var(--gold); color: var(--black);
  font-size: .62rem; font-weight: 700; padding: .1rem .4rem; border-radius: 10px;
}

.nav-scope-badge {
  margin: .35rem .85rem .55rem;
  padding: .32rem .65rem; border-radius: 6px;
  background: rgba(201,162,39,.08);
  border: 1px solid rgba(201,162,39,.22);
  font-size: .66rem; color: var(--gold-light);
  letter-spacing: .05em; text-transform: uppercase; font-weight: 600;
}

.sidebar-footer {
  padding: 1rem 1.1rem;
  border-top: 1px solid rgba(255,255,255,.07);
}
.user-chip {
  display: flex; align-items: center; gap: .7rem;
  background: rgba(255,255,255,.06); border-radius: var(--radius);
  padding: .55rem .75rem; cursor: pointer; transition: var(--transition);
  border: 1px solid rgba(176,28,28,.18);
}
.user-chip:hover { background: rgba(176,28,28,.14); border-color: rgba(176,28,28,.38); }
.user-avatar {
  width: 32px; height: 32px; background: var(--red); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; color: var(--white); flex-shrink: 0;
  font-family: 'Oswald', sans-serif;
}
.user-info { flex: 1; min-width: 0; }
.user-info .name { color: var(--white); font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info .role { color: var(--gold-light); font-size: .67rem; text-transform: uppercase; letter-spacing: .06em; }

/* ── MAIN CONTENT ───────────────────────────────────── */
.main {
  margin-left: 252px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  width: calc(100% - 252px);
  overflow-x: hidden;
}

.topbar {
  background: var(--white); padding: .85rem 1.8rem;
  display: flex; align-items: center; gap: 1rem;
  box-shadow: 0 1px 0 rgba(0,0,0,.1), var(--shadow-sm);
  position: sticky; top: 0; z-index: 50;
  border-bottom: 2px solid var(--red);
  width: 100%;
  flex-shrink: 0;
}
.topbar-toggle {
  display: none; background: none; border: none;
  cursor: pointer; color: var(--gray-dark); font-size: 1.3rem; padding: .2rem;
}
.topbar-title {
  font-family: 'Oswald', sans-serif; font-size: 1.1rem; font-weight: 600;
  color: var(--black); letter-spacing: .05em; text-transform: uppercase;
}
.topbar-breadcrumb { color: var(--gray-mid); font-size: .8rem; margin-left: .5rem; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .8rem; }

.scope-pill {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .26rem .7rem; border-radius: 20px; font-size: .73rem; font-weight: 700;
  background: rgba(176,28,28,.07); color: var(--red);
  border: 1px solid rgba(176,28,28,.2);
  text-transform: uppercase; letter-spacing: .05em;
}

.content { flex: 1; padding: 1.8rem; min-width: 0; overflow-x: hidden; }

/* ── STAT CARDS ─────────────────────────────────────── */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.1rem; margin-bottom: 1.8rem;
}
.stat-card {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 1.3rem 1.5rem; box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,.07);
  display: flex; flex-direction: column; gap: .5rem;
  position: relative; overflow: hidden; transition: var(--transition);
  animation: fadeInUp .4s ease both;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--red);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card.gold::before  { background: var(--gold); }
.stat-card.green::before { background: var(--green-accent); }
.stat-card.red::before   { background: var(--red); }
.stat-card.blue::before  { background: var(--info); }

.stat-icon {
  width: 42px; height: 42px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; margin-bottom: .2rem;
  background: #f5e8e8; color: var(--red);
}
.stat-card.gold  .stat-icon { background: var(--gold-pale);    color: var(--gold); }
.stat-card.green .stat-icon { background: #e8f7f0;             color: var(--green-light); }
.stat-card.red   .stat-icon { background: var(--danger-light); color: var(--red); }
.stat-card.blue  .stat-icon { background: #e8f2fa;             color: var(--info); }

.stat-value {
  font-family: 'Oswald', sans-serif; font-size: 2.1rem; font-weight: 700;
  color: var(--black); line-height: 1; letter-spacing: .02em;
}
.stat-label { font-size: .75rem; color: var(--gray-mid); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.stat-sub { font-size: .8rem; color: var(--gray-light); }

/* ── CARDS & PANELS ─────────────────────────────────── */
.card {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); border: 1px solid rgba(0,0,0,.07);
  overflow: hidden; margin-bottom: 1.4rem;
}
.card-header {
  padding: 1rem 1.5rem; display: flex; align-items: center; gap: .8rem;
  border-bottom: 1px solid rgba(0,0,0,.07); background: rgba(0,0,0,.015);
}
.card-header h3 {
  font-family: 'Oswald', sans-serif; font-size: .95rem; color: var(--black);
  font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
}
.card-header-actions { margin-left: auto; display: flex; gap: .5rem; }
.card-body { padding: 1.5rem; }

/* ── GRID HELPERS ───────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.4rem; }

/* ── FORM CONTROLS ──────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block; font-size: .78rem; font-weight: 600;
  color: var(--gray-dark); margin-bottom: .35rem;
  text-transform: uppercase; letter-spacing: .05em;
}
.form-control, .form-select {
  width: 100%; padding: .6rem .85rem;
  border: 1.5px solid rgba(0,0,0,.15); border-radius: var(--radius);
  font-family: 'Source Sans 3', sans-serif; font-size: .92rem;
  color: var(--charcoal); background: var(--white); transition: var(--transition); appearance: none;
}
.form-control:focus, .form-select:focus {
  outline: none; border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(176,28,28,.10);
}
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236e6e73' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .85rem center; padding-right: 2.2rem;
}
.form-row { display: grid; gap: 1rem; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ── BUTTONS ────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .55rem 1.1rem; border-radius: var(--radius); border: none; cursor: pointer;
  font-family: 'Source Sans 3', sans-serif; font-size: .88rem; font-weight: 600;
  transition: var(--transition); white-space: nowrap; text-decoration: none;
}
.btn-primary { background: var(--red); color: var(--white); }
.btn-primary:hover { background: var(--red-mid); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(176,28,28,.35); }
.btn-gold { background: var(--gold); color: var(--black); }
.btn-gold:hover { background: var(--gold-light); }
.btn-green { background: var(--green-mid); color: var(--white); }
.btn-green:hover { background: var(--green-deep); }
.btn-outline { background: transparent; border: 1.5px solid var(--red); color: var(--red); }
.btn-outline:hover { background: var(--red); color: var(--white); }
.btn-danger { background: var(--red); color: var(--white); }
.btn-danger:hover { background: #8b1515; }
.btn-ghost { background: transparent; color: var(--gray-mid); border: 1.5px solid rgba(0,0,0,.13); }
.btn-ghost:hover { border-color: var(--gray-light); color: var(--gray-dark); background: var(--gray-pale); }
.btn-sm { padding: .38rem .75rem; font-size: .8rem; }
.btn-lg { padding: .75rem 1.6rem; font-size: 1rem; }
.btn-icon { padding: .5rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── TABLES ─────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th {
  text-align: left; padding: .65rem 1rem;
  background: var(--black); font-family: 'Oswald', sans-serif;
  font-size: .72rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--gold-light); font-weight: 600;
  border-bottom: 2px solid var(--red); white-space: nowrap;
}
.table td {
  padding: .7rem 1rem; border-bottom: 1px solid rgba(0,0,0,.06);
  color: var(--gray-dark); vertical-align: middle;
}
.table tr:hover td { background: rgba(176,28,28,.03); }
.table .action-btns { display: flex; gap: .3rem; }

/* ── SEARCH BAR ─────────────────────────────────────── */
.search-bar { position: relative; flex: 1; max-width: 360px; }
.search-bar input {
  width: 100%; padding: .55rem .85rem .55rem 2.4rem;
  border: 1.5px solid rgba(0,0,0,.13); border-radius: var(--radius);
  font-family: 'Source Sans 3', sans-serif; font-size: .9rem;
  background: var(--white); transition: var(--transition);
}
.search-bar input:focus {
  outline: none; border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(176,28,28,.08);
}
.search-bar .search-icon {
  position: absolute; left: .8rem; top: 50%; transform: translateY(-50%);
  color: var(--gray-light); font-size: .95rem; pointer-events: none;
}

/* ── FILTER ROW ─────────────────────────────────────── */
.filter-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.filter-select {
  padding: .52rem .85rem; border: 1.5px solid rgba(0,0,0,.13); border-radius: var(--radius);
  font-family: 'Source Sans 3', sans-serif; font-size: .88rem;
  background: var(--white); color: var(--gray-dark); cursor: pointer; transition: var(--transition);
}
.filter-select:focus { outline: none; border-color: var(--red); }

/* ── BADGES ─────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .18rem .6rem; border-radius: 20px;
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
.badge-green  { background: #e8f7f0; color: #1e7a56; }
.badge-gold   { background: var(--gold-pale); color: #8a6c0f; }
.badge-red    { background: var(--danger-light); color: var(--red); }
.badge-gray   { background: var(--gray-pale); color: var(--gray-mid); }
.badge-blue   { background: #e8f2fa; color: var(--info); }
.badge-orange { background: #fef3e5; color: var(--warning); }

/* ── MODALS ─────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.75);
  backdrop-filter: blur(3px); z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem; animation: fadeIn .2s ease;
}
.modal {
  background: var(--white); border-radius: var(--radius-lg);
  width: 100%; max-width: 620px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(176,28,28,.2);
  animation: slideUp .25s cubic-bezier(.4,0,.2,1);
}
.modal-lg { max-width: 820px; }
.modal-header {
  padding: 1.1rem 1.5rem; display: flex; align-items: center; gap: .8rem;
  position: sticky; top: 0; background: var(--black);
  border-bottom: 2px solid var(--red);
}
.modal-header h4 {
  font-family: 'Oswald', sans-serif; font-size: 1.05rem; color: var(--white);
  letter-spacing: .06em; text-transform: uppercase;
}
.modal-header span { font-size: 1.1rem; }
.modal-close {
  margin-left: auto; background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,.5); font-size: 1.3rem; width: 32px; height: 32px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: var(--transition);
}
.modal-close:hover { background: rgba(255,255,255,.1); color: var(--white); }
.modal-body { padding: 1.6rem; }
.modal-footer {
  padding: 1rem 1.6rem; border-top: 1px solid rgba(0,0,0,.08);
  display: flex; justify-content: flex-end; gap: .6rem; background: rgba(0,0,0,.02);
}

/* ── PAGINATION ─────────────────────────────────────── */
.pagination { display: flex; align-items: center; gap: .3rem; justify-content: center; padding: 1rem 0; }
.page-btn {
  min-width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  border: 1.5px solid rgba(0,0,0,.13); border-radius: var(--radius);
  background: var(--white); cursor: pointer; font-size: .85rem; color: var(--gray-dark); transition: var(--transition);
}
.page-btn:hover { border-color: var(--red); color: var(--red); }
.page-btn.active { background: var(--red); border-color: var(--red); color: var(--white); font-weight: 700; }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── TOAST NOTIFICATIONS ────────────────────────────── */
#toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  z-index: 999; display: flex; flex-direction: column; gap: .5rem; max-width: 340px;
}
.toast {
  background: var(--white); border-radius: var(--radius);
  padding: .85rem 1rem; display: flex; align-items: center; gap: .7rem;
  box-shadow: var(--shadow-lg); border-left: 4px solid var(--green-light);
  animation: slideInRight .3s ease; font-size: .88rem;
}
.toast.error   { border-left-color: var(--red); }
.toast.warning { border-left-color: var(--gold); }
.toast.info    { border-left-color: var(--info); }
.toast-icon { font-size: 1.1rem; flex-shrink: 0; }
.toast-msg { flex: 1; color: var(--gray-dark); }

/* ── VD BREAKDOWN ───────────────────────────────────── */
.vd-bar { height: 6px; border-radius: 3px; background: var(--gray-pale); overflow: hidden; min-width: 80px; }
.vd-bar-fill { height: 100%; border-radius: 3px; background: var(--red); transition: width .6s ease; }

/* ── VOTING EFF CHART ───────────────────────────────── */
.eff-chart { display: flex; flex-direction: column; gap: .7rem; }
.eff-row { display: flex; align-items: center; gap: .8rem; }
.eff-label { font-size: .8rem; color: var(--gray-dark); width: 140px; flex-shrink: 0; font-weight: 500; }
.eff-bar { flex: 1; height: 10px; border-radius: 5px; background: var(--gray-pale); overflow: hidden; }
.eff-bar-fill { height: 100%; border-radius: 5px; transition: width .7s ease; }
.eff-count { font-size: .8rem; color: var(--gray-mid); width: 35px; text-align: right; font-weight: 600; }
.eff-strong-support { background: #27ae6e; }
.eff-likely-support { background: #82c596; }
.eff-undecided      { background: #c9a227; }
.eff-likely-against { background: #e8846a; }
.eff-strong-against { background: #b01c1c; }
.eff-unknown        { background: #aeaeb2; }

/* ── SPINNER ────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid rgba(176,28,28,.15); border-top-color: var(--red);
  border-radius: 50%; animation: spin .7s linear infinite; display: inline-block;
}
.loading-overlay {
  display: flex; align-items: center; justify-content: center;
  padding: 3rem; color: var(--gray-mid); gap: .8rem;
}

/* ── TABS ───────────────────────────────────────────── */
.tabs { display: flex; gap: 0; border-bottom: 2px solid rgba(0,0,0,.09); margin-bottom: 1.4rem; }
.tab {
  padding: .65rem 1.2rem; cursor: pointer; font-size: .88rem; font-weight: 600; color: var(--gray-mid);
  border-bottom: 2px solid transparent; margin-bottom: -2px; transition: var(--transition);
}
.tab:hover { color: var(--red); }
.tab.active { color: var(--black); border-bottom-color: var(--red); }

/* ── EMPTY STATE ────────────────────────────────────── */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--gray-mid); }
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: .8rem; opacity: .5; }
.empty-state h4 { color: var(--gray-dark); margin-bottom: .4rem; }
.empty-state p { font-size: .88rem; }

/* ── DETAIL VIEW ────────────────────────────────────── */
.detail-section { margin-bottom: 1.4rem; }
.detail-section h5 {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--red); font-weight: 700;
  margin-bottom: .8rem; padding-bottom: .35rem;
  border-bottom: 1px solid rgba(176,28,28,.15);
}
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .6rem; }
.detail-item .dl { font-size: .72rem; color: var(--gray-mid); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.detail-item .dv { font-size: .92rem; color: var(--charcoal); font-weight: 500; margin-top: .1rem; }

/* ── SCOPE BANNER (dashboard context) ───────────────── */
.scope-banner {
  display: flex; align-items: center; gap: .65rem;
  padding: .7rem 1.1rem;
  background: rgba(176,28,28,.06);
  border: 1px solid rgba(176,28,28,.18);
  border-left: 4px solid var(--red);
  border-radius: var(--radius);
  margin-bottom: 1.2rem;
  font-size: .88rem; color: var(--gray-dark);
  animation: fadeInUp .3s ease;
}
.scope-banner strong { color: var(--black); font-weight: 700; }

/* ── ACCESS DENIED ──────────────────────────────────── */
.access-denied {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 4rem 2rem; text-align: center; color: var(--gray-mid);
}
.access-denied .icon { font-size: 3rem; margin-bottom: 1rem; }
.access-denied h3 {
  font-family: 'Oswald', sans-serif; color: var(--red); font-size: 1.2rem;
  text-transform: uppercase; letter-spacing: .07em; margin-bottom: .5rem;
}
.access-denied p { font-size: .88rem; max-width: 360px; }

/* ── ANIMATIONS ─────────────────────────────────────── */
@keyframes slideUp      { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeIn       { from { opacity:0; } to { opacity:1; } }
@keyframes fadeInUp     { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
@keyframes slideInRight { from { opacity:0; transform:translateX(30px); } to { opacity:1; transform:translateX(0); } }
@keyframes spin         { to { transform: rotate(360deg); } }

/* ── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-260px);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    z-index: 200;
  }
  .sidebar.open { transform: translateX(0); }
  .main {
    margin-left: 0 !important;
    width: 100% !important;
  }
  .topbar-toggle { display: flex; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .form-row.cols-2, .form-row.cols-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .content { padding: 1rem; }
  .scope-pill { font-size: .65rem; padding: .22rem .55rem; }
  .topbar-title { font-size: .95rem; }
  .filter-row { flex-wrap: wrap; }
  .filter-row .filter-select,
  .filter-row .search-bar { flex: 1 1 calc(50% - .3rem); min-width: 130px; }
  .modal { margin: .5rem; max-width: calc(100vw - 1rem); }
  .modal-lg { max-width: calc(100vw - 1rem); }
}

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .filter-row .filter-select,
  .filter-row .search-bar { flex: 1 1 100%; }
  .filter-row .btn { width: 100%; justify-content: center; }
  .table th, .table td { padding: .5rem .6rem; font-size: .8rem; }
  .topbar { padding: .75rem 1rem; }
  .content { padding: .85rem; }
  .card-body { padding: 1rem; }
  .modal-body { padding: 1rem; }
  .modal-footer { padding: .75rem 1rem; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 400px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { padding: 1rem 1.2rem; }
  .topbar-title { font-size: .85rem; }
  .table th, .table td { padding: .45rem .5rem; font-size: .75rem; }
}

/* ── MOBILE OVERLAY ─────────────────────────────────── */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 99; }
.sidebar-overlay.visible { display: block; }
