:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --ink: #172d42;
  --muted: #647080;
  --line: #e4eaf2;
  --primary: #e23a8b;
  --primary-dark: #8f3f98;
  --primary-soft: #fce6f2;
  --blue: #2563eb;
  --blue-soft: #e9f2ff;
  --green: #16875a;
  --green-soft: #e8f8ef;
  --yellow: #a96f00;
  --yellow-soft: #fff6d6;
  --red: #c33b4a;
  --red-soft: #ffecef;
  --sidebar: #f7fbf8;
  --sidebar-2: #e9f4ee;
  --shadow: 0 24px 70px rgba(23, 45, 66, .12);
  --shadow-soft: 0 16px 40px rgba(23, 45, 66, .08);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --focus: 0 0 0 4px rgba(226, 58, 139, .18);
}

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  min-height: 100%;
  overflow-x: hidden;
}

@supports (overflow-x: clip) {
  html,
  body {
    overflow-x: clip;
  }
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(252, 230, 242, .9), transparent 34rem),
    linear-gradient(140deg, rgba(233, 246, 252, .72), rgba(255, 246, 214, .34) 42%, rgba(244, 247, 251, 1) 74%),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.is-hidden {
  display: none !important;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
  overflow: hidden;
  border: 1px solid rgba(234, 216, 234, .9);
  border-radius: 30px;
  background: rgba(255, 255, 255, .86);
  box-shadow: var(--shadow);
}

.login-art {
  position: relative;
  overflow: hidden;
  padding: clamp(30px, 6vw, 62px);
  background: #f6f7f9;
}

.login-art .brand-with-logo {
  display: grid;
  gap: 8px;
  max-width: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 13px;
  font-weight: 900;
}

.brand-with-logo,
.sidebar-logo-brand {
  align-items: flex-start;
}

.sidebar-logo-brand {
  display: grid;
  gap: 9px;
}

.brand-logo-shell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 224px);
  min-height: 58px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.brand-logo-img {
  display: block;
  width: 190px;
  max-width: 100%;
  height: auto;
}

.brand-mark {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 14px 28px rgba(226, 58, 139, .25);
  font-size: .95rem;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 750;
}

.sidebar .brand small {
  color: var(--muted);
  padding-left: 2px;
}

.sidebar-environment {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px 8px;
  width: 100%;
  padding: 12px 2px 0;
  margin-top: 3px;
  border-top: 1px solid #dbe5df;
  font-size: .74rem;
}

.sidebar-weather {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 4px 6px;
  align-items: center;
}

.sidebar-weather svg { width: 22px; height: 22px; color: #ad7314; }
.sidebar-weather-city { display: block; color: var(--muted); font-size: .68rem; }
.sidebar-weather strong { font-size: .95rem; font-variant-numeric: tabular-nums; }
#sidebarWeatherDescription { grid-column: 1 / -1; color: var(--muted); overflow-wrap: anywhere; }
.sidebar-datetime { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; justify-content: center; }
#sidebarDate { font-size: .7rem; white-space: nowrap; }
#sidebarClock { font-size: .95rem; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 8ch; text-align: right; }
.sidebar-weather-source { color: var(--muted); font-size: .62rem; text-underline-offset: 2px; grid-column: 1 / -1; }
.sidebar-team-status { grid-column: 1 / -1; color: #27614a; font-size: .68rem; min-height: 1.5em; overflow-wrap: anywhere; }
.sidebar-team-status.is-error { color: #a83a31; }

.brand-large .brand-mark {
  width: 56px;
  height: 56px;
  flex-basis: 56px;
  border-radius: 18px;
}

.login-art h1 {
  position: relative;
  margin: 44px 0 12px;
  max-width: 680px;
  font-size: 2.4rem;
  line-height: 1.15;
  letter-spacing: 0;
}

.login-art p {
  position: relative;
  max-width: 600px;
  margin: 0;
  color: #425266;
  font-size: 1rem;
  font-weight: 610;
}

.login-welcome-details {
  display: grid;
  gap: 22px;
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid #dbe5df;
}

.login-today {
  display: grid;
  gap: 4px;
}

.login-detail-label {
  display: block;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 650;
}

.login-today time {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.login-weather {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 78px;
}

.login-weather-icon {
  display: flex;
  align-items: center;
  color: #b47a13;
}

.login-weather-icon svg {
  width: 32px;
  height: 32px;
  stroke-width: 1.75;
}

.login-weather-reading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px 12px;
  margin-top: 2px;
}

.login-weather-reading strong {
  font-size: 1.7rem;
  font-weight: 750;
  line-height: 1.25;
}

.login-weather-reading span {
  color: #425266;
  font-size: .95rem;
  overflow-wrap: anywhere;
}

.login-weather-time,
.login-weather-source {
  color: var(--muted);
  font-size: .72rem;
}

.login-weather-source {
  width: fit-content;
  text-decoration-color: #a6b4ab;
  text-underline-offset: 3px;
}

.save-state,
.pill,
.status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 900;
  line-height: 1.15;
}

.login-panel {
  padding: clamp(24px, 4vw, 44px);
  background: #ffffff;
  border-left: 1px solid rgba(234, 216, 234, .86);
}

.login-panel h2,
.panel h2,
.modal h2 {
  margin: 0;
  letter-spacing: 0;
}

.login-panel h2 {
  font-size: 1.45rem;
}

.login-panel p {
  margin: 8px 0 24px;
  color: var(--muted);
  font-weight: 620;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 22px;
  padding: 22px 16px;
  overflow-y: auto;
  color: var(--ink);
  background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
  border-right: 1px solid rgba(139, 163, 143, .28);
}

.sidebar .brand-mark {
  width: 46px;
  height: 46px;
  flex-basis: 46px;
  box-shadow: none;
}

.nav {
  display: grid;
  align-content: start;
  gap: 8px;
}

.nav-item {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 10px 12px;
  color: #33485d;
  background: transparent;
  font-weight: 850;
  text-align: left;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.nav-item:hover,
.nav-item.is-active {
  color: #102a3f;
  background: rgba(226, 58, 139, .1);
  border-color: rgba(226, 58, 139, .18);
}

.nav-item:active {
  transform: translateY(1px);
}

.nav-item span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #27614a;
  background: rgba(139, 163, 143, .18);
  font-size: .82rem;
  font-weight: 950;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: currentColor;
}

.nav-item.is-active span {
  color: #ffffff;
  background: var(--primary);
}

.nav-logout {
  color: #647080;
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid rgba(139, 163, 143, .25);
}

.user-card {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: var(--primary);
  font-weight: 950;
}

.user-card strong,
.user-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-card small {
  color: var(--muted);
  font-weight: 650;
}

.main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(18px, 3vw, 34px);
  background: rgba(244, 247, 251, .9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.topbar-title {
  min-width: 0;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(1.38rem, 3vw, 2rem);
  line-height: 1.1;
  letter-spacing: 0;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: .94rem;
  font-weight: 650;
}

.topbar-actions,
.button-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.billing-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.billing-tab {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 850;
  cursor: pointer;
}

.billing-tab.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.billing-pane {
  display: none;
}

.billing-pane.is-active {
  display: block;
}

.billing-table-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.billing-table-layout.has-panel {
  grid-template-columns: minmax(0, 1fr) 360px;
}

.billing-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.billing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

.billing-table th,
.billing-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #d8dee8;
  text-align: left;
  white-space: nowrap;
}

.billing-table th {
  background: #f6f8fb;
  color: var(--muted);
  font-weight: 850;
}

.billing-table tr:nth-child(even) td {
  background: #f1f3f6;
}

.billing-table tr:hover td,
.billing-table tr.is-selected td {
  background: #e8f4ef;
}

.billing-table .right,
.billing-detail-lines .right {
  text-align: right;
}

.billing-side-panel,
.billing-detail-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.billing-side-head,
.billing-detail-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #3f4440;
  color: #ffffff;
  font-weight: 850;
  text-transform: uppercase;
}

.billing-side-form {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.billing-payment-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.billing-rates-table {
  min-width: 680px;
  table-layout: fixed;
}

.billing-rates-table th:first-child,
.billing-rates-table th:nth-child(2) {
  width: 150px;
}

.billing-rates-table th {
  white-space: normal;
}

.billing-rates-table th span {
  display: block;
  margin-top: 4px;
  font-weight: 500;
  text-transform: none;
}

.billing-rates-table .input {
  width: 100%;
  min-width: 0;
}

.billing-rates-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 16px;
}

.settlement-controls,
.settlement-metadata {
  margin-bottom: 22px;
}

.cashbook-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-icon .cashbook-icon {
  fill: none;
}

.main:has(#view-cashbook.is-active),
.main:has(#view-billing.is-active),
.main:has(#view-dashboard.is-active) {
  grid-template-rows: auto 1fr auto;
}

.main:has(#view-cashbook.is-active) .page-nav,
.main:has(#view-billing.is-active) .page-nav,
.main:has(#view-dashboard.is-active) .page-nav {
  position: static;
  padding: 0 clamp(18px, 3vw, 34px) 20px;
}

.cashbook-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.attendance-section {
  padding: 22px 0 28px;
  margin-bottom: 26px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  min-width: 0;
}

.attendance-head,
.attendance-date-nav,
.attendance-tools,
.attendance-actions,
.attendance-modal-facts {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.attendance-head { justify-content: space-between; margin-bottom: 18px; }
.attendance-head h2 { margin: 0; font-size: 1.25rem; }
.attendance-sync { margin: 7px 0 0; font-size: .78rem; color: var(--muted); }
.attendance-sync.attendance-orange { color: #a95a10; }
.attendance-date-nav .input { width: 165px; }
.attendance-tools { margin-bottom: 12px; }
.attendance-tools .input { flex: 1; min-width: min(260px, 100%); }
.attendance-tools .select { width: 235px; max-width: 100%; }
.attendance-actions { margin: 14px 0 0; }
.attendance-manual { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.attendance-manual summary { cursor: pointer; font-size: .82rem; font-weight: 700; color: var(--muted); overflow-wrap: anywhere; }
.attendance-actions .button { max-width: 100%; white-space: normal; text-align: center; }
.attendance-actions .button:disabled { opacity: .48; cursor: not-allowed; box-shadow: none; }
.attendance-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 20px; gap: 14px; }
.attendance-summary > div { display: grid; gap: 4px; border-left: 3px solid var(--line); padding-left: 12px; }
.attendance-summary span { font-size: .8rem; color: var(--muted); font-weight: 700; overflow-wrap: anywhere; }
.attendance-summary strong { font-size: 1.2rem; }
.attendance-summary > .attendance-green { border-color: #237348; }
.attendance-summary > .attendance-orange { border-color: #a95a10; }
.attendance-summary > .attendance-blue { border-color: #236cac; }
.attendance-table-wrap { max-width: 100%; max-height: 520px; overflow: auto; border-radius: 8px; }
.attendance-table { min-width: 900px; table-layout: fixed; }
.attendance-table th { position: sticky; top: 0; z-index: 1; letter-spacing: 0; }
.attendance-table th:first-child { width: 145px; }
.attendance-table th:nth-child(2), .attendance-table th:nth-child(3) { width: 135px; }
.attendance-table th:nth-child(4) { width: 150px; }
.attendance-table th:nth-child(5), .attendance-table th:nth-child(6) { width: 62px; }
.attendance-table th:nth-child(7) { width: 110px; }
.attendance-table th:last-child { width: 50px; }
.attendance-table td { overflow-wrap: anywhere; vertical-align: top; font-size: .86rem; }
.attendance-table td, .attendance-table th { padding: 10px; }
.attendance-table .right { text-align: right; }
.attendance-table input[type="checkbox"] { width: 19px; height: 19px; accent-color: var(--primary); }
.attendance-table .meta { display: block; font-size: .78rem; margin-top: 5px; }
.attendance-client { padding: 0; border: 0; background: transparent; text-align: left; font: inherit; font-weight: 800; color: inherit; cursor: pointer; }
.attendance-client:hover { text-decoration: underline; }
.attendance-status { display: flex; align-items: baseline; gap: 6px; font-size: .8rem; font-weight: 700; margin-top: 4px; line-height: 1.45; }
.attendance-status i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: 0 0 8px; }
.attendance-green { color: #237348; }
.attendance-orange { color: #a95a10; }
.attendance-red, .attendance-error { color: #b52b3e; }
.attendance-gray { color: #69727a; }
.attendance-blue { color: #236cac; }
.attendance-conflict td { background: #fff1f3; }
.attendance-notice { padding: 10px 0; margin: 0 0 16px; border-bottom: 1px solid var(--line); }
.attendance-confirm-total { font-weight: 800; }
.attendance-confirm-list { margin: 12px 0 20px; padding: 0; list-style: none; max-height: 330px; overflow-y: auto; }
.attendance-confirm-list li { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.attendance-confirm-list li span { text-align: right; }
.attendance-modal-facts { margin-bottom: 18px; justify-content: space-between; }
.attendance-clock-facts { padding-bottom: 10px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.attendance-clock-facts h3 { margin: 0 0 8px; font-size: .95rem; }
.attendance-clock-facts .attendance-modal-facts { margin: 12px 0 0; }
.attendance-clock-facts .meta { display: block; font-size: .78rem; }
.attendance-plan-fields summary { cursor: pointer; font-weight: 800; }
.attendance-hours-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }

@media (max-width: 620px) {
  .attendance-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .attendance-actions > .button { width: 100%; }
  .attendance-hours-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .attendance-date-nav { width: 100%; }
  .attendance-date-nav .input { flex: 1; min-width: 0; }
  .attendance-tools .select { width: 100%; }
  .attendance-confirm-list li { display: grid; gap: 3px; }
  .attendance-confirm-list li span { text-align: left; }
}

@media (max-width: 380px) {
  .attendance-date-nav { display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px; gap: 8px; }
  .attendance-date-nav .input { width: 100%; }
  .attendance-date-nav [data-attendance-nav="today"] { grid-column: 1 / -1; }
}

.cashbook-toolbar .field {
  width: 220px;
  max-width: 100%;
}

.cashbook-summary strong {
  font-size: 1.3rem;
  overflow-wrap: anywhere;
}

.cashbook-table {
  min-width: 940px;
}

.cashbook-description {
  min-width: 220px;
  max-width: 360px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.cashbook-description .meta {
  display: block;
  margin-top: 4px;
}

.cashbook-row-actions {
  display: flex;
  gap: 6px;
}

.cashbook-voided {
  color: var(--muted);
}

.cashbook-voided .cashbook-entry-amount {
  text-decoration: line-through;
}

.cashbook-modal {
  border-radius: 8px;
  width: min(100%, 640px);
}

.cashbook-form-error,
.record-archive-error {
  color: #ad243b;
  margin: 0;
}

#billingSettlementScreen {
  padding-bottom: 86px;
}

.settlement-section {
  margin: 24px 0;
}

.settlement-section h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.settlement-month-table {
  min-width: 1120px;
}

.settlement-month-table .input {
  width: 82px;
  min-width: 0;
}

.settlement-section table {
  width: 100%;
  border-collapse: collapse;
}

.settlement-section th,
.settlement-section td {
  padding: 9px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.settlement-status {
  font-size: .9rem;
  color: var(--muted);
}

.settlement-totals {
  margin: 0;
}

.settlement-totals > div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.settlement-totals dd {
  margin: 0;
  font-weight: 700;
  white-space: nowrap;
}

.settlement-totals > div:last-child {
  font-weight: 700;
}

.settlement-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.settlement-actions .button {
  scroll-margin-bottom: 100px;
}

.billing-detail-card {
  margin-top: 16px;
}

.billing-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  padding: 18px;
}

.billing-detail-grid label {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-weight: 800;
}

.billing-detail-grid div {
  min-height: 30px;
  border-bottom: 1px solid #ccd4df;
  padding: 5px 0;
}

.billing-form-grid .input,
.billing-form-grid .select,
.billing-detail-message .textarea,
.billing-detail-lines .input {
  border: 0;
  border-bottom: 1px solid #ccd4df;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.billing-form-grid .input[readonly] {
  color: var(--muted);
}

.billing-detail-message {
  margin: 0 18px 14px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.billing-detail-message.field {
  display: grid;
  gap: 8px;
}

.billing-detail-message.field span {
  color: var(--muted);
  font-weight: 850;
}

.billing-detail-lines {
  width: calc(100% - 36px);
  margin: 0 18px 18px;
  border-collapse: collapse;
}

.billing-detail-lines th,
.billing-detail-lines td {
  padding: 10px;
  border-bottom: 1px solid #d8dee8;
}

.billing-detail-lines th {
  color: var(--muted);
  font-size: .8rem;
}

.billing-detail-lines tfoot td {
  background: #3f4440;
  color: #ffffff;
  font-weight: 900;
  text-transform: uppercase;
}

.billing-detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 18px 18px;
  flex-wrap: wrap;
}

.billing-detail-card.is-readonly .input,
.billing-detail-card.is-readonly .textarea {
  color: var(--muted);
}

.invoice-run-backdrop {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(16, 42, 63, .42);
  backdrop-filter: blur(7px);
}

.invoice-run-backdrop.is-open {
  display: flex;
}

body.invoice-run-open {
  overflow: hidden;
}

.invoice-run-modal {
  width: min(960px, 100%);
  max-height: 90dvh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  animation: modal-in .2s ease both;
}

.invoice-run-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: #f8fafb;
}

.invoice-run-head h2 {
  margin: 0;
  font-size: 1.2rem;
}

.invoice-run-body {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.invoice-run-info {
  color: var(--muted);
  font-size: .9rem;
}

.invoice-run-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.invoice-run-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
  gap: 12px;
}

.invoice-run-selection {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.invoice-run-select-all {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: .9rem;
}

.invoice-run-select-all input {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}

#billingRunSelectionSummary { flex: 1 0 100%; }

@media (max-width: 600px) {
  .invoice-run-backdrop {
    padding: 10px;
  }

  .invoice-run-body .form-cols,
  .invoice-run-filters {
    grid-template-columns: 1fr;
  }
}

.billing-run-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}

.billing-run-row > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.billing-run-row strong,
.billing-run-row .meta {
  display: block;
}

.billing-run-row input {
  margin-top: 4px;
  accent-color: var(--primary);
}

.billing-run-row.is-disabled {
  opacity: .62;
  cursor: not-allowed;
}

.global-search {
  position: relative;
  width: min(320px, 34vw);
}

.global-search-input {
  min-height: 42px;
  padding-left: 14px;
  background: rgba(255, 255, 255, .92);
}

.global-search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 80;
  width: min(420px, calc(100vw - 32px));
  max-height: 420px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 22px 54px rgba(23, 45, 66, .18);
}

.global-search-results button {
  width: 100%;
  display: grid;
  gap: 3px;
  border: 0;
  border-radius: 11px;
  padding: 11px 12px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.global-search-results button:hover,
.global-search-results button:focus-visible {
  outline: none;
  background: var(--primary-soft);
}

.global-search-results strong,
.global-search-results span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-search-results span,
.search-empty {
  color: var(--muted);
  font-size: .86rem;
  font-weight: 700;
}

.search-empty {
  padding: 12px;
}

.content {
  min-width: 0;
  padding: clamp(18px, 3vw, 34px);
}

.page-nav {
  position: fixed;
  right: clamp(16px, 3vw, 30px);
  bottom: clamp(16px, 3vw, 30px);
  z-index: 70;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.page-nav-button {
  min-height: 42px;
  border: 1px solid rgba(39, 97, 74, .18);
  border-radius: 999px;
  padding: 0 16px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 14px 34px rgba(15, 55, 42, .2);
  font-weight: 900;
  cursor: pointer;
}

.page-nav-button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.view {
  display: none;
  animation: view-in .22s ease both;
}

.view.is-active {
  display: block;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.button,
.icon-button {
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 900;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 14px;
  color: var(--ink);
  background: #ffffff;
}

.button:hover,
.icon-button:hover {
  transform: translateY(-1px);
  border-color: rgba(226, 58, 139, .32);
  box-shadow: 0 12px 24px rgba(23, 45, 66, .08);
}

.button-primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 14px 28px rgba(226, 58, 139, .22);
}

.button-soft {
  color: #48576a;
  background: var(--surface-soft);
  border-color: var(--line);
}

.button-danger {
  color: #ffffff;
  background: var(--red);
}

.icon-button {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  color: var(--ink);
  background: #ffffff;
  border-color: var(--line);
  font-size: 1.2rem;
}

.menu-button {
  display: none;
}

.save-state {
  color: #27614a;
  background: var(--green-soft);
}

.save-state.is-saving {
  color: #6b4a04;
  background: var(--yellow-soft);
}

.save-state.is-error {
  color: var(--red);
  background: var(--red-soft);
}

.quick-create {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.quick-create-button {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 15px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 14px 28px rgba(226, 58, 139, .22);
  font-size: 1.65rem;
  font-weight: 950;
  line-height: 1;
  transition: transform .18s ease, box-shadow .18s ease;
}

.quick-create:hover .quick-create-button,
.quick-create:focus-within .quick-create-button {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(226, 58, 139, .28);
}

.quick-create-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 70;
  display: none;
  min-width: 226px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 22px 54px rgba(23, 45, 66, .18);
}

.quick-create:hover .quick-create-menu,
.quick-create:focus-within .quick-create-menu {
  display: grid;
  gap: 4px;
}

.quick-create-menu::before {
  content: "";
  position: absolute;
  right: 0;
  bottom: 100%;
  width: 100%;
  height: 10px;
}

.quick-create-menu button {
  min-height: 42px;
  border: 0;
  border-radius: 11px;
  padding: 10px 12px;
  color: var(--ink);
  background: transparent;
  font-weight: 850;
  text-align: left;
}

.quick-create-menu button:hover,
.quick-create-menu button:focus-visible {
  outline: none;
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.panel {
  min-width: 0;
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow-soft);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-head h2 {
  font-size: 1.18rem;
  line-height: 1.2;
}

.panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: .94rem;
  font-weight: 640;
}

.assignment-archive > summary {
  cursor: pointer;
}

.assignment-archive > summary::marker {
  color: var(--primary);
}

.assignment-archive > summary h2 {
  display: inline;
  margin: 0;
  font-size: 1.12rem;
}

.assignment-archive > summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 6px;
}

.assignment-archive[open] > summary {
  margin-bottom: 18px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.metric-card {
  position: relative;
  overflow: hidden;
  min-height: 138px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(23, 45, 66, .06);
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  background: var(--accent, var(--primary));
}

.metric-card span {
  color: var(--muted);
  font-size: .9rem;
  font-weight: 850;
}

.metric-card strong {
  display: block;
  margin-top: 14px;
  font-size: 2.18rem;
  line-height: 1;
  letter-spacing: 0;
}

.metric-card small {
  display: block;
  margin-top: 9px;
  color: #59687a;
  font-size: .9rem;
  font-weight: 660;
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, .82fr);
  gap: 18px;
}

.list {
  display: grid;
  gap: 10px;
}

.list-card,
.entity-card,
.task-row,
.day-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #ffffff;
}

.list-card {
  padding: 14px;
  display: grid;
  gap: 8px;
}

.alert-card {
  border-left: 5px solid #cbd5e1;
}

.alert-critical {
  border-left-color: var(--red);
}

.alert-open {
  border-left-color: var(--yellow);
}

.alert-neutral {
  border-left-color: #647080;
}

.row-between {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.item-title {
  display: block;
  font-weight: 900;
  line-height: 1.25;
}

.muted,
.meta {
  color: var(--muted);
  font-size: .9rem;
  font-weight: 650;
}

.status-active,
.status-done {
  color: var(--green);
  background: var(--green-soft);
}

.status-open,
.status-paused {
  color: var(--yellow);
  background: var(--yellow-soft);
}

.status-critical {
  color: var(--red);
  background: var(--red-soft);
}

.status-neutral {
  color: #48576a;
  background: #eef2f7;
}

.traffic {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 950;
  line-height: 1.15;
  white-space: nowrap;
}

.traffic-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .7);
}

.traffic-gesucht {
  color: var(--red);
  background: var(--red-soft);
}

.traffic-gesucht .traffic-dot {
  background: var(--red);
}

.traffic-hospitation {
  color: var(--yellow);
  background: var(--yellow-soft);
}

.traffic-hospitation .traffic-dot {
  background: #f59e0b;
}

.traffic-laeuft {
  color: var(--green);
  background: var(--green-soft);
}

.traffic-laeuft .traffic-dot {
  background: var(--green);
}

.traffic-beendet {
  color: #59687a;
  background: #eef2f7;
}

.traffic-beendet .traffic-dot {
  background: #647080;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 190px auto;
  gap: 10px;
  margin-bottom: 16px;
}

.report-toolbar {
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) auto;
  align-items: end;
}

.report-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--ink);
  background: #ffffff;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.textarea {
  min-height: 96px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--primary);
  box-shadow: var(--focus);
}

.field {
  display: grid;
  gap: 7px;
}

.field span,
.form-label {
  color: #415164;
  font-size: .92rem;
  font-weight: 850;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-error {
  min-height: 22px;
  margin: 0;
  color: var(--red);
  font-weight: 780;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

table {
  width: 100%;
  min-width: 850px;
  border-collapse: collapse;
  background: #ffffff;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: .94rem;
}

th {
  color: #4b596c;
  background: #f8fafc;
  font-size: .8rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .05em;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.action-row .button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: .86rem;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.day-card {
  min-height: 220px;
  padding: 14px;
}

.day-card h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  letter-spacing: 0;
}

.day-pill {
  display: grid;
  gap: 3px;
  margin-top: 10px;
  padding: 10px;
  border-radius: 12px;
  color: #23436d;
  background: var(--blue-soft);
  font-size: .84rem;
  font-weight: 780;
}

.calendar-toolbar {
  display: grid;
  grid-template-columns: auto minmax(150px, 1fr) auto auto minmax(170px, 220px) minmax(190px, 260px) minmax(170px, 220px);
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.calendar-month-label {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  font-size: 1.05rem;
  text-transform: capitalize;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: -4px 0 16px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 820;
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 999px;
}

.legend-appointment {
  background: var(--blue);
}

.legend-sick {
  background: var(--red);
}

.legend-vacation {
  background: var(--green);
}

.legend-school {
  background: var(--yellow);
}

.legend-neutral {
  background: #7c6b98;
}

.legend-school-holiday { background: #3d8b97; }
.calendar-day.calendar-school-holiday { background: #f1f9fa; border-color: #bddce1; }
.calendar-day.is-muted.calendar-school-holiday { background: #f3f7f7; }
.school-holiday-label { display:block; min-width:0; padding:4px 6px; border-radius:4px; background:#dceff2; color:#235d68; font-size:.72rem; line-height:1.4; overflow-wrap:anywhere; }
.school-holiday-label.is-movable { background:#fff0d6; color:#795710; }
.calendar-holidays { margin-top:18px; padding-top:16px; border-top:1px solid var(--line); }
.calendar-holidays-head { display:flex; align-items:baseline; justify-content:space-between; flex-wrap:wrap; gap:8px; margin-bottom:10px; }
.calendar-holidays-head h3 { margin:0; font-size:.95rem; }
.calendar-holidays-head a { font-size:.8rem; color:#235d68; }
.calendar-holiday-row { display:flex; flex-wrap:wrap; gap:6px 18px; padding:8px 0; font-size:.85rem; border-bottom:1px solid var(--line); }
.calendar-holiday-row strong { flex:1 1 180px; }
.calendar-holiday-row small { flex-basis:100%; color:#795710; }
.calendar-month-label { width:100%; min-width:0; text-transform:none; }

.calendar-grid-wrap {
  overflow-x: auto;
  padding-bottom: 4px;
}

.calendar-grid {
  min-width: 820px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-weekday {
  padding: 0 8px 4px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.calendar-day {
  min-height: 128px;
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.calendar-day.is-muted {
  color: #8390a2;
  background: #f4f7fb;
}

.calendar-date-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.calendar-date-row strong {
  font-size: .95rem;
}

.calendar-add {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 9px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-weight: 950;
}

.calendar-empty,
.calendar-more {
  color: var(--muted);
  font-size: .8rem;
  font-weight: 750;
}

.absence-chip {
  width: 100%;
  display: grid;
  gap: 2px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 7px 8px;
  text-align: left;
  font-size: .78rem;
  font-weight: 850;
}

.absence-chip strong,
.absence-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.absence-self {
  color: #23436d;
  background: var(--blue-soft);
  border-color: rgba(37, 99, 235, .14);
}

.appointment-chip {
  color: #23436d;
  background: var(--blue-soft);
  border-color: rgba(37, 99, 235, .18);
}

.absence-staff {
  color: #27614a;
  background: var(--green-soft);
  border-color: rgba(22, 135, 90, .14);
}

.absence-sick {
  color: var(--red);
  background: var(--red-soft);
  border-color: rgba(195, 59, 74, .18);
}

.absence-client {
  color: #7a5100;
  background: var(--yellow-soft);
  border-color: rgba(169, 111, 0, .18);
}

.absence-reason-sick {
  color: var(--red);
  background: var(--red-soft);
  border-color: rgba(195, 59, 74, .22);
}

.absence-reason-vacation {
  color: #27614a;
  background: var(--green-soft);
  border-color: rgba(22, 135, 90, .18);
}

.absence-reason-appointment {
  color: #23436d;
  background: var(--blue-soft);
  border-color: rgba(37, 99, 235, .18);
}

.absence-reason-school {
  color: #7a5100;
  background: var(--yellow-soft);
  border-color: rgba(169, 111, 0, .2);
}

.absence-reason-neutral {
  color: #513f74;
  background: #f1ecff;
  border-color: rgba(81, 63, 116, .16);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.entity-card {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.record-list {
  display: grid;
  gap: 8px;
}

.record-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.1fr) minmax(210px, .95fr) minmax(180px, .8fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(23, 45, 66, .045);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.school-row {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto auto;
}

.relation-history-item {
  display: grid;
  gap: 8px;
  overflow-wrap: anywhere;
}

.relation-history-item .meta {
  display: block;
  margin-top: 4px;
}

.relation-history-item .action-row {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.record-row:hover,
.record-row:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(226, 58, 139, .32);
  box-shadow: 0 14px 34px rgba(23, 45, 66, .075);
  outline: none;
}

.record-main,
.record-info {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.record-main strong,
.record-main .meta,
.record-info span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-main strong {
  font-size: .98rem;
}

.record-info {
  color: #415164;
  font-size: .88rem;
  font-weight: 720;
}

.record-info span + span {
  color: var(--muted);
  font-size: .82rem;
}

.record-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.record-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.assignment-card {
  align-content: start;
}

.assignment-card-grid {
  align-items: stretch;
}

.assignment-card-meta {
  display: grid;
  gap: 4px;
}

.staff-list {
  display: grid;
  gap: 8px;
}

.staff-list-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.15fr) minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(23, 45, 66, .045);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.staff-list-row:hover,
.staff-list-row:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(226, 58, 139, .32);
  box-shadow: 0 14px 34px rgba(23, 45, 66, .075);
  outline: none;
}

.staff-list-person {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.staff-list-person strong,
.staff-list-person .meta,
.staff-list-info span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-list-person strong {
  display: block;
  font-size: .98rem;
}

.staff-list-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  font-size: .82rem;
  font-weight: 950;
}

.staff-list-info {
  display: grid;
  gap: 2px;
  min-width: 0;
  color: #415164;
  font-size: .88rem;
  font-weight: 720;
}

.staff-list-info span + span {
  color: var(--muted);
  font-size: .82rem;
}

.staff-list-status {
  justify-self: start;
}

.staff-list-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.staff-card {
  position: relative;
  text-align: left;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.staff-card:hover,
.staff-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(226, 58, 139, .35);
  box-shadow: 0 18px 44px rgba(23, 45, 66, .1);
  outline: none;
}

.staff-card::after {
  content: "Akte oeffnen";
  position: absolute;
  top: 14px;
  right: 14px;
  opacity: 0;
  transform: translateY(-4px);
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: .78rem;
  font-weight: 900;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.staff-card:hover::after,
.staff-card:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.entity-card strong {
  font-size: 1rem;
  line-height: 1.22;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mini-box {
  padding: 11px;
  border-radius: 12px;
  background: var(--surface-soft);
}

.mini-box span,
.mini-box strong {
  display: block;
}

.mini-box span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.mini-box strong {
  margin-top: 2px;
  font-size: 1rem;
}

.loadbar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f7;
}

.loadbar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--blue));
}

.profile-hero {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(252, 230, 242, .78), rgba(233, 246, 252, .68)),
    #ffffff;
  box-shadow: var(--shadow-soft);
}

.profile-main,
.profile-actions {
  display: grid;
  gap: 16px;
  align-content: start;
}

.profile-actions {
  justify-items: end;
}

.profile-title {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-title h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
  letter-spacing: 0;
}

.profile-title p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  font-weight: 720;
}

.profile-title .termination-note {
  color: var(--red);
  font-weight: 950;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 16px 34px rgba(226, 58, 139, .24);
  font-size: 1.3rem;
  font-weight: 950;
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  color: #48576a;
  background: rgba(255, 255, 255, .76);
  border: 1px solid rgba(228, 234, 242, .9);
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(340px, 1.1fr);
  gap: 18px;
}

.profile-load {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.profile-load strong {
  font-size: 2.6rem;
  line-height: 1;
}

.profile-facts {
  display: grid;
  gap: 10px;
}

.profile-facts div {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.profile-facts span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.profile-facts strong {
  font-size: .98rem;
  line-height: 1.35;
}

.profile-facts a {
  color: var(--ink);
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.note-list {
  display: grid;
  gap: 10px;
}

.note-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #ffffff;
}

.note-card p {
  margin: 0;
  color: #415164;
  font-weight: 650;
}

.note-meta {
  display: inline-block;
  margin-top: 4px;
}

.document-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.document-upload-box {
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.document-list {
  display: grid;
  gap: 10px;
}

.document-archive {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.document-archive > summary {
  cursor: pointer;
  font-weight: 750;
  color: #415164;
  margin-bottom: 10px;
}

.document-row-archived {
  background: var(--surface-soft);
}

.document-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
}

.document-actions {
  display: grid;
  min-width: min(420px, 100%);
  gap: 8px;
  justify-items: end;
}

.document-deadline-field {
  width: min(220px, 100%);
}

.document-preview {
  min-height: 120px;
  margin-top: 16px;
  border: 1px dashed rgba(100, 112, 128, .35);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface-soft);
}

.document-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.document-preview iframe,
.pdf-preview-object {
  width: 100%;
  height: min(68vh, 720px);
  display: block;
  border: 0;
  background: #ffffff;
}

.pdf-preview-fallback {
  padding: 14px;
}

.task-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
}

.task-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.task-label input {
  width: 22px;
  height: 22px;
  margin-top: 1px;
  accent-color: var(--primary);
}

.task-done .item-title {
  color: var(--muted);
  text-decoration: line-through;
}

.related-task-list {
  gap: 10px;
}

.related-task-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.related-task-compact span {
  max-width: 100%;
  overflow: hidden;
  padding: 5px 8px;
  border-radius: 999px;
  color: #48576a;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  font-size: .78rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-list {
  display: grid;
  gap: 8px;
}

.activity-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  color: #455468;
  font-weight: 660;
}

.activity-dot {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 999px;
  background: var(--primary);
}

.data-path {
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: #415164;
  background: var(--surface-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: .88rem;
  word-break: break-word;
}

.danger-box {
  display: grid;
  gap: 9px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(195, 59, 74, .2);
  border-radius: var(--radius-md);
  background: var(--red-soft);
}

.danger-box p {
  margin: 0;
  color: #73424a;
  font-weight: 650;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(16, 42, 63, .42);
  backdrop-filter: blur(7px);
}

.modal-backdrop.is-open {
  display: flex;
}

.modal {
  width: min(100%, 780px);
  max-height: min(92vh, 860px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: var(--shadow);
  animation: modal-in .2s ease both;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  font-size: 1.24rem;
}

.modal-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 650;
}

.modal-body {
  padding: 20px;
  display: grid;
  gap: 14px;
}

.form-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-cols .full {
  grid-column: 1 / -1;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.check-tile {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  font-weight: 800;
}

.check-tile input {
  accent-color: var(--primary);
}

.empty-state {
  padding: 18px;
  border: 1px dashed #cad4e1;
  border-radius: var(--radius-md);
  color: var(--muted);
  background: #fbfdff;
  font-weight: 700;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  display: none;
  max-width: min(380px, calc(100vw - 36px));
  padding: 13px 15px;
  border-radius: 14px;
  color: #ffffff;
  background: #172d42;
  box-shadow: 0 16px 40px rgba(23, 45, 66, .2);
  font-weight: 850;
}

.toast.is-visible {
  display: block;
}

@media (max-width: 1180px) {
  .metric-grid,
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split-grid {
    grid-template-columns: 1fr;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }

  .week-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calendar-toolbar {
    grid-template-columns: repeat(4, auto);
  }

  .staff-list-row {
    grid-template-columns: minmax(220px, 1.2fr) minmax(180px, 1fr) auto;
  }

  .record-row {
    grid-template-columns: minmax(220px, 1.1fr) minmax(180px, .9fr) auto;
  }

  .record-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .staff-list-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .calendar-toolbar .select,
  .calendar-month-label {
    grid-column: span 2;
  }

  .report-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .login-card {
    grid-template-columns: 1fr;
  }

  .login-panel {
    border-left: 0;
    border-top: 1px solid rgba(234, 216, 234, .86);
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    width: min(86vw, 320px);
    transform: translateX(-104%);
    transition: transform .22s ease;
    box-shadow: 24px 0 80px rgba(16, 42, 63, .22);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  body.sidebar-open::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(16, 42, 63, .36);
  }

  .menu-button {
    display: inline-grid;
    place-items: center;
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar-actions .button-primary {
    display: none;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .staff-list-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .record-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .staff-list-actions {
    width: 100%;
  }

  .record-actions {
    width: 100%;
  }

  .calendar-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .calendar-month-label,
  .calendar-toolbar .select {
    grid-column: 1 / -1;
  }

  .page-nav {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .page-nav-button {
    flex: 1;
  }
}

@media (max-width: 620px) {
  .login-view {
    padding: 12px;
  }

  .login-card {
    border-radius: 22px;
  }

  .login-art h1 {
    margin-top: 28px;
    font-size: 2rem;
  }

  .login-art,
  .login-panel {
    padding: 24px;
  }

  .content {
    padding: 14px;
  }

  .topbar {
    padding: 14px;
    flex-wrap: wrap;
  }

  .topbar-title {
    flex: 1;
  }

  .metric-grid,
  .card-grid,
  .week-grid,
  .form-cols,
  .checkbox-grid,
  .mini-grid,
  .document-upload-grid {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 16px;
    border-radius: 20px;
  }

  .panel-head,
  .row-between,
  .task-row,
  .document-row,
  .document-preview-head,
  .profile-hero,
  .profile-title {
    flex-direction: column;
  }

  .staff-list-actions {
    flex-direction: column;
  }

  .record-actions {
    flex-direction: column;
  }

  .profile-actions {
    justify-items: stretch;
  }

  .document-actions,
  .document-deadline-field {
    width: 100%;
    justify-items: stretch;
  }

  .profile-actions .button {
    width: 100%;
  }

  .topbar-actions {
    width: 100%;
    display: flex;
    justify-content: flex-start;
  }

  .topbar-actions .save-state,
  .topbar-actions .quick-create {
    display: none;
  }

  .global-search {
    width: 100%;
  }

  .modal-backdrop {
    padding: 10px;
    align-items: flex-end;
  }

  .modal {
    border-radius: 22px 22px 0 0;
  }
}
