/* RL Forge Works — Business app. Dark shop look, orange accent (same family as Foreman). */
:root {
  --bg: #121417;
  --bg2: #181b20;
  --card: #1f232a;
  --card2: #262b33;
  --line: #333a44;
  --text: #f2f4f7;
  --muted: #a3acb9;
  --dim: #77818f;
  --accent: #ff8a1f;
  --accent2: #ffb366;
  --accent-ink: #1a1206;
  --good: #3ecf8e;
  --bad: #ff6b6b;
  --warn: #ffcc4d;
  --blue: #6cb6ff;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(0, 0, 0, .35);
  --nav-h: 68px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px);
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent2); }
.hidden { display: none !important; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px calc(10px) 16px;
  padding-top: calc(10px + env(safe-area-inset-top));
  background: linear-gradient(180deg, rgba(18,20,23,.98), rgba(18,20,23,.92));
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  background: radial-gradient(circle at 30% 25%, #ffd29a, var(--accent) 45%, #b44a00 100%);
  display: grid; place-items: center; color: var(--accent-ink); font-weight: 900; font-size: 15px; letter-spacing: -.5px;
  box-shadow: 0 0 18px rgba(255,138,31,.35);
}
.brand-text { min-width: 0; }
.brand-name { font-weight: 800; font-size: 16px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: 12px; color: var(--muted); }
.year-pick {
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 12px; font-weight: 700; font-size: 14px;
}

/* ---------- layout ---------- */
main { max-width: 760px; margin: 0 auto; padding: 16px; }
.screen-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 14px; }
.screen-title h1 { font-size: 24px; margin: 0; letter-spacing: -.3px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 14px;
}
.card h2 { font-size: 17px; margin: 0 0 10px; }
.card h3 { font-size: 15px; margin: 14px 0 6px; color: var(--muted); }
.muted { color: var(--muted); }
.dim { color: var(--dim); font-size: 13px; }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.right { text-align: right; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- hero numbers ---------- */
.hero {
  background: radial-gradient(120% 140% at 0% 0%, rgba(255,138,31,.28), transparent 55%), linear-gradient(160deg, #262018, #1b1e24 60%);
  border: 1px solid #4a3a28; border-radius: 20px; padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.hero-label { color: var(--accent2); font-size: 13px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; }
.hero-big { font-size: clamp(34px, 10vw, 46px); font-weight: 900; letter-spacing: -1px; line-height: 1.05; margin: 4px 0 2px; }
.hero-big.good { color: var(--good); }
.hero-big.bad { color: var(--bad); }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.stat { background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.06); border-radius: 12px; padding: 10px 12px; }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 20px; font-weight: 800; }
@media (min-width: 560px) { .stats { grid-template-columns: repeat(4, 1fr); } }

/* ---------- quick actions ---------- */
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.quick button {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 4px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700;
}
.quick button .ico { font-size: 22px; line-height: 1; }
.quick button:active { transform: scale(.97); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--card2); border-radius: 12px;
  padding: 11px 16px; font-weight: 700; min-height: 44px;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { background: transparent; border-color: #6b2c2c; color: var(--bad); }
.btn.ghost { background: transparent; }
.btn.small { min-height: 34px; padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.fab {
  position: fixed; right: 16px; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 14px); z-index: 25;
  width: 58px; height: 58px; border-radius: 18px; border: 0; background: var(--accent); color: var(--accent-ink);
  font-size: 30px; font-weight: 800; box-shadow: 0 10px 26px rgba(255,138,31,.4);
}

/* ---------- lists ---------- */
.list { display: flex; flex-direction: column; }
.item {
  display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line);
  background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; width: 100%;
}
.item:last-child { border-bottom: 0; }
.item .main { flex: 1; min-width: 0; }
.item .t { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .s { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .amt { font-weight: 800; white-space: nowrap; }
.item .amt.in { color: var(--good); }
.badge { display: inline-block; font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 999px; background: var(--card2); color: var(--muted); border: 1px solid var(--line); vertical-align: 1px; }
.badge.personal { color: #d7a8ff; border-color: #4b3566; }
.badge.warn { color: var(--warn); border-color: #5c4a18; }
.badge.good { color: var(--good); border-color: #1f5a41; }
.badge.accent { color: var(--accent2); border-color: #5a3a17; }
.month-head { font-size: 13px; font-weight: 800; color: var(--accent2); text-transform: uppercase; letter-spacing: .5px; margin: 16px 2px 2px; display: flex; justify-content: space-between; }
.empty { text-align: center; color: var(--muted); padding: 26px 10px; }
.empty .big { font-size: 40px; }

/* ---------- alerts ---------- */
.alert { display: flex; gap: 10px; padding: 12px; border-radius: 12px; background: #2a2413; border: 1px solid #5c4a18; margin-bottom: 10px; font-size: 14px; }
.alert.info { background: #152433; border-color: #22415f; }
.alert.good { background: #122a20; border-color: #1f5a41; }
.alert.bad { background: #2d1717; border-color: #6b2c2c; }
.alert .ico { font-size: 18px; line-height: 1.3; }

/* ---------- forms ---------- */
.field { margin-bottom: 14px; }
.field label, .field .label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.field .req { color: var(--accent); }
.field .hint { font-size: 12.5px; color: var(--dim); margin-top: 5px; }
.input, select.input, textarea.input {
  width: 100%; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; min-height: 48px; outline: none;
}
textarea.input { min-height: 80px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,138,31,.2); }
.input.money { font-size: 24px; font-weight: 800; }
.input-wrap { position: relative; }
.input-wrap .prefix { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 22px; font-weight: 800; }
.input-wrap .input.money { padding-left: 32px; }
.seg { display: flex; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: 0; background: transparent; border-radius: 9px; padding: 9px 6px; font-weight: 700; color: var(--muted); font-size: 14px; }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.switch { width: 50px; height: 30px; border-radius: 99px; background: #3a414c; border: 0; position: relative; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch.on { background: var(--accent); }
.switch.on::after { left: 23px; }
.form-error { background: #2d1717; border: 1px solid #6b2c2c; color: #ffb3b3; border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { border: 1px solid var(--line); background: var(--card2); border-radius: 999px; padding: 6px 11px; font-size: 13px; font-weight: 700; }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* files */
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.thumb { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--bg2); display: grid; place-items: center; font-size: 12px; color: var(--muted); text-align: center; padding: 0; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .x { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.7); color: #fff; font-size: 14px; line-height: 24px; }
.file-btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- sheet (pop-up form) ---------- */
.sheet-back { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet {
  width: 100%; max-width: 640px; max-height: 94vh; overflow: auto; background: var(--bg2); border: 1px solid var(--line);
  border-radius: 22px 22px 0 0; padding: 8px 16px calc(20px + env(safe-area-inset-bottom)); animation: up .2s ease-out;
}
@media (min-width: 700px) { .sheet-back { align-items: center; } .sheet { border-radius: 22px; } }
.sheet-grip { width: 42px; height: 5px; border-radius: 9px; background: #444c58; margin: 6px auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 10px; }
.sheet-head h2 { margin: 0; font-size: 20px; }
.x-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-size: 18px; }
.stamp { font-size: 12px; color: var(--dim); margin: -4px 0 12px; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

/* ---------- bottom nav ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(20,22,26,.97); border-top: 1px solid var(--line); backdrop-filter: blur(8px);
}
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--dim); text-decoration: none; font-size: 11.5px; font-weight: 700; }
.nav a .ico { font-size: 21px; line-height: 1; filter: grayscale(1) brightness(1.2); opacity: .8; }
.nav a.on { color: var(--accent); }
.nav a.on .ico { filter: none; opacity: 1; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 6px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.tabs button { flex: none; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: 14px; color: var(--muted); }
.tabs button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ---------- more menu ---------- */
.menu { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.menu button { text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; min-height: 96px; display: flex; flex-direction: column; gap: 4px; }
.menu .ico { font-size: 24px; }
.menu .t { font-weight: 800; }
.menu .s { font-size: 12.5px; color: var(--muted); }

/* ---------- report ---------- */
.sched { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.sched td { padding: 9px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.sched td.ln { color: var(--accent2); font-weight: 800; width: 3.2em; white-space: nowrap; }
.sched td.amt { text-align: right; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sched tr.total td { border-top: 2px solid var(--accent); border-bottom: 0; font-weight: 900; font-size: 16px; }
.sched .sub { font-size: 12.5px; color: var(--muted); }
details.more { margin-top: 8px; }
details.more summary { cursor: pointer; color: var(--accent2); font-weight: 700; font-size: 14px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding-top: 8px; }
.bars .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bars .pair { display: flex; gap: 2px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.bars .b { width: 42%; max-width: 14px; border-radius: 4px 4px 0 0; min-height: 2px; }
.bars .b.out { background: var(--accent); }
.bars .b.in { background: var(--good); }
.bars .m { font-size: 10.5px; color: var(--dim); }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 24px); transform: translateX(-50%); z-index: 90; background: #f2f4f7; color: #111; font-weight: 700; padding: 11px 18px; border-radius: 12px; box-shadow: var(--shadow); max-width: calc(100vw - 32px); animation: up .2s; }

/* ---------- gps ---------- */
.gps-live { text-align: center; padding: 10px 0; }
.gps-live .miles { font-size: 54px; font-weight: 900; letter-spacing: -1px; }
.pulse { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 rgba(62,207,142,.6); animation: pulse 1.6s infinite; vertical-align: 1px; margin-right: 6px; }
@keyframes pulse { 70% { box-shadow: 0 0 0 12px rgba(62,207,142,0); } 100% { box-shadow: 0 0 0 0 rgba(62,207,142,0); } }

.scan-box { border: 1px dashed #5a3a17; background: #221a10; border-radius: 12px; padding: 10px 12px; font-size: 14px; margin-top: 8px; }

/* ---------- print (year-end report) ---------- */
@media print {
  :root { --bg: #fff; --card: #fff; --text: #000; --muted: #333; --line: #bbb; --accent2: #000; }
  body { background: #fff; color: #000; padding: 0; font-size: 12pt; }
  .topbar, .nav, .fab, .no-print, .toast { display: none !important; }
  main { max-width: none; padding: 0; }
  .card { border: 1px solid #bbb; break-inside: avoid; }
  .hero { background: #fff; border: 1px solid #bbb; box-shadow: none; }
  .print-only { display: block !important; }
}
.print-only { display: none; }

/* RL Forge Works logo in the top bar (brand/rlf-logo.jpg, the exact website logo) */
.brand-logo { height: 72px; width: auto; display: block; }
