:root {
  color-scheme: dark;
  --plane: #080f20;
  --surface: #111e35;
  --surface-2: #192a45;
  --ink: #eef3fb;
  --ink-2: #bbcade;
  --muted: #97abc6;
  --ring: #2b4160;
  --accent: #86b9f5;
  --good: #77d9c0;
  --warning: #dfc393;
  --critical: #ff999e;
}
:root[data-theme="light"] {
  color-scheme: light;
  --plane: #e9eef5;
  --surface: #fff;
  --surface-2: #f0f4f9;
  --ink: #14233b;
  --ink-2: #405674;
  --muted: #536782;
  --ring: #cdd9e8;
  --accent: #346dab;
  --good: #168269;
  --warning: #85601e;
  --critical: #b62e42;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--plane);
  color: var(--ink);
  font:
    16px/1.55 system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  -webkit-font-smoothing: antialiased;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  min-height: 44px;
  border: 1px solid var(--ring);
  border-radius: 8px;
  padding: 8px 15px;
  background: var(--surface-2);
  color: var(--ink);
}
button:hover {
  border-color: var(--accent);
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button.primary {
  background: var(--accent);
  color: var(--plane);
  border-color: transparent;
  font-weight: 700;
}
:root[data-theme="light"] button.primary {
  color: white;
}
button.ghost {
  background: var(--surface);
  color: var(--ink-2);
}
button.danger {
  background: var(--surface-2);
  color: var(--critical);
}
button.danger:hover {
  border-color: var(--critical);
}
button.link.error {
  color: var(--critical);
}
a {
  color: var(--accent);
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
.wrap {
  max-width: 1140px;
  margin: auto;
  padding: 24px 20px 40px;
}
header,
.header-actions,
.section-head,
.dialog-head,
.actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
header {
  justify-content: space-between;
  margin-bottom: 24px;
}
h1 {
  font-size: 23px;
  margin: 0;
}
h2 {
  font-size: 21px;
  margin: 0 0 16px;
}
h3 {
  font-size: 18px;
  margin: 0;
}
p {
  margin: 8px 0;
}
.muted,
small,
footer {
  color: var(--muted);
}
small {
  font-size: 13px;
}
.tabs {
  display: flex;
  border-bottom: 1px solid var(--ring);
  gap: 8px;
  overflow: auto;
  padding-bottom: 10px;
}
.tabs button {
  white-space: nowrap;
  border: 0;
  background: none;
  color: var(--ink-2);
}
.tabs button[aria-current="page"] {
  background: var(--surface-2);
  color: var(--accent);
  box-shadow: inset 0 -3px var(--accent);
}
.filters {
  display: flex;
  align-items: end;
  gap: 12px;
  margin: 22px 0;
}
.filters label {
  min-width: 180px;
}
.filters button {
  margin-inline-start: auto;
}
label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: var(--ink-2);
}
input,
select,
textarea {
  min-width: 0;
  width: 100%;
  min-height: 44px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--ring);
  border-radius: 7px;
  padding: 9px 11px;
}
input[type="time"],
input[type="date"],
input[type="month"],
input[type="number"] {
  direction: ltr;
  text-align: start;
}
textarea {
  resize: vertical;
}
input[type="checkbox"] {
  width: 20px;
  min-height: 20px;
}
label.check {
  display: flex;
  align-items: center;
}
.section-head {
  justify-content: space-between;
  margin: 24px 0 14px;
}
.section-head h2 {
  margin: 0;
}
.panel {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--ring);
  border-radius: 12px;
  margin: 16px 0;
}
.empty {
  padding: 45px 20px;
  text-align: center;
  border: 1px dashed var(--ring);
  border-radius: 12px;
}
.empty p {
  max-width: 480px;
  margin: 8px auto 20px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  border: 1px solid var(--ring);
  border-radius: 12px;
  overflow: hidden;
  background: var(--ring);
}
.metric {
  background: var(--surface);
  padding: 20px;
}
.metric span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}
.metric strong {
  display: block;
  font-size: 29px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  margin: 8px 0;
  direction: ltr;
  text-align: right;
}
.metric:first-child {
  box-shadow: inset 0 3px var(--good);
}
.money {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.good {
  color: var(--good);
}
.warn {
  color: var(--warning);
}
.error {
  color: var(--critical);
}
.notice {
  padding: 12px 16px;
  background: var(--surface-2);
  border-inline-start: 3px solid var(--warning);
  border-radius: 6px;
  margin: 14px 0;
}
.notice.error {
  border-color: var(--critical);
}
.notice:empty,
#status:empty {
  display: none;
}
.scroll {
  overflow-x: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 15px;
}
th {
  text-align: right;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
td,
th {
  padding: 14px 10px;
  border-bottom: 1px solid var(--ring);
}
td:first-child,
th:first-child {
  padding-inline-start: 0;
}
td:last-child,
th:last-child {
  padding-inline-end: 0;
}
.shift-list {
  display: grid;
  gap: 12px;
}
.shift {
  border: 1px solid var(--ring);
  background: var(--surface);
  border-radius: 10px;
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}
.shift .amount {
  font-size: 24px;
  font-weight: 650;
}
.shift .actions {
  grid-column: 1/-1;
  border-top: 1px solid var(--ring);
  padding-top: 12px;
  flex-wrap: wrap;
}
.shift .actions .danger {
  margin-inline-start: auto;
}
.badge {
  font-size: 12px;
  border: 1px solid var(--ring);
  border-radius: 999px;
  padding: 3px 9px;
  display: inline-block;
}
.shift-date {
  color: var(--muted);
  font-size: 14px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 16px;
}
.job {
  padding: 20px;
  border: 1px solid var(--ring);
  border-radius: 12px;
  background: var(--surface);
}
.job button {
  margin-top: 12px;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.receipt {
  background: var(--surface);
  border: 1px solid var(--ring);
  border-radius: 10px;
  overflow: hidden;
}
.receipt img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  background: var(--surface-2);
  display: block;
}
.receipt .body {
  padding: 14px;
}
.receipt button {
  margin-top: 10px;
}
.receipt .actions {
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}
.receipt p {
  overflow-wrap: anywhere;
}
.receipt .heic {
  height: 140px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
}
footer {
  font-size: 12px;
  text-align: center;
  padding-top: 34px;
}
dialog {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--ring);
  border-radius: 14px;
  padding: 24px;
  width: min(660px, calc(100% - 24px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
}
dialog::backdrop {
  background: #020815bb;
}
.dialog-head {
  justify-content: space-between;
  margin-bottom: 20px;
}
.dialog-head h2 {
  margin: 0;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.full {
  grid-column: 1/-1;
}
fieldset {
  border: 1px solid var(--ring);
  border-radius: 8px;
  padding: 14px;
  margin: 0;
}
legend {
  color: var(--muted);
  padding: 0 8px;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  position: sticky;
  bottom: -24px;
  padding: 14px 0;
  background: var(--surface);
}
.breakdown {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 16px;
}
.breakdown strong.total {
  font-size: 30px;
  color: var(--good);
}
.breakdown dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  font-size: 14px;
}
.breakdown dd {
  margin: 0;
  direction: ltr;
}
.breakdown dt {
  color: var(--ink-2);
}
.breakdown details {
  font-size: 13px;
}
.file-list {
  display: grid;
  gap: 8px;
}
.file-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  overflow-wrap: anywhere;
}
.subfilters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 14px 0;
}
.subfilters label {
  min-width: 150px;
}
.nudge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--ring);
}
pre {
  direction: ltr;
  text-align: left;
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
}
#status:not(:empty) {
  margin: 12px 0;
  padding: 12px;
  background: var(--surface-2);
  border-radius: 6px;
}
summary {
  cursor: pointer;
  padding: 8px 0;
}
button.link {
  border: 0;
  padding: 4px;
  background: none;
  color: var(--accent);
}
.payslip-line {
  border: 1px solid var(--ring);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
  background: var(--surface-2);
}
.danger-zone {
  border-top: 1px solid var(--ring);
  padding-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.danger-zone small {
  color: var(--muted);
}
.line-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.line-warn {
  margin: 10px 0 0;
  font-size: 13px;
}
#payslip-totals {
  margin-top: 12px;
}
.payslip-table {
  min-width: 520px;
}
.alert-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--ring);
}
.alert-row:last-child {
  border-bottom: 0;
}
.alert-row p {
  margin: 6px 0 0;
  color: var(--ink-2);
  font-size: 14px;
}
.alert-row button {
  flex: 0 0 auto;
}
#alert-badge {
  margin-inline-start: 6px;
  border-color: var(--critical);
  color: var(--critical);
}
@media (max-width: 700px) {
  .wrap {
    padding: 16px 14px 30px;
  }
  header {
    gap: 8px;
    align-items: start;
    margin-bottom: 18px;
  }
  header .muted {
    font-size: 12px;
  }
  h1 {
    font-size: 21px;
  }
  .header-actions {
    gap: 6px;
  }
  .header-actions button {
    padding: 8px 11px;
  }
  .filters {
    flex-wrap: wrap;
    gap: 10px;
  }
  .filters label {
    min-width: 0;
    flex: 1;
  }
  .filters button {
    flex: 0 0 auto;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
  }
  .metric {
    padding: 16px;
  }
  .metric strong {
    font-size: 25px;
  }
  .tabs {
    gap: 0;
  }
  .tabs button {
    padding: 9px 13px;
    font-size: 14px;
  }
  .panel {
    padding: 16px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .full {
    grid-column: auto;
  }
  dialog {
    padding: 18px;
  }
  .form-actions {
    bottom: -18px;
  }
  .gallery {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .receipt img {
    height: 155px;
  }
  .receipt .body {
    padding: 10px;
  }
  .receipt p {
    font-size: 14px;
  }
  .nudge-row {
    align-items: start;
  }
  .shift {
    gap: 10px;
  }
  .shift .amount {
    font-size: 22px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
@media (max-width: 700px) {
  .filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .filters label:first-child {
    grid-column: 1 / -1;
  }
  .job-totals,
  .job-totals tbody {
    display: block;
  }
  .job-totals thead {
    display: none;
  }
  .job-totals tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 16px 0;
    border-bottom: 1px solid var(--ring);
    gap: 12px;
  }
  .job-totals tr:first-child {
    padding-top: 0;
  }
  .job-totals td {
    border: 0;
    padding: 0;
    white-space: normal;
  }
  .job-totals td:first-child {
    grid-column: 1 / -1;
    font-weight: 650;
  }
  .job-totals td::before {
    content: attr(data-label);
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 4px;
  }
  .job-totals td:first-child::before {
    display: none;
  }
  .breakdown dl {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .breakdown dd {
    margin-bottom: 10px;
    text-align: right;
  }
  .payslip-table,
  .payslip-table tbody {
    display: block;
    min-width: 0;
  }
  .payslip-table thead {
    display: none;
  }
  .payslip-table tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 14px 0;
    border-bottom: 1px solid var(--ring);
    gap: 10px;
  }
  .payslip-table tr:first-child {
    padding-top: 0;
  }
  .payslip-table td {
    border: 0;
    padding: 0;
    white-space: normal;
  }
  .payslip-table td[data-label="תיאור"] {
    grid-column: 1 / -1;
    font-weight: 650;
  }
  .payslip-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 4px;
  }
}
