/* Inter (SIL Open Font License, see fonts/LICENSE-Inter.txt), self-hosted. */
/* Greek and Cyrillic are only downloaded on pages that use them (Ελληνικά, Български, Українська). */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/assets/fonts/inter-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/assets/fonts/inter-greek.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/assets/fonts/inter-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/assets/fonts/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #eef1f6;
  --border: #dde2ea;
  --text: #0f172a;
  --text-muted: #5b6577;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #e0e7ff;
  --in: #059669;
  --in-hover: #047857;
  --in-soft: #d1fae5;
  --out: #e11d48;
  --out-hover: #be123c;
  --out-soft: #ffe4e6;
  --warn: #b45309;
  /* On a break: between clocked in and out. */
  --break: #d97706;
  --break-hover: #b45309;
  --break-soft: #fef3c7;
  --warn-soft: #fef3c7;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 4px 16px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.18);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  overflow-wrap: break-word;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

/* Font Awesome icons (Plannix.icon(), tools/icons.js): as tall as the text, in its colour. */
.icon {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  fill: currentColor;
  vertical-align: -0.125em;
}

.btn {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
  text-align: center;
}
.btn:hover {
  background: var(--surface-2);
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}
.btn-danger {
  color: var(--out);
}
.btn-danger:hover {
  background: var(--out-soft);
  border-color: var(--out);
}
.btn-sm {
  padding: 5px 10px;
  font-size: 13px;
}
.btn-ghost {
  background: transparent;
  border-color: transparent;
}
/* "Reset filters": at the end of a page's filters, as tall as they are. */
.filters-reset {
  min-height: 40px;
  color: var(--primary);
}

.avatar {
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
  flex-shrink: 0;
}
.avatar-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.pill::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.pill-in {
  background: var(--in-soft);
  color: var(--in);
}
.pill-out {
  background: var(--surface-2);
  color: var(--text-muted);
}
.pill-break {
  background: var(--break-soft);
  color: var(--break-hover);
}

.toast-host {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
  width: min(420px, calc(100vw - 32px));
}
.toast {
  background: var(--text);
  color: var(--bg);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  animation: toast-in 0.2s ease-out;
}
.toast.error {
  background: var(--out);
  color: #fff;
}
/* What a demo company would have emailed if it were a real one. */
.toast.demo {
  background: var(--primary);
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ---- PIN pad ---- */
.pin-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.pin-card {
  background: var(--surface);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  padding: 32px 28px 28px;
  width: min(360px, 100%);
  text-align: center;
  user-select: none;
}
.pin-card.shake {
  animation: shake 0.35s;
}
@keyframes shake {
  20%,
  60% {
    transform: translateX(-8px);
  }
  40%,
  80% {
    transform: translateX(8px);
  }
}
.pin-title {
  margin: 10px 0 4px;
  font-size: 22px;
  letter-spacing: -0.02em;
}
.pin-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}
.pin-dots {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 24px 0 6px;
  min-height: 16px;
}
.pin-dots span {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border);
}
.pin-dots span.on {
  background: var(--primary);
  border-color: var(--primary);
}
.pin-error {
  color: var(--out);
  font-weight: 600;
  font-size: 14px;
  min-height: 20px;
  margin: 6px 0 10px;
}
.pin-keys {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.pin-key {
  height: 64px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 26px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.1s, transform 0.05s;
}
.pin-key:hover {
  background: var(--border);
}
.pin-key:active {
  transform: scale(0.96);
}
.pin-key-fn {
  background: transparent;
  font-size: 22px;
}
.pin-key-ok {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.pin-key-ok:hover {
  background: var(--primary-hover);
}

.hidden {
  display: none !important;
}

/* ------------------------------------------------------------ language -- */

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: inherit;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  cursor: pointer;
}
.lang-btn:hover {
  background: var(--surface-2);
}
/* Flags (public/assets/flags, from flag-icons, MIT): a thin edge keeps white flags visible on white. */
.lang-flag {
  flex-shrink: 0;
  border-radius: 2px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12);
}

.lang-dialog {
  width: min(560px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  padding: 20px;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}
.lang-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
  /* The page behind a dialog is out of focus, not just darker. */
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.lang-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.lang-dialog .lang-dialog-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: normal;
  line-height: 1.3;
}
.lang-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: left;
  font-size: 15px;
  cursor: pointer;
}
.lang-option:hover {
  background: var(--surface-2);
}
.lang-option[aria-current] {
  border-color: var(--primary);
  background: var(--primary-soft);
  font-weight: 600;
}

/* ------------------------------------------------------------ tables -- */

/* Every table looks like the backoffice's Employees table: a quiet header, a row per person or thing with who or what
   it is first (an avatar and a name, details under it), tags for states, and the buttons at the end. A row that opens
   something has an arrow at its end. Where a table doesn't fit, every row becomes a card, each value under its
   column's name, so nothing scrolls sideways: on a phone, but also next to the backoffice's menu on a tablet, or in a
   column of the dashboard. common.js measures each table and marks the ones that fit (.fits). */
.table-wrap {
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table th,
.data-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--surface-2);
  font-weight: 700;
  white-space: nowrap;
}
/* A column to sort by: its header is a button (as wide as the header, so a tap anywhere on it sorts), the arrow shows
   how it is sorted. */
.data-table .sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}
.data-table .sort:hover,
.data-table th[aria-sort='ascending'] .sort,
.data-table th[aria-sort='descending'] .sort {
  color: var(--text);
}
.data-table tbody tr:hover {
  background: color-mix(in srgb, var(--surface-2) 50%, transparent);
}
.data-table tbody tr:last-child td {
  border-bottom: 0;
}
.data-table tfoot td {
  border-top: 2px solid var(--border);
  border-bottom: 0;
  background: var(--surface-2);
}
.data-table td.num,
.data-table th.num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.data-table td.actions {
  text-align: right;
  white-space: nowrap;
}
.data-table td.actions .btn + .btn {
  margin-left: 6px;
}
.data-table tr.inactive td {
  opacity: 0.55;
}
/* Who or what the row is: an avatar and a name, with details under it. */
.cell-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.cell-name {
  min-width: 0;
  font-weight: 600;
  /* Between words only, so a table squeezes no name letter by letter: it becomes cards first. */
  overflow-wrap: break-word;
}
/* A name that links to its own page looks like the other names. */
a.cell-name {
  color: inherit;
  text-decoration: none;
}
a.cell-name:hover,
a.cell-name:focus-visible {
  text-decoration: underline;
}
.data-table .sub {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 400;
}
/* A row that opens what it shows (with Enter too). */
.data-table tr.row-link {
  cursor: pointer;
}
.data-table tr.row-link:hover,
.data-table tr.row-link:focus-visible {
  background: var(--primary-soft);
  outline: none;
}
.data-table .chevron {
  width: 24px;
  color: var(--text-muted);
  font-size: 22px;
  text-align: right;
}
.empty-row {
  text-align: center;
  color: var(--text-muted);
  padding: 36px 16px;
}

/* States in a table (and elsewhere): a small label. */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}
.tag-ok {
  color: var(--in);
}
.tag-live {
  color: var(--primary);
}
.tag-warn {
  background: var(--warn-soft);
  color: var(--warn);
}
/* What an employee can do (a skill): green, beside the departments' indigo. */
.tag-skill {
  background: var(--in-soft);
  color: var(--in);
}
/* "+3 more": the tags a row leaves out (Plannix.tagList), named in its title. */
.tag-more {
  background: none;
  box-shadow: inset 0 0 0 1px var(--border);
  cursor: help;
}
/* Several tags together, spaced whether they sit side by side or wrap. */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
}

.table-wrap:not(.fits) .data-table,
.table-wrap:not(.fits) .data-table tbody,
.table-wrap:not(.fits) .data-table tfoot {
  display: block;
}
.table-wrap:not(.fits) .data-table thead {
  display: none;
}
/* The headers of a table that sorts stay, as a row of chips to tap. */
.table-wrap:not(.fits) .data-table.sortable thead {
  display: block;
}
.table-wrap:not(.fits) .data-table.sortable thead tr {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.table-wrap:not(.fits) .data-table.sortable thead th {
  display: none;
}
.table-wrap:not(.fits) .data-table.sortable thead th[data-sort] {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 4px 12px;
  border: 0;
  border-radius: 999px;
}
/* The values side by side, as many as fit and at least two (a table can set how narrow they may be: --card-column).
   A long one (cell-wide: an email address, a list) takes two places, and the short ones after it fill the gaps. On a
   phone that is two by two; a card as wide as a tablet shows a row of them. */
.table-wrap:not(.fits) .data-table tr {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(var(--card-column, 150px), calc(50% - 7px)), 1fr));
  grid-auto-flow: row dense;
  gap: 8px 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.table-wrap:not(.fits) .data-table tbody tr:last-child {
  border-bottom: 0;
}
.table-wrap:not(.fits) .data-table td {
  display: block;
  min-width: 0;
  padding: 0;
  border: 0;
  overflow-wrap: anywhere;
}
.table-wrap:not(.fits) .data-table td[data-label]::before {
  content: attr(data-label);
  display: block;
  margin-bottom: 3px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.table-wrap:not(.fits) .data-table .cell-main,
.table-wrap:not(.fits) .data-table td.actions {
  grid-column: 1 / -1;
}
.table-wrap:not(.fits) .data-table .cell-wide {
  grid-column: span 2;
}
.table-wrap:not(.fits) .data-table td.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  text-align: left;
  white-space: normal;
}
/* Big enough for a finger. */
.table-wrap:not(.fits) .data-table td.actions .btn {
  min-height: 40px;
}
.table-wrap:not(.fits) .data-table td.actions .btn + .btn {
  margin-left: 0;
}
.table-wrap:not(.fits) .data-table td:empty,
.table-wrap:not(.fits) .data-table .chevron {
  display: none;
}
/* A card that opens something says so with its arrow, top right. */
.table-wrap:not(.fits) .data-table tr.row-link .chevron {
  display: block;
  position: absolute;
  top: 14px;
  right: 14px;
}
.table-wrap:not(.fits) .data-table tr.row-link .cell-main {
  padding-right: 24px;
}
/* The totals: one card in the header's grey. */
.table-wrap:not(.fits) .data-table tfoot tr {
  background: var(--surface-2);
}
.table-wrap:not(.fits) .data-table tfoot td {
  border-top: 0;
  background: none;
}

/* Under a list that comes a page at a time (Plannix.pagerHtml): which rows these are, how many rows a page has (a
   table), and the pages before and after. Where it is narrow, the buttons go under the rest. */
.pager {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}
.pager-range {
  margin-right: auto;
  color: var(--text-muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.pager-size {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 400;
}
/* As tall as the buttons next to it: a target for a finger too. */
.pager-size select {
  min-height: 38px;
  padding: 5px 8px;
}
.pager-buttons {
  display: flex;
  gap: 8px;
}
.pager .btn {
  min-height: 38px;
}

/* A list to choose any number of options from, that can be searched (Plannix.searchSelect): it opens below the
   button, in the page's flow, so it also works inside dialogs and next to a touch keyboard. */
.search-select {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.search-select-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 400;
  text-align: left;
  cursor: pointer;
}
.search-select-button:focus-visible,
.search-select-button[aria-expanded='true'] {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  outline: none;
}
.search-select-none .search-select-value {
  color: var(--text-muted);
}
.search-select-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* A flag before an option's label (Plannix.searchPick), with an edge like the language picker's flags. */
.search-select-image {
  flex-shrink: 0;
  border-radius: 2px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12);
}
.search-select-value .search-select-image {
  margin-right: 10px;
  vertical-align: -2px;
}
.search-select-arrow {
  color: var(--text-muted);
}
.search-select-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
}
/* There are more matches than shown (Plannix.searchPick): typing narrows them. */
.search-select-more {
  margin: 0;
  padding: 4px 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 400;
}
.search-select-list {
  max-height: 240px;
  overflow-y: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}
.search-select-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text);
  font: inherit;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.search-select-option:hover,
.search-select-option:focus-visible {
  background: var(--surface-2);
  outline: none;
}
.search-select-option[aria-selected='true'] {
  background: var(--primary-soft);
  font-weight: 600;
}
/* A box before each option, ticked when it is chosen: a tap chooses it or takes it off. */
.search-select-tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: transparent;
  font-size: 11px;
}
.search-select-option[aria-selected='true'] .search-select-tick {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.search-select-done {
  align-self: flex-end;
}
.search-select-empty {
  margin: 0;
  padding: 10px 12px;
  color: var(--text-muted);
}

/* Read out by screen readers, not shown: the name of a field whose meaning its place shows. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
