/* ── Ocean Blue Farm Theme ── */
:root {
  --green-900: #1e3a5f;
  --green-800: #1e40af;
  --green-700: #1d4ed8;
  --green-600: #2563eb;
  --green-500: #3b82f6;
  --green-400: #60a5fa;
  --green-100: #dbeafe;
  --green-50:  #eff6ff;

  --cream-100: #f0f5ff;
  --cream-200: #e0eaff;
  --cream-300: #c7d9ff;

  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --amber-700: #b45309;
  --amber-200: #fde68a;
  --amber-100: #fef3c7;
  --amber-50:  #fffbeb;

  --red-600:   #dc2626;
  --red-500:   #ef4444;
  --red-100:   #fee2e2;

  --blue-500:  #3b82f6;
  --blue-100:  #dbeafe;

  /* ── Semantic aliases ── */
  --primary:    #3b82f6;   /* = --green-500 (blue theme) */
  --text-muted: #6b7280;   /* = --gray-500 */
  --border:     #e5e7eb;   /* = --gray-200 */
  --danger:     #ef4444;   /* = --red-500 */
  --info:       #3b82f6;   /* = --blue-500 */
  --amber:      #f59e0b;   /* = --amber-500 */

  --gray-900:  #111827;
  --gray-700:  #374151;
  --gray-600:  #4b5563;
  --gray-500:  #6b7280;
  --gray-400:  #9ca3af;
  --gray-300:  #d1d5db;
  --gray-200:  #e5e7eb;
  --gray-100:  #f3f4f6;
  --gray-50:   #f9fafb;
  --white:     #ffffff;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.14);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --transition: 0.18s ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--cream-100);
  color: var(--gray-900);
  line-height: 1.5;
  min-height: 100vh;
}
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

/* ── Login page ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--green-900) 0%, var(--green-700) 50%, var(--green-500) 100%);
  padding: 24px;
}
.login-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-xl);
  animation: fadeSlideUp 0.4s ease;
}
.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--green-100);
  margin-bottom: 12px;
}
.login-logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--green-800);
  line-height: 1.2;
}
.login-logo p {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-top: 4px;
}
.login-card h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 24px;
}
.login-error {
  background: var(--red-100);
  color: var(--red-500);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.875rem;
  margin-bottom: 16px;
}

/* ── Layout shell ── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: 260px;
  background: linear-gradient(180deg, var(--green-900) 0%, var(--green-800) 100%);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.2);
}
.sidebar-brand-text h2 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
}
.sidebar-brand-text p {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.nav-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 12px 20px 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,0.7);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  position: relative;
}
.nav-item:hover {
  background: rgba(255,255,255,0.07);
  color: var(--white);
}
.nav-item.active {
  background: rgba(96,165,250,0.15);
  color: var(--green-400);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--green-400);
  border-radius: 0 2px 2px 0;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green-500), var(--green-400));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-info strong {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-info span {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.45);
}
.btn-logout {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.12);
  background: transparent;
  color: rgba(255,255,255,0.55);
  font-size: 0.8rem;
  font-weight: 500;
  transition: all var(--transition);
}
.btn-logout:hover {
  background: rgba(239,68,68,0.15);
  border-color: rgba(239,68,68,0.3);
  color: #fca5a5;
}

/* ── Mobile header ── */
.mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 60px;
  background: var(--green-900);
  z-index: 200;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}
.mobile-header h2 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--white);
}
.btn-menu {
  background: none;
  border: none;
  color: var(--white);
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

/* ── Main content ── */
.main-content {
  margin-left: 260px;
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.page-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.page-header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
}
.page-header p {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-top: 2px;
}
.page-body {
  flex: 1;
  padding: 24px 28px;
}

/* ── Stat cards ── */
.stat-grid, .stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform var(--transition), box-shadow var(--transition);
  animation: fadeSlideUp 0.3s ease both;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.stat-card-header span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-icon svg { width: 18px; height: 18px; }
.stat-icon.green  { background: var(--green-50);  color: var(--green-600); }
.stat-icon.amber  { background: #fffbeb;           color: var(--amber-600); }
.stat-icon.blue   { background: var(--blue-100);   color: var(--blue-500); }
.stat-icon.red    { background: var(--red-100);    color: var(--red-500); }
.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1;
}
.stat-value small {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-500);
}
.stat-sub {
  font-size: 0.75rem;
  color: var(--gray-500);
}

/* ── Section card ── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  animation: fadeSlideUp 0.3s ease both;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
}
.card-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-header h3 svg { width: 16px; height: 16px; color: var(--green-600); }
.card-body { padding: 20px; }
.card-body.no-pad { padding: 0; }

/* ── Dashboard grid ── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.dashboard-grid .span-2 { grid-column: span 2; }

/* ── Pond feed plan ── */
.pond-feed-item {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--gray-100);
  gap: 12px;
  transition: background var(--transition);
}
.pond-feed-item:last-child { border-bottom: none; }
.pond-feed-item:hover { background: var(--gray-50); }
.pond-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--green-500);
  flex-shrink: 0;
}
.pond-feed-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-900);
  flex: 1;
}
.pond-feed-detail {
  font-size: 0.75rem;
  color: var(--gray-500);
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge.green  { background: var(--green-50);  color: var(--green-700); }
.badge.amber  { background: #fffbeb;           color: var(--amber-600); }
.badge.purple { background: #f3e8ff;           color: #7c3aed; }
.badge.blue   { background: var(--blue-100);   color: #1d4ed8; }
.badge.red    { background: var(--red-100);    color: var(--red-500); }
.badge.gray   { background: var(--gray-100);   color: var(--gray-600); }

/* ── Alert items ── */
.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--gray-100);
}
.alert-item:last-child { border-bottom: none; }
.alert-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.alert-dot.amber { background: var(--amber-500); }
.alert-dot.red   { background: var(--red-500); }
.alert-dot.green { background: var(--green-500); }
.alert-text { font-size: 0.8rem; color: var(--gray-700); line-height: 1.4; }
.alert-text strong { font-weight: 600; }

/* ── Activity list ── */
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--gray-100);
}
.activity-item:last-child { border-bottom: none; }
.activity-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--green-100);
  color: var(--green-700);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}
.activity-text { font-size: 0.8rem; color: var(--gray-700); line-height: 1.4; flex: 1; }
.activity-time { font-size: 0.7rem; color: var(--gray-400); white-space: nowrap; margin-top: 1px; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
thead th {
  background: var(--gray-50);
  padding: 10px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid var(--gray-100);
  transition: background var(--transition);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--gray-50); }
tbody td {
  padding: 12px 16px;
  color: var(--gray-700);
  vertical-align: middle;
}
tbody td strong { font-weight: 600; color: var(--gray-900); }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--gray-900);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}
.form-control-static {
  padding: 10px 12px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  min-height: 40px;
  display: flex;
  align-items: center;
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  min-height: 38px;
}
.btn svg { width: 15px; height: 15px; }
.btn-primary {
  background: linear-gradient(135deg, var(--green-600), var(--green-500));
  color: var(--white);
  box-shadow: 0 2px 8px rgba(59,130,246,0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--green-700), var(--green-600));
  box-shadow: 0 4px 12px rgba(59,130,246,0.4);
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--white);
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}
.btn-secondary:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
}
.btn-danger {
  background: var(--white);
  color: var(--red-500);
  border: 1px solid var(--red-100);
}
.btn-danger:hover {
  background: var(--red-100);
  border-color: var(--red-500);
}
.btn-icon {
  width: 32px; height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-500);
  transition: all var(--transition);
  flex-shrink: 0;
  min-height: unset;
}
.btn-icon:hover { background: var(--gray-100); color: var(--gray-700); }
.btn-icon.danger:hover { background: var(--red-100); color: var(--red-500); border-color: var(--red-100); }
.btn-icon svg { width: 14px; height: 14px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; }

/* ── Search / filter bar ── */
.list-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.search-wrap svg {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  width: 15px; height: 15px;
  color: var(--gray-400);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 9px 12px 9px 32px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-input:focus {
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}
.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: fadeSlideUp 0.2s ease;
}
.modal-lg { max-width: 680px; }
.modal-xl { max-width: 840px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100);
  position: sticky; top: 0;
  background: var(--white);
  z-index: 1;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.modal-header h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-900);
}
.modal-body { padding: 24px; }
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* ── Toast notifications ── */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 260px;
  max-width: 380px;
  animation: slideInRight 0.25s ease;
  border-left: 4px solid;
}
.toast.success { border-color: var(--green-500); color: var(--green-800); }
.toast.error   { border-color: var(--red-500);   color: #991b1b; }
.toast.info    { border-color: var(--blue-500);  color: #1e40af; }
.toast svg { width: 16px; height: 16px; flex-shrink: 0; }
.toast-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--gray-400);
  padding: 0;
  cursor: pointer;
  display: flex;
}

/* ── Skeleton loading ── */
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text.w-75 { width: 75%; }
.skeleton-text.w-50 { width: 50%; }
.skeleton-card { height: 100px; border-radius: var(--radius-lg); }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--gray-400);
}
.empty-state svg {
  width: 48px; height: 48px;
  margin-bottom: 12px;
  opacity: 0.4;
}
.empty-state h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 6px;
}
.empty-state p {
  font-size: 0.875rem;
  color: var(--gray-400);
  margin-bottom: 20px;
}

/* ── Pagination ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--gray-100);
  font-size: 0.8rem;
  color: var(--gray-500);
}
.pagination-buttons { display: flex; gap: 4px; }
.page-btn {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  background: var(--white);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--gray-600);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}
.page-btn:hover { background: var(--gray-100); }
.page-btn.active {
  background: var(--green-600);
  border-color: var(--green-600);
  color: var(--white);
}
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Confirm dialog ── */
.confirm-dialog {
  text-align: center;
  padding: 8px 0;
}
.confirm-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--red-100);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.confirm-icon svg { width: 24px; height: 24px; color: var(--red-500); }
.confirm-dialog h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--gray-900);
}
.confirm-dialog p {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-bottom: 24px;
}

/* ── Tabs (inner module tabs) ── */
.tab-bar {
  display: flex;
  gap: 2px;
  background: var(--gray-100);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 20px;
  width: fit-content;
}
.tab-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}
.tab-btn svg { width: 14px; height: 14px; }
.tab-btn.active {
  background: var(--white);
  color: var(--green-700);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.tab-btn:hover:not(.active) { color: var(--gray-700); }

/* ── Feed stock list ── */
.feed-stock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  padding: 16px 20px;
}
.feed-stock-item {
  background: var(--gray-50);
  border-radius: var(--radius-md);
  padding: 12px;
  border: 1px solid var(--gray-200);
}
.feed-stock-item .name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.feed-stock-item .qty {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--green-700);
}
.feed-stock-item .unit {
  font-size: 0.7rem;
  color: var(--gray-400);
}
.feed-stock-item.low { border-color: var(--amber-500); background: #fffbeb; }
.feed-stock-item.low .qty { color: var(--amber-600); }

/* ── Animations ── */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Mobile responsive ── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }
  .sidebar-overlay.show { display: block; }
  .mobile-header { display: flex; }
  .main-content { margin-left: 0; padding-top: 60px; }
  .page-header { padding: 14px 16px; }
  .page-body { padding: 16px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-grid .span-2 { grid-column: span 1; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .form-row.cols-3 { grid-template-columns: 1fr; }
  .modal { border-radius: var(--radius-lg); }

  /* Bigger touch targets — WCAG-recommended 44×44 minimum */
  .btn, .btn-primary, .btn-secondary { min-height: 44px; padding: 10px 16px; font-size: 14px; }
  .btn-sm { min-height: 36px; padding: 6px 10px; }
  .btn-icon { min-width: 40px; min-height: 40px; }
  .form-input, .form-select, select.form-input { min-height: 44px; font-size: 15px; }
  /* iOS auto-zooms inputs <16px font, blocking zoom-out — keep ≥16px */
  input[type="text"], input[type="number"], input[type="email"], input[type="tel"],
  input[type="date"], input[type="month"], input[type="password"], textarea, select {
    font-size: 16px;
  }
  textarea { min-height: 80px; }

  /* Tables: keep horizontal scroll, but make headers bolder + cells more readable */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-sm); }
  .table-wrap table { min-width: 560px; }
  .table-wrap th, .table-wrap td { padding: 10px 8px; font-size: 13px; }

  /* Modal full-screen on phone */
  .modal-overlay { padding: 0; }
  .modal { width: 100%; max-width: 100%; max-height: 100vh; border-radius: 0; margin: 0; }
  .modal-body { padding: 16px; }
  .modal-footer { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .modal-footer .btn { flex: 1; min-width: 0; }

  /* Tax-tab sub-nav: horizontal scroll on small screens */
  .card .tab-bar, .card > div[style*="border-bottom"] { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap !important; white-space: nowrap; }
  .card .tab-bar button, .card > div[style*="border-bottom"] button { flex-shrink: 0; }

  /* List controls (search + filter + add) wrap nicely */
  .list-controls { flex-wrap: wrap; gap: 8px; }
  .list-controls > * { flex: 1; min-width: 140px; }
}
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .login-card { padding: 32px 24px; }
  .page-body { padding: 12px; }
  .stat-card { padding: 12px; }
  .stat-value { font-size: 1.4rem; }
  .table-wrap th, .table-wrap td { padding: 8px 6px; font-size: 12px; }

  /* Hide low-priority columns on phone — keep first 2-3 + actions visible.
     Mark optional cols with .col-hide-sm in the JSX. Generic hint-only. */
  .col-hide-sm { display: none; }

  /* Chat / form fields take full row */
  .form-row, .form-row.cols-2, .form-row.cols-3 { grid-template-columns: 1fr !important; gap: 8px; }
}
