/* Live Report — Batch-focused: Open / Complete / Turned In */

:root {
  --primary:   #2C3E6B;
  --primary-dark: #1e2d52;
  --accent:    #E8835A;
  --bg:        #F7F5F2;
  --surface:   #FFFFFF;
  --elevated:  #f0ede8;
  --text:      #1E1E2E;
  --muted:     #6B7280;
  --border:    #E5E2DD;
  --border-light: #D5D0C8;
  --green:     #4CAF82;
  --green-dim: rgba(76, 175, 130, .10);
  --red:       #E05555;
  --red-dim:   rgba(224, 85, 85, .10);
  --amber:     #D97706;
  --amber-dim: rgba(217, 119, 6, .10);
  --radius:    16px;
  --radius-sm: 10px;
  --shadow:    0 2px 12px rgba(44,62,107,.06);
  --font:      'Segoe UI', system-ui, -apple-system, sans-serif;
}

*, *::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;
}

/* Header */
.fp-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 6px 24px rgba(44,62,107,.10);
  min-height: 60px;
}
.fp-header-left { display: flex; align-items: center; gap: 10px; }
.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%; background: rgba(255,255,255,.1); flex-shrink: 0;
}
.fp-back:hover { background: rgba(255,255,255,.2); color: white; }
.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); font-weight: 500; }
.fp-header-right { display: flex; align-items: center; gap: 8px; }

.live-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 8px rgba(76,175,130,.6);
}
.live-dot.blink { animation: dot-pulse 1.5s ease-in-out; }
@keyframes dot-pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

.live-text {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--green);
}
.last-update { font-size: .75rem; color: rgba(255,255,255,.55); margin-left: 6px; }

/* Content */
.content { max-width: 960px; margin: 0 auto; padding: 24px 20px 60px; }

/* Status Strip */
.status-strip {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px;
}
.status-chip {
  flex: 1; min-width: 100px; text-align: center;
  padding: 12px 10px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.status-chip.open     { border-left: 3px solid var(--accent); }
.status-chip.completed{ border-left: 3px solid var(--primary); }
.status-chip.turned-in{ border-left: 3px solid var(--green); }
.status-chip.today    { border-left: 3px solid var(--amber); }

.status-chip-val {
  display: block; font-size: 1.5rem; font-weight: 800; color: var(--text);
  line-height: 1.2;
}
.status-chip-label {
  display: block; font-size: .65rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: .5px; font-weight: 600; margin-top: 2px;
}

/* 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-title {
  display: flex; align-items: center; gap: 10px;
  font-size: .95rem; font-weight: 700; color: var(--primary);
  margin-bottom: 16px;
}
.card-icon {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: .9rem;
}
.open-icon { background: rgba(232,131,90,.10); }
.open-icon::after { content: '●'; color: var(--accent); animation: dot-pulse 1.5s infinite; }
.comp-icon { background: var(--green-dim); }
.comp-icon::after { content: '✓'; color: var(--green); font-weight: 700; }
.ti-icon { background: rgba(107,114,128,.08); }
.ti-icon::after { content: '📦'; }

/* Batch Row Card */
.batch-row-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px; margin-bottom: 10px;
  transition: all .2s ease;
}
.batch-row-card:hover { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(44,62,107,.05); }
.batch-row-card.done { border-left: 4px solid var(--green); background: linear-gradient(90deg, rgba(76,175,130,.04) 0%, var(--bg) 40%); }

.brc-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 10px; margin-bottom: 10px;
}
.brc-left { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; flex: 1; }
.brc-name   { font-weight: 700; font-size: .95rem; }
.brc-client { font-size: .78rem; color: var(--muted); }
.brc-date   { font-size: .72rem; color: var(--muted); font-weight: 500; }

.brc-est-row {
  padding: 4px 14px 2px;
}
.brc-est-badge {
  display: inline-block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--accent-dim, rgba(232, 131, 90, .10));
  padding: 4px 12px;
  border-radius: 6px;
  letter-spacing: .3px;
}

.brc-pct {
  font-size: 1.1rem; font-weight: 800; padding: 3px 10px; border-radius: 6px;
  text-align: center; min-width: 60px;
}
.brc-pct.green { color: var(--green); background: rgba(76,175,130,.1); }
.brc-pct.amber { color: var(--amber); background: rgba(217,119,6,.1); }
.brc-pct.red   { color: var(--red);   background: rgba(224,85,85,.1); }

.brc-tag {
  font-size: .65rem; font-weight: 700; letter-spacing: .8px; padding: 3px 10px;
  border-radius: 4px; text-transform: uppercase;
}
.brc-tag.comp { color: var(--primary); background: rgba(44,62,107,.08); }
.brc-tag.ti   { color: var(--green);  background: rgba(76,175,130,.12); }

/* Progress bar */
.brc-bar { margin-bottom: 10px; }
.bp-track {
  background: var(--elevated); border-radius: 99px; height: 6px; overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.04);
}
.bp-fill {
  height: 100%; border-radius: 99px; transition: width .6s ease;
  position: relative; overflow: hidden;
}
.bp-fill.low  { background: linear-gradient(90deg, var(--red) 0%, var(--amber) 100%); }
.bp-fill.half { background: linear-gradient(90deg, var(--amber) 0%, var(--accent) 100%); }
.bp-fill.full { background: var(--green); }
.bp-fill.full::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.3) 50%, transparent 100%);
  animation: shimmer 2s infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); } 100% { transform: translateX(100%); }
}

.brc-bottom {
  display: flex; gap: 16px; flex-wrap: wrap;
}
.brc-stat {
  display: flex; flex-direction: column; gap: 1px;
  padding: 4px 10px; border-radius: 6px; background: var(--surface);
  border: 1px solid var(--border);
  min-width: 80px;
}
.brc-stat-val {
  font-size: .95rem; font-weight: 700; color: var(--text);
}
.brc-stat-label {
  font-size: .65rem; color: var(--muted); text-transform: uppercase; letter-spacing: .4px;
}

/* Empty */
.empty {
  color: var(--muted); font-style: italic; text-align: center;
  padding: 20px; font-size: .88rem;
}

/* ── Expandable Items List ──────────────────────────── */
.items-expand {
  max-height: 0; overflow: hidden;
  transition: max-height .35s ease, margin .25s ease;
  margin-top: 0;
}
.items-expand.open {
  max-height: 6000px;
  margin-top: 12px;
}

.items-summary {
  font-size: .72rem; color: var(--muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: .4px;
  padding: 4px 0 8px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 10px;
}

.items-filter {
  width: 100%; padding: 8px 12px; margin-bottom: 10px;
  border: 1px solid var(--border); border-radius: 8px;
  font-family: var(--font); font-size: .84rem;
  background: var(--surface); color: var(--text);
  outline: none; transition: border-color .2s;
}
.items-filter:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(44,62,107,.08); }
.items-filter::placeholder { color: var(--muted); }

.items-scroll { max-height: 420px; overflow-y: auto; }

.items-group {
  margin-bottom: 8px;
}
.items-group-title {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; padding: 6px 10px; border-radius: 6px;
  margin-bottom: 4px;
}
.items-group-title.open-group {
  background: rgba(232,131,90,.08); color: var(--accent);
}
.items-group-title.done-group {
  background: rgba(76,175,130,.08); color: var(--green);
}

.item-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 5px;
  font-size: .82rem;
  margin-bottom: 2px;
  background: var(--surface);
}
.item-row.item-done {
  background: rgba(76,175,130,.04);
  border-left: 3px solid var(--green);
}
.item-row:not(.item-done) {
  border-left: 3px solid var(--accent);
}
.item-row.item-done .item-status { color: var(--green); }
.item-row:not(.item-done) .item-status { color: var(--muted); }

.item-barcode {
  font-family: 'SF Mono', 'Consolas', monospace; font-weight: 600;
  font-size: .85rem; flex: 0 0 auto; min-width: 130px; color: var(--text);
}
.item-counts { flex: 1; color: var(--muted); font-size: .78rem; }
.item-status {
  font-weight: 700; font-size: .85rem; width: 24px; text-align: center;
}
.pri-star { color: #F59E0B; font-size: .75rem; margin-left: 4px; }

/* Batch card click hint */
.batch-row-card { cursor: pointer; }
.batch-row-card:hover { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(44,62,107,.08); }

/* Skeleton */
.skeleton-card {
  padding: 16px; display: flex; flex-direction: column; gap: 8px;
  background: var(--bg); border-radius: var(--radius-sm); margin-bottom: 10px;
}
.skeleton-bar {
  height: 14px; border-radius: 6px;
  background: linear-gradient(90deg, var(--elevated) 25%, var(--border-light) 50%, var(--elevated) 75%);
  background-size: 400% 100%;
  animation: skel 1.8s ease-in-out infinite;
}
.skeleton-bar.w-60 { width: 60%; }
.skeleton-bar.w-50 { width: 50%; }
@keyframes skel { 0%{background-position:100% 0} 100%{background-position:-100% 0} }

/* Footer */
.footer {
  text-align: center; padding: 16px; color: var(--muted);
  font-size: .75rem; display: flex; justify-content: center; gap: 12px; opacity: .7;
}
.footer span::before { content: '·'; margin-right: 12px; }
.footer span:first-child::before { content: none; }

/* Responsive */
@media (max-width: 640px) {
  .fp-header { padding: 0 14px; }
  .fp-title-sep, .fp-title-name { display: none; }
  .last-update { display: none; }
  .content { padding: 16px 10px 60px; }
  .card { padding: 16px 12px; }
  .status-strip { gap: 4px; }
  .status-chip { padding: 8px 6px; min-width: 65px; }
  .status-chip-val { font-size: 1.1rem; }
  .brc-bottom { gap: 6px; }
  .brc-stat { min-width: 60px; padding: 4px 8px; }
  .brc-stat-val { font-size: .85rem; }
}

@media print {
  .fp-header, .footer { display: none; }
  body { background: #fff; color: #000; }
  .card { border: none; box-shadow: none; break-inside: avoid; }
}
