/* ================================================================
   LovePsychicIndi Admin Panel — Global Stylesheet
   Warm Sacred Celestial Theme
   ================================================================ */

/* ── Fonts ────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Variables ────────────────────────────────────────────────── */
:root {
  --saffron:      #FF6F00;
  --saffron-light:#FFAB40;
  --teal:         #00695C;
  --teal-light:   #4DB6AC;
  --gold:         #E8930A;
  --dark:         #1C1C2E;
  --dark2:        #252540;
  --dark3:        #2D2D50;
  --ivory:        #FFF8F0;
  --card:         #FFFFFF;
  --surface:      #FFF3E0;
  --border:       #EEE8DF;
  --text:         #1C1C2E;
  --text2:        #5D5D7A;
  --dim:          #9E9EB8;
  --success:      #2E7D32;
  --error:        #C0392B;
  --warning:      #F57C00;
  --info:         #0277BD;
  --sidebar-w:    240px;
  --topbar-h:     64px;
  --radius:       14px;
  --radius-sm:    8px;
  --shadow:       0 4px 20px rgba(255,111,0,.10);
  --shadow-dark:  0 8px 32px rgba(28,28,46,.14);
}

/* ── Reset ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body { font-family: 'Inter', sans-serif; background: #F4F0EC; color: var(--text); line-height: 1.5; min-height: 100vh; }
a { text-decoration: none; color: inherit; }
button, input, select, textarea { font-family: inherit; }
img { max-width: 100%; display: block; }

/* ── Scrollbar ────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--dim); }

/* ================================================================
   LOGIN PAGE
   ================================================================ */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--dark) 0%, #2D1A00 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.login-card {
  background: white; border-radius: 24px;
  padding: 48px 44px; width: 100%; max-width: 440px;
  box-shadow: 0 32px 80px rgba(28,28,46,.4);
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo .logo-icon {
  width: 64px; height: 64px; border-radius: 18px;
  background: linear-gradient(135deg, var(--saffron), var(--gold));
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 28px; margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(255,111,0,.35);
}
.login-logo h1 { font-family: 'Playfair Display', serif; font-size: 22px; color: var(--text); margin-bottom: 4px; }
.login-logo p { font-size: 13px; color: var(--dim); }
.login-alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 20px; font-size: 13px; font-weight: 500; }
.login-alert.error { background: rgba(192,57,43,.08); color: var(--error); border: 1px solid rgba(192,57,43,.2); }
.login-alert.success { background: rgba(46,125,50,.08); color: var(--success); border: 1px solid rgba(46,125,50,.2); }

/* ================================================================
   LAYOUT
   ================================================================ */
.admin-layout { display: flex; min-height: 100vh; }

/* ── Sidebar ──────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w); min-height: 100vh;
  background: var(--dark); position: fixed; top: 0; left: 0; bottom: 0;
  display: flex; flex-direction: column; z-index: 100;
  box-shadow: 4px 0 24px rgba(0,0,0,.25);
  overflow-y: auto;
}
.sidebar-brand {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: 12px;
}
.brand-icon {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--saffron), var(--gold));
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.brand-text h2 { font-family: 'Playfair Display', serif; font-size: 14px; color: white; }
.brand-text p { font-size: 11px; color: rgba(255,255,255,.4); }

.sidebar-nav { padding: 12px; flex: 1; }
.nav-section-label {
  font-size: 10px; font-weight: 700; letter-spacing: 1.2px;
  color: rgba(255,255,255,.25); padding: 14px 10px 6px; text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 10px; margin-bottom: 2px;
  color: rgba(255,255,255,.6); font-size: 13.5px; font-weight: 500;
  cursor: pointer; transition: all .18s ease; position: relative;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: rgba(255,255,255,.9); }
.nav-item.active {
  background: rgba(255,111,0,.14); color: var(--saffron-light);
  border: 1px solid rgba(255,111,0,.2);
}
.nav-item .nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-badge {
  margin-left: auto; background: var(--saffron); color: white;
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px;
}
.sidebar-footer {
  padding: 16px; border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-footer .nav-item { border-radius: 10px; }

/* ── Main Content ─────────────────────────────────────────────── */
.main-content { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

/* ── Top Bar ──────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h); background: white;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 28px;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 8px rgba(28,28,46,.06);
}
.topbar-title { font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 700; color: var(--text); }
.topbar-subtitle { font-size: 12px; color: var(--dim); margin-top: 1px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.topbar-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border);
  background: white; display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 16px; color: var(--text2); transition: all .15s;
}
.topbar-btn:hover { background: var(--surface); border-color: var(--saffron); color: var(--saffron); }
.topbar-admin {
  display: flex; align-items: center; gap: 10px; padding: 6px 14px;
  background: var(--ivory); border-radius: 24px; border: 1px solid var(--border); cursor: pointer;
}
.topbar-admin-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--saffron), var(--gold));
  display: flex; align-items: center; justify-content: center; font-size: 12px; color: white; font-weight: 700;
}
.topbar-admin-name { font-size: 13px; font-weight: 600; color: var(--text); }

/* ── Page Content ─────────────────────────────────────────────── */
.page-content { padding: 28px 32px; flex: 1; }

/* ── Page Header ──────────────────────────────────────────────── */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 16px; }
.page-header-left h1 { font-family: 'Playfair Display', serif; font-size: 26px; font-weight: 800; color: var(--text); }
.page-header-left p { font-size: 13px; color: var(--text2); margin-top: 3px; }

/* ================================================================
   CARDS & COMPONENTS
   ================================================================ */
.card {
  background: white; border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.card-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-header h2 { font-size: 15px; font-weight: 700; color: var(--text); }
.card-body { padding: 24px; }

/* ── KPI Cards ────────────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 24px; }
.kpi-card {
  background: white; border-radius: var(--radius); padding: 22px;
  border: 1px solid var(--border); box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.kpi-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.kpi-card.saffron::before { background: var(--saffron); }
.kpi-card.teal::before { background: var(--teal); }
.kpi-card.gold::before { background: var(--gold); }
.kpi-card.info::before { background: var(--info); }
.kpi-label { font-size: 12px; font-weight: 600; color: var(--dim); letter-spacing: .5px; text-transform: uppercase; margin-bottom: 10px; }
.kpi-value { font-family: 'Playfair Display', serif; font-size: 32px; font-weight: 800; color: var(--text); }
.kpi-sub { font-size: 12px; color: var(--text2); margin-top: 6px; display: flex; align-items: center; gap: 4px; }
.kpi-icon { position: absolute; right: 18px; top: 18px; font-size: 28px; opacity: .18; }
.kpi-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.kpi-badge.up { background: rgba(46,125,50,.1); color: var(--success); }
.kpi-badge.down { background: rgba(192,57,43,.1); color: var(--error); }

/* ── Stat Row ─────────────────────────────────────────────────── */
.stat-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.stat-pill {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; background: white; border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.stat-pill-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.stat-pill-val { font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 800; color: var(--text); }
.stat-pill-lbl { font-size: 12px; color: var(--text2); }

/* ── Table ────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
table th { padding: 11px 16px; text-align: left; font-size: 11px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .6px; border-bottom: 1px solid var(--border); background: var(--ivory); }
table td { padding: 13px 16px; font-size: 13px; color: var(--text); border-bottom: 1px solid var(--border); }
table tr:last-child td { border-bottom: none; }
table tr:hover td { background: rgba(255,111,0,.025); }
.table-empty { text-align: center; padding: 48px; color: var(--dim); font-size: 14px; }

/* ── Badges ───────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.badge-success { background: rgba(46,125,50,.1); color: var(--success); }
.badge-error   { background: rgba(192,57,43,.1);  color: var(--error); }
.badge-warning { background: rgba(245,124,0,.1);  color: var(--warning); }
.badge-info    { background: rgba(2,119,189,.1);   color: var(--info); }
.badge-saffron { background: rgba(255,111,0,.1);   color: var(--saffron); }
.badge-teal    { background: rgba(0,105,92,.1);    color: var(--teal); }
.badge-gold    { background: rgba(232,147,10,.1);  color: var(--gold); }

/* ── Buttons ──────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 18px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; border: none; transition: all .16s ease; }
.btn-primary { background: linear-gradient(135deg, var(--saffron), var(--gold)); color: white; box-shadow: 0 4px 14px rgba(255,111,0,.3); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(255,111,0,.4); }
.btn-secondary { background: white; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--ivory); border-color: var(--saffron); }
.btn-danger { background: rgba(192,57,43,.1); color: var(--error); border: 1px solid rgba(192,57,43,.2); }
.btn-danger:hover { background: var(--error); color: white; }
.btn-teal { background: linear-gradient(135deg, var(--teal), var(--teal-light)); color: white; box-shadow: 0 4px 14px rgba(0,105,92,.2); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon { width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; }

/* ── Forms ────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 11px; font-weight: 700; color: var(--dim); letter-spacing: .8px; text-transform: uppercase; margin-bottom: 8px; }
.form-control {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px; color: var(--text);
  background: var(--ivory); transition: all .15s;
  outline: none;
}
.form-control:focus { border-color: var(--saffron); background: white; box-shadow: 0 0 0 3px rgba(255,111,0,.1); }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239E9EB8' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.form-row { display: grid; gap: 16px; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ── Search & Filters ─────────────────────────────────────────── */
.filters-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.search-box { position: relative; flex: 1; min-width: 200px; max-width: 320px; }
.search-box input { padding-left: 38px; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--dim); font-size: 16px; }

/* ── Modal ────────────────────────────────────────────────────── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(28,28,46,.6); z-index: 1000; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.active { display: flex; }
.modal { background: white; border-radius: 20px; width: 100%; max-width: 560px; box-shadow: 0 32px 80px rgba(0,0,0,.3); max-height: 90vh; display: flex; flex-direction: column; }
.modal-lg { max-width: 720px; }
.modal-header { padding: 22px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-family: 'Playfair Display', serif; font-size: 18px; font-weight: 700; color: var(--text); }
.modal-close { width: 30px; height: 30px; border-radius: 8px; background: var(--ivory); border: 1px solid var(--border); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 18px; line-height: 1; }
.modal-body { padding: 24px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 12px; justify-content: flex-end; }
/* The form wraps modal-body + modal-footer in most admin pages.
   Without this rule it isn't a flex container, so modal-body's flex/overflow
   never activate and the user can't scroll to the Save button. */
.modal > form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; }

/* ── Toggle Switch ────────────────────────────────────────────── */
.toggle { position: relative; display: inline-flex; width: 40px; height: 22px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: var(--border); border-radius: 22px; cursor: pointer; transition: .2s; }
.toggle-slider::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: white; border-radius: 50%; transition: .2s; }
input:checked + .toggle-slider { background: var(--teal); }
input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ── Charts Placeholder ───────────────────────────────────────── */
.chart-placeholder { background: linear-gradient(135deg, var(--dark), #2D1A00); border-radius: var(--radius); height: 220px; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.3); font-size: 14px; }

/* ── Progress Bar ─────────────────────────────────────────────── */
.progress { height: 6px; background: var(--border); border-radius: 6px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--saffron), var(--gold)); transition: width .4s ease; }

/* ── Avatar ───────────────────────────────────────────────────── */
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: white; background: linear-gradient(135deg, var(--saffron), var(--gold)); flex-shrink: 0; }

/* ── Action Menu ──────────────────────────────────────────────── */
.action-btns { display: flex; gap: 6px; align-items: center; }

/* ── Toast Notification ───────────────────────────────────────── */
.toast { position: fixed; bottom: 24px; right: 24px; padding: 14px 20px; background: var(--dark); color: white; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; box-shadow: var(--shadow-dark); z-index: 9999; display: flex; align-items: center; gap: 10px; transform: translateY(80px); opacity: 0; transition: all .3s ease; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--success); }
.toast.error { background: var(--error); }

/* ── Slot Grid ────────────────────────────────────────────────── */
.slot-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; }
.slot-day-header { font-size: 12px; font-weight: 700; color: var(--text2); text-align: center; padding: 8px; }
.slot-item { padding: 10px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: white; text-align: center; font-size: 12px; cursor: pointer; transition: all .15s; }
.slot-item:hover { border-color: var(--saffron); background: rgba(255,111,0,.04); }
.slot-item.active { border-color: var(--teal); background: rgba(0,105,92,.06); color: var(--teal); font-weight: 700; }
.slot-item.booked { background: rgba(255,111,0,.08); border-color: var(--saffron); color: var(--saffron); font-weight: 700; }

/* ── Gallery Grid ─────────────────────────────────────────────── */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.gallery-item { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); position: relative; }
.gallery-thumb { height: 140px; background: linear-gradient(135deg, #1C1C2E, #2D1A00); display: flex; align-items: center; justify-content: center; font-size: 48px; }
.gallery-caption { padding: 10px 12px; font-size: 12px; font-weight: 500; color: var(--text); }
.gallery-delete { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; background: rgba(192,57,43,.85); color: white; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 14px; }

/* ── Upload Zone ──────────────────────────────────────────────── */
.upload-zone { border: 2px dashed var(--saffron-light); border-radius: var(--radius); padding: 40px; text-align: center; background: rgba(255,171,64,.04); cursor: pointer; transition: all .2s; }
.upload-zone:hover { background: rgba(255,171,64,.08); }
.upload-zone-icon { font-size: 44px; margin-bottom: 12px; }
.upload-zone p { font-size: 14px; font-weight: 600; color: var(--saffron); margin-bottom: 4px; }
.upload-zone span { font-size: 12px; color: var(--dim); }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 1200px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .main-content { margin-left: 0; }
}
@media (max-width: 600px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .page-content { padding: 20px 16px; }
}

/* ── Utility ──────────────────────────────────────────────────── */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.ml-auto { margin-left: auto; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-dim { color: var(--dim); }
.text-small { font-size: 12px; }
.text-center { text-align: center; }
.fw-700 { font-weight: 700; }
.font-serif { font-family: 'Playfair Display', serif; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; display: inline-block; }
