/* =====================================================================
   Kasturi College Result Management Platform — Admin Console
   Dark Forest Enterprise SaaS Design System v4.0
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;600;700&display=swap');

/* =====================================================================
   Design Tokens
   ===================================================================== */
:root {
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --bg-dark: #060e0a;
  --bg-sidebar: #07140e;
  --bg-panel: #0d1b15;
  --bg-card: rgba(13, 27, 21, 0.88);
  --bg-card-hover: rgba(20, 38, 30, 0.95);
  --bg-input: rgba(6, 14, 10, 0.85);
  --bg-glass: rgba(16, 185, 129, 0.06);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-moss: rgba(52, 211, 153, 0.2);
  --border-emerald: rgba(16, 185, 129, 0.45);

  --emerald-primary: #10b981;
  --emerald-dark: #059669;
  --jade-deep: #047857;
  --mint-light: #34d399;
  --mint-bg: rgba(52, 211, 153, 0.12);
  --sage-muted: #84a98c;
  --amber-warning: #f59e0b;
  --rose-danger: #f43f5e;
  --blue-info: #3b82f6;

  --text-bright: #ffffff;
  --text-main: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.15);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --transition-normal: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* =====================================================================
   Reset & Base
   ===================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  background: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.935rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

/* =====================================================================
   Admin Shell — Sidebar + Main Grid
   ===================================================================== */
.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

/* =====================================================================
   Sidebar Navigation
   ===================================================================== */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 1.5rem 1rem;
  border-right: 1px solid var(--border-moss);
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.admin-brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: var(--radius-md);
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  font-family: var(--font-heading);
  background: linear-gradient(135deg, var(--jade-deep), var(--emerald-primary));
  box-shadow: 0 6px 14px rgba(16, 185, 129, 0.3);
}

.admin-brand strong {
  display: block;
  font-size: 1rem;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-bright);
}

.admin-brand small {
  display: block;
  color: var(--mint-light);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.nav-list a {
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  transition: var(--transition-normal);
  position: relative;
}

.nav-list a:hover {
  color: var(--text-bright);
  background: rgba(255, 255, 255, 0.05);
}

.nav-list a.active {
  color: #fff;
  background: linear-gradient(135deg, var(--emerald-primary), var(--emerald-dark));
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

/* Nav icons via inline SVG spans */
.nav-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 20px;
  opacity: 0.8;
}

.nav-list a.active .nav-icon {
  opacity: 1;
}

/* =====================================================================
   Main Content Area & Topbar
   ===================================================================== */
.admin-main {
  min-width: 0;
  padding: 2rem 2.5rem;
  background: var(--bg-dark);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-moss);
}

.admin-eyebrow {
  margin: 0 0 0.15rem;
  color: var(--mint-light);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

h1 {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-bright);
  line-height: 1.2;
}

h2 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-bright);
  line-height: 1.3;
}

h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-bright);
}

/* =====================================================================
   Flash Messages / Alerts
   ===================================================================== */
.alert {
  padding: 0.9rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: alertSlideIn 0.3s ease-out;
}

@keyframes alertSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.alert.success {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--mint-light);
}

.alert.error {
  background: rgba(244, 63, 94, 0.14);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fda4af;
}

.alert.warning {
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fcd34d;
}

.alert.info {
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #93c5fd;
}

/* =====================================================================
   Portal Control Banner (Dashboard)
   ===================================================================== */
.portal-control {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.75rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-moss);
  background: var(--bg-panel);
  box-shadow: var(--shadow-sm);
}

.portal-control.is-open {
  border-color: rgba(16, 185, 129, 0.35);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.06), var(--bg-panel));
}

.portal-control.is-closed {
  border-color: rgba(245, 158, 11, 0.3);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.04), var(--bg-panel));
}

.portal-status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 0.5rem;
  vertical-align: middle;
}

.portal-control.is-open .portal-status-dot {
  background: var(--emerald-primary);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
  animation: pulseGreen 2s infinite;
}

.portal-control.is-closed .portal-status-dot {
  background: var(--amber-warning);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

@keyframes pulseGreen {
  0%, 100% { box-shadow: 0 0 8px rgba(16, 185, 129, 0.6); }
  50% { box-shadow: 0 0 16px rgba(16, 185, 129, 0.9); }
}

.portal-control h2 {
  font-size: 1.15rem;
  margin-bottom: 0.15rem;
}

.portal-control .context-title {
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.portal-control .muted {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.portal-toggle-form {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

/* =====================================================================
   KPI Stat Cards
   ===================================================================== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-moss);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stat-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-emerald);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.stat-card .stat-label,
.stat-card > span:first-child {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  display: block;
}

.stat-card .stat-value,
.stat-card > strong {
  font-family: var(--font-mono);
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--mint-light);
  display: block;
  line-height: 1.1;
}

/* =====================================================================
   Panels & Containers
   ===================================================================== */
.panel {
  margin-bottom: 1.75rem;
  padding: 1.75rem;
  border: 1px solid var(--border-moss);
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
  box-shadow: var(--shadow-md);
}

.panel.narrow {
  max-width: 720px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

/* =====================================================================
   Detail List (key-value pairs, e.g. Last CSV Import)
   ===================================================================== */
.detail-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.detail-list > div {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.9rem 1rem;
  background: rgba(6, 14, 10, 0.5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.detail-list dt {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.detail-list dd {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-bright);
  word-break: break-word;
}

/* =====================================================================
   Buttons
   ===================================================================== */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  height: 40px;
  padding: 0 1.15rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition-normal);
  white-space: nowrap;
  text-decoration: none;
}

.button.primary {
  background: linear-gradient(135deg, var(--emerald-primary), var(--emerald-dark));
  color: #fff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.button.primary:hover {
  background: linear-gradient(135deg, var(--mint-light), var(--emerald-primary));
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

.button.secondary {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-moss);
  color: var(--text-bright);
}

.button.secondary:hover {
  background: rgba(52, 211, 153, 0.12);
  border-color: var(--mint-light);
  color: #fff;
  transform: translateY(-1px);
}

.button.ghost {
  background: transparent;
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}

.button.ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-bright);
  border-color: var(--border-moss);
}

.button.danger {
  background: linear-gradient(135deg, #e11d48, #be123c);
  color: #fff;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.3);
}

.button.danger:hover {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  box-shadow: 0 8px 20px rgba(244, 63, 94, 0.4);
  transform: translateY(-1px);
}

.button.tiny {
  height: 30px;
  padding: 0 0.65rem;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
}

.button.wide {
  width: 100%;
}

/* =====================================================================
   Form Controls
   ===================================================================== */
.stack-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.toolbar-form {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.15rem;
}

.field-full {
  grid-column: 1 / -1;
}

.form-group, label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

label > span {
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"],
input[type="number"],
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 0.6rem 0.9rem;
  background: var(--bg-input) !important;
  border: 1px solid var(--border-moss) !important;
  border-radius: var(--radius-md) !important;
  color: var(--text-bright) !important;
  font-family: inherit !important;
  font-size: 0.9rem !important;
  outline: none !important;
  transition: var(--transition-normal);
  box-sizing: border-box;
}

input[type="file"] {
  width: 100%;
  min-height: 42px;
  padding: 0.5rem 0.9rem;
  background: var(--bg-input) !important;
  border: 1px dashed var(--border-moss) !important;
  border-radius: var(--radius-md) !important;
  color: var(--text-secondary) !important;
  font-family: inherit !important;
  font-size: 0.88rem !important;
  cursor: pointer;
  transition: var(--transition-normal);
}

input[type="file"]:hover {
  border-color: var(--mint-light) !important;
  background: rgba(52, 211, 153, 0.06) !important;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2334d399' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.9rem center !important;
  padding-right: 2.5rem !important;
}

textarea {
  min-height: 80px;
  resize: vertical;
  line-height: 1.6;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--mint-light) !important;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.15) !important;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted) !important;
}

/* Checkbox Row — horizontal inline */
.check-row {
  flex-direction: row !important;
  align-items: center !important;
  gap: 0.65rem !important;
}

.check-row span {
  text-transform: none !important;
  font-size: 0.92rem !important;
  font-weight: 600 !important;
  color: var(--text-main) !important;
}

input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--emerald-primary);
  cursor: pointer;
  flex-shrink: 0;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

/* =====================================================================
   Data Tables
   ===================================================================== */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-moss);
  background: rgba(6, 14, 10, 0.5);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.86rem;
}

th {
  background: rgba(7, 20, 14, 0.95);
  color: var(--mint-light);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.85rem 1rem;
  border-bottom: 2px solid var(--border-moss);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: middle;
}

tbody tr {
  transition: var(--transition-normal);
}

tbody tr:hover {
  background: rgba(52, 211, 153, 0.04);
}

.table-note {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.action-cell {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.action-cell form {
  margin: 0;
  display: inline;
}

/* =====================================================================
   Status Badges
   ===================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge.selected {
  background: rgba(52, 211, 153, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: var(--mint-light);
}

.badge.not_selected {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fda4af;
}

.badge.viewed {
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.2);
  color: var(--sage-muted);
}

.badge.not_viewed {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.empty-state {
  text-align: center;
  padding: 2.5rem !important;
  color: var(--text-muted);
  font-style: italic;
}

/* =====================================================================
   Pagination
   ===================================================================== */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.pagination-info {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.pagination-links {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.pagination-links a,
.pagination-links span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  transition: var(--transition-normal);
}

.pagination-links a {
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  background: transparent;
}

.pagination-links a:hover {
  color: var(--text-bright);
  border-color: var(--mint-light);
  background: rgba(52, 211, 153, 0.1);
}

.pagination-links .active {
  color: #fff;
  background: linear-gradient(135deg, var(--emerald-primary), var(--emerald-dark));
  border-color: transparent;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.pagination-links .dots {
  color: var(--text-muted);
  border: none;
}

/* =====================================================================
   Danger Zone
   ===================================================================== */
.danger-zone {
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid rgba(244, 63, 94, 0.25);
  border-radius: var(--radius-lg);
  background: rgba(244, 63, 94, 0.04);
}

.danger-zone h3 {
  color: #fda4af;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.danger-zone p {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-bottom: 0.85rem;
}

/* =====================================================================
   Settings-specific: Logo Preview & Program Message Groups
   ===================================================================== */
.logo-preview-group {
  padding: 1.25rem;
  border: 1px solid var(--border-moss) !important;
  border-radius: var(--radius-md) !important;
  background: var(--bg-card) !important;
  margin-bottom: 0.5rem !important;
}

.logo-preview-group > span:first-child {
  font-weight: 700 !important;
  display: block !important;
  margin-bottom: 0.6rem !important;
  color: var(--text-secondary) !important;
  font-size: 0.75rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
}

.logo-preview-group img {
  max-height: 80px;
  margin-bottom: 0.85rem;
  border-radius: var(--radius-sm);
}

.program-messages-group {
  margin-top: 0.5rem !important;
  margin-bottom: 0.5rem !important;
  padding: 1.25rem !important;
  border: 1px solid var(--border-moss) !important;
  border-radius: var(--radius-md) !important;
  background: var(--bg-card) !important;
}

.program-messages-group > span:first-child {
  font-weight: 700 !important;
  display: block !important;
  margin-bottom: 0.85rem !important;
  border-bottom: 1px solid var(--border-subtle) !important;
  padding-bottom: 0.6rem !important;
  color: var(--text-secondary) !important;
  font-size: 0.75rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
}

/* =====================================================================
   Utility Text
   ===================================================================== */
.muted {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.settings-note {
  color: var(--text-muted) !important;
  font-size: 0.82rem !important;
  line-height: 1.55 !important;
  margin-bottom: 0.5rem !important;
}

code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  padding: 0.15rem 0.4rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--mint-light);
}

/* =====================================================================
   Login Page
   ===================================================================== */
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--bg-dark);
  padding: 1.5rem;
}

.login-shell {
  width: 100%;
  max-width: 400px;
}

.login-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-moss);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.login-card h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.login-card .muted {
  margin-bottom: 1.5rem;
}

.login-card .admin-brand-mark {
  margin: 0 auto 1.25rem auto;
}

/* =====================================================================
   Responsive — Mobile & Tablet
   ===================================================================== */
@media (max-width: 960px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    height: auto;
    position: relative;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 1rem;
    gap: 0.5rem;
  }

  .admin-brand {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
    margin-right: auto;
  }

  .nav-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.25rem;
    width: 100%;
  }

  .nav-list a {
    padding: 0.5rem 0.75rem;
    font-size: 0.82rem;
  }

  .nav-icon {
    display: none;
  }

  .admin-main {
    padding: 1.25rem;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .toolbar-form {
    flex-direction: column;
    align-items: stretch;
  }

  .portal-control {
    flex-direction: column;
    gap: 1rem;
  }

  .portal-toggle-form {
    width: 100%;
  }

  .portal-toggle-form .button {
    flex: 1;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .pagination-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .pagination-links {
    justify-content: center;
    flex-wrap: wrap;
  }

  .panel-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
}

@media (max-width: 480px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 1.5rem;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}
