/* =============================================================
   Design System — white / blue / grey palette
   ============================================================= */

/* ── Google Fonts (loaded in base.html) ──────────────────── */
/* Inter 300-700 */

/* ── CSS Custom Properties ───────────────────────────────── */
:root {
  --bg:           #EEF2FB;
  --surface:      #FFFFFF;
  --primary:      #2563EB;
  --primary-d:    #1D4ED8;
  --primary-l:    #EFF6FF;
  --navy:         #0F172A;
  --navy-l:       #1E293B;
  --muted:        #64748B;
  --muted-l:      #94A3B8;
  --border:       #E2E8F0;
  --border-l:     #F1F5F9;
  --text:         #1E293B;
  --text-l:       #475569;
  --success:      #10B981;
  --warning:      #F59E0B;
  --danger:       #EF4444;
  --info:         #3B82F6;

  --radius-s:  6px;
  --radius-m:  10px;
  --radius-l:  16px;
  --radius-xl: 24px;

  --shadow-s:  0 1px 4px rgba(15,23,42,.06);
  --shadow-m:  0 4px 14px rgba(15,23,42,.08), 0 1px 3px rgba(15,23,42,.04);
  --shadow-l:  0 8px 28px rgba(15,23,42,.10), 0 2px 6px rgba(15,23,42,.05);
  --shadow-xl: 0 20px 50px rgba(15,23,42,.14), 0 4px 12px rgba(15,23,42,.06);

  --nav-h:       64px;
  --sidebar-w:   230px;
  --t:           .18s ease;
}

/* ── Reset / Base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-d); }

img { max-width: 100%; }

code {
  font-size: .85em;
  background: var(--border-l);
  padding: .1em .4em;
  border-radius: var(--radius-s);
  color: var(--navy-l);
}

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-l); }


/* ============================================================
   TOP NAVBAR
   ============================================================ */

.app-nav {
  position: sticky;
  top: 0;
  z-index: 900;
  height: var(--nav-h);
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-s);
}

.app-nav__inner {
  display: flex;
  align-items: center;
  height: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  gap: 24px;
}

/* Brand */
.app-nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text) !important;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -.02em;
  flex-shrink: 0;
}
.app-nav__logo {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--primary), var(--primary-d));
  border-radius: var(--radius-m);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 1rem;
  box-shadow: 0 2px 8px rgba(37,99,235,.35);
}

/* Tab links */
.app-nav__tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.app-nav__tabs::-webkit-scrollbar { display: none; }

.nav-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  transition: background var(--t), color var(--t);
  position: relative;
}
.nav-tab:hover {
  background: var(--primary-l);
  color: var(--primary);
}
.nav-tab.active {
  background: var(--primary-l);
  color: var(--primary);
  font-weight: 600;
}
.nav-tab.active::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}
.nav-tab.admin { color: var(--navy-l); }
.nav-tab.admin:hover, .nav-tab.admin.active {
  background: #F0F4FF;
  color: var(--navy);
}

/* Right side */
.app-nav__right {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.btn-nav-logout {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-m);
  color: var(--muted);
  transition: background var(--t), color var(--t);
}
.btn-nav-logout:hover {
  background: #FEF2F2; color: var(--danger);
}

/* Mobile nav dropdown */
.nav-dropdown-wrapper {
  display: none;
  position: relative;
}

.nav-dropdown-btn {
  background: none; border: none;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
  font-size: 1.2rem;
  cursor: pointer;
  border-radius: var(--radius-m);
  transition: background var(--t);
}
.nav-dropdown-btn:hover { background: var(--primary-l); }

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 1000;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-l);
  min-width: 180px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(.95);
  transition: opacity var(--t), visibility var(--t), transform var(--t);
  overflow: hidden;
}
.nav-dropdown-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.nav-dropdown-link {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  font-size: .88rem;
  color: var(--text-l);
  font-weight: 500;
  border-bottom: 1px solid var(--border-l);
  transition: background var(--t), color var(--t);
}
.nav-dropdown-link:last-child { border-bottom: none; }
.nav-dropdown-link:hover {
  background: var(--primary-l);
  color: var(--primary);
}


/* ============================================================
   ROLE BADGES
   ============================================================ */

.role-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .01em;
}
.role-badge--admin {
  background: #EFF6FF;
  color: var(--primary-d);
  border: 1px solid #BFDBFE;
}
.role-badge--viewer, .role-badge--default {
  background: #F8FAFC;
  color: var(--muted);
  border: 1px solid var(--border);
}
.role-badge--lg {
  padding: 6px 18px;
  font-size: .92rem;
}


/* ============================================================
   FLASH MESSAGES
   ============================================================ */

.flash-container {
  position: fixed;
  top: calc(var(--nav-h) + 12px);
  right: 20px;
  z-index: 1100;
  display: flex; flex-direction: column; gap: 8px;
}
.flash-msg {
  display: flex; align-items: center; gap: 10px;
  min-width: 280px; max-width: 400px;
  padding: 12px 16px;
  border-radius: var(--radius-m);
  font-size: .88rem;
  font-weight: 500;
  box-shadow: var(--shadow-l);
  animation: slideIn .25s ease;
}
.flash-msg--success { background:#ECFDF5; color:#065F46; border:1px solid #6EE7B7; }
.flash-msg--error   { background:#FEF2F2; color:#991B1B; border:1px solid #FCA5A5; }
.flash-msg--info    { background:#EFF6FF; color:#1E40AF; border:1px solid #93C5FD; }
.flash-close {
  margin-left: auto;
  background: none; border: none; cursor: pointer;
  font-size: 1.1rem; opacity: .5; padding: 0 2px;
}
.flash-close:hover { opacity: 1; }

@keyframes slideIn {
  from { opacity:0; transform:translateX(20px); }
  to   { opacity:1; transform:translateX(0); }
}


/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */

.app-main {
  min-height: calc(100vh - var(--nav-h));
}

.page-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 36px 28px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -.03em;
  margin: 0;
}
.page-subtitle {
  color: var(--muted);
  font-size: .88rem;
  margin: 4px 0 0;
}


/* ============================================================
   CARDS
   ============================================================ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-s);
  overflow: hidden;
  transition: box-shadow var(--t), transform var(--t);
}
.card:hover { box-shadow: var(--shadow-m); }
.card__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border-l);
}
.card__header h3 {
  font-size: .95rem;
  font-weight: 600;
  margin: 0;
  display: flex; align-items: center; gap: 8px;
}
.card__header-link {
  font-size: .82rem;
  color: var(--primary);
  font-weight: 500;
}
.card__body { padding: 18px 22px; }
.card--full { grid-column: 1 / -1; }

/* Quick-access cards (home page) */
.quick-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-s);
  color: var(--text);
  transition: box-shadow var(--t), transform var(--t), border-color var(--t);
}
.quick-card:hover {
  box-shadow: var(--shadow-l);
  transform: translateY(-3px);
  border-color: #C7D7FD;
  color: var(--text);
}
.quick-card__icon {
  width: 52px; height: 52px; flex-shrink: 0;
  border-radius: var(--radius-m);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
}
.quick-card__icon--blue   { background:#EFF6FF; color:#2563EB; }
.quick-card__icon--teal   { background:#ECFDF5; color:#059669; }
.quick-card__icon--purple { background:#F5F3FF; color:#7C3AED; }
.quick-card__body { flex: 1; }
.quick-card__body h3 { font-size:1rem; font-weight:600; margin:0 0 4px; }
.quick-card__body p  { font-size:.85rem; color:var(--muted); margin:0; }
.quick-card__arrow { color: var(--muted-l); font-size: 1.1rem; }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
  max-width: 650px;
  margin: 0 auto;
}


/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 20px;
  border-radius: var(--radius-m);
  font-size: .88rem;
  font-weight: 600;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background var(--t), box-shadow var(--t), transform var(--t), opacity var(--t);
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(37,99,235,.25);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-d);
  border-color: var(--primary-d);
  box-shadow: 0 4px 14px rgba(37,99,235,.35);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-l);
  border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--border-l);
  color: var(--text);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn-danger:hover:not(:disabled) {
  background: #DC2626;
  border-color: #DC2626;
}

.btn-sm { padding: 5px 12px; font-size: .82rem; }
.btn-ghost {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-ghost:hover { background: var(--primary-l); }


/* ============================================================
   FORMS
   ============================================================ */

.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: .84rem;
  font-weight: 600;
  color: var(--text-l);
  margin-bottom: 6px;
  letter-spacing: .01em;
}
.form-control {
  display: block;
  width: 100%;
  padding: 9px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-m);
  font-size: .9rem;
  color: var(--text);
  font-family: inherit;
  transition: border-color var(--t), box-shadow var(--t);
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.form-hint {
  font-size: .8rem;
  color: var(--muted);
  margin-top: 4px;
}

/* Checkbox/toggle row */
.form-check-row {
  display: flex; align-items: center; gap: 10px;
}
.form-check-row input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; }


/* ============================================================
   DATA TABLE  (NBA predictions)
   ============================================================ */

.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-s);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.data-table thead {
  background: #F8FAFC;
  border-bottom: 2px solid var(--border);
}
.data-table thead th {
  padding: 12px 16px;
  font-weight: 600;
  color: var(--muted);
  font-size: .8rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.data-table thead th.sortable { cursor: pointer; user-select: none; }
.data-table thead th.sortable:hover { color: var(--primary); }
.data-table thead th.th-main { color: var(--primary); }

.data-table tbody tr {
  border-bottom: 1px solid var(--border-l);
  transition: background var(--t);
}
.data-table tbody tr:hover { background: #F8FAFF; }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody td { padding: 11px 16px; vertical-align: middle; }

.td-player { font-weight: 600; }
.td-date   { color: var(--muted); font-size: .84rem; white-space: nowrap; }
.td-pos    { color: var(--muted); font-size: .84rem; }
.td-p25, .td-p75 { color: var(--muted); }
.td-p50 { font-weight: 700; color: var(--primary-d); font-size: .95rem; }
.th-range { color: var(--muted-l) !important; }

/* Team badges */
.team-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--border-l);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--navy-l);
}
.team-badge--opp {
  background: #FFF7ED;
  color: #9A3412;
}

/* Home/Away badge */
.ha-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: .78rem;
  font-weight: 600;
}
.ha-badge--home { background:#EFF6FF; color:#1D4ED8; }
.ha-badge--away { background:#F8FAFC; color:var(--muted); }


/* ============================================================
   FILTER BAR  (NBA page)
   ============================================================ */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.filter-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-m);
  padding: 7px 12px;
  flex: 1; min-width: 180px;
  transition: border-color var(--t);
}
.filter-search:focus-within { border-color: var(--primary); }
.filter-search i { color: var(--muted); flex-shrink: 0; }
.filter-search input {
  border: none; outline: none; background: transparent;
  font-size: .88rem; color: var(--text); width: 100%; font-family: inherit;
}
.filter-group { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-group select {
  padding: 7px 28px 7px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-m);
  font-size: .86rem;
  color: var(--text);
  background: var(--surface)
    url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%2364748B' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    no-repeat right 10px center;
  appearance: none;
  cursor: pointer;
  font-family: inherit;
  transition: border-color var(--t);
}
.filter-group select:focus { outline: none; border-color: var(--primary); }
.filter-count {
  font-size: .84rem;
  color: var(--muted);
  white-space: nowrap;
  margin-left: auto;
}


/* ============================================================
   PIPELINE PANEL  (NBA page, admin)
   ============================================================ */

.pipeline-panel {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.pipeline-info { display: flex; align-items: center; gap: 8px; }
.pipeline-status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .82rem; font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
}
.pipeline-status--completed { background:#ECFDF5; color:#065F46; }
.pipeline-status--running   { background:#FFF7ED; color:#92400E; }
.pipeline-status--failed    { background:#FEF2F2; color:#991B1B; }
.pipeline-time { font-size:.8rem; color:var(--muted); }

.pipeline-log-panel {
  background: var(--navy);
  border-radius: var(--radius-l);
  margin-bottom: 20px;
  overflow: hidden;
  border: 1px solid #1E293B;
}
.pipeline-log-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px;
  background: var(--navy-l);
  font-size: .82rem;
  font-weight: 600;
  color: #94A3B8;
}
.pipeline-log-status { font-weight: 700; }
.pipeline-log-status--running   { color: #FBBF24; }
.pipeline-log-status--completed { color: #34D399; }
.pipeline-log-status--failed    { color: #F87171; }
.pipeline-log {
  padding: 16px 18px;
  margin: 0;
  font-size: .78rem;
  line-height: 1.6;
  color: #94A3B8;
  max-height: 320px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}


/* ============================================================
   ALERT CARDS  (inline)
   ============================================================ */

.alert-card {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 14px 18px;
  border-radius: var(--radius-m);
  font-size: .9rem;
  margin-bottom: 20px;
}
.alert-card--warning {
  background: #FFFBEB; color: #92400E;
  border: 1px solid #FDE68A;
}
.alert-card--error {
  background: #FEF2F2; color: #991B1B;
  border: 1px solid #FCA5A5;
}


/* ============================================================
   EMPTY STATE
   ============================================================ */

.empty-state {
  text-align: center;
  padding: 72px 24px;
  color: var(--muted);
}
.empty-state__icon {
  font-size: 3rem;
  opacity: .35;
  display: block;
  margin-bottom: 16px;
}
.empty-state h3 { font-size: 1.1rem; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.empty-state p  { font-size: .9rem; margin-bottom: 24px; }


/* ============================================================
   STATUS BADGES / DOTS
   ============================================================ */

.status-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: .78rem;
  font-weight: 600;
}
.status-badge--completed { background:#ECFDF5; color:#065F46; }
.status-badge--running   { background:#FFF7ED; color:#92400E; }
.status-badge--failed    { background:#FEF2F2; color:#991B1B; }

.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}
.status-dot--completed { background: var(--success); }
.status-dot--running   { background: var(--warning); animation: pulse 1.4s infinite; }
.status-dot--failed    { background: var(--danger); }

@keyframes pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: .4; }
}


/* ============================================================
   LOG-IN PAGE
   ============================================================ */

.page-login { background: var(--bg); }

.login-wrapper {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  position: relative; overflow: hidden;
}

/* Decorative background orbs */
.login-bg { position: absolute; inset: 0; pointer-events: none; }
.login-bg__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .35;
}
.login-bg__orb--1 {
  width: 520px; height: 520px;
  top: -180px; left: -120px;
  background: radial-gradient(circle, #BFDBFE, transparent 70%);
}
.login-bg__orb--2 {
  width: 400px; height: 400px;
  bottom: -140px; right: -80px;
  background: radial-gradient(circle, #C7D2FE, transparent 70%);
}
.login-bg__orb--3 {
  width: 300px; height: 300px;
  top: 40%; left: 55%;
  background: radial-gradient(circle, #E0E7FF, transparent 70%);
}

.login-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 400px;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 40px 38px 36px;
}
.login-card__header { text-align: center; margin-bottom: 28px; }
.login-logo {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--primary), #7C3AED);
  border-radius: var(--radius-l);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.6rem; color: #fff;
  box-shadow: 0 4px 16px rgba(37,99,235,.35);
  margin-bottom: 16px;
}
.login-title {
  font-size: 1.6rem; font-weight: 800;
  letter-spacing: -.04em; margin: 0 0 6px;
}
.login-subtitle { font-size: .88rem; color: var(--muted); margin: 0; }

.login-error {
  display: flex; align-items: center; gap: 8px;
  background: #FEF2F2; color: #991B1B;
  border: 1px solid #FCA5A5;
  border-radius: var(--radius-m);
  padding: 10px 14px;
  font-size: .86rem;
  margin-bottom: 16px;
}

.login-label {
  display: block;
  font-size: .84rem; font-weight: 600;
  color: var(--text-l); margin-bottom: 7px;
}
.login-input-wrap { position: relative; }
.login-input {
  width: 100%;
  padding: 11px 44px 11px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-m);
  font-size: .92rem;
  color: var(--text);
  background: var(--surface);
  font-family: inherit;
  transition: border-color var(--t), box-shadow var(--t);
}
.login-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.login-eye {
  position: absolute; top: 50%; right: 12px; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--muted); padding: 2px; font-size: .95rem;
}
.login-eye:hover { color: var(--primary); }

.login-btn {
  width: 100%; margin-top: 22px;
  padding: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-d));
  color: #fff;
  border: none; border-radius: var(--radius-m);
  font-size: .95rem; font-weight: 700;
  cursor: pointer; font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 3px 12px rgba(37,99,235,.3);
  transition: box-shadow var(--t), transform var(--t);
}
.login-btn:hover {
  box-shadow: 0 6px 20px rgba(37,99,235,.4);
  transform: translateY(-1px);
}
.login-btn:active { transform: scale(.98); }

.login-footer {
  text-align: center;
  font-size: .78rem;
  color: var(--muted-l);
  margin: 18px 0 0;
}


/* ============================================================
   LANDING / HOME PAGE
   ============================================================ */

.hero {
  text-align: center;
  padding: 64px 24px 48px;
}
.hero__icon {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--primary), #7C3AED);
  border-radius: var(--radius-xl);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 2rem; color: #fff;
  box-shadow: 0 6px 24px rgba(37,99,235,.3);
  margin-bottom: 20px;
}
.hero__title {
  font-size: 2.4rem; font-weight: 800;
  letter-spacing: -.05em; margin: 0 0 10px;
}
.hero__subtitle {
  font-size: 1rem; color: var(--muted);
  max-width: 480px; margin: 0 auto 22px;
  line-height: 1.6;
}
.hero__role { margin-top: 8px; }


/* ============================================================
   ADMIN LAYOUT — sidebar + main
   ============================================================ */

.admin-layout { padding: 0 !important; }

.admin-wrapper {
  display: flex;
  min-height: calc(100vh - var(--nav-h));
}

.admin-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--navy);
  display: flex; flex-direction: column;
  position: sticky; top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
}
.admin-sidebar__header {
  display: flex; align-items: center; gap: 10px;
  padding: 22px 20px 14px;
  font-size: .9rem; font-weight: 700;
  color: #E2E8F0;
  border-bottom: 1px solid #1E293B;
  letter-spacing: .02em;
}
.admin-sidebar__header i { color: var(--primary); font-size: 1.1rem; }

.admin-nav { padding: 12px 10px; }
.admin-nav__link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-m);
  font-size: .88rem; font-weight: 500;
  color: #94A3B8;
  transition: background var(--t), color var(--t);
  margin-bottom: 2px;
}
.admin-nav__link:hover {
  background: rgba(255,255,255,.07);
  color: #E2E8F0;
}
.admin-nav__link.active {
  background: rgba(37,99,235,.2);
  color: #93C5FD;
  font-weight: 600;
}
.admin-nav__link i { width: 18px; text-align: center; }

.admin-content {
  flex: 1;
  overflow: auto;
}

.admin-page { padding: 32px 36px; max-width: 1100px; }
.admin-page-header { margin-bottom: 28px; }
.admin-page-header h2 {
  font-size: 1.5rem; font-weight: 700; letter-spacing: -.03em; margin: 0 0 4px;
}
.admin-page-header p { color: var(--muted); font-size: .88rem; margin: 0; }


/* ============================================================
   ADMIN — STAT CARDS
   ============================================================ */

.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-s);
  padding: 20px 22px;
  display: flex; gap: 16px; align-items: flex-start;
  transition: box-shadow var(--t), transform var(--t);
}
.stat-card:hover { box-shadow: var(--shadow-m); transform: translateY(-2px); }
.stat-card__icon {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: var(--radius-m);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.stat-card__icon--blue   { background:#EFF6FF; color:#2563EB; }
.stat-card__icon--green  { background:#ECFDF5; color:#059669; }
.stat-card__icon--purple { background:#F5F3FF; color:#7C3AED; }
.stat-card__icon--orange { background:#FFF7ED; color:#EA580C; }
.stat-card__value {
  font-size: 1.55rem; font-weight: 800;
  letter-spacing: -.03em; line-height: 1;
}
.stat-card__label {
  font-size: .78rem; color: var(--muted);
  margin-top: 4px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .04em;
}


/* ============================================================
   ADMIN GRID + ADMIN TABLE
   ============================================================ */

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.admin-table {
  width: 100%; border-collapse: collapse; font-size: .87rem;
}
.admin-table thead th {
  padding: 9px 14px;
  background: #F8FAFC;
  font-size: .78rem; font-weight: 600;
  color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.admin-table tbody tr { border-bottom: 1px solid var(--border-l); }
.admin-table tbody tr:hover { background: #FAFBFF; }
.admin-table tbody td { padding: 10px 14px; }
.admin-table tbody tr:last-child { border-bottom: none; }


/* ============================================================
   FEEDBACK LIST ITEMS  (admin panel)
   ============================================================ */

.feedback-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-l);
}
.feedback-item:last-child { border-bottom: none; }
.feedback-item__meta {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 5px; flex-wrap: wrap;
}
.feedback-item__msg {
  font-size: .88rem; color: var(--text-l);
  margin: 0; line-height: 1.5;
}
.text-sm   { font-size: .8rem; }
.text-muted { color: var(--muted); }


/* ============================================================
   PERMISSION CHECKBOXES
   ============================================================ */

.perm-checks { display: flex; gap: 10px; flex-wrap: wrap; }
.perm-check {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--border-l);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-s);
  padding: 4px 10px;
  font-size: .82rem; font-weight: 500;
  cursor: pointer;
  transition: border-color var(--t), background var(--t);
}
.perm-check:has(input:checked) {
  background: var(--primary-l);
  border-color: #93C5FD;
  color: var(--primary-d);
}
.perm-check input { cursor: pointer; }


/* ============================================================
   PAGINATION
   ============================================================ */

.pagination {
  display: flex; align-items: center; gap: 6px;
  margin-top: 20px; justify-content: center;
}
.page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--radius-m);
  font-size: .88rem; font-weight: 500;
  color: var(--muted);
  border: 1.5px solid var(--border);
  background: var(--surface);
  transition: all var(--t);
}
.page-btn:hover { background: var(--primary-l); color: var(--primary); border-color: #93C5FD; }
.page-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(37,99,235,.25);
}
.page-btn:disabled { opacity: .4; pointer-events: none; }


/* ============================================================
   FEEDBACK FLOAT BUTTON + MODAL
   ============================================================ */

.feedback-float {
  position: fixed; bottom: 28px; right: 28px; z-index: 800;
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--primary), var(--primary-d));
  color: #fff;
  border: none; border-radius: 99px;
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(37,99,235,.40);
  display: flex; align-items: center; justify-content: center;
  transition: box-shadow var(--t), transform var(--t);
  animation: fbPulse 3s ease-in-out infinite;
}
.feedback-float:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(37,99,235,.55);
  animation: none;
}

@keyframes fbPulse {
  0%,100% { box-shadow: 0 4px 18px rgba(37,99,235,.40); }
  50%      { box-shadow: 0 4px 28px rgba(37,99,235,.65); }
}

.feedback-modal-overlay {
  position: fixed; inset: 0; z-index: 1050;
  background: rgba(15,23,42,.45);
  backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: flex-end;
  padding: 0 28px 92px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
}
.feedback-modal-overlay.open { opacity: 1; pointer-events: auto; }

.feedback-modal {
  width: 360px;
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  transform: translateY(20px) scale(.97);
  transition: transform .22s cubic-bezier(.34,1.56,.64,1);
}
.feedback-modal-overlay.open .feedback-modal {
  transform: translateY(0) scale(1);
}
.feedback-modal__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-l);
  background: linear-gradient(135deg, var(--primary-l), #F0F4FF);
}
.feedback-modal__header h3 {
  font-size: .95rem; font-weight: 700; margin: 0;
  display: flex; align-items: center; gap: 8px;
  color: var(--primary-d);
}
.feedback-modal__close {
  background: none; border: none; font-size: 1.4rem;
  color: var(--muted); cursor: pointer; line-height: 1; padding: 0 2px;
}
.feedback-modal__close:hover { color: var(--danger); }
.feedback-modal__body { padding: 16px 20px 8px; }
.feedback-modal__hint { font-size: .83rem; color: var(--muted); margin: 0 0 10px; }
.feedback-textarea {
  width: 100%; height: 110px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-m);
  padding: 10px 12px;
  font-size: .88rem; font-family: inherit;
  resize: none; color: var(--text);
  transition: border-color var(--t);
}
.feedback-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.feedback-modal__chars {
  text-align: right;
  font-size: .76rem; color: var(--muted-l);
  margin-top: 4px;
}
.feedback-modal__footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 10px 20px 18px;
}
.feedback-toast {
  font-size: .84rem; font-weight: 500;
  padding: 0 20px 12px;
  min-height: 0;
  transition: color var(--t);
}
.feedback-toast--success { color: var(--success); }
.feedback-toast--error   { color: var(--danger); }


/* ============================================================
   BIRD FEEDER PLACEHOLDER
   ============================================================ */

.placeholder-card {
  max-width: 520px;
  margin: 80px auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-m);
  padding: 52px 40px;
  text-align: center;
}
.placeholder-card__icon {
  font-size: 3.5rem;
  margin-bottom: 18px;
  display: block;
  background: linear-gradient(135deg, #ECFDF5, #D1FAE5);
  width: 80px; height: 80px;
  border-radius: var(--radius-xl);
  display: inline-flex; align-items: center; justify-content: center;
}
.placeholder-card h2 {
  font-size: 1.4rem; font-weight: 700; margin: 0 0 10px;
}
.placeholder-card p { color: var(--muted); line-height: 1.6; margin: 0; }


/* ============================================================
   ERROR PAGES
   ============================================================ */

.error-page {
  min-height: 80vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 40px;
}
.error-page__code {
  font-size: 6rem; font-weight: 900;
  letter-spacing: -.06em;
  background: linear-gradient(135deg, var(--primary), #7C3AED);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 8px;
}
.error-page h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 10px; }
.error-page p  { color: var(--muted); margin-bottom: 28px; }


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
  /* Navbar compact */
  .app-nav__inner {
    padding: 0 12px;
    gap: 8px;
  }
  .app-nav__brand {
    font-size: .88rem;
    gap: 6px;
  }
  .app-nav__logo {
    width: 28px;
    height: 28px;
    font-size: .8rem;
  }

  /* Hide role badge on mobile, keep buttons visible */
  .role-badge { display: none; }

  /* Tighten right side buttons */
  .app-nav__right {
    gap: 2px;
    margin-left: auto;
  }
  .btn-nav-logout {
    width: 32px;
    height: 32px;
    font-size: .9rem;
  }

  /* Dropdown button sizing */
  .nav-dropdown-wrapper { 
    display: flex;
    align-items: center;
  }
  .nav-dropdown-btn {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  /* Hide desktop tabs, show mobile dropdown */
  .app-nav__tabs { display: none; }

  .admin-sidebar {
    display: none;  /* collapsed on mobile */
  }
  .admin-page { padding: 20px 16px; }

  .page-container { padding: 24px 16px; }
  .cards-grid { grid-template-columns: 1fr; }
  .admin-grid  { grid-template-columns: 1fr; }
  .stat-cards  { grid-template-columns: repeat(2, 1fr); }

  .page-header { flex-direction: column; }

  .login-card { padding: 28px 22px; }

  .feedback-float { bottom: 20px; right: 20px; }
  .feedback-modal-overlay { padding: 0 12px 80px; }
  .feedback-modal { width: 100%; }
}
