/*

1. CSS Variables - All color and design tokens
2. Global Reset - Base styles
3. Animations - All keyframe animations
4. Login Screen - Hero, form, credentials
5. Forms & Inputs - All form elements and validation
6. Buttons - All button variants and states
7. Dashboard Layout - Main structure
8. Navigation - Navbar, user menu, notifications
9. Sidebar - Menu items and mobile menu
10.Content Area - Page headers and sections
11.Cards - Stats, sheds, tasks, and all card types
12.Lifting Phase - Harvest tracking UI
13.Checklist UI - Phase checklists
14.Alerts & Badges - Status indicators
15.Tables - Data tables
16.Tabs, Modals, Charts - Interactive components
17.Responsive - Tablet, mobile, and small mobile breakpoints

*/

/* ============================================================================
   1. CSS VARIABLES & ROOT CONFIGURATION
   ============================================================================ */

:root {
  --primary: #0f172a;
  --secondary: #1e293b;
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

/* ============================================================================
   2. GLOBAL RESET & BASE STYLES
   ============================================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    "Manrope",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

/* ============================================================================
   3. ANIMATIONS & KEYFRAMES
   ============================================================================ */

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================================================
   4. LOGIN SCREEN
   ============================================================================ */

/* Login Wrapper */
.login-wrapper {
  height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  gap: 0;
  overflow: hidden;
}

/* Login Hero Section */
.login-hero {
  grid-column: 1;
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 48px;
  color: white;
  position: relative;
  overflow: hidden;
}

.login-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(
      circle at 20% 50%,
      rgba(245, 158, 11, 0.15) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(16, 185, 129, 0.15) 0%,
      transparent 50%
    );
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 500px;
}

.hero-logo {
  font-size: 40px;
  margin-bottom: 16px;
  animation: float 3s ease-in-out infinite;
}

.hero-content h1 {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 16px;
  background: linear-gradient(
    135deg,
    #ffffff 0%,
    rgba(255, 255, 255, 0.7) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-content p {
  font-size: 15px;
  opacity: 0.9;
  margin-bottom: 32px;
}

/* Feature List */
.feature-list {
  list-style: none;
  margin-top: 40px;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 16px;
  opacity: 0.9;
}

.feature-list li::before {
  content: "✓";
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--accent);
  border-radius: 50%;
  font-weight: bold;
  font-size: 14px;
  flex-shrink: 0;
}

/* Login Form */
.login-form-wrapper {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: var(--bg);
  width: 100%;
  height: 100vh;
}

.login-card {
  background: white;
  padding: 36px;
  border-radius: 20px;
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 480px;
}

.login-card h2 {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--primary);
}

.login-card .subtitle {
  color: var(--text-secondary);
  margin-bottom: 32px;
}

/* Credentials Box */
.credentials-box {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-left: 4px solid var(--accent);
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 32px;
}

.credentials-box h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-dark);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.credential-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  font-family: "Space Mono", monospace;
}

.credential-item strong {
  color: var(--text-primary);
}

.credential-item span {
  color: var(--text-secondary);
}

/* ============================================================================
   5. FORMS & INPUTS
   ============================================================================ */

/* Form Groups */
.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
  font-size: 13px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  font-family: "Manrope", sans-serif;
  transition: all 0.3s ease;
  background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.1);
}

.form-group.full-width {
  grid-column: 1 / -1;
}

/* Form Layouts */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.form-actions {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 15px;
  border-top: 1px dashed #e2e8f0;
}

/* Input Validation */
input.invalid,
select.invalid {
  border-color: #ef4444;
  background-color: #fef2f2;
}

.error-msg {
  display: none;
  color: #ef4444;
  font-size: 11px;
  margin-top: 4px;
  font-weight: 500;
}

/* Inline Form Panel */
.inline-form-panel {
  background: white;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
  animation: slideDown 0.3s ease-out;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 10px;
}

.panel-header h3 {
  margin: 0;
  color: #1e293b;
  font-size: 16px;
}

/* ============================================================================
   6. BUTTONS
   ============================================================================ */

/* Primary Button */
.btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(
    135deg,
    var(--accent) 0%,
    var(--accent-dark) 100%
  );
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
  min-height: 40px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
}

.btn:active {
  transform: translateY(0);
}

/* Button Variants */
.btn-secondary {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}

.btn-small {
  width: auto;
  padding: 8px 16px;
  font-size: 12px;
  min-height: 36px;
}

.btn-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  pointer-events: none;
}

.btn-harvest {
  background: linear-gradient(
    135deg,
    var(--accent) 0%,
    var(--accent-dark) 100%
  );
  color: white;
  border: none;
  padding: 0 32px;
  height: 48px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s;
  box-shadow: 0 4px 6px rgba(245, 158, 11, 0.2);
}

.btn-harvest:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(245, 158, 11, 0.3);
}

.btn-close-batch {
  background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
  color: white;
  border: none;
  width: 100%;
  padding: 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s;
  box-shadow: 0 4px 6px rgba(239, 68, 68, 0.2);
}

.btn-close-batch:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(239, 68, 68, 0.3);
}

/* Icon Buttons */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: var(--bg);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 16px;
}

.icon-btn:hover {
  background: var(--accent);
  color: white;
  transform: scale(1.1);
}

.icon-btn.danger:hover {
  background: var(--danger);
}

/* Close Button */
.close-btn {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.3s ease;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.close-btn:hover {
  background: var(--bg);
  color: var(--primary);
}

/* Special Button Styles */
.btn-photo-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #eef2ff;
  color: #4f46e5;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid #c7d2fe;
  transition: all 0.2s ease;
  margin-top: 8px;
  width: fit-content;
}

.btn-photo-pill:hover {
  background-color: #e0e7ff;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-photo-pill i,
.btn-photo-pill img {
  font-size: 14px;
}

.btn-undo-subtle {
  background: transparent;
  border: 1px solid #e5e7eb;
  color: #9ca3af;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-undo-subtle:hover {
  background-color: #fee2e2;
  color: #ef4444;
  border-color: #fecaca;
}

.btn-undo-inline {
  font-size: 11px;
  color: #ef4444;
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: 8px;
  cursor: pointer;
  font-weight: 600;
  text-transform: uppercase;
  display: inline-block;
  vertical-align: middle;
  transition: all 0.2s;
}

.btn-undo-inline:hover {
  background: #ef4444;
  color: white;
}

.undo-btn {
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: underline;
  cursor: pointer;
  margin-left: 10px;
}

.large-btn {
  margin-top: 20px;
  width: 100%;
  max-width: 300px;
  padding: 16px;
}

.action-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
}

/* ============================================================================
   7. DASHBOARD LAYOUT
   ============================================================================ */

.dashboard {
  display: none;
  height: 100vh;
  overflow: hidden;
}

.dashboard.active {
  display: flex;
  flex-direction: column;
}

.main-layout {
  display: flex;
  flex: 1;
  /* This ensures the layout only takes the remaining space after Navbar */
  height: calc(100vh - 56px);
  overflow: hidden;
}

/* ============================================================================
   8. NAVIGATION BAR
   ============================================================================ */

.navbar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
}

.navbar-brand .logo {
  font-size: 32px;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

/* Notification Icon */
.notification-icon {
  position: relative;
  font-size: 24px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.notification-icon:hover {
  transform: scale(1.1);
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: black;
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* User Menu */
.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.user-menu:hover {
  background: var(--bg);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    var(--accent) 0%,
    var(--accent-dark) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 13px;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--primary);
}

.user-role {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ============================================================================
   9. SIDEBAR
   ============================================================================ */

.sidebar {
  width: 265px;
  background: white;
  border-right: 1px solid var(--border);
  padding: 16px 0;
  overflow-y: auto;
}

.sidebar-section {
  margin-bottom: 32px;
}

.sidebar-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  padding: 0 24px;
  margin-bottom: 12px;
}

/* Menu Items */
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-secondary);
  font-weight: 500;
  position: relative;
  min-height: 44px;
  font-size: 14px;
}

.menu-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 0;
  background: var(--accent);
  border-radius: 0 4px 4px 0;
  transition: height 0.3s ease;
}

.menu-item:hover {
  background: linear-gradient(
    90deg,
    rgba(245, 158, 11, 0.05) 0%,
    transparent 100%
  );
  color: var(--primary);
}

.menu-item.active {
  color: var(--accent);
  background: linear-gradient(
    90deg,
    rgba(245, 158, 11, 0.1) 0%,
    transparent 100%
  );
  font-weight: 600;
}

.menu-item.active::before {
  height: 32px;
}

.menu-icon {
  font-size: 18px;
  width: 26px;
  text-align: center;
}

/* Mobile Menu */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
}

.mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

.mobile-overlay.active {
  display: block;
}

/* ============================================================================
   10. CONTENT AREA
   ============================================================================ */

.content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  background: var(--bg);
}

/* Page Headers */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}

.page-title {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  line-height: 1.2;
}

.page-subtitle {
  font-size: 13px;
  color: #64748b;
  margin-top: 4px;
}

/* Page Sections */
.page-section {
  display: none;
}

.page-section.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* ============================================================================
   11. CARDS
   ============================================================================ */

/* Base Card */
.card {
  background: white;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

/* Stat Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-dark) 100%);
}

.stat-card.success::before {
  background: linear-gradient(90deg, var(--success) 0%, #059669 100%);
}

.stat-card.danger::before {
  background: linear-gradient(90deg, var(--danger) 0%, #dc2626 100%);
}

.stat-card.info::before {
  background: linear-gradient(90deg, var(--info) 0%, #2563eb 100%);
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-icon {
  font-size: 32px;
  opacity: 0.2;
}

.stat-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  margin: 2px 0;
}

.stat-change {
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.stat-change.positive {
  color: var(--success);
}

.stat-change.negative {
  color: var(--danger);
}

/* Shed Cards */
.sheds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
}

.shed-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  border-left: 5px solid transparent;
  cursor: pointer;
}

.shed-card .btn {
  color: #ffffff !important; /* ✅ Forces text to be WHITE (fixes ash gray) */
  width: auto !important; /* ✅ Stops it from stretching full width */
  min-width: 200px; /* ✅ Sets a nice standard size */
  max-width: 300px; /* Prevents it from getting too wide */
  display: inline-block;
  margin-top: 15px;
}

.shed-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.shed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

.shed-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
}

.shed-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 768px) {
  .shed-metrics {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

.shed-metric {
  text-align: center;
  padding: 12px;
  background: var(--bg);
  border-radius: 10px;
}

.metric-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.metric-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
}

.metric-value.success {
  color: var(--success);
}

.metric-value.danger {
  color: var(--danger);
}

.shed-processes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.process-badge {
  padding: 8px 12px;
  background: var(--bg);
  border-radius: 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.process-badge.active {
  background: linear-gradient(
    135deg,
    var(--accent) 0%,
    var(--accent-dark) 100%
  );
  color: white;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

/* Shed Phase Colors */
.shed-card.status-growing {
  border-left-color: #22c55e;
}

.shed-card.status-growing .badge.success {
  background: #dcfce7;
  color: #166534;
}

.shed-card.status-lifting {
  border-left-color: #f97316;
}

.shed-card.status-lifting .badge.warning {
  background: #ffedd5;
  color: #9a3412;
}

.shed-card.status-cleaning {
  border-left-color: #ef4444;
}

.shed-card.status-cleaning .badge.info {
  background: #fee2e2;
  color: #991b1b;
}

.shed-card.status-prep {
  border-left-color: #3b82f6;
}

.shed-card.status-prep .badge.info {
  background: #dbeafe;
  color: #1e40af;
}

.shed-card.status-empty {
  border-left-color: #94a3b8;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
}

.shed-card.status-empty .badge.secondary {
  background: #e2e8f0;
  color: #475569;
}

/* Empty Shed Card */
.empty-shed-card {
  text-align: center;
  padding: 40px;
  background: white;
  border: 1px dashed var(--border);
  border-radius: 16px;
}

.empty-shed-card .icon-wrapper {
  font-size: 48px;
  margin-bottom: 16px;
}

/* Task Cards */
.task-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: transform 0.2s;
}

.task-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.task-card.completed {
  background: #f8fafc;
  border-left: 4px solid var(--success);
  opacity: 0.8;
}

.task-card.pending {
  border-left: 4px solid var(--warning);
}

.task-info h4 {
  margin: 0 0 5px 0;
  color: var(--text-primary);
}

.task-info p {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.task-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.task-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

.task-meta {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.task-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.task-status-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

/* ============================================================================
   12. LIFTING PHASE UI
   ============================================================================ */

.lifting-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.lifting-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.lifting-title {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  background: #fff7ed;
  padding: 8px;
  border-radius: 12px;
}

.lifting-title h3 {
  margin: 0;
  font-size: 18px;
  color: var(--primary);
}

.lifting-title p {
  margin: 4px 0 0 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.lifting-stat .label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 600;
}

.lifting-stat .value {
  font-size: 24px;
  font-weight: 800;
  color: var(--accent);
}

/* Harvest Input Section */
.harvest-input-section {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: end;
  margin-bottom: 32px;
  background: var(--bg);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.input-group input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  outline: none;
  transition: all 0.2s;
  background: white;
}

.input-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

/* Harvest History */
.harvest-history-section h4 {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.harvest-log-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.log-time {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-weight: 500;
}

.mini-icon {
  width: 14px;
  height: 14px;
  opacity: 0.5;
}

.log-qty {
  color: var(--danger);
  font-weight: 700;
  font-family: "Space Mono", monospace;
}

.empty-log {
  text-align: center;
  color: var(--text-secondary);
  font-style: italic;
  padding: 20px;
  font-size: 13px;
}

/* Close Batch Section */
.close-batch-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px dashed var(--border);
  text-align: center;
}

.close-batch-section p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

/* ============================================================================
   13. CHECKLIST UI
   ============================================================================ */

.checklist-header {
  background: #f8fafc;
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.phase-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.phase-badge.cleaning {
  background: #fee2e2;
  color: #dc2626;
}

.phase-badge.preparation {
  background: #e0f2fe;
  color: #0284c7;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 12px;
  transition: all 0.2s;
}

.checklist-item.locked {
  background: #f1f5f9;
  opacity: 0.7;
  border-style: dashed;
}

.checklist-item.done {
  border-color: #22c55e;
  background: #f0fdf4;
}

.step-idx {
  width: 32px;
  height: 32px;
  background: var(--bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text-secondary);
}

.checklist-item.done .step-idx {
  background: #22c55e;
  color: white;
}

.step-info {
  flex: 1;
}

.step-info h4 {
  margin: 0 0 4px 0;
  font-size: 15px;
}

.step-info p {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

/* Success Box */
.success-box {
  text-align: center;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 24px;
  border-radius: 16px;
  margin-top: 20px;
}

/* ============================================================================
   14. ALERTS & BADGES
   ============================================================================ */

/* Alerts */
.alert {
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  animation: slideDown 0.3s ease;
}

.alert.warning {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
  border-left: 4px solid var(--warning);
}

.alert.danger {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #991b1b;
  border-left: 4px solid var(--danger);
}

.alert.success {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #065f46;
  border-left: 4px solid var(--success);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge.success {
  background: #d1fae5;
  color: #065f46;
}

.badge.warning {
  background: #fef3c7;
  color: #92400e;
}

.badge.danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge.primary {
  background: #dbeafe;
  color: #1e40af;
}

.badge.secondary {
  background: #f1f5f9;
  color: #475569;
}

/* ============================================================================
   15. TABLES
   ============================================================================ */

.table-container {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  min-width: 600px;
}

table thead {
  background: var(--bg);
}

table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
}

table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

table tr:last-child td {
  border-bottom: none;
}

table tr:hover {
  background: var(--bg);
}

#usersTable th,
#usersTable td {
  white-space: nowrap;
  padding: 10px 14px;
  vertical-align: middle;
  text-align: left;
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* ============================================================================
   16. TABS
   ============================================================================ */

.tabs-container,
.shed-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  overflow-x: auto;
}

.tab-btn {
  padding: 10px 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ============================================================================
   MODALS
   ============================================================================ */

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 24px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.3s ease;
  padding: 25px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 32px 32px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
}

.modal-body {
  padding: 32px;
}

.modal-footer,
.modal-actions {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 15px;
}

/* ============================================================================
   CHARTS & PROGRESS
   ============================================================================ */

.chart-container {
  position: relative;
  height: 300px;
  margin-top: 20px;
}

.chart-select {
  padding: 8px 32px 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  background-color: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  outline: none;
  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='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.chart-select:hover {
  border-color: var(--primary);
  background-color: #f8fafc;
}

.chart-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Progress Bar */
.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--success) 0%, #059669 100%);
  transition: width 0.3s ease;
}

/* Loading Animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.text-red {
  color: #ef4444 !important;
}

.text-green {
  color: #22c55e !important;
}

/* ============================================================================
   17. DATATABLES CUSTOMIZATION
   ============================================================================ */

.table-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: white;
  border-bottom: 1px solid var(--border);
}

.table-top label {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-top select {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}

.table-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: white;
  border-top: 1px solid var(--border);
}

.dataTables_info {
  font-size: 13px;
  color: var(--text-secondary);
}

.dataTables_paginate {
  display: flex;
  align-items: center;
  gap: 4px;
}

.paginate_button {
  padding: 6px 12px;
  margin: 0 4px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  background: white;
  transition: all 0.2s;
}

.paginate_button:hover:not(.disabled) {
  background: var(--bg);
  color: var(--primary);
}

.paginate_button.current {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.paginate_button.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================================================
   18. RESPONSIVE DESIGN - TABLETS
   ============================================================================ */

@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .sheds-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Only hide hero on actual tablets/mobile */
@media (max-width: 900px) {
  .login-wrapper {
    grid-template-columns: 1fr;
    background: #ffffff !important; /* Completely remove dark gradient on mobile */
    overflow: hidden;
  }

  .login-hero {
    display: none !important;
    width: 0;
    height: 0;
    overflow: hidden;
  }

  .login-form-wrapper {
    grid-column: 1 / -1;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: #ffffff !important;
  }
}

/* ============================================================================
   RESPONSIVE DESIGN - MOBILE
   ============================================================================ */

@media (max-width: 768px) {
  /* Mobile Menu */

  /* 1. Hide User Name & Role to save space */
  .user-info {
    display: none;
  }

  .mobile-menu-btn {
    display: block;
  }

  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    bottom: 0;
    z-index: 1000;
    transition: left 0.3s ease;
    box-shadow: var(--shadow-xl);
  }

  .sidebar.mobile-open {
    left: 0;
  }

  .mobile-sidebar-header {
    display: flex !important;
  }

  /* Layout Adjustments */
  .content {
    padding: 16px;
  }

  .page-title {
    font-size: 16px;
  }

  .page-subtitle {
    font-size: 14px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .sheds-grid {
    grid-template-columns: 1fr;
  }

  .form-row,
  .form-grid {
    grid-template-columns: 1fr;
  }

  /* Navbar */
  .navbar {
    padding: 0 16px;
    height: 60px;
  }

  /* 3. Resize the Brand/Logo text so it fits better */
  .navbar-brand {
    font-size: 18px;
    gap: 8px;
    white-space: nowrap; /* Prevents text from wrapping awkwardly */
  }

  .navbar-brand .logo {
    display: none; /* Hide the logo icon on mobile to save space */
    font-size: 24px;
  }

  .notification-icon {
    font-size: 20px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .user-menu {
    min-height: 48px;
    padding: 0;
    gap: 0;
    background: transparent;
  }

  /* Stats */
  .stat-value {
    font-size: 28px;
  }

  .stat-icon {
    font-size: 24px;
  }

  /* Cards */
  .card {
    padding: 16px;
  }

  .shed-card {
    padding: 15px !important;
    overflow: hidden;
  }

  .shed-metrics {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .metric-value {
    font-size: 20px !important;
  }

  .metric-label {
    font-size: 10px !important;
  }

  .shed-header {
    align-items: center !important;
    text-align: center !important;
  }

  .shed-header > div {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .shed-processes {
    grid-template-columns: 1fr;
  }

  .process-badge {
    padding: 10px;
  }

  /* Modals */
  .modal-content {
    width: 95%;
    max-height: 85vh;
  }

  .modal-header,
  .modal-body {
    padding: 20px;
  }

  .modal-title {
    font-size: 20px;
  }

  /* Login */
  .login-card {
    padding: 32px 24px;
  }

  .login-card h2 {
    font-size: 28px;
  }

  /* Tables */
  table {
    font-size: 14px;
  }

  table th,
  table td {
    padding: 12px;
  }

  .table-container::after {
    display: none !important;
  }

  /* Page Headers */
  .page-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .page-header .btn {
    font-size: 12px;
    padding: 8px 12px;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .action-buttons {
    display: flex !important;
    flex-direction: row !important;
    gap: 8px !important;
  }

  .icon-btn img {
    width: 18px;
    height: 18px;
  }

  .task-meta {
    flex-direction: column;
    gap: 8px;
  }
}

/* ============================================================================
   RESPONSIVE DESIGN - SMALL MOBILE
   ============================================================================ */

@media (max-width: 480px) {
  .stats-grid {
    gap: 12px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-value {
    font-size: 24px;
  }

  .navbar {
    padding: 0 12px;
  }

  .content {
    padding: 12px;
  }

  .btn {
    padding: 14px;
    font-size: 14px;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 12px;
    font-size: 14px;
  }

  .credentials-box {
    padding: 16px;
  }

  .credential-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .login-card {
    padding: 24px 16px;
  }

  table {
    font-size: 12px;
  }

  table th,
  table td {
    padding: 8px;
  }
}

/* ============================================================================
  To prevent the "double render" on refresh 
  ============================================================================ */

/* Prevent the 0.5s flicker */
#loginScreen,
#dashboardScreen {
  display: none;
}

/* Optional: Smooth entry */
.app-ready {
  animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ====================================================================================
   TOAST NOTIFICATION SYSTEM
   ==================================================================================== */
#toastContainer {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

@media (max-width: 768px) {
  #toastContainer {
    bottom: 80px; /* Clears mobile browser nav bars */
    right: 16px;
    left: 16px;
  }
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  min-width: 280px;
  max-width: 420px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  pointer-events: all;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition:
    opacity 0.35s ease,
    transform 0.35s ease;
}

.toast.toast-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast-success {
  background: #d1fae5;
  color: #065f46;
  border-left: 4px solid #10b981;
}
.toast-error {
  background: #fee2e2;
  color: #991b1b;
  border-left: 4px solid #ef4444;
}
.toast-warning {
  background: #fef3c7;
  color: #92400e;
  border-left: 4px solid #f59e0b;
}
.toast-info {
  background: #dbeafe;
  color: #1e3a8a;
  border-left: 4px solid #3b82f6;
}

.toast-icon {
  font-size: 18px;
  flex-shrink: 0;
}
.toast-msg {
  flex: 1;
}

.toast-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  opacity: 0.6;
  padding: 0 4px;
  transition: opacity 0.2s;
  color: inherit;
  width: auto;
  min-height: unset;
  text-transform: none;
  font-weight: 400;
  box-shadow: none;
}
.toast-close:hover {
  opacity: 1;
  transform: none;
}

/* ==========================================
   REPORTS PAGE
   ========================================== */

/* Filter Bar */
.report-filter-bar {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.report-filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 130px;
}

.report-filter-group label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.report-filter-group select,
.report-filter-group input[type="date"] {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: var(--bg);
  color: var(--text-primary);
  transition: border-color 0.2s;
}

.report-filter-group select:focus,
.report-filter-group input[type="date"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

/* Summary Strip — clean horizontal bar */
.report-summary-strip {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 20px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  overflow: hidden;
}

.report-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 90px;
  padding: 4px 8px;
}

.report-stat-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.report-stat-value {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
}

.report-stat-value.report-danger {
  color: var(--danger);
}

.report-stat-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
  flex-shrink: 0;
}

/* DataTables Theme Override */
#reportDataTable_wrapper {
  font-family: "Manrope", sans-serif;
}

.report-dt-top,
.report-dt-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 8px;
  flex-wrap: wrap;
  gap: 8px;
}

#reportDataTable_wrapper .dataTables_length select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  background: var(--bg);
}

#reportDataTable_wrapper .dataTables_filter input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  margin-left: 6px;
  background: var(--bg);
}

#reportDataTable_wrapper .dataTables_filter input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

#reportDataTable_wrapper .dataTables_info {
  font-size: 12px;
  color: var(--text-secondary);
}

#reportDataTable_wrapper .dataTables_paginate .paginate_button {
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  margin: 0 2px;
  border: 1px solid var(--border) !important;
  background: var(--card-bg) !important;
  color: var(--text-primary) !important;
}

#reportDataTable_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--primary) !important;
  color: white !important;
  border-color: var(--primary) !important;
  font-weight: 700;
}

#reportDataTable_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--bg) !important;
  color: var(--primary) !important;
}

#reportDataTable thead th {
  background: #1e293b;
  color: white;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 14px;
  border-bottom: 2px solid var(--primary) !important;
  white-space: nowrap;
}

#reportDataTable tbody td {
  padding: 10px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}

#reportDataTable tbody tr:hover {
  background: rgba(245, 158, 11, 0.04) !important;
}

/* Photo Thumbnail */
.report-photo-thumb {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid var(--border);
  transition:
    transform 0.15s,
    border-color 0.15s;
}

.report-photo-thumb:hover {
  transform: scale(1.15);
  border-color: var(--primary);
}

/* Photo Lightbox */
.report-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.report-lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

/* Task Photo Lightbox (matches report lightbox) */
.task-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 13000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.task-lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .report-filter-bar {
    flex-direction: column;
    gap: 12px;
  }

  .report-filter-group {
    min-width: 100%;
  }

  .report-summary-strip {
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px;
  }

  .report-stat-divider {
    width: 100%;
    height: 1px;
  }

  .report-stat {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    padding: 4px 0;
  }

  #reportDataTable thead th {
    font-size: 10px;
    padding: 10px 8px;
  }

  #reportDataTable tbody td {
    font-size: 12px;
    padding: 8px;
  }
}

/* Modal Desktop constraints */
@media (min-width: 481px) {
  .task-modal-desktop {
    max-width: 420px !important;
  }
}

/* Mobile Task Card Refinements */
@media (max-width: 480px) {
  .task-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
  }

  .task-card .task-info {
    width: 100%;
  }

  .task-meta-footer .btn,
  .task-meta-footer .badge {
    flex-shrink: 0;
  }

  /* Bottom-Sheet style for Complete Task Modal on Mobile */
  #completeTaskModal {
    align-items: flex-end !important; /* Push to bottom */
  }

  #completeTaskModal .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 24px 24px 0 0 !important;
    margin-bottom: 0 !important;
    animation: slideUpBottom 0.3s ease-out;
  }
}

@keyframes slideUpBottom {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
