:root {
  --brand: #ef6a1a;
  --brand-dark: #cf560f;
  --brand-soft: #fff1e7;
  --bg: #fbf6f2;
  --card: #ffffff;
  --border: #efe3d8;
  --text: #1f2733;
  --muted: #8a8072;
  --ok: #12855a;
  --danger: #d5493f;
  --shadow: 0 1px 2px rgba(30,20,10,.04), 0 10px 30px -16px rgba(120,60,10,.18);
  --shadow-sm: 0 1px 2px rgba(30,20,10,.05);
  --radius: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; line-height: 1.45;
}
a { color: var(--brand); text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,.85); backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border); box-shadow: 0 1px 0 rgba(240,120,20,.12);
  display: flex; align-items: center; gap: 16px; padding: 10px 22px;
}
.topbar .logo-img { height: 30px; display: block; }
.topbar nav { display: flex; gap: 6px; margin-left: auto; align-items: center; }
.topbar nav a, .topbar nav button {
  color: var(--muted); background: transparent; border: 0; font-weight: 600; font-size: 14px;
  padding: 7px 11px; border-radius: 9px; transition: .15s;
}
.topbar nav a:hover, .topbar nav button:hover { color: var(--brand); background: var(--brand-soft); }
.topbar nav .who { color: var(--text); opacity: .55; padding: 0 4px; font-weight: 500; }

.container { max-width: 1000px; margin: 26px auto; padding: 0 20px; }

/* cards */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > * { flex: 1 1 200px; }

/* typography */
h1 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 3px; }
h2 { font-size: 15px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 12px; color: #2c3542; }
h3 { font-size: 15px; font-weight: 700; margin: 18px 0 8px; }
.muted { color: var(--muted); }
.right { text-align: right; }

/* forms */
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 10px 0 5px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  font: inherit; background: #fff; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(239,106,26,.15);
}
input[type=checkbox] { width: auto; }

/* buttons */
.btn {
  background: linear-gradient(180deg, #f4772a, var(--brand)); color: #fff; border: 0; border-radius: 11px;
  padding: 11px 18px; font-weight: 700; box-shadow: 0 2px 6px rgba(239,106,26,.30); transition: .15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(239,106,26,.35); }
.btn:active { transform: translateY(0); }
.btn.ghost { background: #fff; color: var(--brand-dark); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.btn.ghost:hover { background: var(--brand-soft); border-color: #f2c9a8; }
.btn.ok { background: linear-gradient(180deg, #17a06d, var(--ok)); box-shadow: 0 2px 6px rgba(18,133,90,.3); }
.btn.danger { background: linear-gradient(180deg, #e05a50, var(--danger)); box-shadow: 0 2px 6px rgba(213,73,63,.3); }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }

/* header row */
.head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.head .grow { flex: 1; }

/* pills */
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; text-transform: capitalize; letter-spacing: .01em; }
.pill.draft { background: #f2ebe4; color: #8a7a68; }
.pill.confirmed { background: var(--brand-soft); color: var(--brand-dark); }
.pill.completed { background: #e3f5ec; color: var(--ok); }

/* list */
.list-item {
  display: flex; align-items: center; gap: 14px; padding: 14px; margin: 0 -8px; border-radius: 12px;
  transition: background .12s; color: var(--text);
}
.list-item:hover { background: var(--brand-soft); }
.list-item + .list-item { border-top: 1px solid var(--border); }
.list-item .grow { flex: 1; }

/* chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 7px 13px;
  font-size: 12.5px; font-weight: 600; color: var(--muted); box-shadow: var(--shadow-sm); transition: .12s;
}
.chip:hover { border-color: #f2c9a8; }
.chip.on { background: linear-gradient(180deg, #f4772a, var(--brand)); color: #fff; border-color: transparent; box-shadow: 0 2px 6px rgba(239,106,26,.3); }

/* yes/no + view toggle */
.toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 11px; overflow: hidden; box-shadow: var(--shadow-sm); }
.toggle button { padding: 9px 16px; background: #fff; border: 0; color: var(--muted); font-weight: 600; transition: .12s; }
.toggle button:hover { background: var(--brand-soft); }
.toggle button.on { background: var(--brand); color: #fff; }

/* line items */
.line { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px dashed var(--border); }
.line:last-child { border-bottom: 0; }
.line > .grow { flex: 1; }
.stockbox { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 9px; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.stockbox input { width: auto; }
.xbtn { background: #fdeceb; color: var(--danger); border: 0; border-radius: 10px; padding: 10px 12px; font-weight: 700; transition: .12s; }
.xbtn:hover { background: #f9d9d6; }

/* totals */
.totals { background: #fffaf6; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.totals .t { display: flex; justify-content: space-between; padding: 4px 0; font-size: 14px; }
.totals .t .muted { font-weight: 500; }
.totals .grand { font-weight: 800; font-size: 17px; border-top: 1px dashed var(--border); margin-top: 8px; padding-top: 10px; }

/* board */
.board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 4px; }
.board .col { flex: 1 1 220px; min-width: 220px; background: #faf1ea; border: 1px solid var(--border); border-radius: 14px; padding: 12px; }
.board .col h4 { margin: 2px 4px 12px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.board .oc { background: #fff; border: 1px solid var(--border); border-radius: 11px; padding: 12px; margin-bottom: 10px; box-shadow: var(--shadow-sm); transition: .12s; display: block; color: var(--text); }
.board .oc:hover { transform: translateY(-1px); box-shadow: var(--shadow); }

/* chart */
.bars { display: flex; gap: 12px; align-items: flex-end; height: 130px; margin-top: 10px; }
.bars .b { flex: 1; text-align: center; display: flex; flex-direction: column; justify-content: flex-end; }
.bars .b .bar { background: linear-gradient(180deg, #f7862f, var(--brand)); border-radius: 7px 7px 0 0; margin: 0 auto; width: 62%; min-height: 3px; box-shadow: inset 0 -2px 6px rgba(0,0,0,.05); transition: .2s; }
.bars .b:hover .bar { filter: brightness(1.05); }
.bars .b .lbl { font-size: 11px; color: var(--muted); margin-top: 6px; font-weight: 600; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat-v { font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: var(--text); }
.stat-l { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.stat.warn { background: linear-gradient(180deg, #fff5ee, #fff); border-color: #f3c9a6; }
.stat.warn .stat-v { color: var(--brand-dark); }

.error { color: var(--danger); font-weight: 600; }
.login { max-width: 380px; margin: 9vh auto; }
.login .card { padding: 28px; }
.center { text-align: center; }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 20px 0 30px; }
.footer b { color: var(--brand); font-weight: 700; }
