/* ============================================================
   FPFCA — Admin Panel Stylesheet
   Cinematic dark theme, gold accents, premium institutional feel
   ============================================================ */

:root {
  --gold: #c9a14a;
  --gold-soft: #d9b86a;
  --gold-dark: #a8853a;
  --green: #1d5d3f;
  --green-deep: #134029;
  --terracotta: #8b3a2e;
  --cream: #f4ede1;
  --ink: #0e0d0b;
  --ink-2: #161410;
  --ink-3: #1f1c17;
  --ink-4: #2a2620;
  --line: #3a352d;
  --text: #e8e2d3;
  --text-dim: #a39c8b;
  --text-muted: #6b6557;
  --danger: #c44536;
  --success: #4a8f5c;
  --warning: #d4843a;
  --info: #4a7fa5;

  --font-display: 'Fraunces', 'Playfair Display', Georgia, serif;
  --font-body: 'Manrope', 'Inter', system-ui, sans-serif;

  --radius: 8px;
  --radius-sm: 4px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.25);

  --sidebar-w: 260px;
  --topbar-h: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: var(--font-body);
  background: var(--ink);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold-soft); }

/* ============================================================
   LOGIN PAGE
   ============================================================ */

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at top, rgba(201, 161, 74, 0.08), transparent 60%),
    radial-gradient(ellipse at bottom, rgba(29, 93, 63, 0.1), transparent 60%),
    var(--ink);
  padding: 2rem 1rem;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(180deg, var(--ink-3), var(--ink-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.login-brand {
  text-align: center;
  margin-bottom: 2rem;
}

.login-brand .mark {
  width: 56px; height: 56px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--gold-soft), var(--gold-dark));
  display: grid; place-items: center;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  font-style: italic;
}

.login-brand h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 400;
  font-style: italic;
  color: var(--cream);
  letter-spacing: 0.5px;
}

.login-brand p {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-top: 0.4rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ============================================================
   FORMS
   ============================================================ */

.form-group { margin-bottom: 1.2rem; }

.form-group label {
  display: block;
  font-size: 0.8rem;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
input[type="search"],
textarea,
select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color .2s, background .2s;
}

.form-control:focus,
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--gold);
  background: var(--ink-2);
}

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

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%),
                    linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position: calc(100% - 18px) center, calc(100% - 13px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 700px) {
  .form-row { grid-template-columns: 1fr; }
}

.form-help {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
}
.btn-primary:hover {
  background: var(--gold-soft);
  border-color: var(--gold-soft);
  color: var(--ink);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
.btn-ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.btn-danger {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}
.btn-danger:hover { opacity: 0.9; }

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
.btn-block { width: 100%; }

/* ============================================================
   ALERTS / FLASH
   ============================================================ */

.alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.2rem;
  font-size: 0.9rem;
  border-left: 3px solid;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.alert-error,
.alert-danger {
  background: rgba(196, 69, 54, 0.12);
  border-color: var(--danger);
  color: #f3b5ad;
}
.alert-success {
  background: rgba(74, 143, 92, 0.12);
  border-color: var(--success);
  color: #b6e0c0;
}
.alert-info {
  background: rgba(74, 127, 165, 0.12);
  border-color: var(--info);
  color: #b6d2e7;
}
.alert-warning {
  background: rgba(212, 132, 58, 0.12);
  border-color: var(--warning);
  color: #f0c89c;
}

/* ============================================================
   ADMIN LAYOUT — SIDEBAR + TOPBAR
   ============================================================ */

.admin-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--ink-2);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.sidebar-brand .mark {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--gold-soft), var(--gold-dark));
  display: grid; place-items: center;
  color: var(--ink);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
}

.sidebar-brand .name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--cream);
  letter-spacing: 0.3px;
}
.sidebar-brand .sub {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.7rem;
}

.nav-section {
  margin-bottom: 1.2rem;
}

.nav-section .label {
  font-size: 0.7rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 0.8rem 0.5rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 2px;
  transition: all .15s;
}
.nav-link:hover {
  background: var(--ink-3);
  color: var(--text);
}
.nav-link.active {
  background: linear-gradient(90deg, rgba(201, 161, 74, 0.15), transparent);
  color: var(--gold);
  border-left: 2px solid var(--gold);
  padding-left: calc(0.85rem - 2px);
}

.nav-link svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* MAIN AREA */

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: var(--topbar-h);
  background: var(--ink-2);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar .page-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--cream);
}

.topbar .crumbs {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.topbar .user-menu {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.8rem;
  background: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 0.85rem;
}

.user-chip .avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--ink);
  display: grid; place-items: center;
  font-weight: 600;
  font-size: 0.75rem;
}

.content {
  padding: 2rem;
  flex: 1;
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.content-header h1 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 400;
  color: var(--cream);
  letter-spacing: 0.3px;
}

.content-header .lead {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-top: 0.3rem;
}

/* ============================================================
   CARDS / PANELS
   ============================================================ */

.card {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

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

.card-header h2,
.card-header h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.1rem;
  color: var(--cream);
}

.card-body { padding: 1.5rem; }

/* ============================================================
   STAT CARDS (DASHBOARD)
   ============================================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: linear-gradient(180deg, var(--ink-2), var(--ink-3));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  background: radial-gradient(circle, rgba(201, 161, 74, 0.08), transparent 70%);
}

.stat-card .icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(201, 161, 74, 0.12);
  color: var(--gold);
  display: grid; place-items: center;
  margin-bottom: 1rem;
}

.stat-card .icon svg { width: 22px; height: 22px; }

.stat-card .value {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 400;
  color: var(--cream);
  line-height: 1;
  margin-bottom: 0.3rem;
}

.stat-card .label {
  font-size: 0.8rem;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-dim);
}

.stat-card .delta {
  display: inline-block;
  margin-top: 0.7rem;
  font-size: 0.8rem;
  color: var(--success);
}

/* ============================================================
   TABLES
   ============================================================ */

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table th,
.table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.table th {
  font-size: 0.75rem;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 500;
  background: var(--ink-3);
}

.table tbody tr:hover {
  background: var(--ink-3);
}

.table .actions {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 100px;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 500;
}
.badge-success { background: rgba(74, 143, 92, 0.15); color: #b6e0c0; }
.badge-warning { background: rgba(212, 132, 58, 0.15); color: #f0c89c; }
.badge-info { background: rgba(74, 127, 165, 0.15); color: #b6d2e7; }
.badge-danger { background: rgba(196, 69, 54, 0.15); color: #f3b5ad; }
.badge-muted { background: var(--ink-4); color: var(--text-dim); }

/* ============================================================
   GRID UTILS
   ============================================================ */

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-dash { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; }

@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-dash { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ============================================================
   ACTIVITY LIST
   ============================================================ */

.activity-list { list-style: none; }

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}
.activity-item:last-child { border-bottom: none; }

.activity-item .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold);
  margin-top: 8px;
  flex-shrink: 0;
}

.activity-item .text {
  flex: 1;
  font-size: 0.9rem;
}
.activity-item .text strong { color: var(--cream); font-weight: 500; }

.activity-item .time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    left: -100%;
    width: var(--sidebar-w);
    z-index: 100;
    transition: left .3s;
  }
  .sidebar.open { left: 0; }
  .menu-toggle { display: inline-flex; }
}

.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

@media (max-width: 700px) {
  .content { padding: 1.2rem; }
  .topbar { padding: 0 1rem; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { background: var(--ink-4); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--line); }

/* Login footer link */
.login-foot {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.login-foot a { color: var(--text-dim); }
.login-foot a:hover { color: var(--gold); }

/* Honeypot */
.hp { position: absolute; left: -9999px; top: -9999px; }
