/* ================================================================
   IRONFORGE ADMIN — admin.css
   Rebuilt from scratch — Dark industrial theme
================================================================ */

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

:root {
  --bg:       #0d0d0d;
  --surface:  #141414;
  --surface2: #1c1c1c;
  --surface3: #232323;
  --border:   rgba(255,255,255,0.08);
  --border2:  rgba(255,255,255,0.12);
  --text:     #f0f0f0;
  --muted:    #888;
  --muted2:   #555;
  --accent:   #e8001d;
  --accent2:  #ff1a33;
  --gold:     #f5a623;
  --blue:     #3b82f6;
  --green:    #22c55e;
  --red:      #ef4444;
  --sidebar-w: 240px;
  --topbar-h: 56px;
  --radius:   6px;
  --radius-lg: 10px;
  --shadow:   0 2px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);
  --font-main: 'Barlow', sans-serif;
  --font-cond: 'Barlow Condensed', sans-serif;
  --font-disp: 'Bebas Neue', sans-serif;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted2); }

/* ── UTILITIES ── */
.hidden { display: none !important; }
.active { display: block !important; }

/* ═══════════════════════════════════════
   LOGIN
═══════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.login-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, #0d0d0d 0%, #1a0005 50%, #0d0d0d 100%),
    url('https://images.pexels.com/photos/1552242/pexels-photo-1552242.jpeg?auto=compress&w=1400') center/cover;
  background-blend-mode: multiply;
}
.login-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(232,0,29,0.12) 0%, transparent 60%);
}

.login-card {
  position: relative;
  z-index: 2;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}

.login-brand { text-align: center; margin-bottom: 0.75rem; }
.login-logo {
  font-family: var(--font-disp);
  font-size: 2.4rem;
  letter-spacing: 0.05em;
  color: var(--text);
}
.login-logo span { color: var(--accent); }
.login-sub {
  font-family: var(--font-cond);
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  color: var(--muted);
  margin-top: 0.15rem;
}
.login-security {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--muted2);
  letter-spacing: 0.08em;
  margin-bottom: 1.5rem;
}

.login-fields { display: flex; flex-direction: column; gap: 1rem; }

.login-error {
  color: #ff6b6b;
  font-size: 0.82rem;
  min-height: 1.2rem;
  text-align: center;
}

.login-btn { width: 100%; margin-top: 0.5rem; }

/* ═══════════════════════════════════════
   APP LAYOUT
═══════════════════════════════════════ */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}
.app.hidden { display: none; }

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
  z-index: 200;
  transition: transform 0.3s ease;
}

.sb-brand {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.sb-logo {
  font-family: var(--font-disp);
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  line-height: 1;
  flex: 1;
}
.sb-logo span { color: var(--accent); }
.sb-tag {
  font-family: var(--font-cond);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--muted);
  width: 100%;
}
.sb-close {
  display: none;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.25rem;
}

.sb-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  color: var(--muted);
  font-family: var(--font-cond);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  text-decoration: none;
  position: relative;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active {
  background: rgba(232,0,29,0.15);
  color: var(--accent2);
  border-left: 2px solid var(--accent);
}

.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  font-family: var(--font-main);
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}
.nav-badge:empty { display: none; }

.sb-footer {
  padding: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.sb-user { font-size: 0.7rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sb-user-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.5rem;
}
.sb-user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, #7a000f 100%);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-disp);
  font-size: 1rem;
  flex-shrink: 0;
  letter-spacing: 0.03em;
}
.sb-user-info { min-width: 0; }
.sb-user-role {
  font-family: var(--font-cond);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--accent2);
  text-transform: uppercase;
}
.sb-user-email {
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}
/* ── MAIN WRAP ── */
.main-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
}

/* ── TOPBAR ── */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  gap: 1rem;
  flex-shrink: 0;
}
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.menu-toggle span { display: block; width: 20px; height: 2px; background: var(--text); border-radius: 2px; }
.topbar-title {
  font-family: var(--font-cond);
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  color: var(--text);
  flex: 1;
  text-transform: uppercase;
}
.topbar-user { font-size: 0.75rem; color: var(--muted); }

/* ── CONTENT AREA ── */
.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.section { display: none; }
.section.active { display: block; }

/* ═══════════════════════════════════════
   DASHBOARD
═══════════════════════════════════════ */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: border-color 0.2s;
}
.stat-card:hover { border-color: var(--border2); }
.stat-icon {
  width: 46px; height: 46px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon.blue { background: rgba(59,130,246,0.15); color: var(--blue); }
.stat-icon.red  { background: rgba(232,0,29,0.15);   color: var(--accent2); }
.stat-icon.gold { background: rgba(245,166,35,0.15);  color: var(--gold); }
.stat-icon.green { background: rgba(34,197,94,0.15); color: var(--green); }
.stat-value { font-family: var(--font-disp); font-size: 2rem; color: var(--text); line-height: 1; }
.stat-label { font-size: 0.75rem; color: var(--muted); margin-top: 0.15rem; letter-spacing: 0.05em; }

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 768px) { .dash-grid { grid-template-columns: 1fr; } }

.dash-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.panel-head {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-cond);
  letter-spacing: 0.08em;
  font-size: 0.9rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.panel-badge {
  font-size: 0.65rem;
  background: var(--surface3);
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 20px;
  font-family: var(--font-main);
  letter-spacing: 0;
}
.panel-badge.warning { background: rgba(245,166,35,0.15); color: var(--gold); }
.panel-list { padding: 0.5rem 0; }

.panel-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
}
.panel-item:last-child { border-bottom: none; }
.panel-item-name { flex: 1; color: var(--text); font-weight: 500; }
.panel-item-meta { color: var(--muted); font-size: 0.75rem; }
.panel-item-badge {
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
  font-family: var(--font-cond);
  letter-spacing: 0.04em;
}
.badge-new       { background: rgba(59,130,246,0.2); color: #93c5fd; }
.badge-contacted { background: rgba(245,166,35,0.2); color: #fbbf24; }
.badge-purchased { background: rgba(34,197,94,0.2);  color: #86efac; }
.badge-cancelled { background: rgba(239,68,68,0.2);  color: #fca5a5; }
.badge-expiring  { background: rgba(245,166,35,0.2); color: #fbbf24; }
.badge-expired   { background: rgba(239,68,68,0.2);  color: #fca5a5; }
.badge-active    { background: rgba(34,197,94,0.2);  color: #86efac; }
.empty-state { padding: 1.5rem; text-align: center; color: var(--muted); font-size: 0.82rem; }

/* ═══════════════════════════════════════
   SECTION HEADER
═══════════════════════════════════════ */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.section-head h2 {
  font-family: var(--font-disp);
  font-size: 1.6rem;
  letter-spacing: 0.05em;
}
.section-desc { font-size: 0.82rem; color: var(--muted); margin-top: 0.25rem; }

/* ═══════════════════════════════════════
   HERO MANAGER
═══════════════════════════════════════ */
.hero-manager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 768px) { .hero-manager { grid-template-columns: 1fr; } }

.current-hero-preview, .hero-upload-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.preview-label { font-family: var(--font-cond); letter-spacing: 0.1em; color: var(--muted); font-size: 0.78rem; margin-bottom: 0.75rem; text-transform: uppercase; }
.current-media-wrap img, .current-media-wrap video { width: 100%; border-radius: var(--radius); max-height: 260px; object-fit: cover; }
.no-media { background: var(--surface2); border-radius: var(--radius); height: 160px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 0.82rem; }

.hero-actions { margin-top: 1rem; }
.new-preview { margin-top: 1rem; }
.new-preview img, .new-preview video { width: 100%; border-radius: var(--radius); max-height: 200px; object-fit: cover; border: 1px solid var(--border); }

/* ═══════════════════════════════════════
   TOOLBAR
═══════════════════════════════════════ */
.toolbar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.search-input {
  flex: 1;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius);
  font-family: var(--font-main);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--accent); }
.filter-select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius);
  font-family: var(--font-main);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  min-width: 150px;
}
.filter-select option { background: var(--surface2); }

/* ═══════════════════════════════════════
   DATA TABLE
═══════════════════════════════════════ */
.data-table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.data-table thead { background: var(--surface2); }
.data-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-family: var(--font-cond);
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background 0.15s; }
.data-table tbody tr:hover { background: var(--surface2); }

.table-thumb { width: 42px; height: 42px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--border); }
.table-no-img { width: 42px; height: 42px; background: var(--surface3); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; color: var(--muted2); font-size: 0.6rem; }
.table-name { font-weight: 600; }
.table-actions { display: flex; gap: 0.4rem; white-space: nowrap; }

/* ═══════════════════════════════════════
   GALLERY ADMIN
═══════════════════════════════════════ */
.gallery-tabs-admin {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.gtab {
  padding: 0.5rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-family: var(--font-cond);
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.gtab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.gallery-admin-grid { display: none; }
.gallery-admin-grid.active { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }

.gallery-admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.2s;
}
.gallery-admin-card:hover { border-color: var(--border2); }
.gac-media { position: relative; height: 140px; background: var(--surface2); overflow: hidden; }
.gac-media img, .gac-media video { width: 100%; height: 100%; object-fit: cover; }
.gac-info { padding: 0.6rem 0.75rem; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.gac-name { font-size: 0.78rem; color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.ba-thumb-row { display: flex; gap: 0; height: 140px; }
.ba-thumb-row img { width: 50%; height: 100%; object-fit: cover; }
.ba-label-tag {
  font-family: var(--font-cond);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  padding: 2px 6px;
  background: rgba(0,0,0,0.7);
  color: var(--text);
  position: absolute;
  top: 6px;
  left: 6px;
  border-radius: 3px;
}
.ba-label-tag.after { left: auto; right: 6px; color: var(--green); }

/* ═══════════════════════════════════════
   FORMS & MODALS
═══════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  padding: 1rem;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}
.confirm-modal { max-width: 400px; }

.modal-header {
  padding: 1.1rem 1.25rem 0.85rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}
.modal-title {
  font-family: var(--font-disp);
  font-size: 1.2rem;
  letter-spacing: 0.08em;
}
.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.25rem;
  transition: color 0.15s;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 1.25rem; display: flex; flex-direction: column; gap: 0.85rem; flex: 1; }
.modal-footer {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  background: var(--surface);
}

/* Form elements */
.field-group { display: flex; flex-direction: column; gap: 0.35rem; }
.field-group label { font-size: 0.75rem; color: var(--muted); letter-spacing: 0.05em; text-transform: uppercase; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="tel"],
select,
textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius);
  font-family: var(--font-main);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--muted2); }
select option { background: var(--surface2); }
textarea { resize: vertical; min-height: 80px; }
input[readonly] { opacity: 0.6; cursor: not-allowed; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
@media (max-width: 500px) { .form-row { grid-template-columns: 1fr; } }

/* Password toggle */
.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 2.5rem; }
.toggle-pass {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0.25rem;
}
.toggle-pass:hover { color: var(--text); }

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--border2);
  border-radius: var(--radius-lg);
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.drop-zone:hover { border-color: var(--accent); background: rgba(232,0,29,0.04); }
.drop-zone p { font-size: 0.85rem; color: var(--muted); }
.drop-sub { font-size: 0.72rem; color: var(--muted2); }
.drop-zone.mini { padding: 1.25rem 1rem; border-radius: var(--radius); }
.drop-zone svg { color: var(--muted2); }

/* Upload progress */
.upload-progress { margin-top: 0.75rem; }
.progress-bar { background: var(--surface2); border-radius: 4px; height: 6px; overflow: hidden; }
.progress-fill { background: var(--accent); height: 100%; border-radius: 4px; width: 0%; transition: width 0.3s; }
.upload-progress span { font-size: 0.72rem; color: var(--muted); margin-top: 0.25rem; display: block; }

/* Img preview */
.img-preview { margin-top: 0.75rem; }
.img-preview img { max-height: 160px; border-radius: var(--radius); border: 1px solid var(--border); object-fit: contain; max-width: 100%; }
.img-preview video { max-height: 160px; width: 100%; border-radius: var(--radius); }
.current-img-info { font-size: 0.75rem; color: var(--muted); margin-top: 0.5rem; }
.current-img-info a { color: var(--accent2); text-decoration: none; }

/* Before/After upload */
.ba-upload-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 0.5rem; }
.ba-col { display: flex; flex-direction: column; gap: 0.4rem; }

/* Override note */
.override-note {
  font-size: 0.75rem;
  color: var(--gold);
  background: rgba(245,166,35,0.08);
  border: 1px solid rgba(245,166,35,0.2);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
}

/* ═══════════════════════════════════════
   BUTTONS
═══════════════════════════════════════ */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  font-family: var(--font-cond);
  font-size: 0.88rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.btn-primary:hover { background: var(--accent2); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border2);
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  font-family: var(--font-cond);
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-ghost:hover { background: var(--surface2); color: var(--text); }

.btn-danger {
  background: var(--red);
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  font-family: var(--font-cond);
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-danger:hover { background: #dc2626; }

.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.75rem;
  border-radius: 4px;
  font-family: var(--font-cond);
  letter-spacing: 0.06em;
  cursor: pointer;
  border: none;
  transition: background 0.15s;
}
.btn-edit { background: rgba(59,130,246,0.2); color: #93c5fd; }
.btn-edit:hover { background: rgba(59,130,246,0.35); }
.btn-del  { background: rgba(239,68,68,0.2);  color: #fca5a5; }
.btn-del:hover  { background: rgba(239,68,68,0.35); }

.btn-logout {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--muted);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius);
  font-family: var(--font-cond);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: background 0.15s, color 0.15s;
  width: 100%;
  justify-content: center;
}
.btn-logout:hover { background: var(--surface2); color: var(--text); }

/* Status badges in table */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.68rem;
  font-weight: 700;
  font-family: var(--font-cond);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ═══════════════════════════════════════
   TOAST
═══════════════════════════════════════ */
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; display: flex; flex-direction: column; gap: 0.5rem; z-index: 9999; }

.toast {
  background: var(--surface);
  border: 1px solid var(--border2);
  color: var(--text);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.toast.success { border-color: rgba(34,197,94,0.4); }
.toast.error   { border-color: rgba(239,68,68,0.4); }
.toast.warning { border-color: rgba(245,166,35,0.4); }

@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ═══════════════════════════════════════
   RESPONSIVE — Mobile
═══════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .sb-close { display: flex; }
  .menu-toggle { display: flex; }

  .content-area { padding: 1rem; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .data-table th, .data-table td { padding: 0.6rem 0.65rem; }
}

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

/* ═══════════════════════════════════════
   SETTINGS SECTION
═══════════════════════════════════════ */
.settings-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 5px;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.settings-tab {
  flex: 1;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--font-cond);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-align: center;
  min-width: 100px;
}
.settings-tab:hover { background: var(--surface2); color: var(--text); }
.settings-tab.active {
  background: rgba(232,0,29,0.15);
  color: var(--accent2);
  border-left: none;
}

.settings-pane { display: none; }
.settings-pane.active { display: block; }

.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.settings-card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.settings-card-icon {
  width: 34px; height: 34px;
  border-radius: var(--radius);
  background: rgba(232,0,29,0.12);
  color: var(--accent2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.settings-card-title {
  font-family: var(--font-cond);
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  color: var(--text);
  text-transform: uppercase;
  flex: 1;
}
.settings-card-desc {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 1px;
}
.settings-card-body { padding: 1.25rem; }

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 600px) { .settings-grid { grid-template-columns: 1fr; } }

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

.stat-input-group {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0.5rem;
  align-items: end;
}

.settings-save-bar {
  display: flex;
  justify-content: flex-end;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--surface2);
  gap: 0.75rem;
}

.social-link-row {
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.social-link-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: var(--font-cond);
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
.social-link-icon.ig  { background: rgba(225,48,108,0.15); color: #e1306c; }
.social-link-icon.fb  { background: rgba(24,119,242,0.15); color: #1877f2; }
.social-link-icon.yt  { background: rgba(255,0,0,0.15);    color: #ff0000; }
.social-link-icon.wa  { background: rgba(37,211,102,0.15); color: #25d366; }

.settings-hero-preview {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.settings-hero-preview-label {
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  font-family: var(--font-cond);
  text-transform: uppercase;
  width: 100%;
  margin-bottom: 0.25rem;
}

.stat-row-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.stat-entry {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem;
  position: relative;
}
.stat-entry-label {
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  font-family: var(--font-cond);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.stat-entry-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

/* ================================================================
   GYM TOGGLE SWITCH
================================================================ */
.gym-toggle-switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 32px;
  flex-shrink: 0;
}
.gym-toggle-switch input { opacity: 0; width: 0; height: 0; }
.gym-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #333;
  border-radius: 32px;
  transition: background 0.35s;
  border: 1px solid rgba(255,255,255,0.1);
}
.gym-toggle-slider::before {
  content: '';
  position: absolute;
  width: 24px; height: 24px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.gym-toggle-switch input:checked + .gym-toggle-slider { background: #22c55e; }
.gym-toggle-switch input:not(:checked) + .gym-toggle-slider { background: #e8001d; }
.gym-toggle-switch input:checked + .gym-toggle-slider::before { transform: translateX(28px); }

/* ================================================================
   TIMING MANAGER — Admin Editor
================================================================ */
.timing-day-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.tday-btn {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--font-cond);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.45rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s;
}
.tday-btn:hover { color: var(--text); border-color: var(--accent); }
.tday-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.timing-editor-grid {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 1.25rem;
}

.timing-editor-row {
  display: grid;
  grid-template-columns: 48px 1fr 72px 42px;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.85rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.15s;
}
.timing-editor-row:hover { border-color: var(--accent); }

.ter-hour {
  font-family: var(--font-cond);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-align: right;
}

.ter-slider-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}

/* Custom range slider */
.ter-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  background: var(--border);
}
.ter-slider.ter-free  { accent-color: #22c55e; }
.ter-slider.ter-busy  { accent-color: #f59e0b; }
.ter-slider.ter-peak  { accent-color: #e8001d; }

.ter-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: currentColor;
  cursor: pointer;
  border: 2px solid var(--bg);
}

/* Preview mini-bar below slider */
.ter-bar-preview {
  height: 5px;
  background: rgba(255,255,255,0.07);
  border-radius: 3px;
  overflow: hidden;
}
.ter-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.15s;
}
.ter-fill-free { background: #22c55e; }
.ter-fill-busy { background: #f59e0b; }
.ter-fill-peak { background: #e8001d; }

/* Status badge */
.ter-status-badge {
  font-family: var(--font-cond);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 7px;
  border-radius: 4px;
  text-align: center;
}
.ter-badge-free { background: rgba(34,197,94,0.15); color: #22c55e; }
.ter-badge-busy { background: rgba(245,158,11,0.15); color: #f59e0b; }
.ter-badge-peak { background: rgba(232,0,29,0.15);  color: #e8001d; }

/* Percentage value */
.ter-val {
  font-family: var(--font-cond);
  font-size: 0.78rem;
  color: var(--muted);
  text-align: right;
  min-width: 36px;
}

/* Legend */
.timing-editor-legend {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
}
.tel-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  color: var(--muted);
  font-family: var(--font-cond);
  letter-spacing: 0.06em;
}
.tel-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tel-dot.free { background: #22c55e; }
.tel-dot.busy { background: #f59e0b; }
.tel-dot.peak { background: #e8001d; }

/* Save bar btn-ghost in timing context */
.settings-save-bar .btn-ghost {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--font-cond);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  padding: 0.55rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.settings-save-bar .btn-ghost:hover { border-color: var(--accent); color: var(--text); }

@media (max-width: 560px) {
  .timing-editor-row {
    grid-template-columns: 40px 1fr 62px 36px;
    gap: 0.5rem;
    padding: 0.5rem 0.65rem;
  }
  .tday-btn { padding: 0.4rem 0.7rem; font-size: 0.74rem; }
}

/* ================================================================
   TIMING PAGE (sidebar section)
================================================================ */
.timing-page-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.timing-actions-bar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
  flex-wrap: wrap;
}
.timing-actions-bar .btn-ghost {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg3, #1a1a1a);
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--font-cond);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  padding: 0.55rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.timing-actions-bar .btn-ghost:hover { border-color: var(--accent); color: var(--text); }
.timing-actions-bar .btn-primary {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Updated editor row — 5 columns: hour | slider | badge | val | close-toggle */
.timing-editor-row {
  grid-template-columns: 48px 1fr 72px 42px 46px !important;
}

/* Closed row visual dimming */
.ter-closed-row {
  opacity: 0.65;
  background: rgba(255,255,255,0.02) !important;
  border-color: rgba(255,255,255,0.06) !important;
}
.ter-closed-row .ter-hour { opacity: 0.45; }

/* Closed fill style in admin preview */
.ter-fill-closed {
  background: repeating-linear-gradient(
    45deg,
    rgba(255,255,255,0.07) 0px,
    rgba(255,255,255,0.07) 4px,
    rgba(255,255,255,0.02) 4px,
    rgba(255,255,255,0.02) 8px
  ) !important;
  border: 1px solid rgba(255,255,255,0.1);
}
.ter-badge-closed {
  background: rgba(255,255,255,0.06) !important;
  color: rgba(255,255,255,0.3) !important;
}

/* Closed toggle switch */
.ter-closed-toggle {
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
}
.ter-closed-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.ter-closed-slider {
  width: 34px;
  height: 18px;
  background: var(--border);
  border-radius: 9px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.ter-closed-slider::after {
  content: '';
  position: absolute;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #fff;
  top: 3px; left: 3px;
  transition: transform 0.2s;
}
.ter-closed-toggle input:checked + .ter-closed-slider {
  background: #e8001d;
}
.ter-closed-toggle input:checked + .ter-closed-slider::after {
  transform: translateX(16px);
}

/* Legend closed dot */
.tel-dot.closed-dot {
  background: repeating-linear-gradient(
    45deg,
    rgba(255,255,255,0.3) 0px,
    rgba(255,255,255,0.3) 2px,
    rgba(255,255,255,0.08) 2px,
    rgba(255,255,255,0.08) 4px
  );
  border: 1px solid rgba(255,255,255,0.2);
}

@media (max-width: 560px) {
  .timing-editor-row {
    grid-template-columns: 38px 1fr 60px 0 40px !important;
  }
  .ter-val { display: none; }
  .timing-page-card { padding: 1rem; }
}
