:root {
      color-scheme: light;
      --bg: #f5f6f8;
      --panel: #ffffff;
      --text: #1f2933;
      --muted: #6b7a89;
      --accent: #1b6ef3;
      --border: #e3e7ee;
      --content-max-width: 1920px;
    }
    html, body {
      margin: 0;
      padding: 0;
    }
    html {
      scrollbar-gutter: stable;
    }
    body {
      font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
      background: var(--bg);
      color: var(--text);
    }
    .header-1 {
      font-size: 24px;
      line-height: 1.2;
      font-weight: 700;
    }
    .header-2 {
      font-size: 18px;
      line-height: 1.3;
      font-weight: 600;
    }
    .header-3 {
      font-size: 16px;
      line-height: 1.3;
      font-weight: 600;
    }
    .text-1 {
      font-size: 14px;
      line-height: 1.5;
    }
    .text-2 {
      font-size: 13px;
      line-height: 1.5;
    }
    .text-3 {
      font-size: 12px;
      line-height: 1.4;
    }
    body.nav-open,
    body.modal-open {
      overflow: hidden;
    }
    header {
      background: var(--panel);
      border-bottom: 1px solid var(--border);
      margin: 0;
      padding: 12px 24px;
      display: flex;
      align-items: center;
      gap: 12px;
      flex-wrap: nowrap;
      min-width: 0;
      position: sticky;
      top: 0;
      z-index: 10000;
    }
    header a {
      color: var(--text);
      text-decoration: none;
      margin-right: 16px;
    }
    .sync-banner {
      flex: 0 0 auto;
      margin-left: auto;
      padding: 6px 12px;
      margin-right: 0;
      background: #fff3cd;
      border: 1px solid #ffe3a3;
      color: #7a4b00;
      border-radius: 3px;
      font-size: 12px;
      text-align: center;
      white-space: nowrap;
    }
    .sync-banner-label-short {
      display: none;
    }
    .header-left {
      display: flex;
      flex: 0 0 auto;
      align-items: center;
    }
    .header-rates {
      display: flex;
      flex: 0 0 auto;
      position: absolute;
      left: 50%;
      transform: translateX(-50%);
      align-items: center;
      gap: 9px;
      min-width: 0;
      margin-right: 0;
      padding: 6px 9px;
      border: 1px solid var(--border);
      border-radius: 5px;
      background: #f8fafc;
      font-size: 11px;
      white-space: nowrap;
    }
    .header-rate {
      display: inline-flex;
      gap: 3px;
      color: var(--muted);
    }
    .header-rate strong {
      color: var(--text);
      font-weight: 600;
    }
    .header-nav-row {
      display: flex;
      flex: 0 0 auto;
      align-items: center;
      min-width: 0;
    }
    .header-right {
      display: flex;
      flex: 0 0 auto;
      align-items: center;
      gap: 8px;
      margin-left: auto;
      flex-wrap: nowrap;
      justify-content: flex-end;
    }
    .sync-banner:not([hidden]) + .header-right {
      margin-left: 0;
    }
    .site-header a {
      margin-right: 0;
    }
    .site-header.header-rates-hidden .header-rates {
      display: none;
    }
    .rates {
      position: relative;
      display: inline-flex;
      align-items: center;
      gap: 10px;
      padding: 8px 12px;
      border: 1px solid var(--border);
      border-radius: 5px;
      background: var(--panel);
      font-size: 13px;
      overflow: visible;
      width: fit-content;
      max-width: 100%;
    }
    .rate {
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .rate-code {
      font-weight: 600;
      color: var(--text);
    }
    .rate-value {
      font-weight: 700;
      color: var(--text);
      min-width: 52px;
    }
    .rates-actions {
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .rates-manual {
      position: absolute;
      top: calc(100% + 10px);
      right: 0;
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 5px;
      padding: 12px;
      box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
      width: 320px;
      max-width: 90vw;
      z-index: 30;
      box-sizing: border-box;
    }
    .rates-manual form {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }
    .rates-manual label {
      font-size: 12px;
    }
    .rates-manual input,
    .rates-manual select {
      width: 100%;
      box-sizing: border-box;
    }
    .rates-manual-actions {
      display: flex;
      justify-content: flex-end;
      gap: 8px;
    }
    .rates-meta {
      margin-top: 8px;
      color: var(--muted);
    }
    .page-container {
      width: 90%;
      max-width: var(--content-max-width);
      box-sizing: border-box;
      margin: 0 auto;
    }
    main {
      padding: 24px;
    }
    .page-container-bleed {
      width: calc(100% + 48px);
      max-width: none;
      margin-left: -24px;
      margin-right: -24px;
    }
    [hidden] {
      display: none !important;
    }
    .panel {
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 5px;
      padding: 20px;
      box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
    }
    label {
      display: block;
      font-size: 14px;
      color: var(--muted);
    }
    input[type="date"],
    input[type="datetime-local"],
    input[type="number"],
    input[type="search"],
    input[type="time"],
    input[type="text"],
    input[type="email"],
    input[type="password"],
    select {
      margin-top: 6px;
      padding: 8px 10px;
      border: 1px solid var(--border);
      border-radius: 5px;
      font-size: 14px;
      background: #fff;
      box-sizing: border-box;
      max-width: 100%;
    }
    .form-row {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
      margin-bottom: 12px;
    }
    .muted {
      color: var(--muted);
    }
    .report-table th {
      background: #dfead3;
      color: #1f2933;
    }
    .report-meta {
      margin-bottom: 8px;
    }
    .report-meta-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
    }
    .report-color-help {
      margin-top: 10px;
      color: var(--muted);
    }
    .report-color-help summary {
      cursor: pointer;
      color: #1f2933;
      font-weight: 600;
      width: fit-content;
    }
    .report-color-legend {
      display: flex;
      flex-direction: column;
      gap: 10px;
      margin-top: 10px;
      color: var(--muted);
      max-width: 980px;
    }
    .report-color-legend-item {
      display: flex;
      align-items: flex-start;
      gap: 8px;
    }
    .report-color-swatch {
      width: 18px;
      height: 18px;
      border: 1px solid var(--border);
      border-radius: 4px;
      flex: 0 0 18px;
    }
    .report-color-swatch-yellow {
      background: #fff2cc;
    }
    .report-color-swatch-red {
      background: #f4cccc;
    }
    .report-color-swatch-neutral {
      background: #e8eef7;
    }
    .per-page-form {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-left: auto;
    }
    .per-page-label {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      font-size: 12px;
      color: var(--muted);
    }
    .per-page-select {
      margin-top: 0;
      padding: 6px 8px;
      border-radius: 5px;
    }
    .filter-row {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
      align-items: center;
      margin-top: 12px;
    }
    .filter-left,
    .filter-right {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
      align-items: center;
    }
    .filter-right {
      margin-left: auto;
    }
    .filter-search {
      margin-left: 20px;
    }
    .pagination {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
      align-items: center;
      margin-top: 12px;
    }
    .pagination-info {
      font-size: 13px;
      color: var(--muted);
    }
    .pagination-links {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }
    .pagination .btn[aria-disabled="true"] {
      opacity: 0.6;
      cursor: not-allowed;
      pointer-events: none;
    }
    .filter-row .export-btn {
      margin-left: auto;
    }
    .deleted-record-row {
      color: var(--muted);
    }
    .deleted-record-label {
      text-decoration: line-through;
      text-decoration-thickness: 1.5px;
    }
    .checkbox {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 14px;
      color: var(--text);
    }
    .report-cards {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
      gap: 16px;
      margin-top: 16px;
    }
    .report-cards.stacked {
      grid-template-columns: 1fr;
    }
    .report-card {
      display: block;
      padding: 18px;
      border-radius: 5px;
      border: 1px solid var(--border);
      background: var(--panel);
      text-decoration: none;
      color: var(--text);
      box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
      transition: transform 0.15s ease, box-shadow 0.15s ease;
    }
    .report-card:hover {
      transform: translateY(-2px);
      box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
    }
    .report-card-title {
      font-weight: 700;
      font-size: 16px;
      margin-bottom: 6px;
    }
    .report-card-desc {
      color: var(--muted);
      font-size: 13px;
    }
    .messages {
      margin: 0 0 16px;
      padding: 0;
      list-style: none;
    }
    .messages li {
      padding: 10px 12px;
      border-radius: 5px;
      margin-bottom: 8px;
    }
    .messages li.success {
      background: #e6f4ea;
      color: #1e6f3f;
    }
    .messages li.error {
      background: #fdecea;
      color: #b42318;
    }
    .form-error,
    .errorlist {
      margin: 6px 0 0;
      padding: 0;
      list-style: none;
      font-size: 12px;
      color: #b42318;
    }
    .stats-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 16px;
      margin: 16px 0 20px;
    }
    .stat-card {
      border: 1px solid var(--border);
      border-radius: 5px;
      padding: 18px 16px 16px;
      background: #f9fafc;
      display: flex;
      flex-direction: column;
      gap: 6px;
      min-height: 86px;
      justify-content: center;
      position: relative;
    }
    .stat-label {
      font-size: 16px;
      font-weight: 600;
      color: var(--text);
    }
    .stat-value {
      font-size: 28px;
      font-weight: 700;
      color: var(--text);
    }
    .stat-count {
      position: absolute;
      top: 12px;
      right: 12px;
      font-size: 12px;
      color: var(--muted);
    }
    .actions-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 16px;
      margin-top: 16px;
    }
    @media (max-width: 900px) {
      .stats-grid,
      .actions-grid {
        grid-template-columns: 1fr;
      }
    }
    .action-card {
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 5px;
      padding: 16px;
      box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
      display: flex;
      flex-direction: column;
      gap: 12px;
      position: relative;
    }
    .action-title {
      font-weight: 600;
      color: var(--text);
      text-decoration: none;
    }
    .action-title:hover {
      color: var(--accent);
    }
    .action-count {
      position: absolute;
      top: 12px;
      right: 12px;
      font-size: 12px;
      color: var(--muted);
      text-align: right;
      white-space: nowrap;
    }
    .action-count .count-number {
      font-weight: 700;
      color: var(--text);
    }
    .action-count.secondary {
      top: 30px;
    }
    .action-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 12px;
      color: var(--text);
    }
    .action-table th,
    .action-table td {
      padding: 6px;
      border-bottom: 1px solid var(--border);
      text-align: left;
      vertical-align: top;
    }
    .action-table td {
      word-break: break-word;
    }
    .action-table th {
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: 0.03em;
      color: var(--muted);
      font-weight: 600;
    }
    .action-table tr:last-child td {
      border-bottom: none;
    }
    .action-table-empty {
      color: var(--muted);
      font-size: 12px;
    }
    .action-divider {
      height: 1px;
      background: var(--border);
      margin: 6px 0;
    }
    .action-item-title {
      font-weight: 600;
    }
    .action-item-sub {
      color: var(--muted);
      font-size: 12px;
    }
    .action-form {
      margin-top: auto;
    }
    .loader-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.35);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 9999;
    }
    .loader-backdrop.active {
      display: flex;
    }
    .loader-card {
      background: #fff;
      border-radius: 5px;
      padding: 16px 20px;
      display: flex;
      align-items: center;
      gap: 12px;
      font-weight: 600;
      box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
    }
    .loader-spinner {
      width: 22px;
      height: 22px;
      border-radius: 50%;
      border: 3px solid #dbe2ef;
      border-top-color: var(--accent);
      animation: spin 0.9s linear infinite;
    }
    .logo-link {
      display: inline-flex;
      align-items: center;
      text-decoration: none;
    }
    .logo-link img {
      height: 44px;
      width: auto;
      display: block;
    }
    .nav-logout {
      display: block;
      margin: 0;
    }
    .nav-logout button {
      background: transparent;
      border: none;
      color: var(--text);
      cursor: pointer;
      font: inherit;
      padding: 10px 12px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 18px;
      width: 100%;
      min-width: 130px;
      height: auto;
      border-radius: 5px;
      font-weight: 500;
      font-size: 13px;
    }
    .nav-logout button img {
      width: 14px;
      height: 14px;
      display: block;
    }
    .nav-logout button:hover {
      color: var(--accent);
      background: var(--panel-muted, #f3f5f8);
    }
    .nav-user-block {
      position: relative;
      display: inline-block;
    }
    .nav-user {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      font-weight: 600;
      color: var(--text);
      font-size: 13px;
      white-space: nowrap;
      background: transparent;
      border: 0;
      padding: 4px 6px;
      border-radius: 6px;
      cursor: pointer;
      font-family: inherit;
    }
    .nav-user:hover,
    .nav-user[aria-expanded="true"] {
      background: #f0f2f6;
    }
    .profile-menu-list {
      position: absolute;
      top: calc(100% + 8px);
      right: 0;
      z-index: 12000;
      padding: 5px;
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 7px;
      box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
    }
    .profile-menu-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 18px;
      width: 100%;
      min-width: 130px;
      box-sizing: border-box;
      padding: 10px 12px;
      border-radius: 5px;
      color: var(--text);
      font-size: 13px;
      font-weight: 500;
      text-decoration: none;
    }
    .profile-menu-item img {
      display: block;
      width: 14px;
      height: 14px;
    }
    .profile-menu-item:hover,
    .profile-menu-item.active {
      background: var(--panel-muted, #f3f5f8);
      color: var(--accent);
    }
    .nav-user-icon {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      background: #e3e7ee;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex: 0 0 auto;
    }
    .nav-user-icon img {
      width: 16px;
      height: 16px;
      display: block;
      opacity: 0.7;
    }
    .sr-only {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }
    .nav-toggle {
      display: none;
      align-items: center;
      gap: 6px;
      background: #e3e7ee;
      border: 1px solid var(--border);
      color: var(--text);
      padding: 8px;
      border-radius: 5px;
      cursor: pointer;
      font-weight: 600;
      min-width: 40px;
      min-height: 40px;
      justify-content: center;
    }
    .nav-toggle .burger {
      display: inline-block;
      width: 16px;
      height: 12px;
      position: relative;
    }
    .nav-toggle .burger span {
      position: absolute;
      left: 0;
      right: 0;
      height: 2px;
      background: var(--text);
      border-radius: 999px;
      transition: transform 0.2s ease, opacity 0.2s ease;
    }
    .nav-toggle .burger span:nth-child(1) {
      top: 0;
    }
    .nav-toggle .burger span:nth-child(2) {
      top: 5px;
    }
    .nav-toggle .burger span:nth-child(3) {
      bottom: 0;
    }
    .nav-close {
      display: none;
      align-items: center;
      justify-content: center;
      width: 36px;
      height: 36px;
      border-radius: 5px;
      border: 1px solid var(--border);
      background: #f0f3f8;
      cursor: pointer;
      position: absolute;
      top: 12px;
      right: 16px;
    }
    .nav-close img {
      width: 16px;
      height: 16px;
      display: block;
    }
    .primary-nav {
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .primary-nav > a {
      margin: 0;
    }
    .create-menu {
      position: relative;
      flex: 0 0 auto;
    }
    .create-menu-toggle {
      flex: 0 0 auto;
    }
    .create-menu-plus {
      font-size: 18px;
      line-height: 1;
    }
    .create-menu-toggle:hover,
    .create-menu-toggle:focus-visible,
    .create-menu.open .create-menu-toggle {
      background: var(--button-first-hover);
      border-color: var(--button-first-hover);
    }
    .create-menu-chevron {
      width: 0;
      height: 0;
      border-left: 4px solid transparent;
      border-right: 4px solid transparent;
      border-top: 5px solid currentColor;
      transition: transform 0.18s ease;
    }
    .create-menu.open .create-menu-chevron {
      transform: rotate(180deg);
    }
    .create-menu-list {
      position: absolute;
      top: calc(100% + 7px);
      left: 0;
      z-index: 12000;
      min-width: 170px;
      overflow: hidden;
      border: 1px solid #5cb85c;
      border-radius: 5px;
      background: #5cb85c;
      box-shadow: 0 10px 24px rgba(31, 41, 51, 0.2);
    }
    .create-menu-list a {
      display: block;
      margin: 0;
      padding: 10px 14px;
      color: #fff;
      font-size: 13px;
      white-space: nowrap;
    }
    .create-menu-list a:hover,
    .create-menu-list a:focus-visible {
      background: #4cae4c;
      outline: none;
    }
    .nav-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.45);
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.2s ease;
      z-index: 9000;
    }
    .nav-backdrop.active {
      opacity: 1;
      pointer-events: auto;
    }
    .login-shell {
      min-height: calc(100vh - 48px);
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 24px;
      box-sizing: border-box;
    }
    .login-panel {
      width: min(420px, 100%);
      text-align: center;
    }
    .login-panel h1 {
      margin-top: 0;
    }
    .login-panel form {
      display: flex;
      flex-direction: column;
      gap: 12px;
      align-items: center;
    }
    .login-panel form p {
      width: 100%;
      margin: 0;
      text-align: left;
    }
    .login-panel input {
      width: 100%;
      box-sizing: border-box;
    }
    .login-panel .btn {
      width: 100%;
      margin-top: 16px;
    }
    @media (max-width: 1100px) {
      header {
        padding: 12px 16px;
        gap: 12px;
      }
      .header-left,
      .header-right {
        justify-self: auto;
      }
      .header-left {
        display: flex;
        justify-content: flex-start;
      }
      .header-nav-row nav {
        justify-content: flex-start;
        gap: 5px;
      }
      header a {
        margin-right: 0;
      }
      .rates {
        justify-content: center;
        flex-wrap: wrap;
      }
    }
    @media (max-width: 768px) {
      main {
        margin: 0 auto;
        padding: 16px;
      }
      .page-container-bleed {
        width: calc(100% + 32px);
        margin-left: -16px;
        margin-right: -16px;
      }
      .panel {
        padding: 16px;
      }
      .form-row,
      .filter-row {
        flex-direction: column;
        align-items: stretch;
      }
      .form-row > *,
      .filter-row > * {
        width: 100%;
      }
      .filter-left,
      .filter-right {
        width: 100%;
      }
      .filter-right {
        margin-left: 0;
      }
      .filter-search {
        margin-left: 0;
      }
      .filter-row .export-btn {
        margin-left: 0;
      }
      input[type="date"],
      input[type="datetime-local"],
      input[type="number"],
      select {
        width: 100%;
      }
      .rates-actions {
        width: 100%;
        justify-content: center;
      }
      .action-count {
        position: static;
        text-align: left;
      }
      .action-count.secondary {
        top: auto;
      }
      .action-card,
      .panel {
        overflow-x: auto;
      }
    }
    .site-header.header-nav-collapsed .header-nav-row {
      flex: 0 0 0;
      width: 0;
    }
    .site-header.header-nav-collapsed .nav-toggle {
      display: inline-flex;
      justify-content: center;
      width: auto;
    }
    .site-header.header-nav-collapsed .primary-nav {
      position: fixed;
      top: 0;
      right: 0;
      height: 100vh;
      width: max-content;
      max-width: min(90vw, 420px);
      flex-direction: column;
      align-items: stretch;
      justify-content: flex-start;
      gap: 12px;
      box-sizing: border-box;
      background: var(--panel);
      border-left: 1px solid var(--border);
      border-radius: 10px 0 0 10px;
      padding: 48px 18px 20px 24px;
      box-shadow: -12px 0 24px rgba(15, 23, 42, 0.2);
      transform: translateX(100%);
      transition: transform 0.25s ease;
      z-index: 11000;
      overflow-y: auto;
    }
    .site-header.header-nav-collapsed .header-nav-row .primary-nav {
      justify-content: flex-start;
    }
    .site-header.header-nav-collapsed .nav-close {
      display: inline-flex;
    }
    .site-header.header-nav-collapsed .primary-nav.open {
      transform: translateX(0);
    }
    .site-header.header-nav-collapsed .primary-nav a,
    .site-header.header-nav-collapsed .primary-nav .nav-logout,
    .site-header.header-nav-collapsed .primary-nav .nav-user,
    .site-header.header-nav-collapsed .primary-nav .nav-user-block {
      padding: 6px 0 6px 4px;
    }
    .site-header.header-nav-collapsed .primary-nav .create-menu-list a {
      padding: 10px 14px;
    }
    .site-header.header-nav-collapsed .primary-nav .nav-logout button {
      text-align: left;
    }
    .site-header.header-nav-collapsed .sync-banner-label-full,
    .site-header.header-nav-collapsed .nav-user-name {
      display: none;
    }
    .site-header.header-nav-collapsed .sync-banner-label-short {
      display: inline;
    }
    @media (max-width: 480px) {
      header {
        padding: 10px 12px;
        gap: 8px;
      }
      .logo-link {
        font-size: 15px;
      }
      .logo-link img {
        height: 36px;
      }
      .sync-banner {
        padding: 5px 7px;
        font-size: 11px;
        white-space: nowrap;
      }
      .rates {
        gap: 8px;
      }
      .rate-value {
        min-width: 44px;
      }
      .btn {
        width: 100%;
        justify-content: center;
      }
      .rates-actions {
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
        gap: 8px;
      }
      .rates-actions .btn {
        width: auto;
      }
      .nav-logout button {
        padding: 6px 0;
      }
    }
    @keyframes spin {
      to { transform: rotate(360deg); }
    }
