:root {
      /* Brand: #6FCF97 */
      --green-900: #164d30;
      --green-800: #1f6b42;
      --green-700: #2f9a5c;
      --green-600: #45b875;
      --green-500: #6FCF97;
      --green-100: #e8faf0;
      --green-50: #f4fcf7;
      --ink: #1a2420;
      --muted: #5c6b63;
      --line: #d5e8dc;
      --bg: #eef7f2;
      --white: #ffffff;
      --warn: #c45c26;
      --ok: #2f9a5c;
      --due: #6b3fa0;
      --due-soft: #f3ecfa;
      --due-mid: #8b5cc7;
      --due-deep: #4f2878;
      --sidebar-w: 240px;
      --top-h: 52px;
      --radius: 8px;
      --shadow: 0 1px 2px rgba(22, 77, 48, 0.06), 0 8px 24px rgba(22, 77, 48, 0.05);
      --font: "Open Sans", system-ui, sans-serif;
      --display: "Open Sans", system-ui, sans-serif;
    }

    * { box-sizing: border-box; }
    html, body { height: 100%; margin: 0; }
    body {
      font-family: var(--font);
      color: var(--ink);
      background: var(--bg);
      font-size: 14px;
      line-height: 1.45;
    }

    .app {
      display: grid;
      grid-template-columns: var(--sidebar-w) 1fr;
      grid-template-rows: var(--top-h) 1fr;
      min-height: 100vh;
    }

    /* Top bar */
    .topbar {
      grid-column: 1 / -1;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 20px;
      background: linear-gradient(105deg, var(--green-900) 0%, var(--green-700) 50%, var(--green-500) 100%);
      color: #fff;
      z-index: 10;
    }
    .brand {
      font-family: var(--display);
      font-weight: 600;
      font-size: 18px;
      letter-spacing: -0.02em;
    }
    .brand span { opacity: 0.75; font-weight: 500; font-size: 13px; margin-left: 8px; font-family: var(--font); }
    .top-actions { display: flex; align-items: center; gap: 12px; }
    .year-select, .user-chip {
      background: rgba(255,255,255,0.12);
      border: 1px solid rgba(255,255,255,0.22);
      color: #fff;
      border-radius: 999px;
      padding: 6px 14px;
      font: inherit;
      cursor: pointer;
    }
    .year-select option { color: var(--ink); }

    /* Sidebar */
    .sidebar {
      background: var(--white);
      border-right: 1px solid var(--line);
      padding: 16px 12px 24px;
      overflow-y: auto;
    }
    .profile {
      padding: 8px 10px 16px;
      border-bottom: 1px solid var(--line);
      margin-bottom: 14px;
    }
    .profile strong { display: block; font-size: 14px; }
    .profile small { color: var(--muted); font-size: 12px; }
    .nav-label {
      font-size: 11px;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: var(--muted);
      padding: 10px 10px 6px;
      font-weight: 600;
    }
    .nav-item {
      display: flex;
      align-items: center;
      gap: 12px;
      width: 100%;
      border: 0;
      background: transparent;
      text-align: left;
      padding: 10px 12px;
      border-radius: 10px;
      color: var(--ink);
      font: inherit;
      cursor: pointer;
      margin-bottom: 4px;
    }
    .nav-item:hover { background: var(--green-50); }
    .nav-item.active {
      background: var(--green-500);
      color: var(--ink);
      font-weight: 600;
    }
    .nav-item .ico {
      width: 36px;
      height: 36px;
      flex-shrink: 0;
      display: grid;
      place-items: center;
      border-radius: 10px;
      background: var(--green-50);
      color: var(--green-700);
    }
    .nav-item .ico svg {
      width: 20px;
      height: 20px;
      stroke: currentColor;
      fill: none;
      stroke-width: 1.75;
      stroke-linecap: round;
      stroke-linejoin: round;
    }
    .nav-item:hover .ico { background: #d4f5e3; }
    .nav-item.active .ico {
      background: rgba(255,255,255,0.55);
      color: var(--green-800);
    }

    .icon-svg {
      width: 16px;
      height: 16px;
      stroke: currentColor;
      fill: none;
      stroke-width: 1.85;
      stroke-linecap: round;
      stroke-linejoin: round;
      flex-shrink: 0;
    }
    .btn .icon-svg { width: 17px; height: 17px; }
    .panel-title {
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .panel-title .icon-svg {
      width: 18px;
      height: 18px;
      color: var(--green-600);
    }
    .icon-btn {
      display: inline-flex;
      align-items: center;
      gap: 5px;
    }
    .icon-btn .icon-svg { width: 14px; height: 14px; }

    /* Main */
    .main {
      padding: 20px 24px 40px;
      overflow: auto;
      background:
        radial-gradient(900px 400px at 100% 0%, rgba(111, 207, 151, 0.16), transparent 60%),
        var(--bg);
    }
    .page-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 16px;
      margin-bottom: 18px;
    }
    .page-head h1 {
      margin: 0 0 4px;
      font-family: var(--display);
      font-size: 26px;
      font-weight: 600;
      letter-spacing: -0.02em;
    }
    .page-head p { margin: 0; color: var(--muted); font-size: 13px; }

    .btn {
      border: 0;
      border-radius: 8px;
      padding: 9px 14px;
      font: inherit;
      font-weight: 600;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }
    .btn-primary { background: var(--green-500); color: var(--ink); }
    .btn-primary:hover { background: var(--green-600); color: #fff; }
    .btn-ghost {
      background: var(--white);
      border: 1px solid var(--line);
      color: var(--ink);
    }
    .btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

    .panel {
      background: var(--white);
      border: 1px solid var(--line);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      margin-bottom: 16px;
    }
    .panel-pad { padding: 16px 18px; }

    /* KPI row */
    .kpi-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 12px;
      margin-bottom: 16px;
    }
    .kpi {
      background: var(--white);
      border: 1px solid var(--line);
      border-radius: var(--radius);
      padding: 14px 16px;
      box-shadow: var(--shadow);
    }
    .kpi .label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
    .kpi .value { font-family: var(--display); font-size: 24px; margin-top: 4px; font-weight: 600; }
    .kpi .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
    .kpi.accent { background: linear-gradient(160deg, var(--green-50), #fff 70%); border-color: #b8ebcd; }
    .kpi.due {
      background: linear-gradient(160deg, var(--due-soft), #fff 72%);
      border-color: #d4c2ea;
    }
    .kpi.due .label { color: var(--due); }
    .kpi.due .value { color: var(--due-deep); }
    .kpi.due.total {
      border-color: var(--due-mid);
      box-shadow: 0 0 0 1px rgba(107, 63, 160, 0.12);
    }
    .panel-sub {
      margin: 0 0 10px;
      font-size: 13px;
      font-weight: 600;
      color: var(--ink);
    }
    .muted-inline { font-weight: 500; color: var(--muted); }
    .due-legend { color: var(--due); font-weight: 600; }
    .due-stack {
      display: flex;
      height: 14px;
      border-radius: 999px;
      overflow: hidden;
      background: #ebe4f3;
      margin-top: 4px;
    }
    .due-stack > i {
      display: block;
      height: 100%;
      margin: 0;
      font-style: normal;
    }
    .due-stack > i.due-inps { background: var(--due-mid); }
    .due-stack > i.due-tax { background: var(--due-deep); }
    .due-stack-legend {
      display: flex;
      gap: 16px;
      margin-top: 8px;
      font-size: 12px;
      color: var(--muted);
    }
    .due-stack-legend .swatch {
      display: inline-block;
      width: 10px;
      height: 10px;
      border-radius: 2px;
      margin-right: 6px;
      vertical-align: -1px;
    }
    .due-stack-legend .swatch.due-inps { background: var(--due-mid); }
    .due-stack-legend .swatch.due-tax { background: var(--due-deep); }
    .kpi .kpi-ico {
      width: 34px;
      height: 34px;
      border-radius: 10px;
      display: grid;
      place-items: center;
      background: var(--green-100);
      color: var(--green-700);
      margin-bottom: 10px;
    }
    .kpi .kpi-ico svg {
      width: 18px;
      height: 18px;
      stroke: currentColor;
      fill: none;
      stroke-width: 1.85;
      stroke-linecap: round;
      stroke-linejoin: round;
    }
    .kpi.accent .kpi-ico { background: rgba(111, 207, 151, 0.35); }
    .kpi .kpi-ico {
      width: 34px;
      height: 34px;
      border-radius: 10px;
      display: grid;
      place-items: center;
      background: var(--green-100);
      color: var(--green-700);
      margin-bottom: 10px;
    }
    .kpi .kpi-ico svg {
      width: 18px;
      height: 18px;
      stroke: currentColor;
      fill: none;
      stroke-width: 1.85;
      stroke-linecap: round;
      stroke-linejoin: round;
    }
    .kpi.accent .kpi-ico { background: rgba(42, 138, 96, 0.18); }
    .panel-title {
      font-size: 13px;
      font-weight: 600;
      color: var(--green-800);
      margin: 0 0 12px;
    }
    .progress {
      height: 6px;
      background: var(--green-100);
      border-radius: 99px;
      margin-top: 10px;
      overflow: hidden;
    }
    .progress > i {
      display: block;
      height: 100%;
      width: 42%;
      background: var(--green-500);
      border-radius: 99px;
    }

    /* Charts placeholder */
    .charts {
      display: grid;
      grid-template-columns: 1.2fr 1fr;
      gap: 12px;
      margin-bottom: 16px;
    }
    .chart-box {
      height: 200px;
      border-radius: 6px;
      background:
        linear-gradient(180deg, transparent 0 39px, rgba(213, 227, 218, 0.7) 39px 40px) 0 0 / 100% 40px,
        linear-gradient(90deg, var(--green-100), transparent);
      position: relative;
      overflow: hidden;
    }
    .chart-line {
      position: absolute;
      inset: 28px 16px 24px;
      background: no-repeat center / contain;
    }
    .chart-svg { width: 100%; height: 100%; }

    /* Month strip */
    .months {
      display: grid;
      grid-template-columns: repeat(12, 1fr);
      gap: 6px;
      margin-bottom: 14px;
    }
    .month {
      text-align: center;
      padding: 10px 4px;
      border-radius: 6px;
      border: 1px solid var(--line);
      background: var(--white);
      cursor: pointer;
      font-size: 11px;
    }
    .month strong { display: block; font-size: 12px; margin-bottom: 4px; }
    .month .amt { color: var(--muted); }
    .month.has {
      background: var(--green-50);
      border-color: #9ee0b8;
    }
    .month.has .amt { color: var(--ok); font-weight: 600; }
    .month.active {
      outline: 2px solid var(--green-600);
      outline-offset: -1px;
    }

    /* Table */
    .toolbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 12px;
      flex-wrap: wrap;
    }
    .tabs { display: flex; gap: 4px; }
    .tab {
      border: 0;
      background: transparent;
      padding: 8px 12px;
      border-radius: 6px;
      font: inherit;
      color: var(--muted);
      cursor: pointer;
    }
    .tab.active {
      background: var(--green-100);
      color: var(--green-800);
      font-weight: 600;
    }
    .search {
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 8px 12px;
      min-width: 220px;
      font: inherit;
      background: var(--white);
    }

    table.data {
      width: 100%;
      border-collapse: collapse;
      font-size: 13px;
    }
    table.data th {
      text-align: left;
      font-size: 11px;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      color: var(--muted);
      padding: 10px 12px;
      border-bottom: 1px solid var(--line);
      font-weight: 600;
    }
    table.data td {
      padding: 12px;
      border-bottom: 1px solid #eef3f0;
      vertical-align: middle;
    }
    table.data tr:hover td { background: var(--green-50); }
    table.data tr.row-credit td { background: #e7f4fc; }
    table.data tr.row-credit:hover td { background: #d4ebf8; }
    /* Form servizi: input/textarea nelle celle */
    table.data td input,
    table.data td select,
    table.data td textarea {
      width: 100%;
      font: inherit;
      color: var(--ink);
      border: 1px solid var(--line);
      border-radius: 6px;
      padding: 8px 10px;
      background: var(--white);
    }
    table.data td textarea {
      min-height: 64px;
      resize: vertical;
      line-height: 1.4;
      vertical-align: top;
    }
    table.data th.col-order,
    table.data td.col-order {
      width: 72px;
      text-align: center;
      vertical-align: middle;
    }
    .order-btns {
      display: inline-flex;
      flex-direction: column;
      gap: 2px;
      align-items: center;
    }
    .order-btns .icon-btn {
      line-height: 1;
      min-width: 28px;
      padding: 4px 6px;
    }
    table.data th.col-title,
    table.data td.col-title {
      min-width: 120px;
      width: 14%;
      vertical-align: top;
    }
    table.data th.col-desc,
    table.data td.col-desc {
      min-width: 320px;
      width: 38%;
      vertical-align: top;
    }
    table.data td.col-title textarea.item-title {
      min-height: 56px;
      font-size: 15px;
      line-height: 1.35;
    }
    table.data td.col-desc textarea {
      width: 100%;
      min-height: 150px;
      resize: vertical;
      border: 1px solid var(--line);
      border-radius: 6px;
      padding: 8px 10px;
      font: inherit;
      line-height: 1.4;
    }
    table.data th.col-monthly,
    table.data td.col-monthly {
      width: 132px;
      min-width: 132px;
      text-align: left;
      vertical-align: top;
    }
    .cycle-picks {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }
    .cycle-pick {
      display: flex;
      align-items: center;
      gap: 4px;
      margin: 0;
      font-size: 12px;
      line-height: 1.2;
      white-space: nowrap;
      cursor: pointer;
    }
    .cycle-pick input {
      width: auto;
      margin: 0;
      accent-color: var(--green-600);
    }
    table.data td input:focus,
    table.data td select:focus,
    table.data td textarea:focus {
      outline: none;
      border-color: var(--green-600);
      box-shadow: 0 0 0 2px rgba(111, 207, 151, 0.25);
    }
    .badge {
      display: inline-block;
      padding: 3px 8px;
      border-radius: 999px;
      font-size: 12px;
      font-weight: 600;
    }
    .badge.draft { background: #eef0ef; color: #4a5560; }
    .badge.sent { background: #fff3df; color: #8a5a12; }
    .badge.ok { background: var(--green-100); color: var(--ok); }
    .badge.rejected { background: #fde8e8; color: #b42318; }
    .badge.xml { background: #e8f0ff; color: #2c4a8c; }
    .badge.bollo { background: #f3f4f6; color: #667085; font-weight: 500; }
    .badge-row {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      flex-wrap: nowrap;
      white-space: nowrap;
    }
    .doc-meta {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 6px 8px;
      margin: 0;
      line-height: 1.5;
    }
    .actions { display: flex; gap: 6px; flex-wrap: wrap; }
    td.actions {
      display: table-cell;
      vertical-align: middle;
    }
    td.actions .icon-btn { margin-right: 6px; }
    td.actions form { display: inline; }

    .bulk-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
      padding: 12px 16px;
      margin: 0;
      border-bottom: 1px solid var(--line);
      background: var(--green-50);
    }
    .bulk-bar[hidden] { display: none !important; }
    .bulk-count { color: var(--muted); font-size: 13px; }
    table.data th.check-col,
    table.data td.check-col {
      width: 44px;
      padding-left: 16px;
      padding-right: 8px;
    }
    table.data th.check-col input,
    table.data td.check-col input {
      width: 16px;
      height: 16px;
      cursor: pointer;
      margin: 0;
    }
    table.data th.col-subject,
    table.data td.col-subject {
      width: 14%;
      max-width: 160px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    table.data th.col-amount,
    table.data td.col-amount {
      width: 9rem;
      min-width: 7.5rem;
      text-align: right;
      white-space: nowrap;
      font-variant-numeric: tabular-nums;
    }
    table.invoices {
      table-layout: fixed;
      width: 100%;
    }
    table.invoices th.col-customer,
    table.invoices td.col-customer,
    table.invoices th.col-subject,
    table.invoices td.col-subject {
      width: auto;
      max-width: none;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    table.invoices th.col-amount,
    table.invoices td.col-amount {
      min-width: 0;
    }
    table.invoices th.col-quote,
    table.invoices td.col-quote,
    table.invoices th.col-pay,
    table.invoices td.col-pay,
    table.invoices th.col-docn,
    table.invoices td.col-docn,
    table.invoices th.col-rivalsa,
    table.invoices td.col-rivalsa,
    table.invoices th.col-importo,
    table.invoices td.col-importo {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    table.invoices th.col-quote,
    table.invoices th.col-pay,
    table.invoices th.col-docn,
    table.invoices th.col-rivalsa {
      font-size: 11px;
      letter-spacing: 0.02em;
      line-height: 1.2;
    }
    table.invoices td.col-pay .badge-row {
      flex-direction: row;
      flex-wrap: nowrap;
      gap: 4px;
    }
    table.invoices td.col-docn .docn-note {
      font-size: 12px;
      color: var(--muted);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    table.invoices th.col-actions,
    table.invoices td.col-actions {
      width: 19.2rem;
      max-width: none;
      overflow: visible;
      white-space: nowrap;
      padding-left: 8px;
      padding-right: 10px;
    }
    table.invoices td.col-actions.actions {
      flex-wrap: nowrap;
      gap: 6px;
    }
    table.invoices td.col-actions .icon-btn {
      padding: 5px 8px;
      font-size: 12px;
      white-space: nowrap;
    }

    .icon-btn {
      border: 1px solid var(--line);
      background: var(--white);
      border-radius: 6px;
      padding: 5px 9px;
      cursor: pointer;
      font-size: 12px;
      display: inline-flex;
      align-items: center;
      gap: 5px;
    }
    .table-foot {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
      padding: 12px 14px;
      border-top: 1px solid var(--line);
      font-size: 13px;
      color: var(--muted);
    }
    .table-foot strong { color: var(--ink); }
    .table-foot-totals { text-align: right; }
    .table-foot .tot-rejected { color: #b42318; }
    .table-foot .muted { color: var(--muted); margin: 0 4px; }

    /* Forms */
    .form-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 14px 18px;
    }
    .field { display: flex; flex-direction: column; gap: 6px; }
    .field.full { grid-column: 1 / -1; }
    .field label { font-size: 12px; font-weight: 600; color: var(--muted); }
    .field input, .field select, .field textarea {
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 9px 11px;
      font: inherit;
      background: #fff;
    }
    .field textarea { min-height: 80px; resize: vertical; }
    .note {
      background: var(--green-50);
      border: 1px solid #b8ebcd;
      border-radius: 8px;
      padding: 12px 14px;
      font-size: 13px;
      color: var(--green-800);
      margin-bottom: 16px;
    }

    .mock-banner {
      position: sticky;
      top: 0;
      z-index: 5;
      background: #fff8e8;
      border: 1px solid #f0d9a0;
      color: #6b5218;
      padding: 8px 12px;
      border-radius: 8px;
      margin-bottom: 16px;
      font-size: 13px;
    }

    .doc-split {
      display: grid;
      grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
      gap: 16px;
      align-items: start;
      margin-bottom: 16px;
    }
    .doc-split-meta {
      min-width: 0;
      max-width: 100%;
    }
    .doc-split-meta .panel,
    .doc-split-meta .form-grid,
    .doc-split-meta .field {
      min-width: 0;
      max-width: 100%;
    }
    .doc-split-meta .field input:not([type="checkbox"]),
    .doc-split-meta .field select,
    .doc-split-meta .field textarea,
    .doc-split-meta .field button {
      width: 100%;
      max-width: 100%;
      min-width: 0;
      box-sizing: border-box;
    }
    .doc-split-meta .form-grid { grid-template-columns: 1fr; }
    .doc-split-items { min-width: 0; }
    .item-list { display: flex; flex-direction: column; gap: 12px; }
    .item-card {
      display: flex;
      background: #f6faf7;
      border: 1px solid var(--line);
      border-radius: 10px;
      overflow: hidden;
    }
    .item-order {
      width: 46px;
      flex-shrink: 0;
      background: #e6efe9;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 6px;
      padding: 8px 4px;
    }
    .item-body {
      flex: 1;
      min-width: 0;
      display: grid;
      grid-template-columns: minmax(0, 1fr) 168px;
      gap: 12px;
      padding: 12px;
    }
    .item-main, .item-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
    .item-top { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px; }
    .item-lab {
      display: flex;
      flex-direction: column;
      gap: 4px;
      font-size: 11px;
      font-weight: 600;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      color: var(--muted);
    }
    .item-card input,
    .item-card select,
    .item-card textarea {
      width: 100%;
      border: 1px solid var(--line);
      border-radius: 6px;
      padding: 8px 10px;
      font: inherit;
      font-weight: 400;
      letter-spacing: 0;
      text-transform: none;
      color: var(--ink);
      background: #fff;
    }
    .item-card input[type="radio"],
    .item-card input[type="checkbox"] {
      width: auto;
      padding: 0;
      border: 0;
      background: transparent;
    }
    .item-card textarea.item-title { min-height: 52px; resize: vertical; }
    .item-desc textarea { min-height: 140px; resize: vertical; line-height: 1.4; }
    .item-side .cycle-picks { text-transform: none; letter-spacing: 0; font-weight: 400; }
    .live-total {
      margin-top: 14px;
      padding-top: 12px;
      border-top: 1px solid var(--line);
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 4px;
    }
    .live-line {
      display: flex;
      justify-content: space-between;
      gap: 18px;
      min-width: 240px;
      font-size: 13px;
      color: var(--muted);
    }
    .live-line[hidden] { display: none !important; }
    .live-grand {
      margin-top: 4px;
      font-size: 18px;
      color: var(--ink);
      font-weight: 600;
    }
    .live-hint { font-size: 12px; color: var(--muted); margin-top: 2px; }

    @media (max-width: 1100px) {
      .kpi-grid { grid-template-columns: 1fr 1fr; }
      .charts { grid-template-columns: 1fr; }
      .months { grid-template-columns: repeat(6, 1fr); }
    }
    @media (max-width: 1000px) {
      .doc-split { grid-template-columns: 1fr; }
      .doc-split-meta .form-grid { grid-template-columns: 1fr 1fr; }
    }
    .mobile-nav { display: none; }

    @media (max-width: 800px) {
      .app { grid-template-columns: 1fr; }
      .sidebar { display: none; }
      .mobile-nav {
        display: block;
        padding: 10px 12px;
        background: var(--white);
        border-bottom: 1px solid var(--line);
      }
      .nav-jump {
        width: 100%;
        min-height: 44px;
        border: 1px solid var(--line);
        border-radius: 8px;
        padding: 8px 12px;
        font: inherit;
        font-weight: 600;
        color: var(--ink);
        background: var(--green-50);
      }
      .topbar { padding: 0 12px; }
      .top-actions { gap: 8px; }
      .main { padding: 16px 12px 32px; }
      .form-grid,
      .doc-split-meta .form-grid { grid-template-columns: 1fr; }
      .item-body, .item-top { grid-template-columns: 1fr; }
    }
  
a.nav-item { text-decoration: none; color: inherit; }
a.user-chip { text-decoration: none; }
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(700px 320px at 80% 0%, rgba(111, 207, 151, 0.28), transparent 60%),
    var(--bg);
}
.login-card {
  width: min(420px, 100%);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 28px 26px;
}
.login-card h1 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 600;
}
.login-card .sub { color: var(--muted); margin: 0 0 22px; font-size: 13px; }
.login-card .field { margin-bottom: 14px; }
.login-card label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.login-card input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
}
.login-card .error {
  background: #fff1f0;
  border: 1px solid #f5c2c0;
  color: #8a2e2a;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 13px;
}
.flash {
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.45;
}
.flash-error {
  background: #fff1f0;
  border: 1px solid #f5c2c0;
  color: #8a2e2a;
}
.flash-error a {
  color: #6b1f1c;
  font-weight: 600;
  margin-left: 8px;
  text-decoration: underline;
}
.login-card .btn { width: 100%; justify-content: center; margin-top: 8px; }
.placeholder-note {
  background: var(--green-50);
  border: 1px solid #b8ebcd;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--green-800);
}
.year-form { display: inline; margin: 0; }

a.month { text-decoration: none; color: inherit; display: block; }
a.tab { text-decoration: none; }
.toolbar form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; width: 100%; }
.field label input[type="checkbox"] { margin-right: 6px; }
