:root {
  --bg-primary: #0A0E17;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.85);
  --bg-card-border: rgba(245, 158, 11, 0.15);
  --bg-active-card: rgba(30, 20, 10, 0.85);
  
  --jaggery-gold: #F59E0B;
  --jaggery-dark: #B45309;
  --jaggery-light: #FDE68A;
  --jaggery-glow: rgba(245, 158, 11, 0.35);
  
  --cane-green: #10B981;
  --cane-green-glow: rgba(16, 185, 129, 0.3);
  
  --danger-red: #EF4444;
  --danger-glow: rgba(239, 68, 68, 0.3);
  
  --text-main: #F9FAFB;
  --text-muted: #9CA3AF;
  --text-sub: #6B7280;
  
  --border-subtle: #1F2937;
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Roboto Mono', 'Courier New', monospace;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --shadow-active: 0 0 35px rgba(245, 158, 11, 0.25), 0 10px 25px -5px rgba(0, 0, 0, 0.6);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(217, 119, 6, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(16, 185, 129, 0.05) 0%, transparent 40%),
    linear-gradient(rgba(10, 14, 23, 0.95), rgba(10, 14, 23, 0.95));
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* NAVBAR */
.factory-nav {
  background: rgba(17, 24, 39, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bg-card-border);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #F59E0B, #B45309);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px var(--jaggery-glow);
}

.brand-icon svg {
  width: 28px;
  height: 28px;
  fill: #FFF;
}

.brand-text h1 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #F9FAFB, #FDE68A);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text p {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.status-dot-pulse {
  width: 8px;
  height: 8px;
  background: var(--cane-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--cane-green);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.live-clock-card {
  background: rgba(31, 41, 55, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-md);
  text-align: right;
}

.live-clock-card .clock-time {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--jaggery-gold);
}

.live-clock-card .clock-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.nav-links {
  display: flex;
  gap: 0.5rem;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.nav-btn.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(180, 83, 9, 0.3));
  border-color: rgba(245, 158, 11, 0.4);
  color: var(--jaggery-light);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
}

.nav-btn.secondary {
  background: rgba(31, 41, 55, 0.6);
  border-color: var(--border-subtle);
  color: var(--text-main);
}

.nav-btn.secondary:hover {
  background: rgba(55, 65, 81, 0.8);
  border-color: rgba(255, 255, 255, 0.2);
}

/* SUPERVISOR VIEW BANNER */
.supervisor-header {
  padding: 1.5rem 2rem 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.supervisor-title h2 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

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

.supervisor-badge-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
}

.supervisor-select-wrapper label {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
  text-transform: uppercase;
}

.supervisor-select-wrapper select {
  background: transparent;
  border: none;
  color: var(--jaggery-gold);
  font-weight: 700;
  font-size: 0.95rem;
  outline: none;
  cursor: pointer;
}

.supervisor-select-wrapper select option {
  background: var(--bg-secondary);
  color: var(--text-main);
}

/* 7 KADAI GRID */
.kadai-container {
  padding: 1.5rem 2rem 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.75rem;
  max-width: 1750px;
  margin: 0 auto;
  width: 100%;
}

/* KADAI CARD */
.kadai-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.kadai-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.7);
}

/* ACTIVE BOILING STATE */
.kadai-card.boiling {
  background: radial-gradient(circle at 50% 20%, rgba(245, 158, 11, 0.15) 0%, rgba(17, 24, 39, 0.95) 70%);
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: var(--shadow-active);
}

.kadai-card.boiling::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #F59E0B, #EF4444, #F59E0B);
  background-size: 200% 100%;
  animation: heat-stripe 3s linear infinite;
}

@keyframes heat-stripe {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

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

.kadai-number-tag {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.kadai-number-tag .kadai-badge {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
}

.kadai-card.boiling .kadai-badge {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.5);
  color: var(--jaggery-light);
}

.status-pill {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.status-pill.idle {
  background: rgba(107, 114, 128, 0.2);
  color: #9CA3AF;
  border: 1px solid rgba(107, 114, 128, 0.3);
}

.status-pill.boiling {
  background: rgba(245, 158, 11, 0.2);
  color: #FCD34D;
  border: 1px solid rgba(245, 158, 11, 0.5);
  animation: pulse-glow 2s infinite alternate;
}

@keyframes pulse-glow {
  from { box-shadow: 0 0 5px rgba(245, 158, 11, 0.3); }
  to { box-shadow: 0 0 15px rgba(245, 158, 11, 0.7); }
}

/* KADAI VISUAL PAN GRAPHIC */
.kadai-visual-area {
  position: relative;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.5rem 0 1.25rem;
}

.kadai-vessel {
  position: relative;
  width: 140px;
  height: 60px;
  background: #1F2937;
  border: 3px solid #374151;
  border-radius: 0 0 70px 70px;
  transition: all 0.3s ease;
  overflow: hidden;
}

/* Handles on side of Kadai */
.kadai-vessel::before, .kadai-vessel::after {
  content: '';
  position: absolute;
  top: 8px;
  width: 14px;
  height: 14px;
  border: 3px solid #4B5563;
  border-radius: 50%;
}
.kadai-vessel::before { left: -14px; }
.kadai-vessel::after { right: -14px; }

/* In boiling state, the vessel glows with molten jaggery */
.kadai-card.boiling .kadai-vessel {
  border-color: #D97706;
  box-shadow: 0 10px 25px rgba(245, 158, 11, 0.4);
}

.kadai-liquid {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 0;
  background: #111827;
  transition: height 0.5s ease;
}

.kadai-card.boiling .kadai-liquid {
  height: 85%;
  background: linear-gradient(180deg, #F59E0B, #B45309 60%, #78350F 100%);
  position: relative;
  overflow: hidden;
}

/* Bubbles animation for boiling juice */
.bubble {
  position: absolute;
  bottom: 0;
  background: rgba(254, 243, 199, 0.6);
  border-radius: 50%;
  animation: rise 1.8s infinite ease-in;
}

.bubble:nth-child(1) { left: 20%; width: 8px; height: 8px; animation-duration: 1.2s; animation-delay: 0.1s; }
.bubble:nth-child(2) { left: 45%; width: 12px; height: 12px; animation-duration: 1.6s; animation-delay: 0.4s; }
.bubble:nth-child(3) { left: 70%; width: 10px; height: 10px; animation-duration: 1.4s; animation-delay: 0.2s; }
.bubble:nth-child(4) { left: 35%; width: 6px; height: 6px; animation-duration: 1.9s; animation-delay: 0.6s; }

@keyframes rise {
  0% { transform: translateY(0) scale(0.6); opacity: 0.2; }
  50% { opacity: 0.9; }
  100% { transform: translateY(-40px) scale(1.2); opacity: 0; }
}

/* Fire/Heat under Kadai */
.kadai-flames {
  position: absolute;
  bottom: 12px;
  width: 110px;
  height: 18px;
  display: none;
  justify-content: space-around;
  z-index: 1;
}

.kadai-card.boiling .kadai-flames {
  display: flex;
}

.flame-particle {
  width: 14px;
  height: 14px;
  background: radial-gradient(circle, #FEF08A, #F97316 60%, transparent 80%);
  border-radius: 50% 50% 20% 20%;
  transform: rotate(-45deg);
  animation: flicker 0.6s infinite alternate ease-in-out;
}
.flame-particle:nth-child(2) { animation-delay: 0.15s; }
.flame-particle:nth-child(3) { animation-delay: 0.3s; }
.flame-particle:nth-child(4) { animation-delay: 0.45s; }

@keyframes flicker {
  0% { transform: scale(0.8) translateY(0); opacity: 0.7; }
  100% { transform: scale(1.15) translateY(-4px); opacity: 1; }
}

/* TIMER & METRICS SECTION */
.kadai-metrics {
  text-align: center;
  margin-bottom: 1.5rem;
}

.timer-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.3rem;
}

.timer-display {
  font-family: var(--font-mono);
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #6B7280;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  transition: color 0.3s ease;
}

.kadai-card.boiling .timer-display {
  color: var(--jaggery-gold);
  text-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
}

.batch-info-sub {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  min-height: 20px;
}

.batch-tag {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--jaggery-light);
}

/* ACTION BUTTON (Supervisor Big Touch Target) */
.kadai-action-area {
  margin-top: auto;
}

.action-btn {
  width: 100%;
  padding: 1.15rem 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  border: none;
  outline: none;
}

.action-btn:active {
  transform: scale(0.97);
}

/* START BUTTON (When Idle) */
.action-btn.btn-start {
  background: linear-gradient(135deg, #059669, #10B981);
  color: #FFFFFF;
  box-shadow: 0 6px 20px var(--cane-green-glow);
}

.action-btn.btn-start:hover {
  background: linear-gradient(135deg, #047857, #059669);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
  transform: translateY(-2px);
}

/* FINISH BUTTON (When Boiling) */
.action-btn.btn-finish {
  background: linear-gradient(135deg, #D97706, #F59E0B);
  color: #111827;
  font-weight: 900;
  box-shadow: 0 6px 25px var(--jaggery-glow);
}

.action-btn.btn-finish:hover {
  background: linear-gradient(135deg, #B45309, #D97706);
  color: #FFFFFF;
  box-shadow: 0 8px 30px rgba(245, 158, 11, 0.6);
  transform: translateY(-2px);
}

/* NOTICE: No Reset for supervisor */
.no-reset-notice {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-sub);
  margin-top: 0.6rem;
}

/* =======================================
   ADMIN DASHBOARD STYLES
   ======================================= */
.admin-container {
  padding: 1.5rem 2rem 3rem;
  max-width: 1750px;
  margin: 0 auto;
  width: 100%;
}

.admin-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.admin-title h2 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.admin-title p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.2rem;
}

.admin-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-primary {
  background: linear-gradient(135deg, #D97706, #F59E0B);
  color: #111827;
  font-weight: 700;
  border: none;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #B45309, #D97706);
  color: #FFFFFF;
  box-shadow: 0 4px 15px var(--jaggery-glow);
}

.btn-secondary {
  background: rgba(31, 41, 55, 0.8);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-secondary:hover {
  background: rgba(55, 65, 81, 0.9);
  border-color: rgba(255, 255, 255, 0.2);
}

/* KPI CARDS GRID */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.kpi-icon {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon.amber {
  background: rgba(245, 158, 11, 0.15);
  color: var(--jaggery-gold);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.kpi-icon.green {
  background: rgba(16, 185, 129, 0.15);
  color: var(--cane-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.kpi-icon.blue {
  background: rgba(59, 130, 246, 0.15);
  color: #60A5FA;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.kpi-icon.purple {
  background: rgba(168, 85, 247, 0.15);
  color: #C084FC;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.kpi-icon svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.kpi-info .kpi-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.kpi-info .kpi-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 0.2rem;
  letter-spacing: -0.02em;
}

.kpi-info .kpi-sub {
  font-size: 0.75rem;
  color: var(--text-sub);
  margin-top: 0.2rem;
}

/* KADAI ANALYTICS STRIP */
.kadai-analytics-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.analytics-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.analytics-title h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.kadai-bars-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1rem;
}

@media (max-width: 900px) {
  .kadai-bars-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.kadai-bar-col {
  background: rgba(31, 41, 55, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 1rem 0.75rem;
  text-align: center;
}

.kadai-bar-col .col-kadai-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--jaggery-light);
}

.kadai-bar-col .col-batches {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0.35rem 0 0.15rem;
}

.kadai-bar-col .col-duration {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* FILTER BAR */
.filter-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
  justify-content: space-between;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-item label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.filter-input {
  background: rgba(31, 41, 55, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  outline: none;
  font-family: inherit;
}

.filter-input:focus {
  border-color: var(--jaggery-gold);
}

.quick-filter-btns {
  display: flex;
  gap: 0.4rem;
}

.quick-btn {
  background: rgba(31, 41, 55, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-btn.active, .quick-btn:hover {
  background: var(--jaggery-gold);
  color: #111827;
  border-color: var(--jaggery-gold);
}

/* DATA TABLE */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

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

.table-header-title h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.record-count-badge {
  background: rgba(245, 158, 11, 0.15);
  color: var(--jaggery-gold);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.custom-table th {
  background: rgba(31, 41, 55, 0.9);
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  font-weight: 700;
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--border-subtle);
}

.custom-table td {
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

.custom-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.batch-code-col {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--jaggery-light);
  font-size: 0.8rem;
}

.duration-pill {
  background: rgba(16, 185, 129, 0.12);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-block;
}

/* MODALS */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.9), 0 0 30px rgba(245, 158, 11, 0.2);
  transform: scale(0.95);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.open .modal-card {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-header h3 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--jaggery-light);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

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

.modal-form-group label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.modal-form-group input, .modal-form-group select {
  width: 100%;
  background: rgba(31, 41, 55, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  outline: none;
  font-family: inherit;
}

.modal-form-group input:focus {
  border-color: var(--jaggery-gold);
}

.modal-buttons {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.modal-buttons button {
  flex: 1;
  padding: 0.85rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
}

/* TOAST NOTIFICATIONS */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--jaggery-gold);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-main);
  font-size: 0.9rem;
  animation: slide-in 0.3s ease;
  max-width: 380px;
}

.toast.success {
  border-left-color: var(--cane-green);
}

.toast.error {
  border-left-color: var(--danger-red);
}

@keyframes slide-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* FOOTER */
.factory-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  padding: 1.5rem 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-sub);
}

/* ===== Jaggery bundle entry (Finish popup) — large touch targets for the floor ===== */
.modal-card { max-height: 92vh; overflow-y: auto; }
.big-question { font-size: 1.5rem; font-weight: 800; text-align: center; color: #F9FAFB; margin: 0.5rem 0 1rem; }
.big-btn { min-height: 56px; font-size: 1.05rem; }
.bundle-section-title { font-weight: 800; color: #F9FAFB; font-size: 1.05rem; margin-bottom: 0.6rem; }
.bundle-row {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  background: rgba(17, 24, 39, 0.7); border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 10px; padding: 0.6rem; margin-bottom: 0.6rem;
}
.bundle-size {
  flex: 1 1 110px; min-height: 52px; font-size: 1.25rem; font-weight: 800;
  background: #111827; color: #F59E0B; border: 2px solid rgba(245, 158, 11, 0.5);
  border-radius: 8px; padding: 0 0.6rem;
}
.bundle-stepper { display: flex; align-items: center; gap: 0.35rem; }
.step-btn {
  width: 52px; height: 52px; border-radius: 10px; border: none; cursor: pointer;
  font-size: 1.8rem; font-weight: 900; line-height: 1; color: #111827; background: #F59E0B;
  touch-action: manipulation;
}
.step-btn.minus { background: #4B5563; color: #F9FAFB; }
.bundle-count {
  width: 72px; height: 52px; text-align: center; font-size: 1.5rem; font-weight: 900;
  background: #0B1220; color: #F9FAFB; border: 2px solid #374151; border-radius: 8px;
  font-family: var(--font-mono);
}
.bundle-remove {
  width: 44px; height: 44px; border-radius: 8px; border: 1px solid rgba(239, 68, 68, 0.5);
  background: transparent; color: #FCA5A5; font-size: 1.2rem; cursor: pointer;
}
.add-bundle-btn {
  width: 100%; min-height: 48px; margin-bottom: 0.8rem; border-radius: 10px; cursor: pointer;
  background: transparent; color: #F59E0B; border: 2px dashed rgba(245, 158, 11, 0.55);
  font-size: 1rem; font-weight: 800;
}
.bundle-total {
  text-align: center; font-size: 1.45rem; font-weight: 900; color: #10B981;
  background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 10px; padding: 0.7rem; margin-bottom: 1rem; font-family: var(--font-mono);
}
.bundle-total.empty { color: #9CA3AF; background: rgba(75, 85, 99, 0.15); border-color: #374151; }
.bundle-chip {
  display: inline-block; margin: 1px 3px 1px 0; padding: 1px 6px; border-radius: 6px;
  background: rgba(245, 158, 11, 0.12); color: #FCD34D; font-size: 0.75rem; white-space: nowrap;
}
@media (max-width: 420px) {
  .modal-card { padding: 1.1rem; width: 96%; }
  .bundle-stepper { width: 100%; justify-content: space-between; }
  .bundle-count { flex: 1; }
}
/* size + remove on the first line, the big counter on its own full-width line */
.bundle-row .bundle-size { order: 1; flex: 1 1 0; min-width: 0; }
.bundle-row .bundle-remove { order: 2; }
.bundle-row .bundle-stepper { order: 3; width: 100%; justify-content: space-between; }
.bundle-row .bundle-count { flex: 1; width: auto; -moz-appearance: textfield; }
.bundle-count::-webkit-outer-spin-button, .bundle-count::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ===== Phones (and the Android app): compact header so every menu button is reachable ===== */
@media (max-width: 760px) {
  .factory-nav {
    position: static; flex-wrap: wrap; gap: 0.6rem; padding: 0.7rem 0.9rem;
  }
  .brand-icon { width: 38px; height: 38px; }
  .brand-icon svg { width: 22px; height: 22px; }
  .brand-text h1 { font-size: 1rem; }
  .brand-text p { font-size: 0.68rem; letter-spacing: 0.04em; }
  .nav-controls { width: 100%; flex-wrap: wrap; gap: 0.5rem; }
  .live-clock-card { display: none; }
  .nav-links { width: 100%; flex-wrap: wrap; gap: 0.4rem; }
  .nav-btn { padding: 0.55rem 0.8rem; font-size: 0.85rem; flex: 1 1 auto; justify-content: center; }
  .admin-container { padding-left: 0.9rem; padding-right: 0.9rem; }
  .admin-nav-tabs { flex-wrap: wrap; gap: 0.25rem; margin-bottom: 1.2rem; }
  .admin-tab-btn { padding: 0.6rem 0.7rem; font-size: 0.85rem; }
}

/* Developer credit at the bottom of every staff screen */
.dev-credit { margin-top: 0.45rem; font-size: 0.8rem; color: var(--text-sub, #9CA3AF); }
.dev-credit a { color: #F59E0B; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.login-credit { text-align: center; padding: 1rem 1rem 1.5rem; }
