/*
   AstroQnA Admin Panel - Modern Layout with Sidebar, Topbar & Footer
*/

/* Base Layout Container */
body.admin-body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

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

/* =========================================================
   SIDEBAR
   ========================================================= */
.admin-sidebar {
  width: 260px;
  background: #120529;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: all 0.3s ease;
  z-index: 100;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 1.5rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

.sidebar-brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--purple), var(--purple-light));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 4px 15px rgba(108, 59, 206, 0.4);
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
}

.sidebar-brand-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.sidebar-brand-badge {
  font-size: 10.5px;
  color: var(--gold);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 600;
}

.sidebar-menu-title {
  padding: 1.25rem 1.25rem 0.5rem;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text2);
  opacity: 0.6;
  font-weight: 700;
}

.sidebar-nav {
  list-style: none;
  padding: 0 0.75rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border-radius: 10px;
  color: var(--text2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
}

.sidebar-nav-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-nav-icon {
  font-size: 1.15rem;
  width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  transform: translateX(3px);
}

.sidebar-nav-item.active {
  background: linear-gradient(135deg, var(--purple), var(--purple-light));
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.35);
}

.sidebar-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-weight: 600;
}

.sidebar-badge.alert {
  background: #ef4444;
  color: #fff;
  animation: pulse-badge 2s infinite;
}

.sidebar-badge.gold {
  background: #f59e0b;
  color: #000;
  font-weight: 700;
}

@keyframes pulse-badge {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.sidebar-footer {
  margin-top: auto;
  padding: 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-user-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.sidebar-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--purple);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}

.sidebar-user-details {
  display: flex;
  flex-direction: column;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.sidebar-user-role {
  font-size: 11px;
  color: var(--gold);
}

/* =========================================================
   MAIN CONTENT AREA & TOPBAR
   ========================================================= */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg);
}

.admin-topbar {
  min-height: 64px;
  height: auto;
  background: rgba(18, 5, 41, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 2rem;
  position: sticky;
  top: 0;
  z-index: 99;
  gap: 14px;
  flex-wrap: wrap;
}

.admin-topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex-shrink: 0;
}

.topbar-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.2rem;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.topbar-page-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  white-space: nowrap;
  letter-spacing: 0.3px;
  line-height: 1.2;
}

.admin-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
  justify-content: flex-end;
}

.topbar-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 20px;
  font-size: 12px;
  color: #6ee7b7;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1;
}

.topbar-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  flex-shrink: 0;
}

.btn-topbar {
  padding: 6px 13px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--transition);
  line-height: 1.2;
}

.btn-topbar-primary {
  background: var(--purple);
  color: #fff;
  border: none;
}

.btn-topbar-primary:hover {
  background: var(--purple-light);
  transform: translateY(-1px);
}

.btn-topbar-outline {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-topbar-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

@media (max-width: 1200px) {
  .topbar-hide-md {
    display: none !important;
  }
}

@media (max-width: 900px) {
  .topbar-hide-sm {
    display: none !important;
  }
}

/* Form & Section Grid */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* Page Content Container */
.admin-page-content {
  padding: 1.75rem 2rem;
  flex: 1;
  width: 100%;
  box-sizing: border-box;
}

/* =========================================================
   BLOG STUDIO 2-COLUMN LAYOUT
   ========================================================= */
.blog-studio-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.75rem;
  align-items: start;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 1100px) {
  .blog-studio-grid {
    grid-template-columns: 1fr;
  }
}

.blog-quick-tools {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.btn-format-tool {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 3px 8px;
  font-size: 11.5px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-format-tool:hover {
  background: rgba(139, 92, 246, 0.2);
  color: var(--purple-light);
  border-color: rgba(139, 92, 246, 0.4);
}

.emoji-picker-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.emoji-chip {
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  font-size: 15px;
  transition: all 0.15s;
}

.emoji-chip:hover, .emoji-chip.active {
  background: rgba(139, 92, 246, 0.25);
  border-color: var(--purple-light);
  transform: scale(1.1);
}

.category-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.category-chip {
  cursor: pointer;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text2);
  border: 1px solid var(--border);
  transition: all 0.15s;
}

.category-chip:hover {
  background: rgba(139, 92, 246, 0.2);
  color: #fff;
  border-color: var(--purple-light);
}

.live-card-preview {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  margin-top: 10px;
}

.live-card-media {
  height: 120px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(217, 119, 6, 0.15));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.live-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.live-card-emoji {
  font-size: 40px;
}

.live-card-body {
  padding: 12px;
}

.live-card-cat {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--purple-light);
  font-weight: 700;
  margin-bottom: 4px;
}

.live-card-title {
  font-family: var(--font-display);
  font-size: 13.5px;
  color: var(--text);
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.3;
}

.live-card-excerpt {
  font-size: 11px;
  color: var(--text2);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* =========================================================
   DASHBOARD STAT CARDS
   ========================================================= */
.dashboard-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.dash-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.dash-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--purple-light), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}

.dash-card:hover {
  transform: translateY(-3px);
  border-color: var(--purple-light);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

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

.dash-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.dash-card-label {
  font-size: 13.5px;
  color: var(--text2);
  font-weight: 500;
}

.dash-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.dash-card.purple .dash-card-icon {
  background: rgba(139, 92, 246, 0.15);
  color: var(--purple-light);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.dash-card.blue .dash-card-icon {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.dash-card.amber .dash-card-icon {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.dash-card.emerald .dash-card-icon {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.dash-card-val {
  font-size: 2.2rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.dash-card-footer {
  font-size: 12px;
  color: var(--text2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* =========================================================
   CARDS & TABLES
   ========================================================= */
.admin-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem;
  margin-bottom: 2rem;
}

.admin-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-card-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-search-input {
  min-width: 220px;
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13.5px;
  outline: none;
}

.admin-search-input:focus {
  border-color: var(--purple-light);
}

.admin-select {
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13.5px;
  outline: none;
}

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

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

.admin-table th {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text2);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.admin-table td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text);
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Badges */
.admin-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 600;
  background: rgba(139, 92, 246, 0.15);
  color: var(--purple-light);
  border: 1px solid rgba(139, 92, 246, 0.3);
  white-space: nowrap;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-info {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Action Buttons */
.btn-sm {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-edit {
  background: rgba(139, 92, 246, 0.2);
  color: #d8b4fe;
  border: 1px solid rgba(139, 92, 246, 0.4);
}

.btn-edit:hover {
  background: var(--purple);
  color: #fff;
}

.btn-delete {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-delete:hover {
  background: #dc2626;
  color: #fff;
}

.btn-view {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-view:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Forms */
.form-group {
  margin-bottom: 1.35rem;
}

.form-group label {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text2);
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
  transition: border-color var(--transition);
}

.form-control:focus {
  border-color: var(--purple-light);
  background: rgba(255, 255, 255, 0.07);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

/* Modals */
.admin-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  box-sizing: border-box;
}

.admin-modal-overlay.open {
  display: flex;
}

.admin-modal {
  background: #18122B;
  border: 1px solid var(--border);
  border-radius: 14px;
  max-width: 650px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  position: relative;
}

.admin-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
}

.admin-modal-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

/* =========================================================
   ADMIN FOOTER
   ========================================================= */
.admin-footer {
  height: 60px;
  background: #120529;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  font-size: 13px;
  color: var(--text2);
  margin-top: auto;
}

.admin-footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-footer-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* Page Header Standard Styles */
.admin-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.75rem;
  flex-wrap: nowrap;
  gap: 16px;
}

.admin-page-header-text {
  flex: 1 1 auto;
  min-width: 0;
}

.admin-page-heading {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text);
  margin: 0;
  line-height: 1.25;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-page-subheading {
  color: var(--text2);
  font-size: 13.5px;
  margin: 4px 0 0;
  line-height: 1.45;
  max-width: 650px;
}

.admin-page-header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

/* Sidebar Backdrop for Mobile */
.sidebar-backdrop {
  display: none;
}

/* =========================================================
   RESPONSIVE BREAKPOINTS
   ========================================================= */
@media (max-width: 1024px) {
  .dashboard-stat-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
  }
  .blog-studio-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .admin-page-header {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .admin-page-header-actions {
    flex-wrap: wrap;
    width: 100%;
  }
}

@media (max-width: 850px) {
  .admin-sidebar {
    position: fixed;
    left: -270px;
    width: 270px;
    z-index: 1000;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .admin-sidebar.open {
    left: 0;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.85);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
  }

  .topbar-toggle {
    display: inline-flex;
  }

  .topbar-hide-mobile {
    display: none !important;
  }

  .admin-page-content {
    padding: 1.25rem 1rem;
  }

  .form-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 768px) {
  .admin-topbar {
    padding: 0 0.85rem !important;
    min-height: 54px !important;
    height: 54px !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
  }

  .admin-topbar-left {
    gap: 8px !important;
    flex: 1 !important;
    min-width: 0 !important;
  }

  .topbar-toggle {
    width: 34px !important;
    height: 34px !important;
    font-size: 1.1rem !important;
  }

  .topbar-page-title {
    font-size: 0.92rem !important;
    max-width: calc(100vw - 145px) !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .admin-topbar-right {
    margin-left: auto !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
    flex-shrink: 0 !important;
  }

  .topbar-status {
    padding: 4px 8px !important;
    font-size: 11px !important;
  }

  .btn-topbar {
    padding: 5px 9px !important;
    font-size: 11.5px !important;
  }

  .topbar-logout-text {
    display: none !important;
  }
}

@media (max-width: 640px) {
  .admin-page-content {
    padding: 1rem 0.75rem !important;
  }

  .admin-page-heading {
    font-size: 1.15rem !important;
  }

  .admin-page-subheading {
    font-size: 12.5px !important;
  }

  .admin-page-header-actions {
    width: 100% !important;
    display: flex !important;
    gap: 8px !important;
  }

  .admin-page-header-actions .btn-topbar {
    flex: 1 1 calc(50% - 6px) !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 8px 10px !important;
    font-size: 12px !important;
  }

  /* Stat cards 2x2 grid on mobile */
  .dashboard-stat-grid,
  .dashboard-stat-grid.cols-3 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.65rem !important;
    margin-bottom: 1.25rem !important;
  }

  .dash-card {
    padding: 0.85rem 0.75rem !important;
    border-radius: 10px !important;
  }

  .dash-card-header {
    margin-bottom: 0.35rem !important;
  }

  .dash-card-label {
    font-size: 11px !important;
    line-height: 1.25 !important;
  }

  .dash-card-icon {
    width: 30px !important;
    height: 30px !important;
    font-size: 0.95rem !important;
    border-radius: 8px !important;
  }

  .dash-card-val {
    font-size: 1.45rem !important;
    margin-bottom: 0.25rem !important;
  }

  .dash-card-footer {
    font-size: 10.5px !important;
    padding-top: 0.35rem !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 2px !important;
  }

  /* Card and table responsive */
  .admin-card {
    padding: 1rem 0.85rem !important;
    border-radius: 10px !important;
    margin-bottom: 1.25rem !important;
  }

  .admin-card-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }

  .admin-card-title {
    font-size: 1.15rem !important;
  }

  .admin-filter-bar {
    width: 100% !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .admin-search-input,
  .admin-select {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .admin-filter-bar button,
  .admin-filter-bar a {
    width: 100% !important;
    text-align: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }

  .admin-table-wrapper {
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: 8px;
  }

  .admin-table {
    min-width: 620px !important;
    font-size: 12.5px !important;
  }

  .admin-table th,
  .admin-table td {
    padding: 10px 8px !important;
  }

  .admin-modal-overlay {
    padding: 0.75rem !important;
  }

  .admin-modal {
    padding: 1.25rem 1rem !important;
    max-height: 94vh !important;
    border-radius: 12px !important;
  }

  .admin-modal-close {
    top: 12px !important;
    right: 12px !important;
  }

  .admin-footer {
    flex-direction: column !important;
    height: auto !important;
    padding: 1rem 0.75rem !important;
    gap: 6px !important;
    text-align: center !important;
    font-size: 12px !important;
  }

  .admin-footer-left,
  .admin-footer-right {
    flex-direction: column !important;
    align-items: center !important;
    gap: 4px !important;
  }
}

@media (max-width: 380px) {
  .dashboard-stat-grid,
  .dashboard-stat-grid.cols-3 {
    grid-template-columns: 1fr !important;
  }

  .topbar-admin-badge .topbar-admin-name {
    display: none !important;
  }
}

