@font-face {
  font-family: Tajawal;
  src: url('./fonts/Tajawal-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Tajawal;
  src: url('./fonts/Tajawal-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Tajawal;
  src: url('./fonts/Tajawal-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
:root {
  --ground: #f2f5f3;
  --surface: #fff;
  --ink: #192b23;
  --muted: #5d6d65;
  --line: #dce5df;
  --accent: #205c43;
  --soft: #edf4ef;
  --warning: #936015;
  --danger: #ad3e36;
  --radius: 12px;
  font-family: Tajawal, 'Segoe UI', Arial, sans-serif;
  color: var(--ink);
  font-size: 16px;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--ground);
  font-size: 1.0625rem;
  line-height: 1.7;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  user-select: none;
}
a {
  color: var(--accent);
  text-decoration: none;
}
button:disabled {
  cursor: default;
  opacity: 0.55;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #86b39a;
  outline-offset: 3px;
}
[hidden],
.hidden {
  display: none !important;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  font-weight: 700;
  text-wrap: balance;
  line-height: 1.4;
}
h1 {
  font-size: 1.8rem;
}
h2 {
  font-size: 1.2rem;
}
h3 {
  font-size: 1.05rem;
}
p {
  text-wrap: pretty;
}
small,
.muted,
.field-note {
  color: var(--muted);
}
small {
  font-size: 0.875rem;
  line-height: 1.6;
}
svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.skip-link {
  position: fixed;
  top: -80px;
  right: 20px;
  background: var(--ink);
  color: #fff;
  padding: 12px;
  z-index: 50;
}
.skip-link:focus {
  top: 10px;
}
/* Desktop: 248px navigation + fluid sheet, equal 32px canvas gutters. */
.sidebar {
  position: fixed;
  inset: 0 0 0 auto;
  width: 248px;
  padding: 30px 18px 18px;
  display: flex;
  flex-direction: column;
  background: var(--ground);
  border-inline-end: 1px solid var(--line);
  z-index: 10;
  overflow: auto;
  overscroll-behavior: contain;
}
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--ink);
  padding-inline: 10px;
}
.brand span {
  display: flex;
  flex-direction: column;
}
.brand strong {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.2;
}
.brand small {
  font-size: 0.8125rem;
  margin-top: 5px;
}
.sidebar-company {
  margin: 30px 10px 16px;
  padding: 15px 0;
  border-block: 1px solid var(--line);
  display: grid;
  gap: 5px;
  font-size: 0.9375rem;
  font-weight: 500;
}
.eyebrow {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 5px;
}
.nav-group-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
  display: block;
  padding: 20px 12px 8px;
}
.main-nav {
  display: grid;
  gap: 5px;
}
.nav-item {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 46px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  text-align: start;
  color: #506359;
  padding: 10px 12px;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
}
.nav-item.active {
  background: #fff;
  border-color: #d9e4dd;
  color: var(--accent);
  font-weight: 700;
}
.nav-item svg {
  width: 19px;
  height: 19px;
}
.sidebar-bottom {
  margin-top: auto;
  padding-top: 22px;
}
.sidebar-account {
  border-top: 1px solid var(--line);
  padding: 16px 12px 0;
  display: grid;
  gap: 7px;
  font-size: 0.875rem;
}
.workspace {
  margin-inline-start: 248px;
  min-height: 100dvh;
}
.app-header {
  height: 76px;
  padding: 0 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.header-start {
  display: flex;
  align-items: center;
  gap: 13px;
}
.header-label {
  font-size: 0.9375rem;
  color: var(--muted);
  font-weight: 500;
}
.mobile-brand {
  display: none;
}
.icon-button,
.text-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 5px;
}
.menu-toggle {
  display: none;
}
.notification-button {
  position: relative;
  border: 1px solid #d8e1db;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 10px 14px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9375rem;
  font-weight: 500;
}
.notification-button > svg {
  width: 21px;
  height: 21px;
}
.notification-count {
  background: #b74336;
  color: white;
  min-width: 23px;
  height: 23px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: Tajawal, sans-serif;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1;
}
.main-sheet {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  margin: 0 18px 18px;
  padding: 32px;
  min-height: calc(100dvh - 94px);
  outline: none;
}
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}
.page-subtitle {
  margin-top: 8px;
  color: var(--muted);
  font-size: 1rem;
  max-width: 70ch;
  line-height: 1.65;
}
.toolbar,
.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.toolbar {
  margin-bottom: 24px;
  justify-content: space-between;
}
.toolbar .field {
  min-width: 190px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 19px;
  border: 1px solid #cfdcd3;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.5;
  white-space: normal;
}
.button.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  font-weight: 700;
}
.button.danger {
  color: var(--danger);
  border-color: #e8c7c3;
  background: #fff;
}
.button.small {
  padding: 6px 11px;
  min-height: 36px;
  font-size: 0.875rem;
}
.text-button {
  text-align: start;
  justify-content: flex-start;
  color: var(--accent);
  font-size: 0.9375rem;
  font-weight: 500;
}
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 26px;
  overflow: hidden;
  background: #fff;
}
.panel-head {
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}
.panel-body {
  padding: 24px;
}
.grid {
  display: grid;
  gap: 24px;
  align-items: start;
}
.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-block: 1px solid var(--line);
  margin: 26px 0 32px;
  padding: 25px 0;
}
.metric {
  padding-inline: 28px;
  border-inline-start: 1px solid var(--line);
}
.metric:first-child {
  padding-inline-start: 0;
  border: 0;
}
.metric-label {
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.5;
}
.metric-value {
  font-size: 1.9rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.6;
  margin-top: 5px;
}
.metric.lead .metric-value {
  font-size: 2.15rem;
  color: var(--accent);
}
.form-grid,
.row-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 19px 18px;
}
.field {
  display: grid;
  gap: 8px;
  min-width: 0;
  align-content: start;
}
.field.full {
  grid-column: 1/-1;
}
.field label,
label.field-label {
  font-size: 0.9375rem;
  font-weight: 500;
  color: #3d5146;
}
.field-note {
  font-size: 0.875rem;
  line-height: 1.65;
}
.field input,
.field select,
.field textarea,
textarea,
input:not([type='checkbox']),
select {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border: 1px solid #b9c9be;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 11px 13px;
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.5;
}
.field input,
.field select {
  margin-top: 6px;
}
.field textarea,
textarea {
  min-height: 115px;
  resize: vertical;
}
input::placeholder,
textarea::placeholder {
  color: #7c8982;
  opacity: 1;
}
select {
  appearance: auto;
}
input[type='checkbox'] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9375rem;
  line-height: 1.65;
}
.optional {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.8125rem;
}
.tabs {
  display: flex;
  gap: 26px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
  overflow: auto;
}
.tab {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 12px 2px;
  white-space: nowrap;
  font-size: 0.9375rem;
}
.tab.active {
  color: var(--ink);
  border-color: var(--ink);
  font-weight: 700;
}
.table-wrap {
  overflow: auto;
}
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
  line-height: 1.65;
}
th {
  font-size: 0.875rem;
  font-weight: 500;
  color: #64736a;
  white-space: nowrap;
  text-align: start;
}
th,
td {
  padding: 18px 14px;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
th:first-child,
td:first-child {
  padding-inline-start: 24px;
}
tr:last-child td {
  border-bottom: 0;
}
.num,
.mono {
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: isolate;
}
.num {
  text-align: end;
  white-space: nowrap;
}
.positive {
  color: var(--accent);
}
.negative {
  color: var(--danger);
}
td small {
  display: block;
  font-size: 0.875rem;
  margin-top: 4px;
}
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 5px;
  padding: 4px 8px;
  line-height: 1.4;
  font-size: 0.8125rem;
  font-weight: 500;
  background: #edf2ee;
  color: #506258;
  white-space: nowrap;
}
.badge.warning {
  background: #fbf1dc;
  color: var(--warning);
}
.badge.danger {
  background: #fbeae7;
  color: var(--danger);
}
.badge.success {
  background: #e7f2eb;
  color: var(--accent);
}
.notice {
  padding: 15px 18px;
  border-radius: 9px;
  background: #eff4f1;
  color: #455d4e;
  font-size: 0.9375rem;
  line-height: 1.75;
  margin-bottom: 22px;
}
.notice.warning {
  background: #fff6e3;
  color: #78500e;
}
.notice.danger {
  background: #fff0ed;
  color: var(--danger);
}
.notice.success {
  background: #ebf5ee;
  color: var(--accent);
}
.global-status {
  margin: 0 18px 16px;
  padding: 15px 24px;
  border: 1px solid #c3ddcc;
  border-radius: 10px;
  background: #edf6f0;
  color: #20553a;
  font-size: 1rem;
  font-weight: 500;
}
.global-status.error {
  background: #fff0ed;
  color: var(--danger);
  border-color: #edc6bf;
}
.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9375rem;
}
.empty-state strong {
  display: block;
  color: var(--ink);
  margin-bottom: 8px;
}
.journal-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  gap: 14px;
}
.row-actions {
  display: flex;
  gap: 8px;
  margin-top: 22px;
  flex-wrap: wrap;
}
.journal-extra {
  margin-top: 20px;
}
.journal-extra summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.9375rem;
  margin-bottom: 18px;
}
.review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.review-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px;
}
.review-card dl {
  margin: 17px 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}
.review-card dt {
  font-size: 0.9375rem;
  color: var(--muted);
}
.review-card dd {
  margin: 0;
  text-align: end;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.review-total {
  font-size: 1.8rem;
  color: var(--accent);
  margin-top: 12px;
}
.attachment-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  width: 100%;
}
.attachment {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  background: #fafcfb;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 0.875rem;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}
.attachment .text-button {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: start;
}
.attachment .button {
  flex-shrink: 0;
}
.attachment-thumb {
  height: 42px;
  width: 42px;
  object-fit: cover;
  border-radius: 5px;
  outline: 1px solid #00000016;
  outline-offset: -1px;
}
.upload-zone {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 88px;
  padding: 18px;
  border: 1px solid #cbdcd0;
  border-radius: 11px;
  background: #f7faf8;
  cursor: pointer;
  text-align: start;
  overflow: hidden;
}
.upload-zone:focus-within {
  outline: 3px solid #86b39a;
  outline-offset: 3px;
}
.field .upload-zone {
  font-size: 1rem;
}
.upload-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #e8f1eb;
  color: var(--accent);
  flex-shrink: 0;
}
.upload-icon svg {
  width: 22px;
  height: 22px;
}
.upload-copy {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 4px;
}
.upload-copy strong {
  font-size: 1rem;
  font-weight: 700;
  color: #2b4b38;
}
.upload-copy small {
  font-size: 0.8125rem;
  line-height: 1.5;
}
.upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 8px 12px;
  min-height: 38px;
  border: 1px solid #becfc3;
  border-radius: 7px;
  background: white;
  color: #2d4e39;
  font-size: 0.875rem;
  font-weight: 700;
}
.upload-zone .upload-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  max-height: 1px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  opacity: 0;
  overflow: hidden;
  clip-path: inset(50%);
}
.upload-progress {
  display: none;
}
.upload-zone.uploading .upload-progress {
  display: block;
  position: absolute;
  bottom: 4px;
  inset-inline: 18px;
  font-size: 0.75rem;
  color: var(--accent);
}
.upload-zone.uploading .upload-button {
  background: #e7f0ea;
}
.bar-chart {
  display: grid;
  gap: 15px;
}
.bar-row {
  display: grid;
  grid-template-columns: 48px minmax(60px, 1fr) 108px;
  gap: 12px;
  align-items: center;
  font-size: 0.9375rem;
}
.bar-svg {
  width: 100%;
  height: 11px;
  stroke: none;
}
.bar-track {
  height: 11px;
  background: #edf3ee;
  border-radius: 2px;
  overflow: hidden;
}
.bar-fill {
  display: block;
  height: 100%;
  background: var(--accent);
  transform-origin: right;
  transform: scaleX(var(--bar-scale, 0));
}
.auth-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 36px 18px;
  background: #eef3ef;
}
.auth-card {
  width: min(100%, 455px);
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 34px;
}
.auth-brand {
  margin-bottom: 36px;
  padding-inline: 0;
}
.auth-heading {
  margin-bottom: 27px;
}
.auth-heading h1 {
  font-size: 1.7rem;
}
.auth-heading p {
  font-size: 1rem;
  color: var(--muted);
  margin-top: 9px;
}
#login-form {
  display: grid;
  gap: 19px;
}
.auth-submit {
  width: 100%;
  margin-top: 6px;
}
.auth-owner {
  padding-top: 3px;
}
.auth-footer {
  color: var(--muted);
  font-size: 0.875rem;
  margin-top: 26px;
  text-align: center;
}
.initial-loading {
  padding: 80px;
  text-align: center;
  color: var(--muted);
}
dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 30px;
  width: min(800px, calc(100% - 32px));
  max-height: 90dvh;
  overflow: auto;
  overscroll-behavior: contain;
  color: var(--ink);
  font-family: inherit;
}
dialog::backdrop {
  background: #152b2166;
}
.dialog-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 26px;
}
.preview-image {
  max-width: 100%;
  max-height: 65dvh;
  object-fit: contain;
}
.document-frame {
  width: 100%;
  height: 65dvh;
  border: 1px solid var(--line);
}
.profile-note {
  padding: 15px 0;
  border-block: 1px solid var(--line);
  margin-bottom: 20px;
}
.recovery-codes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  font-family: monospace;
  direction: ltr;
}
.qr {
  width: 240px;
  max-width: 100%;
  display: block;
  background: white;
  margin-block: 20px;
}
.long-text {
  overflow-wrap: anywhere;
}
/* Notification inbox: independent cards, readable identity and expiry priority. */
dialog.notification-drawer {
  position: fixed;
  inset: 12px auto 12px 12px;
  margin: 0;
  width: 450px;
  max-width: calc(100vw - 24px);
  height: calc(100dvh - 24px);
  max-height: calc(100dvh - 24px);
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  background: #f7f9f8;
  box-shadow: 0 12px 48px #15322226;
  display: flex;
  flex-direction: column;
}
.notifications-head {
  padding: 26px 24px 20px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.notifications-head h2 {
  font-size: 1.55rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.notification-total {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  font-size: 0.9375rem;
  background: #edf2ef;
  color: #52695a;
  border-radius: 7px;
}
.close-notifications {
  font:
    400 28px/1 Tajawal,
    sans-serif;
  width: 36px;
  min-height: 36px;
  border: 1px solid #e1e8e3;
  border-radius: 8px;
  color: #6a7b70;
}
.notifications-filters {
  display: flex;
  gap: 24px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: white;
}
.notification-filter {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.notification-filter.active {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}
.notification-filter span {
  font-size: 0.8125rem;
  color: #708076;
}
.notifications-scroll {
  overflow: auto;
  overscroll-behavior: contain;
  padding: 20px;
  flex: 1;
  min-height: 0;
}
.notification-card {
  padding: 18px;
  background: white;
  border: 1px solid #dce5df;
  border-inline-start: 3px solid #d69b3e;
  border-radius: 11px;
  margin-bottom: 14px;
}
.notification-card.overdue {
  border-inline-start-color: #bd5144;
}
.notification-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 15px;
}
.notification-kind {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #64776b;
  font-size: 0.875rem;
  font-weight: 500;
}
.notification-kind svg {
  width: 18px;
  height: 18px;
}
.notification-time {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #8e611b;
  background: #fff5df;
  padding: 4px 8px;
  border-radius: 5px;
  white-space: nowrap;
}
.notification-time.danger {
  color: #a73c33;
  background: #fff0ed;
}
.notification-card h3 {
  font-size: 1.0625rem;
  line-height: 1.5;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.vehicle-number {
  font-weight: 700;
  font-size: 1rem;
  padding: 2px 9px;
  border: 1px solid #d9e3dc;
  border-radius: 5px;
  background: #f6f9f7;
  line-height: 1.5;
}
.notification-card p {
  font-size: 0.9375rem;
  line-height: 1.8;
  color: #5b6e61;
}
.notification-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 17px;
  padding-top: 13px;
  border-top: 1px solid #eef2ef;
}
.notification-card-bottom .button {
  font-size: 0.8125rem;
  min-height: 34px;
  padding: 5px 9px;
}
.notification-reviewed {
  font-size: 0.8125rem;
  color: #728178;
}
.notification-card.is-read {
  background: #fbfcfb;
}
.notification-card.is-read .notification-kind {
  color: #7d8b82;
}
.notifications-footer {
  background: white;
  border-top: 1px solid var(--line);
  padding: 17px 22px;
  display: grid;
  gap: 12px;
}
.notifications-footer small {
  font-size: 0.8125rem;
}
.notifications-footer .actions {
  justify-content: space-between;
}
.notification-empty {
  text-align: center;
  padding: 65px 15px;
  color: var(--muted);
}
.notification-empty > svg {
  width: 38px;
  height: 38px;
  color: var(--accent);
  margin-bottom: 20px;
}
.notification-empty h3 {
  margin-bottom: 8px;
}
.notification-empty p {
  font-size: 0.9375rem;
}
@media (hover: hover) and (pointer: fine) {
  .nav-item:hover {
    background: #e8eeea;
    color: var(--ink);
  }
  .button:hover {
    border-color: #80a38b;
    background: #f8fbf9;
  }
  .button.primary:hover {
    background: #174832;
  }
  .text-button:hover {
    text-decoration: underline;
  }
  .upload-zone:hover {
    border-color: #82aa8d;
    background: #f0f6f2;
  }
  .notification-button:hover {
    border-color: #9ab6a3;
  }
  .notification-filter:hover {
    color: var(--accent);
  }
}
@media (prefers-reduced-motion: no-preference) {
  .button {
    transition:
      background-color 150ms ease-out,
      transform 150ms ease-out;
  }
  .button:not(:disabled):active {
    transform: scale(0.96);
  }
}
@media (max-width: 1100px) {
  .sidebar {
    width: 220px;
    padding-inline: 13px;
  }
  .workspace {
    margin-inline-start: 220px;
  }
  .main-sheet {
    padding: 25px;
  }
  .app-header {
    padding: 0 28px;
  }
  .form-grid,
  .row-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid.two {
    grid-template-columns: 1fr;
  }
  .grid.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .metric {
    padding-inline: 20px;
  }
}
@media (max-width: 760px) {
  .sidebar {
    visibility: hidden;
    transform: translateX(110%);
    width: min(320px, 88vw);
    padding-top: calc(26px + env(safe-area-inset-top));
    box-shadow: -10px 0 40px #132f1e20;
  }
  .sidebar.open {
    visibility: visible;
    transform: none;
  }
  .workspace {
    margin: 0;
  }
  .app-header {
    height: 70px;
    padding: 8px 18px;
    padding-top: calc(8px + env(safe-area-inset-top));
  }
  .menu-toggle {
    display: inline-flex;
    width: 34px;
  }
  .header-label {
    display: none;
  }
  .mobile-brand {
    display: inline;
    font-weight: 700;
    font-size: 1.4rem;
  }
  .notification-button {
    min-width: 44px;
    padding: 8px 11px;
    min-height: 42px;
  }
  .notification-button > span:not(.notification-count) {
    display: none;
  }
  .notification-count {
    position: absolute;
    left: -6px;
    top: -7px;
    min-width: 21px;
    height: 21px;
    border: 2px solid var(--ground);
    font-size: 0.75rem;
  }
  .main-sheet {
    margin: 0 8px 8px;
    padding: 24px 17px;
    border-radius: 13px;
    min-height: calc(100dvh - 78px);
    padding-bottom: calc(30px + env(safe-area-inset-bottom));
  }
  .page-head {
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
  }
  h1 {
    font-size: 1.65rem;
  }
  .page-subtitle {
    font-size: 0.9375rem;
    line-height: 1.75;
  }
  .toolbar {
    gap: 16px;
  }
  .toolbar > .actions {
    width: 100%;
  }
  .toolbar .field {
    min-width: 0;
    flex: 1;
  }
  .summary-strip {
    gap: 0;
    margin: 24px 0;
    padding: 20px 0;
  }
  .metric {
    padding-inline: 12px;
  }
  .metric-value {
    font-size: 1.35rem;
  }
  .metric.lead .metric-value {
    font-size: 1.55rem;
  }
  .metric-label {
    font-size: 0.8125rem;
    line-height: 1.6;
  }
  .panel-head,
  .panel-body {
    padding: 18px;
  }
  .panel-head {
    flex-wrap: wrap;
  }
  .form-grid,
  .row-fields,
  .grid.three {
    grid-template-columns: 1fr 1fr;
    gap: 18px 14px;
  }
  .field.full-mobile {
    grid-column: 1/-1;
  }
  .journal-row {
    padding: 18px;
  }
  .review-grid {
    grid-template-columns: 1fr;
  }
  .button {
    min-height: 44px;
  }
  .table-wrap {
    overflow: visible;
  }
  table.data-table {
    display: block;
  }
  table.data-table thead {
    display: none;
  }
  table.data-table tbody {
    display: block;
  }
  table.data-table tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 13px 18px;
    padding: 20px 18px;
    border-bottom: 1px solid var(--line);
  }
  table.data-table td {
    padding: 0 !important;
    border: 0;
    display: flex;
    flex-direction: column;
    text-align: start;
    white-space: normal;
    min-width: 0;
    font-size: 1rem;
  }
  table.data-table td::before {
    content: attr(data-label);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--muted);
    margin-bottom: 4px;
  }
  table.data-table td.wide {
    grid-column: 1/-1;
  }
  table.data-table .num {
    text-align: start;
  }
  .bar-row {
    grid-template-columns: 30px 1fr 87px;
    gap: 10px;
    font-size: 0.875rem;
  }
  .global-status {
    margin-inline: 8px;
    padding: 14px 18px;
  }
  .auth-card {
    padding: 28px;
  }
  .auth-page {
    padding-block: 26px;
  }
  .recovery-codes {
    grid-template-columns: 1fr;
  }
  dialog {
    padding: 22px;
  }
  .dialog-actions {
    justify-content: stretch;
    flex-wrap: wrap;
  }
  .dialog-actions .button {
    flex: 1;
  }
  .upload-zone {
    padding: 15px;
    gap: 11px;
    min-height: 96px;
    flex-wrap: wrap;
  }
  .upload-copy {
    min-width: 150px;
  }
  .upload-button {
    margin-inline-start: auto;
  }
  .upload-icon {
    width: 40px;
    height: 40px;
  }
  .upload-copy small {
    font-size: 0.8125rem;
  }
  dialog.notification-drawer {
    inset: 8px;
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
  }
  .notifications-head {
    padding: 23px 20px 18px;
  }
  .notifications-filters {
    padding-inline: 20px;
  }
  .notifications-scroll {
    padding: 16px;
  }
  .notification-card {
    padding: 16px;
  }
  .notification-card-top {
    gap: 6px;
  }
  .notification-time {
    font-size: 0.75rem;
  }
  .notification-kind {
    font-size: 0.8125rem;
  }
}
@media (max-width: 380px) {
  .form-grid,
  .row-fields {
    grid-template-columns: 1fr;
  }
  .metric {
    padding-inline: 8px;
  }
  .metric-label {
    font-size: 0.75rem;
  }
  .metric-value {
    font-size: 1.2rem;
  }
  .metric.lead .metric-value {
    font-size: 1.35rem;
  }
  .upload-zone {
    align-items: flex-start;
  }
  .upload-copy {
    min-width: 120px;
  }
  .upload-button {
    margin-inline-start: 51px;
  }
}
.smart-select {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  margin-top: 6px;
}
.smart-select .smart-select-native {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  clip-path: inset(50%);
}
.select-trigger {
  font:
    400 1.0625rem/1.5 Tajawal,
    sans-serif;
  width: 100%;
  min-width: 0;
  min-height: 47px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  text-align: start;
  padding: 11px 13px;
  border: 1px solid #b9c9be;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
}
.select-current {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.select-trigger > svg {
  width: 18px;
  height: 18px;
  color: #6d8274;
  stroke-width: 1.8;
}
.smart-select.is-open .select-trigger {
  border-color: #4f8867;
  box-shadow: 0 0 0 3px #e7f0e9;
}
.smart-select.is-open .select-trigger > svg {
  transform: rotate(180deg);
}
.select-trigger:disabled {
  background: #f1f4f2;
  color: #839087;
  cursor: not-allowed;
}
.select-popup {
  position: fixed;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  padding: 6px;
  border: 1px solid #d7e2d9;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 8px 30px #1735241a;
  overflow: hidden;
  font:
    400 1rem/1.6 Tajawal,
    sans-serif;
  color: var(--ink);
}
.select-options {
  overflow: auto;
  overscroll-behavior: contain;
  max-height: 280px;
  padding: 2px;
}
.select-option {
  padding: 10px 12px;
  min-height: 43px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  cursor: pointer;
  line-height: 1.5;
}
.select-option.is-active {
  background: #edf5ef;
  color: #1e5439;
}
.select-option[aria-selected='true'] {
  color: #1e5a3c;
  font-weight: 700;
}
.select-option > svg {
  width: 17px;
  height: 17px;
  color: #2c7750;
  stroke-width: 2;
}
.select-option.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.select-search {
  padding: 5px 5px 8px;
  border-bottom: 1px solid #edf2ee;
  margin-bottom: 4px;
}
.select-search input {
  min-height: 40px;
  font-size: 1rem !important;
  padding: 8px 10px !important;
  border-color: #d5e1d9 !important;
  border-radius: 6px !important;
  margin: 0 !important;
}
.select-no-results {
  padding: 20px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9375rem;
}
@media (max-width: 760px) {
  .select-option {
    min-height: 46px;
  }
  .select-trigger {
    min-height: 48px;
  }
  .select-popup {
    border-radius: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
/* Closed drawers must stay hidden even when their layout uses flex. */
dialog:not([open]) {
  display: none;
}
.entry-tools {
  display: grid;
  gap: 16px;
  min-width: 185px;
}
.entry-tools > .attachment-list:empty {
  display: none;
}
.entry-tools > .attachment-list {
  margin: 0;
}
.entry-actions {
  gap: 12px;
  padding-top: 4px;
}
.entry-tools > .attachment-list + .entry-actions {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.entry-tools > .attachment-list:empty + .entry-actions {
  border: 0;
  padding-top: 0;
}
.attachment {
  flex-wrap: wrap;
  gap: 10px 12px;
}
.attachment .text-button {
  flex: 1 1 130px;
}
.attachment .button {
  margin-inline-start: auto;
}
.toolbar > .actions {
  align-items: flex-end;
}
.period-picker {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  min-width: 0;
}
.toolbar .period-picker .field {
  min-width: 120px;
}
.annual-controls {
  align-items: flex-end;
}
.annual-controls > .button {
  min-height: 48px;
  margin-bottom: 0;
}
.annual-controls input {
  height: 48px;
}
.bar-row {
  grid-template-columns: 70px minmax(60px, 1fr) 108px;
}
.field.full {
  grid-column: 1/-1;
}
@media (max-width: 760px) {
  .period-picker {
    flex: 1 1 100%;
    width: 100%;
  }
  .toolbar .period-picker .field {
    flex: 1;
    min-width: 0;
  }
  .entry-tools {
    min-width: 0;
  }
  .entry-actions .button {
    min-width: 82px;
  }
  .bar-row {
    grid-template-columns: 62px minmax(35px, 1fr) 85px;
  }
  .annual-controls > .field {
    flex: 1;
  }
  .annual-controls > .button {
    flex-shrink: 0;
  }
}

/* Sidebar groups are native disclosures: keyboard behavior and expanded state remain available without JavaScript. */
.nav-group {
  min-width: 0;
  margin-top: 10px;
}
.nav-group-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 12px 9px;
  min-height: 44px;
  list-style: none;
  cursor: pointer;
  color: #53665b;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 7px;
  user-select: none;
}
.nav-group-summary::-webkit-details-marker {
  display: none;
}
.nav-group-summary > svg {
  height: 14px;
  width: 14px;
  transform: rotate(180deg);
  stroke-width: 1.8;
}
.nav-group[open] > .nav-group-summary > svg {
  transform: rotate(90deg);
}
.nav-group-items {
  display: grid;
  gap: 5px;
  padding-inline-start: 7px;
}
.nav-group-items > .nav-item {
  font-size: 0.9375rem;
  padding-inline: 12px;
}
.sidebar-close {
  display: none;
}
.nav-scrim {
  position: fixed;
  inset: 0;
  background: #18342759;
  z-index: 30;
}
.nav-item.active {
  color: #174f36;
}
.nav-item:focus-visible,
.nav-group-summary:focus-visible,
.button:focus-visible,
.text-button:focus-visible,
.icon-button:focus-visible,
.notification-button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid #2c7150;
  outline-offset: 3px;
}
.upload-zone:focus-within {
  outline-color: #2c7150;
}
input::placeholder,
textarea::placeholder {
  color: #66776b;
}
.main-sheet h1:focus-visible {
  outline: 2px solid #2c7150;
  outline-offset: 6px;
  border-radius: 4px;
}
.main-sheet h1 {
  scroll-margin-top: 24px;
}
.summary-strip > .metric {
  min-width: 0;
}
.metric-value {
  overflow-wrap: anywhere;
}
.metric-label {
  overflow-wrap: anywhere;
}
.summary-strip:has(> .metric:nth-child(4)) {
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
}
@media (hover: hover) and (pointer: fine) {
  .nav-group-summary:hover {
    background: #e8eeea;
    color: var(--ink);
  }
}
@media (max-width: 760px) {
  .sidebar {
    z-index: 40;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
    padding-top: calc(20px + env(safe-area-inset-top));
  }
  .sidebar-close {
    display: inline-flex;
    position: absolute;
    top: calc(16px + env(safe-area-inset-top));
    inset-inline-end: 13px;
    width: 44px;
    min-height: 44px;
    border: 1px solid #c2d0c6;
    border-radius: 8px;
    background: var(--ground);
    color: var(--ink);
  }
  .sidebar > .brand {
    padding-inline-end: 42px;
    min-height: 48px;
  }
  .nav-group-summary {
    font-size: 0.9375rem;
  }
  .nav-group-items > .nav-item {
    font-size: 1rem;
    min-height: 46px;
  }
  .summary-strip:has(> .metric:nth-child(4)) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .summary-strip:has(> .metric:nth-child(4)) > .metric {
    padding-block: 10px;
  }
  .summary-strip:has(> .metric:nth-child(4)) > .metric:nth-child(odd) {
    border-inline-start: 0;
  }
  .summary-strip:has(> .metric:nth-child(4)) > .metric:last-child:nth-child(odd) {
    grid-column: 1/-1;
  }
}
@media (max-width: 520px) {
  .summary-strip,
  .summary-strip:has(> .metric:nth-child(4)) {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 6px 0;
    margin: 22px 0;
  }
  .summary-strip > .metric {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    width: 100%;
  }
  .summary-strip > .metric:last-child {
    border-bottom: 0;
  }
  .summary-strip .metric-label {
    font-size: 0.9375rem;
    line-height: 1.6;
    max-width: 48%;
    flex: 1;
  }
  .summary-strip .metric-value,
  .summary-strip .metric.lead .metric-value {
    font-size: 1.45rem;
    line-height: 1.4;
    margin: 0;
    text-align: end;
    min-width: 0;
    max-width: 62%;
  }
  .summary-strip .metric.lead .metric-value {
    font-size: 1.6rem;
  }
  .metric.lead {
    order: -1;
  }
  .table-wrap .data-table td {
    overflow-wrap: anywhere;
  }
  .toolbar .actions {
    min-width: 0;
  }
  .page-head > .actions {
    max-width: 100%;
  }
  .page-head > .actions .button {
    white-space: normal;
  }
  .notification-button:focus-visible {
    outline-offset: 2px;
  }
}
@media print {
  .sidebar,
  .app-header,
  .global-status,
  .nav-scrim,
  .skip-link,
  .dialog-actions {
    display: none !important;
  }
  .workspace {
    margin: 0 !important;
  }
  .main-sheet {
    border: 0;
    border-radius: 0;
    margin: 0;
    padding: 0;
    min-height: 0;
  }
  .page-head {
    break-after: avoid;
  }
  .panel,
  .journal-row {
    break-inside: avoid;
  }
  .table-wrap {
    overflow: visible;
  }
  table.data-table {
    display: table;
  }
  table.data-table thead {
    display: table-header-group;
  }
  table.data-table tbody {
    display: table-row-group;
  }
  table.data-table tr {
    display: table-row;
  }
  table.data-table td {
    display: table-cell;
  }
  table.data-table td::before {
    display: none;
  }
  dialog {
    display: none !important;
  }
}

.nav-section {
  padding-block: 0.35rem;
  border-bottom: 1px solid #cdd9d2;
}
.nav-section summary {
  cursor: pointer;
  padding: 0.55rem 0.65rem;
  font-weight: 700;
}
.nav-section .nav-item {
  width: 100%;
  padding-inline-start: 1.15rem;
}
.sidebar {
  overflow-y: auto;
}
input:not([type='checkbox']),
select,
textarea {
  border-color: #76897d;
}
:focus-visible {
  outline: 3px solid #28714e;
  outline-offset: 2px;
}
@media (max-width: 520px) {
  .summary-strip {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .summary-strip .metric {
    min-width: 0;
  }
  .metric-value {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

.entity-control {
  display: flex;
  align-items: center;
  position: relative;
  margin-top: 6px;
  background: #fff;
  border: 1px solid #74897e;
  border-radius: 10px;
  min-height: 44px;
}
.entity-control:focus-within {
  border-color: #25664c;
  box-shadow: 0 0 0 3px #25664c20;
}
.entity-control input[data-source] {
  margin: 0;
  min-width: 0;
  width: 100%;
  border: 0;
  background: transparent;
  outline: none;
  box-shadow: none;
  padding: 10px 12px;
  text-align: start;
}
.entity-toggle {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  align-self: stretch;
  background: transparent;
  color: #436851;
  border: 0;
  cursor: pointer;
}
.entity-toggle svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}
.entity-menu {
  position: fixed;
  z-index: 500;
  background: white;
  border: 1px solid #a9bcb1;
  border-radius: 12px;
  box-shadow: 0 12px 38px #1a36262e;
  overflow: hidden;
  font-family: inherit;
}
.choice-header {
  background: #f4f7f4;
  color: #465d50;
  font-weight: 700;
  padding: 9px 14px;
  font-size: 0.85rem;
}
.choice-list {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px;
}
.choice-list [role='option'] {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 6px 9px;
  cursor: pointer;
  border-radius: 7px;
  overflow-wrap: anywhere;
}
.choice-list [role='option']:hover,
.choice-list [aria-selected='true'] {
  background: #e7f3eb;
  color: #174b32;
}
.choice-mark {
  color: #256b48;
  min-width: 1em;
}
.choice-list small {
  margin-inline-start: auto;
  color: #41624c;
}
.entity-menu > button {
  width: 100%;
  padding: 8px;
  border: 0;
  background: #f3f6f3;
  color: #28543c;
  cursor: pointer;
}

.permission-options {
  display: grid;
  gap: 0.8rem;
  margin-block: 1rem;
}
.permission-options label {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 1rem;
  border: 1px solid #cbd8d0;
  border-radius: 9px;
}
.permission-options input {
  margin: 0;
  flex: none;
}
.journal-row .row-fields {
  align-items: end;
}
.journal-row .row-fields .field {
  min-width: 0;
}
.journal-row
  .field
  :is(.entity-control, .select-trigger, input[data-field]:not([data-source]):not([type='checkbox'])) {
  box-sizing: border-box;
  height: 46px;
  min-height: 46px;
}
.journal-row .entity-control input[data-source] {
  height: 44px;
}
.statement-filters {
  align-items: end;
}

.attendance-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  padding: 12px;
}
.attendance-grid > div {
  padding: 6px;
  background: #f1f5f2;
  border-radius: 6px;
}
.attendance-grid small {
  display: block;
}
.attendance-grid strong {
  font-variant-numeric: tabular-nums;
}
@media (max-width: 560px) {
  .attendance-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.sidebar-account {
  justify-items: center;
  text-align: center;
  gap: 4px;
}
.sidebar-account strong {
  overflow-wrap: anywhere;
  font-size: 1rem;
}
.sidebar-credit {
  display: grid;
  gap: 2px;
  margin-block-start: 14px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}
.sidebar-credit a {
  color: #315640;
  font-weight: 700;
  text-underline-offset: 3px;
}
.sidebar-credit small {
  font-size: 0.78rem;
}
#company-number {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
}
#current-user {
  color: var(--muted);
}
.logout-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 0.55rem;
  padding: 0.5rem 1rem;
  min-height: 42px;
  border: 1px solid #b9cdc0;
  border-radius: 9px;
  background: #fff;
  color: #315640;
  font: inherit;
  cursor: pointer;
}
.logout-button svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}
.auth-page {
  isolation: isolate;
  background: #e3ece5;
}
.auth-landscape {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(125deg, #cedfd7, #f4f4e9 49%, #dce9df);
}
.auth-landscape::before,
.auth-landscape::after {
  content: '';
  position: absolute;
  inset: -18%;
  background:
    radial-gradient(ellipse at 12% 30%, #77ab967a, transparent 44%),
    radial-gradient(ellipse at 85% 78%, #a1b88485, transparent 38%);
  animation: auth-drift 17s ease-in-out infinite alternate;
}
.auth-landscape::after {
  background: repeating-radial-gradient(
    ellipse at 2% 105%,
    transparent 0 28px,
    #366d571a 29px,
    transparent 31px 46px
  );
  animation-duration: 23s;
  animation-direction: alternate-reverse;
}
.auth-card {
  box-shadow: 0 12px 50px #24473618;
}
@keyframes auth-drift {
  from {
    transform: translate3d(-3%, -2%, 0) rotate(-3deg);
  }
  to {
    transform: translate3d(4%, 3%, 0) rotate(3deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .auth-landscape::before,
  .auth-landscape::after {
    animation: none;
  }
}
.logout-button:hover,
.logout-button:focus-visible {
  background: #e5efe8;
  border-color: #779883;
}
.main-nav {
  margin-block-start: 1rem;
}
.main-sheet .page-head > .actions:empty {
  display: none;
}
.main-sheet .toolbar {
  align-items: end;
  justify-content: flex-start;
}
.toolbar > .actions:has(.field) {
  flex: 1 1 auto;
}
.toolbar > .actions:has(.field) > .field {
  flex: 1 1 10rem;
  min-width: 0;
}
.toolbar > .actions:has(#account-person) > .field:first-child {
  flex-basis: 15rem;
}
.period-picker,
.toolbar .period-picker {
  flex-wrap: wrap;
  flex: 0 1 auto;
  width: fit-content;
  max-width: 100%;
}
.period-picker > .field,
.toolbar .period-picker > .field {
  flex: 0 1 8rem;
  inline-size: 8rem;
  min-width: 0;
}
.toolbar > .actions > .field:has(#debt-year, #debt-month, #annual-year) {
  flex: 0 1 8rem;
  inline-size: 8rem;
  min-width: 0;
}
.statement-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 0 clamp(0.75rem, 2vw, 1.5rem) 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid #cddbd4;
  border-inline-start: 4px solid #467258;
  border-radius: 9px;
  background: #f2f7f4;
  font-weight: 700;
}
.statement-total .statement-amount {
  font-size: 1.3rem;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.statement-total .negative {
  color: #973d49;
}
.statement-total .positive {
  color: #225d42;
}
.main-sheet .toolbar > .actions,
.main-sheet .panel-head > .actions {
  flex-wrap: wrap;
  max-width: 100%;
}
.vehicle-reminders,
.section-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-block-end: 1.25rem;
}
.check-result {
  display: grid;
  justify-items: start;
  gap: 8px;
}
.check-result .actions {
  gap: 8px;
}
.notification-card-bottom,
.notifications-footer .actions {
  flex-wrap: wrap;
  gap: 12px;
}
.notification-card-bottom .button {
  min-height: 40px;
}
@media (max-width: 380px) {
  .notification-card-bottom .button {
    flex: 1 1 100%;
  }
}
.main-sheet[data-screen='operations'] > h2 {
  margin-block: 1.5rem 0.65rem;
}
.main-sheet[data-screen='security'] .panel + .panel {
  margin-block-start: 1rem;
}
#change-password {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  align-items: end;
  gap: 1rem;
}
#change-password > .button {
  justify-self: start;
}
.review-card dl {
  display: grid;
  grid-template-columns: minmax(6rem, 1fr) minmax(0, 1.35fr);
  align-items: baseline;
  gap: 0.5rem 1rem;
  text-align: start;
}
.review-card dl :is(dd, dt) {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: start;
}
label:has(> input[type='checkbox']) {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  min-height: 40px;
}
label > input[type='checkbox'] {
  display: inline-block;
  flex: 0 0 19px;
  inline-size: 19px;
  block-size: 19px;
  min-height: 0;
  margin: 0;
  accent-color: #23644d;
}
@media (max-width: 760px) {
  .main-sheet .toolbar .field {
    min-width: 0;
  }
  .main-sheet .toolbar > .actions > .button {
    flex: 1 1 auto;
    white-space: normal;
  }
  .period-picker {
    max-width: 100%;
  }
  .main-sheet[data-screen='security'] #change-password {
    grid-template-columns: minmax(0, 1fr);
  }
  .data-table td.wide .check-result {
    width: 100%;
  }
}

/* Report controls and financial registers */
.docs-option {
  box-sizing: border-box;
  padding: 7px 12px;
  border: 1px solid #adbdc1;
  border-radius: 9px;
  background: #fff;
  color: #25483a;
  font-weight: 600;
}
.docs-option:has(:checked) {
  background: #e6f3ec;
  border-color: #54876b;
}
.docs-option:has(:focus-visible) {
  outline: 3px solid #26784f;
  outline-offset: 3px;
}
.docs-option > #include-docs {
  appearance: none;
  display: grid;
  place-content: center;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  border: 1.5px solid #688177;
  border-radius: 6px;
  background: white;
  cursor: pointer;
}
.docs-option > #include-docs:checked {
  background: #246447;
  border-color: #246447;
}
.docs-option > #include-docs:checked::after {
  content: '';
  width: 10px;
  height: 5px;
  border: solid white;
  border-width: 0 0 2px 2px;
  transform: translateY(-1px) rotate(-45deg);
}
@media (forced-colors: active) {
  .docs-option > #include-docs {
    appearance: auto;
  }
  .docs-option > #include-docs:checked::after {
    display: none;
  }
}
.merge-trigger::before {
  content: '⇄';
  font-size: 1.3em;
  line-height: 1;
}
.merge-dialog {
  width: min(30rem, calc(100% - 2rem));
  box-sizing: border-box;
}
.merge-dialog h2 {
  margin: 0 0 0.75rem;
}
.merge-dialog p {
  line-height: 1.8;
}
.merge-dialog form {
  margin-block: 1rem;
}
:is(.reopen-dialog, .bank-dialog) h2 {
  margin: 0 0 1rem;
}
:is(.reopen-dialog, .bank-dialog) .field label {
  display: grid;
  gap: 6px;
}
:is(.reopen-dialog, .bank-dialog) .dialog-actions {
  margin-block-start: 20px;
  padding-block-start: 16px;
  border-block-start: 1px solid var(--line);
  flex-wrap: wrap;
}
.bank-dialog #bank-event {
  display: grid;
  gap: 14px;
  min-width: 0;
}
.merge-dialog .dialog-actions {
  border-block-start: 1px solid var(--line);
  padding-block-start: 1rem;
  justify-content: flex-start;
}
.panel > h2,
.attendance-review > summary {
  padding: 16px 22px;
  margin: 0;
  background: #f7faf8;
  border-block-end: 1px solid var(--line);
  text-align: start;
}
.panel-head > h2,
.attendance-review h2 {
  margin: 0;
  text-align: start;
}
.attendance-review > summary {
  cursor: pointer;
}
.attendance-review > summary > h2 {
  display: inline;
  font-size: 1.2rem;
}
.attendance-review {
  margin-block-start: 24px;
}
.invoice-balances {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}
.invoice-balances bdi {
  white-space: nowrap;
}
.invoice-figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  flex: 1 1 29rem;
  gap: 12px;
  margin: 0;
  min-width: 0;
}
.invoice-figures > div {
  padding: 12px 16px;
  border-inline-start: 4px solid #3b7356;
  background: #eef6f1;
  border-radius: 8px;
}
.invoice-figures > div + div {
  background: #eff4f9;
  border-color: #58799a;
}
.invoice-figures dt {
  color: #324c41;
  font-weight: 700;
}
.invoice-figures dd {
  margin: 4px 0 0;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.invoice-document {
  display: grid;
  justify-items: start;
  gap: 8px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.invoice-document small {
  margin: 0;
}
.data-table tbody tr:nth-child(odd) {
  background: #fff;
}
.data-table tbody tr:nth-child(even) {
  background: #eef3f6;
}
.check-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid currentColor;
  border-radius: 2rem;
  font-weight: 700;
  white-space: nowrap;
  font-size: 0.9rem;
  padding: 0.15rem 0.65rem;
}
.check-badge svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.check-pending {
  color: #82570c;
  background: #fff3ce;
}
.check-returned {
  color: #982f39;
  background: #fff0f0;
}
.check-cleared {
  color: #226344;
  background: #e5f5e9;
}
.check-returned svg {
  stroke: #e70e3c;
}
.check-direction {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.check-direction svg {
  box-sizing: border-box;
  flex: none;
  width: 27px;
  height: 27px;
  padding: 4px;
  border-radius: 7px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}
.check-direction.incoming svg {
  color: #255d80;
  background: #dcecf7;
}
.check-direction.outgoing svg {
  color: #934056;
  background: #fae3e9;
}
.check-direction.direct svg {
  color: #604c8d;
  background: #ede6f6;
}
.main-sheet[data-screen='vehicles'] .attachment-list {
  grid-template-columns: minmax(0, 1fr);
  min-width: min(13rem, 100%);
  row-gap: 10px;
  margin: 0 0 0.65rem;
}
.main-sheet[data-screen='vehicles'] .attachment {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: start;
  gap: 5px;
  white-space: normal;
}
.main-sheet[data-screen='vehicles'] .attachment .button {
  margin: 0;
}
.main-sheet[data-screen='vehicles'] .attachment .text-button {
  white-space: normal;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: start;
}
.auth-symbol {
  position: absolute;
  width: clamp(34px, 5vw, 76px);
  height: auto;
  fill: none;
  stroke: #4e7864;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.46;
  animation: symbol-float 11s ease-in-out infinite alternate;
}
.symbol-ledger {
  top: 20%;
  left: 12%;
}
.symbol-cheque {
  bottom: 18%;
  right: 8%;
  animation-delay: -6s;
}
.symbol-chart {
  top: 12%;
  right: 19%;
  animation-delay: -3s;
}
@keyframes symbol-float {
  from {
    transform: translateY(7px) rotate(-9deg);
  }
  to {
    transform: translateY(-13px) rotate(6deg);
  }
}
@media (max-width: 600px) {
  .symbol-ledger {
    left: 5%;
    top: 7%;
  }
  .symbol-chart {
    right: 6%;
    top: 10%;
  }
  .symbol-cheque {
    bottom: 5%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .auth-symbol {
    animation: none;
  }
}

.company-modules {
  min-inline-size: 0;
  margin: 1rem 0;
  padding: 0;
  border: 0;
}
.company-modules legend {
  margin-block-end: .5rem;
  padding: 0;
  font-weight: 700;
}
.company-modules > div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
  gap: .5rem;
}
.company-modules label {
  min-block-size: 44px;
  padding: .45rem .75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}
.company-modules label:has(input:checked) {
  border-color: #91b4a2;
  background: var(--soft);
}
.company-modules label:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.worker-dialog .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
}
.worker-dialog .field-note.full,
.worker-dialog .worker-days {
  grid-column: 1 / -1;
}
.worker-dialog .field-note.full {
  margin: -.5rem 0 0;
  text-align: start;
}
.worker-days {
  min-inline-size: 0;
  margin: .5rem 0 0;
  border: 0;
  padding: 0;
}
.worker-days legend {
  padding: 0;
  margin-block-end: .5rem;
  font-weight: 700;
}
.worker-days > div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 5.5rem), 1fr));
  gap: .5rem;
}
.worker-days .checkbox-row {
  margin: 0;
  min-block-size: 44px;
  padding: .35rem .55rem;
  gap: .4rem;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.worker-days .checkbox-row:has(:checked) {
  border-color: #91b4a2;
  background: var(--soft);
}
.worker-dialog .dialog-actions {
  align-items: stretch;
  gap: .75rem;
}
@media (max-width: 560px) {
  .worker-dialog .form-grid { grid-template-columns: minmax(0, 1fr); }
  .worker-dialog .dialog-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.restore-dialog #restore-form {
  display: grid;
  gap: 1rem;
  margin-block-start: 1rem;
}
.restore-dialog #restore-form > .field,
.restore-dialog .upload-copy { min-inline-size: 0; }
.restore-dialog .upload-copy { overflow-wrap: anywhere; }
.restore-dialog .dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  border-block-start: 1px solid var(--line);
  padding-block-start: 1rem;
  margin: 0;
}
@media (max-width: 540px) {
  .restore-dialog .upload-zone { grid-template-columns: auto minmax(0, 1fr); }
  .restore-dialog .upload-button { grid-column: 1 / -1; justify-self: start; }
  .restore-dialog .dialog-actions .button { flex: 1 1 100%; }
}

.balance-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
  gap: .75rem;
  margin-block: 1rem 1.5rem;
}
.balance-metrics .metric {
  padding: .75rem 1rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: #f7faf8;
}
.balance-metrics .metric.lead { background: #e6f3ec; }
.balance-metrics .metric-value { font-size: 1.4rem; }
.task-dialog h2 { margin-block: 0 1rem; }
.task-dialog p { line-height: 1.8; margin-block: .5rem 1rem; }
.task-dialog form, .task-dialog .delivery-options { display: grid; gap: .875rem; }
.task-dialog .delivery-options .checkbox-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: .75rem;
  align-items: center;
  overflow-wrap: anywhere;
}
.task-dialog .dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  border-block-start: 1px solid var(--line);
  padding-block-start: 1rem;
  margin: .25rem 0 0;
}
@media (max-width: 540px) {
  .task-dialog .dialog-actions .button { flex: 1 1 9rem; }
}

.void-comparison { padding: .85rem 1rem; border: 1px solid var(--line); border-radius: .65rem; }
.void-comparison h3 { margin: 0 0 .65rem; font-size: 1rem; overflow-wrap: anywhere; }
.void-comparison dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr)); gap: .75rem; margin: 0; }
.void-comparison dt { color: var(--muted); }
.void-comparison dd { margin: .25rem 0 0; font-size: 1.2rem; font-weight: 700; overflow-wrap: anywhere; }
.void-comparison dl > :last-child dd { color: var(--accent); }
#void-form .field-note { margin: 0; }
#void-form .offset-after:empty { display: none; }

.payroll-panel { container-type: inline-size; }
.payroll-body { padding: clamp(14px, 3%, 24px); }
.payroll-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}
.payroll-totals > div {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: #f4f6f5;
}
.payroll-totals dt { color: var(--muted); font-weight: 600; }
.payroll-totals dd {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.payroll-totals .payroll-remaining { background: #e7f3eb; }
.payroll-remaining dt, .payroll-remaining dd { color: var(--accent); }
.payroll-payments {
  width: 100%;
  margin-block-start: 20px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.payroll-payments :is(th, td) { padding: 10px 14px; text-align: start; }
.payroll-payments th { background: #f1f4f2; white-space: normal; }
.payroll-payments :is(th, td):last-child { text-align: end; }
.payroll-payments tbody tr:nth-child(even) { background: #f7f9f8; }
@container (max-width: 40rem) {
  .payroll-totals { grid-template-columns: 1fr; gap: 8px; }
  .payroll-totals > div {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    padding: 10px 12px;
  }
  .payroll-totals dd { font-size: 1.15rem; text-align: end; }
}
