/* ============================================================
   MD PRINTER — ADMIN CMS DASHBOARD STYLESHEET (LIGHT THEME)
   ============================================================ */

:root {
  --admin-bg: #f8fafc;
  --admin-card: #ffffff;
  --admin-border: #e2e8f0;
  --admin-sidebar-bg: #0f172a;
  --admin-sidebar-w: 260px;
  --cmyk-cyan: #0085b2;
  --cmyk-magenta: #ee0083;
  --cmyk-yellow: #eab308;
  --cmyk-gold: #c99e50;
  --text-main: #0f172a;
  --text-muted: #64748b;
}

body.admin-body {
  background-color: var(--admin-bg);
  color: var(--text-main);
  display: flex;
  min-height: 100vh;
  margin: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* Sidebar Navigation */
.admin-sidebar {
  width: var(--admin-sidebar-w);
  background: var(--admin-sidebar-bg);
  border-right: 1px solid #1e293b;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.05);
  transition: width 0.3s ease, background 0.4s ease;
}

.sidebar-header {
  padding: 20px 24px;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #090d16;
}

.sidebar-header img {
  height: 38px;
  width: auto;
  object-fit: contain;
}

.sidebar-menu {
  list-style: none;
  padding: 16px 12px 60px 12px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  color: #94a3b8;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.sidebar-link i {
  width: 20px;
  text-align: center;
  font-size: 1rem;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.sidebar-link.active {
  background: linear-gradient(135deg, rgba(0, 133, 178, 0.25), rgba(0, 133, 178, 0.1));
  color: #38bdf8;
  font-weight: 800;
  border-left: 3.5px solid var(--cmyk-cyan);
}

/* Main Layout */
.admin-main {
  margin-left: var(--admin-sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
}

/* Centered Floating Background Watermark for Admin Panel */
.admin-main::after {
  content: "MD PRINTER";
  position: fixed;
  top: 55%;
  left: calc(50% + (var(--admin-sidebar-w, 260px) / 2));
  transform: translate(-50%, -50%) rotate(-10deg);
  font-size: clamp(3.5rem, 8vw, 8.5rem);
  font-weight: 900;
  letter-spacing: 16px;
  color: rgba(0, 133, 178, 0.035);
  -webkit-text-stroke: 1.2px rgba(0, 133, 178, 0.11);
  pointer-events: none;
  z-index: 80;
  white-space: nowrap;
  user-select: none;
  font-family: 'Plus Jakarta Sans', sans-serif;
  text-transform: uppercase;
  transition: color 0.4s ease, -webkit-text-stroke 0.4s ease, left 0.3s ease;
}

body.dark-theme .admin-main::after {
  color: rgba(255, 255, 255, 0.025) !important;
  -webkit-text-stroke: 1.2px rgba(255, 255, 255, 0.09) !important;
}

.admin-topbar {
  height: 72px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  transition: background-color 0.4s ease, border-color 0.4s ease, color 0.4s ease;
}

.admin-topbar-title {
  font-weight: 800;
  font-size: 1.15rem;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-content {
  padding: 36px 32px 60px 32px;
  flex: 1;
  position: relative;
  z-index: 1;
}

/* Card Containers */
.admin-table-card, .admin-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  transition: background-color 0.4s ease, border-color 0.4s ease, color 0.4s ease, box-shadow 0.4s ease;
}

/* Search Input Icon Wrapper - Prevents Search Icon Overlap Across All Pages */
.search-input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.search-input-wrapper i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
  z-index: 10;
  font-size: 0.9rem;
  transition: color 0.4s ease;
}

.search-input-wrapper input.form-control,
.search-input-wrapper input[type="text"] {
  padding-left: 42px !important;
  width: 100%;
}

/* Form Controls System (High Contrast & Clear Readability) */
.form-group {
  margin-bottom: 20px;
}

.form-label, label.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}

.form-control, 
input[type="text"], 
input[type="email"], 
input[type="password"], 
input[type="number"], 
input[type="tel"], 
select, 
textarea {
  width: 100%;
  box-sizing: border-box;
  background-color: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 10px !important;
  padding: 11px 14px;
  font-size: 0.95rem !important;
  font-family: inherit !important;
  outline: none !important;
  transition: all 0.2s ease !important;
}

/* Fix search input icon overlap */
.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  width: 100%;
}

.search-input-wrapper i,
.search-input-wrapper .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.95rem;
  pointer-events: none;
  z-index: 5;
}

.search-input-wrapper input,
.search-input-wrapper .form-control {
  padding-left: 44px !important;
}

/* Custom Select Dropdown Styling */
select.form-control,
.select-styled {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 16px 16px !important;
  padding-right: 40px !important;
  cursor: pointer;
}

/* Administrative Pagination Bar */
.admin-pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px 20px;
  background: #ffffff;
  border-top: 1px solid var(--admin-border);
}

.admin-pagination-info {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 600;
}

.admin-pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #334155;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  text-decoration: none;
  transition: all 0.2s ease;
}

.pagination-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.pagination-btn.active {
  background: #0085b2;
  color: #ffffff;
  border-color: #0085b2;
}

.pagination-btn.disabled {
  opacity: 0.5;
  pointer-events: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--cmyk-cyan) !important;
  box-shadow: 0 0 0 3px rgba(0, 133, 178, 0.15) !important;
  background-color: #ffffff !important;
}

/* Data Tables */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.admin-table-card {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid var(--admin-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

.admin-table th {
  background: #f1f5f9;
  padding: 14px 20px;
  color: #475569;
  font-weight: 800;
  border-bottom: 1px solid var(--admin-border);
  text-transform: uppercase;
  font-size: 0.76rem;
  letter-spacing: 0.5px;
}

.admin-table td {
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
  color: #0f172a;
  vertical-align: middle;
}

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

/* Status Badges */
.badge-status {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  display: inline-block;
}

.badge-New, .badge-published { 
  background: rgba(0, 133, 178, 0.12); 
  color: var(--cmyk-cyan); 
  border: 1px solid rgba(0, 133, 178, 0.3); 
}

.badge-Contacted, .badge-draft { 
  background: rgba(234, 179, 8, 0.12); 
  color: #b45309; 
  border: 1px solid rgba(234, 179, 8, 0.3); 
}

.badge-Quoted { 
  background: rgba(168, 85, 247, 0.12); 
  color: #7e22ce; 
  border: 1px solid rgba(168, 85, 247, 0.3); 
}

.badge-Won { 
  background: rgba(16, 185, 129, 0.12); 
  color: #047857; 
  border: 1px solid rgba(16, 185, 129, 0.3); 
}

.badge-Lost { 
  background: rgba(239, 68, 68, 0.12); 
  color: #b91c1c; 
  border: 1px solid rgba(239, 68, 68, 0.3); 
}

/* Quick Stat Metric Cards */
.admin-stat-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
  display: flex;
  align-items: center;
  gap: 20px;
}

.admin-stat-icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

/* Alert Boxes */
.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #047857;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 700;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #b91c1c;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 700;
}

@media (max-width: 900px) {
  .admin-sidebar { width: 70px; }
  .sidebar-link span { display: none; }
  .sidebar-header img { max-width: 32px; }
  .admin-main { margin-left: 70px; }
  .admin-topbar { padding: 0 16px; }
  .admin-content { padding: 20px 16px; }
}

/* ============================================================
   ADMIN MODAL POPUP SYSTEM STYLES
   ============================================================ */
.admin-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeInAdminModal 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-modal-dialog {
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  animation: scaleUpAdminModal 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.admin-modal-content {
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--admin-border);
}

.admin-modal-header {
  padding: 20px 24px;
  background: #0f172a;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.admin-modal-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.2s ease;
}

.admin-modal-close:hover {
  color: #ef4444;
}

.admin-modal-body {
  padding: 24px;
}

@keyframes fadeInAdminModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleUpAdminModal {
  from { opacity: 0; transform: scale(0.92) translateY(15px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ============================================================
   RESPONSIVE ADMIN PANEL OVERRIDES (MOBILE & TABLET)
   ============================================================ */
.admin-table-card {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid var(--admin-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  display: block !important;
  width: 100% !important;
  margin-bottom: 24px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 850px !important;
}

@media (max-width: 900px) {
  .admin-sidebar { width: 70px !important; }
  .sidebar-link span { display: none !important; }
  .sidebar-header img { max-width: 32px !important; }
  .admin-main { margin-left: 70px !important; }
  .admin-topbar { padding: 0 16px !important; flex-wrap: wrap !important; }
  .admin-content { padding: 20px 14px !important; }
}

@media (max-width: 768px) {
  div[style*="grid-template-columns: 1fr 1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr"],
  div[style*="grid-template-columns: 2fr 1fr"],
  div[style*="grid-template-columns: repeat(4, 1fr)"],
  div[style*="grid-template-columns: repeat(3, 1fr)"] {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  
  .admin-topbar {
    height: auto !important;
    padding: 12px 14px !important;
    gap: 10px;
  }

  .admin-topbar-title {
    font-size: 1rem !important;
  }

  form[style*="display: flex; gap: 10px; margin-bottom: 20px"] {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .admin-modal-backdrop {
    padding: 8px !important;
  }
  .admin-modal-dialog {
    max-width: 98% !important;
    max-height: 94vh !important;
    border-radius: 12px !important;
  }
  .admin-modal-body {
    padding: 16px !important;
  }

  .admin-table th, .admin-table td {
    padding: 12px 14px !important;
    font-size: 0.85rem !important;
  }
}

@media (max-width: 576px) {
  .admin-sidebar { width: 56px !important; }
  .admin-main { margin-left: 56px !important; }
  .sidebar-header { padding: 12px 6px !important; justify-content: center !important; }
  .sidebar-header span { display: none !important; }
  .sidebar-link { padding: 10px 0 !important; justify-content: center !important; }
  .sidebar-link i { font-size: 1.15rem !important; margin: 0 !important; }
  .admin-content { padding: 14px 8px !important; }
}

/* ============================================================
   ADMIN SIDEBAR SCROLLING & BUTTON HOVER SYSTEM OVERRIDES
   ============================================================ */
.admin-sidebar {
  max-height: 100vh !important;
  overflow-y: auto !important;
}

.sidebar-menu {
  padding-bottom: 60px !important;
  overflow-y: auto !important;
}

/* Admin Button Hover Shimmer Sweep & Lift System */
body.admin-body .btn {
  font-family: inherit;
  position: relative;
  overflow: hidden;
  padding: 10px 22px !important;
  font-size: 0.88rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.4px !important;
  border-radius: 10px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  white-space: nowrap !important;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              background-color 0.3s ease,
              border-color 0.3s ease,
              color 0.3s ease !important;
}

body.admin-body .btn::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -130%;
  width: 75%;
  height: 200%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.35) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-25deg);
  transition: left 0.65s cubic-bezier(0.19, 1, 0.22, 1);
  pointer-events: none;
  z-index: 2;
}

body.admin-body .btn:hover::after {
  left: 140%;
}

body.admin-body .btn:hover {
  transform: translateY(-2px) !important;
}

body.admin-body .btn:active {
  transform: translateY(0) scale(0.97) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12) !important;
}

body.admin-body .btn-primary {
  background-color: var(--cmyk-cyan) !important;
  color: #ffffff !important;
  border: 1px solid var(--cmyk-cyan) !important;
}

body.admin-body .btn-primary:hover {
  background-color: #0077b6 !important;
  color: #ffffff !important;
  border-color: #0077b6 !important;
  box-shadow: 0 6px 18px rgba(0, 133, 178, 0.35) !important;
}

body.admin-body .btn-outline, 
body.admin-body .btn-outline-secondary {
  background-color: #ffffff !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
}

body.admin-body .btn-outline:hover, 
body.admin-body .btn-outline-secondary:hover {
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12) !important;
}

body.admin-body .btn-sm {
  padding: 7px 14px !important;
  font-size: 0.8rem !important;
  border-radius: 8px !important;
}

/* Admin Search Bar Alignment System */
.admin-search-form {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  max-width: 680px;
  width: 100%;
}

.admin-search-input {
  flex: 1;
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 10px !important;
  padding: 10px 16px !important;
  font-size: 0.92rem !important;
  color: #0f172a !important;
}

.admin-search-input:focus {
  border-color: var(--cmyk-cyan) !important;
  box-shadow: 0 0 0 3px rgba(0, 133, 178, 0.15) !important;
}

/* ============================================================
   ADMIN TABLE ACTION BUTTONS & ANALYTICS DASHBOARD
   ============================================================ */
.admin-actions {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 6px !important;
  white-space: nowrap !important;
}

.admin-table td .btn, 
.admin-table td button,
.btn-admin-action {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  border-radius: 8px !important;
  font-weight: 700 !important;
  font-size: 0.78rem !important;
  padding: 6px 12px !important;
  line-height: 1.2 !important;
  text-decoration: none !important;
  box-sizing: border-box !important;
  transition: all 0.2s ease !important;
}

/* Keyframes for smooth Chart Bar animation */
@keyframes chartBarGrow {
  0% {
    width: 0% !important;
    opacity: 0.3;
  }
  100% {
    opacity: 1;
  }
}

@keyframes barPulseGlow {
  0% { box-shadow: 0 0 0 rgba(0, 168, 232, 0); }
  50% { box-shadow: 0 0 12px rgba(0, 168, 232, 0.4); }
  100% { box-shadow: 0 0 0 rgba(0, 168, 232, 0); }
}

/* Analytics Chart & Bar Components */
.analytics-chart-bar {
  background: #f1f5f9;
  border-radius: 8px;
  overflow: hidden;
  height: 28px;
  position: relative;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.analytics-chart-fill {
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(90deg, #0085b2 0%, #00a8e8 100%);
  transition: width 1s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.5s ease;
  animation: chartBarGrow 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
  position: relative;
  overflow: hidden;
}

.analytics-chart-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: barShimmer 3s infinite;
}

@keyframes barShimmer {
  0% { left: -100%; }
  60% { left: 150%; }
  100% { left: 150%; }
}

.analytics-chart-fill.current-month {
  background: linear-gradient(90deg, #ee0083 0%, #ff2a9d 100%) !important;
  animation: chartBarGrow 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards, barPulseGlow 3s infinite !important;
}

.quarter-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
  transition: transform 0.2s, box-shadow 0.2s;
}

.quarter-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.06);
}

/* ============================================================
   COLLAPSIBLE SIDEBAR & DARK MODE ENGINE
   ============================================================ */
body.sidebar-collapsed {
  --admin-sidebar-w: 74px;
}

body.sidebar-collapsed .admin-sidebar {
  width: 74px !important;
}

body.sidebar-collapsed .sidebar-header {
  padding: 16px 10px !important;
  justify-content: center !important;
}

body.sidebar-collapsed .sidebar-header span {
  display: none !important;
}

body.sidebar-collapsed .sidebar-menu {
  padding-left: 6px !important;
  padding-right: 6px !important;
}

body.sidebar-collapsed .sidebar-link span,
body.sidebar-collapsed .sidebar-link .badge,
body.sidebar-collapsed .menu-category {
  display: none !important;
}

body.sidebar-collapsed .sidebar-link {
  justify-content: center !important;
  padding: 12px 0 !important;
  gap: 0 !important;
}

body.sidebar-collapsed .sidebar-link i {
  font-size: 1.25rem !important;
}

body.sidebar-collapsed .admin-main {
  margin-left: 74px !important;
}

/* Dark Mode Theme */
body.dark-theme {
  --admin-bg: #0b0f19;
  --admin-card: #151c2c;
  --admin-border: #243048;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  background-color: #0b0f19 !important;
  color: #f1f5f9 !important;
}

body.dark-theme .admin-topbar {
  background: #151c2c !important;
  border-bottom-color: #243048 !important;
  color: #f1f5f9 !important;
}

body.dark-theme .admin-topbar-title {
  color: #f1f5f9 !important;
}

body.dark-theme .admin-table-card,
body.dark-theme .admin-card,
body.dark-theme form[style*="background: #ffffff"],
body.dark-theme form[style*="background:#ffffff"],
body.dark-theme div[style*="background: #ffffff"],
body.dark-theme div[style*="background:#ffffff"],
body.dark-theme div[style*="background: white"],
body.dark-theme div[style*="background:white"],
body.dark-theme .quarter-card {
  background-color: #151c2c !important;
  border-color: #243048 !important;
  color: #f1f5f9 !important;
}

body.dark-theme form[style*="background: #ffffff"] input,
body.dark-theme form[style*="background:#ffffff"] input,
body.dark-theme form[style*="background: #ffffff"] select,
body.dark-theme form[style*="background:#ffffff"] select {
  background-color: #0f172a !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

body.dark-theme .admin-table th {
  background-color: #1e293b !important;
  color: #cbd5e1 !important;
  border-bottom-color: #243048 !important;
}

body.dark-theme .admin-table td,
body.dark-theme tr[style*="border-bottom: 1px solid #f1f5f9"] {
  border-bottom-color: #243048 !important;
  color: #e2e8f0 !important;
}

body.dark-theme h1, 
body.dark-theme h2, 
body.dark-theme h3, 
body.dark-theme h4, 
body.dark-theme h5, 
body.dark-theme strong {
  color: #f8fafc !important;
}

body.dark-theme p, 
body.dark-theme small, 
body.dark-theme span:not(.btn):not(.badge) {
  color: #cbd5e1;
}

body.dark-theme .form-control,
body.dark-theme input[type="text"],
body.dark-theme input[type="email"],
body.dark-theme input[type="password"],
body.dark-theme input[type="number"],
body.dark-theme select,
body.dark-theme textarea {
  background-color: #1e293b !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

body.dark-theme .admin-pagination-bar {
  background-color: #151c2c !important;
  border-top-color: #243048 !important;
}

body.dark-theme .pagination-btn {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}

body.dark-theme .btn-outline {
  background-color: #1e293b !important;
  color: #e2e8f0 !important;
  border-color: #334155 !important;
}

/* Fix Inline Dark Text Colors in Dark Mode */
body.dark-theme [style*="color: #0f172a"],
body.dark-theme [style*="color:#0f172a"],
body.dark-theme [style*="color: #334155"],
body.dark-theme [style*="color:#334155"],
body.dark-theme [style*="color: #475569"],
body.dark-theme [style*="color:#475569"] {
  color: #f8fafc !important;
}

body.dark-theme [style*="color: #64748b"],
body.dark-theme [style*="color:#64748b"],
body.dark-theme [style*="color: #94a3b8"],
body.dark-theme [style*="color:#94a3b8"] {
  color: #cbd5e1 !important;
}

body.dark-theme table td,
body.dark-theme table td div,
body.dark-theme table td strong {
  color: #f8fafc !important;
}

body.dark-theme table td small {
  color: #94a3b8 !important;
}

body.dark-theme table tr {
  background-color: transparent !important;
  border-bottom-color: #243048 !important;
}

body.dark-theme table th {
  background-color: #1e293b !important;
  color: #f1f5f9 !important;
  border-bottom-color: #334155 !important;
}

body.dark-theme .admin-topbar-actions > div[style*="background: #f1f5f9"],
body.dark-theme div[style*="background: #f1f5f9"] {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

/* Password Input Eye Toggle Wrapper */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-input-wrapper input {
  padding-right: 42px !important;
}

.password-input-wrapper .password-toggle-eye {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  cursor: pointer;
  z-index: 10;
  padding: 4px;
  transition: color 0.2s;
}

.password-input-wrapper .password-toggle-eye:hover {
  color: var(--cmyk-cyan, #0085b2);
}

/* ============================================================
   ADMIN SIDEBAR DESKTOP COLLAPSED STATE
   ============================================================ */
@media (min-width: 993px) {
  body.sidebar-collapsed .admin-sidebar {
    width: 72px !important;
  }
  body.sidebar-collapsed .admin-sidebar .sidebar-header span,
  body.sidebar-collapsed .admin-sidebar .sidebar-link span,
  body.sidebar-collapsed .admin-sidebar .sidebar-link small {
    display: none !important;
  }
  body.sidebar-collapsed .admin-sidebar .sidebar-link {
    justify-content: center !important;
    padding: 12px 0 !important;
  }
  body.sidebar-collapsed .admin-sidebar .sidebar-link i {
    font-size: 1.25rem !important;
    margin: 0 !important;
  }
  body.sidebar-collapsed .admin-main {
    margin-left: 72px !important;
  }
  body.sidebar-collapsed .admin-main::after {
    left: calc(50% + 36px) !important;
  }
}

/* Admin Mobile Sidebar Backdrop */
.admin-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99990;
  cursor: pointer;
}

/* ============================================================
   ADMIN PANEL TABLET & MOBILE RESPONSIVE ENGINE (MAX-WIDTH: 992PX)
   ============================================================ */
@media (max-width: 992px) {
  .admin-sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 280px !important;
    z-index: 99999 !important;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 12px 0 36px rgba(0, 0, 0, 0.45) !important;
  }

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

  .admin-main {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  .admin-main::after {
    display: none !important;
  }

  .admin-topbar {
    padding: 10px 16px !important;
    height: auto !important;
    min-height: 60px !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
  }

  .admin-topbar-title {
    font-size: 1rem !important;
  }

  .admin-topbar-actions {
    flex-wrap: wrap !important;
    gap: 8px !important;
    width: 100% !important;
    justify-content: flex-start !important;
  }

  .admin-topbar-actions .btn {
    padding: 6px 10px !important;
    font-size: 0.78rem !important;
  }

  .admin-content {
    padding: 16px 12px 60px 12px !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }

  /* Tables in Admin: Horizontal Scrolling with Touch Support */
  .table-responsive,
  .admin-table-card,
  .admin-card:has(> table),
  div:has(> table) {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-width: 100% !important;
    display: block !important;
  }

  .admin-table-card table,
  div:has(> table) table,
  table {
    min-width: 650px;
  }
}

/* ============================================================
   ADMIN PANEL SMARTPHONE RESPONSIVE (MAX-WIDTH: 768PX)
   ============================================================ */
@media (max-width: 768px) {
  /* Admin Cards & Widgets */
  .admin-card {
    padding: 16px 14px !important;
    border-radius: 12px !important;
    margin-bottom: 16px !important;
  }

  /* Grid Layouts Stack to Single Column on Mobile */
  div[style*="grid-template-columns: 350px 1fr"],
  div[style*="grid-template-columns: 2fr 1fr"],
  div[style*="grid-template-columns: 1.2fr 0.8fr"],
  div[style*="grid-template-columns: 200px 1fr"],
  div[style*="grid-template-columns: 200px 1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr 1fr"],
  div[style*="repeat(auto-fit, minmax(300px"],
  div[style*="repeat(auto-fit, minmax(280px"],
  div[style*="repeat(auto-fit, minmax(260px"],
  div[style*="repeat(auto-fit, minmax(220px"],
  div[style*="repeat(auto-fit, minmax(200px"],
  div[style*="repeat(auto-fit, minmax(180px"] {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  /* Flex headers wrap cleanly */
  div[style*="display: flex; justify-content: space-between"] {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  /* Admin Modals */
  .admin-modal-dialog {
    max-width: 95vw !important;
    width: 95vw !important;
    margin: 10px auto !important;
  }

  .admin-modal-body {
    padding: 16px 12px !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
  }

  .admin-footer {
    padding: 14px 16px !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }
}


