/* Fluxo Biomass Web – one stylesheet for every screen.
   Layout: dark-green sidebar on the left, light work area on the right.
   Colours: field green (brand) + straw gold (highlight) on a warm grey-white. */

:root {
  --green-950: #102A1C;
  --green-900: #153625;
  --green-800: #1C4630;
  --green-700: #22573B;
  --green-600: #2C6E4A;
  --green-100: #E3EFE7;
  --green-50:  #F1F7F3;
  --straw-600: #A87A1C;
  --straw-500: #C9962B;
  --straw-100: #F6EBD2;
  --straw-50:  #FCF7EC;
  --bg:        #F4F5F1;
  --surface:   #FFFFFF;
  --line:      #E2E5DE;
  --line-soft: #EEF0EB;
  --ink:       #17201B;
  --ink-2:     #3D4A42;
  --muted:     #6B776F;
  --red:       #B23A2B;
  --red-50:    #FBEDEA;
  --blue:      #2B5C8A;
  --blue-50:   #EAF1F8;

  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(16, 42, 28, .06), 0 1px 1px rgba(16, 42, 28, .04);
  --font: "IBM Plex Sans", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Manrope", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --sidebar: 248px;
  --rail: 68px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--green-700); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 700; }
h3 { font-size: 14px; font-weight: 700; }
.num, td.n, th.n { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }
body.nav-pinned .shell { grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar {
  background: var(--green-900);
  color: #DCE8E0;
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--rail); z-index: 40;
  overflow: hidden; transition: width .18s ease, box-shadow .18s ease;
}
.sidebar:hover, .sidebar:focus-within, body.nav-pinned .sidebar { width: var(--sidebar); }
.sidebar:hover:not(body.nav-pinned .sidebar) { box-shadow: 8px 0 28px rgba(16, 42, 28, .25); }
/* In the slim rail only the icons show; the labels appear when the mouse is over the menu or it is pinned open. */
.brand-text, .nav-label, .nav-section, .sidebar-foot .who, .sidebar-foot .role, .sidebar-foot form, .badge-count { opacity: 0; white-space: nowrap; transition: opacity .12s; }
.sidebar:hover .brand-text, .sidebar:hover .nav-label, .sidebar:hover .nav-section, .sidebar:hover .who, .sidebar:hover .role, .sidebar:hover form, .sidebar:hover .badge-count,
.sidebar:focus-within .brand-text, .sidebar:focus-within .nav-label, .sidebar:focus-within .nav-section, .sidebar:focus-within .who, .sidebar:focus-within .role, .sidebar:focus-within form, .sidebar:focus-within .badge-count,
body.nav-pinned .brand-text, body.nav-pinned .nav-label, body.nav-pinned .nav-section, body.nav-pinned .who, body.nav-pinned .role, body.nav-pinned form, body.nav-pinned .badge-count { opacity: 1; }
.nav-section { padding: 12px 12px 4px; line-height: 1.3; overflow: hidden; }
.brand { display: flex; align-items: center; gap: 12px; padding: 18px 16px 14px; }
.brand-mark {
  flex: none;
  width: 36px; height: 36px; border-radius: 9px;
  background: var(--straw-500); color: var(--green-950);
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 18px;
}
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 15px; color: #fff; line-height: 1.15; }
.brand-sub { font-size: 12px; color: #9DB5A6; }
.nav { padding: 6px 10px; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 8px;
  color: #C9D9CF; font-weight: 500;
  position: relative;
}
.nav a:hover { background: var(--green-800); color: #fff; text-decoration: none; }
.nav a.active { background: var(--green-700); color: #fff; }
.nav a.active::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--straw-500);
}
.nav-section { font-size: 12px; font-weight: 600; color: #7F9A89; padding: 14px 12px 6px; }
.sidebar-foot { padding: 12px 14px 44px; border-top: 1px solid var(--green-800); font-size: 13px; }
.sidebar-foot .who { color: #fff; font-weight: 600; }
.sidebar-foot .role { color: #9DB5A6; font-size: 12px; text-transform: capitalize; }
.sidebar-foot form { margin-top: 10px; }
.sidebar-foot button {
  background: none; border: 1px solid var(--green-700); color: #C9D9CF;
  border-radius: 7px; padding: 6px 10px; font: inherit; cursor: pointer; display: inline-flex; gap: 8px; align-items: center;
}
.sidebar-foot button:hover { background: var(--green-800); color: #fff; }

.main { grid-column: 2; min-width: 0; display: flex; flex-direction: column; }
.mobile-bar { display: none; align-items: center; gap: 10px; background: var(--green-900); color: #fff; padding: 10px 16px; font-family: var(--font-display); font-weight: 800; }
.mobile-bar .brand-mark { width: 30px; height: 30px; font-size: 15px; border-radius: 8px; }
.nav-logout { display: none; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 16px 28px 12px;
}
.topbar .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.content { padding: 0 28px 40px; display: flex; flex-direction: column; gap: 20px; }

/* ---------- Date range picker ---------- */
.range { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 3px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg a {
  padding: 6px 12px; border-radius: 7px; color: var(--ink-2); font-weight: 500; font-size: 13px;
}
.seg a:hover { text-decoration: none; background: var(--green-50); }
.seg a.on { background: var(--green-700); color: #fff; }
.range form { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; max-width: 100%; }
.range input[type=date] {
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 13px; background: var(--surface); color: var(--ink);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 7px 12px; border-radius: 8px; font: inherit; font-weight: 600; font-size: 13px; cursor: pointer;
}
.btn:hover { border-color: #C9CFC6; text-decoration: none; background: #FAFBF8; }
.btn-primary { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.btn-primary:hover { background: var(--green-800); border-color: var(--green-800); }
.btn-sm { padding: 4px 9px; font-size: 12px; border-radius: 7px; }
.btn-ok { color: var(--green-700); border-color: #BFD8C8; background: var(--green-50); }
.btn-ok:hover { background: var(--green-100); }
.btn-warn { color: var(--red); border-color: #EBC5BE; background: var(--red-50); }
.btn:focus-visible, .seg a:focus-visible, .nav a:focus-visible { outline: 2px solid var(--straw-500); outline-offset: 2px; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.card-body { padding: 16px 18px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat .label { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat .value { font-family: var(--font-display); font-size: 26px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.stat .note { color: var(--muted); font-size: 12px; margin-top: 2px; }
.stat.highlight { background: var(--straw-50); border-color: var(--straw-100); }
.stat.highlight .value { color: var(--straw-600); }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; font-weight: 600; color: var(--muted); font-size: 12px;
  padding: 10px 12px; border-bottom: 1px solid var(--line); background: #FAFBF8; white-space: nowrap;
}
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: var(--ink); }
table.data th.sorted-asc::after { content: " ▲"; font-size: 9px; }
table.data th.sorted-desc::after { content: " ▼"; font-size: 9px; }
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; white-space: nowrap; }
table.data td.wrap { white-space: normal; min-width: 140px; }
table.data td.st { white-space: normal; width: 1%; }
table.data td.st .tag { margin: 1px 0; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: #FAFBF8; }
table.data th.n, table.data td.n { text-align: right; }
table.data td.strong { font-weight: 600; }
.group-row td { background: var(--green-50) !important; font-weight: 700; color: var(--green-800); font-family: var(--font-display); }
.empty { padding: 36px 18px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

/* ---------- Tags ---------- */
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.tag-green { background: var(--green-100); color: var(--green-800); }
.tag-straw { background: var(--straw-100); color: var(--straw-600); }
.tag-red { background: var(--red-50); color: var(--red); }
.tag-grey { background: #EDEFEA; color: var(--ink-2); }
.tag-blue { background: var(--blue-50); color: var(--blue); }
.mtype { font-weight: 600; color: var(--ink-2); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 18px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 12px 12px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--green-700); border-bottom-color: var(--green-700); }
.tabs .count { background: #EDEFEA; color: var(--ink-2); border-radius: 999px; padding: 0 7px; font-size: 11px; margin-left: 6px; }

/* ---------- Attention list ---------- */
.attention { list-style: none; margin: 0; padding: 0; }
.attention li { display: flex; gap: 10px; padding: 11px 18px; border-bottom: 1px solid var(--line-soft); align-items: flex-start; }
.attention li:last-child { border-bottom: 0; }
.attention .icon { color: var(--straw-600); margin-top: 1px; }
.attention a { color: var(--ink); }
.attention .clear { color: var(--muted); padding: 22px 18px; text-align: center; }

/* ---------- Photos ---------- */
.thumbs { display: flex; gap: 6px; }
.thumb { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; border: 1px solid var(--line); display: block; }
.thumb-missing { width: 34px; height: 34px; border-radius: 6px; border: 1px dashed #CCD2C9; display: grid; place-items: center; color: #A3ADA6; font-size: 10px; }
.dup { outline: 2px solid var(--red); outline-offset: 1px; }

/* ---------- Review form ---------- */
.review { display: flex; gap: 6px; align-items: center; }
.review form { margin: 0; }
.sendback { position: relative; }
.sendback summary { list-style: none; }
.sendback summary::-webkit-details-marker { display: none; }
.sendback .pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; width: 300px;
  display: flex; gap: 6px; padding: 8px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 8px 24px rgba(16, 42, 28, .12);
}
.sendback .pop input { flex: 1; border: 1px solid var(--line); border-radius: 7px; padding: 5px 8px; font: inherit; font-size: 13px; }

/* ---------- Messages ---------- */
.messages { list-style: none; margin: 0 32px 4px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.messages li { padding: 10px 14px; border-radius: 8px; font-weight: 500; }
.messages .success { background: var(--green-100); color: var(--green-800); }
.messages .error { background: var(--red-50); color: var(--red); }
.messages .info { background: var(--blue-50); color: var(--blue); }

/* ---------- Attendance grid ---------- */
.att td.c { text-align: center; padding: 8px 2px; min-width: 26px; }
.att th.c { text-align: center; padding: 8px 2px; }
.dot { display: inline-block; width: 20px; height: 20px; line-height: 20px; border-radius: 5px; font-size: 10px; font-weight: 700; }
.dot-present { background: var(--green-100); color: var(--green-800); }
.dot-off { background: var(--straw-100); color: var(--straw-600); }
.dot-leave { background: var(--blue-50); color: var(--blue); }
.dot-absent { background: var(--red-50); color: var(--red); }

/* ---------- Detail header ---------- */
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px 24px; }
.kv div > span:first-child { display: block; color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.kv div strong { font-size: 14px; }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art {
  background: var(--green-900); color: #DCE8E0; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background-image: repeating-linear-gradient(115deg, rgba(201,150,43,.07) 0 2px, transparent 2px 22px);
}
.login-art h1 { color: #fff; font-size: 34px; line-height: 1.15; max-width: 14ch; margin-top: 18px; }
.login-art p { color: #A9C0B1; max-width: 42ch; }
.login-form { display: grid; place-items: center; padding: 32px 16px; }
.login-form form { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 14px; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.field input { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; font: inherit; background: var(--surface); }
.field input:focus { outline: 2px solid var(--green-600); outline-offset: 0; border-color: transparent; }
.form-error { background: var(--red-50); color: var(--red); padding: 10px 12px; border-radius: 8px; font-weight: 500; }

.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--line-soft); border-radius: 11px; padding: 4px; }
.auth-tabs a { text-align: center; padding: 9px 8px; border-radius: 8px; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.auth-tabs a.on { background: var(--surface); color: var(--green-800); box-shadow: var(--shadow); }
.role-cards { display: grid; gap: 8px; }
.field label.role-card, .role-card { display: flex; font-weight: 400; margin: 0; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; background: var(--surface); }
.role-card input { width: auto; margin-top: 4px; accent-color: var(--green-700); }
.role-card strong { display: block; font-size: 14px; }
.role-card span { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.role-card:has(input:checked) { border-color: var(--green-600); background: var(--green-50); }
.form-note { background: var(--blue-50); color: var(--blue); padding: 10px 12px; border-radius: 8px; font-weight: 500; }
.form-ok { background: var(--green-50); color: var(--green-800); padding: 10px 12px; border-radius: 8px; font-weight: 500; }

/* ---------- Phase notice ---------- */
.phase { display: flex; gap: 16px; align-items: flex-start; }
.phase .badge { background: var(--straw-100); color: var(--straw-600); font-weight: 700; border-radius: 8px; padding: 6px 10px; white-space: nowrap; }
.list-plain { margin: 8px 0 0; padding-left: 18px; color: var(--ink-2); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
.grid-2 > *, .content > * { min-width: 0; }
@media (max-width: 860px) {
  .shell, body.nav-pinned .shell { grid-template-columns: minmax(0, 1fr); }
  .main { grid-column: 1; }
  .sidebar { grid-column: 1; }
  /* Phone: the menu is a bar at the bottom of the screen, like a phone app. */
  .sidebar, .sidebar:hover, body.nav-pinned .sidebar {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; width: 100%; height: calc(62px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px); flex-direction: row; z-index: 60; overflow: hidden;
    box-shadow: 0 -2px 14px rgba(16, 42, 28, .28);
  }
  .sidebar .brand, .nav-section, .sidebar-foot { display: none; }
  .brand-text, .nav-label, .badge-count { opacity: 1; }
  .nav { flex-direction: row; align-items: stretch; overflow-x: auto; overflow-y: hidden; padding: 0 4px; gap: 0; scrollbar-width: none; scroll-snap-type: x proximity; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex-direction: column; justify-content: center; align-items: center; gap: 3px; min-width: 66px; padding: 6px 6px; border-radius: 0; font-size: 10.5px; line-height: 1.15; white-space: nowrap; scroll-snap-align: start; text-align: center; }
  .nav a:hover { background: transparent; }
  .nav a.active { background: transparent; color: var(--straw-500); }
  .nav a.active::before { display: block; left: 22%; right: 22%; top: 0; bottom: auto; width: auto; height: 3px; border-radius: 0 0 3px 3px; }
  .nav .badge-count { position: absolute; top: 4px; right: 14px; }
  .nav-logout { display: flex; align-items: stretch; margin: 0; }
  .nav-logout button { background: none; border: 0; color: #C9D9CF; font: inherit; font-size: 10.5px; min-width: 66px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; cursor: pointer; padding: 6px 8px; }
  .mobile-bar { display: flex; }
  .shell { padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }
  .actionbar, .shell .actionbar, body.nav-pinned .shell .actionbar { bottom: calc(62px + env(safe-area-inset-bottom, 0px)); }
  .topbar, .content { padding-left: 16px; padding-right: 16px; }
  .messages { margin: 0 16px 4px; }
  .login-page { grid-template-columns: 1fr; }
  .login-art { padding: 20px 20px 18px; gap: 10px; }
  .login-art h1 { font-size: 21px; max-width: none; margin-top: 12px; }
  .login-art p, .login-art .tagline { display: none; }
  .login-form { place-items: start center; padding: 22px 16px 32px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ======================================================================
   Entry forms, dialogs, keyboard hints, search, print
   ====================================================================== */
.entry { display: flex; flex-direction: column; gap: 16px; padding-bottom: 84px; max-width: 1180px; }
.form-card .card-head h2 { font-size: 15px; margin: 0; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px 20px; }
.fields .field.wide { grid-column: 1 / -1; }
.field[hidden] { display: none; }
.input, .field select.input, .field textarea.input {
  width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; font: inherit;
  background: var(--surface); color: var(--ink); min-height: 42px;
}
.input:focus, .file:focus { outline: 2px solid var(--green-600); outline-offset: 0; border-color: transparent; }
.field input.check { width: 18px; height: 18px; padding: 0; accent-color: var(--green-700); }
.checkline { display: flex !important; align-items: center; gap: 10px; font-weight: 600; margin-top: 24px; }
.file { width: 100%; font: inherit; padding: 8px; border: 1px dashed #B9C4BC; border-radius: 9px; background: var(--green-50); }
.req { color: var(--red); margin-left: 3px; }
.help { color: var(--muted); font-size: 12px; margin-top: 5px; }
.err { color: var(--red); font-size: 12.5px; font-weight: 600; margin-top: 5px; }
.field.has-error .input { border-color: var(--red); background: var(--red-50); }
.photo-box { margin: 0 0 8px; }
.photo-preview { max-width: 100%; max-height: 180px; border-radius: 9px; border: 1px solid var(--line); display: block; }
.photo-empty { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; padding: 10px 12px; background: var(--bg); border-radius: 9px; }
.photo-empty .icon { width: 18px; height: 18px; }
.dup-warning { color: var(--red); background: var(--red-50); border-radius: 7px; padding: 5px 9px; font-size: 12.5px; font-weight: 600; margin-top: 6px; }

.actionbar {
  position: fixed; left: 0; right: 0; bottom: 36px; z-index: 20; display: flex; gap: 10px; align-items: center; justify-content: flex-end;
  padding: 12px 28px; background: rgba(255,255,255,.96); border-top: 1px solid var(--line); backdrop-filter: blur(6px);
}
.actionbar-left { margin-right: auto; }
.shell .actionbar { left: var(--rail); }
body.nav-pinned .shell .actionbar { left: var(--sidebar); }

kbd {
  display: inline-block; font: 600 11px/1 ui-monospace, Consolas, monospace; padding: 3px 6px; border-radius: 5px;
  background: #EEF0EB; border: 1px solid var(--line); border-bottom-width: 2px; color: var(--ink-2); margin-left: 4px;
}
.btn-primary kbd { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.3); color: #fff; }

.hintbar {
  position: fixed; left: 0; right: 0; bottom: 0; height: 36px; z-index: 30; display: flex; gap: 18px; align-items: center;
  padding: 0 28px; background: var(--green-950); color: #B9CDBF; font-size: 12px; overflow: hidden; white-space: nowrap;
}
.hintbar kbd { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.2); }
.content { padding-bottom: 56px; }

.dialog { border: 0; border-radius: 14px; padding: 22px 24px; max-width: 520px; width: calc(100% - 32px); box-shadow: 0 24px 60px rgba(16,42,28,.35); }
.dialog::backdrop { background: rgba(16,42,28,.45); }
.dialog h2 { margin: 0 0 6px; font-size: 18px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.keys td { padding: 6px 10px 6px 0; vertical-align: top; font-size: 13.5px; }
.keys td:first-child { white-space: nowrap; }

.search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 9px; padding: 0 10px; background: var(--surface); min-width: 240px; }
.search input { border: 0; outline: 0; font: inherit; padding: 9px 0; width: 100%; background: transparent; }
.search:focus-within { outline: 2px solid var(--green-600); }
.search .icon { width: 16px; height: 16px; color: var(--muted); }
tr.filtered-out { display: none; }

.radios { display: flex; gap: 8px; flex-wrap: wrap; }
.radio input { position: absolute; opacity: 0; pointer-events: none; }
.radio span { display: inline-block; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 13px; background: var(--surface); }
.radio input:checked + span { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.radio-absent input:checked + span { background: var(--red); border-color: var(--red); }
.radio-off input:checked + span { background: var(--blue); border-color: var(--blue); }
.radio input:focus-visible + span { outline: 2px solid var(--straw-500); outline-offset: 2px; }

.badge-count { background: var(--straw-500); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; margin-left: auto; }
.collapse-btn { margin-top: 8px; background: transparent; border: 0; color: #A9C0B1; cursor: pointer; padding: 8px 14px; text-align: left; font: inherit; font-size: 12px; }

/* ---------- Reports ---------- */
.report-head { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; align-items: flex-end; padding: 16px 18px; border-bottom: 2px solid var(--green-800); }
.report-head h2 { margin: 0; font-size: 18px; }
table.ledger { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.ledger th { text-align: left; background: var(--green-50); font-size: 12.5px; color: var(--ink-2); padding: 9px 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; }
table.ledger td { padding: 8px 12px; border-bottom: 1px solid var(--line-soft); }
table.ledger .num { text-align: right; }
table.ledger tbody tr:nth-child(even) { background: #FAFBF8; }
table.ledger tfoot td { font-weight: 800; border-top: 2px solid var(--green-800); background: var(--green-50); }
table.ledger tr.zero td { color: #A0A9A3; }
.report-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.tile span { display: block; color: var(--muted); font-size: 12px; }
.tile strong { font-size: 22px; }
.hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.hub a.hub-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); color: var(--ink); text-decoration: none; transition: transform .12s, border-color .12s; }
.hub a.hub-card:hover { transform: translateY(-2px); border-color: var(--green-600); }
.hub-card strong { display: block; font-size: 16px; margin-bottom: 4px; }
.hub-card span { color: var(--muted); font-size: 13px; }

@media (max-width: 860px) {
  .shell .actionbar, body.nav-pinned .shell .actionbar { left: 0; padding: 10px 16px; }
  .hintbar { display: none; }
}
@media print {
  .sidebar, .topbar .range, .hintbar, .actionbar, .no-print, .messages { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
  .card, .tile { box-shadow: none; }
  table.ledger th { position: static; }
}


/* ======================================================================
   Polish: colour per machine type, stat icons, trend bars, header
   ====================================================================== */
:root {
  --t-baler: #C9962B; --t-toka: #2C6E4A; --t-liner: #1F8A8A; --t-lifter: #2B5C8A; --t-trolley: #9A5B3A; --t-press: #6B5B95;
}
body { background: linear-gradient(180deg, #E9EEE6 0, var(--bg) 220px) no-repeat, var(--bg); }
.topbar { position: sticky; top: 0; z-index: 15; background: rgba(238, 242, 235, .92); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(16, 42, 28, .06); margin-bottom: 16px; }
h1 { font-size: 24px; font-weight: 800; }
.card { border-radius: 14px; box-shadow: 0 1px 2px rgba(16, 42, 28, .05), 0 6px 18px -10px rgba(16, 42, 28, .18); }
.card-head h2 { font-size: 15px; }

.mtype::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; background: #B5BDB7; vertical-align: 0; }
.mt-baler::before { background: var(--t-baler); } .mt-toka::before { background: var(--t-toka); } .mt-liner::before { background: var(--t-liner); }
.mt-lifter::before { background: var(--t-lifter); } .mt-trolley::before { background: var(--t-trolley); } .mt-press::before { background: var(--t-press); }

.stat { position: relative; padding: 16px 18px 14px 18px; border-radius: 14px; overflow: hidden; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--tone, var(--green-600)); }
.stat .ic { float: right; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--tone, var(--green-600)) 14%, white); color: var(--tone, var(--green-600)); }
.stat .value { font-size: 30px; line-height: 1.1; }
.tone-straw { --tone: var(--t-baler); } .tone-green { --tone: var(--t-toka); } .tone-teal { --tone: var(--t-liner); }
.tone-blue { --tone: var(--t-lifter); } .tone-brown { --tone: var(--t-trolley); } .tone-red { --tone: var(--red); }

.trend { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 120px; padding: 6px 4px 0; }
.trend .bar { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 4px; min-width: 0; }
.trend .bar i { display: block; width: 100%; max-width: 38px; min-height: 3px; border-radius: 6px 6px 2px 2px; background: var(--tone, var(--green-600)); }
.trend .bar b { font-size: 11px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.trend-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; padding: 4px 4px 0; text-align: center; font-size: 11.5px; color: var(--muted); }
.trend-days .today { color: var(--ink); font-weight: 700; }
.trends { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #EDEFEA; color: var(--ink-2); }
.avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--green-100); color: var(--green-800); font-weight: 700; font-size: 12px; margin-right: 8px; vertical-align: middle; }
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.board .item { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--tone, var(--straw-500)); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); }
.board .item h3 { font-size: 16px; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.board .item p { margin: 6px 0 0; color: var(--ink-2); }
.minibars { display: inline-flex; align-items: flex-end; gap: 3px; height: 22px; vertical-align: middle; }
.minibars i { display: block; width: 6px; background: var(--green-600); border-radius: 2px 2px 0 0; opacity: .85; }
.minibars i:last-child { opacity: 1; background: var(--straw-500); }
.topbar .sub { font-size: 13.5px; }

/* Slim rail: compact spacing so every menu item fits on a laptop screen */
.hintbar { left: var(--rail); }
body.nav-pinned .hintbar { left: var(--sidebar); }
.nav-section { height: 10px; padding: 0 12px; }
.sidebar:hover .nav-section, .sidebar:focus-within .nav-section, body.nav-pinned .nav-section { height: auto; padding: 12px 12px 4px; }
.sidebar-foot .who, .sidebar-foot .role, .sidebar-foot > form { display: none; }
.sidebar:hover .sidebar-foot .who, .sidebar:hover .sidebar-foot .role, .sidebar:hover .sidebar-foot > form,
.sidebar:focus-within .sidebar-foot .who, .sidebar:focus-within .sidebar-foot .role, .sidebar:focus-within .sidebar-foot > form,
body.nav-pinned .sidebar-foot .who, body.nav-pinned .sidebar-foot .role, body.nav-pinned .sidebar-foot > form { display: block; }
.sidebar-foot { padding: 8px 12px 44px; }
.nav a { padding: 9px 12px; }
@media (max-width: 860px) { .hintbar, body.nav-pinned .hintbar { left: 0; } }

.fields { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 18px; }
.input, .field select.input { min-height: 40px; padding: 8px 11px; }
.form-card .card-body { padding: 14px 18px 16px; }
.ft-row.ft-off { opacity: .6; }
.ft-row .card-head { background: var(--green-50); border-radius: 14px 14px 0 0; }
.hub-feature { border-color: var(--green-600, #2f7d4f); background: var(--green-50); }
.field-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.field-card { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--line, #e3e8e2); border-radius: 12px; background: #fff; color: inherit; text-decoration: none; transition: box-shadow .15s, transform .15s; }
.field-card:hover { box-shadow: 0 6px 18px rgba(20,60,35,.12); transform: translateY(-1px); }
.field-card strong { font-size: 15px; }
.field-card .chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.field-card .chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px; background: var(--green-50); font-size: 12.5px; font-weight: 600; }
.field-card .chip small { font-weight: 400; opacity: .7; }
.field-card .ft-totals { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted, #667); }
.field-card .ft-totals b { color: inherit; font-size: 15px; }
.field-card .live { color: #b26a00; font-weight: 600; }

/* Clean chrome: no shortcut bar, no key badges, no corner buttons (shortcuts still work) */
.hintbar, .collapse-btn { display: none !important; }
kbd { display: none !important; }
.content { padding-bottom: 32px; }
.entry { padding-bottom: 76px; }
.sidebar-foot { padding: 10px 12px 14px; }
.sidebar-foot > form { display: block; margin-top: 0; }
.sidebar-foot .who, .sidebar-foot .role { display: none; }
.sidebar:hover .sidebar-foot .who, .sidebar:focus-within .sidebar-foot .who, body.nav-pinned .sidebar-foot .who,
.sidebar:hover .sidebar-foot .role, .sidebar:focus-within .sidebar-foot .role, body.nav-pinned .sidebar-foot .role { display: block; }
.sidebar-foot > form { opacity: 1; }

/* Bill builder summary */
.bill-sum{display:flex;flex-wrap:wrap;gap:10px;margin-top:16px;padding:14px;background:var(--green-50,#f1f6f2);border-radius:12px}
.bill-sum>div{flex:1 1 110px}
.bill-sum span{display:block;font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted,#5d6d63)}
.bill-sum strong{font-size:16px;font-variant-numeric:tabular-nums}
.bill-sum .grand strong{font-size:22px;color:var(--green-700,#1c4630)}

/* Figure tiles stay two across on a phone so the page is not one long column */
@media (max-width: 860px) {
  .report-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 11px 12px; }
  .tile strong { font-size: 18px; overflow-wrap: anywhere; }
}

/* One sidebar item per area; the pages inside an area are tabs across the top */
.nav-section { display: none; }
.nav a, .nav form { flex-shrink: 0; }
.section-tabs { display: flex; gap: 4px; padding: 0 24px; border-bottom: 1px solid var(--line); background: var(--surface); overflow-x: auto; scrollbar-width: none; }
.section-tabs a { padding: 12px 16px; font-weight: 600; color: var(--muted); white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.section-tabs a:hover { color: var(--ink); text-decoration: none; }
.section-tabs a.on { color: var(--green-700); border-bottom-color: var(--green-700); }

/* Same height for every box on a form */
.field input.input:not(.check), .field select.input { height: 44px; min-height: 44px; padding: 0 12px; }
.field textarea.input { min-height: 88px; }
@media (max-width: 860px) {
  .section-tabs { padding: 0 8px; }
  .section-tabs a { padding: 11px 12px; }
  .nav a { min-width: 0; flex: 1 1 0; }
}

.section-tabs { margin-bottom: 16px; }
.nav-label .short { display: none; }
@media (max-width: 860px) {
  .nav-label .long { display: none; }
  .nav-label .short { display: inline; }
}
