/* Mac-style look, same font and colours as the Cash Book.
   PC: sidebar on the left. Mobile: bar on top with the menu in one scrolling line. */

/* Inter (free, SIL Open Font License): the closest look to San Francisco; served from this folder */
@font-face {
  font-family: "Inter";
  src: url("/static/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f5f5f7;
  --sidebar: #ebebef;
  --card: #ffffff;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: #e2e2e7;
  --line-strong: #d2d2d7;
  --accent: #0071e3;
  --accent-soft: #e8f1fc;
  --green: #1f8a4c;
  --green-soft: #e9f6ee;
  --red: #c9342c;
  --red-soft: #fdeeed;
  --amber: #9a6700;
  --amber-soft: #fff6dc;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 14px rgba(0, 0, 0, 0.04);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  /* San Francisco where it is installed (Mac, iPhone); Inter everywhere else */
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter",
               "Segoe UI Variable Text", "Segoe UI", system-ui, "Nirmala UI", sans-serif;
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: -0.006em;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.hide { display: none; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100%; }

.sidebar {
  width: 216px;
  flex-shrink: 0;
  background: var(--sidebar);
  border-right: 1px solid var(--line-strong);
  display: flex;
  flex-direction: column;
  padding: 16px 10px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: block; padding: 0 8px 14px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-top { font-size: 12px; color: var(--muted); letter-spacing: 0.02em; }
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; margin-top: 2px; }
.nav-label { font-size: 11px; font-weight: 600; color: var(--muted); padding: 12px 8px 4px; letter-spacing: 0.02em; }
.nav-item { display: block; padding: 7px 10px; border-radius: 7px; font-size: 13.5px; color: var(--ink); white-space: nowrap; }
.nav-item:hover { background: rgba(0, 0, 0, 0.05); text-decoration: none; }
.nav-item.active { background: var(--accent); color: white; font-weight: 600; }
.sidebar-foot { margin-top: auto; padding: 10px 8px 0; border-top: 1px solid var(--line-strong); }
.user-name { font-weight: 600; font-size: 13px; }
.user-role { font-size: 11.5px; color: var(--muted); margin-bottom: 6px; }
.link-btn { color: var(--accent); font-size: 12.5px; }

.content { flex: 1; min-width: 0; }
main { max-width: 1120px; padding: 18px 22px 24px; }

h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 14px; }
h1 .mute { font-weight: 400; margin-left: 6px; }
h2 { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.mute { color: var(--muted); font-size: 12.5px; }
p.mute { margin-bottom: 10px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
        padding: 16px 18px; margin-bottom: 14px; }

.flash { padding: 9px 12px; border-radius: 8px; margin-bottom: 14px; font-weight: 500; font-size: 13px; }
.flash.ok { background: var(--green-soft); color: var(--green); }
.flash.err { background: var(--red-soft); color: var(--red); }
.flash.warn { background: var(--amber-soft); color: var(--amber); }
td.wrap { white-space: normal; min-width: 280px; }
tr.total td { font-weight: 700; border-top: 1px solid var(--line-strong); }
td form { margin: 0; }

/* ---------- Top bar (all pages after login) ---------- */
.topbar { position: sticky; top: 0; z-index: 20; height: 52px; display: flex; align-items: center; justify-content: space-between;
          gap: 12px; padding: 0 20px; background: rgba(246, 246, 248, 0.82); backdrop-filter: blur(18px);
          -webkit-backdrop-filter: blur(18px); border-bottom: 1px solid var(--line-strong); }
.tb-brand { color: var(--ink); line-height: 1.15; }
.tb-brand:hover { text-decoration: none; }
.tb-brand b { display: block; font-size: 16px; font-weight: 700; letter-spacing: 0.02em; }
.tb-brand span { font-size: 11px; color: var(--muted); }
.tb-right { display: flex; align-items: center; gap: 14px; }
.tb-space { font-size: 11.5px; color: var(--muted); background: #e9e9ee; border: 1px solid var(--line-strong);
            border-radius: 8px; padding: 5px 10px; text-transform: uppercase; letter-spacing: 0.03em; }
.tb-space b { color: var(--ink); }
.tb-user { text-align: right; line-height: 1.2; padding-left: 14px; border-left: 1px solid var(--line-strong); }
.tb-user b { display: block; font-size: 11.5px; color: var(--green); text-transform: uppercase; letter-spacing: 0.06em; }
.tb-user span { font-size: 11px; color: var(--muted); }
.app { min-height: calc(100vh - 52px); }
.sidebar { top: 52px; height: calc(100vh - 52px); padding-top: 12px; }
.hubback { font-weight: 600; color: var(--accent); margin-bottom: 4px; }
main.wide { max-width: 1280px; margin: 0 auto; }

/* ---------- Central Hub ---------- */
.hubhead { align-items: flex-start; border-bottom: 1px solid var(--line-strong); padding: 14px 0 16px; margin-bottom: 22px; }
.hubtitle { font-size: 28px; letter-spacing: -0.025em; margin-bottom: 4px; }
.hubhead p.mute { font-size: 13.5px; max-width: 760px; margin: 0; }
.hubgrid { display: grid; gap: 18px; grid-template-columns: 1fr; }
.hubcard { display: flex; flex-direction: column; justify-content: space-between; min-height: 236px; padding: 22px;
           background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
           color: var(--ink); transition: box-shadow .15s, border-color .15s, transform .15s; }
.hubcard:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 2px 4px rgba(0,0,0,.05), 0 12px 28px rgba(0,0,0,.09);
                 border-color: var(--hc); }
.hubcard h3 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; margin: 16px 0 8px; }
.hubcard:hover h3 { color: var(--hc); }
.hubcard p { font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.hubcard .launch { font-size: 12.5px; font-weight: 600; color: var(--hc); padding-top: 14px; }
.hubicon { display: inline-flex; width: 46px; height: 46px; border-radius: 12px; align-items: center; justify-content: center;
           background: var(--hs); }
.hubicon svg { width: 25px; height: 25px; fill: none; stroke: var(--hc); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.hubcard.c1 { --hc: #5b3aa6; --hs: #efe8fc; } .hubcard.c2 { --hc: #1f8a4c; --hs: #e9f6ee; }
.hubcard.c3 { --hc: #b56a00; --hs: #fff1d6; } .hubcard.c4 { --hc: #0071e3; --hs: #e8f1fc; }
button.amber, .btn.amber { background: #c27c00; border-color: #c27c00; color: white; }
button.amber:hover, .btn.amber:hover { background: #d48a05; }
.btn.danger { background: var(--red); border-color: var(--red); color: white; } .btn.danger:hover { background: #d43e36; }
.btn.small { padding: 5px 11px; font-size: 12.5px; }

/* ---------- Module bar: HUB button, module title, dropdown menus ---------- */
.modbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 9px 12px; margin-bottom: 14px;
          background: #1d1d1f; color: white; border-radius: 12px; box-shadow: var(--shadow); }
.modbar.amberbar { background: #7a4a00; }
.hubbtn { font-size: 12px; font-weight: 700; letter-spacing: 0.03em; color: white; padding: 5px 10px; border-radius: 8px;
          background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.18); }
.hubbtn:hover { background: rgba(255, 255, 255, 0.22); text-decoration: none; }
.modtitle { font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: rgba(255, 255, 255, 0.86);
            margin-right: auto; }
a.modtitle:hover { color: white; text-decoration: none; }
.modnav { display: flex; flex-wrap: wrap; gap: 8px; }
.modnav select { width: auto; padding: 5px 8px; font-size: 13px; font-weight: 600; color: white; background: #3a3a3e;
                 border: 1px solid #55555b; border-radius: 8px; }
.modnav select option { color: var(--ink); background: white; }

/* ---------- pieces used by the HR screens ---------- */
.caps { text-transform: uppercase; letter-spacing: 0.04em; font-size: 11.5px; }
h2.caps { font-size: 12.5px; font-weight: 700; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 12px; }
h2.big2 { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 4px; }
h2.under { border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 14px; }
.c-ink { color: var(--ink); }
.tile.left { text-align: left; padding: 16px 18px; }
.tile.left span { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; }
.tile.left b { margin-top: 8px; font-size: 30px; }
.bar { margin-bottom: 14px; }
.barhead { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; margin-bottom: 5px; }
.bartrack { height: 8px; border-radius: 99px; background: #ececf0; overflow: hidden; }
.bartrack div { height: 100%; border-radius: 99px; }
.bar.g .barhead { color: var(--green); } .bar.g .bartrack div { background: #34a868; }
.bar.a .barhead { color: var(--amber); } .bar.a .bartrack div { background: #e5a823; }
.bar.r .barhead { color: var(--red); } .bar.r .bartrack div { background: #dd4a41; }
.scrollbox { max-height: 170px; overflow-y: auto; }
.strip { align-items: center; margin-bottom: 14px; }
.card.strip { display: flex; }
.split { display: grid; gap: 14px; grid-template-columns: 1fr; align-items: start; }
.split .card { margin-bottom: 0; }
.scrolly { max-height: 600px; overflow-y: auto; padding-right: 4px; margin-top: 10px; }
.punchcard { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; padding: 14px;
             margin-bottom: 12px; background: #f7f7f9; border: 1px solid var(--line); border-radius: 12px; }
.punchcard:hover { background: var(--card); }
.punchcard .who { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 230px; }
.badge.idb { background: #efe8fc; color: #5b3aa6; }
.rectify { margin-top: 6px; padding: 3px 9px; font-size: 11.5px; }
.acc { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; overflow: hidden; background: var(--card); }
.acc summary { display: flex; justify-content: space-between; padding: 10px 12px; font-size: 12.5px; font-weight: 700; cursor: pointer;
               list-style: none; user-select: none; }
.acc summary::-webkit-details-marker { display: none; }
.acc[open] summary .mute { transform: rotate(180deg); }
.accbody { padding: 6px 12px 8px; background: #f7f7f9; border-top: 1px solid var(--line); max-height: 160px; overflow-y: auto; }
.card.flush { padding: 0; overflow: hidden; }
.cardhead { display: flex; justify-content: space-between; align-items: center; padding: 13px 18px; background: #f7f7f9;
            border-bottom: 1px solid var(--line); }
.cardhead h2 { margin: 0; font-size: 15px; font-weight: 700; }
table.dark th { background: #1d1d1f; color: white; padding: 10px 12px; font-size: 11px; }
table.dark td { padding: 10px 12px; }
tr.sel td { background: var(--accent-soft) !important; }
.passchip { font-family: Consolas, "Courier New", monospace; font-weight: 700; font-size: 12.5px; color: #5b3aa6;
            background: #f4effd; padding: 2px 8px; border-radius: 5px; }
.passbox { font-weight: 700; color: #5b3aa6; background: #faf7ff !important; border-color: #d9c9f7 !important; }
.inlineform { display: inline; }
button.dangerlight { background: var(--red-soft); border-color: #f6cfcb; color: var(--red); }
button.dangerlight:hover { background: #fbdcd9; }
.vault { background: #f7f7f9; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 14px 0 4px; }
.vault h3 { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.actions.right { justify-content: flex-end; }
.checks.col label { display: flex; margin: 6px 0; }
.denied { background: #f2f2f5; border: 1px solid var(--line-strong); color: var(--muted); padding: 30px; border-radius: 12px;
          text-align: center; font-style: italic; }
.card.empty { text-align: center; padding: 44px 20px; }
.dropzone { display: block; max-width: 440px; margin: 20px auto 0; padding: 22px; border: 2px dashed var(--line-strong);
            border-radius: 12px; background: #f7f7f9; cursor: pointer; color: var(--accent); }
.dropzone:hover { background: var(--accent-soft); }
.dropzone input { display: none; }
.dropzone b { display: block; font-size: 13px; margin-bottom: 3px; }
.filterbox { display: grid; gap: 12px; grid-template-columns: 1fr; align-items: end; background: #f7f7f9; border: 1px solid var(--line);
             border-radius: 12px; padding: 14px; margin: 12px 0 18px; }
.filterbox label { margin-top: 0; font-weight: 700; }
.reportbox { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.reporthead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 16px;
              background: #2c2c30; color: white; font-weight: 700; font-size: 13.5px; }
.reporthead small { font-weight: 400; opacity: .75; margin-left: 8px; }
.reporthead button { background: #4a4a50; border-color: #4a4a50; }
.reportbox th { background: #f2f2f5; padding: 10px 12px; }
.reportbox td { padding: 9px 12px; }
td.rawlog { font-family: Consolas, "Courier New", monospace; font-size: 12.5px; background: #fafafc; }
.note { padding: 12px 18px; font-size: 12px; color: var(--amber); background: var(--amber-soft); border-top: 1px solid #f3e3b3; margin: 0; }
@media (min-width: 700px) { .hubgrid { grid-template-columns: repeat(2, 1fr); } .filterbox { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1000px) { .hubgrid { grid-template-columns: repeat(4, 1fr); } .split { grid-template-columns: 2fr 1fr; }
                             .split.rev { grid-template-columns: 1fr 2fr; } }
@media (max-width: 899px) {
  .topbar { position: static; height: auto; padding: 8px 12px; flex-wrap: wrap; }
  .tb-space { display: none; }
  .sidebar { top: 0; height: auto; }
  .sidebar-foot { display: none; }
  main.wide { padding: 14px 12px 24px; }
  .hubtitle { font-size: 22px; }
  .hubcard { min-height: 0; }
  .modnav, .modnav select { width: 100%; }
}

/* ---------- HR ---------- */
.headrow { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.headrow h1 { margin-bottom: 0; }
.clock { text-align: right; }
.clock b { display: block; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.c-green { color: var(--green); } .c-red { color: var(--red); } .c-amber { color: var(--amber); } .c-blue { color: var(--accent); }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%;
          background: var(--accent-soft); color: #0a4d99; font-size: 11px; font-weight: 700; object-fit: cover;
          vertical-align: middle; flex-shrink: 0; }
.avatar.big { width: 46px; height: 46px; font-size: 16px; }
.rowline { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); }
.rowline:first-of-type { border-top: none; }
.rowline > span:last-child { white-space: nowrap; flex-shrink: 0; }
.rowline > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cols3 { display: grid; gap: 14px; grid-template-columns: 1fr; }
.cols3 .card { margin-bottom: 0; }
.cols3 { margin-bottom: 14px; }
.punchrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
            padding: 12px 0; border-top: 1px solid var(--line); }
.punchrow .who { display: flex; align-items: center; gap: 12px; min-width: 240px; flex: 1; }
.punchbtns { display: grid; grid-template-columns: repeat(4, auto); gap: 6px; }
.pb { min-width: 86px; padding: 9px 10px; border: none; color: white; font-weight: 600; }
.pb.k-IN { background: var(--green); } .pb.k-IN:hover { background: #23965a; }
.pb.k-OUT { background: var(--red); } .pb.k-OUT:hover { background: #d43e36; }
.pb.k-LUNCHOUT { background: #c27c00; } .pb.k-LUNCHOUT:hover { background: #d48a05; }
.pb.k-LUNCHIN { background: var(--accent); }
.pb:disabled, .pb:disabled:hover { background: #ececf0; color: #b0b0b8; cursor: not-allowed; box-shadow: none; }
.badge.k-IN { background: var(--green-soft); color: var(--green); } .badge.k-OUT { background: var(--red-soft); color: var(--red); }
.badge.k-LUNCHOUT { background: var(--amber-soft); color: var(--amber); } .badge.k-LUNCHIN { background: var(--accent-soft); color: #0a4d99; }
a.badge:hover { text-decoration: none; filter: brightness(0.96); }
.rect { width: 100%; }
.rect input[type=text] { flex: 1; max-width: 340px; }
button.danger { background: var(--red); border-color: var(--red); } button.danger:hover { background: #d43e36; }
tr.past td { color: var(--muted); }
.tabs { display: inline-flex; background: #e4e4ea; border-radius: 9px; padding: 2px; margin-bottom: 14px; }
.tab { padding: 5px 16px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--ink); }
.tab:hover { text-decoration: none; }
.tab.active { background: var(--card); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
dialog { border: none; border-radius: 14px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25); padding: 20px 22px 16px;
         width: 300px; max-width: 92vw; margin: auto; }
dialog::backdrop { background: rgba(0, 0, 0, 0.3); backdrop-filter: blur(3px); }
dialog h2 { font-size: 17px; margin-bottom: 2px; }
dialog input[type=password] { font-size: 22px; text-align: center; letter-spacing: 0.3em; margin-top: 10px; }
dialog .actions button { flex: 1; }
@media (min-width: 700px) { .row.four { grid-template-columns: repeat(4, 1fr); } .tiles.four { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1000px) { .cols3 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 699px) { .punchbtns { grid-template-columns: repeat(2, 1fr); width: 100%; } }
@media print {
  .sidebar, .noprint, .flash { display: none !important; }
  body { background: white; } main { padding: 0; max-width: none; }
  .card { box-shadow: none; border: none; padding: 0; }
  th, td { padding: 4px 6px; }
}

/* search box above a challan list */
.search { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.search input[type=text] { flex: 1; min-width: 180px; max-width: 420px; }
.search input[type=date] { width: auto; }

/* one challan per line with its own buttons (put back, delivered ...) */
.line { border-top: 1px solid var(--line); padding: 10px 0; margin-top: 10px; }
.line .inline { margin-top: 6px; }
.line .inline input[type=text] { flex: 1; min-width: 160px; max-width: 360px; }
.big { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }

/* ---------- Controls ---------- */
button, .btn {
  display: inline-block;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.03);
}
button:hover, .btn:hover { background: #0077ed; text-decoration: none; }
button:active, .btn:active { background: #0068d1; }
button.grey, .btn.grey { border-color: var(--line-strong); background: var(--card); color: var(--ink); }
button.grey:hover, .btn.grey:hover { background: #f7f7f9; }
button.grey:active, .btn.grey:active { background: #efeff2; }
button.small { padding: 5px 11px; font-size: 12.5px; }

label { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin: 10px 0 4px; }

input[type=text], input[type=password], input[type=number], input[type=date], input[type=file], select {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--card);
  outline: none;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.18); }
input[readonly] { background: #f2f2f5; color: var(--muted); }
input[type=number] { font-variant-numeric: tabular-nums; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); vertical-align: middle; }
input[type=file] { padding: 5px 6px; font-size: 13px; }

.row { display: grid; gap: 0 14px; grid-template-columns: 1fr; }
.actions { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline input[type=file] { width: auto; flex: 1; min-width: 180px; }
.checks label { display: inline-flex; gap: 6px; align-items: center; margin: 4px 14px 4px 0; color: var(--ink); font-size: 13px; }

/* ---------- Dashboard tiles ---------- */
.tiles { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); margin-bottom: 14px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
        padding: 14px 12px; text-align: center; color: var(--ink); }
.tile:hover { text-decoration: none; border-color: var(--line-strong); }
.tile b { display: block; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tile span { font-size: 12px; color: var(--muted); }

/* ---------- Tables ---------- */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 0.02em; text-transform: uppercase; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafafc; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
         background: #ececf0; color: var(--ink); vertical-align: middle; }
.badge.PICKED { background: var(--amber-soft); color: var(--amber); }
.badge.PACKING { background: #ffe9cf; color: #8a4b00; }
.badge.PACKED { background: var(--accent-soft); color: #0a4d99; }
.badge.OUT { background: #efe8fc; color: #5b3aa6; }
.badge.DELIVERED { background: var(--green-soft); color: var(--green); }
.badge.CANCELLED { background: var(--red-soft); color: var(--red); }

/* ---------- Party search list ---------- */
.suggest { border: 1px solid var(--line-strong); border-radius: 9px; margin-top: 4px; background: var(--card);
           box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16); max-height: 260px; overflow: auto; padding: 4px; }
.suggest div { padding: 7px 10px; border-radius: 6px; cursor: pointer; }
.suggest div:hover { background: var(--accent); color: white; }

.photos img { max-width: 100%; width: 260px; border-radius: 8px; border: 1px solid var(--line); margin: 0 8px 8px 0; }

.login { max-width: 360px; margin: 10vh auto 0; padding: 22px 22px 18px; border-radius: 14px;
         box-shadow: 0 24px 60px rgba(0, 0, 0, 0.12); }
.login h1 { font-size: 19px; margin-bottom: 6px; }
.login button { width: 100%; padding: 8px; }
.plain main { max-width: none; }

/* ---------- PC ---------- */
@media (min-width: 700px) {
  .row { grid-template-columns: repeat(2, 1fr); }
  .row.three { grid-template-columns: repeat(3, 1fr); }
  .tiles { grid-template-columns: repeat(6, 1fr); }
}

/* ---------- Mobile / tablet: sidebar becomes a top bar ---------- */
@media (max-width: 899px) {
  body { font-size: 15px; }
  .app { display: block; }
  .sidebar { width: auto; height: auto; padding: 8px 10px 6px; border-right: none; border-bottom: 1px solid var(--line-strong);
             z-index: 5; background: rgba(235, 235, 239, 0.88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
  .brand { padding: 0 4px 6px; }
  .brand-top, .nav-label, .user-role { display: none; }
  .brand-name { margin-top: 0; font-size: 16px; }
  .nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-item { padding: 7px 12px; font-size: 14px; }
  .sidebar-foot { position: absolute; top: 9px; right: 12px; margin: 0; padding: 0; border: none; display: flex; gap: 10px; align-items: center; }
  .user-name { font-size: 12.5px; font-weight: 500; color: var(--muted); }
  main { padding: 14px 12px 24px; }
  h1 { font-size: 20px; }
  .card { padding: 14px; }
  /* 16px stops the phone from zooming in when a box is touched; bigger buttons for fingers */
  input[type=text], input[type=password], input[type=number], input[type=date], select { font-size: 16px; padding: 10px; }
  button, .btn { padding: 10px 16px; font-size: 15px; }
  button.small { padding: 8px 13px; font-size: 14px; }
  input[type=checkbox] { width: 22px; height: 22px; }
  th, td { padding: 9px 8px; }
}
