/* ============================================================
   AMUDHASRI DANCE STUDIO — Main Stylesheet
   Themes: Dark luxury (default) + Warm light (theme-light)
   Fonts: Dark — Cormorant Garamond + DM Sans
          Light — Playfair Display + Lato
   ============================================================ */

/* System fonts — no external download needed */

/* ── Dark theme (default) ───────────────────────────────────── */
:root {
  --bg:              #0f0f12;
  --bg-card:         #17171d;
  --bg-card2:        #1e1e27;
  --bg-sidebar:      #17171d;
  --border:          #2a2a36;
  --border-light:    #33333f;
  --gold:            #c9a84c;
  --gold-light:      #e2c47a;
  --gold-dim:        #8a6e2f;
  --text:            #e8e6e0;
  --text-muted:      #8a8799;
  --text-dim:        #5a5869;
  --red:             #e05555;
  --red-dim:         #6b2626;
  --green:           #4caf7d;
  --green-dim:       #1e4532;
  --blue:            #5b8dee;
  --blue-dim:        #1e2f5a;
  --portal-accent:   #0DA0DC;
  --portal-accent-dk:#0880b0;
  --sidebar-w:       240px;
  --radius:          10px;
  --radius-sm:       6px;
  --shadow:          0 4px 24px rgba(0,0,0,.45);
  --shadow-sm:       0 2px 10px rgba(0,0,0,.3);
  --transition:      0.18s ease;
  --font-display:    'Trebuchet MS', 'Segoe UI', -apple-system, sans-serif;
  --font-body:       'Segoe UI', -apple-system, BlinkMacSystemFont, 'Trebuchet MS', system-ui, sans-serif;
}

/* ── Light theme override ───────────────────────────────────── */
html.theme-light {
  --bg:              #f5ede0;
  --bg-card:         #ffffff;
  --bg-card2:        #faf6f0;
  --bg-sidebar:      #fdf8f3;
  --border:          #e0d5c5;
  --border-light:    #d0c4b0;
  --gold:            #8b2500;
  --gold-light:      #a83010;
  --gold-dim:        #c4471a;
  --text:            #2c1a0e;
  --text-muted:      #7a6a5a;
  --text-dim:        #b0a090;
  --red:             #c0392b;
  --red-dim:         #fde8e8;
  --green:           #27835a;
  --green-dim:       #e6f4ec;
  --blue:            #2563eb;
  --blue-dim:        #e8eefb;
  --shadow:          0 4px 24px rgba(0,0,0,.10);
  --shadow-sm:       0 2px 10px rgba(0,0,0,.07);
  --font-display:    'Trebuchet MS', 'Segoe UI', -apple-system, sans-serif;
  --font-body:       'Segoe UI', -apple-system, BlinkMacSystemFont, 'Trebuchet MS', system-ui, sans-serif;
}

/* Light theme — sidebar uses its own bg var */
html.theme-light .sidebar {
  background: var(--bg-sidebar);
  border-right-color: var(--border);
}
html.theme-light .topbar {
  background: var(--bg-card);
  border-bottom-color: var(--border);
}
/* Light theme — form controls need explicit bg so they don't inherit cream */
html.theme-light .form-control {
  background: #fff;
  border-color: var(--border-light);
  color: var(--text);
}
html.theme-light .search-bar {
  background: #fff;
  border-color: var(--border-light);
}
/* Light theme — table hover */
html.theme-light tbody tr:hover td { background: rgba(0,0,0,.025); }
/* Light theme — scrollbar */
html.theme-light ::-webkit-scrollbar-track { background: #f0e8dc; }
html.theme-light ::-webkit-scrollbar-thumb { background: var(--border-light); }

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.65;
}
a { color: var(--gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-light); }
img { max-width: 100%; }
button { font-family: var(--font-body); cursor: pointer; }
input, select, textarea { font-family: var(--font-body); }

/* ── Auth / Login Pages ────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(201,168,76,.08) 0%, transparent 70%),
    var(--bg);
  padding: 2rem 2rem 3rem;
}
body.auth-page > footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg);
  margin-top: 0;
  border-top: none;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: var(--shadow);
  animation: fadeUp .4s ease both;
}
.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.auth-logo-icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: .75rem;
}
.auth-logo h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: .02em;
}
.auth-logo p {
  font-size: .85rem;
  color: var(--text-muted);
  margin-top: .2rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ── Google sign-in button ─────────────────────────────────── */
.google-signin-wrap {
  margin-bottom: 1.25rem;
}
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  width: 100%;
  padding: .8rem 1.25rem;
  background: #ffffff;
  color: #3c4043;
  border: 1.5px solid #dadce0;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: .01em;
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow .15s ease, border-color .15s ease, background .15s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
  position: relative;
}
.btn-google:hover {
  background: #f8f9fa;
  border-color: #c6c8ca;
  box-shadow: 0 3px 12px rgba(0,0,0,.2);
}
.btn-google:active {
  background: #f1f3f4;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.btn-google svg {
  flex-shrink: 0;
}

/* ── Auth divider ───────────────────────────────────────────── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: .875rem;
  margin-bottom: 1.5rem;
  color: var(--text-dim);
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Layout ────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: transform var(--transition);
}
.sidebar-logo {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo-inner {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.sidebar-logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.sidebar-logo-text h2 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}
.sidebar-logo-text span {
  font-size: .75rem;
  color: var(--text-muted);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
}
.nav-section {
  margin-bottom: .25rem;
}
.nav-section-label {
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: .75rem 1.25rem .3rem;
  font-weight: 500;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .7rem 1.25rem;
  color: var(--text-muted);
  font-size: .9rem;
  font-weight: 400;
  border-left: 2px solid transparent;
  transition: all var(--transition);
}
.nav-item:hover {
  color: var(--text);
  background: rgba(201,168,76,.06);
  border-left-color: var(--gold-dim);
}
.nav-item.active {
  color: var(--gold);
  background: rgba(201,168,76,.1);
  border-left-color: var(--gold);
  font-weight: 500;
}
.nav-item .icon { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .75rem;
}
.sidebar-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--gold-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  color: var(--bg);
  font-weight: 600;
  flex-shrink: 0;
}
.sidebar-user-info { overflow: hidden; }
.sidebar-user-info strong {
  display: block;
  font-size: .875rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-info span {
  font-size: .775rem;
  color: var(--text-muted);
}

/* ── Main Content ──────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar {
  height: 64px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--text);
}
.topbar-actions { display: flex; align-items: center; gap: .75rem; }
.page-body { padding: 2rem; flex: 1; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}
.card-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.1rem;
}

/* ── Stat Cards ────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition);
}
.stat-card:hover { border-color: var(--border-light); }
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 0 var(--radius) 0 80px;
  opacity: .06;
}
.stat-card.gold::before  { background: var(--gold); }
.stat-card.green::before { background: var(--green); }
.stat-card.blue::before  { background: var(--blue); }
.stat-card.red::before   { background: var(--red); }
.stat-icon {
  font-size: 1.5rem;
  margin-bottom: .6rem;
  display: block;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
  margin-bottom: .3rem;
}
.stat-label {
  font-size: .82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* ── Tabs ──────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: .25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.tab {
  padding: .7rem 1.2rem;
  font-size: .9rem;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* ── Tables ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .925rem;
}
thead th {
  padding: .8rem 1rem;
  text-align: left;
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: .9rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(255,255,255,.02); }
.td-link { color: var(--gold); font-weight: 500; }
.td-link:hover { color: var(--gold-light); text-decoration: underline; }

/* ── Badges / Pills ────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .25rem .7rem;
  border-radius: 99px;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .03em;
  white-space: nowrap;
}
.badge-active  { background: var(--green-dim); color: var(--green); }
.badge-inactive{ background: var(--red-dim);   color: var(--red);   }
.badge-gold    { background: rgba(201,168,76,.15); color: var(--gold); }
.badge-blue    { background: var(--blue-dim);  color: var(--blue);  }

/* ── Forms ─────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.form-group { display: flex; flex-direction: column; gap: .4rem; }
.form-group.full { grid-column: 1 / -1; }
label {
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.form-control {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: .65rem .9rem;
  font-size: 1rem;
  font-family: var(--font-body);
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
.form-control:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,.12);
}
.form-control::placeholder { color: var(--text-dim); }
select.form-control { cursor: pointer; }
.form-hint { font-size: .8rem; color: var(--text-muted); margin-top: .3rem; }
.form-check { display: flex; align-items: center; gap: .5rem; }
.form-check input[type=checkbox] { accent-color: var(--gold); width: 17px; height: 17px; cursor: pointer; }
.form-check label { font-size: .925rem; color: var(--text); text-transform: none; letter-spacing: 0; cursor: pointer; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .65rem 1.3rem;
  border-radius: var(--radius-sm);
  font-size: .925rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: var(--font-body);
  text-decoration: none;
  line-height: 1;
}
.btn-primary {
  background: var(--gold);
  color: #0f0f12;
  border-color: var(--gold);
}
.btn-primary:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
  color: #0f0f12;
}
.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border-light);
}
.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
}
.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border-color: var(--red-dim);
}
.btn-danger:hover { background: #7a2c2c; }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,.05); }
.btn-sm { padding: .45rem .9rem; font-size: .85rem; }
.btn-icon { width: 36px; height: 36px; padding: 0; justify-content: center; border-radius: var(--radius-sm); }

/* ── Alerts ────────────────────────────────────────────────── */
.alert {
  padding: .9rem 1.15rem;
  border-radius: var(--radius-sm);
  font-size: .925rem;
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  margin-bottom: 1rem;
}
.alert-success { background: var(--green-dim); color: var(--green); border: 1px solid #2a5c3f; }
.alert-error   { background: var(--red-dim);   color: var(--red);   border: 1px solid #6b2626; }
.alert-info    { background: var(--blue-dim);  color: var(--blue);  border: 1px solid #1e2f5a; }

/* ── Search bar ────────────────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: .5rem .85rem;
  width: 280px;
}
.search-bar input {
  border: none;
  background: none;
  color: var(--text);
  font-size: .925rem;
  font-family: var(--font-body);
  width: 100%;
}
.search-bar input:focus { outline: none; }
.search-bar input::placeholder { color: var(--text-dim); }
.search-icon { color: var(--text-dim); font-size: .9rem; }

/* ── Modal ─────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  animation: fadeUp .2s ease both;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; }
.modal-body { padding: 1.5rem; }
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
}

/* ── Misc ──────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: .75rem; }
.empty-state p { font-size: .925rem; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.section-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}
.divider { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }
.text-muted { color: var(--text-muted); }
.text-gold  { color: var(--gold); }
.text-red   { color: var(--red); }
.text-green { color: var(--green); }
.text-right { text-align: right; }
.text-center{ text-align: center; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-sm { gap: .5rem; }
.gap { gap: 1rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.w-100 { width: 100%; }
.page-actions { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin-bottom: 1.5rem; }
.inline-form { display: flex; gap: .5rem; align-items: center; }

/* ── Animations ────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.animate-in { animation: fadeUp .3s ease both; }

/* ── Responsive ────────────────────────────────────────────── */
.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.25rem;
  cursor: pointer;
  padding: .4rem;
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .hamburger { display: block; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .search-bar { width: 100%; }
  .page-body { padding: 1.25rem; }
}

/* Tuition display */
.tuition-row { display: flex; flex-direction: column; gap: .1rem; }
.tuition-original { font-size: .8rem; color: var(--text-muted); text-decoration: line-through; }
.tuition-discounted { color: var(--green); font-weight: 500; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ── Pagination ────────────────────────────────────────────── */
.pagination { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; }
.page-btn {
  min-width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  padding: 0 .5rem;
}
.page-btn:hover { border-color: var(--gold); color: var(--gold); }
.page-btn.active { background: var(--gold); color: var(--bg); border-color: var(--gold); font-weight: 600; }
.page-btn.disabled { opacity: .4; pointer-events: none; }

/* ── Two-column responsive grid ─────────────────────────── */
.two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 900px) {
  .two-col-grid { grid-template-columns: 1fr; }
}

/* ── Sidebar backdrop (mobile) ───────────────────────────── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 99;
  cursor: pointer;
}
@media (max-width: 768px) {
  .sidebar-backdrop.open { display: block; }
}
