/* Kancelária — accountant's office. Uses tokens from base.css only (DESIGN.md). */

.office { max-width: 1240px; }
.office-head h1 { font-size: var(--f-33); line-height: 40px; max-width: 40ch; text-wrap: balance; }
.office-head p { font-size: var(--f-15); }
.office-head .btn { flex: none; }

/* toolbar */
.toolbar { display: flex; align-items: center; gap: var(--s-3); margin: 0 0 var(--s-3); flex-wrap: wrap; }
.search { position: relative; flex: 1 1 320px; max-width: 440px; display: block; }
.search > svg { position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--ink-2); pointer-events: none; }
.toolbar .search input[type="search"] { padding-left: 40px; padding-right: 40px; }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 500 12px/1 "Onest", sans-serif;
  padding: 3px 6px; border: 1px solid var(--rule); border-radius: 4px; color: var(--ink-2); }
.search input:focus + kbd { display: none; }
.toggle .count { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--bad-wash); color: var(--bad); font-size: var(--f-13); font-weight: 650; }
.toggle[aria-pressed="true"] { background: var(--bad-wash); border-color: color-mix(in srgb, var(--bad) 45%, var(--rule)); color: var(--bad); }
.toggle[aria-pressed="true"] .count { background: var(--bad); color: var(--sheet); }
#shown { margin-left: auto; font-size: var(--f-13); }

/* the working table sits on the desk directly: rules, not cards */
table.clients { background: var(--sheet); border-radius: var(--r-sheet); border: 1px solid var(--rule); border-collapse: separate; border-spacing: 0; }
table.clients thead th { position: sticky; top: 0; background: var(--sheet); z-index: 1; padding-top: var(--s-3); white-space: nowrap; }
table.clients thead th:first-child { border-top-left-radius: var(--r-sheet); }
table.clients td { vertical-align: middle; padding-top: 14px; padding-bottom: 14px; }
table.clients tbody tr:last-child td { border-bottom: 0; }
tr.client { cursor: pointer; }
tr.client:focus-within { background: var(--stamp-wash); }
tr.client td:first-child { box-shadow: inset 3px 0 0 transparent; }
tr.client.hot-bad td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
tr.client.hot-warn td:first-child { box-shadow: inset 3px 0 0 var(--warn); }

.who a { display: block; color: var(--ink); font-weight: 600; text-decoration: none; }
.who a:hover { text-decoration: underline; }
.who a:focus-visible { box-shadow: none; text-decoration: underline; text-decoration-color: var(--stamp); text-decoration-thickness: 2px; }
.who .sub { display: block; font-size: var(--f-13); line-height: 18px; color: var(--ink-2); margin-top: 2px; }
.c-caka b { font-size: var(--f-17); font-weight: 650; }
.c-over b { display: block; font-weight: 650; color: var(--bad); }
.c-over .sub, .c-krit .why { display: block; font-size: var(--f-13); line-height: 18px; color: var(--ink-2); margin-top: 2px; }
.c-krit .why { padding-left: 4px; }
.nil { color: var(--ink-2); opacity: .6; }
.due { white-space: nowrap; font-variant-numeric: tabular-nums; }
.due span { color: var(--ink-2); margin-left: 6px; font-size: var(--f-13); }
.due-warn, .due-warn span { color: var(--warn); font-weight: 600; }
.c-last { white-space: nowrap; font-size: var(--f-13); }

.none { padding: var(--s-6) var(--s-4); text-align: center; color: var(--ink-2); }
.linkish { background: none; border: 0; padding: 0; color: var(--stamp); font: inherit; text-decoration: underline; cursor: pointer; }
.keys { margin-top: var(--s-4); font-size: var(--f-13); }
.keys kbd { font: 500 12px/1 "Onest", sans-serif; padding: 3px 6px; border: 1px solid var(--rule); border-radius: 4px; background: var(--sheet); color: var(--ink); }

/* add-client dialog */
dialog#add { border: 0; border-radius: var(--r-sheet); padding: 0; background: var(--sheet); color: var(--ink);
  box-shadow: var(--sheet-shadow); width: min(440px, calc(100vw - 32px)); }
dialog#add::backdrop { background: color-mix(in srgb, var(--ink) 35%, transparent); }
.add-form { display: grid; gap: var(--s-4); padding: var(--s-5); }
.period { border: 0; padding: 0; margin: 0; display: flex; gap: var(--s-4); flex-wrap: wrap; }
.period legend { font-size: var(--f-13); font-weight: 500; color: var(--ink-2); margin-bottom: var(--s-2); padding: 0; }
.period label { display: inline-flex; align-items: center; gap: var(--s-2); }
.period input { accent-color: var(--stamp); width: 18px; height: 18px; }
.add-actions { display: flex; gap: var(--s-2); }

/* bar above a client's desk */
.client-bar { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-6); border-bottom: 1px solid var(--rule);
  background: var(--sheet); font-size: var(--f-13); }
.client-bar a { color: var(--ink-2); }
.client-bar b { color: var(--ink); font-weight: 600; }
.client-bar .client-back { margin-left: auto; color: var(--stamp); font-weight: 550; white-space: nowrap; }
.client-bar span { color: var(--ink-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* tablet: drop the least important column */
@media (max-width: 1099px) { .clients .c-last, .clients th:last-child { display: none; } }

/* phone: the same rows become a list */
@media (max-width: 767px) {
  .office-head h1 { font-size: var(--f-26); line-height: 32px; }
  .office-head .btn { width: 100%; }
  .search { flex-basis: 100%; max-width: none; }
  .search kbd, .keys { display: none; }
  #shown { margin-left: 0; }
  table.clients, table.clients tbody { display: block; }
  table.clients thead { display: none; }
  tr.client { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px var(--s-4); padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--rule); }
  tr.client:last-child { border-bottom: 0; }
  tr.client.hot-bad { box-shadow: inset 3px 0 0 var(--bad); }
  tr.client.hot-warn { box-shadow: inset 3px 0 0 var(--warn); }
  tr.client td { display: block; padding: 0; border: 0; box-shadow: none !important; text-align: left; font-size: var(--f-13); }
  tr.client .who { flex: 1 0 100%; font-size: var(--f-15); }
  tr.client td.c-caka::before, tr.client td.c-over::before, tr.client td.c-due::before {
    content: attr(data-label) " "; color: var(--ink-2); }
  tr.client td.c-caka b { font-size: var(--f-15); }
  tr.client td.c-over b, tr.client td.c-over .sub { display: inline; margin: 0; }
  tr.client td.c-over .sub::before { content: ", "; }
  tr.client .c-krit .why { display: inline; padding-left: 6px; }
  tr.client .c-krit { flex: 1 0 100%; }
  tr.client td:has(> .nil) { display: none; }
  tr.client .c-last { display: none; }
  .client-bar { padding: var(--s-2) var(--s-4); }
  .client-bar > a:first-child, .client-bar > span[aria-hidden] { display: none; }  /* "Späť do kancelárie" says it */
}
