:root {
    --admin-sidebar: #0b2e1b;
    --admin-sidebar-hover: #15452d;
    --admin-bg: #F9F7F4;
    --admin-card: #ffffff;
    --admin-text: #1A1A1A;
    --admin-text-muted: #6B6B6B;
    --gold: #938925;
    --gold-hover: #82781f;
    --teal: #2d6a4f;
    --transition: .4s cubic-bezier(.16, 1, .3, 1);
    --bounce: .5s cubic-bezier(.34, 1.56, .64, 1);
    --radius: 16px;
    --radius-sm: 8px;
    --shadow: 0 8px 32px rgba(0,0,0,.08);
    --shadow-lg: 0 16px 48px rgba(0,0,0,.12);
    --font-title: 'Outfit', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --font-ui: 'Open Sans', sans-serif;
    --font-alt: 'Fira Sans', sans-serif;
}

body {
  overflow-x: visible !important; /* Fix position: sticky */
}

.admin-mobile-header {
  display: none;
}

.admin-wrapper {
  display: flex;
  min-height: 100vh;
  background: var(--admin-bg);
}

.admin-sidebar {
  width: 280px;
  flex-shrink: 0;
  background: var(--admin-sidebar);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
  box-shadow: 4px 0 24px rgba(0,0,0,0.1);
}

.admin-sidebar__logo {
  padding: 32px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  background: linear-gradient(to right, rgba(255,255,255,0.02), transparent);
}

.admin-sidebar__nav {
  flex: 1;
  min-height: 0;
  padding: 24px 16px;
  overflow-y: auto;
}

.admin-sidebar__nav-title {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.3);
  margin: 24px 8px 12px;
  font-weight: 800;
  font-family: var(--font-alt);
}

.admin-sidebar__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: var(--font-ui);
  transition: all var(--transition);
  margin-bottom: 4px;
  position: relative;
}

.admin-sidebar__link:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
  transform: translateX(6px);
}

.admin-sidebar__link.active {
  background: var(--gold);
  color: var(--brown-dark);
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(147,137,37,0.3);
}

.admin-sidebar__link.active:hover {
  transform: translateX(4px);
}

.admin-main {
  flex: 1;
  min-width: 0;
  padding: 48px;
  background: #f4f7f9;
  min-height: 100vh;
  overflow-y: auto;
}

.admin-main__header {
  margin-bottom: 40px;
}

.admin-main__title {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 2rem;
  color: var(--brown-dark);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.admin-main__subtitle {
  color: var(--admin-text-muted);
  font-size: 1rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.stat-card {
  background: #fff;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -2px rgba(0,0,0,0.02);
  display: flex;
  align-items: center;
  gap: 20px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

.stat-card:hover {
  transform: translateY(-6px);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card:hover .stat-card__icon {
  transform: scale(1.08);
}

.stat-card__icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: rgba(147,137,37, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--bounce);
}

.stat-card__value {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1a202c;
}

.stat-card__label {
  font-size: 0.875rem;
  color: var(--admin-text-muted);
  font-weight: 600;
}

.admin-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
  overflow: hidden;
  border: 1px solid #edf2f7;
}

.admin-card__header {
  padding: 24px 28px;
  border-bottom: 1px solid #edf2f7;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fafcfd;
}

.admin-card__header h3 {
  font-weight: 700;
  font-size: 1.1rem;
  font-family: var(--font-title);
}

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

.admin-table th {
  text-align: left;
  padding: 16px 28px;
  background: #f8fafc;
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--admin-text-muted);
  font-weight: 800;
  font-family: var(--font-alt);
  letter-spacing: 0.05em;
}

.admin-table td {
  padding: 20px 28px;
  border-bottom: 1px solid #edf2f7;
  font-size: 0.9rem;
  color: #4a5568;
}

.admin-table tr:last-child td {
  border-bottom: 0;
}

.badge {
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-alt);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge--pending { background: #fff5f5; color: #c53030; }
.badge--resolved { background: #f0fff4; color: #276749; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    font-family: var(--font-ui);
}

.btn--sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 8px;
}

.btn--primary {
    background: var(--admin-sidebar);
    color: #fff;
}
.btn--primary:hover {
    background: var(--admin-sidebar-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(11, 46, 27, .3);
}

.btn--gold {
    background: var(--gold);
    color: var(--admin-sidebar);
}
.btn--gold:hover {
    background: var(--gold-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(147, 137, 37, .3);
}

.btn--outline {
    background: transparent;
    border: 2px solid var(--admin-sidebar);
    color: var(--admin-sidebar);
}
.btn--outline:hover {
    background: var(--admin-sidebar);
    color: #fff;
    transform: translateY(-2px);
}

.btn--danger {
    background: #fff5f5;
    color: #c53030;
    border: 1px solid #feb2b2;
}
.btn--danger:hover {
    background: #c53030;
    color: #fff;
    transform: translateY(-2px);
}

.btn--block {
    display: flex;
    width: 100%;
    justify-content: center;
}

.btn:active {
    transform: translateY(0) scale(.97) !important;
}

/* Animations */
.animate {
    animation: fadeIn 0.5s ease forwards;
}

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

/* Login Page Styles */
.login-body {
    background: linear-gradient(135deg, var(--admin-sidebar) 0%, #1a4a2e 100%);
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    font-family: var(--font-body);
    position: relative;
}

.login-body::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at 20% 80%, rgba(212,175,55,0.1) 0%, transparent 60%),
                radial-gradient(ellipse at 80% 20%, rgba(212,175,55,0.08) 0%, transparent 60%);
    pointer-events: none;
}

.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 420px;
    animation: fadeInUp .6s ease forwards;
    position: relative;
    overflow: hidden;
}

.login-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--gold), #C4872A);
}

.login-box__header {
    text-align: center;
    margin-bottom: 36px;
}

.login-box__title {
    font-family: var(--font-title);
    font-size: 2rem;
    font-weight: 800;
    color: var(--admin-sidebar);
    margin: 0 0 6px;
    letter-spacing: -0.5px;
}

.login-box__subtitle {
    color: var(--admin-text-muted);
    font-size: 1rem;
    margin: 0;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form__group {
    margin-bottom: 0;
}

.form > .btn {
    margin-top: 8px;
}

.form__label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--admin-text);
    font-size: 0.9rem;
}

.form__input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #edf2f7;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s;
    box-sizing: border-box;
}

.form__input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(147, 137, 37, 0.1);
}

.alert {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert {
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert--error {
    background: #fff5f5;
    color: #c53030;
    border: 1px solid #feb2b2;
}

.alert--success {
    background: #f0fff4;
    color: #276749;
    border: 1px solid #9ae6b4;
}

.password-wrapper {
    position: relative;
    width: 100%;
}
.password-wrapper .form__input {
    padding-right: 44px;
}
.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    font-size: 18px;
    line-height: 1;
    color: #718096;
    transition: color 0.15s;
}
.password-toggle:hover {
    color: var(--gold);
}

/* ==============================
   PAGE TRANSITION
   ============================== */
.page-transition {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--admin-sidebar);
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease;
}

.page-transition--active {
  opacity: 1;
}

/* ==============================
   TOAST
   ============================== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: all;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .88rem;
  font-weight: 500;
  transform: translateX(120%);
  opacity: 0;
  transition: all .4s cubic-bezier(.22,1,.36,1);
  border-left: 4px solid var(--admin-sidebar);
  min-width: 300px;
  max-width: 420px;
}

.toast--visible {
  transform: translateX(0);
  opacity: 1;
}

.toast--success { border-left-color: #28A745; color: #155724; }
.toast--error { border-left-color: #DC3545; color: #721C24; }
.toast--info { border-left-color: var(--gold); }

.toast__icon { flex-shrink: 0; }

/* ==============================
   CONFIRM DIALOG
   ============================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}

.modal-overlay--open {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  background: #fff;
  border-radius: var(--radius);
  padding: 32px;
  max-width: 420px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  transform: scale(.92) translateY(20px);
  transition: transform .3s cubic-bezier(.22,1,.36,1);
  text-align: center;
}

.modal-overlay--open .modal-box {
  transform: scale(1) translateY(0);
}

.modal-box__title {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--admin-text);
  margin-bottom: 8px;
}

.modal-box__text {
  color: var(--admin-text-muted);
  font-size: .9rem;
  margin-bottom: 24px;
  line-height: 1.5;
}

.modal-box__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ==============================
   SKELETON LOADER
   ============================== */
.skeleton {
  background: linear-gradient(90deg, #e8e8e8 25%, #f5f5f5 50%, #e8e8e8 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}

.skeleton--text { height: 14px; width: 100%; margin-bottom: 8px; }
.skeleton--title { height: 22px; width: 60%; margin-bottom: 12px; }

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ==============================
   STAT CARD ENHANCED
   ============================== */
.stat-card {
  animation: fadeInUp .5s ease forwards;
}

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

/* ==============================
   RESPONSIVE
   ============================== */
@media (max-width: 1024px) {
  .admin-main {
    padding: 32px 24px;
  }

  .admin-sidebar {
    width: 240px;
  }
}

@media (max-width: 768px) {
  .admin-mobile-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: #ffffff;
    border-bottom: 1px solid #edf2f7;
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .admin-wrapper {
    flex-direction: column;
  }

  .admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    z-index: 9999;
    transform: translateX(-100%);
    transition: transform .4s cubic-bezier(0.16, 1, 0.3, 1);
    flex-direction: column;
    padding: 0;
    box-shadow: 4px 0 30px rgba(0,0,0,0.2);
    border-radius: 0 16px 16px 0;
  }

  .admin-sidebar--open {
    transform: translateX(0) !important;
  }

  .admin-sidebar__logo {
    padding: 24px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    flex: none;
  }

  .admin-sidebar__nav {
    display: flex !important;
    flex-direction: column;
    padding: 16px;
    order: unset;
    overflow-y: auto;
  }

  .admin-sidebar__nav-title:first-child {
    margin-top: 0;
  }

  .admin-sidebar__toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #f4f7f9;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: var(--admin-sidebar);
    font-size: 24px;
    line-height: 1;
    padding: 0;
    transition: background .2s;
  }

  .admin-sidebar__toggle:hover {
    background: #e2e8f0;
  }

  /* Sidebar overlay */
  .admin-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity .4s ease;
  }

  .admin-sidebar-overlay--open {
    opacity: 1 !important;
    pointer-events: all !important;
  }

  /* Sidebar close button inside drawer */
  .admin-sidebar__close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 2.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .3s;
    z-index: 10;
  }

  .admin-sidebar__close:hover {
    color: var(--gold);
  }

  .admin-main {
    padding: 24px 16px;
    margin-left: 0;
  }

  .admin-main__title {
    font-size: 1.5rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .stat-card {
    padding: 16px;
  }

  .admin-card__header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
    padding: 16px 20px;
  }

  .admin-table th,
  .admin-table td {
    padding: 12px 16px;
  }

  .login-box {
    padding: 32px 24px;
    margin: 16px;
  }

  .login-box__title {
    font-size: 1.6rem;
  }
}

@media (max-width: 480px) {
  .admin-main {
    padding: 16px 12px;
  }

  .admin-main__title {
    font-size: 1.25rem;
  }

  .admin-table {
    font-size: 0.8rem;
  }

  .admin-table th,
  .admin-table td {
    padding: 8px 12px;
  }

  .stat-card {
    flex-direction: column;
    text-align: center;
  }

  .login-box {
    padding: 28px 20px;
    margin: 12px;
  }

  .login-box__title {
    font-size: 1.35rem;
  }

  .toast-container {
    top: 12px;
    right: 12px;
    left: 12px;
  }

  .toast {
    min-width: unset;
    max-width: unset;
    width: 100%;
  }

  .admin-sidebar {
    max-width: 100vw;
    border-radius: 0;
  }

  .admin-sidebar-overlay {
    display: block;
  }

  .admin-sidebar__close {
    display: flex;
  }
}

/* Table wrapper for horizontal scroll */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ==============================
   ADMIN ACTIONS (filter/toolbar)
   ============================== */
.admin-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

@media (max-width: 600px) {
  .admin-actions {
    flex-direction: column;
    align-items: stretch;
  }
}



/* Mobile top bar */
.admin-mobile-header {
  display: none;
}

@media (max-width: 768px) {
  .admin-mobile-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #fff;
    border-bottom: 1px solid #edf2f7;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  }
}

/* No scroll */
body.no-scroll {
  overflow: hidden !important;
  height: 100vh !important;
}

/* Stat card animation */
.stat-card {
  opacity: 0;
  transform: translateY(20px);
}

.stat-card--visible {
  animation: fadeInUp .5s ease forwards;
}

/* Action buttons (icon-only) */
.action-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f4f7f9;
  color: var(--admin-text-muted);
  transition: all 0.2s;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.action-btn:hover {
  background: var(--gold);
  color: var(--brown-dark);
  transform: translateY(-2px);
}

.action-btn.text-danger:hover {
  background: #fc8181;
  color: white;
}

.action-btn svg {
  pointer-events: none;
}

/* Ripple on admin buttons */
.btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.4);
  transform: scale(0);
  animation: rippleAnim .6s ease-out forwards;
  pointer-events: none;
}

@keyframes rippleAnim {
  to { transform: scale(4); opacity: 0; }
}

/* Material form grid */
.material-form-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
}

@media (max-width: 900px) {
  .material-form-grid {
    grid-template-columns: 1fr;
  }
}

/* Builder layout */
.builder-empty {
  text-align: center;
  padding: 80px 40px;
  background: white;
  border-radius: 24px;
  border: 2px dashed #e2e8f0;
  margin-top: 20px;
}

@media (max-width: 600px) {
  .builder-empty {
    padding: 40px 20px;
  }

  .builder-empty p {
    max-width: 100% !important;
  }
}

.builder-module {
  margin-bottom: 32px;
  overflow: hidden;
}

.builder-module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: #fafcfd;
  border-bottom: 1px solid #edf2f7;
  flex-wrap: wrap;
  gap: 12px;
}

.builder-module-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-weight: 700;
  font-size: 1.05rem;
}

.builder-module-order {
  background: var(--admin-sidebar);
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  flex-shrink: 0;
}

.builder-module-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.builder-lessons-empty {
  padding: 32px;
  font-size: 0.85rem;
  color: var(--admin-text-muted);
  text-align: center;
  background: #fafafa;
  border-radius: 12px;
  margin: 16px;
}

.builder-lesson-order {
  text-align: center;
  font-weight: 700;
  color: var(--admin-text-muted);
  white-space: nowrap;
}

.builder-lesson-title {
  font-weight: 600;
  color: var(--brown-dark);
}

.builder-lesson-meta {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--teal);
}

.builder-lesson-meta span {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.builder-lesson-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* Mobile builder responsive */
@media (max-width: 600px) {
  .builder-module-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .builder-module-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .builder-lesson-actions {
    justify-content: flex-start;
    gap: 6px;
  }

  .builder-lesson-meta span {
    max-width: 120px;
  }

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

/* Modal wrapper for responsive modals */
.admin-modal .admin-card {
  max-height: 90vh;
  overflow-y: auto;
}

@media (max-width: 600px) {
  .admin-modal .admin-card {
    padding: 24px 16px !important;
    width: 95% !important;
  }

  .admin-modal .admin-card .btn {
    font-size: 0.85rem;
    padding: 10px 16px;
  }
}

/* Dashboard grid */
.admin-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 32px;
}

@media (max-width: 1024px) {
  .admin-dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* Quick access bar */
.admin-quick-access {
  margin-top: 32px;
  background: #fff;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

@media (max-width: 600px) {
  .admin-quick-access {
    flex-direction: column;
    text-align: center;
  }
}

/* Material form fields (4-col grid in materials.php) */
.material-form-fields {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 16px;
  align-items: end;
}

@media (max-width: 900px) {
  .material-form-fields {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .material-form-fields {
    grid-template-columns: 1fr;
  }
}

/* Form grid for modal with responsive fallback */
.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .form__row {
    grid-template-columns: 1fr;
  }
}

/* Form feedback */
.form__input--error {
  border-color: #DC3545 !important;
  box-shadow: 0 0 0 3px rgba(220,53,69,.12) !important;
}

.form__input--success {
  border-color: #28A745 !important;
  box-shadow: 0 0 0 3px rgba(40,167,69,.12) !important;
}

.form__error {
  font-size: .8rem;
  color: #DC3545;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  animation: fadeInUp .3s ease forwards;
}

/* Image preview in forms */
.img-preview {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

@media (max-width: 480px) {
  .admin-table input[type="number"],
  .admin-table select {
    width: 100% !important;
    box-sizing: border-box;
  }
}

.admin-sidebar-overlay {
  display: none;
}

.admin-sidebar__close {
  display: none;
}

.admin-table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Table row hover */
.admin-table tbody tr {
  transition: background .2s ease;
}

.admin-table tbody tr:hover {
  background: #f8fafc;
}

/* Table responsive card view on very small screens */
@media (max-width: 540px) {
  .admin-table-card-view {
    display: block;
  }

  .admin-table-card-view thead {
    display: none;
  }

  .admin-table-card-view tbody tr {
    display: block;
    padding: 16px;
    margin-bottom: 12px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid #edf2f7;
  }

  .admin-table-card-view tbody tr:hover {
    background: #fff;
  }

  .admin-table-card-view td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.85rem;
  }

  .admin-table-card-view td:last-child {
    border-bottom: none;
  }

  .admin-table-card-view td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--admin-text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-right: 12px;
  }
}

/* ==========================================================================
   ENHANCED MODERN ADMIN INTERFACE & RESPONSIVE POLISH
   ========================================================================== */

/* Enhanced Root Variables */
:root {
    --admin-sidebar: #092316;
    --admin-sidebar-hover: #13422a;
    --admin-bg: #f4f7f5;
    --admin-card: #ffffff;
    --admin-border: #e2e8e4;
    --admin-text: #1a202c;
    --admin-text-muted: #64748b;
    --gold: #938925;
    --gold-hover: #7e751d;
    --gold-light: #fefce8;
    --teal: #2d6a4f;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 16px 36px -6px rgba(0, 0, 0, 0.1);
    --font-title: 'Outfit', sans-serif;
    --font-body: 'DM Sans', sans-serif;
}

body {
    background: var(--admin-bg);
    color: var(--admin-text);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
}

/* Sidebar Improvements */
.admin-sidebar {
    background: var(--admin-sidebar);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-sidebar__logo span {
    letter-spacing: -0.01em;
}

.admin-sidebar__link {
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-sidebar__link:hover {
    background: rgba(255, 255, 255, 0.09);
    color: #ffffff;
    transform: translateX(4px);
}

.admin-sidebar__link.active {
    background: linear-gradient(135deg, var(--gold) 0%, #82781f 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(147, 137, 37, 0.35);
}

/* Admin Main Content Container */
.admin-main {
    padding: 36px 40px;
    background: var(--admin-bg);
}

.admin-card {
    background: var(--admin-card);
    border-radius: var(--radius);
    border: 1px solid var(--admin-border);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

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

/* Modal Animations & Overlay Polish */
.modal-overlay {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(15, 23, 42, 0.65);
}

.modal-box {
    animation: modalZoom 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-lg);
}

@keyframes modalZoom {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Action Buttons */
.action-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #475569;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
}

.action-btn:hover {
    background: var(--gold);
    color: #ffffff;
    border-color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(147, 137, 37, 0.25);
}

.action-btn.text-danger:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.25);
}

/* Mobile responsive padding & layout */
@media (max-width: 768px) {
    .admin-main {
        padding: 20px 16px;
    }
    
    .admin-main__title {
        font-size: 1.5rem;
    }

    .modal-box {
        padding: 20px 16px !important;
        width: 94% !important;
        border-radius: 16px;
    }
}

/* Page Transition Safety Fix */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--admin-sidebar);
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.page-transition--active {
    opacity: 1;
    pointer-events: all;
}
