/* ======================================================
   WIZ CHRONICLES — GLOBAL STYLESHEET
   Split theme: 
   - Landing/Apply = Parchment scroll on dark castle wall
   - Admin = Dark modern indigo-purple
   ====================================================== */

:root {
  /* === Castle / Parchment Theme (Landing + Apply) === */
  --bg-castle: #0b0a08;
  --bg-castle-wall: #141210;
  --color-gold: #c5a059;
  --color-gold-bright: #e8c868;
  --color-gold-dim: #8e6c27;
  --color-gold-glow: rgba(197, 160, 89, 0.25);
  --color-parchment: #f5ecd8;
  --color-parchment-dark: #e8dcc4;
  --color-ink: #2c1a04;
  --color-ink-light: #5c4021;
  --color-scroll-edge: #3c2a13;

  /* === Admin Dark Theme === */
  --admin-bg: #0a0a0f;
  --admin-surface: #12121a;
  --admin-card: #1a1a2e;
  --admin-border: rgba(99, 102, 241, 0.15);
  --admin-accent: #6366f1;
  --admin-accent-bright: #818cf8;
  --admin-accent-glow: rgba(99, 102, 241, 0.2);
  --admin-text: #e2e0ff;
  --admin-text-muted: #8b8b9e;
  --admin-violet: #a78bfa;

  /* === Shared === */
  --color-success: #22c55e;
  --color-danger: #ef4444;
  --font-serif: var(--font-cinzel), 'Cinzel', serif;
  --font-body: var(--font-lora), 'Lora', serif;

  background-color: var(--bg-castle);
  color: #d4c5a9;
}

/* ===========================
   RESET & BASE
   =========================== */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  background: var(--bg-castle);
}

/* Subtle stone texture overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(197, 160, 89, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(197, 160, 89, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ===========================
   TYPOGRAPHY
   =========================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  letter-spacing: 0.08em;
}

a {
  color: var(--color-gold);
  text-decoration: none;
  transition: all 0.3s ease;
}
a:hover {
  color: var(--color-gold-bright);
  text-shadow: 0 0 8px var(--color-gold-glow);
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #0d0c0a; }
::-webkit-scrollbar-thumb { background: #2a2520; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-gold-dim); }

/* ===========================
   LAYOUT UTILITIES
   =========================== */
.container-center {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.layout-wrapper {
  max-width: 1200px;
  width: 95%;
  margin: 0 auto;
}
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.mt-8 { margin-top: 32px; }
.gap-2 { gap: 8px; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }

/* =========================================================
   PARCHMENT / SCROLL THEME (Landing + Apply pages)
   ========================================================= */

/* --- Magic Header --- */
.magic-header {
  text-align: center;
  padding: 40px 20px;
  position: relative;
  z-index: 10;
}
.magic-title {
  font-size: 2.8rem;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--color-gold-bright) 0%, var(--color-gold) 50%, var(--color-gold-dim) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 20px rgba(197, 160, 89, 0.15));
}
.magic-subtitle {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: #a89474;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  margin-bottom: 20px;
}

/* --- Divider --- */
.divider-line {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 15px auto;
  width: 250px;
}
.divider-line::before, .divider-line::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--color-gold-dim), transparent);
}
.divider-line .wand-icon {
  margin: 0 15px;
  color: var(--color-gold);
  filter: drop-shadow(0 0 4px var(--color-gold-glow));
}

/* --- Parchment Scroll Card --- */
.parchment-scroll {
  background: linear-gradient(180deg, #faf5e9 0%, var(--color-parchment) 20%, var(--color-parchment) 80%, #f0e6ce 100%);
  color: var(--color-ink);
  border-radius: 4px;
  padding: 45px 40px;
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.7),
    inset 0 0 60px rgba(184, 134, 11, 0.08);
  border: 1px solid #d4c7a5;
  border-top: 12px solid var(--color-scroll-edge);
  border-bottom: 12px solid var(--color-scroll-edge);
  position: relative;
  max-width: 800px;
  width: 100%;
  margin: 0 auto 40px;
}
.parchment-scroll::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 5%; right: 5%;
  height: 6px;
  background: #1e150a;
  border-radius: 3px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}
.parchment-scroll::after {
  content: "";
  position: absolute;
  bottom: -12px;
  left: 5%; right: 5%;
  height: 6px;
  background: #1e150a;
  border-radius: 3px;
  box-shadow: 0 -2px 4px rgba(0,0,0,0.4);
}
.parchment-scroll h2 {
  color: var(--color-ink);
  text-shadow: none;
  font-size: 1.8rem;
  text-align: center;
  margin-bottom: 25px;
  border-bottom: 2px double var(--color-gold-dim);
  padding-bottom: 12px;
}

/* --- Wax Seal --- */
.wax-seal-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px 10px;
}
.wax-seal {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #c8a04e 0%, var(--color-gold-dim) 70%, #5a4010 100%);
  box-shadow: 
    0 4px 10px rgba(0,0,0,0.5),
    inset 0 2px 4px rgba(255,255,255,0.2),
    inset 0 -3px 5px rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: bold;
  text-shadow: 0 -1px 2px rgba(0,0,0,0.6);
  margin-bottom: 25px;
  border: 3px solid var(--color-gold);
  position: relative;
  transform: rotate(-5deg);
}
.wax-seal::after {
  content: "W";
  position: absolute;
  font-size: 2.2rem;
  font-family: var(--font-serif);
  opacity: 0.3;
}

/* --- Magical Button (gold) --- */
.magic-button {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  font-weight: 600;
  text-transform: uppercase;
  color: #1a0e03;
  background: linear-gradient(135deg, var(--color-gold-bright) 0%, var(--color-gold) 60%, var(--color-gold-dim) 100%);
  border: 1px solid var(--color-gold);
  border-radius: 4px;
  padding: 13px 26px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s ease;
}
.magic-button:hover {
  background: linear-gradient(135deg, #f0d078 0%, var(--color-gold-bright) 100%);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4), 0 0 12px var(--color-gold-glow);
  transform: translateY(-1px);
  color: #1a0e03;
}
.magic-button:active {
  transform: translateY(1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.magic-button.gold {
  background: linear-gradient(135deg, var(--admin-accent) 0%, #4f46e5 100%);
  border: 1px solid var(--admin-accent-bright);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.magic-button.gold:hover {
  background: linear-gradient(135deg, var(--admin-accent-bright) 0%, var(--admin-accent) 100%);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4), 0 0 12px var(--admin-accent-glow);
}
.magic-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* --- Tabs (inside parchment) --- */
.magic-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 30px;
  border-bottom: 2px solid #d4c7a5;
  padding-bottom: 12px;
}
.magic-tab {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  background: transparent;
  border: none;
  color: #8c7355;
  padding: 10px 22px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  font-weight: 600;
}
.magic-tab:hover { color: var(--color-ink); }
.magic-tab.active { color: var(--color-ink); }
.magic-tab.active::after {
  content: "";
  position: absolute;
  bottom: -14px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--color-gold-dim);
  border-radius: 2px;
}

/* --- Form Styles (ink on parchment) --- */
.parchment-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-label {
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-weight: 600;
  color: #4b3621;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-input, .form-textarea {
  background-color: rgba(255, 255, 255, 0.45);
  border: 1px solid #c4b898;
  border-bottom: 2px solid var(--color-gold-dim);
  border-radius: 4px;
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 11px 14px;
  transition: all 0.3s ease;
  width: 100%;
}
.form-input:focus, .form-textarea:focus {
  background-color: rgba(255, 255, 255, 0.7);
  border-color: var(--color-gold);
  outline: none;
  box-shadow: 0 0 6px rgba(142, 108, 39, 0.15);
}
.form-input::placeholder, .form-textarea::placeholder {
  color: #8d7a64;
  opacity: 0.7;
}
.form-textarea {
  resize: vertical;
  min-height: 110px;
}
.form-hint {
  font-size: 0.82rem;
  color: #6e5a44;
  margin-top: 3px;
  font-style: italic;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
@media (min-width: 640px) {
  .form-row { grid-template-columns: 1fr 1fr; }
}

/* --- Status Cards (Apply page) --- */
.status-card {
  padding: 28px;
  border-radius: 6px;
  margin-top: 20px;
  text-align: center;
}
.status-card.approved {
  background-color: rgba(34, 197, 94, 0.08);
  border: 1px dashed var(--color-success);
}
.status-card.rejected {
  background-color: rgba(239, 68, 68, 0.08);
  border: 1px dashed var(--color-danger);
}
.status-card.pending {
  background-color: rgba(197, 160, 89, 0.06);
  border: 1px dashed var(--color-gold);
}
.status-badge {
  font-family: var(--font-serif);
  font-weight: bold;
  font-size: 1.15rem;
  display: inline-block;
  margin-bottom: 12px;
}
.status-badge.approved { color: var(--color-success); }
.status-badge.rejected { color: var(--color-danger); }
.status-badge.pending { color: var(--color-gold-bright); text-shadow: 0 0 8px var(--color-gold-glow); }

/* =========================================================
   ADMIN DARK THEME
   ========================================================= */

/* --- Discord Profile Header (used in both themes) --- */
.user-profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  background-color: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 25px;
}
.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.user-avatar {
  border-radius: 50%;
  border: 2px solid var(--admin-accent);
  background-color: #333;
}
.user-names { display: flex; flex-direction: column; }
.user-displayname {
  font-weight: bold;
  color: var(--admin-text);
  font-size: 0.95rem;
}
.user-discordtag {
  color: var(--admin-text-muted);
  font-size: 0.8rem;
}

.admin-nav-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 1024px) {
  .user-profile-header {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .user-info {
    width: 100%;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(99, 102, 241, 0.15);
  }
  .admin-nav-actions {
    justify-content: flex-start;
    width: 100%;
  }
}

/* --- Admin Container --- */
.admin-container {
  max-width: 1250px;
  width: 96%;
  margin: 0 auto 50px;
}

/* --- Stat Cards --- */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 25px;
}
.stat-card {
  background-color: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  padding: 16px 12px;
  text-align: center;
  transition: border-color 0.3s;
}
.stat-card:hover { border-color: var(--admin-accent); }
.stat-val {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--admin-accent-bright);
}
.stat-lbl {
  color: var(--admin-text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
}

/* --- Admin Tabs --- */
.admin-tabs {
  display: flex;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 20px;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.admin-tab-btn {
  flex: 1;
  min-width: 130px;
  background: transparent;
  border: none;
  padding: 12px 10px;
  font-family: var(--font-serif);
  color: var(--admin-text-muted);
  cursor: pointer;
  font-size: 0.88rem;
  transition: all 0.3s;
  text-align: center;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}
.admin-tab-btn:hover {
  color: var(--admin-text);
  background-color: rgba(99, 102, 241, 0.04);
}
.admin-tab-btn.active {
  color: var(--admin-accent-bright);
  background-color: rgba(99, 102, 241, 0.08);
  border-bottom-color: var(--admin-accent);
}

/* --- Wizard Card (Admin dark card) --- */
.wizard-card {
  background-color: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  position: relative;
  transition: all 0.3s ease;
  overflow: hidden;
}
.wizard-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 2px;
  background: linear-gradient(to right, transparent, var(--admin-accent), transparent);
  opacity: 0.5;
}
.wizard-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
}

/* --- Ledger (Application List) --- */
.ledger-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ledger-item {
  background-color: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  padding: 18px;
  transition: all 0.3s;
}
.ledger-item.pending { border-left: 4px solid var(--color-gold); }
.ledger-item.approved { border-left: 4px solid var(--color-success); }
.ledger-item.rejected { border-left: 4px solid var(--color-danger); }
.ledger-item.form-approved {
  border-left: 4px solid var(--admin-accent);
  background-color: rgba(99, 102, 241, 0.03);
}

.ledger-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  cursor: pointer;
}
.ledger-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ledger-type-badge {
  font-family: var(--font-serif);
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: bold;
  letter-spacing: 0.04em;
}
.ledger-type-badge.student {
  background-color: rgba(99, 102, 241, 0.15);
  color: var(--admin-accent-bright);
  border: 1px solid var(--admin-accent);
}
.ledger-type-badge.staff {
  background-color: rgba(167, 139, 250, 0.15);
  color: var(--admin-violet);
  border: 1px solid var(--admin-violet);
}
.ledger-username {
  font-size: 1.05rem;
  font-family: var(--font-serif);
  font-weight: bold;
  color: var(--admin-text);
}
.ledger-icname {
  color: var(--admin-text-muted);
  font-size: 0.85rem;
}
.ledger-date {
  font-size: 0.78rem;
  color: var(--admin-text-muted);
}

/* --- Ledger Details --- */
.ledger-details {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--admin-border);
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 768px) {
  .ledger-details { grid-template-columns: 1fr 1fr; }
  .ledger-details .backstory-col { grid-column: span 2; }
}
.detail-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.detail-label {
  font-size: 0.78rem;
  color: var(--admin-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.detail-value {
  font-size: 0.92rem;
  color: var(--admin-text);
  background-color: rgba(0, 0, 0, 0.25);
  padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid rgba(99, 102, 241, 0.05);
}
.detail-value.backstory {
  white-space: pre-wrap;
  line-height: 1.6;
  font-style: italic;
  font-family: var(--font-body);
}

/* --- Action Buttons --- */
.ledger-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  justify-content: flex-end;
}
.action-btn {
  font-family: var(--font-serif);
  padding: 7px 16px;
  border-radius: 4px;
  font-size: 0.82rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.action-btn.approve {
  background-color: rgba(34, 197, 94, 0.15);
  color: var(--color-success);
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.action-btn.approve:hover {
  background-color: rgba(34, 197, 94, 0.25);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.2);
}
.action-btn.reject {
  background-color: rgba(239, 68, 68, 0.15);
  color: var(--color-danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.action-btn.reject:hover {
  background-color: rgba(239, 68, 68, 0.25);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.2);
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-content {
  background-color: var(--admin-card);
  border: 1px solid var(--admin-accent);
  border-radius: 8px;
  padding: 28px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
  position: relative;
}
.modal-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--admin-accent-bright);
  margin-bottom: 12px;
}
.modal-textarea {
  background-color: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 4px;
  color: var(--admin-text);
  font-family: var(--font-body);
  font-size: 0.92rem;
  padding: 10px;
  width: 100%;
  min-height: 90px;
  resize: vertical;
  margin-bottom: 16px;
}
.modal-textarea:focus {
  outline: none;
  border-color: var(--admin-accent);
}
.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* App detail modal animation */
.app-detail-modal {
  animation: modalSlideIn 0.25s ease-out;
}
@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- Drawer (side panel) --- */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(3px);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.drawer-overlay.active { opacity: 1; pointer-events: auto; }
.drawer-panel {
  position: fixed;
  top: 0; right: -600px;
  width: 100%; max-width: 600px;
  height: 100%;
  background-color: var(--admin-surface);
  border-left: 2px solid var(--admin-accent);
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.6);
  z-index: 95;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}
.drawer-panel.active { right: 0; }
.drawer-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--admin-bg);
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.drawer-footer {
  padding: 18px 22px;
  border-top: 1px solid var(--admin-border);
  background-color: var(--admin-bg);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* =========================================================
   RESPONSIVE DESIGN
   ========================================================= */

/* --- Tablet (max-width: 1024px) --- */
@media (max-width: 1024px) {
  .admin-stats-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  .user-profile-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start !important;
  }
  .houses-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* --- Mobile (max-width: 768px) --- */
@media (max-width: 768px) {
  .admin-container {
    padding: 12px 6px !important;
  }
  .admin-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
  }
  .stat-val { font-size: 1.5rem; }
  .stat-lbl { font-size: 0.72rem; }

  .admin-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .admin-tab-btn {
    white-space: nowrap;
    padding: 10px 12px;
    font-size: 0.82rem;
  }

  .ledger-header {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 8px;
  }
  .ledger-info { width: 100%; }
  .ledger-username { font-size: 0.88rem !important; }

  .magic-title { font-size: 1.8rem !important; }
  .magic-subtitle { font-size: 0.8rem !important; }

  .wizard-card { padding: 16px !important; }

  .modal-content {
    margin: 10px;
    max-width: calc(100% - 20px) !important;
    max-height: 95vh !important;
    padding: 18px !important;
  }
  .app-detail-modal {
    width: calc(100% - 20px) !important;
  }

  .parchment-scroll {
    padding: 25px 18px !important;
    margin: 0 8px !important;
  }

  .houses-grid {
    grid-template-columns: 1fr !important;
  }

  .user-profile-header > div:last-child {
    flex-wrap: wrap;
    gap: 6px;
  }
  .user-profile-header .magic-button,
  .user-profile-header .magic-button.gold {
    font-size: 0.68rem !important;
    padding: 6px 10px !important;
  }
}

/* --- Small Mobile (max-width: 480px) --- */
@media (max-width: 480px) {
  .admin-stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px;
  }
  .stat-card { padding: 12px 8px; }
  .stat-val { font-size: 1.2rem; }
  .magic-title { font-size: 1.4rem !important; }

  .parchment-scroll {
    padding: 20px 14px !important;
    margin: 0 4px !important;
    border-top-width: 8px;
    border-bottom-width: 8px;
  }

  .form-input,
  .form-textarea { font-size: 0.88rem !important; }
  .form-label { font-size: 0.78rem !important; }

  .magic-button {
    padding: 10px 20px !important;
    font-size: 0.85rem !important;
  }
}

/* ===========================
   ADMIN CI OVERRIDE — Gold → Purple
   Only applies inside .admin-container
   (Landing + Apply pages keep gold)
   =========================== */
.admin-container {
  --color-gold: #818cf8;
  --color-gold-bright: #a5b4fc;
  --color-gold-dim: #4f46e5;
  --color-gold-glow: rgba(99, 102, 241, 0.25);
  --color-parchment-darker: rgba(26, 26, 46, 0.8);
  --color-parchment-base: #e2e0ff;
  color: #e2e0ff;
}

.admin-container a {
  color: #818cf8;
}
.admin-container a:hover {
  color: #a5b4fc;
  text-shadow: 0 0 8px rgba(99, 102, 241, 0.25);
}

.admin-container .magic-title {
  background: linear-gradient(135deg, #a5b4fc 0%, #818cf8 50%, #6366f1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.3));
}

.admin-container .magic-subtitle {
  color: #8b8b9e;
}

.admin-container .divider-line {
  background: linear-gradient(to right, transparent, #4f46e5, transparent);
}

.admin-container .magic-button {
  background: linear-gradient(135deg, #a5b4fc 0%, #6366f1 60%, #4f46e5 100%);
  border: 1px solid #818cf8;
  color: #fff;
}
.admin-container .magic-button:hover {
  background: linear-gradient(135deg, #c7d2fe 0%, #818cf8 100%);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4), 0 0 12px rgba(99, 102, 241, 0.3);
}

.admin-container .wizard-card {
  background-color: rgba(26, 26, 46, 0.8);
  border-color: rgba(99, 102, 241, 0.15);
}

.admin-container .form-input,
.admin-container .form-textarea {
  background-color: rgba(26, 26, 46, 0.9);
  border-color: rgba(99, 102, 241, 0.2);
  color: #e2e0ff;
}

.admin-container .stat-card {
  background-color: rgba(26, 26, 46, 0.6);
  border-color: rgba(99, 102, 241, 0.1);
}

.admin-container .ledger-item.pending {
  border-left-color: #818cf8;
}

.admin-container .admin-tab-btn.active {
  border-color: #818cf8;
}

.admin-container .status-badge.pending {
  color: #a5b4fc;
  text-shadow: 0 0 8px rgba(99, 102, 241, 0.25);
}

.admin-container .modal-content {
  background-color: #1a1a2e;
  border-color: rgba(99, 102, 241, 0.2);
}
