/* ==========================================================================
   BHAJAN PLANNER — Admin Panel
   Shares the same token language as style.css so pages match whichever
   file (or both) happen to load.
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --primary: #d98a2b;
  --primary-dark: #b86f1e;

  --accent: #7d2f45;
  --accent-dark: #5e2233;

  --gold: #e9c876;

  --bg: #fbf8f2;
  --surface: #ffffff;

  --border: #e7e0d2;
  --border-soft: #f0ebdf;

  --text: #221e2a;
  --text-light: #8b8394;

  --success: #4f7a5b;
  --success-bg: #e8f1e9;
  --danger: #b23b32;
  --danger-bg: #fbeae8;
  --info: #2e6f86;
  --info-bg: #e5eff2;

  --shadow-sm: 0 1px 3px rgba(34, 30, 42, 0.06);
  --shadow: 0 8px 24px rgba(34, 30, 42, 0.08);
  --shadow-lg: 0 20px 48px rgba(34, 30, 42, 0.12);

  --radius: 14px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", "Segoe UI", sans-serif;
}

/* ==========================================================================
   PAGE
   ========================================================================== */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
}

body.admin-page {
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

/* Mobile sidebar open: prevent body scroll */
body.mobile-sidebar-open {
  overflow: hidden;
}

input,
select,
textarea,
button {
  font-size: 16px;
}

button,
.btn,
.primary-btn,
.secondary-btn,
.back-btn,
.table-btn,
.page-btn,
.sidebar-nav a,
.sidebar-footer a,
.menu-card,
a {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   LAYOUT
   ========================================================================== */

.admin-layout {
  display: flex;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

.main-content {
  flex: 1;

  display: flex;
  flex-direction: column;

  overflow-y: auto;
  overflow-x: hidden;

  height: 100vh;
  min-width: 0;
}
/* ==========================================================================
   SIDEBAR
   ========================================================================== */

.sidebar {
  width: 264px;
  background: var(--surface);
  border-right: 1px solid var(--border);

  display: flex;
  flex-direction: column;

  padding: max(26px, env(safe-area-inset-top)) 20px
    max(26px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));

  height: 100vh;

  overflow-y: auto;
  overflow-x: hidden;

  position: sticky;
  top: 0;

  z-index: 5;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 38px;
}

.sidebar-toggle {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--text-light);
  font-size: 18px;
  cursor: pointer;
  padding: 7px;
  border-radius: 8px;
}
.sidebar-toggle:hover {
  background: var(--bg);
  color: var(--accent);
}
body.sidebar-collapsed .sidebar {
  width: 72px;
  padding-left: 10px;
  padding-right: 10px;
}
body.sidebar-collapsed .sidebar-header {
  justify-content: center;
  margin-bottom: 28px;
}
body.sidebar-collapsed .sidebar-header > .logo,
body.sidebar-collapsed .sidebar-header > div:not(.logo) {
  display: none;
}
body.sidebar-collapsed .sidebar-toggle {
  margin: 0;
}
body.sidebar-collapsed .sidebar-nav a,
body.sidebar-collapsed .sidebar-footer a {
  justify-content: center;
  font-size: 0;
  padding: 12px 8px;
}
body.sidebar-collapsed .sidebar-nav a span,
body.sidebar-collapsed .sidebar-footer a span {
  width: auto;
  font-size: 18px;
  line-height: 1;
}
body.sidebar-collapsed .sidebar:hover {
  width: 264px;
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: 20px;
}
body.sidebar-collapsed .sidebar:hover .sidebar-header {
  justify-content: flex-start;
}
body.sidebar-collapsed .sidebar:hover .sidebar-header > .logo,
body.sidebar-collapsed .sidebar:hover .sidebar-header > div:not(.logo) {
  display: block;
}
body.sidebar-collapsed .sidebar:hover .sidebar-toggle {
  margin-left: auto;
}
body.sidebar-collapsed .sidebar:hover .sidebar-nav a,
body.sidebar-collapsed .sidebar:hover .sidebar-footer a {
  justify-content: flex-start;
  font-size: 14px;
}
/* Sidebar Scrollbar */

.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: #d7cfbf;

  border-radius: 999px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: #c2b8a5;
}
.logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent);
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  font-size: 22px;
}

.sidebar-header h2 {
  margin: 0;
  color: var(--text);
  font-size: 19px;
  font-family: var(--font-display);
  font-weight: 600;
}

.sidebar-header small {
  display: block;
  color: var(--text-light);
  margin-top: 2px;
  font-size: 12px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-light);
  font-weight: 600;
  font-size: 14px;
  transition: var(--transition);
}

.sidebar-nav span {
  width: 20px;
  text-align: center;
}

.sidebar-nav a:hover {
  background: var(--bg);
  color: var(--accent);
}

.sidebar-nav a.active {
  background: rgba(217, 138, 43, 0.1);
  color: var(--accent-dark);
  border-left: 3px solid var(--primary);
  padding-left: 11px;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--text-light);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
}

.sidebar-footer a:hover {
  background: var(--bg);
  color: var(--accent);
}

/* ==========================================================================
   TOPBAR
   ========================================================================== */

.topbar {
  min-height: 72px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: env(safe-area-inset-top) max(30px, env(safe-area-inset-right)) 0 30px;
  gap: 12px;
  flex-shrink: 0;
}

/* Mobile hamburger — hidden on desktop */
.mobile-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 18px;
  color: var(--text-light);
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition);
  line-height: 1;
}
.mobile-menu-btn:hover {
  background: var(--bg);
  color: var(--accent);
}

.page-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  font-family: var(--font-display);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.admin-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.role-badge {
  padding: 7px 16px;
  border-radius: 50px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ==========================================================================
   PAGE BODY
   ========================================================================== */

.page-body {
  flex: 1;
  padding: 34px;
}

/* The sidebar owns navigation; dashboard shortcut/control cards are retired. */
.admin-control-grid,
.admin-dashboard-actions {
  display: none !important;
}

.admin-form-wrapper {
  max-width: 760px;
}
.admin-form-wrapper form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 28px;
}
.admin-form-wrapper .section-title {
  margin-bottom: 22px;
}
.admin-form-wrapper .admin-card-body {
  padding: 0;
}
.admin-form-wrapper form > .admin-card {
  border: 0;
  box-shadow: none;
  margin: 26px 0 0;
  overflow: visible;
}
.admin-form-wrapper form > .admin-card::before {
  display: none;
}
.admin-form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   CARDS
   ========================================================================== */

.admin-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 26px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  animation: fadeUp 0.4s var(--transition);
}

.admin-card:hover {
  box-shadow: var(--shadow);
}

.admin-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--primary);
}

.admin-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 26px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.admin-card-header h2 {
  margin: 0;
  font-size: 18px;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 600;
}

.admin-card-body {
  padding: 26px;
}

/* ==========================================================================
   SECTION TITLES
   ========================================================================== */

.section-title {
  display: flex;
  align-items: center;
  gap: 13px;
}

.section-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg);
  font-size: 18px;
}

/* ==========================================================================
   DASHBOARD GRID
   ========================================================================== */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 22px;
}

/* ==========================================================================
   STAT CARD
   ========================================================================== */

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(217, 138, 43, 0.12);
  color: var(--accent-dark);
  font-size: 24px;
  flex-shrink: 0;
}

.stat-content h3 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-display);
}

.stat-content p {
  margin-top: 4px;
  color: var(--text-light);
  font-size: 13px;
}

/* ==========================================================================
   TABLE
   ========================================================================== */

.table-wrapper {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.admin-table thead {
  background: var(--bg);
}

.admin-table th {
  padding: 16px 18px;
  text-align: left;
  color: var(--text-light);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text);
  font-size: 14px;
}

.admin-table tbody tr {
  transition: var(--transition);
}

.admin-table tbody tr:hover {
  background: var(--bg);
}

/* ==========================================================================
   STATUS BADGES
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
}
.badge-warning {
  background: #fcf2dc;
  color: #9c7414;
}
.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
}
.badge-admin {
  background: rgba(125, 47, 69, 0.1);
  color: var(--accent-dark);
}

/* ==========================================================================
   ACTION BUTTONS
   ========================================================================== */

.action-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  transition: var(--transition);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-light);
}
.btn-secondary:hover {
  background: var(--bg);
}

.btn-edit {
  background: var(--info-bg);
  color: var(--info);
}
.btn-edit:hover {
  background: #d5e6ea;
}

.btn-delete {
  background: var(--danger-bg);
  color: var(--danger);
}
.btn-delete:hover {
  background: #f6d8d5;
}

/* ==========================================================================
   EMPTY STATE
   ========================================================================== */

.empty-state {
  padding: 56px 28px;
  text-align: center;
  color: var(--text-light);
}

.empty-state h3 {
  margin-top: 16px;
  color: var(--text);
  font-family: var(--font-display);
}

.empty-state p {
  max-width: 440px;
  margin: 10px auto 0;
  line-height: 1.65;
}

/* ==========================================================================
   FORM WRAPPER
   ========================================================================== */

.admin-form-wrapper {
  max-width: 1000px;
  margin: 0 auto;
}

.admin-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.admin-page-header h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 600;
  color: var(--text);
  font-family: var(--font-display);
}

.admin-page-header p {
  margin-top: 8px;
  color: var(--text-light);
  font-size: 15px;
}

/* ==========================================================================
   FORM GRID
   ========================================================================== */

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 26px;
  row-gap: 22px;
}

.admin-grid.single {
  grid-template-columns: 1fr;
}

/* ==========================================================================
   FIELD
   ========================================================================== */

.field {
  display: flex;
  flex-direction: column;
  position: relative;
}

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

.field label {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  letter-spacing: 0.2px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 13px 16px;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  font-family: var(--font-body);
  transition: var(--transition);
}

.field input {
  height: 50px;
}
.field select {
  height: 50px;
  cursor: pointer;
}
.field textarea {
  resize: vertical;
  min-height: 120px;
  font-family: inherit;
}

.field input:hover,
.field textarea:hover,
.field select:hover {
  border-color: var(--gold);
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(217, 138, 43, 0.15);
}

.field small {
  margin-top: 7px;
  color: var(--text-light);
  font-size: 12.5px;
}

/* ==========================================================================
   CHECKBOX
   ========================================================================== */

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.checkbox-group input {
  width: 17px;
  height: 17px;
}

/* ==========================================================================
   ACTIONS
   ========================================================================== */

.admin-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
}

.primary-btn,
.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
}

.primary-btn {
  border: none;
  color: #fff;
  background: var(--accent);
  box-shadow: var(--shadow-sm);
}
.primary-btn:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.primary-btn:active {
  transform: translateY(0);
}

.secondary-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-light);
}
.secondary-btn:hover {
  background: var(--bg);
  border-color: var(--gold);
}

/* ==========================================================================
   BACK BUTTON
   ========================================================================== */

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 20px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-light);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
}

.back-btn:hover {
  background: var(--bg);
  transform: translateY(-2px);
}

/* ==========================================================================
   ALERTS
   ========================================================================== */

.admin-error,
.admin-success,
.admin-warning {
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 22px;
  font-weight: 500;
  font-size: 14px;
}

.admin-error {
  background: var(--danger-bg);
  border: 1px solid rgba(178, 59, 50, 0.2);
  color: var(--danger);
}
.admin-success {
  background: var(--success-bg);
  border: 1px solid rgba(79, 122, 91, 0.2);
  color: var(--success);
}
.admin-warning {
  background: #fcf2dc;
  border: 1px solid #eecf9c;
  color: #9c7414;
}

/* ==========================================================================
   DIVIDERS
   ========================================================================== */

.divider {
  height: 1px;
  background: var(--border);
  margin: 26px 0;
}

/* ==========================================================================
   LOADING
   ========================================================================== */

.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stat-card {
  animation: fadeUp 0.4s var(--transition);
}

.admin-table tbody tr {
  transition:
    background 0.2s,
    transform 0.2s;
}

/* ==========================================================================
   SCROLLBAR
   ========================================================================== */

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: #d8d0bf;
  border-radius: 50px;
}
::-webkit-scrollbar-thumb:hover {
  background: #c5bba5;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1100px) {
  .sidebar {
    width: 230px;
  }
}

@media (max-width: 900px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }
  .admin-page-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .admin-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .primary-btn,
  .secondary-btn,
  .back-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================================
   MOBILE — sidebar becomes a full-screen overlay
   ============================================================ */
@media (max-width: 768px) {
  /* Show the hamburger button in the topbar */
  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Topbar: always a single row on mobile */
  .topbar {
    padding: 14px 16px;
    min-height: 60px;
    padding-top: max(14px, env(safe-area-inset-top));
  }

  .page-title {
    font-size: 17px;
  }

  .admin-name {
    font-size: 13px;
  }

  .role-badge {
    padding: 5px 10px;
    font-size: 10px;
  }

  .page-body {
    padding: 16px;
  }

  /* Hide the desktop sidebar completely */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 80vw;
    max-width: 300px;
    height: 100vh;
    height: 100dvh;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
    padding: max(26px, env(safe-area-inset-top)) 20px
      max(26px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  }

  /* Show sidebar when mobile-sidebar-open is on body */
  body.mobile-sidebar-open .sidebar {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(34, 30, 42, 0.22);
  }

  /* Dim overlay behind sidebar */
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(34, 30, 42, 0.5);
    z-index: 999;
    backdrop-filter: blur(2px);
  }

  body.mobile-sidebar-open .sidebar-overlay {
    display: block;
  }

  /* Collapsed state has NO effect on mobile (sidebar is hidden via transform) */
  body.sidebar-collapsed .sidebar {
    width: 80vw !important;
    max-width: 300px !important;
    padding-left: max(20px, env(safe-area-inset-left)) !important;
    padding-right: 20px !important;
  }
  body.sidebar-collapsed .sidebar-header {
    justify-content: flex-start !important;
    margin-bottom: 38px;
  }
  body.sidebar-collapsed .sidebar-header > .logo,
  body.sidebar-collapsed .sidebar-header > div:not(.logo) {
    display: flex !important;
  }
  body.sidebar-collapsed .sidebar-toggle {
    margin-left: auto !important;
  }
  body.sidebar-collapsed .sidebar-nav a,
  body.sidebar-collapsed .sidebar-footer a {
    justify-content: flex-start !important;
    font-size: 14px !important;
    padding: 12px 14px !important;
  }
  body.sidebar-collapsed .sidebar-nav a span,
  body.sidebar-collapsed .sidebar-footer a span {
    font-size: 18px !important;
    width: 20px;
  }

  /* Sidebar header: always show logo and title on mobile overlay */
  .sidebar-header > .logo,
  .sidebar-header > div:not(.logo) {
    display: flex !important;
  }
  .sidebar-header h2,
  .sidebar-header small {
    display: block !important;
  }
  .sidebar-toggle {
    margin-left: auto;
  }
  .sidebar-nav a,
  .sidebar-footer a {
    justify-content: flex-start !important;
    font-size: 14px !important;
  }
}

@media (max-width: 500px) {
  .admin-card-body {
    padding: 18px;
  }
  .admin-card-header {
    padding: 16px 18px;
  }
  .admin-page-header h1 {
    font-size: 26px;
  }
}

/* ==========================================================================
   SEARCH / FILTER BAR
   ========================================================================== */

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-box input {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 44px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  transition: var(--transition);
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(217, 138, 43, 0.12);
}

.search-box i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
}

.filter-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */

.pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 26px;
}

.page-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-light);
  text-decoration: none;
  transition: var(--transition);
}

.page-btn:hover {
  background: var(--bg);
}

.page-btn.active {
  background: var(--accent);
  color: #fff;
  border: none;
}

/* ==========================================================================
   MODAL (wrapper variant used alongside style.css's .modal)
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(34, 30, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px;
  z-index: 999;
}

.modal-overlay .modal,
.modal-overlay .modal-content {
  width: 100%;
  max-width: 500px;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: fadeUp 0.25s var(--transition);
}

/* ==========================================================================
   DROPDOWN
   ========================================================================== */

.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 210px;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 200;
}

.dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 16px;
  color: var(--text-light);
  text-decoration: none;
  font-size: 13.5px;
  transition: var(--transition);
}

.dropdown-menu a:hover {
  background: var(--bg);
  color: var(--accent);
}

/* ==========================================================================
   TOAST
   ========================================================================== */

.toast {
  position: fixed;
  top: 26px;
  right: 26px;
  min-width: 290px;
  background: var(--surface);
  border-radius: 12px;
  border-left: 4px solid var(--primary);
  padding: 16px 20px;
  box-shadow: var(--shadow-lg);
  animation: fadeUp 0.3s var(--transition);
  z-index: 9999;
  font-size: 14px;
}

.toast.success {
  border-left-color: var(--success);
}
.toast.error {
  border-left-color: var(--danger);
}

/* ==========================================================================
   KPI WIDGETS
   ========================================================================== */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 20px;
}

.kpi-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
  transition: var(--transition);
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--accent-dark);
}

.kpi-label {
  margin-top: 6px;
  color: var(--text-light);
  font-size: 13px;
}

/* ==========================================================================
   UTILITIES
   ========================================================================== */

.w-100 {
  width: 100%;
}
.text-center {
  text-align: center;
}
.text-right {
  text-align: right;
}
.d-flex {
  display: flex;
}
.d-grid {
  display: grid;
}
.d-none {
  display: none;
}
.justify-between {
  justify-content: space-between;
}
.justify-center {
  justify-content: center;
}
.align-center {
  align-items: center;
}
.gap-10 {
  gap: 10px;
}
.gap-20 {
  gap: 20px;
}
.gap-30 {
  gap: 30px;
}
.mt-0 {
  margin-top: 0;
}
.mt-10 {
  margin-top: 10px;
}
.mt-20 {
  margin-top: 20px;
}
.mt-30 {
  margin-top: 30px;
}
.mt-40 {
  margin-top: 40px;
}
.mb-0 {
  margin-bottom: 0;
}
.mb-10 {
  margin-bottom: 10px;
}
.mb-20 {
  margin-bottom: 20px;
}
.mb-30 {
  margin-bottom: 30px;
}
.mb-40 {
  margin-bottom: 40px;
}
.p-20 {
  padding: 20px;
}
.p-30 {
  padding: 30px;
}
.rounded {
  border-radius: var(--radius);
}
.shadow {
  box-shadow: var(--shadow);
}
.bg-white {
  background: var(--surface);
}

/* ==========================================================================
   PRINT
   ========================================================================== */

@media print {
  .sidebar,
  .topbar,
  .toolbar,
  .pagination,
  .admin-actions {
    display: none;
  }
  .main-content {
    width: 100%;
  }
  .admin-card {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}

/* ==========================================================
   ADMIN CALENDAR LAYOUT
   ========================================================== */

.container.container-xl {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 24px;
}

/* Header */

.header {
  margin-bottom: 28px;
  text-align: center;
}

.header h1 {
  margin-bottom: 8px;
}

.header p {
  margin: 0;
}

/* Calendar wrapper */

.calendar-header,
.calendar-legend,
.calendar-grid {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

/* Month navigation */

.calendar-header {
  margin-top: 30px;
  margin-bottom: 30px;
}

/* Legend */

.calendar-legend {
  margin-bottom: 26px;
  padding: 0 8px;
}

/* Calendar Grid */

.calendar-grid {
  display: grid;

  grid-template-columns: repeat(7, minmax(0, 1fr));

  gap: 14px;

  padding: 0 8px 18px;
}

/* Calendar Cells */

.calendar-day {
  padding: 14px;

  min-height: 130px;

  border-radius: 14px;

  transition: 0.25s ease;
}

.calendar-day:hover {
  transform: translateY(-2px);

  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

/* Navigation Buttons */

.calendar-nav-btn {
  width: 60px;

  height: 60px;

  border-radius: 16px;
}

/* Calendar Title */

.calendar-title {
  font-size: 42px;

  font-family: var(--font-display);

  font-weight: 700;
}

/* Better spacing */

.calendar-actions {
  margin-top: auto;
}

/* Desktop */

@media (min-width: 1500px) {
  .calendar-grid {
    padding: 0 20px 20px;
  }
}
.calendar-wrapper {
  padding: 0 26px;
}
.calendar-date-num {
  font-size: 22px;

  font-weight: 700;
}
.event-pill,
.perm-pill {
  border-radius: 999px;

  padding: 7px 12px;

  font-size: 12px;

  font-weight: 700;
}

/* ==========================================================================
   ADMIN CALENDAR — MOBILE OVERRIDES
   ========================================================================== */

@media (max-width: 768px) {
  /* Container no longer needs to fight the sidebar */
  .container.container-xl {
    padding: 16px 12px;
  }

  .calendar-wrapper {
    padding: 0 4px;
  }

  .calendar-grid {
    gap: 5px;
    padding: 0 4px 12px;
  }

  .calendar-day {
    padding: 6px 4px;
    min-height: 70px;
    border-radius: 8px;
  }

  .calendar-date-num {
    font-size: 13px;
  }

  .event-pill {
    padding: 3px 5px;
    font-size: 9px;
    border-radius: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .perm-pill {
    padding: 2px 4px;
    font-size: 8px;
  }

  .calendar-nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .calendar-title {
    font-size: 22px;
  }

  .calendar-header {
    margin-top: 16px;
    margin-bottom: 16px;
  }

  /* Admin Users Management — Mobile Adjustments */
  .admin-users-wrapper {
    padding: 0 4px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 18px;
  }

  .stats-grid .stat-card {
    padding: 12px 14px;
  }

  .stat-value {
    font-size: 22px;
    margin-top: 4px;
  }

  .table-header {
    padding: 14px 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .table-header input.search-box {
    width: 100%;
  }

  .admin-users-wrapper .admin-table th,
  .admin-users-wrapper .admin-table td {
    padding: 10px 12px;
    font-size: 13px;
  }

  .table-actions {
    justify-content: flex-start;
  }
}

