/* Wygląd w stylu Google Sheets */
:root {
  --blue: #1a73e8;
  --blue-d: #0b57d0;
  --blue-l: #d3e3fd;
  --line: #e1e1e1;
  --hdr: #f8f9fa;
  --hink: #5f6368;
  --ink: #202124;
  --tool: #edf2fa;
  --ok-bg: #e6f4ea;
  --ok: #137333;
  --no-bg: #fce8e6;
  --no: #a50e0e;
  color-scheme: light;
}
* { box-sizing: border-box; min-width: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  background: #f9fbfd;
  color: var(--ink);
  font: 14px/1.4 Roboto, Arial, sans-serif;
}
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }

.top { display: flex; align-items: center; gap: 10px; padding: 8px 16px 4px; }
.logo { width: 22px; height: 28px; flex: none; }
.top h1 { margin: 0; font-size: 18px; font-weight: 400; line-height: 1.2; }
.sub { margin: 0; color: var(--hink); font-size: 13px; }
.sync { margin-left: auto; color: var(--hink); font-size: 13px; white-space: nowrap; }
.sync.err { color: var(--no); }

.toolbar { display: flex; align-items: center; gap: 2px; margin: 4px 8px 8px; padding: 4px 8px; background: var(--tool); border-radius: 24px; flex-wrap: wrap; min-height: 40px; }
.toolbar button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 6px 10px; border-radius: 4px; cursor: pointer; min-height: 32px; }
.toolbar button:hover { background: rgba(68, 71, 70, .08); }
.toolbar button:disabled { opacity: .4; cursor: default; background: none; }
.toolbar svg { width: 18px; height: 18px; fill: #444746; }
.tsep { width: 1px; height: 20px; background: #c7c7c7; margin: 0 6px; }
.keys { color: var(--hink); font-size: 13px; }
@media (max-width: 700px) { .keys, .tsep { display: none; } .toolbar button span { display: none; } }

main { position: relative; background: #fff; border-top: 1px solid #c4c7c5; min-height: 0; }
.view { position: absolute; inset: 0; }
.view[hidden] { display: none; }
.scrollv { overflow: auto; }
.scrollv .gw { position: relative; inset: auto; overflow: visible; }
.sheets { display: flex; align-items: flex-start; width: max-content; min-width: 100%; }
#ordersGrid { flex: none; }
#feesGrid { flex: 1; }
.sheet.nofill { min-width: 0; }
.daypane { padding: 20px 16px 32px; border-top: 1px solid #c4c7c5; background: #fff; }
.daypane .more { margin: 8px 0 0; font-size: 13px; }
.daypane .more a { color: var(--blue-d); }
.daypane .empty { padding: 12px 16px; }

/* arkusz */
.gw { position: absolute; inset: 0; overflow: auto; outline: 0; }
table.sheet { border-collapse: separate; border-spacing: 0; table-layout: fixed; width: max-content; min-width: 100%; font: 14px/1.3 Roboto, Arial, sans-serif; }
.sheet col.rnc { width: 46px; }
.sheet col.fill { width: auto; }
.sheet th, .sheet td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); height: 25px; padding: 2px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.sheet thead th { position: sticky; background: var(--hdr); color: var(--hink); font-weight: 400; z-index: 2; border-color: #c4c7c5; }
.sheet tr.let th { top: 0; text-align: center; font-size: 13px; height: 22px; }
.sheet tr.let th.hl { background: var(--blue-l); color: #041e49; font-weight: 500; }
.sheet tr.titles th { top: 23px; color: var(--ink); font-weight: 500; background: #fff; border-bottom: 2px solid #c4c7c5; }
.sheet tr.titles th.n { text-align: right; }
.sheet th.rn, .sheet th.corner { position: sticky; left: 0; background: var(--hdr); color: var(--hink); text-align: center; font-weight: 400; font-size: 13px; z-index: 1; border-color: #c4c7c5; cursor: pointer; }
.sheet thead th.rn, .sheet th.corner { z-index: 3; cursor: default; }
.sheet tr.titles th.rn { color: var(--hink); font-weight: 400; background: var(--hdr); }
.sheet th.rn.hl { background: var(--blue-l); color: #041e49; font-weight: 500; }
.sheet th.fill, .sheet td.fill { border-right: 0; background: transparent; }
.sheet td { cursor: cell; background: #fff; }
.sheet td.n { text-align: right; font-variant-numeric: tabular-nums; }
.sheet td.chk { text-align: center; }
.sheet td.calc { color: var(--hink); background: #f8f9fa; cursor: default; }
.sheet td.sel { box-shadow: inset 0 0 0 2px var(--blue); }
.sheet td.editing { box-shadow: inset 0 0 0 2px var(--blue); padding: 0; overflow: visible; }
.sheet tr.rsel td:not(.fill) { background: #e8f0fe; }
.sheet tr.ok td:not(.fill) { background: var(--ok-bg); color: var(--ok); }
.sheet tr.no td:not(.fill) { background: var(--no-bg); color: var(--no); }
.sheet tr.ok.rsel td:not(.fill), .sheet tr.no.rsel td:not(.fill) { background: #e8f0fe; }
.ph { color: #9aa0a6; font-style: italic; }
.ce { width: 100%; height: 25px; border: 0; padding: 2px 6px; background: #fff; outline: 0; font: 14px Roboto, Arial, sans-serif; color: var(--ink); }
.ce.bad { background: var(--no-bg); }
.cb { display: inline-block; width: 16px; height: 16px; border: 2px solid #5f6368; border-radius: 2px; vertical-align: middle; cursor: pointer; position: relative; background: #fff; }
.cb.on { background: var(--blue); border-color: var(--blue); }
.cb.on::after { content: ""; position: absolute; left: 3.5px; top: 0; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.dd { position: absolute; z-index: 5; background: #fff; border-radius: 4px; box-shadow: 0 2px 6px rgba(60, 64, 67, .3), 0 1px 2px rgba(60, 64, 67, .2); padding: 4px 0; max-height: 260px; overflow: auto; }
.dd div { padding: 6px 12px; cursor: pointer; white-space: nowrap; }
.dd div:hover, .dd div.hi { background: #e8f0fe; }

/* zakładki */
.tabsbar { display: flex; align-items: center; gap: 8px; background: var(--hdr); border-top: 1px solid #c4c7c5; padding: 0 8px; min-height: 44px; }
.tabs { display: flex; gap: 2px; overflow-x: auto; flex: 1; align-items: center; scrollbar-width: thin; }
.tabs button { flex: none; border: 0; background: none; padding: 8px 14px; border-radius: 4px 4px 0 0; cursor: pointer; color: #444746; min-height: 40px; white-space: nowrap; }
.tabs button:hover { background: rgba(68, 71, 70, .08); }
.tabs button.on { background: #e1e9f7; color: var(--blue-d); font-weight: 500; box-shadow: inset 0 -3px 0 var(--blue-d); }
.tabs .add { font-size: 20px; line-height: 1; padding: 6px 12px; border-radius: 50%; }
.tabs .sp { flex: 1 0 12px; }
.tabs .fixed { color: var(--blue-d); }
.stat { color: var(--hink); font-size: 13px; white-space: nowrap; padding-left: 8px; }
.stat b { color: var(--ink); font-weight: 500; }
@media (max-width: 700px) { .tabsbar { flex-wrap: wrap; padding-bottom: 4px; } .stat { width: 100%; padding: 0 4px 4px; } }

/* popover nowego dnia */
.pop { position: fixed; left: 12px; bottom: 54px; z-index: 10; background: #fff; border-radius: 8px; box-shadow: 0 4px 12px rgba(60, 64, 67, .3); padding: 14px; display: grid; gap: 8px; width: 240px; }
.pop[hidden] { display: none; }
.pop label { font-weight: 500; }
.pop input { border: 1px solid #c4c7c5; border-radius: 4px; padding: 8px; font-size: 16px; }
.pop .row { display: flex; justify-content: flex-end; gap: 6px; }
.primary { background: var(--blue-d); color: #fff; border: 0; border-radius: 18px; padding: 8px 18px; cursor: pointer; font-weight: 500; }
.ghost { background: none; border: 0; color: var(--blue-d); padding: 8px 12px; border-radius: 18px; cursor: pointer; font-weight: 500; }

.toast { position: fixed; left: 50%; bottom: 60px; transform: translateX(-50%); background: #323232; color: #fff; padding: 10px 16px; border-radius: 4px; z-index: 20; max-width: calc(100vw - 32px); }
.toast[hidden] { display: none; }

/* rozliczenie */
.settle { overflow: auto; padding: 16px; }
.settle h2 { font-size: 16px; font-weight: 500; margin: 0 0 8px; }
.settle h2 + p { margin: -4px 0 10px; color: var(--hink); font-size: 13px; }
.settle section { margin-bottom: 28px; }
.settle .wrapx { overflow-x: auto; }
.settle table { border-collapse: collapse; font: 14px/1.3 Roboto, Arial, sans-serif; }
.settle th, .settle td { border: 1px solid var(--line); padding: 5px 8px; text-align: left; vertical-align: top; }
.settle thead th { background: var(--hdr); font-weight: 500; white-space: nowrap; }
.settle td.n, .settle th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.settle tr.tot td { font-weight: 500; border-top: 2px solid #c4c7c5; }
.settle .who { font-weight: 500; white-space: nowrap; }
.settle .acc { font-variant-numeric: tabular-nums; white-space: nowrap; }
.settle .items { color: var(--hink); font-size: 13px; min-width: 220px; max-width: 420px; white-space: normal; }
.settle .miss { color: var(--no); }
.settle tr.no td { background: var(--no-bg); }
.settle .empty { padding: 24px; background: var(--ok-bg); color: var(--ok); border-radius: 8px; max-width: 520px; }
.settle .zero { color: #bdc1c6; }
@media (max-width: 700px) { .sub { display: none; } }
