/* Reset & Base Setup */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-main: #F4F5FB;
  --bg-card: #FFFFFF;
  --bg-input: #F8FAFC;
  
  --color-primary: #5B46E8;
  --color-primary-hover: #4C38D3;
  --color-primary-light: #EEF2FF;
  
  --color-text-main: #0F172A;
  --color-text-muted: #64748B;
  --color-border: #E2E8F0;
  
  --color-success: #10B981;
  --color-success-light: #ECFDF5;
  --color-danger: #EF4444;
  --color-danger-light: #FEF2F2;
  --color-warning: #F59E0B;
  
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.06);
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--color-text-main);
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* Helpers */
.hidden { display: none !important; }
.text-muted { color: var(--color-text-muted); }
.text-sm { font-size: 12px; }
.font-mono { font-family: monospace; }
.text-center { text-align: center; }
.text-green { color: #10B981 !important; }
.text-red { color: #EF4444 !important; }
.text-purple { color: #6366F1 !important; }
.text-blue { color: #0284C7 !important; }
.text-teal { color: #0D9488 !important; }
.text-orange { color: #F97316 !important; }
.text-danger { color: #EF4444 !important; }

.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }

/* Auth / Login View */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
  overflow: hidden;
}

.auth-wrapper::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  top: -100px;
  right: -100px;
  border-radius: 50%;
}

.auth-wrapper::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
  bottom: -80px;
  left: -80px;
  border-radius: 50%;
}

.auth-card {
  background: var(--bg-card);
  width: 100%;
  max-width: 420px;
  padding: 40px 32px;
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  z-index: 1;
  backdrop-filter: blur(10px);
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-header .logo-icon {
  width: 72px;
  height: 72px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
  border: 2px solid var(--color-primary-light);
  overflow: hidden;
}

.auth-logo-img {
  width: 60px;
  height: 60px;
  display: block;
  object-fit: contain;
}

.auth-header h2 { font-size: 22px; font-weight: 700; color: var(--color-text-main); }
.auth-header p { font-size: 13px; color: var(--color-text-muted); margin-top: 4px; }

/* Form Controls */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }

input[type="text"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="date"],
select,
textarea {
  width: 100%;
  height: 44px;
  padding: 0 16px;
  background-color: var(--bg-input);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  color: var(--color-text-main);
  outline: none;
  transition: all 0.2s ease;
}

textarea { height: auto; padding: 12px 16px; }

input:focus, select:focus, textarea:focus {
  background-color: var(--bg-card);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(91, 70, 232, 0.12);
}

.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-primary { background-color: var(--color-primary); color: #FFFFFF; }
.btn-primary:hover { background-color: var(--color-primary-hover); }
.btn-purple { background-color: #6366F1; color: #FFFFFF; }
.btn-purple:hover { background-color: #4F46E5; }
.btn-success { background-color: var(--color-success); color: #FFFFFF; }
.btn-success:hover { background-color: #059669; }
.btn-outline { background-color: transparent; border-color: var(--color-border); color: var(--color-text-main); }
.btn-outline:hover { background-color: var(--bg-input); }
.btn-block { width: 100%; }

/* Alerts & Badges */
.error-alert { background-color: var(--color-danger-light); color: var(--color-danger); border: 1px solid #FCA5A5; padding: 10px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; }
.badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: var(--radius-full); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.badge-purple, .badge-sales { background-color: #EEF2FF; color: #6366F1; }
.badge-success { background-color: var(--color-success-light); color: var(--color-success); }

/* FULL SCREEN LAYOUT */
.layout-wrapper { display: flex; height: 100vh; width: 100vw; overflow: hidden; }

/* ============================================
   PREMIUM SIDEBAR — Light Theme
   ============================================ */

.sidebar-full {
  width: 248px;
  height: 100vh;
  background: #FFFFFF;
  border-right: 1px solid #E8ECF1;
  padding: 24px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.sidebar-top { display: flex; flex-direction: column; position: relative; z-index: 1; }

/* Brand */
.brand-badge-box {
  margin-bottom: 28px;
  padding: 0 6px;
}

.brand-logo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
}

.brand-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar-logo-img {
  width: 32px;
  height: 32px;
  display: block;
  object-fit: contain;
}

.made-by-tag {
  font-size: 16px;
  font-weight: 800;
  color: #1E293B;
  letter-spacing: -0.3px;
  display: block;
  line-height: 1.2;
}

.made-by-sub {
  font-size: 10px;
  font-weight: 600;
  color: #94A3B8;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: 2px;
}

/* Navigation */
.nav-menu { display: flex; flex-direction: column; gap: 2px; }

.nav-group-title {
  font-size: 10px;
  font-weight: 700;
  color: #94A3B8;
  letter-spacing: 1.2px;
  margin-bottom: 6px;
  padding: 0 12px;
  text-transform: uppercase;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: transparent;
  border: none;
  color: #64748B;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  position: relative;
}

.nav-item svg {
  opacity: 0.55;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}

.nav-item:hover {
  background-color: #F1F5F9;
  color: #1E293B;
}

.nav-item:hover svg {
  opacity: 0.85;
}

.nav-item.active {
  background: linear-gradient(135deg, #EEF2FF, #E0E7FF);
  color: #4F46E5;
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, #818CF8, #6366F1);
}

.nav-item.active svg {
  opacity: 1;
  color: #6366F1;
}

/* Sidebar Bottom Profile Widget */
.sidebar-bottom-profile {
  background: #F8FAFC;
  border: 1px solid #E8ECF1;
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.profile-info { display: flex; align-items: center; gap: 10px; min-width: 0; }

.avatar-circle {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366F1, #818CF8);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-text { display: flex; flex-direction: column; min-width: 0; }
.p-name { font-size: 12px; font-weight: 700; color: #1E293B; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-role { font-size: 10px; color: #94A3B8; font-weight: 500; }

.sidebar-logout-btn {
  background: transparent;
  border: none;
  color: #94A3B8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.sidebar-logout-btn:hover {
  background: #FEF2F2;
  color: #EF4444;
}

/* PREMIUM MONTH SWITCHER */
.premium-month-switcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  padding: 6px 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.pm-arrow {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: #F1F5F9;
  border: none;
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.pm-arrow:hover { background: #6366F1; color: #FFFFFF; }
.pm-display {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 8px;
}
.pm-cal-icon { color: #6366F1; }
.pm-text { font-size: 14px; font-weight: 700; color: #0F172A; white-space: nowrap; }

/* PREMIUM KPI CARDS */
.premium-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1100px) { .premium-kpi-grid { grid-template-columns: repeat(2, 1fr); } }
/* KPI grid override handled in responsive section below */

.premium-kpi-card {
  background: #FFFFFF;
  border: 1px solid #E8ECF1;
  border-radius: 14px;
  padding: 20px 24px;
  transition: box-shadow 0.2s ease;
}
.premium-kpi-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.05); }

.pkpi-label {
  font-size: 11px;
  font-weight: 700;
  color: #94A3B8;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.pkpi-value {
  font-size: 28px;
  font-weight: 800;
  color: #1E293B;
  line-height: 1.1;
}

.pkpi-sub {
  font-size: 12px;
  color: #94A3B8;
  margin-top: 6px;
}

/* Hide icon wrap — not used in this style */
.pkpi-icon-wrap { display: none; }

/* CHART CARDS */
.dash-charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .dash-charts-row { grid-template-columns: 1fr; } }
.chart-card { min-height: 280px; }
.chart-card .card-box-title { margin-bottom: 16px; }
.chart-container { position: relative; width: 100%; height: 220px; max-width: 100%; overflow: hidden; }

/* OLD DASHBOARD STYLES (kept for non-dashboard sections) */

/* Independent Scrollable Content Area */
.main-scroll-area {
  flex: 1;
  height: 100vh;
  overflow-y: auto;
  padding: 24px 32px;
  background-color: var(--bg-main);
}

.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.page-title { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.page-sub { font-size: 13px; color: var(--color-text-muted); }

.card-box { background: var(--bg-card); border-radius: var(--radius-lg); padding: 20px; border: 1px solid var(--color-border); box-shadow: var(--shadow-sm); }
.card-box-title { font-size: 15px; font-weight: 700; }

/* KPI Cards Grid (legacy, used by non-dashboard sections) */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.kpi-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 18px; border: 1px solid var(--color-border); box-shadow: var(--shadow-sm); }
.kpi-label { font-size: 11px; font-weight: 800; color: var(--color-text-muted); letter-spacing: 0.5px; }
.kpi-value { font-size: 26px; font-weight: 800; color: var(--color-text-main); margin: 4px 0; }
.kpi-sub { font-size: 11px; color: var(--color-text-muted); }

/* Dashboard Summary Modules */
.dash-summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
@media (max-width: 900px) { .dash-summary-grid { grid-template-columns: 1fr; } }

.milk-summary-bars { display: flex; flex-direction: column; gap: 16px; padding: 10px 0; }
.bar-header { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.progress-track { background: #F1F5F9; height: 10px; border-radius: 20px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 20px; }
.progress-fill.green { background: #10B981; }
.progress-fill.purple { background: #6366F1; }

/* ============================================
   FILTER PANEL — Premium Table Filters
   ============================================ */
.filter-panel {
  background: #FFFFFF;
  border: 1px solid #E8ECF1;
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 16px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.filter-group label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: #94A3B8;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.filter-group select,
.filter-group input[type="date"],
.filter-group input[type="text"],
.filter-group input[type="number"] {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #1E293B;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.filter-group select {
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%2394A3B8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.filter-group select:focus,
.filter-group input:focus {
  border-color: #6366F1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.filter-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}

.filter-actions .btn-apply {
  background: #6366F1;
  color: #FFFFFF;
  border: none;
  padding: 8px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.filter-actions .btn-apply:hover { background: #4F46E5; }

.filter-actions .btn-clear {
  background: #FFFFFF;
  color: #64748B;
  border: 1px solid #E2E8F0;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-actions .btn-clear:hover { background: #F1F5F9; color: #1E293B; }

.filter-result-text {
  font-size: 12px;
  color: #94A3B8;
  margin-left: 8px;
}

/* Share Location & Attendance Widget */
.dashboard-widget-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.share-location-card, .attendance-action-card { background: var(--bg-card); border-radius: 20px; padding: 20px; border: 1px solid #E2E8F0; box-shadow: 0 4px 20px rgba(0,0,0,0.03); }
.share-loc-header, .att-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.icon-circle { width: 42px; height: 42px; border-radius: 14px; background-color: #EEF2FF; display: flex; align-items: center; justify-content: center; }
.icon-circle.green { background-color: var(--color-success-light); }
.share-loc-title { font-size: 16px; font-weight: 700; }
.share-count { font-size: 11px; font-weight: 800; color: #6366F1; }
.share-loc-body { display: flex; gap: 8px; margin-bottom: 12px; }
.share-input { flex: 1; border-radius: 30px; background-color: #F1F5F9; padding: 10px 18px; font-size: 13px; border: 1px solid transparent; }
.share-loc-footer { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #94A3B8; }
.att-desc { font-size: 12px; color: var(--color-text-muted); margin: 10px 0; }

/* Data Table & Clickable Rows */
.table-responsive { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th { font-size: 11px; font-weight: 800; color: var(--color-text-muted); letter-spacing: 0.5px; padding: 12px 14px; border-bottom: 1px solid var(--color-border); }
.data-table td { padding: 14px; border-bottom: 1px solid var(--color-border); font-size: 13px; vertical-align: middle; }
.data-table.clickable-rows tbody tr { cursor: pointer; transition: background 0.15s ease; }
.data-table.clickable-rows tbody tr:hover { background-color: #EEF2FF; }

/* SEARCH BAR & FILTER DROPDOWNS OVERHAUL */
.field-filter-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

@media (max-width: 768px) {
  .field-filter-card {
    flex-direction: column;
    align-items: stretch;
  }
}

.search-box-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 0 16px;
  flex: 1;
  height: 44px;
  border: 1px solid var(--color-border);
  transition: all 0.2s ease;
}

.search-box-wrapper:focus-within {
  background-color: #FFFFFF;
  border-color: #6366F1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.search-box-wrapper input {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  font-size: 14px;
  color: var(--color-text-main);
  width: 100%;
  height: 100%;
}

.select-filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.filter-select {
  height: 44px;
  min-width: 150px;
  background-color: var(--bg-input);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0 38px 0 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
  
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
}

.filter-select:focus {
  background-color: #FFFFFF;
  border-color: #6366F1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* ATTENDANCE MANAGER */
.att-kpi-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
@media (max-width: 1024px) { .att-kpi-grid { grid-template-columns: repeat(3, 1fr); } }
.att-kpi-card { background: #FFFFFF; border-radius: 16px; padding: 16px; border: 1px solid var(--color-border); box-shadow: var(--shadow-sm); }
.att-kpi-lbl { font-size: 10px; font-weight: 800; color: #94A3B8; letter-spacing: 0.5px; }
.att-kpi-val { font-size: 24px; font-weight: 800; color: #0F172A; margin-top: 4px; }
.att-cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 1024px) { .att-cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .att-cards-grid { grid-template-columns: 1fr; } }
.att-card { background: #FFFFFF; border-radius: 16px; padding: 16px; border: 1px solid var(--color-border); box-shadow: var(--shadow-sm); cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease; display: flex; flex-direction: column; justify-content: space-between; }
.att-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.06); }
.att-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.att-identity { display: flex; align-items: center; gap: 12px; }
.att-avatar { width: 36px; height: 36px; border-radius: 50%; background-color: #E0F2FE; color: #0284C7; font-weight: 800; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.att-name-code h4 { font-size: 13px; font-weight: 700; color: #0F172A; }
.att-name-code span { font-size: 11px; color: #94A3B8; font-family: monospace; }
.att-chevron-btn { width: 24px; height: 24px; border-radius: 50%; background-color: #F1F5F9; color: #94A3B8; display: flex; align-items: center; justify-content: center; }
.att-card-bottom { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; border-top: 1px solid #F1F5F9; font-size: 11px; }
.status-tag { font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 12px; text-transform: uppercase; }
.status-tag.pending { background-color: #FFF7ED; color: #EA580C; }
.status-tag.present { background-color: #ECFDF5; color: #059669; }

/* DRAWER & POPUP BACKDROPS */
/* ===== ATTENDANCE DRAWER - PREMIUM ===== */
.drawer-backdrop { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(15, 23, 42, 0.4); backdrop-filter: blur(6px); z-index: 1000; display: flex; justify-content: flex-end; }
.drawer-panel { width: 440px; max-width: 100%; height: 100vh; background: linear-gradient(180deg, #F8FAFF 0%, #FFFFFF 100%); box-shadow: -10px 0 40px rgba(0,0,0,0.12); display: flex; flex-direction: column; animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* CENTERED RECORD DETAIL POPUP */
#drawer-record-backdrop {
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#drawer-record-backdrop .drawer-panel {
  width: 500px;
  max-width: 92vw;
  height: auto;
  max-height: 88vh;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--color-border);
  animation: popupScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popupScaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.drawer-header { padding: 20px 24px; border-bottom: 1px solid #E2E8F0; display: flex; align-items: center; justify-content: space-between; background: #fff; }
.drawer-title { font-size: 17px; font-weight: 800; color: #0F172A; letter-spacing: -0.3px; }
.drawer-sub { font-size: 11px; color: #94A3B8; font-family: 'Plus Jakarta Sans', monospace; font-weight: 600; }
.drawer-close-btn { background: #F1F5F9; border: none; width: 32px; height: 32px; border-radius: 50%; font-size: 18px; color: #64748B; cursor: pointer; transition: all 0.2s ease; display: flex; align-items: center; justify-content: center; }
.drawer-close-btn:hover { background: #E2E8F0; color: #0F172A; transform: rotate(90deg); }
.drawer-body { padding: 20px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 16px; }

/* Stat Pills */
.drawer-stat-pills-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.drawer-pill { background: #FFFFFF; border: 1.5px solid #E2E8F0; border-radius: 14px; padding: 10px 4px; text-align: center; transition: all 0.2s ease; }
.drawer-pill:hover { border-color: #CBD5E1; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.pill-lbl { font-size: 8px; font-weight: 800; color: #94A3B8; display: block; letter-spacing: 0.5px; }
.pill-val { font-size: 18px; font-weight: 800; display: block; margin-top: 2px; }
.pill-val.green { color: #059669; }
.pill-val.red { color: #DC2626; }
.pill-val.purple { color: #9333EA; }
.pill-val.blue { color: #0284C7; }
.pill-val.teal { color: #0D9488; }

/* Calendar Card */
.calendar-card { background: #FFFFFF; border-radius: 16px; border: 1px solid #E2E8F0; padding: 18px; box-shadow: 0 2px 8px rgba(0,0,0,0.02); }
.calendar-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.month-title { font-size: 13px; font-weight: 800; color: #0F172A; letter-spacing: 0.5px; }
.calendar-nav-arrows { display: flex; gap: 6px; }
.cal-arrow-btn { width: 28px; height: 28px; border-radius: 50%; background: #EEF2FF; border: none; color: #6366F1; font-weight: 800; cursor: pointer; transition: all 0.2s ease; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.cal-arrow-btn:hover { background: #6366F1; color: #fff; }
.calendar-week-days { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 10px; font-weight: 800; color: #94A3B8; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid #F1F5F9; }
.drawer-calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.drawer-cal-day { aspect-ratio: 1; border-radius: 12px; background-color: #F8FAFC; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #475569; cursor: pointer; transition: all 0.2s ease; border: 2px solid transparent; }
.drawer-cal-day:hover { transform: scale(1.08); background-color: #F1F5F9; }
.drawer-cal-day.status-present { background-color: #D1FAE5; color: #059669; }
.drawer-cal-day.status-absent { background-color: #FEE2E2; color: #DC2626; }
.drawer-cal-day.status-halfday { background-color: #E0F2FE; color: #0284C7; }
.drawer-cal-day.status-onleave { background-color: #F3E8FF; color: #9333EA; }
.drawer-cal-day.status-holiday { background-color: #CCFBF1; color: #0D9488; }
.drawer-cal-day.selected { border: 2px solid #5B46E8; box-shadow: 0 0 0 3px rgba(91, 70, 232, 0.15); transform: scale(1.05); }

/* View Location Map Button */
#att-view-map-link { margin: 12px 0 4px 0; }
#att-view-map-link a,
.view-location-map-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 20px;
  background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
  color: #fff;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
  text-align: center;
}
#att-view-map-link a:hover,
.view-location-map-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

/* Manage Attendance Card */
.manage-att-card { background: #FFFFFF; border-radius: 16px; border: 1px solid #E2E8F0; padding: 18px; box-shadow: 0 2px 8px rgba(0,0,0,0.02); }
.manage-header { display: flex; align-items: center; justify-content: space-between; }
.manage-lbl { font-size: 10px; font-weight: 800; color: #6366F1; letter-spacing: 0.5px; text-transform: uppercase; }
.manage-date-title { font-size: 14px; font-weight: 800; color: #0F172A; margin-top: 4px; line-height: 1.3; }
.status-options-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.status-choice-btn { background: #F8FAFC; border: 1.5px solid #E2E8F0; border-radius: 12px; padding: 10px 8px; text-align: left; cursor: pointer; transition: all 0.2s ease; }
.status-choice-btn:hover { background: #EEF2FF; border-color: #C7D2FE; transform: translateY(-1px); }
.status-choice-btn.active { background: #EEF2FF; border-color: #6366F1; box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15); }
.choice-title { font-size: 8px; font-weight: 800; color: #94A3B8; display: block; letter-spacing: 0.5px; }
.choice-val { font-size: 11px; font-weight: 800; display: block; margin-top: 3px; }
.choice-val.text-green { color: #059669; }
.choice-val.text-red { color: #DC2626; }
.choice-val.text-purple { color: #9333EA; }
.choice-val.text-blue { color: #0284C7; }
.choice-val.text-teal { color: #0D9488; }
.choice-val.text-orange { color: #F59E0B; }

/* FIELD ACTIVITY MONITORING */
.field-title { font-size: 24px; font-weight: 800; }
.field-subtitle { font-size: 13px; color: var(--color-text-muted); }
.field-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.field-kpi-card { background: var(--bg-card); border-radius: 16px; padding: 20px; border: 1px solid var(--color-border); }
.field-kpi-label { font-size: 11px; font-weight: 800; color: #94A3B8; }
.field-kpi-value { font-size: 28px; font-weight: 800; color: #0F172A; }

.time-pills { display: flex; gap: 6px; }
.pill-btn { padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 700; border: none; background-color: #F1F5F9; color: #64748B; cursor: pointer; }
.pill-btn.active { background-color: #6366F1; color: #FFFFFF; }
.staff-cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.staff-card { background: var(--bg-card); border-radius: 16px; padding: 18px; border: 1px solid var(--color-border); }
.staff-card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.staff-identity { display: flex; align-items: center; gap: 12px; }
.initials-avatar { width: 38px; height: 38px; border-radius: 50%; background-color: #D1FAE5; color: #059669; font-weight: 800; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.staff-name-code h4 { font-size: 13px; font-weight: 700; text-transform: uppercase; color: #0F172A; }
.staff-name-code span { font-size: 11px; color: #94A3B8; font-family: monospace; }
.staff-card-stats { display: flex; flex-direction: column; gap: 8px; font-size: 12px; margin-bottom: 14px; }
.staff-stat-row { display: flex; align-items: center; justify-content: space-between; }
.staff-stat-row .label { color: #64748B; }
.staff-stat-row .val { font-weight: 700; color: #0F172A; }
.staff-stat-row .val.blue { color: #6366F1; font-size: 13px; }
.view-details-btn { background: transparent; border: none; color: #6366F1; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; padding: 0; text-transform: uppercase; }

.detail-header-bar { display: flex; align-items: center; justify-content: space-between; }
.detail-back-title { display: flex; align-items: center; gap: 12px; }
.back-arrow-btn { background: transparent; border: none; cursor: pointer; color: #0F172A; }
.detail-name { font-size: 18px; font-weight: 800; }
.date-range-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.detail-stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.purple-stat-box { background-color: #5B46E8; color: #FFFFFF; border-radius: 14px; padding: 16px; }
.purple-stat-box .stat-lbl { font-size: 10px; font-weight: 800; opacity: 0.8; }
.purple-stat-box .stat-val { font-size: 24px; font-weight: 800; margin-top: 4px; }
.grey-stat-box { background-color: #EAECEF; border-radius: 14px; padding: 16px; }
.grey-stat-box .stat-lbl { font-size: 10px; font-weight: 800; color: #64748B; }
.grey-stat-box .stat-val.dark { font-size: 24px; font-weight: 800; color: #0F172A; margin-top: 4px; }

.day-lbl { font-size: 11px; font-weight: 800; color: #94A3B8; letter-spacing: 0.5px; }
.day-accordion-card { background: #FFFFFF; border-radius: 16px; border: 1px solid #E2E8F0; margin-bottom: 12px; overflow: hidden; }
.day-accordion-header { padding: 16px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; background-color: #FFFFFF; }
.day-accordion-header .day-date-group { display: flex; align-items: center; gap: 12px; }
.day-circle-badge { width: 32px; height: 32px; border-radius: 50%; background-color: #EEF2FF; color: #6366F1; font-weight: 800; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.day-accordion-header .day-date { font-size: 14px; font-weight: 700; color: #0F172A; }
.day-accordion-header .day-sub-time { font-size: 11px; color: #94A3B8; }
.day-accordion-header .day-dist-arrow { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 800; color: #6366F1; }
.accordion-chevron { color: #94A3B8; transition: transform 0.2s ease; }
.day-accordion-card.open .accordion-chevron { transform: rotate(90deg); }
.day-accordion-body { padding: 16px; background-color: #FAFAFD; border-top: 1px solid #F1F5F9; display: none; }
.day-accordion-card.open .day-accordion-body { display: block; }
.route-summary-box { background-color: #EEF2FF; border-radius: 12px; padding: 12px; display: flex; align-items: center; justify-around: text-align: center; margin-bottom: 16px; }
.route-summary-box>div{text-align:center;flex:1}
.route-summary-box>div:first-child{text-align:left}
.route-summary-box>div:last-child{text-align:right}
.route-lbl{font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.3px;margin-bottom:2px}
.route-val{font-size:14px;font-weight:800;color:#0F172A;margin-bottom:2px}
.route-val.purple{color:#5B46E8;font-size:18px}
.timeline-items { display: flex; flex-direction: column; gap: 0; padding-left: 20px; position: relative; }
.timeline-items::before { content: ''; position: absolute; left: 29px; top: 20px; bottom: 20px; width: 2px; background: #E2E8F0; }
.timeline-item { display: flex; align-items: flex-start; gap: 14px; padding: 10px 0; position: relative; }
.timeline-item.start-point, .timeline-item.return-point { padding: 0; }
.timeline-item.start-point .tl-card, .timeline-item.return-point .tl-card { width: 100%; }
.tl-dot { width: 20px; height: 20px; min-width: 20px; border-radius: 50%; background: #6366F1; color: #fff; font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; position: relative; z-index: 2; margin-top: 2px; }
.tl-dot.green { background: #10B981; }
.tl-dot.red { background: #EF4444; }
.tl-card{background:#FFF;border:1px solid #E2E8F0;border-radius:10px;padding:10px 14px;flex:1;display:flex;justify-content:space-between;align-items:flex-start}
.tl-card-left{flex:1}
.tl-card-right{text-align:right;min-width:80px;margin-left:12px}
.tl-card .timeline-point-title{font-size:11px;font-weight:800;text-transform:uppercase}
.tl-card .timeline-note{font-size:13px;color:#334155;margin-top:1px}
.tl-card .timeline-time{font-size:11px;color:#94A3B8}
.tl-card .timeline-dist{font-size:11px;color:#6366F1;font-weight:700}
.tl-card .view-map-link{font-size:11px;color:#6366F1;font-weight:600;cursor:pointer;display:inline-flex;align-items:center;gap:3px;text-decoration:none;margin-top:2px}
.tl-card .view-map-link:hover{text-decoration:underline}
.timeline-item.start-point .tl-card { background-color: #ECFDF5; border-color: #A7F3D0; }
.timeline-item.return-point .tl-card { background-color: #FEF2F2; border-color: #FCA5A5; }
.timeline-item.start-point .tl-dot { background: #10B981; }
.timeline-item.return-point .tl-dot { background: #EF4444; }
.timeline-point-title { font-size: 11px; font-weight: 800; text-transform: uppercase; }

/* Milk Reports */
.milk-reports-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.report-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 20px; border: 1px solid var(--color-border); }
.report-card.green-border { border-top: 4px solid #10B981; }
.report-card.purple-border { border-top: 4px solid #6366F1; }
.report-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.report-card-header h3 { font-size: 15px; font-weight: 800; }
.report-metrics { display: flex; flex-direction: column; gap: 12px; }
.metric-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; padding-bottom: 8px; border-bottom: 1px dashed var(--color-border); }
.metric-row.grand-total { font-size: 15px; font-weight: 800; border-bottom: none; padding-top: 8px; }

/* Modals & Backdrop Click Overlay */
.modal-backdrop { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(15, 23, 42, 0.4); backdrop-filter: blur(4px); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-box { background: var(--bg-card); border-radius: var(--radius-lg); width: 100%; max-width: 500px; border: 1px solid var(--color-border); overflow: hidden; max-height: 90vh; display: flex; flex-direction: column; }
.modal-box.modal-sm { max-width: 400px; }
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--color-border); display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: 16px; font-weight: 800; }
.modal-close { background: transparent; border: none; font-size: 20px; color: var(--color-text-muted); cursor: pointer; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-footer { padding: 16px 20px; border-top: 1px solid var(--color-border); display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.role-conditional-box { background-color: var(--bg-input); padding: 14px; border-radius: var(--radius-sm); margin-top: 12px; }
.sub-heading { font-size: 11px; font-weight: 800; color: var(--color-text-muted); text-transform: uppercase; margin-bottom: 10px; }
.tab-selector-bar { display: flex; background-color: var(--bg-input); padding: 4px; border-radius: var(--radius-sm); gap: 4px; }
.tab-btn { flex: 1; padding: 8px; border: none; border-radius: 6px; background: transparent; font-family: inherit; font-size: 13px; font-weight: 700; color: var(--color-text-muted); cursor: pointer; }
.tab-btn.active { background-color: var(--bg-card); color: var(--color-primary); }

/* ============================================
   THIN PREMIUM SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }
* { scrollbar-width: thin; scrollbar-color: #CBD5E1 transparent; }

/* ============================================
   TABLE RESPONSIVE WRAPPER
   ============================================ */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-responsive::-webkit-scrollbar { height: 4px; }

/* ============================================
   FULL RESPONSIVE — ALL DEVICES
   ============================================ */

/* --- Mobile ≤ 768px --- */
@media (max-width: 768px) {
  .layout-wrapper { flex-direction: column; }

  /* Sidebar */
  .sidebar-full { position: fixed; top: 0; left: -280px; z-index: 900; width: 280px; height: 100vh; transition: left 0.3s cubic-bezier(0.4,0,0.2,1); box-shadow: 4px 0 24px rgba(0,0,0,0.12); padding: 20px 14px; }
  .sidebar-full.open { left: 0; }
  .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 899; backdrop-filter: blur(3px); }
  .sidebar-overlay.active { display: block; }

  /* Mobile Header */
  .mobile-header { display: flex !important; align-items: center; justify-content: space-between; padding: 10px 16px; background: #FFFFFF; border-bottom: 1px solid var(--color-border); position: sticky; top: 0; z-index: 100; }
  .mobile-hamburger { background: none; border: none; color: #0F172A; cursor: pointer; padding: 4px; display: flex; align-items: center; justify-content: center; }
  .mobile-brand { font-size: 16px; font-weight: 800; color: #6366F1; }
  .mobile-brand-row { display: flex; align-items: center; gap: 8px; }
  .mobile-logo-img { width: 26px; height: 26px; display: block; object-fit: contain; border-radius: 6px; }

  /* Main Area */
  .main-scroll-area { flex: 1; overflow-y: auto; padding: 16px; }
  .main-scroll-area::-webkit-scrollbar { width: 3px; }

  /* Section Header */
  .section-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .page-title { font-size: 20px; }
  .page-sub { font-size: 12px; }
  .section-header .btn { width: 100%; height: 40px; font-size: 13px; }

  /* KPI Cards — 2 per row */
  .premium-kpi-grid { grid-template-columns: 1fr 1fr !important; gap: 10px; }
  .premium-kpi-card { padding: 14px 16px; border-radius: 12px; }
  .pkpi-label { font-size: 9px; letter-spacing: 0.5px; margin-bottom: 4px; }
  .pkpi-value { font-size: 22px; }
  .pkpi-sub { font-size: 10px; margin-top: 4px; }

  /* Charts */
  .dash-charts-row { grid-template-columns: 1fr; gap: 12px; }
  .chart-card { min-height: 220px; }
  .chart-container { height: 200px; }
  .chart-container canvas { max-width: 100% !important; max-height: 100% !important; }

  /* Dashboard Summary */
  .dash-summary-grid { grid-template-columns: 1fr; gap: 12px; }

  /* Filter Panel */
  .filter-panel { padding: 14px 16px; border-radius: 12px; }
  .filter-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .filter-actions { flex-wrap: wrap; gap: 8px; }
  .filter-result-text { margin-left: 0; width: 100%; margin-top: 4px; }

  /* Reports */
  .milk-reports-grid { grid-template-columns: 1fr; gap: 12px; }
  .report-card { padding: 16px; border-radius: 12px; }
  .report-card-header h3 { font-size: 13px; }

  /* Card Box */
  .card-box { padding: 14px; border-radius: 12px; }

  /* Data Table */
  .data-table th { font-size: 10px; padding: 10px 10px; white-space: nowrap; }
  .data-table td { font-size: 12px; padding: 10px; }

  /* Modals */
  .modal-backdrop { padding: 12px; }
  .modal-box { max-width: 100%; border-radius: 14px; }
  .modal-header { padding: 14px 16px; }
  .modal-body { padding: 16px; }
  .modal-footer { padding: 12px 16px; flex-direction: column; }
  .form-row-2 { grid-template-columns: 1fr; }

  /* Employee Widget Grid */
  .dashboard-widget-grid { grid-template-columns: 1fr; gap: 12px; }

  /* Drawer */
  .drawer-panel { width: 100%; max-width: 100%; border-radius: 16px 16px 0 0; max-height: 85vh; }
  .drawer-backdrop { align-items: flex-end; }
  .drawer-header { padding: 14px 16px; }
  .drawer-body { padding: 16px; }
  .drawer-stat-pills-row { grid-template-columns: repeat(5, 1fr); gap: 4px; }
  .drawer-pill { padding: 8px 2px; }
  .pill-val { font-size: 15px; }
  .status-options-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }

  /* Field Location */
  .route-summary-box { padding: 12px 14px; flex-wrap: wrap; gap: 8px; }
  .route-summary-box > div { min-width: 30%; }
  .tl-card { flex-direction: column; gap: 6px; }
  .tl-card-right { text-align: left; margin-left: 0; margin-top: 4px; }
  .timeline-items { padding-left: 16px; }
  .timeline-items::before { left: 25px; }
  .tl-dot { width: 18px; height: 18px; min-width: 18px; margin-right: 10px; }

  /* Field Filter Card */
  .field-filter-card { flex-direction: column; align-items: stretch; }

  /* Attendance Heatmap */
  .heatmap-grid { gap: 4px; }
  .heatmap-cell { width: 28px; height: 28px; font-size: 9px; }

  /* Tab Selector */
  .tab-selector-bar { flex-wrap: wrap; }
}

/* --- Tablet 769px–1024px --- */
@media (min-width: 769px) and (max-width: 1024px) {
  .main-scroll-area { padding: 20px 24px; }
  .premium-kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .premium-kpi-card { padding: 16px 20px; }
  .pkpi-value { font-size: 26px; }
  .dash-charts-row { grid-template-columns: 1fr 1fr; }
  .chart-container { height: 220px; }
  .filter-grid { grid-template-columns: repeat(3, 1fr); }
  .milk-reports-grid { grid-template-columns: 1fr 1fr; }
}

/* --- Desktop hide mobile-only --- */
@media (min-width: 769px) {
  .sidebar-overlay, .mobile-header { display: none !important; }
}

/* --- Small phones ≤ 400px --- */
@media (max-width: 400px) {
  .premium-kpi-grid { grid-template-columns: 1fr; }
  .premium-kpi-card { padding: 12px 14px; }
  .pkpi-value { font-size: 20px; }
  .filter-grid { grid-template-columns: 1fr; }
  .main-scroll-area { padding: 12px; }
  .page-title { font-size: 18px; }
  .route-summary-box { flex-direction: column; text-align: center; }
  .route-summary-box > div { text-align: center !important; }
}

/* ============================================
   MOBILE TABLE — SHOW ONLY KEY COLUMNS
   ============================================ */
@media (max-width: 768px) {
  /* Customers: show NAME(1), ROLE(2), TOTAL MILK(8) — hide DATE(3), MOBILE(4), VILLAGE(5), COW(6), BUFF(7) */
  #section-customers tr td:nth-child(3),
  #section-customers tr td:nth-child(4),
  #section-customers tr td:nth-child(5),
  #section-customers tr td:nth-child(6),
  #section-customers tr td:nth-child(7),
  #section-customers thead tr th:nth-child(3),
  #section-customers thead tr th:nth-child(4),
  #section-customers thead tr th:nth-child(5),
  #section-customers thead tr th:nth-child(6),
  #section-customers thead tr th:nth-child(7) { display: none; }

  /* Potential Customers: show NAME(1), ROLE(2), ACTION(8) — hide DATE(3), MOBILE(4), VILLAGE(5), COW(6), BUFF(7) */
  #section-potential-customers tr td:nth-child(3),
  #section-potential-customers tr td:nth-child(4),
  #section-potential-customers tr td:nth-child(5),
  #section-potential-customers tr td:nth-child(6),
  #section-potential-customers tr td:nth-child(7),
  #section-potential-customers thead tr th:nth-child(3),
  #section-potential-customers thead tr th:nth-child(4),
  #section-potential-customers thead tr th:nth-child(5),
  #section-potential-customers thead tr th:nth-child(6),
  #section-potential-customers thead tr th:nth-child(7) { display: none; }

  /* Visits: show CUSTOMER NAME(1), STATUS(5), ACTION(7) — hide TYPE(2), DATE(3), REASON(4), OUTCOME(6) */
  #section-visits tr td:nth-child(2),
  #section-visits tr td:nth-child(3),
  #section-visits tr td:nth-child(4),
  #section-visits tr td:nth-child(6),
  #section-visits thead tr th:nth-child(2),
  #section-visits thead tr th:nth-child(3),
  #section-visits thead tr th:nth-child(4),
  #section-visits thead tr th:nth-child(6) { display: none; }

  /* Dashboard recent visits table: show CUSTOMER(1), STATUS(3) — hide DATE(2) */
  #section-dashboard tr td:nth-child(2),
  #section-dashboard thead tr th:nth-child(2) { display: none; }
}
