:root {
  /* Color System */
  --blue-primary: #0284c7;        /* Sky 600 */
  --blue-hover: #0369a1;          /* Sky 700 */
  --blue-light: #f0f9ff;          /* Sky 50 */
  --blue-glow: rgba(2, 132, 199, 0.15);
  
  --green-primary: #10b981;       /* Emerald 500 */
  --green-hover: #059669;         /* Emerald 600 */
  --green-light: #ecfdf5;         /* Emerald 50 */
  --green-glow: rgba(16, 185, 129, 0.15);

  --danger-primary: #ef4444;      /* Red 500 */
  --danger-hover: #dc2626;        /* Red 600 */
  --danger-light: #fef2f2;        /* Red 50 */

  --text-main: #0f172a;           /* Slate 900 */
  --text-muted: #64748b;          /* Slate 500 */
  --text-light: #94a3b8;          /* Slate 400 */

  --bg-main: #f8fafc;             /* Slate 50 */
  --bg-surface: #ffffff;
  --bg-soft: #f1f5f9;             /* Slate 100 */

  --border-light: #e2e8f0;        /* Slate 200 */
  --border-focus: #38bdf8;        /* Sky 300 */
  
  /* Layout & Animations */
  --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.04), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.04), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-premium: 0 20px 25px -5px rgba(15, 23, 42, 0.03), 0 8px 10px -6px rgba(15, 23, 42, 0.03);
}

/* Base resets & typography */
html {
  min-height: 100%;
  font-size: 15px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body.admin-shell {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(2, 132, 199, 0.02) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.02) 0%, transparent 40%);
  background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6, .admin-page-title, .brand-text {
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Header & Navbar */
.admin-navbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  padding: 0.8rem 0;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1020;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main) !important;
}

.brand-icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--blue-primary), var(--green-primary));
  color: #ffffff;
  font-size: 1.15rem;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.2);
}

.brand-text {
  font-size: 1.25rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text-main), #334155);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tag {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  -webkit-text-fill-color: var(--text-muted);
  margin-left: 0.25rem;
}

.admin-user-profile {
  background: var(--bg-surface);
  border-color: var(--border-light) !important;
  font-size: 0.88rem;
  box-shadow: var(--shadow-sm);
}

.user-avatar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--green-primary);
  display: inline-block;
  box-shadow: 0 0 0 3px var(--green-glow);
}

/* Layout container */
.admin-container-main {
  flex: 1;
  margin-top: 2rem;
  padding-bottom: 3rem;
}

/* Full Screen Auth Center Shell */
.admin-shell-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  width: 100%;
  padding: 3rem 1rem;
}

/* Sidebar & Navigation */
.admin-sidebar-col {
  position: relative;
}

.admin-sidebar {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 1.5rem 1rem;
  position: sticky;
  top: 5.5rem;
  box-shadow: var(--shadow-md);
}

.sidebar-header .sidebar-title {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--text-main);
}

.sidebar-header .sidebar-subtitle {
  font-size: 0.75rem;
  font-weight: 400;
}

.admin-menu {
  gap: 0.4rem;
}

.admin-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  transition: var(--transition-smooth);
  border: 1px solid transparent;
}

.admin-menu-item i {
  font-size: 1.1rem;
  transition: var(--transition-smooth);
}

.admin-menu-item:hover {
  background-color: var(--blue-light);
  color: var(--blue-primary);
  border-color: rgba(2, 132, 199, 0.08);
}

.admin-menu-item:hover i {
  transform: translateX(2px);
}

.admin-menu-item.active {
  background: linear-gradient(135deg, var(--blue-light), rgba(16, 185, 129, 0.04));
  color: var(--blue-primary);
  font-weight: 600;
  border-color: rgba(2, 132, 199, 0.15);
  box-shadow: var(--shadow-sm);
}

.admin-menu-item.active i {
  color: var(--blue-primary);
}

/* Premium Dashboard & Widgets */
.admin-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  transition: var(--transition-smooth);
}

.admin-card.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.admin-card-header-gradient {
  background: linear-gradient(135deg, var(--blue-primary), var(--blue-hover));
  color: #ffffff;
  border: none;
}

.admin-card-header-gradient .admin-subtitle {
  color: rgba(255, 255, 255, 0.85);
}

.admin-page-title {
  font-size: 1.75rem;
  color: var(--text-main);
}

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

/* Stat Cards */
.admin-stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

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

.admin-stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--blue-primary);
}

.admin-stat-card.stat-green::after {
  background: var(--green-primary);
}

.stat-icon-wrap {
  width: 3rem;
  height: 3rem;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.stat-blue .stat-icon-wrap {
  background-color: var(--blue-light);
  color: var(--blue-primary);
}

.stat-green .stat-icon-wrap {
  background-color: var(--green-light);
  color: var(--green-primary);
}

.admin-stat-card .stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
  margin-bottom: 0.25rem;
}

.admin-stat-card .stat-label {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9rem;
}

.admin-stat-card .stat-desc {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-top: 0.5rem;
  display: block;
}

/* UI/UX Forms (Premium Design) */
.form-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed var(--border-light);
}

.form-section-title i {
  color: var(--blue-primary);
  font-size: 1.15rem;
}

.form-section-title.health-title i {
  color: var(--green-primary);
}

.form-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: #334155; /* Slate 700 */
  margin-bottom: 0.4rem;
}

.form-control, .form-select {
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
  font-size: 0.92rem;
  color: var(--text-main);
  background-color: #fafafa;
  transition: var(--transition-smooth);
}

.form-control:focus, .form-select:focus {
  background-color: var(--bg-surface);
  border-color: var(--border-focus);
  box-shadow: 0 0 0 4px var(--blue-glow);
  outline: none;
}

.form-control::placeholder {
  color: var(--text-light);
  font-size: 0.88rem;
}

/* Premium Seamless Input Group (For unified search & login fields) */
.premium-input-group {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  transition: var(--transition-smooth);
}

.premium-input-group .input-group-text {
  border: none;
  background-color: #fafafa;
  color: var(--text-muted);
  border-radius: 10px 0 0 10px !important;
  transition: var(--transition-smooth);
}

.premium-input-group .form-control {
  border: none;
  background-color: #fafafa;
  border-radius: 0 10px 10px 0 !important;
  transition: var(--transition-smooth);
}

.premium-input-group .form-control:focus {
  box-shadow: none !important;
  background-color: var(--bg-surface);
}

.premium-input-group:focus-within {
  border-color: var(--border-focus) !important;
  box-shadow: 0 0 0 4px var(--blue-glow) !important;
}

.premium-input-group:focus-within .input-group-text {
  background-color: var(--bg-surface);
}

/* Switches & Checkboxes with Fixed Padding (Fix Label Padding Bug!) */
.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-left: 0;
  margin-bottom: 0.25rem;
}

.form-check-input {
  width: 1.35rem;
  height: 1.35rem;
  margin-top: 0;
  margin-left: 0;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background-color: #fafafa;
  transition: var(--transition-smooth);
  cursor: pointer;
}

.form-check-input:checked {
  background-color: var(--green-primary);
  border-color: var(--green-primary);
  box-shadow: 0 0 0 3px var(--green-glow);
}

.form-check-input:focus {
  box-shadow: 0 0 0 3px var(--blue-glow);
  border-color: var(--blue-primary);
}

/* Styled Toggle Switches with Correct Alignment and Grid Spacing */
.form-switch {
  padding-left: 2.8rem !important;
}

.form-switch .form-check-input {
  margin-left: -2.8rem !important;
  width: 2.2rem !important;
  height: 1.25rem !important;
  border-radius: 100px !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%2394a3b8'/%3e%3c/svg%3e") !important;
  background-position: left center !important;
  background-repeat: no-repeat !important;
  transition: var(--transition-smooth) !important;
}

.form-switch .form-check-input:checked {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23ffffff'/%3e%3c/svg%3e") !important;
  background-position: right center !important;
  background-color: var(--green-primary) !important;
  border-color: var(--green-primary) !important;
}

.form-check-label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
  padding-left: 0.2rem;
}

/* File Upload and Image Previews */
.photo-upload-container {
  border: 2px dashed var(--border-light);
  background-color: var(--bg-main);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  transition: var(--transition-smooth);
}

.photo-upload-container:hover {
  border-color: var(--blue-primary);
  background-color: var(--blue-light);
}

.existing-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}

.photo-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  aspect-ratio: 1;
  background-color: var(--bg-soft);
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

.photo-card:hover img {
  transform: scale(1.05);
}

.photo-badge-primary {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(2, 132, 199, 0.9);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
  padding: 0.25rem 0;
}

/* Beautiful Modern Buttons */
.btn {
  font-family: 'Outfit', sans-serif;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.6rem 1.25rem;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.btn-primary {
  background-color: var(--blue-primary);
  border-color: var(--blue-primary);
  color: #ffffff;
}

.btn-primary:hover, .btn-primary:focus {
  background-color: var(--blue-hover);
  border-color: var(--blue-hover);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.25);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-success {
  background-color: var(--green-primary);
  border-color: var(--green-primary);
  color: #ffffff;
}

.btn-success:hover, .btn-success:focus {
  background-color: var(--green-hover);
  border-color: var(--green-hover);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
  transform: translateY(-1px);
}

.btn-outline-primary {
  border-color: var(--border-light);
  color: var(--blue-primary);
  background-color: var(--bg-surface);
}

.btn-outline-primary:hover, .btn-outline-primary:focus {
  background-color: var(--blue-light);
  border-color: rgba(2, 132, 199, 0.2);
  color: var(--blue-primary);
  transform: translateY(-1px);
}

.btn-outline-secondary {
  border-color: var(--border-light);
  color: var(--text-muted);
  background-color: var(--bg-surface);
}

.btn-outline-secondary:hover {
  background-color: var(--bg-soft);
  color: var(--text-main);
  border-color: var(--text-light);
}

.btn-outline-danger {
  border-color: rgba(239, 68, 68, 0.15);
  color: var(--danger-primary);
  background-color: var(--bg-surface);
}

.btn-outline-danger:hover {
  background-color: var(--danger-light);
  border-color: rgba(239, 68, 68, 0.25);
  color: var(--danger-hover);
}

.btn-logout {
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
}

/* Responsive Modern Tables */
.table-responsive {
  border-radius: 12px;
  border: 1px solid var(--border-light);
  background-color: var(--bg-surface);
}

.table {
  margin-bottom: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.table thead th {
  background-color: var(--bg-soft);
  color: var(--text-muted);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
}

.table tbody td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.9rem;
  color: var(--text-main);
}

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

.table-hover tbody tr:hover {
  background-color: var(--blue-light) !important;
}

.table-hover tbody tr:last-child td {
  border-bottom: none;
}

/* Badges & Indicators */
.badge {
  font-weight: 600;
  font-size: 0.78rem;
  padding: 0.45rem 0.75rem;
  border-radius: 100px;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.badge.bg-primary-soft {
  background-color: var(--blue-light);
  color: var(--blue-primary);
  border: 1px solid rgba(2, 132, 199, 0.12);
}

.badge.bg-green-soft {
  background-color: var(--green-light);
  color: var(--green-primary);
  border: 1px solid rgba(16, 185, 129, 0.12);
}

.badge.bg-gray-soft {
  background-color: var(--bg-soft);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
}

.badge.bg-danger-soft {
  background-color: var(--danger-light);
  color: var(--danger-primary);
  border: 1px solid rgba(239, 68, 68, 0.12);
}

/* Clean Admin Filters bar */
.admin-filter-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

/* Login Auth Layout (floating premium card style) */
.admin-auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  box-shadow: var(--shadow-premium);
  overflow: hidden;
  position: relative;
}

.admin-auth-header {
  padding: 2.5rem 2.5rem 1.5rem;
  text-align: center;
  background: linear-gradient(to bottom, var(--blue-light) 0%, transparent 100%);
  position: relative;
}

.admin-auth-body {
  padding: 0 2.5rem 2.5rem;
}

.admin-auth-icon-wrapper {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--blue-primary), var(--green-primary));
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.25);
}

/* Footer style */
.admin-footer {
  background-color: rgba(255, 255, 255, 0.6);
  border-top: 1px solid var(--border-light);
  backdrop-filter: blur(4px);
}

/* Alert modifications */
.alert {
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.9rem 1.25rem;
  border: 1px solid transparent;
}

.alert-success {
  background-color: var(--green-light);
  color: var(--green-primary);
  border-color: rgba(16, 185, 129, 0.12);
}

.alert-danger {
  background-color: var(--danger-light);
  color: var(--danger-primary);
  border-color: rgba(239, 68, 68, 0.12);
}

.text-danger {
  font-size: 0.8rem;
  font-weight: 500;
  margin-top: 0.35rem;
  display: block;
}

/* Custom list items for tags */
.cat-tag {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  background-color: var(--bg-soft);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  margin-right: 0.3rem;
  margin-bottom: 0.3rem;
  transition: var(--transition-smooth);
}

.cat-tag:hover {
  border-color: rgba(2, 132, 199, 0.3);
  color: var(--blue-primary);
}

/* Responsive sidebar adaptations */
@media (max-width: 991.98px) {
  .admin-sidebar {
    position: static;
    margin-bottom: 2rem;
  }
  
  .admin-menu {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .admin-menu-item {
    padding: 0.6rem 0.9rem;
    font-size: 0.85rem;
  }
}
