/* Work Hub — FamilyHub (matches /food theme) */

:root {
  --primary:   #2C3E6B;
  --primary-dark: #1e2d52;
  --accent:    #E8835A;
  --accent-light: #F5A87A;
  --accent-dim: rgba(232, 131, 90, .12);
  --bg:        #F7F5F2;
  --surface:   #FFFFFF;
  --elevated:  #f0ede8;
  --text:      #1E1E2E;
  --muted:     #6B7280;
  --border:    #E5E2DD;
  --border-light: #D5D0C8;
  --success:   #4CAF82;
  --success-dim: rgba(76, 175, 130, .12);
  --danger:    #E05555;
  --danger-dim: rgba(224, 85, 85, .12);
  --warning:   #F5A623;
  --radius:    16px;
  --radius-sm: 10px;
  --shadow:    0 2px 12px rgba(44,62,107,.08);
  --shadow-md: 0 8px 30px rgba(44,62,107,.14);
  --shadow-lg: 0 12px 40px rgba(44,62,107,.18);
  --font:      'Segoe UI', system-ui, -apple-system, sans-serif;
  --trans:     0.2s cubic-bezier(.4,0,.2,1);
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header / Navigation (matches /food) ──────────────────── */

.fp-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 0 20px;
  display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-md);
  min-height: 60px; flex-wrap: wrap;
}

.fp-header-left {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}

.fp-back {
  color: rgba(255,255,255,.7);
  font-size: 1.2rem; text-decoration: none;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: all var(--trans);
  background: rgba(255,255,255,.1);
  flex-shrink: 0;
}
.fp-back:hover { background: rgba(255,255,255,.2); color: white; text-decoration: none; }

.fp-title { display: flex; align-items: center; gap: 8px; font-size: .95rem; }
.fp-title-hub { font-weight: 700; }
.fp-title-hub span { color: var(--accent); }
.fp-title-sep { color: rgba(255,255,255,.35); }
.fp-title-name { color: rgba(255,255,255,.8); }

.fp-tabs {
  display: flex; gap: 2px; flex: 1; justify-content: center;
}
.fp-tab {
  background: none; border: none; border-bottom: 2px solid transparent;
  color: rgba(255,255,255,.55);
  padding: 10px 16px; cursor: pointer;
  font: .88rem/1 var(--font); font-weight: 500;
  transition: all var(--trans); min-height: 44px;
  display: flex; align-items: center;
}
.fp-tab:hover { color: rgba(255,255,255,.85); background: rgba(255,255,255,.08); }
.fp-tab.active { color: white; border-bottom-color: var(--accent); }

.fp-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.fp-report-tab {
  background: rgba(232, 131, 90, .18);
  border: 1px solid rgba(232, 131, 90, .3);
  color: var(--accent-light);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font: .78rem/1 var(--font);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--trans);
  text-decoration: none;
  white-space: nowrap;
}
.fp-report-tab:hover {
  background: rgba(232, 131, 90, .3);
  color: white;
  text-decoration: none;
}

/* ── Views ───────────────────────────────────────────────────── */

.view { display: none; padding: 28px 20px 60px; max-width: 960px; margin: 0 auto; }
.view.active { display: block; }
.hidden { display: none !important; }

/* ── Cards ───────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.card h2, .card h3, .card h4 { color: var(--text); margin-bottom: 12px; }

/* ── Stats Grid ──────────────────────────────────────────────── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  text-align: center;
  min-width: 100px;
  flex: 1;
}

.stat-label { display: block; font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .7px; margin-bottom: 3px; }
.stat-value { display: block; font-size: 1.3rem; font-weight: 700; color: var(--primary); margin: 4px 0; }
.stat-sub { display: block; font-size: .72rem; color: var(--muted); }

.stat-card.green .stat-value { color: var(--success); }

/* ── Mini Stats ──────────────────────────────────────────────── */

.batch-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.mini-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  text-align: center;
}

.mini-stat-value { display: block; font-size: 1.25rem; font-weight: 700; color: var(--primary); }
.mini-stat-label { display: block; font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }

/* ── Rate Colors ─────────────────────────────────────────────── */

.rate-good { color: var(--success) !important; }
.rate-bad { color: var(--danger) !important; }
.rate-warn { color: #D97706 !important; }
.rate-great { color: var(--success) !important; text-shadow: 0 0 8px rgba(76,175,130,.3); }

/* ── Forms ───────────────────────────────────────────────────── */

.form-row { display: flex; gap: 12px; margin-bottom: 12px; align-items: flex-end; }
.form-row-2 > .form-group { flex: 1; }
.form-row-3 > .form-group { flex: 1; }
.form-row-4 > .form-group { flex: 1; }

.form-group { display: flex; flex-direction: column; margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: .73rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 5px;
}

input[type="text"],
input[type="number"],
input[type="date"] {
  width: 100%;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 10px;
  border-radius: 6px;
  font-family: var(--font);
  font-size: .87rem;
  background: var(--bg);
  min-height: 40px;
  transition: border-color var(--trans);
}

input:focus { outline: none; border-color: var(--primary); }

.form-group-barcode { flex: 1; }
.barcode-input-row { display: flex; gap: 8px; align-items: flex-end; }
.barcode-input-row input { flex: 1; }
.form-group-barcode input { font-size: 16px; padding: 10px 14px; }

.btn-camera {
  width: 44px; min-height: 44px; padding: 0;
  font-size: 1.3rem; border-radius: var(--radius-sm);
  background: var(--accent-dim); border: 1px solid rgba(232,131,90,.25);
  color: var(--accent); flex-shrink: 0;
  transition: all var(--trans);
}
.btn-camera:hover { background: var(--accent); color: white; }
.btn-camera:active { transform: scale(.95); }

/* Camera modal */
.camera-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 300; padding: 12px;
}
.camera-modal {
  background: #1a1a2e; border-radius: var(--radius);
  overflow: hidden; width: 100%; max-width: 420px;
  box-shadow: 0 12px 48px rgba(0,0,0,.5);
}
.camera-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; color: white; font-weight: 600; font-size: .9rem;
}
.camera-header .btn-ghost { color: rgba(255,255,255,.8); border-color: rgba(255,255,255,.2); }
.camera-header .btn-ghost:hover { color: white; background: rgba(255,255,255,.1); }
.camera-modal video {
  width: 100%; display: block; background: #000;
  max-height: 60vh; object-fit: cover;
}
.camera-status {
  padding: 10px 16px; text-align: center; font-size: .82rem;
  color: rgba(255,255,255,.7); background: rgba(0,0,0,.3);
  font-weight: 500;
}

.form-actions { display: flex; gap: 8px; align-items: center; }

/* ── Buttons ─────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font: inherit;
  font-size: .83rem;
  font-weight: 600;
  transition: all var(--trans);
  white-space: nowrap;
  min-height: 36px;
}

.btn:hover { filter: brightness(.95); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: #3a4f87; }
.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--bg); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { opacity: .9; }
.btn-danger { background: transparent; border: 1px solid var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: white; }
.btn-warning { background: rgba(245,166,35,.12); color: var(--warning); border: 1px solid rgba(245,166,35,.3); }
.btn-warning:hover { background: var(--warning); color: white; }
.btn-sm { padding: 6px 12px; font-size: .8rem; min-height: 32px; }

/* ── Badge ───────────────────────────────────────────────────── */

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
}

.badge-open { background: var(--accent-dim); color: var(--accent); }
.badge-completed { background: var(--success-dim); color: var(--success); }
.badge-archived { background: rgba(107,114,128,.1); color: var(--muted); }

/* ── Batch List ──────────────────────────────────────────────── */

.batch-list h4 { color: var(--muted); margin: 12px 0 8px; font-size: .72rem; text-transform: uppercase; letter-spacing: .6px; font-weight: 700; }

.batch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  cursor: pointer;
  background: var(--surface);
  transition: all var(--trans);
  -webkit-tap-highlight-color: transparent;
}

.batch-row:hover { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(44,62,107,.08); }

.batch-row-name { font-weight: 600; flex: 1; }
.batch-row-meta { font-size: .8rem; color: var(--muted); }

/* ── Activity Log ─────────────────────────────────────────────── */

.activity-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: .84rem;
}
.activity-row:last-child { border-bottom: none; }

.activity-time { color: var(--muted); font-size: .75rem; white-space: nowrap; min-width: 130px; }
.activity-action { flex: 1; }
.activity-batch {
  color: var(--accent);
  cursor: pointer;
  font-size: .78rem;
  font-weight: 600;
}
.activity-batch:hover { text-decoration: underline; }

.rolling-open-notice {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--success-light);
  color: var(--success);
  border-radius: 8px;
  font-size: .85rem;
}

/* ── Batch Header ────────────────────────────────────────────── */

.batch-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.batch-info h2 { margin-bottom: 4px; }
.batch-client { color: var(--muted); font-size: .84rem; margin-left: 8px; }
.batch-dates { color: var(--muted); font-size: .78rem; margin-top: 4px; }
.batch-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── Table ──────────────────────────────────────────────────── */

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .86rem;
}

th, td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

th {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--muted);
  font-weight: 600;
}

.item-done td { opacity: .45; }

.item-actions {
  display: flex;
  gap: 4px;
  white-space: nowrap;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--success);
}

/* ── Active Batch Card ───────────────────────────────────────── */

.active-batch-info h3 { margin-bottom: 4px; }
.active-batch-stats {
  display: flex;
  gap: 16px;
  margin: 8px 0;
  font-size: .85rem;
  color: var(--muted);
  flex-wrap: wrap;
}

.est-date-stat {
  font-weight: 600;
  color: var(--primary);
}
.est-date-stat .est-missing {
  color: var(--muted);
  font-weight: 400;
  font-style: italic;
}

.est-date-editor {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 10px 0 12px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.est-date-editor label {
  font-size: .82rem;
  color: var(--text);
  white-space: nowrap;
  font-weight: 600;
}
.est-date-editor input[type="date"] {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 180px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg);
  color: var(--text);
  font-size: .85rem;
}
.est-date-editor .btn {
  flex: 0 0 auto;
  font-size: .78rem;
  padding: 4px 10px;
  min-height: 28px;
}

/* ── Week Navigation ─────────────────────────────────────────── */

.week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}

.week-nav h2 { flex: 1; text-align: center; }
.week-nav-spacer { width: 8px; }
.period-btn { font-size: .75rem; padding: 4px 10px; min-height: 28px; }
.period-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.day-filter { font-size: .72rem; padding: 3px 8px; min-height: 26px; }
.day-filter.active { background: var(--primary); color: white; border-color: var(--primary); }

.eff-indicator {
  width: 100%; height: 10px; border-radius: 6px; margin-bottom: 14px;
  background: var(--border); transition: all .3s ease;
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 14px 3px rgba(76,175,130,.4), 0 0 32px 6px rgba(76,175,130,.15); }
  50%      { box-shadow: 0 0 24px 6px rgba(76,175,130,.6), 0 0 50px 10px rgba(76,175,130,.25); }
}
.eff-indicator.great {
  animation: pulse-glow 2s ease-in-out infinite;
}

/* ── Report ──────────────────────────────────────────────────── */

.report-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }

.report-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.report-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.report-row span:first-child { color: var(--muted); }
.report-highlight span { font-weight: 600; }

.report-table {
  width: 100%;
  font-size: .82rem;
}

/* ── Modal ───────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20,20,35,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 40px rgba(0,0,0,.22);
  animation: slide-in .15s ease;
}

@keyframes slide-in { from { opacity:0; transform:translateY(-5px) } to { opacity:1; transform:none } }

.modal h3 { margin-bottom: 18px; font-size: 1.05rem; font-weight: 700; }

/* ── Empty State ────────────────────────────────────────────── */

.empty-msg { color: var(--muted); font-style: italic; text-align: center; padding: 40px 20px; font-size: .9rem; }

/* ── Responsive ──────────────────────────────────────────────── */

@media (max-width: 600px) {
  .fp-header { padding: 0 12px; gap: 8px; }
  .fp-title-sep, .fp-title-name { display: none; }
  .fp-tabs { order: 3; width: 100%; border-top: 1px solid rgba(255,255,255,.1); padding: 0; margin: 0; justify-content: stretch; }
  .fp-tab { flex: 1; justify-content: center; padding: 10px 8px; font-size: .82rem; min-height: 40px; }
  .view { padding: 16px 12px 80px; }
  .form-row, .form-row-2, .form-row-3, .form-row-4 { flex-direction: column; }
  .batch-header { flex-direction: column; }
  .batch-actions { width: 100%; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .batch-stats-grid { grid-template-columns: repeat(3, 1fr); }
  .report-grid { grid-template-columns: 1fr; }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { border-radius: var(--radius) var(--radius) 0 0; width: 100%; max-height: 92dvh; padding: 20px 16px; padding-bottom: max(20px, env(safe-area-inset-bottom)); }
  .week-nav { flex-wrap: wrap; gap: 6px; justify-content: center; }
  .week-nav h2 { flex: none; width: 100%; order: -1; font-size: 1rem; }
  .week-nav-spacer { display: none; }

  .active-batch-stats { flex-direction: column; gap: 4px; }
  .est-date-editor { flex-direction: column; align-items: stretch; gap: 6px; }
  .est-date-editor label { white-space: normal; }
  .est-date-editor input[type="date"] { max-width: 100%; flex: 1 1 auto; }
}

/* ── Charts ──────────────────────────────────────────────────── */

.chart-container {
  position: relative;
  height: 260px;
  width: 100%;
}

.chart-container--compact {
  height: 100px;
  width: 100%;
}

/* ── Rate Trend Card (two-column) ─────────────────────────── */

.rate-trend-layout {
  display: flex;
  gap: 16px;
  align-items: stretch;
}
.rate-trend-main {
  flex: 3;
  min-width: 0;
}
.rate-trend-avg {
  flex: 1;
  min-width: 130px;
  max-width: 180px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 14px 10px;
  text-align: center;
}
.avg-rate-label {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 4px;
}
.avg-rate-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}
.avg-rate-comp {
  font-size: .72rem;
  color: var(--muted);
  margin-top: 4px;
}

@media (max-width: 600px) {
  .rate-trend-layout {
    flex-direction: column;
  }
  .rate-trend-avg {
    max-width: none;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
  }
  .rate-trend-avg .chart-container--compact {
    height: 60px;
    max-width: 120px;
  }
  .avg-rate-value {
    font-size: 1.2rem;
  }
}

/* ── Print ───────────────────────────────────────────────────── */

@media print {
  .fp-header, .batch-actions, .btn, #scan-entry-card, #batch-select-area,
  .form-actions { display: none !important; }
  body { background: #fff; color: #000; }
  .card { border: none; box-shadow: none; }
  .view { display: block !important; }
  #view-batch { display: block !important; }
  #batch-work-area { display: block !important; }
  #batch-report-card { display: block !important; }
  .report-row span:first-child { color: #333; }
  .rate-good { color: #2e7d32 !important; }
  .rate-bad { color: #c62828 !important; }
  .rate-warn { color: #B45309 !important; }
  .rate-great { color: #2e7d32 !important; text-shadow: 0 0 4px rgba(76,175,130,.3); }
}
.item-selected { background: rgba(99, 102, 241, 0.15) !important; }
.select-col { width: 32px; text-align: center; }
.item-priority { background: rgba(245, 158, 11, 0.08); }
.pri-star { cursor: pointer; font-size: 1.15rem; color: var(--border); transition: color var(--trans); display: inline-block; padding: 2px; }
.pri-star.active { color: #F59E0B; }
.pri-star:hover { color: #F59E0B; }
.pri-col { width: 32px; text-align: center; }

/* ── Toast notifications ──────────────────────────────────── */

#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--primary);
  color: white;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: .84rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  animation: toast-in .25s ease, toast-out .25s ease forwards;
  animation-delay: 0s, 2.5s;
  pointer-events: auto;
  max-width: 360px;
}
.toast.toast-success { background: var(--success); }
.toast.toast-error { background: var(--danger); }
.toast.toast-warning { background: var(--warning); color: var(--text); }

@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(10px); } }

/* ── Scan flash animation ─────────────────────────────────── */

.scan-flash {
  animation: scan-flash .5s ease;
}
@keyframes scan-flash {
  0%   { border-color: var(--success); box-shadow: 0 0 0 3px var(--success-dim); }
  100% { border-color: var(--border); box-shadow: none; }
}

/* ── Scan Card Improvements ──────────────────────────────── */

.scan-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.scan-card-header h3 { margin-bottom: 0; }

.scan-session-stats {
  font-size: .8rem;
  color: var(--muted);
  background: var(--bg);
  padding: 4px 10px;
  border-radius: 99px;
  font-weight: 600;
}
.scan-session-stats span {
  color: var(--primary);
  font-size: 1rem;
}

.last-scanned-preview {
  background: linear-gradient(135deg, var(--success-dim) 0%, rgba(76,175,130,.06) 100%);
  border-left: 3px solid var(--success);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 14px;
  animation: slide-in .3s ease;
}
.last-scanned-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--success);
  font-weight: 700;
  margin-bottom: 2px;
}
.last-scanned-barcode {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  font-family: 'SF Mono', monospace;
}
.last-scanned-meta {
  font-size: .78rem;
  color: var(--muted);
  margin-top: 2px;
}

.scan-options-row {
  display: flex;
  gap: 16px;
  margin: 10px 0 14px;
  flex-wrap: wrap;
}
.scan-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.scan-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.btn-lg {
  padding: 10px 22px;
  font-size: .95rem;
}

/* ── Row highlight for new items ─────────────────────────── */

.row-highlight {
  animation: row-glow 2.5s ease forwards;
}
@keyframes row-glow {
  0%   { background: rgba(76, 175, 130, .25); }
  60%  { background: rgba(76, 175, 130, .12); }
  100% { background: transparent; }
}

/* ── Enhanced scan flash ─────────────────────────────────── */

.scan-flash {
  animation: scan-flash .6s ease;
}
@keyframes scan-flash {
  0%   { border-color: var(--success); box-shadow: 0 0 0 4px var(--success-dim), 0 0 20px rgba(76,175,130,.3); }
  50%  { border-color: var(--success); box-shadow: 0 0 0 4px var(--success-dim), 0 0 30px rgba(76,175,130,.5); }
  100% { border-color: var(--border); box-shadow: none; }
}

/* ── Scan details expander ────────────────────────────────── */

.details-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: .78rem;
  font-weight: 600;
  transition: color var(--trans);
  margin-bottom: 10px;
}
.details-toggle:hover { color: var(--primary); }
.details-toggle .arrow { transition: transform var(--trans); display: inline-block; font-size: .7rem; }
.details-toggle.open .arrow { transform: rotate(90deg); }

.scan-details { overflow: hidden; transition: max-height .25s ease, opacity .2s ease; }
.scan-details.collapsed { max-height: 0; opacity: 0; margin-bottom: 0; }
.scan-details.expanded { max-height: 300px; opacity: 1; }

/* ── Items search bar ─────────────────────────────────────── */

.items-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.items-search {
  flex: 1;
  max-width: 280px;
}
.items-search input { width: 100%; }
.item-count-filtered { font-size: .75rem; color: var(--muted); white-space: nowrap; }

/* ── Items header row ─────────────────────────────────────── */

.items-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.items-header-row h3 { margin-bottom: 0; }
.items-header-actions { display: flex; gap: 6px; }

/* ── Batch Comparison Card ───────────────────────────────── */

.comparison-card { border-left: 4px solid var(--accent); }
.comparison-grid { display: grid; gap: 2px; }
.comparison-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: .92rem;
}
.comparison-row:last-child { border-bottom: none; }
.comparison-row span:first-child { color: var(--muted); font-weight: 500; }
.comparison-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.comparison-difference { font-size: 1.05rem; padding-top: 12px; margin-top: 4px; border-top: 2px solid var(--border); border-bottom: none; }
.comparison-difference .comparison-value { font-size: 1.25rem; }

/* ── Batch Switcher ──────────────────────────────────────── */

.batch-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.batch-title-row h2 { margin-bottom: 0; }

.batch-switcher {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: .82rem;
  color: var(--text);
  cursor: pointer;
  min-width: 160px;
  max-width: 260px;
}
.batch-switcher:focus { outline: none; border-color: var(--primary); }

/* ── Weekly Batch Breakdown ──────────────────────────────── */

.breakdown-row { padding: 10px 0; border-bottom: 1px solid var(--border-light); font-size: .84rem; }
.breakdown-row:last-child { border-bottom: none; }
.breakdown-name { font-weight: 600; margin-bottom: 3px; }
.breakdown-meta { color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.breakdown-diff { font-weight: 700; }
.breakdown-diff.positive { color: var(--success); }
.breakdown-diff.negative { color: var(--danger); }

/* ════════════════════════════════════════════════════════════════
   SNAZZY UPGRADES
   ════════════════════════════════════════════════════════════════ */

/* ── Card hover lift ───────────────────────────────────────── */
.card {
  transition: transform var(--trans), box-shadow var(--trans);
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ── Smooth view transitions ───────────────────────────────── */
.view {
  animation: fade-in-up .35s cubic-bezier(.4,0,.2,1);
}
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* ── Stat card glow-ups ────────────────────────────────────── */
.stat-card {
  position: relative;
  overflow: hidden;
  transition: transform var(--trans), box-shadow var(--trans);
  border: none;
  box-shadow: var(--shadow);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity var(--trans);
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.stat-card:hover::before {
  opacity: 1;
}
.stat-card .stat-value {
  background: linear-gradient(135deg, var(--primary) 0%, #4a5d8f 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-card.green .stat-value {
  background: linear-gradient(135deg, var(--success) 0%, #3d9e70 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Mini stat cards ───────────────────────────────────────── */
.mini-stat {
  position: relative;
  overflow: hidden;
  border: none;
  box-shadow: var(--shadow);
  transition: transform var(--trans), box-shadow var(--trans);
}
.mini-stat::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  opacity: 0.3;
  transition: opacity var(--trans);
}
.mini-stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.mini-stat:hover::before {
  opacity: 1;
}

/* ── Input focus glow ──────────────────────────────────────── */
input[type="text"],
input[type="number"],
input[type="date"],
select,
.batch-switcher {
  transition: border-color var(--trans), box-shadow var(--trans);
}
input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus,
.batch-switcher:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 131, 90, .15);
}

/* ── Table row hover ───────────────────────────────────────── */
table tbody tr {
  transition: background var(--trans);
}
table tbody tr:hover {
  background: rgba(44, 62, 107, .04);
}
.item-done:hover td {
  opacity: .6;
}

/* ── Button press effect ───────────────────────────────────── */
.btn {
  transition: transform .1s ease, filter var(--trans), box-shadow var(--trans);
}
.btn:active {
  transform: scale(.96);
}
.btn-primary {
  box-shadow: 0 4px 14px rgba(44, 62, 107, .25);
}
.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(44, 62, 107, .35);
}
.btn-accent {
  box-shadow: 0 4px 14px rgba(232, 131, 90, .3);
}
.btn-accent:hover {
  box-shadow: 0 6px 20px rgba(232, 131, 90, .4);
}

/* ── Badge glow ────────────────────────────────────────────── */
.badge {
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  transition: transform var(--trans);
}
.badge-open {
  background: linear-gradient(135deg, rgba(232,131,90,.15) 0%, rgba(232,131,90,.08) 100%);
}
.badge-completed {
  background: linear-gradient(135deg, rgba(76,175,130,.15) 0%, rgba(76,175,130,.08) 100%);
}

/* ── Batch row hover ───────────────────────────────────────── */
.batch-row {
  position: relative;
  overflow: hidden;
  border: none;
  box-shadow: var(--shadow);
}
.batch-row::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: 0;
  transition: opacity var(--trans);
}
.batch-row:hover::before {
  opacity: 1;
}

/* ── Progress bar ──────────────────────────────────────────── */
.progress-wrap {
  background: var(--bg);
  border-radius: 99px;
  height: 10px;
  overflow: hidden;
  margin: 8px 0 4px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.06);
}
.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-light) 100%);
  transition: width .6s cubic-bezier(.4,0,.2,1);
  position: relative;
  overflow: hidden;
}
.progress-fill::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.25) 50%, transparent 100%);
  animation: shimmer 2s infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.progress-label {
  font-size: .75rem;
  color: var(--muted);
  text-align: right;
}

/* ── Comparison card accent ────────────────────────────────── */
.comparison-card {
  border-left: 4px solid var(--accent);
  position: relative;
  overflow: hidden;
}
.comparison-card::after {
  content: '';
  position: absolute;
  top: -50%; right: -50%;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(232,131,90,.06) 0%, transparent 70%);
  pointer-events: none;
}
.comparison-difference .comparison-value {
  text-shadow: 0 2px 8px rgba(0,0,0,.06);
}

/* ── Custom scrollbar ──────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ── Tab active underline glow ─────────────────────────────── */
.fp-tab.active {
  text-shadow: 0 0 12px rgba(232, 131, 90, .35);
}

/* ── Toast enhanced ────────────────────────────────────────── */
.toast {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ════════════════════════════════════════════════════════════════
   PAYMENTS SECTION
   ════════════════════════════════════════════════════════════════ */

.payments-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.payments-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.payments-header h2 { margin-bottom: 0; }

.payments-toolbar {
  margin-bottom: 12px;
}

.year-select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: .85rem;
  color: var(--text);
  cursor: pointer;
  min-width: 120px;
}
.year-select:focus { outline: none; border-color: var(--primary); }

.paystub-row {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
  background: var(--surface);
  transition: all var(--trans);
}
.paystub-row:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(44,62,107,.06);
}

.paystub-row-main {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.paystub-date {
  font-weight: 700;
  font-size: .92rem;
  min-width: 100px;
}
.paystub-gross {
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary);
  min-width: 80px;
}
.paystub-base {
  font-size: .85rem;
  color: var(--muted);
  min-width: 70px;
}
.paystub-overpay {
  font-weight: 700;
  font-size: .92rem;
  min-width: 80px;
}

.paystub-row-meta {
  font-size: .78rem;
  color: var(--muted);
  margin-top: 4px;
}

.paystub-row-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.paystub-file-badge {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  font-size: .78rem;
}

.paystub-file-badge .lucide-icon {
  width: 16px;
  height: 16px;
}

.calc-preview {
  display: flex;
  gap: 20px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-size: .88rem;
}
.calc-preview span {
  color: var(--muted);
}
.calc-preview strong {
  color: var(--text);
  font-size: 1rem;
}

/* ── Monthly earnings table ───────────────────────────────── */
#monthly-earnings-table td.muted { color: var(--muted); }
#monthly-earnings-table tbody tr:last-child td { border-bottom: none; font-weight: 700; background: var(--bg); }

/* ── Empty state illustration hint ─────────────────────────── */
.empty-msg {
  opacity: .7;
  letter-spacing: .2px;
}

/* ── Eff Report Modal ──────────────────────── */

.report-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.report-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .88rem;
  transition: background var(--trans);
}
.report-checkbox:hover {
  background: var(--elevated);
}
.report-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
.report-checkbox span {
  font-weight: 500;
}

