/* =====================================================================
   FicklePass — Admin Panel Design System
   Palette: Orange / White / Black (brand colors)
   Type: Playfair Display (headings) + Inter (UI/body/data)
   ===================================================================== */

:root {
  /* Colors */
  --paper:        #ffffff;
  --paper-dim:    #f7f5f2;
  --ink:          #161616;
  --ink-light:    #2a2a2a;
  --ink-lighter:  #4a4a4a;
  --gold:         #f2730c;
  --gold-dark:    #cc5e07;
  --gold-tint:    #fef0e3;
  --green:        #3a8a5c;
  --green-tint:   #e3f3ea;
  --red:          #c44545;
  --red-tint:     #fbe8e8;
  --line:         #e8e6e2;
  --text:         #161616;
  --text-muted:   #65615b;
  --text-faint:   #9b968d;
  --white:        #ffffff;

  /* Type */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Spacing/radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(22, 22, 22, 0.06);
  --shadow-md: 0 4px 16px rgba(22, 22, 22, 0.08);
  --shadow-lg: 0 12px 32px rgba(22, 22, 22, 0.16);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

h1, h2, h3 { font-family: var(--font-display); margin: 0; color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------------
   AUTH (login page)
   --------------------------------------------------------------------- */
.auth-body {
  background: var(--ink);
  background-image: radial-gradient(circle at 20% 20%, rgba(214,140,69,0.10), transparent 40%),
                     radial-gradient(circle at 80% 80%, rgba(214,140,69,0.08), transparent 45%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-wrap { width: 100%; max-width: 420px; padding: 24px; }
.auth-card {
  background: var(--paper);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 44px 40px;
}
.auth-brand { text-align: center; margin-bottom: 28px; }
.auth-logo {
  width: 56px; height: 56px; margin: 0 auto 16px;
  background: var(--gold);
  color: var(--ink);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 22px;
}
.auth-brand h1 { font-size: 26px; margin-bottom: 4px; }
.auth-brand p { color: var(--text-muted); font-size: 13.5px; margin: 0; }
.auth-form { display: flex; flex-direction: column; gap: 6px; }
.auth-form label { font-size: 13px; font-weight: 600; color: var(--ink); margin-top: 14px; }
.auth-form input {
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  background: var(--white);
  transition: border-color 0.15s;
}
.auth-form input:focus { border-color: var(--gold); outline: none; }
.auth-footer { text-align: center; margin-top: 22px; font-size: 12px; color: var(--text-faint); letter-spacing: 0.04em; text-transform: uppercase; }

/* ---------------------------------------------------------------------
   APP SHELL
   --------------------------------------------------------------------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 248px;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 28px; }
.sidebar-logo {
  width: 36px; height: 36px;
  background: var(--gold);
  color: var(--ink);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  flex-shrink: 0;
}
.sidebar-brand span { font-family: var(--font-display); font-size: 19px; font-weight: 600; color: var(--white); }

.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: rgba(253,251,247,0.68);
  font-size: 14px; font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: rgba(253,251,247,0.06); color: var(--white); }
.nav-item.active { background: var(--gold); color: var(--ink); font-weight: 600; }
.nav-icon { font-size: 16px; width: 20px; text-align: center; opacity: 0.9; }

.sidebar-footer { border-top: 1px solid rgba(253,251,247,0.12); padding-top: 16px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 8px 12px; }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--gold-tint); color: var(--gold-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.user-name { font-size: 13.5px; font-weight: 600; color: var(--white); }
.user-role { font-size: 11.5px; color: rgba(253,251,247,0.5); }
.logout-link {
  display: block; text-align: center;
  font-size: 13px; font-weight: 600; color: var(--gold);
  padding: 9px; border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.logout-link:hover { background: rgba(214,140,69,0.12); }

.main-content { flex: 1; min-width: 0; }
.topbar {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 22px 36px;
}
.page-title { font-size: 24px; }
.page-body { padding: 28px 36px 60px; }

/* ---------------------------------------------------------------------
   BUTTONS
   --------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 14px; font-weight: 600;
  transition: transform 0.1s, box-shadow 0.15s, background 0.15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--gold); color: var(--ink); }
.btn-primary:hover { background: var(--gold-dark); }
.btn-secondary { background: var(--white); color: var(--ink); border: 1.5px solid var(--line); }
.btn-secondary:hover { border-color: var(--ink-lighter); }
.btn-ghost { background: transparent; color: var(--ink-lighter); }
.btn-ghost:hover { background: var(--paper-dim); }
.btn-danger { background: var(--red-tint); color: var(--red); }
.btn-danger:hover { background: #f5d0d0; }
.btn-success { background: var(--green); color: var(--white); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------------------------------------------------------------------
   CARDS / PANELS
   --------------------------------------------------------------------- */
.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.panel-pad { padding: 24px; }
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}
.panel-header h2 { font-size: 17px; }

/* Stat tiles */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-tile {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.stat-tile .stat-label { font-size: 12.5px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-tile .stat-value { font-family: var(--font-display); font-size: 32px; color: var(--ink); margin-top: 6px; }
.stat-tile .stat-sub { font-size: 12.5px; color: var(--text-faint); margin-top: 4px; }
.stat-tile.accent { border-color: var(--gold); background: linear-gradient(135deg, var(--gold-tint), var(--white)); }

/* ---------------------------------------------------------------------
   FORMS
   --------------------------------------------------------------------- */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.form-group .hint { font-size: 12px; color: var(--text-faint); margin-top: 4px; }
.form-control {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--white);
  color: var(--text);
}
.form-control:focus { border-color: var(--gold); outline: none; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ---------------------------------------------------------------------
   TABLES
   --------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data-table thead th {
  text-align: left;
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 12px 16px;
  border-bottom: 2px solid var(--line);
  background: var(--paper-dim);
  white-space: nowrap;
}
table.data-table tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.data-table tbody tr:hover { background: var(--paper-dim); }
table.data-table tbody tr:last-child td { border-bottom: none; }

/* ---------------------------------------------------------------------
   STATUS PILLS (wax-seal style)
   --------------------------------------------------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.03em;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.04);
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.pill-in { background: var(--green-tint); color: var(--green); }
.pill-in::before { background: var(--green); }
.pill-not-yet { background: var(--paper-dim); color: var(--text-muted); }
.pill-not-yet::before { background: var(--text-faint); }
.pill-gold { background: var(--gold-tint); color: var(--gold-dark); }
.pill-gold::before { background: var(--gold); }
.pill-red { background: var(--red-tint); color: var(--red); }
.pill-red::before { background: var(--red); }

/* ---------------------------------------------------------------------
   BADGES (card type)
   --------------------------------------------------------------------- */
.badge { display: inline-block; padding: 3px 9px; border-radius: 5px; font-size: 11.5px; font-weight: 700; }
.badge-single { background: var(--paper-dim); color: var(--ink-lighter); }
.badge-double { background: var(--ink); color: var(--gold-tint); }

/* ---------------------------------------------------------------------
   ALERTS
   --------------------------------------------------------------------- */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13.5px; margin-bottom: 16px; }
.alert-error { background: var(--red-tint); color: #8a2e2e; }
.alert-success { background: var(--green-tint); color: #1e5c3a; }
.alert-info { background: var(--gold-tint); color: var(--gold-dark); }

/* ---------------------------------------------------------------------
   MODALS
   --------------------------------------------------------------------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(26,34,56,0.45);
  display: none;
  align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  max-width: 560px; width: 100%;
  max-height: 88vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.modal-header h3 { font-size: 18px; }
.modal-close { background: none; border: none; font-size: 22px; color: var(--text-faint); line-height: 1; }
.modal-body { padding: 24px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--line); }

/* ---------------------------------------------------------------------
   CARD TEMPLATE GRID (Card Style Picker)
   --------------------------------------------------------------------- */
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.template-card {
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
  background: var(--white);
}
.template-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.template-card.selected { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-tint); }
.template-card .tpl-preview { height: 110px; display: flex; align-items: center; justify-content: center; }
.template-card .tpl-name { padding: 10px 12px; font-size: 12.5px; font-weight: 600; color: var(--ink); border-top: 1px solid var(--line); }
.template-card .tpl-category { font-size: 10.5px; color: var(--text-faint); padding: 0 12px 10px; text-transform: uppercase; letter-spacing: 0.03em; }

/* ---------------------------------------------------------------------
   EMPTY STATES
   --------------------------------------------------------------------- */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.5; }
.empty-state h3 { font-size: 16px; color: var(--ink); margin-bottom: 6px; }
.empty-state p { font-size: 13.5px; max-width: 360px; margin: 0 auto 18px; }

/* ---------------------------------------------------------------------
   UTILITY
   --------------------------------------------------------------------- */
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap-8 { display: flex; gap: 8px; align-items: center; }
.flex-gap-12 { display: flex; gap: 12px; align-items: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.text-muted { color: var(--text-muted); }
.text-faint { color: var(--text-faint); }
.text-sm { font-size: 13px; }
.w-full { width: 100%; }

@media (max-width: 900px) {
  .sidebar { display: none; }
  .page-body { padding: 20px; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}
