:root {
  --bg: #f0fdfa;
  --bg-pattern: #ecfdf5;
  --surface: #ffffff;
  --text: #134e4a;
  --text-muted: #5f8a85;
  --border: #ccfbf1;
  --primary: #0d9488;
  --primary-light: #14b8a6;
  --primary-glow: rgba(13, 148, 136, 0.15);
  --shadow-sm: 0 1px 3px rgba(13, 148, 136, 0.06);
  --shadow-md: 0 4px 20px rgba(13, 148, 136, 0.1);
  --shadow-lg: 0 12px 40px rgba(13, 148, 136, 0.12);
  --radius: 16px;
  --radius-sm: 12px;
  --sidebar-w: 260px;
  --navbar-h: 68px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
}

body {
  font-family: 'Cairo', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(20, 184, 166, 0.12), transparent),
    radial-gradient(ellipse 60% 50% at 90% 100%, rgba(13, 148, 136, 0.08), transparent);
  pointer-events: none;
  z-index: 0;
}

.app {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  box-shadow: var(--shadow-sm);
  pointer-events: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.brand-icon {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

.brand-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.brand h1 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.brand p {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  min-height: 48px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  text-align: right;
  width: 100%;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

.nav-item .nav-icon,
.nav-item svg {
  pointer-events: none;
}

.nav-item:hover {
  background: var(--bg-pattern);
  color: var(--primary);
}

.nav-item.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: auto;
}

.logout-btn:hover {
  border-color: #fca5a5;
  color: #dc2626;
  background: #fef2f2;
}

/* ── Main ── */
.main {
  flex: 1;
  margin-right: var(--sidebar-w);
  max-width: calc(100% - var(--sidebar-w));
}

.main-content {
  padding: calc(var(--navbar-h) + 2rem) 2.5rem 2rem;
  max-width: 1200px;
}

/* ── Top Navbar ── */
.sidebar-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--primary);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.sidebar-toggle:hover {
  background: #f0fdfa;
  border-color: var(--primary-light);
}

.sidebar-toggle svg {
  width: 20px;
  height: 20px;
}

.sidebar-overlay {
  display: none;
}

.top-navbar {
  position: fixed;
  top: 0;
  right: var(--sidebar-w);
  left: 0;
  height: var(--navbar-h);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 90;
  box-shadow: var(--shadow-sm);
}

.navbar-brand-mini {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.9rem;
}

.navbar-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #000;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.navbar-brand-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.navbar-dropdown-wrap {
  position: relative;
}

.navbar-icon-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.navbar-icon-btn:hover,
.navbar-admin-btn:hover {
  border-color: #99f6e4;
  color: var(--primary);
  background: #f0fdfa;
}

.navbar-icon-btn svg {
  width: 20px;
  height: 20px;
}

.navbar-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e11d48;
  color: white;
  font-size: 0.65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
}

.navbar-badge.is-hidden {
  display: none;
}

.navbar-admin-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.75rem 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

.admin-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  font-size: 0.85rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.admin-avatar-lg {
  width: 44px;
  height: 44px;
  font-size: 1rem;
}

.admin-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: right;
  line-height: 1.3;
}

.admin-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}

.admin-role {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.admin-chevron {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.navbar-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  min-width: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
  animation: dropdownIn 0.2s ease;
}

.navbar-dropdown-wrap:last-child .navbar-dropdown {
  left: auto;
  right: 0;
}

@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--border);
}

.dropdown-header h4 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
}

.dropdown-link {
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
}

.dropdown-link:hover {
  text-decoration: underline;
}

.notifications-list {
  list-style: none;
  max-height: 320px;
  overflow-y: auto;
}

.notification-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid #f0fdfa;
  cursor: pointer;
  transition: background 0.15s ease;
}

.notification-item:hover {
  background: #f0fdfa;
}

.notification-item.unread {
  background: #fafffe;
}

.notification-item.unread::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 0.45rem;
  flex-shrink: 0;
}

.notification-item:not(.unread)::before {
  content: '';
  width: 8px;
  flex-shrink: 0;
}

.notification-body strong {
  display: block;
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 0.15rem;
}

.notification-body span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.notification-time {
  display: block;
  font-size: 0.7rem;
  color: #94a3b8;
  margin-top: 0.25rem;
}

.admin-dropdown-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.1rem;
}

.admin-dropdown-header strong {
  display: block;
  font-size: 0.9rem;
  color: var(--text);
}

.admin-dropdown-header span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
}

.dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1.1rem;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: right;
  transition: background 0.15s ease;
}

.admin-dropdown-menu {
  display: flex;
  flex-direction: column;
  padding: 0.35rem 0;
}

.dropdown-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.dropdown-item:hover {
  background: #f0fdfa;
}

.dropdown-item:hover svg {
  color: var(--primary);
}

.dropdown-item-logout {
  color: #dc2626;
}

.dropdown-item-logout svg {
  color: #dc2626;
}

.dropdown-item-logout:hover {
  background: #fef2f2;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.page-header h2 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
}

.page-header p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.header-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-greeting {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.pulse {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

/* ── Pages ── */
.page {
  display: none;
  animation: fadeIn 0.35s ease;
}

.page.active {
  display: block;
}

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

/* ── Stats ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0.7;
}

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

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.stat-icon svg {
  width: 22px;
  height: 22px;
}

.stat-icon.teal { background: #ccfbf1; color: #0d9488; }
.stat-icon.cyan { background: #cffafe; color: #0891b2; }
.stat-icon.rose { background: #ffe4e6; color: #e11d48; }
.stat-icon.blue { background: #dbeafe; color: #2563eb; }
.stat-icon.purple { background: #ede9fe; color: #7c3aed; }
.stat-icon.gold { background: #fef3c7; color: #ca8a04; }

/* ── Sales section ── */
.sales-summary {
  display: grid;
  grid-template-columns: 1fr 1fr 2.2fr;
  align-items: start;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.sales-stat {
  margin-bottom: 0;
  align-self: start;
  height: auto;
}

.sales-chart-panel {
  margin-bottom: 0;
}

.sales-chart-panel h3 {
  margin-bottom: 1rem;
}

.stat-value {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
  margin-bottom: 0.35rem;
}

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

/* ── Panels ── */
.charts-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.panel h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.25rem;
}

.chart-wrap {
  position: relative;
  height: 280px;
}

/* ── Regions ── */
.regions-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.region-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.region-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.region-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.region-count {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--primary);
}

.region-bar {
  height: 8px;
  background: #ecfdf5;
  border-radius: 999px;
  overflow: hidden;
}

.region-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 999px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Empty pages ── */
.empty-panel {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-panel h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.empty-panel p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ── Recent inspections ── */
.recent-panel {
  margin-top: 0;
}

.recent-table-wrap {
  overflow-x: auto;
}

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

.recent-table th {
  text-align: right;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--border);
}

.recent-table td {
  padding: 1rem;
  border-bottom: 1px solid #f0fdfa;
  font-size: 0.9rem;
}

.recent-table tbody tr {
  transition: background 0.15s ease;
}

.recent-table tbody tr:hover {
  background: #f0fdfa;
}

.hive-id {
  font-weight: 700;
  color: var(--primary);
  margin-left: 0.5rem;
}

.beekeeper-name {
  color: var(--text);
  font-weight: 500;
}

.diagnosis-tag {
  font-weight: 600;
  color: var(--text);
}

.status-badge {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.status-recovered {
  background: #d1fae5;
  color: #047857;
}

.status-treatment {
  background: #fef3c7;
  color: #b45309;
}

.status-open {
  background: #e0e7ff;
  color: #4338ca;
}

/* ── Login page ── */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-page {
  width: 100%;
  max-width: 440px;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-lg);
}

.login-brand {
  text-align: center;
  margin-bottom: 2rem;
}

.login-brand .brand-icon {
  width: 88px;
  height: 88px;
  margin: 0 auto 1rem;
  border-radius: 18px;
}

.login-brand .brand-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.login-brand h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary);
}

.login-brand p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.login-form h2 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: #fafffe;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

.login-error {
  background: #fef2f2;
  color: #dc2626;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
  border: 1px solid #fecaca;
}

.login-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.login-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.login-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.login-btn svg {
  width: 18px;
  height: 18px;
  transform: scaleX(-1);
}

.login-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ── Inspections page ── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.filter-chip {
  padding: 0.45rem 1.1rem;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-chip:hover {
  background: var(--bg-pattern);
}

.filter-chip.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  border-color: transparent;
  box-shadow: 0 3px 10px var(--primary-glow);
}

.inspections-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.inspection-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

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

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.card-delete {
  background: none;
  border: none;
  color: #cbd5e1;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}

.card-delete:hover {
  color: #ef4444;
  background: #fef2f2;
}

.card-delete svg {
  width: 18px;
  height: 18px;
}

.card-id {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text);
}

.card-type-badge {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  background: #ecfdf5;
  color: #0f766e;
}

.card-type-badge.type-varroa {
  background: #fff7ed;
  color: #c2410c;
}

.card-type-badge.type-nosema {
  background: #ecfdf5;
  color: #047857;
}

.card-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.card-beekeeper {
  margin: 0 0 0.35rem;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
}

.card-info {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}

.card-tag {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.tag-diagnosis {
  background: #fce7f3;
  color: #be185d;
}

.tag-mites {
  background: #f1f5f9;
  color: #64748b;
}

.tag-status.status-recovered {
  background: #ccfbf1;
  color: #0d9488;
}

.tag-status.status-treatment {
  background: #ccfbf1;
  color: #0d9488;
}

.tag-status.status-open {
  background: #e0e7ff;
  color: #4338ca;
}

.card-treatment {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  font-weight: 500;
}

.inspections-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ── Data table (beekeepers) ── */
.data-panel {
  padding: 0;
  overflow: hidden;
}

.table-wrap {
  position: relative;
  overflow-x: auto;
}

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

.data-table th {
  text-align: right;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 1rem 1.5rem;
  border-bottom: 2px solid var(--border);
  background: #fafffe;
}

.data-table td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #f0fdfa;
  font-size: 0.9rem;
  color: var(--text);
}

.data-table tbody tr {
  transition: background 0.15s ease;
}

.data-table tbody tr:hover {
  background: #f0fdfa;
}

.clickable-row {
  cursor: pointer;
}

.cell-name {
  font-weight: 700;
}

.clickable-row:hover .cell-name {
  color: var(--primary);
}

.beekeepers-table {
  table-layout: fixed;
  min-width: 980px;
}

.beekeepers-table .col-name { width: 16%; }
.beekeepers-table .col-phone { width: 16%; }
.beekeepers-table .col-email { width: 26%; }
.beekeepers-table .col-location { width: 18%; }
.beekeepers-table .col-status { width: 12%; }
.beekeepers-table .col-action { width: 12%; }

.beekeepers-table th,
.beekeepers-table td {
  text-align: right;
  vertical-align: middle;
}

.beekeepers-table .cell-ltr {
  direction: ltr;
  display: inline-block;
  text-align: left;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.beekeepers-table .cell-location-country {
  line-height: 1.4;
  white-space: normal;
}

.beekeepers-table .cell-location-region {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.beekeepers-table .cell-action {
  text-align: center;
}

.row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
}

.row-delete-btn {
  width: 34px;
  height: 34px;
  border: 1px solid #fecaca;
  border-radius: 10px;
  background: #fff5f5;
  color: #dc2626;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.row-delete-btn svg {
  width: 16px;
  height: 16px;
}

.row-delete-btn:hover:not(:disabled) {
  background: #fee2e2;
  border-color: #fca5a5;
}

.row-delete-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.row-inactive {
  opacity: 0.65;
}

.row-inactive .cell-name {
  color: var(--text-muted);
}

.account-status {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.account-status-active {
  background: #d1fae5;
  color: #047857;
}

.account-status-disabled {
  background: #fee2e2;
  color: #dc2626;
}

.toggle-switch-sm {
  width: 40px;
  height: 22px;
}

.toggle-switch-sm .toggle-slider::before {
  width: 16px;
  height: 16px;
  top: 3px;
  right: 3px;
}

.toggle-switch-sm input:checked + .toggle-slider::before {
  transform: translateX(-18px);
}

/* ── Beekeeper profile page ── */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.back-btn:hover {
  background: #f0fdfa;
  border-color: var(--primary);
}

.back-btn svg {
  width: 18px;
  height: 18px;
}

.profile-page-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.profile-info-panel h3,
.profile-section-panel h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}

.profile-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.profile-info-item {
  background: #fafffe;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
}

.profile-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.profile-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  word-break: break-all;
}

.profile-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.profile-list li {
  background: #fafffe;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.profile-list li.profile-diagnosis-item {
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.profile-list li.profile-diagnosis-item:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.12);
  transform: translateY(-1px);
}

.profile-list li.profile-diagnosis-item::after {
  content: 'عرض التفاصيل ←';
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 700;
  margin-top: 0.25rem;
}

.profile-list li strong {
  font-size: 0.88rem;
  color: var(--text);
}

.profile-list li span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.profile-empty {
  font-size: 0.85rem;
  color: #94a3b8;
  padding: 0.5rem 0;
}

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

.profile-chart-header h3 {
  margin-bottom: 0;
}

.trend-badge {
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.trend-improving {
  background: #d1fae5;
  color: #047857;
}

.trend-declining {
  background: #ffe4e6;
  color: #be123c;
}

.trend-stable {
  background: #e0f2fe;
  color: #0369a1;
}

.chart-hint {
  margin-top: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
}

.profile-details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.profile-section-panel {
  min-height: 180px;
}

.profile-order-item em.order-status-tag {
  font-style: normal;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: #ecfeff;
  color: #0f766e;
}

.profile-order-item em.order-status-tag.status-pending { background: #ffedd5; color: #9a3412; }
.profile-order-item em.order-status-tag.status-approved { background: #dbeafe; color: #1d4ed8; }
.profile-order-item em.order-status-tag.status-shipped { background: #e0e7ff; color: #4338ca; }
.profile-order-item em.order-status-tag.status-delivered { background: #d1fae5; color: #065f46; }
.profile-order-item em.order-status-tag.status-rejected { background: #fee2e2; color: #b91c1c; }

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

  .profile-details-grid {
    grid-template-columns: 1fr;
  }
}

.requests-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: #ede9fe;
  color: #7c3aed;
  font-weight: 800;
  font-size: 0.85rem;
}

.partner-status {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.partner-active {
  background: #d1fae5;
  color: #047857;
}

.partner-pending {
  background: #fef3c7;
  color: #b45309;
}

.partner-inactive {
  background: #f1f5f9;
  color: #64748b;
}

.order-status {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.order-pending {
  background: #fef3c7;
  color: #b45309;
}

.order-approved {
  background: #dbeafe;
  color: #1d4ed8;
}

.order-shipped {
  background: #ede9fe;
  color: #6d28d9;
}

.order-delivered {
  background: #d1fae5;
  color: #047857;
}

.order-rejected {
  background: #fee2e2;
  color: #dc2626;
}

.status-select {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  transition: opacity 0.15s ease;
}

.status-select:disabled {
  opacity: 0.6;
  cursor: wait;
}

.status-select.order-pending { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.status-select.order-approved { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
.status-select.order-shipped { background: #ede9fe; color: #6d28d9; border-color: #ddd6fe; }
.status-select.order-delivered { background: #d1fae5; color: #047857; border-color: #a7f3d0; }
.status-select.order-rejected { background: #fee2e2; color: #dc2626; border-color: #fecaca; }

.order-status-locked {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1.5px solid transparent;
  cursor: not-allowed;
  user-select: none;
  white-space: nowrap;
}

.order-status-locked svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.order-status-locked.order-delivered {
  background: #d1fae5;
  color: #047857;
  border-color: #a7f3d0;
}

.table-empty {
  display: none;
  text-align: center;
  padding: 3rem 1rem;
  color: #94a3b8;
  font-size: 0.95rem;
  font-weight: 500;
}

.table-empty.is-visible {
  display: block;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 3px 10px var(--primary-glow);
  white-space: nowrap;
}

.action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 16px var(--primary-glow);
}

.action-btn svg {
  width: 16px;
  height: 16px;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(19, 78, 74, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 1.5rem;
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
}

.modal-close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.modal-close:hover {
  border-color: #fca5a5;
  color: #dc2626;
  background: #fef2f2;
}

.modal-close svg {
  width: 18px;
  height: 18px;
}

.modal-form {
  padding: 1.5rem;
}

.modal-form .form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: #fafffe;
}

.modal-form .form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-error {
  font-size: 0.85rem;
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  margin-bottom: 1rem;
}

.form-error[hidden] {
  display: none;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.modal-btn {
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}

.modal-btn-cancel {
  background: #f0fdfa;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.modal-btn-cancel:hover {
  background: #e6fffa;
  color: var(--text);
}

.modal-btn-submit {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.modal-btn-submit:hover:not(:disabled) {
  transform: translateY(-1px);
}

.modal-btn-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* ── Questions page ── */
.questions-hint {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  background: #f0fdfa;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.questions-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.question-tree-group {
  background: #fafffe;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.question-tree-node {
  position: relative;
}

.question-tree-children {
  margin-right: calc(1.25rem + var(--depth, 0) * 0.5rem);
  padding-right: 1.25rem;
  border-right: 2px dashed #99f6e4;
  margin-top: 0.75rem;
}

.tree-branch-label {
  font-size: 0.72rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  display: inline-block;
}

.tree-branch-yes {
  background: #d1fae5;
  color: #047857;
}

.tree-branch-no {
  background: #fee2e2;
  color: #dc2626;
}

.tree-branch-choice {
  background: #ecfeff;
  color: #0e7490;
}

.question-optional-tag {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #b45309;
}

.question-illustration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.65rem;
  margin: 0.75rem 0 0.35rem;
}

.question-illustration {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #f8fffe;
}

.question-tree-card {
  margin-bottom: 0.5rem;
}

.question-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.question-card-top .question-title {
  margin-bottom: 0;
  flex: 1;
}

.question-edit-btn {
  border: 1px solid #99f6e4;
  background: #f0fdfa;
  color: #0f766e;
  border-radius: 10px;
  padding: 0.35rem 0.7rem;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.question-outcomes {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.75rem 0;
  padding: 0.75rem;
  background: #f8fffe;
  border-radius: var(--radius-sm);
  border: 1px solid #e6fffa;
}

.outcome-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
}

.outcome-row strong {
  color: var(--text);
  min-width: 3rem;
}

.outcome-treatment {
  color: #047857;
  font-weight: 700;
}

.outcome-link {
  color: var(--primary);
  font-weight: 700;
}

.outcome-none {
  color: #94a3b8;
}

.outcome-patch-select {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.78rem;
  background: white;
  max-width: 200px;
}

.question-tree-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tree-add-btn {
  padding: 0.4rem 0.75rem;
  border: 1px dashed #6ee7b7;
  border-radius: 8px;
  background: #ecfdf5;
  color: #047857;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tree-add-btn-no {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #dc2626;
}

.tree-add-btn:hover {
  transform: translateY(-1px);
}

.modal-wide {
  max-width: 520px;
}

.modal-treatment {
  max-width: min(920px, 96vw);
  max-height: min(90vh, 860px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-treatment-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 0;
}

.modal-treatment-form .modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
}

.modal-treatment-form .modal-footer {
  flex-shrink: 0;
  padding: 1rem 1.5rem 1.25rem;
  border-top: 1px solid var(--border);
  background: #fafafa;
}

.modal-treatment-form .modal-footer .form-error {
  margin-bottom: 0.75rem;
}

.modal-treatment-form .modal-footer .modal-actions {
  margin-top: 0;
}

.treatment-form-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 1.75rem;
  align-items: start;
}

.treatment-form-col {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.modal-treatment .severity-levels-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
}

.modal-treatment .severity-level-option {
  padding: 0.6rem 0.75rem;
}

.modal-treatment .severity-level-option span:last-child {
  display: none;
}

.modal-treatment .schedule-times-grid {
  grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 768px) {
  .modal-treatment {
    max-width: 100%;
    max-height: 94vh;
  }

  .treatment-form-layout {
    grid-template-columns: 1fr;
  }

  .modal-treatment .severity-level-option span:last-child {
    display: block;
  }
}

.outcomes-section {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.outcomes-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.outcomes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.outcome-box label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.outcome-box select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.82rem;
  background: #fafffe;
}

.question-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.question-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.question-body {
  flex: 1;
  min-width: 0;
}

.question-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.question-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.question-category {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.question-category-varroa {
  background: #ccfbf1;
  color: #0f766e;
}

.question-category-nosema {
  background: #ede9fe;
  color: #6d28d9;
}

.question-category-both {
  background: #fef3c7;
  color: #b45309;
}

.modal-form .form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: #fafffe;
  resize: vertical;
  min-height: 80px;
}

.modal-form .form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: #fafffe;
}

.modal-form .form-group textarea:focus,
.modal-form .form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.question-card .card-delete {
  flex-shrink: 0;
}

.question-radio {
  width: 22px;
  height: 22px;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.questions-empty {
  text-align: center;
  padding: 3rem;
  color: #94a3b8;
  font-weight: 500;
}

/* ── Treatments page ── */
.diagnosis-levels-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

.levels-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.levels-section-header h3 {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.levels-section-header p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.levels-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
}

.levels-grid-nosema {
  grid-template-columns: repeat(3, 1fr);
}

.level-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  border-right: 4px solid var(--level-color, var(--primary));
  background: #fafffe;
}

.level-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--level-color);
  margin-bottom: 0.35rem;
}

.level-card h4 {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 0.4rem;
}

.level-action {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--level-color);
  margin-bottom: 0.35rem;
}

.level-rec {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.treatment-severity-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}

.severity-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #fef3c7;
  color: #b45309;
}

.severity-tag-safe {
  background: #d1fae5;
  color: #047857;
}

.severity-tag-critical {
  background: #fee2e2;
  color: #dc2626;
}

.field-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0.25rem 0 0.65rem;
  line-height: 1.45;
}

.severity-levels-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.severity-level-option {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fafafa;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.severity-level-option:hover {
  border-color: #93c5fd;
  background: #f8fbff;
}

.severity-level-option:has(input:checked) {
  border-color: #3b82f6;
  background: #eff6ff;
}

.severity-level-option input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.severity-level-option strong {
  display: block;
  font-size: 0.88rem;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
}

.severity-level-option span {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.level-linked-treatments {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px dashed rgba(0, 0, 0, 0.08);
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.level-linked-treatments strong {
  color: var(--text-primary);
}

.treatments-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.treatment-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.treatment-card .card-delete {
  position: static;
}

.treatment-card-actions {
  position: absolute;
  top: 1rem;
  left: 1rem;
  display: flex;
  gap: 0.4rem;
}

.card-edit {
  width: 34px;
  height: 34px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
  color: #1d4ed8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.card-edit svg {
  width: 16px;
  height: 16px;
}

.card-edit:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.treatment-card .card-delete {
  position: static;
  width: 34px;
  height: 34px;
}

.treatment-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.5rem;
  padding-left: 2rem;
}

.treatment-category {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #ccfbf1;
  color: var(--primary);
  margin-bottom: 0.85rem;
}

.treatment-meta {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.treatment-meta li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.treatment-meta li svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--primary);
}

.treatment-meta strong {
  color: var(--text);
}

.treatment-details {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0.65rem;
}

.treatment-calc-hint {
  font-size: 0.78rem;
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
}

.dose-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: -0.25rem 0 0.75rem;
}

.schedule-times-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.schedule-time-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.schedule-time-field input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
}

.treatment-details strong {
  color: var(--text);
  font-weight: 700;
}

.treatments-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: #94a3b8;
  font-weight: 500;
}

/* ── Settings Page ── */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.settings-panel h3 {
  margin-bottom: 1.25rem;
}

.settings-hint {
  margin: -0.5rem 0 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.form-success {
  color: #047857;
  font-size: 0.85rem;
  font-weight: 700;
  margin: 0.5rem 0;
}

.settings-form .form-group input[readonly] {
  background: #f8fffe;
  color: var(--text-muted);
  cursor: default;
}

.settings-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: #fafffe;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.settings-list li strong {
  display: block;
  font-size: 0.88rem;
  color: var(--text);
  margin-bottom: 0.15rem;
}

.settings-list li span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  right: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(-20px);
}

/* ── App Broadcast Notifications ── */
.broadcast-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.broadcast-stat {
  margin: 0;
}

.broadcast-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1.5rem;
  align-items: start;
}

.broadcast-compose h3,
.broadcast-history h3 {
  margin-bottom: 0.5rem;
}

.broadcast-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.broadcast-form .form-group textarea,
.broadcast-form .form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: #fafffe;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.broadcast-form .form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.broadcast-form .form-group textarea:focus,
.broadcast-form .form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

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

.char-count {
  display: block;
  text-align: left;
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 0.35rem;
}

.broadcast-preview {
  margin: 1.25rem 0;
  padding: 1rem;
  background: #f0fdfa;
  border: 1px dashed #99f6e4;
  border-radius: var(--radius-sm);
}

.preview-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.phone-preview {
  max-width: 320px;
  margin: 0 auto;
}

.phone-preview-bar {
  height: 6px;
  width: 40%;
  background: #cbd5e1;
  border-radius: 999px;
  margin: 0 auto 0.75rem;
}

.phone-notification-card {
  display: flex;
  gap: 0.75rem;
  background: white;
  border-radius: 14px;
  padding: 0.85rem 1rem;
  box-shadow: 0 4px 16px rgba(13, 148, 136, 0.12);
  border: 1px solid var(--border);
}

.phone-notification-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.phone-notification-icon svg {
  width: 18px;
  height: 18px;
}

.phone-notification-card strong {
  display: block;
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.phone-notification-card p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.preview-app {
  display: block;
  font-size: 0.68rem;
  color: #94a3b8;
  margin-top: 0.35rem;
}

.broadcast-send-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.broadcast-send-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.broadcast-send-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.broadcast-send-btn svg {
  width: 18px;
  height: 18px;
}

.broadcast-table-msg {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.broadcast-status {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.broadcast-status-delivered {
  background: #d1fae5;
  color: #047857;
}

.broadcast-status-active {
  background: #d1fae5;
  color: #047857;
}

.broadcast-status-ended {
  background: #fee2e2;
  color: #b91c1c;
}

.broadcast-toggle-btn {
  border: 1px solid var(--border, #e5e7eb);
  background: #fff;
  color: #0f172a;
  border-radius: 8px;
  padding: 0.35rem 0.7rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.broadcast-toggle-btn:hover {
  background: #f8fafc;
}

.broadcast-field-hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: #64748b;
}

/* ── Responsive ── */
@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .sales-summary {
    grid-template-columns: 1fr 1fr;
  }

  .sales-chart-panel {
    grid-column: 1 / -1;
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }

  .inspections-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar-toggle {
    display: inline-flex;
  }

  .sidebar-overlay {
    display: block;
    position: fixed;
    /* Cover content only — leave sidebar clickable on the right (RTL). */
    top: 0;
    bottom: 0;
    left: 0;
    right: min(280px, 86vw);
    background: rgba(15, 23, 42, 0.45);
    z-index: 150;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .sidebar-overlay:not([hidden]) {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar {
    width: min(280px, 86vw);
    padding: 1.25rem 1rem;
    transform: translateX(105%);
    transition: transform 0.25s ease;
    z-index: 200;
    box-shadow: none;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .main {
    margin-right: 0;
    max-width: 100%;
  }

  .top-navbar {
    right: 0;
    padding: 0 0.85rem;
  }

  .navbar-brand-text {
    display: none;
  }

  .admin-info,
  .admin-chevron {
    display: none;
  }

  .navbar-admin-btn {
    padding: 0.35rem;
  }

  .main-content {
    padding: calc(var(--navbar-h) + 1rem) 1rem 1.25rem;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions .btn,
  .header-actions button {
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .stat-card {
    padding: 0.9rem;
  }

  .stat-value {
    font-size: 1.35rem;
  }

  .sales-summary {
    grid-template-columns: 1fr;
  }

  .inspections-grid {
    grid-template-columns: 1fr;
  }

  .treatments-grid {
    grid-template-columns: 1fr;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .broadcast-stats {
    grid-template-columns: 1fr;
  }

  .broadcast-grid {
    grid-template-columns: 1fr;
  }

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

  .outcomes-grid {
    grid-template-columns: 1fr;
  }

  .schedule-times-grid {
    grid-template-columns: 1fr;
  }

  .levels-grid,
  .levels-grid-nosema {
    grid-template-columns: 1fr;
  }

  .profile-info-grid {
    grid-template-columns: 1fr;
  }

  .table-wrap,
  .recent-table-wrap {
    margin-inline: -0.25rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .data-table {
    min-width: 560px;
  }

  .navbar-dropdown {
    position: fixed;
    top: calc(var(--navbar-h) + 0.5rem);
    left: 0.75rem;
    right: 0.75rem;
    width: auto;
    max-width: none;
  }

  .modal {
    width: min(100%, 96vw);
    margin: 0.75rem;
  }

  .modal-actions,
  .confirm-delete-actions {
    flex-direction: column-reverse;
  }

  .modal-actions .btn,
  .confirm-delete-btn {
    width: 100%;
  }
}

.modal.modal-inspection-detail {
  width: min(960px, 96vw) !important;
  max-width: min(960px, 96vw) !important;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.insp-view-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.insp-view-hero {
  border-radius: 16px;
  padding: 1.1rem 1.2rem;
  color: #0f172a;
  border: 1px solid #99f6e4;
  background: linear-gradient(135deg, #ecfeff 0%, #f0fdfa 55%, #fff 100%);
}

.insp-view-hero.is-nosema {
  border-color: #fcd34d;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 45%, #fff 100%);
}

.insp-view-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.insp-type-pill,
.insp-status-pill,
.insp-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.insp-type-pill {
  background: #0f766e;
  color: #fff;
}

.insp-view-hero.is-nosema .insp-type-pill {
  background: #b45309;
}

.insp-status-pill.is-ok { background: #d1fae5; color: #065f46; }
.insp-status-pill.is-treatment { background: #ffedd5; color: #9a3412; }
.insp-status-pill.is-open { background: #e0f2fe; color: #075985; }

.insp-view-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: #134e4a;
}

.insp-view-beekeeper {
  margin: 0.25rem 0 0.7rem;
  color: #475569;
  font-size: 0.95rem;
}

.insp-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.insp-chip {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #ccfbf1;
  color: #0f766e;
}

.insp-chip.muted {
  color: #64748b;
  border-color: #e2e8f0;
}

.insp-context {
  margin: 0;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #334155;
  font-size: 0.9rem;
}

.insp-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

@media (max-width: 720px) {
  .insp-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.insp-metric {
  background: #f8fffe;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.insp-metric span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.insp-metric strong {
  font-size: 1rem;
  color: #0f766e;
}

.profile-diagnosis-item {
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.profile-diagnosis-item:hover {
  background: #f0fdfa;
  border-color: #99f6e4;
}

.inspection-detail-body {
  padding: 0 1.25rem 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.inspection-detail-loading {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 1rem;
}

.inspection-detail-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.inspection-detail-meta .meta-item {
  background: #f8fffe;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
}

.inspection-detail-meta .meta-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.inspection-detail-meta .meta-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.inspection-detail-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  background: #fff;
}

.inspection-detail-section h4 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: var(--text);
}

.inspection-detail-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.inspection-image-card {
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  background: #fafffe;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.inspection-image-card strong {
  font-size: 0.8rem;
  color: var(--primary);
}

.inspection-image-card.is-viewable {
  padding: 0.5rem;
  border-style: solid;
}

.inspection-image-card img {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  background: #0f172a0d;
}

.broadcast-image-picker {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.9rem 1rem;
  border: 1.5px dashed var(--border);
  border-radius: 12px;
  background: #0f172a08;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.broadcast-image-picker:hover {
  border-color: var(--primary, #0d9488);
  background: #0d948812;
}

.broadcast-image-picker input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.broadcast-image-picker-title {
  font-weight: 700;
  color: var(--text, #0f172a);
  font-size: 0.92rem;
}

.broadcast-image-picker-hint {
  color: var(--muted, #64748b);
  font-size: 0.8rem;
}

.broadcast-image-preview {
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.broadcast-image-preview img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.broadcast-history-title-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.broadcast-history-thumb {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.phone-notification-image {
  width: 100%;
  max-height: 140px;
  object-fit: cover;
  border-radius: 10px;
  margin-top: 0.5rem;
  display: block;
}

.inspection-answers-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.inspection-answers-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  background: #f8fffe;
  border: 1px solid var(--border);
  font-size: 0.82rem;
}

.inspection-answers-list .answer-yes {
  color: #dc2626;
  font-weight: 700;
  white-space: nowrap;
}

.inspection-answers-list .answer-no {
  color: #047857;
  font-weight: 700;
  white-space: nowrap;
}

.inspection-order-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.inspection-order-badge.placed {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.inspection-order-badge.not-placed {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.inspection-treatment-box {
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.08), #fff);
  border: 1px solid rgba(13, 148, 136, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
}

.inspection-treatment-box strong {
  display: block;
  color: var(--primary);
  margin-bottom: 0.35rem;
}

.inspection-treatment-box p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.6;
}

@media (max-width: 640px) {
  .inspection-detail-meta {
    grid-template-columns: 1fr;
  }

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

  .page-header h2 {
    font-size: 1.25rem;
  }

  .main-content {
    padding: calc(var(--navbar-h) + 0.85rem) 0.85rem 1rem;
  }

  .login-card {
    margin: 1rem;
    padding: 1.5rem 1.15rem;
  }
}

.modal-confirm-delete {
  max-width: 420px;
  padding: 1.75rem 1.5rem 1.5rem;
  text-align: center;
}

.confirm-delete-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  border: 1px solid #fecaca;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #dc2626;
}

.confirm-delete-icon svg {
  width: 28px;
  height: 28px;
}

.modal-confirm-delete h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 0.5rem;
}

.confirm-delete-item {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 0.65rem;
  word-break: break-word;
}

.confirm-delete-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 0.75rem;
}

.confirm-delete-desc[hidden] {
  display: none;
}

.confirm-delete-warning {
  font-size: 0.8rem;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  margin: 0 0 1.25rem;
  line-height: 1.5;
}

.confirm-delete-actions {
  display: flex;
  gap: 0.65rem;
}

.confirm-delete-btn {
  flex: 1;
  height: 46px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.confirm-delete-btn-cancel {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
}

.confirm-delete-btn-cancel:hover {
  background: #f8fafc;
  color: var(--text);
}

.confirm-delete-btn-danger {
  border: none;
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: #fff;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.28);
}

.confirm-delete-btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.35);
}

/* ── Monthly reports ── */
.reports-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.reports-hint {
  margin: 0;
  color: var(--muted, #64748b);
  font-size: 0.92rem;
  max-width: 42rem;
  line-height: 1.6;
}

.reports-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.reports-months-label {
  font-size: 0.85rem;
  color: var(--muted, #64748b);
  font-weight: 600;
}

.reports-pdf-option {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted, #475569);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: #fff;
}

.reports-pdf-option input {
  width: 1rem;
  height: 1rem;
  accent-color: #0d9488;
  cursor: pointer;
}

#reports-months {
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  font: inherit;
  background: #fff;
}

.reports-pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: none;
  border-radius: 10px;
  padding: 0.6rem 0.95rem;
  background: linear-gradient(135deg, #0d9488, #14b8a6);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.28);
}

.reports-pdf-btn svg {
  width: 18px;
  height: 18px;
}

.reports-pdf-btn:hover {
  transform: translateY(-1px);
}

.reports-summary {
  margin-bottom: 1.25rem;
}

.reports-table-panel .reports-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.reports-table-panel h3 {
  margin: 0;
}

.reports-generated {
  font-size: 0.8rem;
  color: var(--muted, #64748b);
}

.reports-ym {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 500;
}

.card-outcome {
  opacity: 0.85;
  font-size: 0.82rem !important;
}

.partner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.partner-status.partner-pending {
  background: #ffedd5;
  color: #c2410c;
}

.partner-status.partner-inactive {
  background: #fee2e2;
  color: #b91c1c;
}

.partner-status.partner-active {
  background: #d1fae5;
  color: #047857;
}

/* App notify popup */
.modal-app-notify {
  width: min(400px, 92vw);
  text-align: center;
  padding: 1.6rem 1.4rem 1.35rem;
}

.app-notify-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.9rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #d1fae5;
  color: #047857;
}

.app-notify-icon svg {
  width: 28px;
  height: 28px;
}

.modal-app-notify.is-error .app-notify-icon {
  background: #fee2e2;
  color: #b91c1c;
}

.modal-app-notify.is-info .app-notify-icon {
  background: #e0f2fe;
  color: #0369a1;
}

.modal-app-notify h3 {
  margin: 0 0 0.55rem;
  font-size: 1.15rem;
  color: #0f172a;
}

.app-notify-message {
  margin: 0 0 1.25rem;
  color: #475569;
  line-height: 1.7;
  font-size: 0.95rem;
  white-space: pre-wrap;
}

.app-notify-ok {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, #0d9488, #14b8a6);
  color: #fff;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.28);
}

.app-notify-ok:hover {
  transform: translateY(-1px);
}

.modal-app-notify.is-error .app-notify-ok {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.28);
}

@media (max-width: 720px) {
  .reports-toolbar {
    align-items: stretch;
  }

  .reports-toolbar-actions {
    width: 100%;
  }

  #reports-months,
  #reports-period,
  #orders-filter,
  .reports-pdf-btn {
    flex: 1;
  }
}

.reports-full {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.reports-loading {
  color: #64748b;
  padding: 1rem 0;
}

.report-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.report-meta h2 {
  margin: 0;
  color: #0f766e;
  font-size: 1.25rem;
}

.report-meta span {
  color: #64748b;
  font-size: 0.85rem;
}

.report-section {
  padding: 1.1rem 1.2rem 1.25rem;
}

.report-section h3 {
  margin: 0 0 0.85rem;
  color: #134e4a;
  font-size: 1.05rem;
}

.report-section h4 {
  margin: 0.85rem 0 0.5rem;
  color: #0f766e;
  font-size: 0.92rem;
}

.report-note,
.report-na {
  color: #64748b;
  font-size: 0.86rem;
  line-height: 1.55;
  margin: 0.4rem 0 0;
}

.report-na {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
}

.report-highlights,
.report-tips,
.report-defs {
  margin: 0;
  padding-inline-start: 1.2rem;
  display: grid;
  gap: 0.45rem;
  color: #334155;
  line-height: 1.55;
}

.report-highlights li {
  display: grid;
  gap: 0.15rem;
}

.report-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.report-bars {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.report-bar-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.86rem;
  color: #334155;
  margin-bottom: 0.2rem;
}

.report-bar-track {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.report-bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #14b8a6, #0d9488);
}

.report-heat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.7rem;
}

.report-heat-card {
  border-radius: 12px;
  padding: 0.8rem;
  border: 1px solid #e2e8f0;
  background: #ecfdf5;
  background-image: linear-gradient(
    90deg,
    rgba(254, 242, 242, calc(var(--heat, 0) / 100)) 0%,
    #ecfdf5 100%
  );
  display: grid;
  gap: 0.2rem;
  font-size: 0.82rem;
  color: #475569;
}

.report-heat-card strong {
  color: #0f172a;
  font-size: 0.95rem;
}

@media (max-width: 900px) {
  .report-two-col {
    grid-template-columns: 1fr;
  }
}

/* Print / Save as PDF for reports page */
@media print {
  body * {
    visibility: hidden !important;
  }

  body.printing-reports #reports-full,
  body.printing-reports #reports-full * {
    visibility: visible !important;
  }

  body.printing-reports #reports-full {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 12mm !important;
    background: #fff !important;
    box-shadow: none !important;
  }

  body.printing-reports .sidebar,
  body.printing-reports .top-navbar,
  body.printing-reports .sidebar-overlay,
  body.printing-reports .reports-toolbar,
  body.printing-reports .modal-overlay {
    display: none !important;
  }

  .report-section {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}
