:root {
  --ink: #17221d;
  --muted: #69736e;
  --soft: #f4f6f3;
  --line: #e4e8e4;
  --panel: #ffffff;
  --green: #204f3d;
  --green-2: #2f6a53;
  --green-soft: #eaf2ed;
  --mint: #cce7d8;
  --orange: #d98743;
  --orange-soft: #fff0e2;
  --red: #bc4d4d;
  --red-soft: #fae9e7;
  --blue: #4776a8;
  --blue-soft: #eaf1f8;
  --shadow: 0 12px 35px rgba(24, 48, 38, 0.08);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html {
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #eef1ed;
}

body {
  margin: 0;
  min-width: 320px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  min-height: 100vh;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

@media (max-width: 900px) {
  .report-grid {
    grid-template-columns: 1fr;
  }
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 25px 18px 18px;
  color: #eef7f2;
  background:
    radial-gradient(circle at 10% 0%, rgba(104, 173, 138, 0.22), transparent 27%),
    linear-gradient(180deg, #183d30 0%, #123126 100%);
  z-index: 20;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 10px 27px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 13px;
  color: #15382c;
  background: #d5eee0;
  font: 800 21px Georgia, serif;
}

.brand strong {
  display: block;
  font: 800 18px Georgia, serif;
  letter-spacing: 0.12em;
}

.brand span,
.sidebar-user span,
.support-card span {
  display: block;
  margin-top: 3px;
  color: #9fb8ac;
  font-size: 11px;
}

.main-nav {
  flex: 1;
  overflow-y: auto;
}

.nav-label {
  margin: 16px 12px 8px;
  color: #809d8f;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-item {
  position: relative;
  display: flex;
  width: 100%;
  align-items: center;
  gap: 13px;
  margin: 3px 0;
  padding: 11px 13px;
  border: 0;
  border-radius: 10px;
  color: #afc5bb;
  background: transparent;
  text-align: left;
  transition: 160ms ease;
}

.nav-item:hover,
.nav-item.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.nav-item.active::before {
  position: absolute;
  left: -18px;
  width: 3px;
  height: 24px;
  border-radius: 0 4px 4px 0;
  background: #8fd0aa;
  content: "";
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 20px;
  border: 1px solid rgba(202, 231, 215, 0.18);
  border-radius: 6px;
  color: #cce7d8;
  font-size: 10px;
  font-weight: 800;
}

.nav-badge {
  min-width: 21px;
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 10px;
  color: #183d30;
  background: #bfe6ce;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}

.nav-badge.warm {
  background: #f3c890;
}

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 14px;
}

.support-card,
.sidebar-user {
  display: flex;
  gap: 10px;
  align-items: center;
}

.support-card {
  margin-bottom: 13px;
  padding: 10px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.06);
}

.support-icon {
  display: grid !important;
  place-items: center;
  flex: 0 0 30px;
  height: 30px;
  margin: 0 !important;
  border-radius: 50%;
  color: #14382b !important;
  background: #a9d5bb;
  font-weight: 800;
}

.support-card strong,
.sidebar-user strong {
  display: block;
  font-size: 12px;
}

.sidebar-user {
  padding: 7px;
}

.sidebar-user > div:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #183d30;
  background: #d9e8de;
  font-size: 11px;
  font-weight: 800;
}

.main-content {
  min-width: 0;
  background: #f5f6f3;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
}

.mobile-brand {
  display: none;
}

.global-search {
  display: flex;
  width: min(470px, 48vw);
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #8a948e;
  background: #f4f6f3;
}

.global-search:focus-within {
  border-color: #a7c4b5;
  background: #fff;
}

.global-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 13px;
}

kbd {
  padding: 3px 6px;
  border: 1px solid #dfe4df;
  border-radius: 5px;
  color: #8a948e;
  background: #fff;
  font-size: 10px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.role-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.role-switcher select {
  padding: 8px 28px 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-size: 12px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  color: inherit;
  background: transparent;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.topbar .icon-button:hover {
  background: var(--soft);
}

.notification-button {
  position: relative;
  font-size: 21px;
}

.notification-button span {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--orange);
}

.page {
  width: min(1440px, 100%);
  min-height: calc(100vh - 72px);
  margin: 0 auto;
  padding: 30px 34px 50px;
}

.page-loading {
  display: grid;
  height: 60vh;
  place-items: center;
  align-content: center;
  color: var(--muted);
}

.loader {
  width: 26px;
  height: 26px;
  border: 3px solid var(--line);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 25px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green-2);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 5px;
  font: 700 clamp(25px, 3vw, 34px) Georgia, serif;
  letter-spacing: -0.02em;
}

h2 {
  font: 700 18px Georgia, serif;
}

h3 {
  font-size: 14px;
}

.page-subtitle {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.header-actions,
.toolbar,
.button-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #334039;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  transition: 140ms ease;
}

.button:hover {
  border-color: #b8c7be;
  transform: translateY(-1px);
}

.button.primary {
  border-color: var(--green);
  color: #fff;
  background: var(--green);
}

.button.primary:hover {
  background: #153e2f;
}

.button.soft {
  border-color: transparent;
  color: var(--green);
  background: var(--green-soft);
}

.button.danger {
  color: var(--red);
  background: var(--red-soft);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 2px 5px rgba(30, 48, 39, 0.02);
}

.stat-card {
  position: relative;
  min-height: 136px;
  padding: 19px;
  overflow: hidden;
}

.stat-card::after {
  position: absolute;
  right: -20px;
  bottom: -30px;
  width: 95px;
  height: 95px;
  border-radius: 50%;
  background: var(--card-soft, var(--green-soft));
  content: "";
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: var(--card-color, var(--green));
  background: var(--card-soft, var(--green-soft));
  font-weight: 800;
}

.trend {
  color: var(--green-2);
  font-size: 10px;
  font-weight: 700;
}

.stat-value {
  position: relative;
  z-index: 1;
  margin: 15px 0 3px;
  font: 700 27px Georgia, serif;
}

.stat-label {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 11px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(310px, 0.75fr);
  gap: 18px;
  margin-bottom: 18px;
}

.panel {
  min-width: 0;
  padding: 20px;
}

.panel.flush {
  padding: 0;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.panel-header h2,
.panel-header h3 {
  margin: 0;
}

.panel-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.text-link {
  border: 0;
  color: var(--green-2);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
}

.department-chart {
  display: flex;
  min-height: 215px;
  align-items: flex-end;
  gap: clamp(12px, 3vw, 30px);
  padding: 16px 8px 4px;
}

.bar-group {
  display: flex;
  min-width: 42px;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.bar-value {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.bar {
  width: min(38px, 70%);
  min-height: 8px;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, #4b8b6d, #214d3b);
}

.bar-label {
  max-width: 68px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attention-list,
.activity-list {
  display: grid;
  gap: 2px;
}

.attention-item,
.activity-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 0;
  border-bottom: 1px solid #edf0ed;
}

.attention-item:last-child,
.activity-item:last-child {
  border-bottom: 0;
}

.list-avatar {
  display: grid;
  flex: 0 0 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 10px;
  font-weight: 800;
}

.attention-item > div:nth-child(2),
.activity-item > div:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.attention-item strong,
.activity-item strong {
  display: block;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attention-item small,
.activity-item small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.filter-input,
.field input,
.field select,
.field textarea,
.table-input {
  width: 100%;
  border: 1px solid #dfe4df;
  border-radius: 8px;
  outline: 0;
  color: var(--ink);
  background: #fff;
}

.filter-input {
  max-width: 290px;
  padding: 9px 11px;
  font-size: 12px;
}

.filter-input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus,
.table-input:focus {
  border-color: #71a087;
  box-shadow: 0 0 0 3px rgba(61, 119, 90, 0.1);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

th {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  color: #7a847f;
  background: #fafbfa;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  padding: 12px 14px;
  border-bottom: 1px solid #edf0ed;
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #fafcfb;
}

.person-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.person-cell strong {
  display: block;
  font-size: 11px;
}

.person-cell small {
  color: var(--muted);
  font-size: 9px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 20px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 9px;
  font-weight: 800;
}

.pill::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.pill.orange {
  color: #a86025;
  background: var(--orange-soft);
}

.pill.red {
  color: var(--red);
  background: var(--red-soft);
}

.pill.blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.row-action {
  padding: 5px 8px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
}

.row-action:hover {
  color: var(--green);
  background: var(--green-soft);
}

.empty-state {
  padding: 42px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.field {
  display: grid;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: #56615b;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  min-height: 40px;
  padding: 9px 10px;
  font-size: 12px;
}

.field textarea {
  min-height: 76px;
  resize: vertical;
}

.form-actions {
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 7px;
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(10, 26, 20, 0.52);
  backdrop-filter: blur(4px);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  position: relative;
  width: min(620px, 100%);
  max-height: 90vh;
  padding: 27px;
  border-radius: 18px;
  background: white;
  box-shadow: 0 28px 90px rgba(13, 35, 27, 0.3);
  overflow-y: auto;
  animation: modal-in 180ms ease-out;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 31px;
  height: 31px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: var(--soft);
  font-size: 20px;
}

.modal-title {
  margin-bottom: 6px;
  font: 700 22px Georgia, serif;
}

.modal-subtitle {
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 12px;
}

.sheet-shell {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.sheet-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 9px;
  border-bottom: 1px solid var(--line);
  background: #f7f9f7;
}

.sheet-toolbar .button {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 10px;
}

.sheet-status {
  margin-left: auto;
  color: var(--muted);
  font-size: 10px;
}

.spreadsheet {
  min-width: 900px;
}

.spreadsheet th {
  text-align: center;
}

.spreadsheet td {
  padding: 0;
  border-right: 1px solid #edf0ed;
}

.spreadsheet .row-number {
  width: 36px;
  color: #7b8780;
  background: #f7f9f7;
  font-size: 10px;
  text-align: center;
}

.table-input {
  min-width: 100px;
  height: 38px;
  padding: 7px 9px;
  border: 0;
  border-radius: 0;
  font-size: 11px;
}

.table-input:focus {
  position: relative;
  z-index: 2;
  box-shadow: inset 0 0 0 2px #3f795c;
}

.progress {
  width: 90px;
}

.progress-track {
  height: 5px;
  margin-top: 5px;
  border-radius: 5px;
  background: #e8ede9;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 5px;
  background: var(--green-2);
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--line);
  overflow: hidden;
}

.summary-item {
  padding: 14px 16px;
  background: #fff;
}

.summary-item span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.summary-item strong {
  font: 700 18px Georgia, serif;
}

.split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.client-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.client-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.client-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.client-logo {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  color: var(--green);
  background: var(--green-soft);
  font: 700 16px Georgia, serif;
}

.client-card strong {
  font-size: 12px;
}

.client-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.toast-stack {
  position: fixed;
  z-index: 200;
  right: 22px;
  bottom: 22px;
  display: grid;
  gap: 8px;
}

.toast {
  min-width: 240px;
  padding: 12px 15px;
  border: 1px solid #cde1d5;
  border-radius: 10px;
  color: #204f3d;
  background: #f4fbf6;
  box-shadow: var(--shadow);
  font-size: 11px;
  font-weight: 700;
  animation: toast-in 200ms ease-out;
}

.toast.error {
  border-color: #efc9c5;
  color: var(--red);
  background: #fff6f5;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (max-width: 1050px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .client-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    left: 0;
    width: 256px;
    transform: translateX(-102%);
    transition: transform 180ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.2);
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 7px;
  }

  .topbar {
    height: 62px;
    padding: 0 16px;
  }

  .global-search {
    width: auto;
    flex: 1;
  }

  .global-search kbd,
  .role-switcher span,
  .top-avatar {
    display: none;
  }

  .role-switcher select {
    max-width: 115px;
  }

  .page {
    min-height: calc(100vh - 62px);
    padding: 23px 16px 40px;
  }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions .button {
    flex: 1;
  }

  .form-grid,
  .split-grid {
    grid-template-columns: 1fr;
  }

  .field.full {
    grid-column: auto;
  }
}

@media (max-width: 540px) {
  .stats-grid,
  .client-grid,
  .summary-strip {
    grid-template-columns: 1fr;
  }

  .topbar-actions .notification-button {
    display: none;
  }

  .global-search {
    display: none;
  }

  .page-header {
    margin-bottom: 18px;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-input {
    max-width: none;
  }
}

/* Command-centre design: incoming information, work and money in one frame. */
.command-hero,
.mailbox-hero,
.finance-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(390px, 0.9fr);
  gap: 36px;
  align-items: center;
  margin-bottom: 18px;
  padding: 32px;
  border-radius: 20px;
  color: #eff8f2;
  background:
    radial-gradient(circle at 88% 5%, rgba(124, 190, 151, 0.3), transparent 25%),
    radial-gradient(circle at 55% 100%, rgba(36, 84, 62, 0.78), transparent 38%),
    linear-gradient(125deg, #14392c 0%, #0e2720 100%);
  overflow: hidden;
}

.hero-kicker,
.section-label {
  display: block;
  margin-bottom: 9px;
  color: #73c89a;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.command-hero h2,
.mailbox-hero h2,
.finance-hero h2 {
  margin: 0 0 12px;
  color: #fff;
  font: 700 clamp(25px, 3.1vw, 39px) Georgia, serif;
  letter-spacing: -0.03em;
}

.command-hero p,
.mailbox-hero p,
.finance-hero p {
  max-width: 585px;
  margin: 0;
  color: #b6cbbd;
  font-size: 13px;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  gap: 19px;
  margin-top: 22px;
}

.hero-link {
  padding: 0 0 5px;
  border: 0;
  border-bottom: 1px solid #5fa57d;
  color: #e7f8ec;
  background: transparent;
  font-size: 11px;
  font-weight: 800;
}

.flow-map {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 185px;
}

.flow-node {
  position: relative;
  z-index: 1;
  width: 132px;
  padding: 16px 13px;
  border: 1px solid rgba(204, 235, 216, 0.2);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.06);
}

.flow-node span {
  display: block;
  margin-bottom: 14px;
  color: #83cf9f;
  font-size: 10px;
  font-weight: 800;
}

.flow-node strong,
.flow-node small {
  display: block;
}

.flow-node strong {
  color: #f8fff9;
  font-size: 11px;
}

.flow-node small {
  margin-top: 5px;
  color: #a8c4b3;
  font-size: 9px;
  line-height: 1.35;
}

.flow-node.source { transform: translateY(-24px); }
.flow-node.destination { transform: translateY(24px); }

.flow-line {
  width: 26px;
  height: 1px;
  background: #5b9872;
}

.command-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--line);
  overflow: hidden;
}

.command-stat {
  min-height: 128px;
  padding: 17px 19px;
  background: #fff;
}

.command-stat span,
.command-stat p {
  color: var(--muted);
  font-size: 10px;
}

.command-stat span { display: block; margin-bottom: 16px; }
.command-stat strong { display: block; font: 700 26px Georgia, serif; }
.command-stat p { margin: 5px 0 0; font-weight: 700; }

.command-grid,
.finance-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  gap: 18px;
  margin-bottom: 18px;
}

.inbox-preview { min-height: 290px; }
.section-label { color: #669c7b; }

.mail-list {
  border-top: 1px solid #edf0ed;
}

.mail-row,
.invoice-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 0;
  border-bottom: 1px solid #edf0ed;
}

.mail-row:last-child,
.invoice-row:last-child { border-bottom: 0; }

.mail-row > div,
.invoice-row > div { min-width: 0; flex: 1; }
.mail-row strong,
.invoice-row strong { display: block; font-size: 11px; }
.mail-row small,
.invoice-row small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }

.mail-mark,
.invoice-doc {
  display: grid;
  flex: 0 0 31px;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 9px;
  color: #246349;
  background: #e4f1e8;
  font-size: 10px;
  font-weight: 800;
}

.mail-mark.client { color: #446f9e; background: #e8f0fa; }
.route-pill {
  padding: 5px 8px;
  border-radius: 12px;
  color: #277050;
  background: #eaf5ed;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.route-pill.blue { color: #4776a8; background: #edf3fa; }
.finance-avatar { color: #9b622d; background: #fff0e2; }
.file-avatar { color: #4776a8; background: #eaf1f8; }

.operations-strip { padding-bottom: 22px; }
.operating-lanes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.operating-lanes > div { padding: 13px 14px; border-left: 2px solid #85b898; background: #f8faf8; }
.operating-lanes strong, .operating-lanes small { display: block; }
.operating-lanes strong { margin: 7px 0 4px; font-size: 12px; }
.operating-lanes small { color: var(--muted); font-size: 10px; }
.lane-number { color: #478362; font-size: 9px; font-weight: 800; letter-spacing: 0.1em; }

.mailbox-hero,
.finance-hero { grid-template-columns: minmax(0, 1fr) 170px; }

.mailbox-count,
.finance-summary {
  display: grid;
  min-height: 135px;
  place-items: center;
  align-content: center;
  border: 1px solid rgba(204, 235, 216, 0.17);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.06);
}

.mailbox-count strong,
.finance-summary strong { color: #c7e9d3; font: 700 46px Georgia, serif; }
.mailbox-count span,
.finance-summary span,
.finance-summary small { color: #a7c4b2; font-size: 10px; }

.mailbox-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.mailbox-card { position: relative; min-height: 295px; overflow: hidden; }
.mailbox-card::after { position: absolute; right: -42px; bottom: -57px; width: 170px; height: 170px; border-radius: 50%; background: #e6f3e9; content: ""; }
.client-card::after { background: #e9f0fa; }
.mailbox-card h2 { margin: 15px 0 8px; }
.mailbox-card p { max-width: 350px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.account-chip { display: inline-flex; padding: 5px 8px; border-radius: 5px; color: #266447; background: #e6f3e9; font-size: 9px; font-weight: 800; letter-spacing: 0.09em; }
.client-chip { color: #456f9d; background: #eaf1fa; }
.account-address { margin: 17px 0; color: var(--green); font-size: 12px; font-weight: 800; }
.mailbox-card ul { position: relative; z-index: 1; margin: 0 0 22px; padding: 0; list-style: none; }
.mailbox-card li { margin: 8px 0; color: #59675f; font-size: 11px; }
.mailbox-card li::before { margin-right: 8px; color: #4b9767; content: "•"; }
.mailbox-card .button { position: relative; z-index: 1; }

.automation-list { padding: 25px; }
.route-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.route-steps > div { padding: 13px 0; border-top: 1px solid #dce5de; }
.route-steps b { display: grid; width: 23px; height: 23px; place-items: center; margin-bottom: 10px; border-radius: 50%; color: #fff; background: var(--green); font-size: 10px; }
.route-steps strong, .route-steps span { display: block; }
.route-steps strong { margin-bottom: 5px; font-size: 11px; }
.route-steps span { color: var(--muted); font-size: 10px; line-height: 1.4; }

.finance-hero { background: radial-gradient(circle at 83% 18%, rgba(198, 152, 83, 0.28), transparent 24%), linear-gradient(125deg, #24372e, #15241e); }
.finance-summary { background: rgba(255, 244, 222, 0.07); }
.finance-summary strong { color: #f4d3a5; }
.finance-panel-heading { margin: 0; padding: 20px 20px 10px; }
.invoice-list { padding: 0 20px 5px; }
.invoice-row b { color: #aa672b; font-size: 10px; white-space: nowrap; }
.invoice-row b.approved-text { color: #367b57; }
.invoice-doc { color: #a75e42; background: #f9e9e3; font-size: 8px; }
.payment-card { display: flex; flex-direction: column; min-height: 240px; background: #eef5f0; }
.payment-card h2 { margin: 0 0 8px; }
.payment-card > p:not(.section-label) { color: var(--muted); font-size: 12px; line-height: 1.5; }
.payment-path { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: 18px 0 auto; }
.payment-path span { color: #3c664c; font-size: 9px; font-weight: 800; text-align: center; }
.payment-path i { width: 17px; height: 1px; background: #9bc4a9; }
.payment-note { margin-top: 17px; padding-top: 13px; border-top: 1px solid #d5e4d9; }
.payment-note strong, .payment-note small { display: block; }
.payment-note strong { margin-bottom: 4px; color: #315c43; font-size: 10px; }
.payment-note small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.finance-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; border: 1px solid var(--line); border-radius: 13px; background: var(--line); overflow: hidden; }
.finance-kpis div { padding: 16px 18px; background: #fff; }
.finance-kpis span, .finance-kpis strong { display: block; }
.finance-kpis span { margin-bottom: 6px; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.finance-kpis strong { font-size: 11px; }

@media (max-width: 1050px) {
  .command-hero { grid-template-columns: 1fr; }
  .flow-map { justify-content: flex-start; }
}

@media (max-width: 780px) {
  .command-hero, .mailbox-hero, .finance-hero { grid-template-columns: 1fr; padding: 23px; }
  .flow-map { overflow-x: auto; justify-content: flex-start; }
  .flow-node { min-width: 125px; }
  .command-stats, .mailbox-grid, .route-steps, .operating-lanes, .finance-kpis { grid-template-columns: 1fr 1fr; }
  .command-grid, .finance-grid { grid-template-columns: 1fr; }
}

@media (max-width: 540px) {
  .command-stats, .mailbox-grid, .route-steps, .operating-lanes, .finance-kpis { grid-template-columns: 1fr; }
  .mail-row, .invoice-row { align-items: flex-start; flex-wrap: wrap; }
  .route-pill, .invoice-row b { margin-left: 42px; }
}

/* -------------------------------------------------------------------------
   Payroll / wage grid
   ------------------------------------------------------------------------- */

.wage-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  justify-content: space-between;
}

.wage-month,
.wage-status,
.wage-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.wage-status small {
  color: var(--muted);
}

.wage-travel-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.wage-travel-all select {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.wage-locked-banner {
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--orange-soft);
  color: #8a4b16;
  font-weight: 600;
}

.wage-grid-wrap {
  overflow-x: auto;
  max-width: 100%;
}

.wage-grid {
  border-collapse: collapse;
  font-size: 12px;
  background: #f5ebe0;
  white-space: nowrap;
}

.wage-grid th,
.wage-grid td {
  border: 1px solid #d8cdbd;
  padding: 4px 6px;
  text-align: center;
}

.wage-grid thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--green);
  color: #eef7f2;
  font-weight: 600;
}

.wage-grid th.sunday,
.wage-grid td.sunday {
  background: #d9d9d9;
}

.wage-grid th.holiday,
.wage-grid td.holiday {
  background: #fce4ec;
}

.wage-grid .wg-name {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 132px;
  text-align: left;
  font-weight: 600;
  background: #efe3d4;
}

.wage-grid thead .wg-name {
  z-index: 3;
  background: var(--green);
}

.wage-grid .wg-day {
  width: 26px;
  padding: 1px;
}

.day-input {
  width: 26px;
  border: 1px solid transparent;
  background: transparent;
  text-align: center;
  padding: 3px 0;
  border-radius: 4px;
}

.day-input:focus {
  outline: none;
  border-color: var(--green-2);
  background: #fffef7;
}

.day-input.invalid {
  border-color: var(--red);
  background: var(--red-soft);
}

.wage-grid .wg-sum {
  text-align: right;
  background: #fffdf8;
  font-variant-numeric: tabular-nums;
}

.wage-grid .wg-sum.yellow {
  background: #fffacd;
}

.wage-grid .wg-sum.green {
  background: #e7f3ea;
}

.wage-grid .wg-sum.red {
  background: var(--red-soft);
}

.wage-grid .wg-sum.qualified {
  background: #c6efce;
}

.wage-grid .wg-sum.not_qualified {
  background: #ffc7ce;
}

.wage-grid .wg-sum.gross {
  background: #fff200;
  font-weight: 700;
}

.wage-grid tr.wg-total td {
  background: #daa520;
  color: #2a1c00;
  font-weight: 700;
}

.wage-grid tr.wg-total .wg-name {
  background: #daa520;
}

.travel-cell {
  white-space: nowrap;
}

.travel-select {
  padding: 2px 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-right: 6px;
}

.chip-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 7px;
  padding: 2px 7px;
  font-variant-numeric: tabular-nums;
}

.chip-btn.add {
  color: var(--green-2);
}

.chip-btn.sub {
  color: var(--red);
}

.chip-btn:hover {
  border-color: var(--green-2);
}

/* Adjustment + holiday + finalize modals */

.adj-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
}

.adj-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.adj-item small {
  display: block;
  color: var(--muted);
}

.finalize-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 14px 0;
}

.finalize-summary > div {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--soft);
}

.finalize-summary span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.finalize-summary small {
  font-weight: 400;
  color: var(--muted);
}

.validation-block {
  margin: 12px 0;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
}

.validation-block ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.validation-block.error {
  background: var(--red-soft);
  color: #8a2b2b;
}

.validation-block.warn {
  background: var(--orange-soft);
  color: #8a4b16;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}

/* ---------------------------------------------------------------------------
   Dita e punës — the daily sheet
   --------------------------------------------------------------------------- */

.day-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.day-search {
  flex: 1 1 260px;
  min-width: 200px;
}

.day-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.day-toggle select {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  color: var(--ink);
}

.day-count {
  margin-left: auto;
  font-size: 13px;
  color: var(--muted);
}

.day-table {
  width: 100%;
  border-collapse: collapse;
}

.day-table th,
.day-table td {
  padding: 9px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.day-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--soft);
}

.day-table .day-check {
  width: 42px;
  padding-right: 0;
}

.day-table .day-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}

.day-row.changed {
  background: var(--green-soft);
}

.day-row.changed td:first-child {
  box-shadow: inset 3px 0 0 var(--green-2);
}

.day-select {
  width: 100%;
  max-width: 240px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  color: var(--ink);
}

.day-hours {
  width: 92px;
  padding: 7px 10px;
  border: 1px solid var(--orange);
  border-radius: 9px;
  background: var(--panel);
  color: var(--ink);
}

.day-state .pill {
  white-space: nowrap;
}

.day-empty {
  margin: 0;
  padding: 22px 18px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 720px) {
  .day-table thead th:nth-child(5),
  .day-table tbody td:nth-child(5) {
    display: none;
  }

  .day-count {
    margin-left: 0;
  }
}

/* Punonjësit — tabs, licences and record form sections */

.tab-row {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border-radius: 11px;
  background: var(--soft);
}

.tab {
  padding: 7px 12px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
}

.tab.active {
  color: var(--green);
  background: var(--panel);
  box-shadow: 0 1px 3px rgba(24, 48, 38, 0.12);
}

.muted-cell {
  color: var(--muted);
}

.row-actions {
  white-space: nowrap;
}

.row-action.danger:hover {
  color: var(--red);
  background: var(--red-soft);
}

.list-avatar.muted {
  color: var(--muted);
  background: var(--soft);
}

.form-section {
  grid-column: 1 / -1;
  margin: 8px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.form-section:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.license-list {
  display: grid;
  gap: 8px;
}

.license-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto auto auto;
  align-items: end;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
}

.license-row input {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid #dfe4df;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.license-row label {
  display: grid;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
}

@media (max-width: 720px) {
  .license-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------------------------------------------------------------------------
   Dita e punës: tap sheet (phone first)
   Every worker is a row with three big buttons: 8 · M · other hours.
   --------------------------------------------------------------------------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.tap-sheet {
  max-width: 760px;
  margin: 0 auto;
}

.tap-head {
  position: sticky;
  top: 72px;
  z-index: 10;
  display: grid;
  gap: 10px;
  margin: -30px -34px 0;
  padding: 14px 34px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.tap-date {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 14px;
  background: var(--soft);
}

.tap-arrow {
  width: 46px;
  height: 46px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--green);
  background: var(--panel);
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.tap-date-label {
  position: relative;
  display: grid;
  flex: 1;
  min-width: 0;
  text-align: center;
  cursor: pointer;
}

.tap-date-label strong {
  font: 700 17px Georgia, serif;
}

.tap-date-label small {
  color: var(--muted);
  font-size: 12px;
}

/* The native date picker sits invisibly over the label: tap the date to change it. */
.tap-date-label input {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  cursor: pointer;
}

.tap-search input {
  width: 100%;
  height: 50px;
  padding: 0 16px 0 44px;
  border: 2px solid var(--green);
  border-radius: 14px;
  outline: none;
  background:
    var(--panel)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%2369736e' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='8.5' cy='8.5' r='6'/%3E%3Cpath d='M13 13l5 5'/%3E%3C/svg%3E")
    14px center / 20px no-repeat;
  font-size: 17px;
}

.tap-search input:focus {
  box-shadow: 0 0 0 4px var(--green-soft);
}

.tap-filters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tap-chip {
  flex: none;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.tap-chip.miss {
  color: var(--red);
  background: var(--red-soft);
}

.tap-chip.other {
  color: #9a5a1f;
  background: var(--orange-soft);
}

.tap-chip.empty {
  color: var(--muted);
  background: var(--soft);
}

.tap-chip.active {
  border-color: currentColor;
  box-shadow: inset 0 0 0 1px currentColor;
}

.tap-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 600;
}

.tap-banner.rest {
  color: var(--blue);
  background: var(--blue-soft);
}

.tap-banner.locked {
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--soft);
}

.tap-list {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.tap-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 7px 8px 7px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.tap-row[hidden],
.tap-chip[hidden] {
  display: none;
}

.tap-row.letter-start {
  margin-top: 26px;
}

.tap-row.letter-start::before {
  content: attr(data-letter);
  position: absolute;
  top: -22px;
  left: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.tap-row.is-miss {
  border-color: var(--red);
  background: var(--red-soft);
}

.tap-row.is-other {
  border-color: var(--orange);
  background: var(--orange-soft);
}

.tap-row.is-empty .tap-name strong {
  color: var(--muted);
}

.tap-row.changed {
  box-shadow: inset 4px 0 0 var(--green-2);
}

.tap-name {
  display: grid;
  flex: 1;
  min-width: 0;
  line-height: 1.25;
}

.tap-name strong {
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tap-name small {
  color: var(--muted);
  font-size: 12px;
}

.tap-note {
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 6px;
  color: var(--blue);
  background: var(--blue-soft);
  font-weight: 700;
}

.tap-seg {
  display: flex;
  flex: none;
  gap: 5px;
}

.tap {
  width: 50px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: var(--soft);
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.tap:disabled {
  cursor: default;
  opacity: 0.85;
}

.tap:focus-visible {
  outline: 3px solid var(--mint);
  outline-offset: 2px;
}

.tap.on-full {
  border-color: var(--green);
  color: white;
  background: var(--green);
}

.tap.on-miss {
  border-color: var(--red);
  color: white;
  background: var(--red);
}

.tap.on-other {
  border-color: var(--orange);
  color: white;
  background: var(--orange);
}

.tap-save {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: grid;
  gap: 6px;
  justify-items: center;
  margin: 16px -34px -50px;
  padding: 12px 34px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.tap-save .button.primary {
  width: min(520px, 100%);
  height: 54px;
  justify-content: center;
  border-radius: 16px;
  font-size: 17px;
}

.tap-save .button.primary:disabled {
  border-color: var(--line);
  color: var(--muted);
  background: var(--soft);
  cursor: default;
}

.tap-save > span {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.tap-link {
  padding: 6px;
  border: 0;
  color: var(--green-2);
  background: none;
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Keypad bottom sheet (other hours) */
.keypad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.key {
  height: 58px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: var(--soft);
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.key.wide {
  grid-column: span 2;
  font-size: 15px;
}

.key.sel {
  border-color: var(--orange);
  color: white;
  background: var(--orange);
}

.key.full {
  border-color: var(--green);
  color: white;
  background: var(--green);
}

.key.miss {
  border-color: var(--red);
  color: white;
  background: var(--red);
}

.key.soft {
  color: var(--blue);
  background: var(--blue-soft);
}

.key.soft.sel {
  color: white;
  background: var(--blue);
}

.keypad-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px;
  margin-top: 12px;
}

.keypad-sheet .modal-title {
  padding-right: 36px;
}

.keypad-sheet .modal-subtitle {
  margin-bottom: 14px;
}

@media (max-width: 780px) {
  .tap-head {
    top: 62px;
    margin: -23px -16px 0;
    padding: 10px 16px;
  }

  .tap-save {
    margin: 16px -16px -40px;
    padding-inline: 16px;
  }

  /* On a phone, dialogs flagged as sheets rise from the bottom edge. */
  .modal-backdrop:has(.modal.as-sheet) {
    align-items: end;
    padding: 0;
  }

  .modal.as-sheet {
    width: 100%;
    max-height: 92vh;
    padding: 22px 16px calc(18px + env(safe-area-inset-bottom, 0px));
    border-radius: 22px 22px 0 0;
    animation: sheet-in 200ms ease-out;
  }
}

@keyframes sheet-in {
  from {
    transform: translateY(40px);
    opacity: 0.4;
  }
}

@media (max-width: 380px) {
  .tap {
    width: 44px;
  }

  .tap-row {
    padding-left: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .modal.as-sheet {
    animation: none;
  }
}

/* ---------------------------------------------------------------------------
   Phone screens: Sot, Pagat, Kalendari, Punonjësit
   Day colours are shared everywhere: green 8+ h, yellow fewer hours,
   purple medical report (R), red absent (M), grey nothing / day off.
   --------------------------------------------------------------------------- */

:root {
  --purple: #6b4fa0;
  --purple-soft: #efe9f8;
  --amber: #a8741a;
  --amber-soft: #fbf1dc;
  --bottom-h: 0px;
}

.phone-page {
  display: grid;
  gap: 14px;
  max-width: 760px;
  margin: 0 auto;
}

.phone-page.wide-ok {
  max-width: 1320px;
}

.phone-head {
  display: grid;
  gap: 6px;
}

.phone-head h1 {
  margin: 0;
  font: 700 clamp(24px, 6vw, 32px) Georgia, serif;
  text-wrap: balance;
}

.phone-head .eyebrow {
  margin: 0;
}

.phone-head .sub {
  margin: 0;
  color: var(--muted);
}

.source-line {
  color: var(--muted);
  font-size: 12px;
}

.card-block {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.card-block.alert {
  border-color: var(--orange);
  background: var(--orange-soft);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-top h2 {
  margin: 0;
  font: 700 18px Georgia, serif;
}

.card-top small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.today-line {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.today-chips,
.doc-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tone-chip,
.code-dot {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.tone-chip.full {
  color: var(--green);
  background: var(--green-soft);
}

.tone-chip.miss,
.code-dot.miss {
  color: var(--red);
  background: var(--red-soft);
}

.tone-chip.sick,
.code-dot.sick {
  color: var(--purple);
  background: var(--purple-soft);
}

.tone-chip.short {
  color: var(--amber);
  background: var(--amber-soft);
}

.tone-chip.none {
  color: var(--muted);
  background: var(--soft);
}

.today-names,
.agenda {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.today-names li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.code-dot {
  min-width: 28px;
  padding: 2px 6px;
  text-align: center;
}

.agenda li {
  display: grid;
  gap: 2px;
}

.agenda span {
  color: var(--muted);
}

.figure-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 6px;
}

.figure-row > div,
.pay-total > div:not(.figure-row) {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--soft);
}

.figure-row span,
.pay-total span {
  color: var(--muted);
  font-size: 12px;
}

.figure-row b {
  font-size: 17px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.figure-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.figure-total b,
.pay-total > div:not(.figure-row) b {
  font: 700 22px Georgia, serif;
  font-variant-numeric: tabular-nums;
}

.button.wide {
  width: 100%;
  justify-content: center;
  min-height: 46px;
}

.button.danger-fill {
  border-color: var(--red);
  color: white;
  background: var(--red);
}

.red-text {
  color: var(--red);
}

.purple-text {
  color: var(--purple);
}

.muted {
  color: var(--muted);
}

.hint-line {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.link-button {
  padding: 0;
  border: 0;
  color: var(--green-2);
  background: none;
  font: inherit;
  font-weight: 600;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Segmented tabs */
.seg-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--soft);
}

.seg-tabs button {
  flex: 1;
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
}

.seg-tabs button.on {
  color: var(--green);
  background: var(--panel);
  box-shadow: 0 1px 3px rgba(20, 40, 30, 0.12);
}

.seg-tabs.compact {
  max-width: 360px;
}

/* Month navigation */
.month-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 14px;
  background: var(--soft);
}

.month-nav-label {
  display: grid;
  flex: 1;
  justify-items: center;
  gap: 2px;
}

.month-nav-label strong {
  font: 700 18px Georgia, serif;
}

/* Lists of people (workers, wages, calendar picker) */
.person-list,
.pay-list,
.request-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.person-row,
.pay-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  cursor: pointer;
}

.person-row[hidden],
.pay-row[hidden],
.pay-table tr[hidden],
.wage-grid tr[hidden] {
  display: none;
}

.person-row:focus-visible,
.pay-row:focus-visible {
  outline: 3px solid var(--mint);
}

.chev {
  color: var(--muted);
  font-size: 22px;
}

.pay-amount {
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sticky-action {
  position: sticky;
  bottom: calc(var(--bottom-h) + 10px);
  box-shadow: 0 8px 24px rgba(20, 40, 30, 0.18);
}

/* Requests waiting for the office */
.request-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.request-card.pending {
  border-color: var(--orange);
}

.change-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.change-table th,
.change-table td {
  padding: 4px 6px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.change-table th {
  color: var(--muted);
  font-weight: 600;
  width: 38%;
}

.change-table .from {
  color: var(--muted);
  text-decoration: line-through;
}

/* Facts in a sheet */
.facts {
  display: grid;
  gap: 6px;
  margin: 0 0 14px;
}

.facts div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

.sheet-actions {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.seg-field {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.seg-field label {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-weight: 600;
}

.seg-field label:has(input:checked) {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-soft);
}

.form-grid [hidden] {
  display: none;
}

/* Daily sheet additions: R button, hours box, new worker */
.tap.on-sick {
  border-color: var(--purple);
  color: white;
  background: var(--purple);
}

.tap-row.is-sick {
  border-color: var(--purple);
  background: var(--purple-soft);
}

.tap-hours {
  width: 58px;
  height: 48px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--panel);
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.tap-hours::placeholder {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.tap-hours:focus {
  border-style: solid;
  border-color: var(--orange);
  outline: none;
  box-shadow: 0 0 0 3px var(--orange-soft);
}

.tap-hours.on-other {
  border: 1px solid var(--amber);
  color: white;
  background: var(--amber);
}

.tap-row.is-other {
  border-color: var(--amber);
  background: var(--amber-soft);
}

.tap-chip.sick {
  color: var(--purple);
  background: var(--purple-soft);
}

.tap-chip.other {
  color: var(--amber);
  background: var(--amber-soft);
}

.tap-new {
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 6px;
  color: var(--orange);
  background: var(--orange-soft);
  font-weight: 700;
}

.day-extra {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 18px 0 4px;
}

/* Wages */
.pay-total {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.pay-table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.pay-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.pay-table th,
.pay-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.pay-table th {
  position: sticky;
  top: 0;
  color: var(--muted);
  background: var(--soft);
  font-size: 11px;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pay-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pay-table .strong,
.pay-table tfoot td {
  font-weight: 800;
}

.pay-table tbody tr {
  cursor: pointer;
}

.pay-table tbody tr:hover {
  background: var(--green-soft);
}

.pay-breakdown {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.pay-breakdown th,
.pay-breakdown td {
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.pay-breakdown th {
  font-weight: 500;
}

.pay-breakdown th small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.pay-breakdown td {
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pay-breakdown tr.sum th,
.pay-breakdown tr.sum td {
  background: var(--soft);
}

.pay-breakdown tr.grand th,
.pay-breakdown tr.grand td {
  border-bottom: 0;
  font: 800 18px Georgia, serif;
}

.pay-breakdown {
  table-layout: fixed;
}

.pay-breakdown td {
  width: 42%;
}

.pay-edit {
  display: block;
  width: 100%;
  max-width: 130px;
  margin: 4px 0 0 auto;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: right;
  font: inherit;
  font-weight: 600;
}

.wage-grid td.tone-miss {
  color: var(--red);
  background: var(--red-soft);
  font-weight: 800;
}

.wage-grid td.tone-sick {
  color: var(--purple);
  background: var(--purple-soft);
  font-weight: 800;
}

.wage-grid td.tone-short {
  color: var(--amber);
  background: var(--amber-soft);
  font-weight: 800;
}

.wage-grid td.tone-miss input,
.wage-grid td.tone-sick input,
.wage-grid td.tone-short input {
  color: inherit;
  font-weight: 800;
}

/* Calendars */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.cal-head {
  padding: 4px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.cal-day {
  position: relative;
  display: grid;
  align-content: start;
  gap: 1px;
  min-width: 0;
  min-height: 64px;
  padding: 5px 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--panel);
  font: inherit;
  text-align: left;
  overflow: hidden;
}

button.cal-day {
  cursor: pointer;
}

.cal-day b {
  font-size: 14px;
}

.cal-day small {
  overflow: hidden;
  font-size: 10px;
  line-height: 1.15;
  color: var(--muted);
  text-overflow: ellipsis;
}

.cal-day small.hol {
  color: var(--blue);
}

.cal-day.off {
  background: var(--soft);
  color: var(--muted);
}

.cal-day.saved {
  box-shadow: inset 0 -3px 0 var(--green-2);
}

.cal-day.today {
  border: 2px solid var(--green);
}

.cal-day .marks {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: auto;
}

.mk {
  padding: 0 3px;
  border-radius: 4px;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.mk.miss {
  color: var(--red);
  background: var(--red-soft);
}

.mk.sick {
  color: var(--purple);
  background: var(--purple-soft);
}

.mk.note {
  position: absolute;
  top: 3px;
  right: 3px;
  color: var(--blue);
  background: var(--blue-soft);
}

.cal-day.worker {
  min-height: 56px;
  align-content: space-between;
}

.cal-code {
  font-size: 15px;
  font-weight: 800;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.cal-day.tone-full,
.sw.tone-full {
  border-color: #9ccdb2;
  color: var(--green);
  background: var(--green-soft);
}

.cal-day.tone-short,
.sw.tone-short {
  border-color: #e5c27c;
  color: var(--amber);
  background: var(--amber-soft);
}

.cal-day.tone-sick,
.sw.tone-sick {
  border-color: #c6b4e6;
  color: var(--purple);
  background: var(--purple-soft);
}

.cal-day.tone-miss,
.sw.tone-miss {
  border-color: #e5a7a2;
  color: var(--red);
  background: var(--red-soft);
}

.cal-day.tone-none,
.sw.tone-none {
  color: var(--muted);
}

.cal-day.worker.off {
  background: var(--soft);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 12px;
  list-style: none;
}

.legend li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sw {
  width: 14px;
  height: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
}

.sw.saved {
  box-shadow: inset 0 -3px 0 var(--green-2);
}

.sw.off {
  background: var(--soft);
}

/* Bottom navigation (phone) */
.bottom-nav {
  display: none;
}

@media (max-width: 780px) {
  :root {
    --bottom-h: calc(62px + env(safe-area-inset-bottom, 0px));
  }

  body {
    padding-bottom: var(--bottom-h);
  }

  .bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    display: grid;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line);
    background: var(--panel);
  }

  .bottom-nav button {
    display: grid;
    justify-items: center;
    gap: 2px;
    min-height: 50px;
    border: 0;
    color: var(--muted);
    background: none;
    font-size: 11px;
    font-weight: 700;
  }

  .bottom-nav button[hidden] {
    display: none;
  }

  .bn-ico {
    display: grid;
    width: 30px;
    height: 26px;
    place-items: center;
    border-radius: 9px;
    font-size: 13px;
    font-style: normal;
    font-weight: 800;
  }

  .bottom-nav button.active {
    color: var(--green);
  }

  .bottom-nav button.active .bn-ico {
    color: white;
    background: var(--green);
  }

  .tap-save {
    bottom: var(--bottom-h);
  }

  .toast-stack {
    bottom: calc(var(--bottom-h) + 12px);
  }

  .cal-day {
    min-height: 54px;
    padding: 4px 3px;
  }

  .cal-day small {
    display: none;
  }

  .cal-day.worker {
    min-height: 50px;
  }

  .cal-code {
    font-size: 13px;
  }
}

@media (max-width: 380px) {
  .tap-hours {
    width: 50px;
  }
}

/* Full names, never cut: a long name wraps onto a second line. */
.tap-name strong {
  overflow: visible;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.2;
}

/* The wage breakdown and change tables read as text, not as data-grid headers. */
.pay-breakdown th,
.change-table th {
  background: none;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.change-table th {
  color: var(--muted);
}

.pay-breakdown tr.grand th {
  font: 800 18px Georgia, serif;
}

.seg-field input[type="radio"],
.check-row input[type="checkbox"] {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  padding: 0;
  accent-color: var(--green);
}

.seg-field label {
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
}

/* Menu: words only, no letter boxes. */
@media (max-width: 780px) {
  .bottom-nav button {
    align-content: center;
    min-height: 52px;
    margin: 0 2px;
    border-radius: 12px;
    font-size: 13px;
  }

  .bottom-nav button.active {
    color: var(--green);
    background: var(--green-soft);
  }
}

/* Greeting on Sot */
.phone-head.greet h1 {
  font-size: clamp(28px, 7.5vw, 38px);
}

.phone-head.greet .sub {
  font-size: 16px;
}

/* The yellow block: names highlighted like in the timesheet. */
.yellow-name {
  padding: 0 4px;
  border-radius: 4px;
  background: #fff1a8;
  color: #3d3405;
}

.tap-row.is-yellow .tap-name strong {
  align-self: start;
  justify-self: start;
  padding: 0 4px;
  border-radius: 4px;
  background: #fff1a8;
  color: #3d3405;
}

.tap-row.block-start::before {
  color: #8a6d00;
  letter-spacing: 0.04em;
}

.yellow-check {
  padding: 10px 12px;
  border: 1px solid #f0d860;
  border-radius: 12px;
  background: #fffbe0;
  color: #3d3405;
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
}

/* Week strip under the date: jump back to correct a day, or ahead */
.week-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.wk {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0;
  min-height: 50px;
  padding: 4px 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: var(--panel);
}

.wk small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.wk b {
  font-size: 16px;
}

.wk i {
  position: absolute;
  top: 2px;
  right: 2px;
  padding: 0 2px;
  border-radius: 4px;
  color: var(--red);
  background: var(--red-soft);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}

.wk.saved {
  box-shadow: inset 0 -3px 0 var(--green-2);
}

.wk.today b {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.wk.on {
  border-color: var(--green);
  color: var(--on-green, #fff);
  background: var(--green);
}

.wk.on small,
.wk.on b {
  color: #fff;
}

/* Month calendar inside the pay review */
.modal .cal-grid {
  margin-bottom: 8px;
}

.cal-day.mini {
  min-height: 40px;
  padding: 3px;
}

.cal-day.mini b {
  font-size: 11px;
}

.cal-day.mini .cal-code {
  font-size: 12px;
}

/* Light red: has stopped coming (5+ M in a row) or leaving, waiting for the office. */
:root {
  --rose: #fdecea;
  --rose-line: #eba9a2;
}

.tap-row.is-leaving,
.person-row.leaving {
  border-color: var(--rose-line);
  background: var(--rose);
}

.tap-leave {
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 6px;
  color: var(--red);
  background: var(--rose);
  border: 1px solid var(--rose-line);
  font-weight: 700;
}

.card-block.leaving {
  border-color: var(--rose-line);
  background: var(--rose);
}

.button.leave-button {
  border-color: var(--rose-line);
  color: var(--red);
  background: var(--rose);
}

.exit-table td {
  font-weight: 600;
}

.tap-name small .tap-leave,
.tap-name small .tap-new {
  display: inline-block;
}

.wk i {
  top: auto;
  right: 50%;
  bottom: -7px;
  transform: translateX(50%);
  border: 1px solid var(--panel);
}

.week-strip {
  padding-bottom: 6px;
}

/* Phone header: the bell stays reachable, so notifications can be turned off too. */
@media (max-width: 540px) {
  .topbar-actions .notification-button {
    display: inline-grid;
  }
}

.figure-total b,
.pay-total b {
  white-space: nowrap;
}

.figure-total {
  flex-wrap: wrap;
}

.wage-grid .link-button.yellow-name {
  color: #3d3405;
  text-decoration: none;
}

/* Custom report builder */
.report-button {
  border-color: var(--green);
  color: var(--green);
}

.report-templates,
.report-blank {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.tpl {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--green-soft);
  overflow: hidden;
}

.chip-tpl {
  padding: 7px 12px;
  border: 0;
  color: var(--green);
  background: none;
  font-weight: 700;
}

.chip-tpl.static {
  cursor: default;
}

.tpl-x {
  padding: 4px 10px 4px 2px;
  border: 0;
  color: var(--muted);
  background: none;
  font-size: 16px;
}

.report-cols {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px;
}

.report-cols label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.report-cols label.on {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-soft);
}

.report-cols input,
.seg-field input[type="radio"] {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--green);
}

.blank-add {
  display: flex;
  flex: 1;
  gap: 6px;
  min-width: 220px;
}

.blank-add input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

/* Posta */
.seg-tabs.scroll {
  overflow-x: auto;
  scrollbar-width: none;
}

.seg-tabs.scroll button {
  flex: 1 0 auto;
  padding: 0 12px;
}

.mail-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mail-row {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  cursor: pointer;
}

.mail-row.unread {
  border-left: 4px solid var(--green);
}

.mail-row.unread .mail-top strong,
.mail-row.unread .mail-subject {
  font-weight: 800;
}

.mail-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.mail-top strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-top small {
  flex: none;
  color: var(--muted);
}

.mail-subject {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.mail-meta .snip {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acct {
  flex: none;
  padding: 1px 7px;
  border-radius: 999px;
  font-weight: 700;
}

.acct-zyra {
  color: var(--green);
  background: var(--green-soft);
}

.acct-kliente {
  color: var(--blue);
  background: var(--blue-soft);
}

.att {
  flex: none;
  font-weight: 700;
}

.mail-text {
  margin: 0;
  padding: 12px;
  border-radius: 12px;
  background: var(--soft);
  font: 14px/1.5 inherit;
  font-family: inherit;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.att-list {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.att-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.att-list span {
  display: grid;
  min-width: 0;
}

.att-list small {
  color: var(--muted);
}

.steps-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  font-size: 15px;
}

.steps-list code,
.hint-line code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--soft);
  font-size: 13px;
}

.posta textarea {
  min-height: 220px;
  font: inherit;
}

/* Five Posta tabs fit a 375 px phone. */
.seg-tabs.scroll button {
  flex: 1 1 auto;
  padding: 0 6px;
  font-size: 13px;
}

/* Dosjet */
.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.folder-tile {
  display: grid;
  gap: 2px;
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: var(--panel);
  text-align: left;
}

.folder-tile b {
  font-size: 15px;
  overflow-wrap: anywhere;
}

.folder-tile small {
  color: var(--muted);
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

/* Prodhimi */
.bar {
  display: block;
  height: 5px;
  margin-top: 4px;
  overflow: hidden;
  border-radius: 5px;
  background: var(--soft);
}

.bar i {
  display: block;
  height: 100%;
  background: var(--green-2);
}

.work-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.work-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.work-row[hidden] {
  display: none;
}

.work-input {
  display: grid;
  flex: none;
  justify-items: center;
  gap: 2px;
}

.work-input input {
  width: 74px;
  height: 46px;
  border: 2px solid var(--green);
  border-radius: 12px;
  font-size: 18px;
  font-weight: 800;
  text-align: center;
}

.work-input .link-button {
  font-size: 11px;
}

.lanci-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
}

.lancio-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  background: var(--panel);
  text-align: left;
}

.stage-mini {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
}

.file-button {
  cursor: pointer;
}

.orange-text {
  color: var(--orange);
}

.size-table {
  width: auto;
  min-width: 100%;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.size-table th,
.size-table td {
  padding: 4px 6px;
  border: 1px solid var(--line);
  text-align: center;
  font-size: 12px;
  letter-spacing: 0;
}

.size-table td input {
  width: 34px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-align: center;
  font-weight: 700;
}

.size-table .bolla-total td,
.size-table .bolla-total th {
  background: var(--green-soft);
  font-weight: 800;
}

.label-form {
  display: grid;
  gap: 10px;
}

.split-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.split-fields[hidden] {
  display: none;
}

/* Carton table: compact cells so a bolla fits a phone. */
.modal .size-table td input {
  width: 30px;
  min-width: 0;
  height: 28px;
  padding: 0;
  font-size: 13px;
}

.modal .size-table th,
.modal .size-table td {
  padding: 3px 2px;
}

/* ===========================================================================
   Kutitë — the app as boxes, for people who are not at home with technology.
   Kryefaqja shows one big tile per box; a tap opens the box; "‹ Kryefaqja"
   (or the phone's Back) returns. Big targets (48 px and more), 16–17 px text,
   words only, one 8 px spacing scale, soft layered shadows, 18–20 px corners.
   This layer comes last on purpose: it refines the rules above it.
   =========================================================================== */

:root {
  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --s4: 32px;
  --radius: 18px;
  --radius-lg: 20px;
  --line: #dfe5e0;
  --muted: #5d6762;
  --shadow-1: 0 1px 2px rgba(16, 40, 30, 0.05), 0 2px 8px rgba(16, 40, 30, 0.05);
  --shadow-2: 0 2px 4px rgba(16, 40, 30, 0.06), 0 12px 28px rgba(16, 40, 30, 0.1);
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* One colour per box: the tiles, the menu lines and the bar inside a box. */
[data-tone="home"] { --c: #204f3d; }
[data-tone="dita"] { --c: #2f8a5a; }
[data-tone="pagat"] { --c: #204f3d; }
[data-tone="prodhimi"] { --c: #c9762f; }
[data-tone="punonjesit"] { --c: #6b4fa0; }
[data-tone="kalendari"] { --c: #3f6c9c; }
[data-tone="posta"] { --c: #b0476b; }
[data-tone="dosjet"] { --c: #7a6a3a; }
[data-tone="zyra"] { --c: #4f7f86; }
[data-tone="perdoruesit"] { --c: #5d6762; }
[data-tone="kujtesat"] { --c: #a8741a; }
[data-tone="faturat"] { --c: #2c6e8f; }
[data-tone="materialet"] { --c: #8a5a2b; }
[data-tone="blerjet"] { --c: #9b3d3d; }
[data-tone="kompania"] { --c: #3d4f7a; }

[hidden] {
  display: none !important;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-size: 16px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}

.figure-row b,
.pay-amount,
.pay-total b,
.num,
.tone-chip,
.figure-total b,
.home-date {
  font-variant-numeric: tabular-nums;
}

/* Headings: tight, heavy, the same family as the text (no serif anywhere). */
h1,
h2,
h3,
.brand strong,
.brand-mark,
.figure-total b,
.pay-total b,
.pay-breakdown tr.grand th,
.phone-head h1,
.card-top h2,
.modal-title,
.month-nav-label strong,
.tap-date-label strong {
  font-family: inherit;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.card-top h2 {
  font-size: 19px;
}

.modal-title {
  padding-right: 96px;
  font-size: 23px;
  line-height: 1.2;
}

.modal-subtitle,
.hint-line {
  font-size: 15px;
}

.today-line {
  font-size: 16px;
}

.tap-name small,
.card-top small {
  font-size: 14px;
}

.pill {
  padding: 4px 10px;
  font-size: 13px;
}

/* --- Buttons, fields, links: nothing smaller than a thumb ------------------ */

.button {
  min-height: 48px;
  padding: 11px 18px;
  border-radius: 14px;
  font-size: 16px;
  box-shadow: var(--shadow-1);
}

.button.wide {
  min-height: 56px;
  font-size: 17px;
}

.button:disabled {
  opacity: 0.6;
  transform: none;
}

.button:active:not(:disabled) {
  transform: scale(0.98);
}

.field label {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.field input,
.field select,
.field textarea {
  min-height: 48px;
  padding: 10px 14px;
  border-color: #cfd8d2;
  border-radius: 12px;
  font-size: 16px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

.check-row {
  min-height: 48px;
  font-size: 16px;
}

.link-button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  color: var(--green);
  background: var(--panel);
  font-weight: 700;
  text-decoration: none;
}

.wage-grid .link-button {
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
}

.tap-link {
  min-height: 48px;
  padding: 10px 14px;
  font-size: 15px;
}

.seg-tabs button {
  min-height: 48px;
  font-size: 16px;
}

.tap-chip {
  min-height: 48px;
  padding: 10px 16px;
  font-size: 15px;
}

.tap-arrow {
  width: 52px;
  height: 52px;
}

.modal-close {
  top: 14px;
  right: 14px;
  width: auto;
  height: 48px;
  padding: 0 16px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: var(--panel);
  font-size: 16px;
  font-weight: 700;
}

.modal {
  border-radius: var(--radius-lg);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.table-wrap,
.wage-grid-wrap,
.tap-filters,
.seg-tabs.scroll,
.main-nav {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.form-actions {
  flex-wrap: wrap;
}

/* Main actions inside a box: full-width, big; side by side on a computer. */
.doc-buttons,
.header-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s1);
}

.doc-buttons .button,
.header-actions .button {
  min-height: 52px;
  width: 100%;
}

@media (min-width: 781px) {
  .doc-buttons,
  .header-actions {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

.big-actions {
  display: grid;
  gap: 10px;
}

@media (min-width: 781px) {
  .big-actions {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
}

.big-button {
  display: grid;
  gap: 4px;
  justify-items: center;
  min-height: 60px;
  padding: 16px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--panel);
  box-shadow: var(--shadow-1);
  font: inherit;
  font-size: 18px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 160ms ease;
}

.big-button small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.big-button.primary {
  border-color: var(--green);
  color: #fff;
  background: linear-gradient(160deg, #2a6a50, var(--green));
}

.big-button.primary small {
  color: rgba(255, 255, 255, 0.85);
}

.big-button.danger {
  border-color: #efc9c5;
  color: var(--red);
}

.big-button:active {
  transform: scale(0.98);
}

.day-actions {
  margin: var(--s2) 0 var(--s1);
}

.section-title {
  margin: var(--s1) 4px 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Saving: full width, tall, always at hand at the bottom. */
.tap-save .button.primary {
  width: 100%;
  max-width: 640px;
  height: 56px;
  border-radius: 16px;
  font-size: 19px;
  font-weight: 800;
}

.tap-save > span {
  font-size: 15px;
}

.sticky-action {
  min-height: 56px;
  border-radius: 16px;
  font-size: 18px;
}

/* --- Cards and lists --------------------------------------------------------- */

.card-block {
  gap: 12px;
  padding: 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
}

.person-row,
.pay-row {
  min-height: 64px;
  padding: 12px 14px;
  border-radius: 16px;
  box-shadow: var(--shadow-1);
}

.tap-row {
  min-height: 64px;
}

.phone-page {
  gap: var(--s2);
}

/* --- PC: the boxes as large words in a light sidebar -------------------------- */

.app-shell {
  grid-template-columns: 272px minmax(0, 1fr);
}

.sidebar {
  padding: 22px 14px 16px;
  border-right: 1px solid var(--line);
  color: var(--ink);
  background: var(--panel);
}

.brand {
  padding: 0 6px 18px;
}

.brand-mark {
  border: 0;
  color: #fff;
  background: linear-gradient(160deg, #2a6a50, var(--green));
}

.brand strong {
  color: var(--green);
}

.brand span {
  color: var(--muted);
}

.main-nav {
  display: grid;
  align-content: start;
  gap: 6px;
  padding-right: 2px;
}

.nav-item {
  min-height: 50px;
  margin: 0;
  padding: 12px 14px;
  border-left: 6px solid var(--c, var(--line));
  border-radius: 14px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
}

.nav-item:hover {
  color: var(--ink);
  background: var(--soft);
}

.nav-item.active {
  color: var(--ink);
  background: var(--green-soft);
}

.nav-item.active::before {
  display: none;
}

.nav-badge {
  color: #fff;
  background: var(--c, var(--green));
  font-size: 12px;
}

.nav-badge:empty {
  display: none;
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.sidebar-user strong {
  color: var(--ink);
  font-size: 16px;
}

.sidebar-user span {
  color: var(--muted);
  font-size: 14px;
}

.sidebar .avatar {
  color: #fff;
  background: var(--green);
  font-size: 13px;
}

.sidebar-account {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s1);
}

.sidebar-account .button {
  width: 100%;
  min-height: 48px;
  padding: 10px;
  font-size: 15px;
}

.topbar-actions .button {
  min-height: 44px;
}

.account-button {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Inside a box: a big way back and the box name ---------------------------- */

.box-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 20px 34px 0;
}

.box-bar h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.box-bar h1::before {
  flex: none;
  width: 8px;
  height: 28px;
  border-radius: 6px;
  background: var(--c, var(--green));
  content: "";
}

.back-button {
  flex: none;
  min-height: 48px;
  padding: 10px 16px;
  border: 2px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: var(--panel);
  box-shadow: var(--shadow-1);
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.back-button:active {
  transform: scale(0.97);
}

.page-header {
  margin-bottom: var(--s2);
}

.page-header .page-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

/* --- Kryefaqja ------------------------------------------------------------------ */

.home-page {
  display: grid;
  gap: var(--s2);
  max-width: 1180px;
  margin: 0 auto;
}

.home-head h1 {
  margin: 0;
  font-size: clamp(26px, 7vw, 34px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.home-date {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 17px;
  font-weight: 600;
}

.home-head .sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.task-card {
  display: grid;
  gap: var(--s2);
  padding: 20px;
  border-radius: var(--radius-lg);
  color: #fff;
  background: linear-gradient(135deg, #2c6f53 0%, #204f3d 55%, #173b2e 100%);
  box-shadow: 0 2px 4px rgba(16, 40, 30, 0.1), 0 14px 30px rgba(32, 79, 61, 0.26);
}

.task-card b {
  display: block;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.task-card span {
  display: block;
  margin-top: 4px;
  font-size: 16px;
  opacity: 0.9;
}

.task-go {
  min-height: 56px;
  padding: 0 28px;
  border: 0;
  border-radius: 16px;
  color: var(--green);
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
  font: inherit;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 120ms ease;
}

.task-go:active {
  transform: scale(0.97);
}

@media (min-width: 781px) {
  .task-card {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

.box-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (min-width: 1000px) {
  .box-tiles {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--s2);
  }
}

.box-tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  min-height: 124px;
  padding: 16px;
  border: 1px solid var(--line);
  border-top: 8px solid var(--c);
  border-radius: var(--radius-lg);
  color: var(--ink);
  background: var(--panel);
  box-shadow: var(--shadow-1);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 160ms ease;
}

.box-tile:hover {
  box-shadow: var(--shadow-2);
}

.box-tile:active {
  transform: scale(0.97);
}

.box-tile:focus-visible {
  outline: 3px solid var(--c);
  outline-offset: 3px;
}

.box-tile b {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.box-tile span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.box-tile em {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 10px;
  line-height: 1.3;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 12%, white);
  font-size: 14px;
  font-style: normal;
  font-weight: 800;
}

.today-reminders {
  border-left: 6px solid #a8741a;
}

/* --- Phone: no top bar; two big items at the bottom ---------------------------- */

@media (max-width: 780px) {
  :root {
    --bottom-h: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  .topbar {
    display: none;
  }

  .tap-head {
    top: 0;
  }

  .box-bar {
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
  }

  .box-bar h1 {
    font-size: 21px;
  }

  .box-bar h1::before {
    height: 24px;
  }

  .page {
    min-height: calc(100vh - var(--bottom-h));
  }

  .bottom-nav {
    grid-template-columns: 1fr 1fr;
    grid-auto-flow: row;
    gap: var(--s1);
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -4px 18px rgba(16, 40, 30, 0.06);
  }

  .bottom-nav button {
    min-height: 56px;
    margin: 0;
    border-radius: 16px;
    color: var(--ink);
    font-size: 17px;
    font-weight: 800;
  }

  .bottom-nav button.active {
    color: var(--green);
    background: var(--green-soft);
  }

  .toast-stack {
    right: 16px;
    bottom: calc(var(--bottom-h) + 12px);
    left: 16px;
  }

  .toast {
    min-width: 0;
    font-size: 16px;
  }

  .form-actions .button {
    flex: 1 1 140px;
  }

  .modal-title {
    padding-right: 92px;
  }
}

body.signed-out .app-shell,
body.signed-out .bottom-nav {
  display: none;
}

body.signed-out {
  padding-bottom: 0;
}

/* --- Sign in, first run, own password ------------------------------------------ */

.auth-screen {
  position: fixed;
  z-index: 90;
  inset: 0;
  display: grid;
  place-items: center;
  padding: var(--s3) var(--s2) calc(var(--s3) + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
  background:
    radial-gradient(circle at 15% 0%, #d6e9dd 0, transparent 45%),
    radial-gradient(circle at 100% 100%, #e6efe9 0, transparent 40%),
    #eef1ed;
}

.auth-card {
  display: grid;
  gap: var(--s2);
  width: min(440px, 100%);
  padding: 28px 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow-2);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-brand strong {
  display: block;
  color: var(--green);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.auth-brand span {
  color: var(--muted);
  font-size: 14px;
}

.auth-card h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.auth-sub {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.auth-form {
  display: grid;
  gap: var(--s2);
}

.auth-form .field input {
  min-height: 52px;
  font-size: 17px;
}

.auth-form .validation-block {
  margin: 0;
  font-size: 15px;
}

.auth-card .page-loading {
  height: auto;
  padding: var(--s3) 0;
}

/* --- Përdoruesit ------------------------------------------------------------------ */

.user-row.inactive {
  opacity: 0.7;
}

.user-row .user-boxes {
  color: var(--ink);
}

.user-pills {
  display: grid;
  flex: none;
  gap: 6px;
  justify-items: end;
}

.user-editor {
  padding-bottom: var(--s1);
}

.user-editor .back-button {
  justify-self: start;
}

.user-form {
  display: grid;
  gap: 12px;
}

.perm-box {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-left: 6px solid var(--c);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-1);
}

.perm-box:not(.on) {
  background: var(--soft);
  box-shadow: none;
}

.perm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 12px 16px;
  cursor: pointer;
}

.perm-head b {
  display: block;
  font-size: 18px;
  font-weight: 800;
}

.perm-head small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 14px;
}

.perm-box:not(.on) .perm-head b {
  color: var(--muted);
}

.active-row {
  padding: 4px 0;
}

.perm-actions {
  display: grid;
  padding: 0 16px 8px;
}

.perm-tick {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 0;
  border-top: 1px solid #edf1ee;
  font-size: 16px;
  cursor: pointer;
}

.perm-tick input {
  flex: none;
  width: 26px;
  height: 26px;
  margin: 0;
  accent-color: var(--green);
}

/* A real on/off switch, made from a checkbox. */
.switch {
  position: relative;
  flex: none;
  width: 60px;
  height: 34px;
  margin: 0;
  border-radius: 999px;
  background: #c9d2cc;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: background 160ms ease;
}

.switch::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  content: "";
  transition: transform 180ms var(--ease-out);
}

.switch:checked {
  background: var(--green);
}

.switch:checked::after {
  transform: translateX(26px);
}

.switch:focus-visible {
  outline: 3px solid var(--mint);
  outline-offset: 2px;
}

.temp-pass {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s1);
  padding: 12px;
  border-radius: 14px;
  background: var(--soft);
}

.temp-pass code {
  flex: 1;
  min-width: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.06em;
  word-break: break-all;
  user-select: all;
}

/* --- Kujtesat --------------------------------------------------------------------- */

.rem-calendar {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-1);
  touch-action: pan-y;
}

.rem-day {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  min-height: 52px;
  padding: 4px 2px;
  border-color: transparent;
  text-align: center;
}

.rem-day b {
  font-size: 16px;
}

.rem-day.today {
  border-color: var(--green);
}

.rem-day.today b {
  color: var(--green);
}

.rem-day.picked {
  color: #fff;
  background: var(--green);
}

.rem-day.picked b {
  color: #fff;
}

.rem-dots {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 10px;
}

.rem-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a8741a;
}

.rem-dots i.done {
  background: #b9c3bd;
}

.rem-dots small {
  color: inherit;
  font-size: 11px;
  font-weight: 700;
}

.rem-day.picked .rem-dots i {
  background: #fff;
}

.rem-list,
.rule-list {
  display: grid;
  gap: var(--s1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.rem-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 10px 10px 10px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow-1);
}

.card-block .rem-row {
  box-shadow: none;
}

.rem-row .tap-name {
  flex: 1;
  min-width: 0;
}

.rem-row.done .tap-name strong {
  color: var(--muted);
  text-decoration: line-through;
}

.tick-button {
  flex: none;
  min-width: 88px;
  min-height: 52px;
  padding: 0 14px;
  border: 2px solid var(--green);
  border-radius: 14px;
  color: var(--green);
  background: var(--panel);
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 120ms ease, background 160ms ease;
}

.tick-button.on {
  color: #fff;
  background: var(--green);
}

.tick-button:active {
  transform: scale(0.96);
}

.rule-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-1);
}

.rule-card.off {
  background: var(--soft);
  box-shadow: none;
}

.rule-card.off strong {
  color: var(--muted);
}

.rule-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.rule-top .tap-name {
  display: grid;
  gap: 2px;
}

.rem-form {
  display: grid;
  gap: var(--s2);
}

.choice-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.choice-group legend {
  margin-bottom: var(--s1);
  padding: 0;
  font-size: 14px;
  font-weight: 700;
}

.choice-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
}

.choice-chips label {
  position: relative;
}

.choice-chips input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.choice-chips span {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 10px 16px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  font-size: 16px;
  font-weight: 700;
}

.choice-chips input:checked + span {
  border-color: var(--green);
  color: #fff;
  background: var(--green);
}

.choice-chips input:focus-visible + span {
  outline: 3px solid var(--mint);
  outline-offset: 2px;
}

/* --- Loading outline ---------------------------------------------------------------- */

.sk {
  display: block;
  border-radius: 10px;
  background: linear-gradient(90deg, #e7ece8 25%, #f3f6f3 50%, #e7ece8 75%);
  background-size: 200% 100%;
  animation: vpa-shimmer 1.2s linear infinite;
}

.sk-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.sk-task {
  min-height: 116px;
  background: #dce8e1;
}

.sk-tile {
  min-height: 124px;
  border-top: 8px solid #e3e8e4;
}

.skeleton .home-head {
  display: grid;
  gap: 10px;
}

@keyframes vpa-shimmer {
  to {
    background-position: -200% 0;
  }
}

/* --- Motion: a box slides in from the right; going back slides it out ------------ */

html[data-nav] .page {
  view-transition-name: page;
}

html[data-nav] .box-bar:not([hidden]) {
  view-transition-name: boxbar;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
}

::view-transition-old(page),
::view-transition-old(boxbar) {
  animation: 160ms ease both vpa-fade-out;
}

::view-transition-new(page),
::view-transition-new(boxbar) {
  animation: 220ms var(--ease-out) both vpa-in-right;
}

html[data-nav="back"]::view-transition-old(page),
html[data-nav="back"]::view-transition-old(boxbar) {
  animation: 220ms var(--ease-out) both vpa-out-right;
}

html[data-nav="back"]::view-transition-new(page),
html[data-nav="back"]::view-transition-new(boxbar) {
  animation: 200ms ease both vpa-fade-in;
}

.enter-forward {
  animation: vpa-in-right 220ms var(--ease-out);
}

.enter-back {
  animation: vpa-in-left 220ms var(--ease-out);
}

@keyframes vpa-in-right {
  from {
    opacity: 0;
    transform: translateX(32px);
  }
}

@keyframes vpa-in-left {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }
}

@keyframes vpa-out-right {
  to {
    opacity: 0;
    transform: translateX(32px);
  }
}

@keyframes vpa-fade-out {
  to {
    opacity: 0;
  }
}

@keyframes vpa-fade-in {
  from {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after,
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
    transition: none !important;
  }
}

/* Phone: while a screen has its own Save bar, that bar takes the bottom edge
   and the Kryefaqja / Llogaria bar steps aside (Back still works). */
@media (max-width: 780px) {
  body:has(.tap-save:not([hidden])) {
    padding-bottom: 0;
  }

  body:has(.tap-save:not([hidden])) .bottom-nav {
    display: none;
  }

  body:has(.tap-save:not([hidden])) .tap-save {
    bottom: 0;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
}

.rule-who {
  color: var(--green);
  font-weight: 700;
}

.backup-card {
  margin-top: 24px;
}

.backup-card h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

/* Excel / Word inside the app (Dosjet). Full screen on the phone. */
.modal.as-preview {
  width: min(1200px, 100vw);
  max-width: 100vw;
  max-height: 100dvh;
}

@media (max-width: 780px) {
  .modal.as-preview {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
  }
}

.preview-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.preview-head h2 {
  margin: 0;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.preview-actions {
  display: flex;
  gap: 8px;
}

.sheet-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  overscroll-behavior-x: contain;
}

.sheet-tabs button {
  flex: none;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  font-weight: 700;
}

.sheet-tabs button.on {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}

.sheet-scroll {
  overflow: auto;
  max-height: calc(100dvh - 190px);
  border: 1px solid var(--line);
  border-radius: 12px;
  -webkit-overflow-scrolling: touch;
}

.sheet-table {
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.sheet-table th {
  position: sticky;
  left: 0;
  min-width: 34px;
  padding: 4px 6px;
  background: var(--soft);
  color: var(--muted);
  font-weight: 600;
  text-align: right;
}

.sheet-table td {
  min-width: 56px;
  max-width: 320px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  white-space: pre-wrap;
  vertical-align: top;
}

.sheet-table .b,
.doc-view .b {
  font-weight: 800;
}

.doc-view {
  max-width: 760px;
  line-height: 1.55;
}

.doc-view .sheet-table {
  margin: 10px 0;
}

.register-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 4px 0 12px;
}

@media (max-width: 420px) {
  .register-actions {
    grid-template-columns: 1fr;
  }
}

/* PC menu: with 14 boxes the list is long; tighter lines so all fit on a
   normal screen, and it scrolls (with a visible bar) when the screen is short. */
@media (min-width: 781px) {
  .main-nav {
    min-height: 0;
    scrollbar-width: thin;
  }

  .main-nav {
    display: grid;
    align-content: start;
    gap: 2px;
  }

  .main-nav .nav-item {
    min-height: 40px;
    padding-top: 6px;
    padding-bottom: 6px;
    margin: 0;
    font-size: 16px;
  }
}

/* "Add to home screen" card on Kryefaqja (iPhone / Android, until installed). */
.install-card {
  border: 1px solid var(--line);
  background: linear-gradient(135deg, #f4faf6, #ffffff);
}

.install-card h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.install-card ol {
  margin: 0 0 8px;
  padding-left: 22px;
  line-height: 1.6;
  font-size: 16px;
}

.backup-card .button + .button {
  margin-top: 8px;
}

.check-line {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  font-size: 15px;
}

.check-line input {
  width: 22px;
  height: 22px;
}

/* ---------------------------------------------------------------------------
   Veprimtaria (the owner's activity log) and the banner on a screen opened
   from it with "Hape si e pa".
   --------------------------------------------------------------------------- */
.main-nav .nav-item.nav-sub {
  min-height: 40px;
  margin-left: 18px;
  font-size: 15px;
  font-weight: 700;
}

.akt-page {
  display: grid;
  gap: 12px;
}

.akt-summary {
  display: grid;
  gap: 6px;
  font-size: 17px;
}

.akt-summary.flagged {
  border-left: 6px solid var(--red);
}

.akt-filters {
  padding-bottom: 2px;
}

.akt-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.akt-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: var(--panel);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.akt-card.orange {
  border-left-color: var(--orange);
}

.akt-card.red {
  border-left-color: var(--red);
  background: #fffafa;
}

.akt-card:active {
  background: var(--soft);
}

.akt-time {
  min-width: 46px;
  padding-top: 1px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.akt-body {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.akt-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.akt-top b {
  font-size: 16px;
}

.akt-text {
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.akt-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.akt-badge.download {
  color: var(--blue);
  background: var(--blue-soft);
}

.akt-badge.login,
.akt-badge.logout,
.akt-badge.password {
  color: var(--muted);
  background: var(--soft);
}

.akt-badge.denied,
.akt-badge.login-failed {
  color: var(--red);
  background: var(--red-soft);
}

.akt-flag {
  justify-self: start;
  padding: 3px 9px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
}

.akt-flag.orange {
  color: #9a5a1f;
  background: var(--orange-soft);
}

.akt-flag.red {
  color: var(--red);
  background: var(--red-soft);
}

.akt-flags {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.akt-recent h2,
.akt-diff-title {
  margin: 10px 0 8px;
  font-size: 17px;
}

.akt-recent .big-button.akt-day-flagged {
  border-left: 6px solid var(--orange);
}

.akt-diff-wrap {
  max-height: 46vh;
  overflow: auto;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.akt-diff {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.akt-diff th,
.akt-diff td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.akt-diff thead th {
  position: sticky;
  top: 0;
  color: var(--muted);
  background: var(--soft);
  font-size: 13px;
}

.akt-diff td:nth-child(2) {
  color: var(--muted);
}

.akt-tech {
  font-size: 12px;
  overflow-wrap: anywhere;
}

.akt-open {
  min-height: 56px;
  font-size: 18px;
}

.akt-home {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 1px solid var(--line);
  border-left: 6px solid var(--green);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.akt-home.flagged {
  border-left-color: var(--red);
}

.akt-home-title {
  font-size: 18px;
  font-weight: 800;
}

.akt-home-line {
  font-size: 16px;
}

.akt-home-open {
  color: var(--green-2);
  font-weight: 700;
}

.replay-banner {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  width: min(1440px, 100%);
  margin: 10px auto 0;
  padding: 10px 14px;
  border-left: 6px solid var(--blue);
  border-radius: 12px;
  background: var(--blue-soft);
}

.replay-banner div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.replay-banner b {
  font-size: 15px;
}

.replay-banner small {
  color: var(--muted);
  font-size: 13px;
}

.replay-banner .button {
  min-height: 44px;
}

.akt-diff tbody th {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: none;
}
