/* =============================================
   Admin Panel — Spanish Lessons With Mercedes
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Figtree', sans-serif; background: #F4F5F7; color: #121117; min-height: 100vh; }
a { text-decoration: none; color: inherit; }

:root {
  --ochre: #D4920A; --dark: #121117; --teal: #3DDABE;
  --danger: #E53E3E; --success: #38A169; --sidebar-w: 260px;
}

/* ── LOGIN PAGE ─────────────────────────── */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #FEF3E2 0%, #fff8ec 100%);
}
.login-card {
  background: #fff; border-radius: 16px; padding: 48px 40px;
  box-shadow: 0 8px 40px rgba(212,146,10,0.15); width: 420px; text-align: center;
}
.login-logo { margin: 0 auto 32px; display: flex; align-items: center; justify-content: center; gap: 12px; }
.login-logo-mark {
  width: 52px; height: 52px; background: var(--ochre); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: Georgia, serif; font-size: 24px; font-weight: bold; color: var(--dark);
}
.login-logo-text { text-align: left; }
.login-logo-top { font-size: 10px; font-weight: 700; color: #4D4C5C; letter-spacing: 1px; text-transform: uppercase; }
.login-logo-bottom { font-family: 'Noto Sans', sans-serif; font-weight: 700; font-size: 18px; color: var(--dark); }
.login-title { font-family: 'Noto Sans', sans-serif; font-weight: 700; font-size: 28px; color: var(--dark); margin-bottom: 8px; }
.login-subtitle { font-size: 15px; color: #4D4C5C; margin-bottom: 32px; }
.form-group { text-align: left; margin-bottom: 20px; }
.form-label { display: block; font-size: 14px; font-weight: 600; color: var(--dark); margin-bottom: 6px; }
.form-input {
  width: 100%; padding: 12px 16px; border: 1.5px solid #DCDCE5; border-radius: 8px;
  font-size: 15px; font-family: 'Figtree', sans-serif; color: var(--dark);
  transition: border-color 0.2s; outline: none;
}
.form-input:focus { border-color: var(--ochre); }
.form-error { font-size: 13px; color: var(--danger); margin-top: 6px; display: none; }
.form-error.visible { display: block; }
.btn-login {
  width: 100%; padding: 14px; background: var(--ochre); color: var(--dark);
  border: none; border-radius: 8px; font-size: 16px; font-weight: 700;
  font-family: 'Figtree', sans-serif; cursor: pointer; transition: background 0.2s; margin-top: 8px;
}
.btn-login:hover { background: #B87C08; }
.login-back { margin-top: 20px; font-size: 13px; color: #4D4C5C; }
.login-back a { color: var(--ochre); font-weight: 600; }

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

/* Sidebar */
.sidebar {
  width: var(--sidebar-w); background: var(--dark); flex-shrink: 0;
  display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 10;
}
.sidebar__logo {
  padding: 24px 20px; border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 10px;
}
.sidebar__logo-mark {
  width: 36px; height: 36px; background: var(--ochre); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: Georgia, serif; font-size: 16px; font-weight: bold; color: var(--dark);
}
.sidebar__logo-name { font-family: 'Noto Sans', sans-serif; font-weight: 700; font-size: 13px; color: #fff; line-height: 1.3; }
.sidebar__logo-sub { font-size: 10px; color: rgba(255,255,255,0.4); }
.sidebar__nav { flex: 1; padding: 16px 0; }
.sidebar__section { padding: 0 16px 8px; font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.3); letter-spacing: 1.5px; text-transform: uppercase; margin-top: 16px; }
.sidebar__link {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  color: rgba(255,255,255,0.65); font-size: 14px; font-weight: 600;
  border-radius: 8px; margin: 2px 8px; transition: all 0.15s; cursor: pointer;
}
.sidebar__link:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar__link.active { background: var(--ochre); color: var(--dark); }
.sidebar__link svg { flex-shrink: 0; }
.sidebar__footer { padding: 16px; border-top: 1px solid rgba(255,255,255,0.08); }
.sidebar__user { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 8px; }
.sidebar__avatar { width: 36px; height: 36px; background: var(--ochre); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--dark); font-size: 14px; }
.sidebar__user-info { flex: 1; }
.sidebar__user-name { font-size: 13px; font-weight: 600; color: #fff; }
.sidebar__user-role { font-size: 11px; color: rgba(255,255,255,0.4); }
.sidebar__logout { padding: 8px 16px; background: rgba(229,62,62,0.15); color: #FC8181; border: none; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; width: 100%; margin-top: 8px; font-family: 'Figtree', sans-serif; transition: background 0.2s; }
.sidebar__logout:hover { background: rgba(229,62,62,0.25); }

/* Main content */
.admin-main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.admin-topbar {
  background: #fff; border-bottom: 1px solid #DCDCE5; padding: 16px 32px;
  display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 5;
}
.admin-topbar__title { font-family: 'Noto Sans', sans-serif; font-weight: 700; font-size: 22px; color: var(--dark); }
.admin-topbar__subtitle { font-size: 13px; color: #4D4C5C; margin-top: 2px; }
.admin-topbar__right { display: flex; align-items: center; gap: 12px; }
.btn-add {
  display: flex; align-items: center; gap: 8px; padding: 10px 20px;
  background: var(--ochre); color: var(--dark); border: none; border-radius: 8px;
  font-size: 14px; font-weight: 700; cursor: pointer; font-family: 'Figtree', sans-serif;
  transition: background 0.2s;
}
.btn-add:hover { background: #B87C08; }
.admin-content { padding: 32px; flex: 1; }

/* Dashboard stats */
.dash-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 32px; }
.dash-stat {
  background: #fff; border-radius: 12px; padding: 24px;
  border: 1px solid #DCDCE5; display: flex; flex-direction: column; gap: 8px;
}
.dash-stat__value { font-family: 'Noto Sans', sans-serif; font-weight: 700; font-size: 36px; color: var(--dark); }
.dash-stat__label { font-size: 14px; color: #4D4C5C; font-weight: 600; }
.dash-stat__icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.dash-stat--ochre .dash-stat__icon { background: rgba(212,146,10,0.12); color: var(--ochre); }
.dash-stat--teal .dash-stat__icon { background: rgba(61,218,190,0.12); color: #2BA99A; }
.dash-stat--blue .dash-stat__icon { background: rgba(40,133,253,0.12); color: #2885FD; }
.dash-stat--green .dash-stat__icon { background: rgba(56,161,105,0.12); color: var(--success); }

/* Tables */
.table-card { background: #fff; border-radius: 12px; border: 1px solid #DCDCE5; overflow: hidden; }
.table-card__header { padding: 20px 24px; border-bottom: 1px solid #DCDCE5; display: flex; align-items: center; justify-content: space-between; }
.table-card__title { font-family: 'Noto Sans', sans-serif; font-weight: 700; font-size: 18px; color: var(--dark); }
.table-search { padding: 8px 14px; border: 1.5px solid #DCDCE5; border-radius: 8px; font-size: 14px; font-family: 'Figtree', sans-serif; outline: none; width: 240px; }
.table-search:focus { border-color: var(--ochre); }
table { width: 100%; border-collapse: collapse; }
thead th { background: #F8F9FA; padding: 12px 16px; text-align: left; font-size: 12px; font-weight: 700; color: #4D4C5C; letter-spacing: 0.8px; text-transform: uppercase; border-bottom: 1px solid #DCDCE5; }
tbody tr { border-bottom: 1px solid #F4F5F7; transition: background 0.1s; }
tbody tr:hover { background: #FAFAFA; }
tbody tr:last-child { border-bottom: none; }
td { padding: 14px 16px; font-size: 14px; color: var(--dark); vertical-align: middle; }
.td-title { font-weight: 600; max-width: 280px; }
.td-title small { display: block; font-weight: 400; color: #4D4C5C; font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
.badge {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 12px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.3px; white-space: nowrap;
}
.badge-a1 { background: #E8F5E9; color: #2E7D32; }
.badge-a2 { background: #E3F2FD; color: #1565C0; }
.badge-b1 { background: #FFF3E0; color: #E65100; }
.badge-b2 { background: #F3E5F5; color: #6A1B9A; }
.badge-c1 { background: #FCE4EC; color: #AD1457; }
.badge-c2 { background: #FFEBEE; color: #B71C1C; }
.badge-dele { background: rgba(212,146,10,0.15); color: #A06C00; }
.badge-grammar { background: #E0F2F1; color: #00695C; }
.badge-conv { background: #F1F8E9; color: #33691E; }
.badge-culture { background: #EDE7F6; color: #4527A0; }
.td-actions { display: flex; gap: 8px; align-items: center; }
.btn-edit { padding: 6px 12px; background: rgba(212,146,10,0.1); color: var(--ochre); border: 1px solid var(--ochre); border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: 'Figtree', sans-serif; transition: all 0.15s; }
.btn-edit:hover { background: var(--ochre); color: var(--dark); }
.btn-delete { padding: 6px 12px; background: rgba(229,62,62,0.08); color: var(--danger); border: 1px solid rgba(229,62,62,0.3); border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: 'Figtree', sans-serif; transition: all 0.15s; }
.btn-delete:hover { background: var(--danger); color: #fff; }
.empty-state { padding: 48px; text-align: center; color: #4D4C5C; }
.empty-state svg { margin: 0 auto 16px; opacity: 0.3; }
.empty-state p { font-size: 15px; }
.table-pagination { padding: 16px 24px; border-top: 1px solid #DCDCE5; display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: #4D4C5C; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: #fff; border-radius: 16px; width: 600px; max-height: 90vh;
  overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  transform: translateY(20px); transition: transform 0.2s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal__header { padding: 24px 28px; border-bottom: 1px solid #DCDCE5; display: flex; align-items: center; justify-content: space-between; }
.modal__title { font-family: 'Noto Sans', sans-serif; font-weight: 700; font-size: 20px; color: var(--dark); }
.modal__close { background: none; border: none; font-size: 22px; color: #4D4C5C; cursor: pointer; line-height: 1; padding: 4px; border-radius: 4px; }
.modal__close:hover { background: #F4F5F7; }
.modal__body { padding: 28px; display: flex; flex-direction: column; gap: 20px; }
.modal__footer { padding: 20px 28px; border-top: 1px solid #DCDCE5; display: flex; justify-content: flex-end; gap: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-select {
  width: 100%; padding: 12px 16px; border: 1.5px solid #DCDCE5; border-radius: 8px;
  font-size: 15px; font-family: 'Figtree', sans-serif; color: var(--dark);
  outline: none; background: #fff; cursor: pointer;
}
.form-select:focus { border-color: var(--ochre); }
.form-textarea {
  width: 100%; padding: 12px 16px; border: 1.5px solid #DCDCE5; border-radius: 8px;
  font-size: 15px; font-family: 'Figtree', sans-serif; color: var(--dark);
  resize: vertical; min-height: 90px; outline: none;
}
.form-textarea:focus { border-color: var(--ochre); }
.form-hint { font-size: 12px; color: #4D4C5C; margin-top: 4px; }
.btn-cancel { padding: 12px 24px; background: #F4F5F7; color: var(--dark); border: 1px solid #DCDCE5; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: 'Figtree', sans-serif; }
.btn-save { padding: 12px 24px; background: var(--ochre); color: var(--dark); border: none; border-radius: 8px; font-size: 14px; font-weight: 700; cursor: pointer; font-family: 'Figtree', sans-serif; transition: background 0.2s; }
.btn-save:hover { background: #B87C08; }

/* Toast notification */
.toast {
  position: fixed; bottom: 32px; right: 32px; padding: 14px 20px;
  background: var(--dark); color: #fff; border-radius: 10px; font-size: 14px; font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2); z-index: 9999;
  transform: translateY(100px); opacity: 0; transition: all 0.3s;
  display: flex; align-items: center; gap: 10px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast--success { border-left: 4px solid var(--teal); }
.toast--error { border-left: 4px solid var(--danger); }
