/* Materials Ledger — construction theme: steel, safety yellow, brick and a blueprint grid. */
:root {
  --bg: #0b0f14;
  --bg-2: #0f151d;
  --panel: #121a24;
  --panel-2: #172231;
  --panel-3: #1d2a3b;
  --line: #243245;
  --line-2: #2f4158;
  --text: #e8eef6;
  --muted: #8b9cb3;
  --accent: #ffb703;
  --accent-2: #fb8500;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #fb7185;
  --blue: #60a5fa;
  --radius: 16px;
  --shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.7);
  --head: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --body: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--body);
  font-size: 15px;
  color: var(--text);
  background:
    radial-gradient(1100px 600px at 90% -10%, rgba(255, 183, 3, 0.07), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(96, 165, 250, 0.07), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 70%);
}
h1, h2, h3, h4 { font-family: var(--head); font-weight: 700; letter-spacing: 0.01em; margin: 0; line-height: 1.1; }
h1 { font-size: 28px; text-transform: uppercase; letter-spacing: 0.04em; }
h2 { font-size: 34px; text-transform: uppercase; letter-spacing: 0.03em; }
h3 { font-size: 18px; text-transform: uppercase; letter-spacing: 0.05em; }
h4 { font-size: 16px; text-transform: uppercase; letter-spacing: 0.05em; }
p { margin: 0 0 8px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.link { font-weight: 600; }
.eyebrow { font-family: var(--head); text-transform: uppercase; letter-spacing: 0.16em; font-size: 12px; color: var(--accent); font-weight: 700; }
.label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.neg { color: var(--bad); }
.pos { color: var(--ok); }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.hint { color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.hint.bad { color: var(--bad); }
.step {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px;
  background: var(--accent); color: #111; font-family: var(--head); font-weight: 800; font-size: 14px; margin-right: 8px; vertical-align: 1px;
}

/* ---------- Sign-in ---------- */
.login { position: fixed; inset: 0; display: grid; grid-template-columns: 1.15fr 0.85fr; z-index: 50; overflow: hidden; background: var(--bg); }
.blueprint {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 183, 3, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 183, 3, 0.08) 1px, transparent 1px);
  background-size: 36px 36px;
  animation: drift 40s linear infinite;
}
@keyframes drift { to { background-position: 360px 360px; } }
.login-art { position: relative; display: flex; align-items: flex-end; justify-content: center; padding: 40px; }
.skyline { width: min(680px, 100%); height: auto; overflow: visible; }
.skyline .b { fill: #17222f; stroke: #2b3b50; stroke-width: 1.5; transform-box: fill-box; transform-origin: bottom; }
.skyline .win { fill: #ffb703; opacity: 0.35; }
.skyline .steel { fill: #ffb703; }
.skyline .cable { stroke: #cbd5e1; stroke-width: 2; }
.skyline .hook { fill: #fb8500; }
.skyline .ground { stroke: #ffb703; stroke-width: 3; }
.skyline .crane { stroke: none; }
.login-card {
  align-self: center; justify-self: center; width: min(420px, calc(100% - 40px)); margin-right: 8vw;
  background: linear-gradient(180deg, rgba(23, 34, 49, 0.92), rgba(15, 21, 29, 0.96));
  border: 1px solid var(--line-2); border-radius: 22px; padding: 30px; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  position: relative; z-index: 2;
}
.login-card::before {
  content: ''; position: absolute; left: 30px; right: 30px; top: -1px; height: 4px; border-radius: 0 0 4px 4px;
  background: repeating-linear-gradient(-45deg, var(--accent) 0 12px, #111 12px 24px);
}
.login-brand { display: flex; gap: 14px; align-items: center; margin-bottom: 22px; }
.login-title { font-family: var(--head); font-size: 32px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em; line-height: 1; }
.login-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.login-note { min-height: 20px; color: var(--muted); font-size: 13px; text-align: center; margin-top: 12px; }
.login-card .form { gap: 14px; }

/* Brick mark (logo) */
.mark { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; width: 46px; height: 46px; padding: 6px; border-radius: 12px; background: #111820; border: 1px solid var(--line-2); flex: none; }
.mark span { border-radius: 3px; background: linear-gradient(135deg, #ffd166, #fb8500); box-shadow: inset 0 -2px 0 rgba(0,0,0,0.25); }
.mark span:nth-child(3) { grid-column: 1 / 2; }
.mark span:nth-child(4) { grid-column: 2 / 3; }
.mark span:nth-child(5) { grid-column: 1 / 2; }
.mark span:nth-child(6) { grid-column: 2 / 3; }
.mark.small { width: 38px; height: 38px; gap: 3px; padding: 5px; border-radius: 10px; }
.mark.small span { border-radius: 2px; }

/* ---------- Form controls ---------- */
.form { display: flex; flex-direction: column; gap: 12px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; justify-content: flex-end; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.field em { font-style: normal; color: var(--accent); text-transform: none; letter-spacing: 0; }
.field.compact { gap: 4px; }
.span-2 { grid-column: span 2; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--bg-2); border: 1px solid var(--line-2);
  border-radius: 12px; padding: 11px 13px; width: 100%; min-width: 0; outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 183, 3, 0.16); background: #0c121a; }
input[type=number] { font-variant-numeric: tabular-nums; }
select.select, .select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
select.compact, .select.compact, input.compact { padding: 9px 12px; width: auto; min-width: 150px; }
.search { min-width: 230px; background-image: none; }
.grid-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.row-gap { display: flex; gap: 10px; align-items: center; }
.row-gap .select { flex: 1; }
.form-error { color: var(--bad); background: rgba(251, 113, 133, 0.1); border: 1px solid rgba(251, 113, 133, 0.35); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.check-row { display: flex; flex-wrap: wrap; gap: 8px; }
.check { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 999px; cursor: pointer; background: var(--panel-2); }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.check span { display: inline-flex; gap: 6px; align-items: center; }
.segmented { display: inline-flex; gap: 0; margin-top: 14px; padding: 4px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 14px; }
.seg { position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: 9px 16px; border-radius: 10px; color: var(--muted); font-weight: 600; cursor: pointer; transition: all .2s; }
.seg input:checked + span { background: var(--accent); color: #111; box-shadow: 0 6px 18px -6px rgba(255,183,3,.6); }
.file-drop { display: flex; flex-direction: column; gap: 4px; padding: 18px; border: 1.5px dashed var(--line-2); border-radius: 14px; cursor: pointer; text-align: center; color: var(--text); transition: border-color .2s, background .2s; }
.file-drop:hover { border-color: var(--accent); background: rgba(255,183,3,.05); }
.file-drop small { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--head); font-weight: 700; font-size: 16px; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 10px 18px; border-radius: 12px; border: 1px solid transparent; cursor: pointer; color: var(--text);
  background: var(--panel-3); transition: transform .15s ease, box-shadow .2s, background .2s, border-color .2s, color .2s;
  white-space: nowrap; text-decoration: none; position: relative; overflow: hidden;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 14px; }
.btn-primary { background: linear-gradient(180deg, #ffc233, #f59e0b); color: #111; box-shadow: 0 10px 24px -12px rgba(255,183,3,.7); }
.btn-primary:hover { box-shadow: 0 14px 30px -12px rgba(255,183,3,.85); }
.btn-accent { background: linear-gradient(180deg, #ff9f1c, #fb6f00); color: #120a00; box-shadow: 0 10px 24px -12px rgba(251,133,0,.8); }
.btn-accent:hover { box-shadow: 0 14px 30px -10px rgba(251,133,0,.9); }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { background: var(--panel-2); border-color: var(--muted); }
.btn-danger { background: var(--bad); color: #22070d; }
.btn-danger-ghost { background: transparent; border-color: rgba(251,113,133,.45); color: var(--bad); }
.btn-danger-ghost:hover { background: rgba(251,113,133,.1); }
.btn::after {
  content: ''; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.22) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .6s ease;
}
.btn:hover::after { transform: translateX(120%); }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--text); cursor: pointer; transition: all .15s; flex: none; text-decoration: none;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); text-decoration: none; }
.icon-btn.danger:hover { border-color: var(--bad); color: var(--bad); }
.menu-btn { display: none; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; margin-right: 4px; }
.chip {
  font: inherit; font-size: 14px; font-weight: 600; color: var(--text); background: var(--panel-2); border: 1px solid var(--line-2);
  padding: 7px 14px; border-radius: 999px; cursor: pointer; transition: all .2s;
}
.chip:hover { border-color: var(--accent); }
.chip.active { background: var(--accent); color: #111; border-color: var(--accent); box-shadow: 0 6px 16px -8px rgba(255,183,3,.8); }

/* ---------- Shell ---------- */
#app { display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: 100vh; position: relative; z-index: 1; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 22px 16px;
  background: linear-gradient(180deg, #111a25, #0c1219); border-right: 1px solid var(--line); overflow-y: auto;
}
.sidebar::after { content: ''; position: absolute; top: 0; right: -1px; width: 1px; height: 100%; background: linear-gradient(180deg, transparent, var(--accent), transparent); opacity: .3; }
.brand { display: flex; gap: 12px; align-items: center; padding: 4px 8px 14px; border-bottom: 1px dashed var(--line-2); }
.brand-name { font-family: var(--head); font-weight: 800; font-size: 20px; text-transform: uppercase; letter-spacing: .03em; line-height: 1; }
.brand-sub { font-size: 12px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin-top: 3px; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-section { font-family: var(--head); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: #5f7187; margin: 14px 10px 6px; font-weight: 700; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  color: #b8c6d8; font-weight: 500; transition: background .2s, color .2s, transform .2s;
}
.nav-link i { font-size: 17px; color: #7c8fa6; transition: color .2s; }
.nav-link:hover { background: rgba(255,255,255,.04); color: var(--text); text-decoration: none; transform: translateX(3px); }
.nav-link:hover i { color: var(--accent); }
.nav-link.active { background: linear-gradient(90deg, rgba(255,183,3,.18), rgba(255,183,3,.02)); color: var(--text); font-weight: 600; }
.nav-link.active i { color: var(--accent); }
.nav-link.active::before { content: ''; position: absolute; left: -16px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.user { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: #111; font-family: var(--head); font-weight: 800; flex: none; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 16px 28px;
  background: rgba(11, 15, 20, .72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
.crumb { min-width: 0; flex: 1; }
.crumb-section { font-family: var(--head); font-size: 12px; text-transform: uppercase; letter-spacing: .16em; color: var(--accent); font-weight: 700; }
.crumb h1 { font-size: 26px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; gap: 10px; }
.hazard {
  height: 8px; background: repeating-linear-gradient(-45deg, var(--accent) 0 18px, #14110a 18px 36px);
  background-size: 51px 51px; opacity: .9; animation: hazard 2.2s linear infinite;
}
@keyframes hazard { to { background-position: 51px 0; } }
#view { padding: 26px 28px 60px; min-width: 0; outline: none; }
.view { min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 0 0 18px; }
.page-head p { margin: 0; }
.page-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.loading { display: grid; place-items: center; min-height: 40vh; }
.loader { display: flex; gap: 6px; }
.loader span { width: 18px; height: 14px; border-radius: 3px; background: linear-gradient(135deg, #ffd166, #fb8500); animation: brick 1s ease-in-out infinite; }
.loader span:nth-child(2) { animation-delay: .15s; }
.loader span:nth-child(3) { animation-delay: .3s; }
@keyframes brick { 0%, 100% { transform: translateY(0); opacity: .45; } 50% { transform: translateY(-10px); opacity: 1; } }
.empty, .empty-mini { text-align: center; color: var(--muted); padding: 34px 16px; }
.empty-mini { padding: 18px 8px; font-size: 14px; }
.empty p { margin: 8px 0 14px; }
.empty-icon { font-size: 40px; color: var(--accent); opacity: .85; }
.empty-mini a { font-weight: 600; }

/* ---------- Cards, grids, stats ---------- */
.card {
  position: relative; background: linear-gradient(180deg, rgba(23,34,49,.75), rgba(15,21,29,.92));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  transition: border-color .25s, transform .25s; min-width: 0; margin-bottom: 18px;
}
.card:hover { border-color: var(--line-2); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h3 { display: flex; align-items: center; gap: 8px; }
.card-head h3 i { color: var(--accent); }
.table-card { padding: 16px 16px 8px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }
.builder { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 0 22px; align-items: start; }
.builder-side { position: sticky; top: 90px; }
.builder-main .card { margin-bottom: 18px; }
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px; border-left: 3px solid var(--line-2);
}
.stat span { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.stat strong { font-family: var(--head); font-size: 24px; font-weight: 700; }
.stat.accent { border-left-color: var(--accent); }
.stat.ok { border-left-color: var(--ok); }
.stat.warn { border-left-color: var(--warn); }
.stat.bad { border-left-color: var(--bad); }
.kpi {
  position: relative; overflow: hidden; background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: 16px; padding: 16px 16px 14px; box-shadow: var(--shadow); --c: var(--accent);
  transition: transform .25s, border-color .25s;
}
.kpi:hover { transform: translateY(-3px); border-color: var(--c); }
.kpi::after { content: ''; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, var(--c), transparent 70%); opacity: .18; }
.kpi-amber { --c: #ffb703; } .kpi-green { --c: #34d399; } .kpi-red { --c: #fb7185; } .kpi-blue { --c: #60a5fa; } .kpi-violet { --c: #c084fc; } .kpi-slate { --c: #94a3b8; }
.kpi-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); font-size: 18px; margin-bottom: 12px; }
.kpi-label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.kpi-value { font-family: var(--head); font-size: 26px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-bar { height: 3px; border-radius: 3px; background: var(--line); margin-top: 12px; overflow: hidden; }
.kpi-bar span { display: block; height: 100%; width: 0; background: var(--c); border-radius: 3px; transition: width 1.1s cubic-bezier(.2,.8,.2,1); }
.chart-box { position: relative; height: 280px; }
.chart-donut { height: 280px; }

/* Hero */
.hero {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 20px; align-items: center;
  background: linear-gradient(120deg, #15202d 0%, #0d131b 70%); border: 1px solid var(--line-2); border-radius: 22px;
  padding: 26px 26px 22px 30px; margin-bottom: 18px; overflow: hidden; box-shadow: var(--shadow);
}
.hero::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: repeating-linear-gradient(-45deg, var(--accent) 0 10px, #14110a 10px 20px); }
.hero h2 { margin: 6px 0 4px; }
.hero-tag { color: var(--muted); }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.hero-art { position: relative; }
.hero-svg { width: 100%; height: auto; border-radius: 14px; }
.hero-blocks .hb { fill: #1c2839; stroke: #2e4058; stroke-width: 1; transform-box: fill-box; transform-origin: bottom; animation: rise 1.2s cubic-bezier(.2,.8,.2,1) both; }
.hero-blocks .hb:nth-child(2) { animation-delay: .1s; } .hero-blocks .hb:nth-child(3) { animation-delay: .2s; }
.hero-blocks .hb:nth-child(4) { animation-delay: .3s; } .hero-blocks .hb:nth-child(5) { animation-delay: .4s; }
@keyframes rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.hero-windows .hw { fill: #ffb703; opacity: .55; animation: flicker 4s ease-in-out infinite; }
.hero-windows .hw:nth-child(3n) { animation-delay: -1.3s; }
.hero-windows .hw:nth-child(4n) { animation-delay: -2.1s; }
@keyframes flicker { 0%, 100% { opacity: .15; } 50% { opacity: .75; } }
.hero-crane .cr { fill: #ffb703; }
.hero-crane .cr-brace { stroke: #ffb703; stroke-width: 3; fill: none; }
.hero-crane .cable { stroke: #cbd5e1; stroke-width: 1.5; }
.hero-hook { transform-box: view-box; transform-origin: 130px 27px; animation: sway 5s ease-in-out infinite; }
@keyframes sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
.hero-ground { stroke: #ffb703; stroke-width: 2; opacity: .7; }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list li { border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 6px; border-radius: 10px; color: var(--text); transition: background .2s; }
.list-row:hover { background: rgba(255,255,255,.03); text-decoration: none; }
.list-row.stack { flex-direction: column; align-items: stretch; gap: 8px; }
.list-row .right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.bar { height: 8px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 999px; transition: width 1s cubic-bezier(.2,.8,.2,1); }
.bar-warn span { background: linear-gradient(90deg, #fde68a, #fb8500); }
.bar-bad span { background: linear-gradient(90deg, #fca5a5, var(--bad)); }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-ok { color: #6ee7b7; background: rgba(52,211,153,.12); border-color: rgba(52,211,153,.3); }
.pill-warn { color: #fde68a; background: rgba(251,191,36,.12); border-color: rgba(251,191,36,.3); }
.pill-bad { color: #fda4af; background: rgba(251,113,133,.12); border-color: rgba(251,113,133,.3); }
.pill-muted { color: var(--muted); background: rgba(148,163,184,.1); border-color: var(--line-2); }
.mini-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); background: var(--panel-3); border: 1px solid var(--line-2); padding: 3px 9px; border-radius: 8px; }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table th { font-family: var(--head); font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; text-align: left; padding: 10px 12px; background: var(--panel); border-bottom: 1px solid var(--line-2); position: sticky; top: 0; }
.table th.num { text-align: right; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: rgba(255,183,3,.035); }
.table tbody tr[hidden] { display: none; }
.table tfoot th { color: var(--text); background: var(--panel-2); border-top: 1px solid var(--line-2); }
.table td.actions, .table th:last-child:empty { width: 1%; white-space: nowrap; text-align: right; }
.table td.actions .icon-btn { margin-left: 4px; }
.table a { font-weight: 600; }
.row-bad td { background: rgba(251,113,133,.05); }
.neg { color: var(--bad); }
.table tr.kind-opening td { color: var(--muted); }
.table tr.kind-payment td:first-child { border-left: 3px solid var(--ok); }
.table tr.kind-invoice td:first-child, .table tr.kind-purchase td:first-child { border-left: 3px solid var(--accent); }
.search-wrap { position: relative; }
.search { font-size: 14px; padding: 9px 13px; }

/* Picker tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tile {
  --hue: #ffb703; position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left;
  padding: 14px; border-radius: 16px; border: 1px solid var(--line-2); background: linear-gradient(180deg, var(--panel-2), var(--bg-2));
  color: var(--text); font: inherit; cursor: pointer; transition: transform .2s, border-color .2s, box-shadow .2s, background .2s; overflow: hidden;
}
.tile::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--hue); opacity: .55; transition: opacity .2s; }
.tile:hover { transform: translateY(-3px); border-color: var(--hue); }
.tile.active { border-color: var(--hue); background: linear-gradient(180deg, color-mix(in srgb, var(--hue) 22%, var(--panel-2)), var(--bg-2)); box-shadow: 0 14px 30px -16px var(--hue); }
.tile.active::before { opacity: 1; }
.tile-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: color-mix(in srgb, var(--hue) 18%, transparent); color: var(--hue); font-size: 19px; margin-bottom: 6px; }
.tile-name { font-family: var(--head); font-weight: 700; font-size: 17px; text-transform: uppercase; letter-spacing: .03em; }
.tile-unit { font-size: 12.5px; color: var(--muted); }
.picked { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding: 10px 14px; border-radius: 12px; background: rgba(255,183,3,.07); border: 1px dashed rgba(255,183,3,.35); font-size: 14px; }
.picked i { color: var(--accent); }
.picked.picked-empty { background: var(--bg-2); border-color: var(--line-2); color: var(--muted); }
.add-line { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 12px; align-items: end; margin-top: 16px; }
.readout { font-family: var(--head); font-size: 20px; font-weight: 700; padding: 10px 13px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line-2); font-variant-numeric: tabular-nums; }
.add-line .btn { height: 44px; }

/* Bill lines and totals */
.lines { display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow-y: auto; padding-right: 2px; }
.line {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 10px 10px 10px 14px; border-radius: 12px;
  background: var(--bg-2); border: 1px solid var(--line); border-left: 3px solid var(--hue);
  animation: pop .35s cubic-bezier(.2,.8,.2,1);
}
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.line-total { font-family: var(--head); font-weight: 700; font-size: 17px; }
.totals .totals-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.totals .totals-row span { color: var(--muted); font-size: 14px; }
.totals .totals-row strong { font-size: 16px; }
.totals .totals-row.big { border-bottom: 0; padding: 14px 0 6px; }
.totals .totals-row.big span { color: var(--text); font-family: var(--head); font-size: 18px; text-transform: uppercase; letter-spacing: .04em; }
.totals .totals-row.big strong { font-family: var(--head); font-size: 30px; color: var(--accent); }
.totals-input input { width: 170px; text-align: right; padding: 8px 11px; font-weight: 600; }
.totals-note { font-size: 13px; color: var(--muted); min-height: 18px; margin: 4px 0 12px; }
.totals-note.bad { color: var(--bad); }
.totals-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.totals-actions .btn { flex: 1; }
.customer-card { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.card .totals-actions { margin-top: 4px; }

/* Ledger & parties */
.party-card {
  display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: 18px; background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); color: var(--text); transition: transform .25s, border-color .25s, box-shadow .25s;
}
.party-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 22px 40px -24px rgba(255,183,3,.45); text-decoration: none; }
.party-card[hidden] { display: none !important; }
.party-top { display: flex; gap: 12px; align-items: center; }
.party-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: auto; }
.party-products { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.party-avatar { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: color-mix(in srgb, var(--hue) 22%, var(--panel-3)); color: var(--hue); font-family: var(--head); font-weight: 800; font-size: 17px; flex: none; border: 1px solid color-mix(in srgb, var(--hue) 40%, transparent); }
.party-avatar.big { width: 64px; height: 64px; border-radius: 18px; font-size: 24px; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.ledger-hero {
  display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; padding: 22px;
  border-radius: 20px; background: linear-gradient(120deg, #17243a, #0e1520); border: 1px solid var(--line-2); margin-bottom: 16px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.ledger-hero::after { content: ''; position: absolute; right: -60px; bottom: -60px; width: 220px; height: 220px; border: 22px solid rgba(255,183,3,.08); border-radius: 50%; }
.ledger-id { display: flex; gap: 16px; align-items: center; }
.ledger-id h2 { font-size: 30px; margin: 4px 0 4px; }
.ledger-balance { text-align: right; }
.balance-value { font-family: var(--head); font-size: 40px; font-weight: 800; color: var(--text); line-height: 1; margin: 6px 0; font-variant-numeric: tabular-nums; }
.balance-value.bad { color: #fda4af; }
.balance-value.ok { color: #6ee7b7; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab { position: relative; padding: 10px 14px; color: var(--muted); font-family: var(--head); font-size: 16px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab i { margin-right: 4px; }
.report-tabs { margin-bottom: 14px; }
.range-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; margin-bottom: 16px; }
.range-bar .field { min-width: 150px; }
.range-bar .chip-row { align-items: center; }
.range-bar .page-actions { margin-left: auto; }

/* Stock & prices */
.stock-group, .price-group { padding: 0; overflow: hidden; }
.stock-group .table-wrap, .price-group .table-wrap { padding: 0 6px 8px; }
.group-head { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: linear-gradient(90deg, color-mix(in srgb, var(--hue) 14%, transparent), transparent 70%); border-bottom: 1px solid var(--line); }
.group-head h3 { font-size: 20px; }
.group-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: color-mix(in srgb, var(--hue) 20%, transparent); color: var(--hue); font-size: 20px; }
.group-val { margin-left: auto; text-align: right; }
.group-val strong { display: block; font-family: var(--head); font-size: 22px; }
.stock-bar-col { min-width: 220px; }
.qty-line { display: flex; flex-direction: column; gap: 5px; }
.qty-line .num { text-align: left; }
.rate-cell input { width: 140px; margin-left: auto; text-align: right; padding: 8px 10px; }
.table tr.changed td { background: rgba(255,183,3,.07); }
.savebar {
  position: sticky; bottom: 14px; z-index: 15; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 18px; padding: 12px 14px 12px 18px; border-radius: 16px; background: rgba(23,34,49,.94); border: 1px solid var(--accent);
  box-shadow: 0 20px 40px -18px rgba(255,183,3,.5); backdrop-filter: blur(8px); animation: rise-in .35s cubic-bezier(.2,.8,.2,1);
}
@keyframes rise-in { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.savebar[hidden] { display: none !important; }

/* Invoice on screen */
.invoice-stage { max-width: 880px; margin: 0 auto; }
.invoice-status { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }

/* Settings */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.settings-grid .card { margin-bottom: 18px; }
.danger-title { color: var(--bad); }

/* Paper documents: invoice, statement, report (screen and print) */
.paper {
  background: #fff; color: #111827; border-radius: 6px; padding: 34px 38px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.7);
  font-family: var(--body); position: relative; overflow: hidden;
}
.paper::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 8px; background: repeating-linear-gradient(-45deg, #ffb703 0 14px, #111 14px 28px); }
.paper-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 16px; border-bottom: 3px solid #111; margin-bottom: 16px; }
.paper-brand { font-family: var(--head); font-size: 32px; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; line-height: 1; }
.paper-sub { color: #b45309; font-weight: 600; font-size: 13px; margin-top: 4px; }
.paper-addr { font-size: 13px; color: #374151; margin-top: 6px; line-height: 1.45; }
.paper-title { text-align: right; }
.paper-doc { font-family: var(--head); font-size: 22px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: #b45309; }
.paper-no { font-family: var(--head); font-size: 26px; font-weight: 700; }
.paper-date { font-size: 13px; color: #4b5563; margin-top: 2px; }
.paper-party { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 18px; font-size: 14px; line-height: 1.5; }
.paper .label { color: #6b7280; }
.party-name { font-family: var(--head); font-size: 20px; font-weight: 700; }
.paper-status .big { font-family: var(--head); font-size: 26px; }
.paper-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.paper-table th { text-align: left; font-family: var(--head); text-transform: uppercase; letter-spacing: .05em; font-size: 12px; color: #374151; border-bottom: 2px solid #111; padding: 8px 6px; }
.paper-table td { border-bottom: 1px solid #e5e7eb; padding: 9px 6px; }
.paper-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.paper-totals { margin: 16px 0 0 auto; width: 340px; font-size: 14px; }
.paper-totals > div { display: flex; justify-content: space-between; padding: 6px 4px; border-bottom: 1px solid #e5e7eb; font-variant-numeric: tabular-nums; }
.paper-totals .grand { border-top: 2px solid #111; border-bottom: 0; margin-top: 4px; padding: 10px 6px; background: #fff7d6; font-family: var(--head); font-size: 20px; font-weight: 800; }
.paper-foot { margin-top: 42px; font-size: 12.5px; color: #374151; }
.paper-foot p { text-align: center; margin-top: 18px; }
.paper-foot .sig { display: inline-block; width: 40%; border-top: 1px solid #111; margin-right: 8%; padding-top: 4px; text-align: center; }
.paper.report { padding: 30px 34px; }
.paper.report .stats-row { gap: 8px; }
.paper.report .stat { color: #111; background: #f8fafc; border-color: #e5e7eb; }
.paper.report .stat span { color: #6b7280; }
.paper.report .stat strong { color: #111; }
.paper.report .card { box-shadow: none; background: #fff; border-color: #e5e7eb; }
.paper.report .card-head h3 { color: #111; }
.paper.report .table th { background: #f3f4f6; color: #374151; border-bottom-color: #111; }
.paper.report .table td { border-bottom-color: #e5e7eb; color: #111; }
.paper.report .table a { color: #111; }
.paper.report .card-head i { display: none; }
.paper.report .chart-box { display: none; }
.paper.statement .paper-table td.num { font-weight: 500; }

#print-area { display: none; }
.scrim { display: none; }

/* ---------- Modal, toast ---------- */
#modal-root .modal-backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(4, 7, 11, .66); backdrop-filter: blur(5px);
  display: grid; place-items: center; padding: 18px;
}
.modal {
  width: min(560px, 100%); max-height: calc(100vh - 36px); display: flex; flex-direction: column;
  background: linear-gradient(180deg, #172231, #0f151d); border: 1px solid var(--line-2); border-radius: 20px; box-shadow: 0 40px 90px -30px #000;
  overflow: hidden; position: relative;
}
.modal::before { content: ''; height: 5px; background: repeating-linear-gradient(-45deg, var(--accent) 0 12px, #111 12px 24px); }
.modal.modal-wide { width: min(860px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px 6px; }
.modal-head h3 { font-size: 22px; }
.modal-body { padding: 14px 20px 6px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px 18px; border-top: 1px solid var(--line); margin-top: 10px; }
.confirm-text { font-size: 15px; line-height: 1.5; }
#toast-root { position: fixed; right: 18px; bottom: 18px; z-index: 120; display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 36px)); }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-radius: 14px; background: #161f2b; border: 1px solid var(--line-2);
  box-shadow: 0 18px 40px -16px #000; font-weight: 500; font-size: 14.5px;
}
.toast i { font-size: 18px; }
.toast-ok { border-left: 4px solid var(--ok); } .toast-ok i { color: var(--ok); }
.toast-warn { border-left: 4px solid var(--warn); } .toast-warn i { color: var(--warn); }
.toast-bad { border-left: 4px solid var(--bad); } .toast-bad i { color: var(--bad); }

/* Responsive */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1100px) {
  .builder { grid-template-columns: 1fr; }
  .builder-side { position: static; }
  .grid-2, .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  #app { grid-template-columns: 1fr; }
  /* Phone drawer: closed = off-screen AND hidden (not tappable). Open = on screen. */
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; height: 100vh; height: 100dvh; width: 280px; z-index: 60;
    transform: translateX(-102%); visibility: hidden; box-shadow: 30px 0 60px -30px #000;
    transition: transform .35s cubic-bezier(.2,.8,.2,1), visibility 0s linear .35s;
  }
  .sidebar.open { transform: none; visibility: visible; transition: transform .35s cubic-bezier(.2,.8,.2,1), visibility 0s; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 55; opacity: 0; pointer-events: none; transition: opacity .3s; }
  .scrim.show { opacity: 1; pointer-events: auto; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 12px 16px; }
  .crumb h1 { font-size: 22px; }
  #view { padding: 18px 16px 60px; }
  .hero { grid-template-columns: 1fr; padding: 22px 20px; }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-card { margin: 0 auto; }
  .hide-sm { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi-value { font-size: 22px; }
  .add-line { grid-template-columns: 1fr 1fr; }
  .add-line .field:last-of-type { grid-column: span 2; }
  .grid-form { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .ledger-balance { text-align: left; }
  .search { min-width: 0; width: 100%; }
  .page-actions { width: 100%; }
  .page-actions .search, .page-actions .select { flex: 1 1 100%; }
  .range-bar .page-actions { margin-left: 0; }
  .table th, .table td { padding: 9px 8px; font-size: 13px; }
  .segmented { display: flex; width: 100%; }
  .seg { flex: 1; }
  .seg span { text-align: center; padding: 9px 8px; }
  .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .top-actions .btn { padding: 9px 11px; }
  .paper { padding: 22px 18px; }
  .paper-head { flex-direction: column; }
  .paper-title { text-align: left; }
  .paper-party { flex-direction: column; }
  .paper-totals { width: 100%; }
  .cards-grid { grid-template-columns: 1fr; }
  .party-card { padding: 14px; }
  .ledger-id { flex-direction: column; align-items: flex-start; }
  .balance-value { font-size: 32px; }
  .stock-bar-col { min-width: 150px; }
}

/* Entrance and exit animations. They use `backwards` fill, so the start state applies only while the
   animation runs and nothing stays hidden afterwards (no inline styles, no dependence on a script). */
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(18px) scale(.97); } }
@keyframes pop-out { to { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes rise-in { from { opacity: 0; transform: translateY(16px); } }
@keyframes slide-in { from { opacity: 0; transform: translateX(40px); } }
@keyframes slide-out { to { opacity: 0; transform: translateX(24px); } }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }
@keyframes grow-up { from { transform: scaleY(0); } }
@keyframes grow-across { from { transform: scaleX(0); } }
@keyframes drop-in { from { opacity: 0; transform: translateY(-22px) rotate(-8deg); } }
@keyframes hang { 0%, 100% { transform: translateY(-14px); } 50% { transform: translateY(12px); } }
@keyframes glow { 0%, 100% { opacity: .15; } 50% { opacity: .6; } }

#modal-root .modal-backdrop { animation: fade-in .2s ease backwards; }
#modal-root .modal { animation: pop-in .34s cubic-bezier(.2,1.2,.3,1) backwards; }
#modal-root .modal-backdrop.is-closing { animation: fade-out .2s ease forwards; }
#modal-root .modal-backdrop.is-closing .modal { animation: pop-out .2s ease-in forwards; }
.toast { animation: slide-in .35s cubic-bezier(.2,.8,.2,1) backwards; }
.toast.is-closing { animation: slide-out .3s ease forwards; }
.view .reveal { animation: rise-in .55s cubic-bezier(.2,.8,.2,1) backwards; }
.form-error.shake, .login-card.shake { animation: shake .4s ease; }
.login-card { animation: rise-in .7s .25s cubic-bezier(.2,.8,.2,1) backwards; }
.login-brand .mark span { animation: drop-in .5s cubic-bezier(.3,1.4,.5,1) backwards; }
.login-brand .mark span:nth-child(2) { animation-delay: .08s; }
.login-brand .mark span:nth-child(3) { animation-delay: .16s; }
.login-brand .mark span:nth-child(4) { animation-delay: .24s; }
.login-brand .mark span:nth-child(5) { animation-delay: .32s; }
.login-brand .mark span:nth-child(6) { animation-delay: .4s; }
.blueprint { animation: fade-in 1s ease backwards; }
.skyline .b { animation: grow-up .9s cubic-bezier(.2,.8,.2,1) backwards; }
.skyline .b1 { animation-delay: .05s; }
.skyline .b2 { animation-delay: .17s; }
.skyline .b3 { animation-delay: .29s; }
.skyline .b4 { animation-delay: .41s; }
.skyline .ground { animation: grow-across .8s ease-out backwards; transform-box: fill-box; transform-origin: left; }
.skyline .crane { animation: fade-in .5s ease .2s backwards; }
.skyline .hook { transform-box: fill-box; animation: hang 2.8s ease-in-out infinite; }
.skyline .win { animation: glow 3.2s ease-in-out infinite; }
.skyline .win:nth-child(3n) { animation-delay: -1.1s; }
.skyline .win:nth-child(4n) { animation-delay: -2.2s; }

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

/* Print: only the paper document is shown */
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff !important; color: #000; }
  body::before, .hazard, #app, #modal-root, #toast-root, .login { display: none !important; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block !important; }
  .paper { box-shadow: none; border-radius: 0; padding: 0; background: #fff; color: #000; }
  .paper::before { height: 6px; }
  .paper-table th { color: #000; }
  .paper.report .table, .paper.report .stats-row { display: block; }
}
