@layer reset,base,layout,components,responsive;
@layer components {
  .dashboard-welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 25px 28px;
    border-left: 4px solid var(--brand, #173c34);
    border-radius: var(--radius);
    background: #edf3ef;
  }
  .dashboard-role {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
  }
  .dashboard-welcome h2 {
    margin: 8px 0;
    font-size: 1.45rem;
    overflow-wrap: anywhere;
  }
  .dashboard-welcome p {
    color: var(--muted);
    font-size: 0.85rem;
  }
  .dashboard-quick,
  .dashboard-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }
  .dashboard-quick {
    justify-content: flex-end;
  }
  .dashboard-columns {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 20px;
  }
  .dashboard-panels {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    align-items: start;
  }
  .dashboard-columns .list-row,
  .dashboard-panels .list-row {
    flex-wrap: wrap;
  }
  .dashboard-columns .grow,
  .dashboard-panels .grow {
    min-width: 120px;
    overflow-wrap: anywhere;
  }
  .dashboard-columns .key-value {
    flex-wrap: wrap;
    gap: 8px;
  }
}
@layer responsive {
  @media (max-width: 1100px) {
    .dashboard-welcome {
      align-items: flex-start;
      flex-direction: column;
    }
    .dashboard-quick {
      justify-content: flex-start;
    }
    .dashboard-columns,
    .dashboard-panels {
      grid-template-columns: 1fr;
    }
  }
  @media (max-width: 480px) {
    .dashboard-welcome {
      padding: 20px 16px;
    }
    .dashboard-quick {
      width: 100%;
    }
    .dashboard-quick .btn {
      white-space: normal;
      text-align: left;
    }
  }
}
@layer reset {
  * {
    box-sizing: border-box;
  }
  body,
  h1,
  h2,
  h3,
  p {
    margin: 0;
  }
  button,
  input,
  select,
  textarea {
    font: inherit;
  }
  button,
  a,
  input,
  select,
  textarea {
    -webkit-tap-highlight-color: transparent;
  }
  button {
    cursor: pointer;
  }
  a {
    color: inherit;
    text-decoration: none;
  }
  button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
  }
  table {
    border-collapse: collapse;
  }
  svg {
    display: block;
  }
}
@layer base {
  :root {
    --ink: #1b292a;
    --muted: #637171;
    --line: #dfe5e4;
    --paper: #fff;
    --canvas: #f4f6f6;
    --green: #173f35;
    --green-soft: #e6efe9;
    --accent: #b5d698;
    --orange: #9a6318;
    --red: #b33838;
    --radius: 10px;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    font-size: 16px;
    color: var(--ink);
    font-synthesis: none;
  }
  body {
    background: var(--canvas);
    line-height: 1.5;
  }
  button {
    border: 0;
  }
  button:focus-visible,
  a:focus-visible,
  input:focus-visible,
  textarea:focus-visible,
  select:focus-visible {
    outline: 3px solid #639e88;
    outline-offset: 3px;
  }
  h1 {
    font-size: 2rem;
    letter-spacing: -0.055em;
    line-height: 1.2;
    font-weight: 600;
  }
  h2 {
    font-size: 1.12rem;
    letter-spacing: -0.02em;
    font-weight: 600;
  }
  h3 {
    font-size: 1rem;
    font-weight: 600;
  }
  small,
  .meta {
    font-size: 0.8rem;
    color: var(--muted);
  }
  .muted {
    color: var(--muted);
  }
  .eyebrow {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 650;
    color: var(--muted);
  }
  .mono {
    font-variant-numeric: tabular-nums;
    font-family: "SFMono-Regular", Consolas, monospace;
  }
  .num {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
  .right {
    text-align: right;
  }
  .nowrap {
    white-space: nowrap;
  }
  .link {
    color: var(--green);
    font-weight: 600;
  }
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .boot {
    padding: 20vh 10vw;
  }
  .boot b {
    letter-spacing: 0.08em;
  }
  .boot span {
    font-weight: 400;
    color: var(--muted);
  }
  .boot p {
    margin-top: 1rem;
  }
  .icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
  }
}
@layer layout {
  .shell {
    display: grid;
    grid-template-columns: 242px minmax(0, 1fr);
    min-height: 100vh;
  }
  .sidebar {
    position: fixed;
    width: 242px;
    inset: 0 auto 0 0;
    background: #fff;
    border-right: 1px solid var(--line);
    padding: 27px 16px 16px;
    display: flex;
    flex-direction: column;
    z-index: 30;
    overflow: auto;
  }
  .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px 25px;
  }
  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--green);
    color: white;
    font-size: 1.2rem;
    display: grid;
    place-items: center;
    font-weight: 750;
  }
  .brand strong {
    letter-spacing: 0.12em;
    font-size: 0.87rem;
  }
  .brand small {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
  }
  .company-switch {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    gap: 9px;
    align-items: center;
    margin-bottom: 22px;
  }
  .company-switch b {
    display: block;
    font-size: 0.85rem;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .company-switch .company-symbol {
    background: #edf0ef;
    width: 29px;
    height: 29px;
    display: grid;
    place-items: center;
    border-radius: 5px;
    flex-shrink: 0;
  }
  .nav-group {
    margin: 14px 0 7px 12px;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #7a8584;
    font-weight: 650;
  }
  .nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    margin: 3px 0;
    border-radius: 7px;
    font-size: 0.875rem;
    color: #53615e;
    min-height: 41px;
  }
  .nav-link:hover {
    background: #f3f6f4;
  }
  .nav-link.active {
    background: var(--green-soft);
    color: var(--green);
    font-weight: 650;
  }
  .nav-link .count {
    margin-left: auto;
    font-size: 0.75rem;
    padding: 0 6px;
    border-radius: 4px;
    background: #d2e4d9;
    color: var(--green);
  }
  .sidebar-bottom {
    margin-top: auto;
    padding-top: 24px;
  }
  .profile {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 15px 8px 0;
    border-top: 1px solid var(--line);
  }
  .avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #e8eded;
    color: #344941;
    display: grid;
    place-items: center;
    font-size: 0.75rem;
    font-weight: 650;
    flex-shrink: 0;
  }
  .profile b {
    font-size: 0.8rem;
  }
  .profile small {
    display: block;
    text-transform: capitalize;
  }
  .main {
    grid-column: 2;
    min-width: 0;
  }
  .topbar {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 36px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
  }
  .breadcrumbs {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 0.8rem;
  }
  .top-tools {
    display: flex;
    gap: 14px;
    align-items: center;
  }
  .search-button {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    background: #f7f8f8;
    border: 1px solid var(--line);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
  }
  .search-button kbd {
    font-size: 0.7rem;
    border: 1px solid var(--line);
    padding: 0 4px;
    background: white;
    border-radius: 3px;
  }
  .content {
    padding: 34px 36px 56px;
    max-width: 1680px;
    margin: auto;
  }
  .page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 27px;
  }
  .page-head p {
    margin-top: 9px;
    font-size: 0.875rem;
    color: var(--muted);
  }
  .page-actions {
    display: flex;
    gap: 9px;
    align-items: center;
  }
  .grid {
    display: grid;
    gap: 20px;
  }
  .grid-2 {
    grid-template-columns: minmax(0, 1.65fr) minmax(270px, 1fr);
  }
  .grid-even {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .span-full {
    grid-column: 1/-1;
  }
  .stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 20px 0 25px;
    background: white;
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }
  .stat {
    padding: 23px 24px;
    border-right: 1px solid var(--line);
  }
  .stat:last-child {
    border: 0;
  }
  .stat-top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: var(--muted);
    font-size: 0.82rem;
  }
  .stat-value {
    font-size: 2rem;
    letter-spacing: -0.04em;
    margin: 12px 0 4px;
    font-weight: 550;
    font-variant-numeric: tabular-nums;
  }
  .stat-value.money {
    font-size: 1.65rem;
  }
  .section-gap {
    margin-top: 24px;
  }
  .auth-shell {
    display: grid;
    grid-template-columns: minmax(330px, 0.9fr) minmax(480px, 1.1fr);
    min-height: 100vh;
    background: white;
  }
  .auth-story {
    background: #173c34;
    color: #f5f8f3;
    padding: 45px 9%;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }
  .auth-story .brand {
    padding: 0;
    color: white;
  }
  .auth-story .brand small {
    color: #b8c7bf;
  }
  .auth-story .brand-mark {
    background: #a9c798;
    color: #173c34;
  }
  .auth-message {
    margin: auto 0;
    padding: 65px 0;
  }
  .auth-message h1 {
    font-size: clamp(2rem, 3.6vw, 3.8rem);
    line-height: 1.13;
    max-width: 480px;
    letter-spacing: -0.055em;
  }
  .auth-message > p {
    margin-top: 24px;
    color: #c0d0c8;
    max-width: 370px;
    font-size: 1rem;
    line-height: 1.8;
  }
  .workflow-ledger {
    margin-top: 44px;
    border-top: 1px solid #47675c;
    max-width: 420px;
  }
  .workflow-row {
    display: flex;
    padding: 15px 0;
    gap: 18px;
    align-items: center;
    border-bottom: 1px solid #47675c;
    font-size: 0.85rem;
  }
  .workflow-row .step-number {
    font-size: 0.75rem;
    color: #abc29f;
    width: 24px;
  }
  .workflow-row small {
    margin-left: auto;
    color: #b2c9bd;
  }
  .auth-foot {
    font-size: 0.75rem;
    color: #b9ccc1;
    display: flex;
    gap: 8px;
    align-items: center;
  }
  .auth-main {
    padding: 48px clamp(28px, 6vw, 95px);
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .auth-topline {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    margin-bottom: 36px;
    color: var(--muted);
  }
  .auth-main h2 {
    font-size: 1.9rem;
    letter-spacing: -0.05em;
    margin-bottom: 8px;
  }
  .auth-main > p {
    font-size: 0.875rem;
    color: var(--muted);
    margin-bottom: 24px;
  }
  .auth-form {
    max-width: 580px;
  }
  .auth-form .btn {
    width: 100%;
    margin-top: 18px;
  }
  .auth-footer {
    margin-top: 30px;
    color: var(--muted);
    font-size: 0.75rem;
  }
  .setup-progress {
    display: flex;
    gap: 8px;
    margin-bottom: 26px;
  }
  .setup-progress span {
    height: 3px;
    background: var(--line);
    flex: 1;
  }
  .setup-progress .done {
    background: var(--green);
  }
  .auth-qr {
    width: 180px;
    height: 180px;
    background: white;
    display: block;
    margin: 18px 0;
  }
  .setup-main {
    justify-content: flex-start;
  }
  .setup-main .auth-topline {
    margin-bottom: 20px;
  }
}
@layer components {
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 39px;
    padding: 9px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    line-height: 1.3;
    white-space: nowrap;
  }
  .btn:hover {
    background: #f4f7f5;
  }
  .btn.primary {
    background: var(--green);
    border-color: var(--green);
    color: white;
  }
  .btn.primary:hover {
    background: #245244;
  }
  .btn.danger {
    color: var(--red);
    border-color: #e7c9c9;
  }
  .btn.small {
    min-height: 31px;
    padding: 5px 10px;
    font-size: 0.78rem;
  }
  .btn.ghost {
    background: transparent;
    border: 0;
    color: var(--muted);
    padding: 7px;
  }
  .icon-btn {
    display: grid;
    place-items: center;
    background: none;
    color: var(--muted);
    width: 34px;
    height: 34px;
    border-radius: 5px;
  }
  .icon-btn:hover {
    background: #edf1ee;
  }
  .panel {
    background: white;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    min-width: 0;
    overflow: hidden;
  }
  .panel-head {
    padding: 20px 22px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .panel-head p {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 4px;
  }
  .panel-body {
    padding: 22px;
  }
  .panel-footer {
    padding: 13px 22px;
    border-top: 1px solid var(--line);
    background: #fcfdfc;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--muted);
    gap: 12px;
  }
  .table-wrap {
    overflow-x: auto;
    max-width: 100%;
  }
  table {
    width: 100%;
    font-size: 0.85rem;
    text-align: left;
  }
  th {
    font-size: 0.72rem;
    font-weight: 550;
    color: #72817a;
    background: #f8faf9;
    padding: 12px 20px;
    white-space: nowrap;
    border-bottom: 1px solid var(--line);
  }
  td {
    padding: 15px 20px;
    border-bottom: 1px solid #eef1ef;
    vertical-align: middle;
  }
  tr:last-child td {
    border-bottom: 0;
  }
  tbody tr:hover {
    background: #fcfdfc;
  }
  td b {
    font-weight: 550;
  }
  td small {
    display: block;
    margin-top: 3px;
  }
  .person-cell {
    display: flex;
    align-items: center;
    gap: 11px;
  }
  .person-cell .avatar {
    border-radius: 8px;
    background: #eaf0ed;
  }
  .badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 4px;
    line-height: 1.4;
    font-size: 0.72rem;
    font-weight: 550;
    background: #edf0f0;
    color: #586767;
    white-space: nowrap;
  }
  .badge.green {
    background: #e8f1e9;
    color: #356044;
  }
  .badge.orange {
    background: #fbf0df;
    color: #8d6528;
  }
  .badge.red {
    background: #f9e8e6;
    color: #a64a40;
  }
  .badge.blue {
    background: #eaf0f7;
    color: #426286;
  }
  .empty {
    padding: 43px 24px;
    max-width: 520px;
    margin: auto;
    text-align: center;
  }
  .empty .empty-mark {
    margin: 0 auto 16px;
    width: 46px;
    height: 46px;
    background: #f1f5f2;
    border: 1px solid var(--line);
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: #6a8376;
  }
  .empty h3 {
    margin-bottom: 7px;
  }
  .empty p {
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--muted);
  }
  .empty .btn {
    margin-top: 18px;
  }
  .toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
  }
  .toolbar input {
    min-width: 180px;
    max-width: 300px;
  }
  .toolbar .meta {
    margin-left: auto;
  }
  .field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 16px;
    min-width: 0;
  }
  .field label,
  .field-label {
    font-size: 0.8rem;
    font-weight: 600;
  }
  .field small {
    font-size: 0.75rem;
  }
  .field input,
  .field select,
  .field textarea,
  .toolbar input,
  .toolbar select {
    width: 100%;
    background: #fff;
    border: 1px solid #ccd6d1;
    min-height: 41px;
    padding: 9px 11px;
    border-radius: 5px;
    color: var(--ink);
    font-size: 0.875rem;
    line-height: 1.5;
  }
  .field input:focus,
  .field select:focus,
  .field textarea:focus {
    border-color: #38745e;
    outline: 2px solid #d5e8dd;
    outline-offset: 0;
  }
  .field textarea {
    min-height: 95px;
    resize: vertical;
  }
  .form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 16px;
  }
  .field.wide {
    grid-column: 1/-1;
  }
  .form-section {
    border-top: 1px solid var(--line);
    margin: 14px 0 20px;
    padding-top: 20px;
  }
  .form-section h3 {
    margin-bottom: 15px;
  }
  .checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
  }
  .check-chip {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
    border: 1px solid var(--line);
    padding: 7px 10px;
    border-radius: 5px;
  }
  .check-chip input {
    accent-color: var(--green);
  }
  .form-error {
    background: #fbedeb;
    border: 1px solid #edc6c0;
    color: #973d32;
    padding: 10px 13px;
    border-radius: 5px;
    font-size: 0.85rem;
    margin: 14px 0;
    display: none;
  }
  .form-error:not(:empty) {
    display: block;
  }
  .notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border: 1px solid #d9e5dd;
    background: #f0f5f0;
    padding: 16px 19px;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #3a5648;
    line-height: 1.6;
  }
  .notice .icon {
    margin-top: 2px;
  }
  .notice p {
    font-size: 0.82rem;
  }
  .notice.warning {
    background: #fff8eb;
    border-color: #f0dfb9;
    color: #805d24;
  }
  .notice-action {
    margin-left: auto;
  }
  .list-row {
    display: flex;
    gap: 13px;
    align-items: center;
    padding: 17px 22px;
    border-bottom: 1px solid #edf0ee;
  }
  .list-row:last-child {
    border: 0;
  }
  .list-row .grow {
    flex: 1;
    min-width: 0;
  }
  .list-row .row-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #f0f4f1;
    color: #5c7767;
    display: grid;
    place-items: center;
    flex-shrink: 0;
  }
  .list-row h3 {
    font-size: 0.85rem;
    margin-bottom: 4px;
  }
  .list-row p {
    font-size: 0.78rem;
    color: var(--muted);
  }
  .step-row {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 17px 22px;
    border-bottom: 1px solid var(--line);
  }
  .step-row:last-child {
    border: 0;
  }
  .step-row .ordinal {
    color: #87978d;
    font-size: 0.8rem;
    width: 20px;
  }
  .step-row .grow {
    flex: 1;
  }
  .step-row b {
    font-size: 0.85rem;
    font-weight: 550;
  }
  .step-row small {
    display: block;
    font-size: 0.75rem;
    margin-top: 3px;
  }
  .step-row.completed .ordinal {
    color: #4f775b;
  }
  .tabs {
    display: flex;
    gap: 24px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 24px;
    overflow: auto;
  }
  .tab {
    padding: 10px 0 14px;
    color: var(--muted);
    font-size: 0.85rem;
    background: none;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
  }
  .tab.active {
    color: var(--green);
    border-color: var(--green);
    font-weight: 600;
  }
  .pipeline {
    display: flex;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: auto;
    background: white;
    margin-bottom: 24px;
  }
  .pipeline-step {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 145px;
    padding: 16px;
    border-right: 1px solid var(--line);
    font-size: 0.78rem;
    color: var(--muted);
  }
  .pipeline-step:last-child {
    border: 0;
  }
  .pipeline-step.active {
    background: #e8f1ea;
    color: var(--green);
  }
  .pipeline-step .number {
    border: 1px solid currentColor;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    font-size: 0.7rem;
  }
  .detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 22px;
  }
  .detail-grid dt {
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 6px;
  }
  .detail-grid dd {
    margin: 0;
    font-size: 0.9rem;
  }
  .amount-total {
    padding: 20px;
    background: #f2f6f3;
    border: 1px solid var(--line);
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    font-variant-numeric: tabular-nums;
  }
  .amount-total strong {
    font-size: 1.25rem;
    color: var(--green);
  }
  .ledger-line {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #edf1ee;
    font-size: 0.85rem;
    gap: 15px;
  }
  .ledger-line.indent {
    padding-left: 12px;
    color: var(--muted);
  }
  .bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 24px;
    height: 190px;
    padding-top: 25px;
  }
  .bar-col {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 7px;
  }
  .bar-col .bar {
    width: 100%;
    max-width: 48px;
    background: #315c49;
    border-radius: 3px 3px 0 0;
    min-height: 2px;
  }
  .bar-col small {
    font-size: 0.7rem;
  }
  .recovery-codes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 15px;
    background: #f1f5f2;
    border: 1px solid var(--line);
    border-radius: 6px;
    margin-top: 16px;
  }
  .recovery-codes code {
    font-size: 0.9rem;
  }
  .mobile-menu {
    display: none;
  }
  .key-value {
    display: flex;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.85rem;
    gap: 20px;
  }
  .key-value span {
    color: var(--muted);
  }
  .empty-table td {
    padding: 0;
  }
  .page-foot {
    font-size: 0.75rem;
    color: #77857d;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 28px;
  }
  .secure-label {
    display: flex;
    gap: 6px;
    align-items: center;
    font-size: 0.75rem;
    color: var(--muted);
  }
  .secure-label .icon {
    width: 14px;
    height: 14px;
    flex-basis: 14px;
  }
  .schedule-cell {
    background: #edf3ee;
    border-left: 3px solid #83a18d;
    padding: 9px 10px;
    min-width: 110px;
    border-radius: 3px;
    font-size: 0.75rem;
  }
  .schedule-cell b {
    display: block;
  }
  .schedule-cell small {
    font-size: 0.7rem;
  }
  .calendar-table td {
    padding: 8px;
    vertical-align: top;
  }
  .calendar-table th {
    padding: 12px 8px;
  }
  .report-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  .report-card .btn {
    align-self: flex-start;
    margin-top: auto;
  }
  .report-card p {
    font-size: 0.85rem;
    color: var(--muted);
  }
  dialog {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0;
    width: min(690px, calc(100% - 32px));
    max-height: 90vh;
    box-shadow: 0 24px 70px #102c2826;
    color: var(--ink);
  }
  dialog::backdrop {
    background: #18272566;
    backdrop-filter: blur(2px);
  }
  .dialog-head {
    padding: 23px 25px 18px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--line);
  }
  .dialog-head h2 {
    font-size: 1.3rem;
  }
  .dialog-head p {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 5px;
  }
  .dialog-body {
    padding: 24px 25px;
  }
  .dialog-foot {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 16px 25px;
    background: #fafcfb;
    border-top: 1px solid var(--line);
    position: sticky;
    bottom: 0;
  }
  .dialog-foot .grow {
    flex: 1;
  }
  .toast {
    position: fixed;
    bottom: 25px;
    right: 25px;
    max-width: 420px;
    background: #173f35;
    color: #fff;
    box-shadow: 0 8px 30px #14292230;
    border-radius: 7px;
    padding: 14px 20px;
    font-size: 0.875rem;
    z-index: 1000;
  }
  .toast.error {
    background: #823d38;
  }
  .modal-list {
    max-height: 55vh;
    overflow: auto;
  }
  .modal-list button {
    width: 100%;
    border-bottom: 1px solid var(--line);
    padding: 14px 20px;
    text-align: left;
    background: white;
    display: flex;
    gap: 15px;
    align-items: center;
  }
  .modal-list button:hover {
    background: #f2f6f3;
  }
  .modal-list button small {
    display: block;
  }
  .search-field {
    padding: 20px;
  }
  .search-field input {
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--line);
    padding: 10px;
    font-size: 1.1rem;
  }
  .divider {
    height: 1px;
    background: var(--line);
    margin: 20px 0;
  }
  .file-input {
    padding: 16px;
    border: 1px dashed #afbeb5;
    border-radius: 7px;
    background: #f8faf8;
    width: 100%;
    font-size: 0.85rem;
  }
  .inline-action {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
  }
}
@layer responsive {
  @media (min-width: 1650px) {
    .content {
      padding-top: 44px;
    }
    .sidebar {
      width: 260px;
    }
    .shell {
      grid-template-columns: 260px minmax(0, 1fr);
    }
  }
  @media (max-width: 1100px) {
    .content {
      padding: 26px 24px;
    }
    .topbar {
      padding: 0 24px;
    }
    .stats {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .stat:nth-child(2) {
      border: 0;
    }
    .stat:nth-child(-n + 2) {
      border-bottom: 1px solid var(--line);
    }
    .grid-2 {
      grid-template-columns: 1fr;
    }
    .page-head h1 {
      font-size: 1.7rem;
    }
    .auth-story {
      padding: 35px 8%;
    }
    .auth-main {
      padding: 40px;
    }
  }
  @media (max-width: 780px) {
    .shell {
      display: block;
    }
    .sidebar {
      transform: translateX(-100%);
      transition: transform 0.18s;
    }
    .shell.menu-open .sidebar {
      transform: translateX(0);
      box-shadow: 15px 0 50px #16251e33;
    }
    .main {
      width: 100%;
    }
    .topbar {
      height: 60px;
      padding: 0 16px;
    }
    .mobile-menu {
      display: grid;
    }
    .content {
      padding: 25px 16px 36px;
    }
    .top-tools .secure-label {
      display: none;
    }
    .search-button {
      border: 0;
      background: transparent;
    }
    .search-button span,
    .search-button kbd {
      display: none;
    }
    .page-head {
      flex-direction: column;
      gap: 16px;
      margin-bottom: 20px;
    }
    .page-actions {
      width: 100%;
      flex-wrap: wrap;
    }
    .page-head h1 {
      font-size: 1.85rem;
    }
    .grid-even {
      grid-template-columns: 1fr;
    }
    .stat {
      padding: 18px;
    }
    .stat-value {
      font-size: 1.75rem;
    }
    .stat-value.money {
      font-size: 1.35rem;
    }
    .stats {
      margin-top: 16px;
    }
    .panel-head {
      padding: 17px;
    }
    .panel-body {
      padding: 17px;
    }
    td,
    th {
      padding: 13px 16px;
    }
    .auth-shell {
      display: block;
    }
    .auth-story {
      min-height: unset;
      padding: 22px;
    }
    .auth-message,
    .auth-foot {
      display: none;
    }
    .auth-story .brand {
      padding: 0;
    }
    .auth-main {
      padding: 30px 22px;
    }
    .auth-main h2 {
      font-size: 1.6rem;
    }
    .auth-topline {
      margin-bottom: 22px;
    }
    .form-grid {
      grid-template-columns: 1fr;
    }
    .field.wide {
      grid-column: auto;
    }
    .detail-grid {
      grid-template-columns: repeat(2, 1fr);
      padding: 17px;
      gap: 15px;
    }
    .notice {
      padding: 14px;
      flex-wrap: wrap;
    }
    .notice-action {
      margin-left: 32px;
    }
    .toolbar {
      padding: 14px;
    }
    .toolbar input {
      min-width: 0;
      max-width: none;
      flex: 1;
    }
    .page-foot {
      flex-direction: column;
      gap: 6px;
    }
    .dialog-body {
      padding: 20px;
    }
    .dialog-head {
      padding: 20px;
    }
    .dialog-foot {
      padding: 15px 20px;
    }
    .tabs {
      gap: 20px;
    }
    .toast {
      bottom: 14px;
      left: 14px;
      right: 14px;
    }
    .top-tools {
      gap: 6px;
    }
    .list-row {
      padding: 16px;
    }
    .pipeline-step {
      min-width: 140px;
    }
    .auth-form {
      max-width: 100%;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    * {
      transition: none !important;
      scroll-behavior: auto !important;
    }
  }
  @media print {
    body {
      background: white;
    }
    .sidebar,
    .topbar,
    .page-head,
    .page-actions,
    .page-foot,
    .tabs,
    .dialog-head .icon-btn,
    .dialog-foot,
    #notifications {
      display: none !important;
    }
    .shell {
      display: block;
    }
    .main {
      width: 100%;
    }
    .content {
      padding: 0;
    }
    dialog {
      position: static;
      display: block;
      max-height: none;
      width: 100%;
      border: 0;
      box-shadow: none;
    }
    .dialog-body {
      padding: 0;
    }
    body:has(dialog[open]) #app {
      display: none;
    }
    dialog:not([open]) {
      display: none;
    }
    .panel {
      border: 0;
    }
    .no-print {
      display: none !important;
    }
  }
}
@layer components {
  .toolbar select {
    width: auto;
    max-width: 230px;
  }
}

@layer base {
  html {
    scroll-padding-top: 80px;
  }
  body:has(dialog[open]) {
    overflow: hidden;
  }
  .skip-link {
    position: fixed;
    left: 16px;
    top: -100px;
    z-index: 100;
    background: white;
    padding: 12px 20px;
    border: 2px solid var(--green);
  }
  .skip-link:focus {
    top: 12px;
  }
  .field,
  .panel,
  .panel-head > div,
  .page-head > div,
  .stat,
  .person-cell > div {
    min-width: 0;
  }
  .panel-head,
  .page-head,
  .detail-grid,
  .key-value,
  .ledger-line,
  .auth-main {
    overflow-wrap: anywhere;
  }
  input,
  select,
  textarea {
    max-width: 100%;
  }
}
@layer components {
  .nav-backdrop,
  .nav-close {
    display: none;
  }
  .table-wrap {
    overscroll-behavior-x: contain;
  }
  .table-wrap:focus-visible {
    outline: 3px solid #639e88;
    outline-offset: -3px;
  }
  .stat-value {
    overflow-wrap: anywhere;
  }
  .panel-head {
    flex-wrap: wrap;
  }
  dialog {
    max-height: calc(100dvh - 32px);
    overscroll-behavior: contain;
  }
}
@layer responsive {
  @media (max-width: 1100px) {
    .breadcrumbs {
      min-width: 0;
    }
    .breadcrumbs b {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .search-button span,
    .search-button kbd {
      display: none;
    }
  }
  @media (max-width: 780px) {
    body.navigation-open {
      overflow: hidden;
    }
    .sidebar {
      width: min(300px, calc(100vw - 48px));
      padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
    .nav-close {
      display: grid;
      position: absolute;
      right: 12px;
      top: 14px;
    }
    .nav-backdrop {
      position: fixed;
      inset: 0;
      z-index: 29;
      background: #10292380;
    }
    .menu-open .nav-backdrop {
      display: block;
    }
    .nav-link,
    .icon-btn,
    .btn,
    .check-chip {
      min-height: 44px;
    }
    .icon-btn {
      min-width: 44px;
    }
    input,
    select,
    textarea {
      font-size: 16px;
      min-height: 44px;
    }
    input[type="checkbox"] {
      min-height: auto;
    }
    .toolbar {
      gap: 10px;
    }
    .toolbar select {
      min-width: 0;
      max-width: 100%;
      flex: 1 1 130px;
    }
    .toolbar input {
      flex: 1 1 100%;
      width: 100%;
    }
    .content {
      padding-bottom: max(36px, env(safe-area-inset-bottom));
    }
    .dialog-foot {
      flex-wrap: wrap;
      padding-bottom: max(15px, env(safe-area-inset-bottom));
    }
    .detail-grid {
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
    .auth-main {
      min-height: calc(100dvh - 86px);
    }
    .auth-qr {
      max-width: 100%;
      height: auto;
    }
    .recovery-codes {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      overflow-wrap: anywhere;
    }
    .person-cell {
      min-width: 140px;
    }
  }
  @media (max-width: 420px) {
    .breadcrumbs > .muted {
      display: none;
    }
    .top-tools > .avatar {
      display: none;
    }
    .stat {
      padding: 15px 12px;
    }
    .stat-value.money {
      font-size: 1.1rem;
    }
    .stat-label {
      font-size: 0.75rem;
    }
    .dialog-head {
      gap: 10px;
    }
    .dialog-body {
      padding: 18px 14px;
    }
    .dialog-head,
    .dialog-foot {
      padding-left: 14px;
      padding-right: 14px;
    }
    .amount-total {
      flex-wrap: wrap;
      gap: 8px;
    }
    .detail-grid {
      grid-template-columns: minmax(0, 1fr);
    }
  }
}

@layer components {
  .calculation-details {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    background: #f7faf8;
  }
  .calculation-details summary {
    cursor: pointer;
    font-weight: 600;
    min-height: 32px;
  }
  .calculation-details small {
    display: block;
  }
  input[readonly] {
    background: #edf3ef;
    color: #254b3e;
    cursor: default;
  }
  [hidden] {
    display: none !important;
  }
}

/* Batch employee tools share the existing form and action styles. */
.employee-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.employee-selection {
  min-width: 0;
  margin: 20px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.employee-selection legend {
  padding: 0 6px;
  font-weight: 600;
}
.employee-selection > input {
  width: 100%;
  min-width: 0;
}
.employee-selection-list {
  max-height: 220px;
  overflow-y: auto;
  margin: 8px 0;
}
.employee-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 3px;
  border-bottom: 1px solid var(--line);
}
.employee-choice > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.employee-choice small {
  display: block;
  color: var(--muted);
}
.employee-choice input {
  flex: 0 0 auto;
}
[hidden] {
  display: none !important;
}

.employee-import-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px;
  margin-bottom: 20px;
}
.employee-import-panel h2 {
  margin: 0 0 8px;
  font-size: 17px;
}
.employee-import-panel p {
  margin: 0;
  max-width: 650px;
}
.employee-import-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex-shrink: 0;
}
@media (max-width: 1100px) {
  .employee-import-panel {
    align-items: flex-start;
    flex-direction: column;
  }
}
@media (max-width: 540px) {
  .employee-import-buttons {
    width: 100%;
  }
  .employee-import-buttons .btn {
    width: 100%;
  }
}

.reauth-dialog {
  max-width: 480px;
  width: calc(100% - 24px);
}
@layer components {
  .page-actions {
    flex-wrap: wrap;
  }
  .history-access {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
  }
  .page-foot {
    flex-wrap: wrap;
    border-top: 1px solid var(--line);
    padding-top: 16px;
  }
  .copyright {
    line-height: 1.6;
  }
}
