/* ============================================================================
   FreshLine — Repack Portal design system
   Fresh-produce operations aesthetic: deep forest sidebar, crisp light content,
   fresh-green primary + lime accent, food-safety semantic colors, soft motion.
   ========================================================================== */

:root {
  /* Brand */
  --green-900: #06251A;
  --green-800: #0A3324;
  --green-700: #0E4631;
  --green-600: #12603F;
  --green-500: #16794A;   /* primary */
  --green-400: #1F9A5E;
  --green-300: #34B978;
  --lime-500:  #84CC16;   /* accent */
  --lime-400:  #A3E635;
  --lime-300:  #BEF264;

  /* Neutrals */
  --ink:       #0F1B16;
  --ink-2:     #2C3A33;
  --muted:     #5C6B63;
  --muted-2:   #8A988F;
  --line:      #E3EAE5;
  --line-2:    #EEF3EF;
  --surface:   #FFFFFF;
  --bg:        #F4F8F5;
  --bg-2:      #EAF1EC;

  /* Semantic — food-safety critical */
  --ok:        #16A34A;
  --ok-bg:     #E7F6ED;
  --warn:      #E89611;
  --warn-bg:   #FCF1DD;
  --danger:    #DC2626;
  --danger-bg: #FBE9E9;
  --info:      #0EA5E9;
  --info-bg:   #E3F4FC;

  /* Effects */
  --radius:    14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(8, 30, 20, 0.06), 0 1px 3px rgba(8, 30, 20, 0.05);
  --shadow:    0 4px 14px rgba(8, 30, 20, 0.07), 0 2px 6px rgba(8, 30, 20, 0.05);
  --shadow-lg: 0 18px 48px rgba(8, 30, 20, 0.16), 0 6px 16px rgba(8, 30, 20, 0.08);
  --shadow-glow: 0 0 0 4px rgba(132, 204, 22, 0.18);

  --sidebar-w: 256px;
  --topbar-h:  64px;
  --ease:      cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --font:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Space Grotesk', var(--font);
  --mono:      'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 14px;
  line-height: 1.5;
}
h1, h2, h3, h4, .display { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; color: var(--ink); margin: 0; }
a { color: var(--green-500); text-decoration: none; }
a:hover { color: var(--green-600); }
::selection { background: var(--lime-300); color: var(--green-900); }
.mono { font-family: var(--mono); font-variant-ligatures: none; }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--muted-2); background-clip: content-box; }

/* ============================================================================
   App shell
   ========================================================================== */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  background: linear-gradient(180deg, var(--green-900) 0%, var(--green-800) 60%, var(--green-700) 100%);
  color: #DCEDE3;
  display: flex; flex-direction: column;
  padding: 18px 14px;
  z-index: 30;
  overflow: hidden;
}
.sidebar::before {
  /* subtle leafy glow */
  content: ''; position: absolute; top: -120px; right: -120px; width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(132,204,22,0.22), transparent 70%);
  pointer-events: none;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 16px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, var(--lime-400), var(--green-400));
  display: grid; place-items: center; box-shadow: 0 6px 16px rgba(132,204,22,0.35);
  flex: none;
}
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 19px; color: #fff; letter-spacing: -0.02em; line-height: 1; }
.brand-sub { font-size: 10.5px; color: #8FBFA4; letter-spacing: 0.14em; text-transform: uppercase; margin-top: 3px; }

.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; overflow-y: auto; flex: 1; padding-right: 2px; }
.nav-section { font-size: 10px; text-transform: uppercase; letter-spacing: 0.13em; color: #6E9C82; margin: 16px 10px 6px; font-weight: 600; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: 10px;
  color: #BBD6C7; font-weight: 500; font-size: 13.5px;
  cursor: pointer; border: none; background: none; width: 100%; text-align: left;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), transform 0.15s var(--ease);
  position: relative;
}
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: 0.85; }
.nav-item:hover { background: rgba(255,255,255,0.07); color: #fff; }
.nav-item.active { background: rgba(132,204,22,0.16); color: #fff; }
.nav-item.active::before {
  content: ''; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 22px; border-radius: 0 4px 4px 0; background: var(--lime-400);
}
.nav-item .nav-badge { margin-left: auto; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--danger); color: #fff; }
.sidebar-foot { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 12px; margin-top: 8px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; }
.user-avatar { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, var(--green-400), var(--green-600)); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; }
.user-name { font-size: 13px; color: #fff; font-weight: 600; }
.user-role { font-size: 11px; color: #8FBFA4; text-transform: capitalize; }
.logout-btn { margin-left: auto; color: #8FBFA4; background: none; border: none; cursor: pointer; padding: 6px; border-radius: 8px; display: grid; place-items: center; }
.logout-btn:hover { color: #fff; background: rgba(255,255,255,0.08); }

/* Main column */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: var(--topbar-h); position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px; padding: 0 26px;
  background: rgba(244, 248, 245, 0.8);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 19px; }
.topbar .crumb { color: var(--muted); font-size: 13px; }
.topbar-spacer { flex: 1; }
.search-box {
  display: flex; align-items: center; gap: 8px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 7px 12px; min-width: 220px;
  color: var(--muted); transition: box-shadow 0.15s, border-color 0.15s;
}
.search-box:focus-within { border-color: var(--green-300); box-shadow: var(--shadow-glow); }
.search-box input { border: none; outline: none; background: none; font-family: var(--font); font-size: 13px; color: var(--ink); width: 100%; }
.bell-btn { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; transition: border-color 0.15s, color 0.15s, background 0.15s; }
.bell-btn:hover { border-color: var(--green-300); color: var(--green-600); }
.bell-btn svg { width: 19px; height: 19px; }
.bell-btn.has-alerts { color: var(--warn); border-color: var(--warn-bg); }
.bell-count { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg); }

.conn-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid var(--line); }
.conn-pill .conn-dot { width: 8px; height: 8px; border-radius: 50%; }
.conn-pill.offline { background: var(--warn-bg); color: #b06f06; border-color: var(--warn-bg); }
.conn-pill.offline .conn-dot { background: var(--warn); }
.conn-pill.syncing { background: var(--info-bg); color: #0369a1; border-color: var(--info-bg); }
.conn-pill.syncing .conn-dot { background: var(--info); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* Time-clock keypad */
.kp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kp-key { font-family: var(--font-display); font-size: 22px; font-weight: 600; color: var(--ink); padding: 18px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; transition: background 0.12s, transform 0.08s, border-color 0.12s; }
.kp-key:hover { background: var(--bg); border-color: var(--green-300); }
.kp-key:active { transform: scale(0.96); }
.kp-key.kp-alt { font-size: 14px; font-weight: 600; color: var(--muted); }
.kp-key.kp-go { font-size: 15px; font-weight: 700; background: var(--green-500); color: #fff; border-color: var(--green-500); }
.kp-key.kp-go:hover { background: var(--green-600); }

.view { padding: 26px; max-width: 1320px; width: 100%; margin: 0 auto; animation: viewIn 0.4s var(--ease-out); }

@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ============================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font); font-weight: 600; font-size: 13.5px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; transition: transform 0.12s var(--ease), box-shadow 0.15s var(--ease), background 0.15s var(--ease), border-color 0.15s; white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--green-500), var(--green-600)); color: #fff; box-shadow: 0 4px 12px rgba(18,96,63,0.28); }
.btn-primary:hover { box-shadow: 0 8px 20px rgba(18,96,63,0.36); transform: translateY(-1px); color: #fff; }
.btn-accent { background: linear-gradient(135deg, var(--lime-400), var(--lime-500)); color: var(--green-900); box-shadow: 0 4px 12px rgba(132,204,22,0.3); }
.btn-accent:hover { box-shadow: 0 8px 20px rgba(132,204,22,0.4); transform: translateY(-1px); }
.btn-ghost { background: var(--surface); color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--green-300); color: var(--green-600); background: var(--line-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-icon { padding: 8px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ============================================================================
   Cards, panels, grids
   ========================================================================== */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.card-head h3 { font-size: 15px; }
.card-head .sub { color: var(--muted); font-size: 12.5px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2,1fr); } .grid-3 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 720px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* KPI stat cards */
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  transition: transform 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out);
}
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat::after { content: ''; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: var(--bg-2); opacity: 0.6; }
.stat-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 12px; position: relative; }
.stat-icon svg { width: 20px; height: 20px; }
.stat-icon.g { background: var(--ok-bg); color: var(--ok); }
.stat-icon.l { background: rgba(132,204,22,0.16); color: #5d8f0f; }
.stat-icon.a { background: var(--warn-bg); color: var(--warn); }
.stat-icon.r { background: var(--danger-bg); color: var(--danger); }
.stat-icon.b { background: var(--info-bg); color: var(--info); }
.stat-value { font-family: var(--font-display); font-size: 30px; font-weight: 600; line-height: 1; letter-spacing: -0.03em; position: relative; }
.stat-label { color: var(--muted); font-size: 12.5px; margin-top: 6px; position: relative; }
.stat-trend { font-size: 11.5px; font-weight: 600; margin-top: 8px; display: inline-flex; align-items: center; gap: 3px; position: relative; }
.stat-trend.up { color: var(--ok); }
.stat-trend.down { color: var(--danger); }

/* ============================================================================
   Badges / pills
   ========================================================================== */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; line-height: 1.4; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-bg); color: #15803d; }
.badge.warn { background: var(--warn-bg); color: #b06f06; }
.badge.danger { background: var(--danger-bg); color: #b91c1c; }
.badge.info { background: var(--info-bg); color: #0369a1; }
.badge.neutral { background: var(--line-2); color: var(--muted); }
.badge.plain::before { display: none; }

/* ============================================================================
   Tables
   ========================================================================== */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data thead th {
  text-align: left; font-weight: 600; color: var(--muted); font-size: 11.5px;
  text-transform: uppercase; letter-spacing: 0.05em; padding: 11px 14px;
  border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; cursor: default;
}
table.data thead th.sortable { cursor: pointer; user-select: none; }
table.data thead th.sortable:hover { color: var(--green-600); }
table.data tbody td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); color: var(--ink-2); }
table.data tbody tr { transition: background 0.12s; }
table.data tbody tr:hover { background: var(--bg); }
table.data tbody tr:last-child td { border-bottom: none; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
.empty-row td { text-align: center; color: var(--muted-2); padding: 36px; }

/* ============================================================================
   Forms
   ========================================================================== */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 11.5px; color: var(--muted); }
.input, select.input, textarea.input {
  font-family: var(--font); font-size: 13.5px; color: var(--ink);
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  outline: none; transition: border-color 0.15s, box-shadow 0.15s; width: 100%;
}
.input:focus, select.input:focus, textarea.input:focus { border-color: var(--green-300); box-shadow: var(--shadow-glow); }
textarea.input { resize: vertical; min-height: 72px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

/* ============================================================================
   Modal / drawer
   ========================================================================== */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(6,37,26,0.45); backdrop-filter: blur(3px);
  display: grid; place-items: center; z-index: 100; padding: 20px; animation: fadeIn 0.2s var(--ease);
}
.modal {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px; max-height: 88vh; display: flex; flex-direction: column; overflow: hidden;
  animation: modalIn 0.28s var(--ease-out);
}
.modal.wide { max-width: 820px; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { font-size: 17px; }
.modal-close { margin-left: auto; background: none; border: none; cursor: pointer; color: var(--muted); padding: 6px; border-radius: 8px; display: grid; place-items: center; }
.modal-close:hover { background: var(--line-2); color: var(--ink); }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 22px; border-top: 1px solid var(--line-2); background: var(--bg); }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ============================================================================
   Toasts
   ========================================================================== */
.toast-host { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast {
  display: flex; align-items: center; gap: 11px; background: var(--surface);
  border: 1px solid var(--line); border-left: 4px solid var(--green-500);
  border-radius: 12px; padding: 13px 16px; box-shadow: var(--shadow-lg); min-width: 280px; max-width: 380px;
  animation: toastIn 0.32s var(--ease-out);
}
.toast.ok { border-left-color: var(--ok); }
.toast.warn { border-left-color: var(--warn); }
.toast.danger { border-left-color: var(--danger); }
.toast.leaving { animation: toastOut 0.25s var(--ease) forwards; }
.toast-icon { width: 22px; height: 22px; flex: none; }
.toast-msg { font-size: 13.5px; color: var(--ink-2); font-weight: 500; }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }

/* ============================================================================
   Utilities
   ========================================================================== */
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.stack { display: flex; flex-direction: column; }
.gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.muted { color: var(--muted); }
.muted-2 { color: var(--muted-2); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.strong { font-weight: 700; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.tabnum { font-variant-numeric: tabular-nums; }
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.page-head .ph-title { font-size: 24px; }
.page-head .ph-sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.page-head .spacer { flex: 1; }

.pill-tabs { display: inline-flex; gap: 4px; background: var(--bg-2); padding: 4px; border-radius: 11px; }
.pill-tab { padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; border: none; background: none; transition: all 0.15s var(--ease); }
.pill-tab.active { background: var(--surface); color: var(--green-600); box-shadow: var(--shadow-sm); }

/* Progress / meters */
.meter { height: 8px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--green-400), var(--lime-400)); transition: width 0.6s var(--ease-out); }
.meter.warn > span { background: linear-gradient(90deg, var(--warn), #f5b942); }
.meter.danger > span { background: linear-gradient(90deg, var(--danger), #f87171); }

/* Skeleton loaders */
.skel { background: linear-gradient(90deg, var(--line-2) 25%, var(--bg-2) 37%, var(--line-2) 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.skel-row { height: 44px; margin-bottom: 8px; }
.skel-stat { height: 116px; }

/* Timeline (traceability chain) */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ''; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item::before { content: ''; position: absolute; left: -23px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--green-400); }
.tl-item.in::before { border-color: var(--info); }
.tl-item.out::before { border-color: var(--lime-500); }

/* Empty states */
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state .es-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--bg-2); display: grid; place-items: center; margin: 0 auto 14px; color: var(--green-400); }
.empty-state h3 { color: var(--ink-2); margin-bottom: 6px; }

/* Mobile: collapse sidebar */
.menu-toggle { display: none; }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: 264px; transform: translateX(-100%); transition: transform 0.3s var(--ease-out); }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .menu-toggle { display: grid; place-items: center; }
  .scrim { position: fixed; inset: 0; background: rgba(6,37,26,0.4); z-index: 25; }
}

.topbar-logout { white-space: nowrap; }
@media (max-width: 560px) {
  .topbar-logout-label { display: none; }   /* icon-only on phones */
  .topbar .search-box { display: none; }     /* free up room for the logout icon */
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ============================================================================
   Professional report document (customer-facing, print-to-PDF)
   ========================================================================== */
.report-doc {
  background: #fff; color: #1a1a1a; max-width: 850px; margin: 0 auto;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 44px 52px 36px; box-shadow: var(--shadow-sm);
  font-family: var(--font); line-height: 1.5;
}
.rd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.rd-brand { display: flex; align-items: center; gap: 14px; }
.rd-logo { width: 50px; height: 50px; border-radius: 13px; background: var(--rd-accent, #16794A); display: grid; place-items: center; flex: none; }
.rd-logo svg { width: 30px; height: 30px; }
.rd-co { font-family: var(--font-display); font-size: 22px; font-weight: 600; color: #111; letter-spacing: -0.02em; line-height: 1.1; }
.rd-tag { font-size: 12px; color: #666; margin-top: 3px; }
.rd-contact { text-align: right; font-size: 11.5px; color: #555; line-height: 1.65; }
.rd-contact .rd-co-sm { font-weight: 700; color: #333; }
.rd-rule { height: 3px; background: var(--rd-accent, #16794A); border-radius: 2px; margin: 18px 0 0; }
.rd-rule.thin { height: 1px; background: var(--line); margin: 22px 0; }
.rd-title { font-family: var(--font-display); font-size: 25px; font-weight: 600; color: #111; margin: 26px 0 2px; letter-spacing: -0.02em; }
.rd-subtitle { font-size: 13px; color: #666; margin-bottom: 20px; }
.rd-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 24px; margin: 18px 0 6px; }
.rd-meta.cols-3 { grid-template-columns: repeat(3, 1fr); }
.rd-meta-k { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em; color: #999; font-weight: 600; }
.rd-meta-v { font-size: 14px; color: #111; font-weight: 600; margin-top: 3px; }
.rd-meta-v.mono { font-family: var(--mono); font-size: 13px; }
.rd-section-h { font-size: 13px; font-weight: 700; color: #111; text-transform: uppercase; letter-spacing: 0.05em; margin: 24px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.rd-doc-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.rd-doc-table th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; color: #888; font-weight: 600; padding: 7px 10px; border-bottom: 1.5px solid #ddd; }
.rd-doc-table td { padding: 8px 10px; border-bottom: 1px solid #eee; color: #222; }
.rd-doc-table td.num, .rd-doc-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.rd-chain { list-style: none; padding: 0; margin: 0; }
.rd-chain li { position: relative; padding: 0 0 14px 22px; font-size: 12.5px; }
.rd-chain li::before { content: ''; position: absolute; left: 4px; top: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--rd-accent, #16794A); }
.rd-chain li.in::before { background: #0EA5E9; }
.rd-chain li::after { content: ''; position: absolute; left: 8px; top: 14px; bottom: 0; width: 1px; background: var(--line); }
.rd-chain li:last-child::after { display: none; }
.rd-chain .rd-chain-t { font-weight: 600; color: #111; }
.rd-chain .rd-chain-m { color: #666; font-size: 11.5px; }
.rd-attest { margin: 26px 0 0; font-size: 11.5px; color: #555; font-style: italic; line-height: 1.6; }
.rd-sign { display: flex; gap: 40px; margin: 34px 0 8px; }
.rd-sign-box { flex: 1; }
.rd-sign-line { border-top: 1px solid #999; padding-top: 6px; font-size: 11px; color: #777; }
.rd-foot { margin-top: 30px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; font-size: 10.5px; color: #999; }

.doc-toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; }

/* Print: render ONLY the report document, as a clean branded page. */
@media print {
  @page { margin: 0.5in; }
  .sidebar, .topbar, .pill-tabs, .page-head, .doc-toolbar, .toast-host, .btn, .stat, .skel { display: none !important; }
  .app { display: block; }
  .main { display: block; }
  .view { padding: 0; max-width: none; animation: none; }
  body { background: #fff; }
  .report-doc { border: none; box-shadow: none; max-width: none; margin: 0; padding: 0; border-radius: 0; }
  .report-doc * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rd-section-h, .rd-doc-table tr { page-break-inside: avoid; }
}
