/* finesse · register=product · shell=sidebar+live-preview · palette=sage-teal */
@import url("/assets/fonts.css");
:root {
  --page: #f5f7f6;
  --bg: #fdfefd;
  --panel-2: #f0f5f2;
  --border: rgba(32, 61, 48, 0.09);
  --ink-1: #24352d;
  --ink-2: #4b6056;
  --ink-3: #687a70;
  --accent: #176c60;
  --accent-soft: #e6f2eb;
  --on-accent: #f7fbf8;
  --up: #28735c;
  --down: #ab4b41;
  --warn: #9c7130;
  --shadow: 0 2px 5px #203d3003;
  --radius: 14px;
  --r-sm: 8px;
  --font:
    "BaiBua Thai", -apple-system, BlinkMacSystemFont, "Thonburi", "Segoe UI",
    "PingFang SC", sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--page);
  color: var(--ink-1);
  font: 14px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.55;
}
button[aria-busy="true"] .icon {
  animation: pulse 1s infinite;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  color: inherit;
}
h1,
h2,
h3,
h4,
p {
  margin: 0;
}
h1,
h2,
h3 {
  text-wrap: balance;
}
h1 {
  font-size: 28px;
  line-height: 1.45;
  letter-spacing: -0.65px;
  font-weight: 650;
}
h2 {
  font-size: 17px;
  font-weight: 650;
}
h3 {
  font-size: 15px;
  font-weight: 600;
}
small {
  font-size: 11px;
}
p {
  text-wrap: pretty;
}
.icon {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  vertical-align: middle;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 550;
  min-height: 42px;
  white-space: nowrap;
  transition:
    background 0.15s,
    box-shadow 0.15s,
    transform 0.15s;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn.primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 2px 3px #176c6014;
}
.btn.primary:hover {
  background: #11584e;
}
.btn.secondary {
  background: var(--bg);
  border-color: var(--border);
  box-shadow: var(--shadow);
}
.btn.secondary:hover {
  background: var(--panel-2);
  border-color: #b7cfc2;
}
.btn.full {
  width: 100%;
}
.icon-btn {
  border: 0;
  background: transparent;
  padding: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  border-radius: 7px;
  min-width: 34px;
  min-height: 36px;
}
.icon-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.text-button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
  padding: 3px;
}
.text-link {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--accent);
  font-size: 12px;
  font-weight: 550;
  border: 0;
  background: none;
  cursor: pointer;
}
.text-link .icon {
  width: 15px;
}
.nowrap {
  white-space: nowrap;
}
.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.initial-loading,
.load-error {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  font-size: 24px;
}
.initial-loading span {
  font-size: 14px;
  color: var(--ink-3);
}
:focus-visible {
  outline: 3px solid #63ac9570;
  outline-offset: 3px;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 238px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  padding: 28px 17px 14px;
  display: flex;
  flex-direction: column;
  z-index: 30;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
}
.brand img {
  width: 36px;
  height: 36px;
}
.brand > span {
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: -0.8px;
  font-weight: 650;
}
.brand small {
  display: block;
  font-size: 8px;
  letter-spacing: 1.7px;
  color: var(--ink-3);
  margin-top: 5px;
  font-weight: 550;
}
.workspace-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  margin: 35px 0 29px;
  padding: 10px 9px;
  min-width: 0;
}
.workspace-avatar {
  width: 31px;
  height: 31px;
  background: #edf0e5;
  border: 1px solid #dee5d5;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: #717e49;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}
.workspace-switch > div {
  min-width: 0;
  flex: 1;
}
.workspace-switch strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
  font-weight: 650;
}
.workspace-switch div span {
  font-size: 10px;
  color: var(--ink-3);
}
.workspace-switch > .icon {
  width: 13px;
  color: #8a978f;
}
.nav-label {
  font-size: 10px;
  letter-spacing: 0.7px;
  color: var(--ink-3);
  padding: 0 14px;
  margin-bottom: 11px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  border-radius: 7px;
  padding: 11px 13px;
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 5px;
  min-height: 43px;
}
.nav-item .icon {
  width: 18px;
}
.nav-item small {
  margin-left: auto;
  background: #eef2ef;
  min-width: 21px;
  padding: 0 5px;
  text-align: center;
  border-radius: 5px;
  font-size: 10px;
  color: var(--ink-3);
}
.nav-item:hover {
  background: #f2f6f3;
}
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.nav-item.active small {
  background: #cee5d9;
  color: var(--accent);
}
.config-label {
  margin-top: 27px;
}
.sidebar-bottom {
  margin-top: auto;
  padding-top: 25px;
}
.plan-mini {
  background: #f0f6ed;
  border: 1px solid #e2ebdc;
  border-radius: 10px;
  padding: 16px 14px;
  position: relative;
}
.leaf-mark {
  position: absolute;
  right: 13px;
  top: 15px;
  color: #77956e;
}
.leaf-mark .icon {
  width: 22px;
  height: 22px;
}
.plan-mini > strong {
  font-size: 11px;
}
.plan-mini p {
  font-size: 23px;
  color: #365b41;
  font-weight: 600;
  margin-top: 6px;
}
.plan-mini p span {
  font-size: 10px;
  color: var(--ink-3);
  font-weight: 400;
}
.plan-mini a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  border-top: 1px solid #dce8d7;
  padding-top: 9px;
  font-size: 11px;
  color: #4d6948;
}
.plan-mini a .icon {
  width: 15px;
}
.user-profile {
  border: 0;
  border-top: 1px solid var(--border);
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 19px;
  padding: 17px 3px 2px;
  text-align: left;
}
.user-avatar {
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  border-radius: 50%;
  background: #e9e6db;
  color: #6c6756;
  font-size: 12px;
  font-weight: 650;
  flex-shrink: 0;
}
.user-profile > span:nth-child(2) {
  flex: 1;
}
.user-profile strong {
  display: block;
  font-size: 11px;
}
.user-profile small {
  display: block;
  color: var(--ink-3);
  font-size: 10px;
}
.user-profile > .icon {
  width: 16px;
}
.app-main {
  margin-left: 238px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 72px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 34px;
  background: #fbfdfb;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 13px;
  font-size: 11px;
  color: var(--ink-3);
}
.breadcrumb .icon {
  width: 12px;
}
.breadcrumb strong {
  font-weight: 500;
  color: var(--ink-2);
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}
.language-picker {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-2);
}
.language-picker .icon {
  width: 16px;
}
.language-picker select {
  background: transparent;
  border: 0;
  color: var(--ink-2);
  font-size: 11px;
  cursor: pointer;
  padding: 5px;
}
.topbar-divider {
  width: 1px;
  height: 22px;
  background: var(--border);
}
.online-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--ink-3);
}
.online-status i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #5b9472;
}
.compact-avatar {
  width: 29px;
  height: 29px;
  font-size: 10px;
}
.menu-toggle {
  display: none;
}
.demo-strip {
  font-size: 10px;
  text-align: center;
  color: #5d735b;
  background: #edf3e7;
  padding: 5px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-bottom: 1px solid #e1eadb;
}
.demo-strip .icon {
  width: 12px;
  height: 12px;
}
#main-content {
  padding: 34px 34px 25px;
  max-width: 1640px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}
.welcome-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 27px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 0.9px;
  color: var(--accent);
  font-weight: 550;
}
.eyebrow span {
  color: var(--ink-3);
  letter-spacing: 0;
  font-weight: 400;
  margin-left: 4px;
}
.welcome-row h1 {
  margin: 9px 0 7px;
  font-size: 26px;
}
.welcome-row p,
.page-heading p {
  font-size: 12px;
  color: var(--ink-3);
}
.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.month-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  min-height: 42px;
  box-shadow: var(--shadow);
}
.month-picker > .icon {
  width: 16px;
  color: var(--ink-3);
}
.month-picker input {
  border: 0;
  background: none;
  color: var(--ink-2);
  font-size: 11px;
  max-width: 140px;
  outline: none;
}
.stats-grid {
  display: grid;
  grid-template-columns: 1.18fr 0.85fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 25px;
}
.stat-card {
  padding: 17px 20px 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.stat-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.stat-icon {
  width: 31px;
  height: 31px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #eaf2ee;
  color: #56806b;
}
.stat-icon .icon {
  width: 16px;
  height: 16px;
}
.stat-1 {
  background: #eef0f6;
  color: #7b85a2;
}
.stat-2 {
  background: #edf4e9;
  color: #78916c;
}
.stat-3 {
  background: #f8f1e6;
  color: #ad9467;
}
.stat-unit {
  color: #8b978f;
  font-size: 9px;
  letter-spacing: 0.4px;
}
.stat-card p {
  color: var(--ink-3);
  font-size: 11px;
  margin: 13px 0 4px;
}
.stat-card > strong {
  font-size: 27px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.7px;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 294px;
  gap: 23px;
  align-items: start;
}
.dashboard-left {
  min-width: 0;
}
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 21px 23px;
  border-bottom: 1px solid var(--border);
}
.card-heading h2 {
  font-size: 15px;
}
.card-heading span,
.card-heading div > span {
  display: block;
  font-size: 10px;
  color: var(--ink-3);
  margin-top: 4px;
}
.table-scroll {
  overflow-x: auto;
}
.invoice-table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  font-size: 11px;
}
.invoice-table th {
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-3);
  padding: 13px 15px;
  background: #f7faf8;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.invoice-table td {
  padding: 14px 15px;
  border-bottom: 1px solid #eef2ef;
  vertical-align: middle;
}
.invoice-table tr:last-child td {
  border-bottom: 0;
}
.invoice-table td:first-child,
.invoice-table th:first-child {
  padding-left: 23px;
}
.invoice-table td:last-child {
  padding-right: 12px;
  padding-left: 2px;
  width: 36px;
}
.invoice-table tbody tr:hover {
  background: #f9fcfa;
}
.invoice-table strong {
  font-weight: 550;
}
.invoice-link {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--ink-1);
  font-size: 10px;
  font-weight: 550;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.invoice-link small {
  display: block;
  font-size: 9px;
  color: var(--ink-3);
  font-weight: 400;
  margin-top: 3px;
}
.document-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 33px;
  background: #f1f5f2;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: #7b9484;
}
.document-icon .icon {
  width: 14px;
  height: 16px;
}
.customer-cell {
  font-size: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 230px;
  line-height: 1.65;
}
.cell-sub {
  display: block;
  font-size: 9px;
  color: var(--ink-3);
  margin-top: 3px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 3px 7px;
  font-size: 9px;
  white-space: nowrap;
}
.badge > span {
  width: 4px;
  height: 4px;
  background: currentColor;
  border-radius: 50%;
}
.badge.paid {
  background: #eaf5ed;
  color: #46775a;
  border-color: #e0eddf;
}
.badge.issued {
  background: #fbf3e5;
  color: #9c783d;
  border-color: #f0e7d5;
}
.badge.draft {
  background: #eef1f2;
  color: #76818a;
  border-color: #e6e9ec;
}
.quick-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 23px 21px;
  background: #eef3ec;
  border: 1px solid #e4ebe1;
  border-radius: 12px;
  margin-top: 21px;
}
.banner-leaf {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: #e2ecdc;
  border-radius: 11px;
  flex-shrink: 0;
  color: #79976c;
}
.banner-leaf .icon {
  width: 23px;
  height: 23px;
}
.quick-banner > div:nth-child(2) {
  flex: 1;
}
.quick-banner h3 {
  font-size: 12px;
  color: #3c5a42;
}
.quick-banner p {
  font-size: 10px;
  color: #74866f;
  margin-top: 5px;
}
.quick-banner .btn {
  font-size: 10px;
  min-height: 35px;
  padding: 7px 11px;
}
.quick-banner .btn .icon {
  width: 14px;
}
.month-card {
  background: #194f45;
  color: #f1f6f1;
  padding: 22px;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  border: 1px solid #154d43;
}
.month-card:after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  border: 1px solid #cae5d21a;
  border-radius: 50%;
  right: -110px;
  top: 50px;
  pointer-events: none;
}
.month-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 0.8px;
  color: #b5cec2;
}
.month-card-top .icon {
  width: 17px;
}
.month-card > p {
  font-size: 10px;
  color: #adc9bd;
  margin-top: 18px;
}
.month-card > h2 {
  font-size: 29px;
  letter-spacing: -0.5px;
  font-weight: 500;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.month-card h2 small {
  font-size: 20px;
  color: #b5d1c3;
}
.month-card-rows {
  display: grid;
  gap: 10px;
  margin: 24px 0;
  border-bottom: 1px solid #f3fff118;
  padding-bottom: 20px;
  font-size: 10px;
}
.month-card-rows > div {
  display: flex;
  justify-content: space-between;
}
.month-card-rows span {
  color: #b3cbbf;
}
.month-card-rows strong {
  font-weight: 450;
  font-variant-numeric: tabular-nums;
}
.progress-heading {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: #bed2c8;
}
.progress-heading strong {
  font-weight: 500;
  color: #eef7f0;
}
progress {
  height: 5px;
  display: block;
  width: 100%;
  border: 0;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 10px;
  appearance: none;
  background: #38675b;
}
progress::-webkit-progress-bar {
  background: #38675b;
}
progress::-webkit-progress-value {
  background: #b6d69b;
  border-radius: 3px;
}
progress::-moz-progress-bar {
  background: #b6d69b;
}
.month-card-bottom {
  display: flex;
  gap: 6px;
  align-items: center;
  color: #aac8b9;
  font-size: 9px;
  margin-top: 19px;
}
.month-card-bottom .icon {
  width: 12px;
  height: 12px;
}
.export-card {
  padding: 20px 21px;
  margin-top: 18px;
}
.export-icon {
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  background: #f1f4ed;
  color: #73896b;
  border-radius: 8px;
  margin-bottom: 12px;
}
.export-icon .icon {
  width: 17px;
}
.export-card h3 {
  font-size: 13px;
}
.export-card p {
  font-size: 10px;
  color: var(--ink-3);
  margin: 5px 0 15px;
}
.export-card .btn {
  font-size: 11px;
  min-height: 36px;
  padding: 7px 10px;
}
.export-card .btn .icon {
  width: 14px;
}
.template-link {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 20px;
  padding: 0 6px;
  color: #6c8171;
}
.template-link > span {
  width: 28px;
  display: grid;
  place-items: center;
}
.template-link strong {
  display: block;
  font-size: 10px;
  font-weight: 500;
}
.template-link small {
  display: block;
  font-size: 9px;
  color: #839286;
  margin-top: 3px;
}
.template-link > .icon {
  width: 12px;
  margin-left: auto;
}
.app-footer {
  display: flex;
  justify-content: space-between;
  padding: 20px 34px;
  font-size: 9px;
  color: #8a978e;
  border-top: 1px solid var(--border);
  margin-top: 12px;
}
.app-footer > span:first-child {
  font-weight: 650;
  color: #5b7765;
  letter-spacing: 0.2px;
}
.app-footer span span {
  font-weight: 400;
  margin-left: 7px;
  color: #99a49d;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 27px;
}
.page-heading h1 {
  font-size: 25px;
}
.page-heading p {
  margin-top: 5px;
}
.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 19px 22px;
  gap: 20px;
  border-bottom: 1px solid var(--border);
}
.status-tabs {
  display: flex;
  gap: 3px;
  background: #f3f6f3;
  border-radius: 8px;
  padding: 4px;
}
.status-tabs button {
  border: 0;
  padding: 6px 11px;
  border-radius: 5px;
  font-size: 11px;
  background: none;
  color: var(--ink-3);
  min-height: 32px;
  white-space: nowrap;
}
.status-tabs button.active {
  background: var(--bg);
  color: var(--accent);
  box-shadow: 0 1px 4px #1f4b3912;
}
.search-box {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 10px;
  gap: 8px;
  min-width: 240px;
}
.search-box .icon {
  width: 15px;
  color: #8b9b91;
}
.search-box input {
  border: 0;
  outline: none;
  background: none;
  font-size: 10px;
  width: 100%;
  min-width: 0;
}
.table-footer {
  border-top: 1px solid var(--border);
  padding: 14px 23px;
  color: var(--ink-3);
  font-size: 10px;
}
.empty {
  text-align: center;
  padding: 60px 25px;
}
.empty-icon {
  display: grid;
  place-items: center;
  background: var(--panel-2);
  border: 1px solid var(--border);
  width: 58px;
  height: 58px;
  border-radius: 18px;
  color: #8ca695;
  margin: 0 auto 18px;
}
.empty-icon .icon {
  width: 27px;
  height: 27px;
}
.empty h3 {
  font-size: 16px;
}
.empty p {
  font-size: 12px;
  color: var(--ink-3);
  margin: 7px 0 20px;
}
.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 22px;
  align-items: start;
  max-width: 1250px;
}
.settings-main {
  display: grid;
  gap: 20px;
}
.form-card {
  padding: 24px;
}
.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 23px;
}
.section-number {
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 7px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  font-weight: 650;
  flex-shrink: 0;
}
.section-title h3 {
  font-size: 15px;
}
.section-title p {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 4px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.span-2 {
  grid-column: 1/-1;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
.field > span {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-2);
}
input:not(
  [type="radio"],
  [type="checkbox"],
  [type="month"],
  [type="search"],
  [type="file"]
),
select,
textarea {
  border: 1px solid #dce5df;
  background: #fbfdfb;
  border-radius: 7px;
  padding: 10px 12px;
  min-height: 43px;
  color: var(--ink-1);
  width: 100%;
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
  font-size: 12px;
}
.language-picker select {
  border: 0;
  border-radius: 0;
  min-height: auto;
  padding: 2px;
  width: auto;
  background: none;
  font-size: 11px;
}
.month-picker input {
  width: auto;
  min-height: 0;
  font-size: 11px;
  padding: 0;
}
.field input:hover,
.field textarea:hover,
.field select:hover {
  border-color: #b7cabe;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: #549c82;
  box-shadow: 0 0 0 3px #5ca58718;
}
textarea {
  resize: vertical;
  line-height: 1.8;
}
.small-note {
  color: var(--ink-3);
  font-size: 10px;
  line-height: 1.8;
}
.small-note .icon {
  width: 13px;
  height: 13px;
  margin-right: 6px;
}
.upload-panel {
  border-bottom: 1px solid var(--border);
  padding-bottom: 20px;
  margin-bottom: 20px;
}
.upload-panel:last-of-type {
  border: 0;
  margin-bottom: 0;
}
.upload-panel h4 {
  font-size: 12px;
  font-weight: 550;
}
.upload-panel p {
  font-size: 9px;
  color: var(--ink-3);
  margin-top: 4px;
}
.upload-preview {
  height: 135px;
  display: grid;
  place-items: center;
  background: #f7faf6;
  border: 1px dashed #cbdacf;
  border-radius: 10px;
  margin: 14px 0;
  color: #93aa97;
}
.upload-preview > .icon {
  width: 29px;
  height: 29px;
}
.upload-preview img {
  max-height: 115px;
  max-width: 90%;
  object-fit: contain;
}
.upload-preview.has-image {
  background: repeating-conic-gradient(#f4f6f2 0% 25%, #fdfefd 0% 50%) 50%/12px
    12px;
}
.upload-buttons {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.upload-buttons .btn {
  font-size: 11px;
  padding: 6px 12px;
  min-height: 35px;
  cursor: pointer;
}
.upload-buttons .icon {
  width: 15px;
}
.sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  background: #fbfdfbf0;
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  margin-top: 20px;
}
.settings-grid > .sticky-actions {
  margin-top: 0;
}
.sticky-actions > div {
  display: flex;
  gap: 10px;
}
.sticky-actions > span {
  font-size: 10px;
  color: var(--ink-3);
}
.customer-grid {
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.customer-card {
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.customer-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.customer-avatar {
  width: 36px;
  height: 36px;
  background: var(--accent-soft);
  border-radius: 9px;
  color: #6c9a80;
  display: grid;
  place-items: center;
}
.customer-card h3 {
  font-size: 13px;
  margin-bottom: 8px;
}
.customer-card p {
  font-size: 11px;
  color: var(--ink-3);
  margin-bottom: 8px;
  line-height: 1.8;
}
.customer-card .customer-tax {
  font-size: 10px;
  color: var(--accent);
}
.customer-card small {
  font-size: 10px;
  color: var(--ink-3);
}
.customer-card .text-link {
  border-top: 1px solid var(--border);
  padding-top: 15px;
  margin-top: auto;
  margin-top: 20px;
  justify-content: space-between;
  font-size: 11px;
}
.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
  gap: 25px;
  align-items: start;
}
.editor-main {
  display: grid;
  gap: 20px;
}
.editor-preview {
  position: sticky;
  top: 24px;
}
.preview-label {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  letter-spacing: 0.8px;
  color: var(--ink-3);
  padding: 0 4px 12px;
}
.preview-label > span:first-child {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
}
.preview-label i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #69a282;
}
.preview-disclaimer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 9px;
  color: #849389;
  margin-top: 15px;
}
.preview-disclaimer .icon {
  width: 13px;
}
.customer-select {
  margin-bottom: 20px;
}
.invoice-item {
  display: flex;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 18px;
  margin-bottom: 18px;
}
.item-index {
  background: #f0f5f1;
  width: 23px;
  height: 23px;
  border-radius: 5px;
  color: var(--ink-3);
  font-size: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 29px;
}
.item-fields {
  flex: 1;
  min-width: 0;
}
.item-numbers {
  display: grid;
  grid-template-columns: 1fr 0.8fr 1.3fr;
  gap: 10px;
  margin-top: 12px;
}
.item-numbers input {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.item-numbers .field:nth-child(2) input {
  text-align: left;
}
.delete-item {
  align-self: flex-start;
  margin-top: 26px;
  min-width: 27px;
  width: 27px;
  padding: 4px;
}
.delete-item .icon {
  width: 15px;
}
.vat-options {
  border: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
  padding: 0;
  margin: 0 0 22px;
}
.vat-options legend {
  font-size: 11px;
  color: var(--ink-2);
  margin-bottom: 9px;
}
.radio-card {
  display: flex;
  gap: 10px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 9px;
  align-items: center;
  cursor: pointer;
  background: #fafcf9;
}
.radio-card:has(input:checked) {
  border-color: #66a68a;
  background: #eef7f0;
}
.radio-card input {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
}
.radio-card strong {
  font-size: 12px;
  display: block;
  font-weight: 500;
}
.radio-card small {
  font-size: 10px;
  color: var(--ink-3);
}
.preflight h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 15px;
}
.preflight h3 .icon {
  width: 16px;
  color: var(--accent);
}
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 11px;
  margin: 10px 0;
}
.check-row .icon {
  width: 14px;
  height: 16px;
  margin-top: 2px;
}
.check-row.error {
  color: var(--warn);
}
.check-row.success {
  color: var(--up);
}
.check-row a {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  text-decoration: underline;
}
.paper {
  background: #fff;
  border: 1px solid #e0e7e0;
  box-shadow: 0 4px 24px #2a4d3610;
  border-radius: 3px;
  aspect-ratio: 210/297;
  padding: 26px 23px;
  display: flex;
  flex-direction: column;
  font-size: 7px;
  color: #34473d;
  min-height: 500px;
  overflow: hidden;
  position: relative;
}
.paper-head {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 12px;
}
.paper-head img {
  max-width: 70px;
  max-height: 34px;
  object-fit: contain;
  margin-bottom: 10px;
}
.paper-monogram {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  background: #e9f0e7;
  border-radius: 5px;
  color: #53745a;
  margin-bottom: 10px;
}
.paper-monogram .icon {
  width: 18px;
}
.paper-head h4 {
  font-size: 8px;
  font-weight: 650;
  line-height: 1.6;
}
.paper-head p {
  font-size: 6px;
  color: #758279;
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.paper-title {
  text-align: right;
  padding-top: 4px;
  min-width: 0;
}
.paper-title strong {
  display: block;
  color: #176c60;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.paper-title > span {
  display: block;
  font-size: 7px;
  letter-spacing: 1.1px;
  color: #7b9683;
  margin-top: 1px;
}
.paper-title small {
  display: block;
  font-size: 6px;
  margin-top: 14px;
}
.paper-client {
  margin-top: 20px;
  min-height: 64px;
}
.paper-client > span {
  font-size: 5px;
  letter-spacing: 0.5px;
  color: #689078;
  display: block;
  margin-bottom: 4px;
}
.paper-client strong {
  font-size: 8px;
  font-weight: 550;
}
.paper-client p {
  font-size: 6px;
  line-height: 1.8;
  color: #758279;
  overflow-wrap: anywhere;
}
.paper-meta {
  display: flex;
  justify-content: space-between;
  font-size: 6px;
  color: #779182;
  margin-bottom: 8px;
}
.paper-table {
  border-collapse: collapse;
  font-size: 6px;
  width: 100%;
}
.paper-table th {
  background: #eaf1ea;
  border-top: 1px solid #d1dfd1;
  border-bottom: 1px solid #d1dfd1;
  padding: 6px 3px;
  color: #597363;
  text-align: left;
  font-weight: 500;
}
.paper-table th.num {
  text-align: right;
}
.paper-table td {
  padding: 10px 3px;
  border-bottom: 1px solid #edf1ec;
  overflow-wrap: anywhere;
  max-width: 140px;
}
.totals {
  display: grid;
  gap: 10px;
  font-size: 12px;
}
.totals > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.totals span {
  color: var(--ink-3);
}
.totals strong {
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.totals .total-final {
  border-top: 1px solid var(--border);
  margin-top: 5px;
  padding-top: 12px;
  font-size: 14px;
  color: var(--accent);
}
.totals .total-final span {
  color: var(--accent);
}
.totals.compact {
  margin: 16px 0 25px auto;
  width: 70%;
  gap: 5px;
  font-size: 6px;
}
.totals.compact .total-final {
  font-size: 7px;
  padding-top: 6px;
  margin-top: 3px;
}
.paper-signatures {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 15px;
  margin-top: auto;
  padding-top: 25px;
  min-height: 60px;
}
.paper-signatures > span:not(.stamp-space) {
  text-align: center;
  border-top: 1px solid #d5dfd5;
  width: 30%;
  padding-top: 5px;
  font-size: 5px;
  color: #869487;
}
.paper-signatures img {
  width: 53px;
  height: 53px;
  object-fit: contain;
}
.stamp-space {
  width: 45px;
  height: 45px;
}
.paper-bottom {
  font-size: 5px;
  color: #92a094;
  text-align: center;
  border-top: 1px solid #e4eae2;
  padding-top: 10px;
  margin-top: 15px;
}
.report-card {
  display: flex;
  gap: 45px;
  align-items: center;
  padding: 40px;
  margin-bottom: 25px;
}
.report-visual {
  width: 160px;
  height: 190px;
  border: 1px solid #dce7dc;
  border-radius: 12px;
  background: #f0f5ee;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
  color: #81a078;
}
.report-visual > .icon {
  width: 53px;
  height: 53px;
  stroke-width: 1;
}
.report-visual > span {
  font-size: 25px;
  letter-spacing: 2px;
  margin-top: 8px;
  font-weight: 550;
}
.report-visual > i {
  font-size: 8px;
  font-style: normal;
  position: absolute;
  bottom: 15px;
  letter-spacing: 1.5px;
}
.report-card > div:last-child {
  max-width: 650px;
}
.report-card h2 {
  font-size: 21px;
  margin: 8px 0 12px;
}
.report-card p {
  font-size: 12px;
  color: var(--ink-3);
  margin: 10px 0;
  line-height: 1.9;
}
.report-meta {
  display: flex;
  gap: 20px;
  color: var(--accent);
  font-size: 13px;
  margin: 20px 0;
}
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin: 24px 0 14px;
}
.billing-notice {
  display: flex;
  gap: 12px;
  border: 1px solid #e5ddca;
  background: #faf7ed;
  padding: 16px 20px;
  border-radius: 9px;
  color: #87734b;
}
.billing-notice > .icon {
  margin-top: 3px;
}
.billing-notice strong {
  font-size: 12px;
  font-weight: 550;
}
.billing-notice p {
  font-size: 11px;
  margin-top: 4px;
  color: #8b8062;
}
.price-card {
  padding: 25px 22px;
  display: flex;
  flex-direction: column;
}
.price-card.selected {
  border-color: #7ba58b;
  background: #f6faf5;
}
.price-tag {
  font-size: 9px;
  color: #65836a;
  letter-spacing: 0.3px;
  min-height: 24px;
}
.price-card h2 {
  font-size: 16px;
  margin: 11px 0 15px;
}
.price {
  font-size: 36px;
  line-height: 1.4;
  letter-spacing: -1.5px;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
}
.price small {
  font-size: 19px;
  margin-right: 3px;
  color: var(--ink-3);
}
.price-period {
  font-size: 11px;
  color: var(--ink-3);
}
.thb-price {
  font-size: 11px;
  color: var(--accent);
  margin: 14px 0 18px;
  border-top: 1px solid var(--border);
  padding-top: 13px;
}
.price-card ul {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  min-height: 105px;
}
.price-card li {
  display: flex;
  gap: 6px;
  font-size: 10px;
  line-height: 1.8;
  color: var(--ink-3);
  margin: 9px 0;
}
.price-card li .icon {
  width: 12px;
  height: 15px;
  color: #699476;
  margin-top: 2px;
}
.price-card .btn {
  margin-top: auto;
  font-size: 11px;
}
.current-plan {
  display: flex;
  align-items: center;
  gap: 7px;
  justify-content: center;
  color: var(--accent);
  font-size: 11px;
  margin-top: auto;
  min-height: 42px;
  background: #e5f0e3;
  border-radius: 7px;
}
.current-plan .icon {
  width: 15px;
}
.fx-note {
  color: var(--ink-3);
  font-size: 10px;
  margin: 13px 0 25px;
}
.usage-card {
  display: flex;
  align-items: center;
  gap: 45px;
  padding: 27px;
  margin-bottom: 20px;
}
.usage-card > div:first-child {
  margin-right: auto;
}
.usage-card h2 {
  font-size: 16px;
}
.usage-card p {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 4px;
}
.usage-card span {
  font-size: 11px;
  color: var(--ink-3);
  display: block;
}
.usage-card strong {
  font-size: 23px;
  display: block;
  font-weight: 500;
}
.request-row {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 15px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.request-row small {
  color: var(--warn);
}
#toast {
  position: fixed;
  bottom: 25px;
  left: calc(50% + 119px);
  transform: translate(-50%, 20px);
  padding: 13px 20px;
  background: #254c3c;
  color: #f6fbf6;
  border: 1px solid #47755e;
  border-radius: 10px;
  box-shadow: 0 8px 30px #254c3c26;
  z-index: 1000;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s,
    transform 0.2s;
  max-width: min(90vw, 600px);
}
#toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
#toast.toast-error {
  background: #784332;
  border-color: #a67157;
}
#toast .icon {
  width: 16px;
  height: 16px;
}
.modal-open {
  overflow: hidden;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: #19372a65;
  backdrop-filter: blur(3px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 25px;
}
.modal {
  background: var(--bg);
  border: 1px solid #f9fff5a0;
  border-radius: 16px;
  width: 580px;
  max-width: 100%;
  max-height: calc(100vh - 50px);
  overflow: auto;
  box-shadow: 0 20px 80px #142e3440;
}
.modal > header {
  padding: 19px 23px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.modal > header h2 {
  font-size: 16px;
}
.modal-body {
  padding: 23px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 25px;
}
.confirm-copy {
  font-size: 13px;
  line-height: 1.95;
  color: var(--ink-2);
}
.modal-wide {
  width: 1000px;
}
.modal-wide .modal-body {
  padding: 0;
}
.document-toolbar {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
  padding: 16px 23px;
  background: #f4f8f3;
}
.document-toolbar > div {
  display: flex;
  gap: 8px;
  margin-left: auto;
}
.copy-option {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--ink-3);
}
.copy-option input {
  accent-color: var(--accent);
}
.document-frame {
  width: 100%;
  border: 0;
  height: 65vh;
  display: block;
  background: #e9eeef;
}
.auth-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.08fr 1fr;
}
.auth-intro {
  background: #edf3ea;
  position: relative;
  padding: 42px 55px 28px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.auth-intro .brand {
  padding: 0;
}
.auth-copy {
  max-width: 470px;
  margin: 65px auto 0;
  width: 100%;
}
.auth-copy > .eyebrow {
  font-size: 9px;
  letter-spacing: 1.5px;
  color: #6b876e;
}
.auth-copy h1 {
  font-size: 37px;
  letter-spacing: -1.2px;
  line-height: 1.55;
  margin: 15px 0 13px;
  font-weight: 550;
  color: #31513c;
}
.auth-copy > p {
  font-size: 13px;
  color: #7b8e79;
  max-width: 340px;
  line-height: 1.9;
}
.auth-paper {
  width: 290px;
  transform: rotate(-4deg);
  margin: 35px auto 40px;
  position: relative;
}
.auth-paper .paper {
  min-height: 350px;
  padding: 20px 18px;
  box-shadow: 8px 10px 35px #3b5a4120;
}
.auth-paper .paper-title strong {
  font-size: 11px;
}
.auth-paper .paper-head h4 {
  font-size: 6px;
}
.auth-paper .paper-client {
  min-height: 45px;
  margin-top: 12px;
}
.auth-paper .paper-monogram {
  display: none;
}
.auth-paper .paper p,
.auth-paper .paper-table {
  font-size: 5px;
}
.auth-paper .paper-head p {
  font-size: 4px;
}
.auth-paper .totals.compact {
  font-size: 5px;
}
.auth-paper .totals.compact .total-final {
  font-size: 6px;
}
.auth-paper .paper-signatures {
  padding-top: 13px;
  min-height: 30px;
}
.auth-document-label {
  position: absolute;
  bottom: 44px;
  left: -60px;
  transform: rotate(4deg);
  box-shadow: 0 6px 20px #35564113;
  background: #fdfefd;
  border: 1px solid #dee8da;
  border-radius: 8px;
  padding: 12px 17px;
  font-size: 11px;
  color: #5c7c5c;
  display: flex;
  gap: 8px;
  align-items: center;
}
.auth-document-label .icon {
  width: 17px;
  color: #6e9360;
}
.auth-intro-footer {
  margin-top: auto;
  font-size: 9px;
  color: #8b9b86;
  text-align: center;
}
.auth-form-side {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 80px 45px;
  background: #fdfefd;
}
.auth-lang {
  position: absolute;
  top: 36px;
  right: 40px;
}
.auth-form {
  max-width: 340px;
  width: 100%;
}
.auth-form > .eyebrow {
  font-size: 9px;
  letter-spacing: 1.5px;
}
.auth-form h2 {
  font-size: 29px;
  font-weight: 550;
  margin-top: 12px;
}
.auth-form > p {
  color: var(--ink-3);
  font-size: 12px;
  margin: 8px 0 30px;
}
.auth-form .field {
  margin-top: 19px;
}
.auth-form .field input {
  font-size: 13px;
  height: 46px;
}
.auth-form > small {
  font-size: 10px;
  color: var(--ink-3);
}
.auth-submit {
  width: 100%;
  margin-top: 27px;
  justify-content: space-between;
  min-height: 45px;
}
.auth-or {
  border-top: 1px solid var(--border);
  position: relative;
  margin: 29px 0;
}
.auth-or > span {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg);
  color: #91a08f;
  padding: 0 11px;
  font-size: 11px;
}
.auth-form .btn.full {
  font-size: 11px;
}
.auth-switch {
  margin-top: 24px;
  text-align: center;
  color: var(--ink-3);
  font-size: 11px;
}
.auth-switch button {
  font-size: 11px;
  margin-left: 5px;
}
.auth-trust {
  font-size: 10px;
  color: #91a18e;
  margin-top: 60px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.auth-trust .icon {
  width: 13px;
  height: 13px;
}
.form-error {
  background: #fbf0e9;
  color: #9d6748;
  padding: 10px 12px;
  border: 1px solid #efdccc;
  border-radius: 7px;
  font-size: 11px;
}
@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}
@media (min-width: 1600px) {
  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr) 330px;
  }
  .invoice-table td {
    padding-top: 18px;
    padding-bottom: 18px;
  }
  .customer-cell {
    max-width: 330px;
  }
}
@media (max-width: 1240px) {
  .sidebar {
    width: 214px;
    padding-left: 12px;
    padding-right: 12px;
  }
  .app-main {
    margin-left: 214px;
  }
  .topbar {
    padding: 0 25px;
  }
  #main-content {
    padding: 28px 25px;
  }
  .welcome-row {
    align-items: flex-start;
    gap: 12px;
  }
  .welcome-row h1 {
    font-size: 23px;
  }
  .welcome-row .page-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .welcome-row .month-picker {
    order: 2;
  }
  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 17px;
  }
  .card-heading {
    padding: 18px;
  }
  .invoice-table th,
  .invoice-table td {
    padding: 12px 10px;
  }
  .invoice-table td:first-child,
  .invoice-table th:first-child {
    padding-left: 16px;
  }
  .document-icon {
    display: none;
  }
  .stat-card {
    padding: 15px;
  }
  .stat-card > strong {
    font-size: 24px;
  }
  .quick-banner {
    padding: 18px 15px;
    gap: 10px;
  }
  .banner-leaf {
    display: none;
  }
  .quick-banner .btn {
    font-size: 9px;
  }
  .stats-grid {
    gap: 12px;
  }
  .month-card {
    padding: 20px;
  }
  .month-card > h2 {
    font-size: 26px;
  }
  .customer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .settings-grid {
    grid-template-columns: minmax(0, 1fr) 280px;
  }
  .form-card {
    padding: 21px;
  }
  .editor-grid {
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 20px;
  }
  .editor-preview .paper {
    padding: 20px 18px;
  }
  .editor-preview .paper-title strong {
    font-size: 12px;
  }
  .paper-head h4 {
    font-size: 7px;
  }
  .pricing-grid {
    gap: 12px;
  }
  .price-card {
    padding: 20px 16px;
  }
  .price {
    font-size: 30px;
  }
  .topbar-right {
    gap: 15px;
  }
}
@media (max-width: 1040px) {
  .sidebar {
    width: 190px;
  }
  .app-main {
    margin-left: 190px;
  }
  .workspace-switch {
    gap: 7px;
  }
  .workspace-avatar {
    width: 26px;
    height: 26px;
  }
  .nav-item {
    font-size: 11px;
    gap: 8px;
    padding-left: 10px;
  }
  .brand {
    padding-left: 10px;
  }
  .brand > span {
    font-size: 22px;
  }
  .brand img {
    width: 32px;
    height: 32px;
  }
  .topbar-right .online-status {
    display: none;
  }
  .welcome-row h1 {
    font-size: 22px;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-aside {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .export-card {
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 25px;
  }
  .template-link {
    grid-column: 1/-1;
    margin: 0;
  }
  .quick-banner .btn {
    font-size: 11px;
  }
  .invoice-table td {
    padding-top: 16px;
    padding-bottom: 16px;
  }
  .month-card {
    padding: 23px;
  }
  .month-card-rows {
    margin: 17px 0;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .settings-main,
  .branding-card {
    grid-column: 1;
  }
  .branding-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  .branding-card > .section-title,
  .branding-card > .small-note {
    grid-column: 1/-1;
  }
  .upload-panel {
    border: 0;
    margin: 0;
  }
  .branding-card .section-title {
    margin-bottom: 0;
  }
  .editor-grid {
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 16px;
  }
  .editor-main .form-grid {
    grid-template-columns: 1fr;
  }
  .editor-main .span-2 {
    grid-column: 1;
  }
  .item-numbers {
    gap: 7px;
  }
  .editor-main .form-card {
    padding: 18px;
  }
  .editor-preview .paper {
    padding: 18px 15px;
    min-height: 440px;
  }
  .price-card h2 {
    font-size: 14px;
  }
  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .price-card ul {
    min-height: 70px;
  }
  .report-card {
    gap: 27px;
    padding: 30px;
  }
  .report-visual {
    width: 120px;
    height: 160px;
  }
  #toast {
    left: calc(50% + 95px);
  }
}
@media (max-width: 800px) {
  .sidebar {
    transform: translateX(-100%);
    width: 238px;
    transition: transform 0.2s;
    box-shadow: 20px 0 70px #2d523a17;
  }
  .nav-open .sidebar {
    transform: translateX(0);
  }
  .app-main {
    margin-left: 0;
  }
  .topbar {
    height: 63px;
    padding: 0 20px;
    gap: 16px;
  }
  .menu-toggle {
    display: flex;
  }
  .breadcrumb {
    margin-right: auto;
  }
  .topbar-right {
    gap: 11px;
  }
  .topbar-divider,
  .compact-avatar {
    display: none;
  }
  #main-content {
    padding: 25px 20px;
  }
  .welcome-row .page-actions {
    flex-direction: row;
    align-items: center;
  }
  .welcome-row h1 {
    font-size: 21px;
  }
  .welcome-row {
    flex-wrap: wrap;
    margin-bottom: 22px;
  }
  .welcome-row .page-actions {
    width: 100%;
    justify-content: space-between;
    margin-top: 6px;
  }
  .welcome-row .month-picker {
    order: 0;
  }
  .stats-grid {
    gap: 10px;
    margin-bottom: 20px;
  }
  .stat-card {
    padding: 14px 12px;
  }
  .stat-card p {
    font-size: 10px;
  }
  .stat-card > strong {
    font-size: 21px;
  }
  .stat-unit {
    font-size: 8px;
  }
  .editor-grid {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.85fr);
  }
  .editor-main .form-grid {
    grid-template-columns: 1fr;
  }
  .editor-preview .paper {
    padding: 18px 14px;
  }
  .editor-preview .paper-title strong {
    font-size: 10px;
  }
  .editor-preview .paper-head h4 {
    font-size: 6px;
  }
  .editor-preview .paper-head p {
    font-size: 5px;
  }
  .paper-table td {
    max-width: 100px;
  }
  .auth-intro {
    padding: 32px 30px;
  }
  .auth-copy h1 {
    font-size: 28px;
  }
  .auth-copy {
    margin-top: 65px;
  }
  .auth-copy > p {
    font-size: 12px;
  }
  .auth-paper {
    width: 240px;
  }
  .auth-document-label {
    left: -20px;
    font-size: 9px;
    padding: 10px;
  }
  .auth-form-side {
    padding: 80px 30px;
  }
  .auth-form h2 {
    font-size: 25px;
  }
  .auth-intro-footer {
    font-size: 8px;
  }
  .app-footer {
    padding: 20px;
  }
  #toast {
    left: 50%;
  }
  .customer-grid {
    gap: 15px;
    padding: 20px;
  }
  .usage-card {
    gap: 25px;
  }
}
@media (max-width: 620px) {
  h1 {
    font-size: 23px;
  }
  .breadcrumb {
    font-size: 10px;
    gap: 7px;
  }
  .language-picker {
    gap: 4px;
  }
  .topbar {
    padding: 0 15px;
  }
  .demo-strip {
    font-size: 9px;
  }
  #main-content {
    padding: 22px 15px;
  }
  .welcome-row .eyebrow {
    font-size: 9px;
  }
  .welcome-row h1 {
    font-size: 22px;
  }
  .welcome-row p {
    font-size: 11px;
  }
  .welcome-row .btn {
    font-size: 11px;
    padding: 9px 12px;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .stat-card {
    padding: 15px 16px;
  }
  .stat-card > strong {
    font-size: 25px;
  }
  .stat-card p {
    font-size: 11px;
  }
  .stat-icon {
    width: 28px;
    height: 28px;
  }
  .stat-top {
    gap: 10px;
  }
  .dashboard-grid {
    gap: 16px;
  }
  .card-heading {
    padding: 16px;
  }
  .card-heading h2 {
    font-size: 14px;
  }
  .card-heading div > span {
    font-size: 9px;
  }
  .card-heading .text-link {
    font-size: 10px;
    gap: 4px;
  }
  .invoice-table {
    min-width: 540px;
  }
  .invoice-table th {
    font-size: 9px;
  }
  .invoice-table td {
    padding: 13px 10px;
  }
  .invoice-link {
    font-size: 10px;
  }
  .customer-cell {
    max-width: 155px;
  }
  .dashboard-aside {
    grid-template-columns: 1fr;
  }
  .export-card {
    padding: 22px;
  }
  .month-card {
    padding: 25px;
  }
  .month-card > h2 {
    font-size: 33px;
  }
  .month-card p {
    font-size: 12px;
  }
  .month-card-rows,
  .progress-heading {
    font-size: 11px;
  }
  .quick-banner {
    flex-wrap: wrap;
    align-items: center;
  }
  .quick-banner > div:nth-child(2) {
    min-width: 210px;
  }
  .quick-banner .btn {
    width: 100%;
    margin-top: 7px;
  }
  .quick-banner h3 {
    font-size: 13px;
  }
  .quick-banner p {
    font-size: 11px;
  }
  .app-footer > span:last-child {
    max-width: 190px;
    text-align: right;
    font-size: 8px;
  }
  .app-footer > span:last-child span {
    display: none;
  }
  .page-heading {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 21px;
  }
  .page-heading h1 {
    font-size: 23px;
  }
  .page-heading p {
    font-size: 11px;
    max-width: 300px;
  }
  .page-actions {
    flex-wrap: wrap;
  }
  .page-heading .btn {
    font-size: 11px;
  }
  .list-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 15px;
  }
  .status-tabs {
    width: 100%;
    justify-content: space-between;
  }
  .status-tabs button {
    padding: 6px 9px;
    flex: 1;
    font-size: 10px;
    min-height: 36px;
  }
  .search-box {
    min-width: 0;
    padding: 10px;
    min-height: 43px;
  }
  .search-box input {
    font-size: 12px;
  }
  .customer-grid {
    grid-template-columns: 1fr;
    padding: 15px;
  }
  .customer-card {
    padding: 19px;
  }
  .customer-card h3 {
    font-size: 14px;
  }
  .customer-card .text-link {
    font-size: 12px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid .span-2 {
    grid-column: 1;
  }
  .form-card {
    padding: 20px;
  }
  .field > span {
    font-size: 12px;
  }
  .field input,
  .field select,
  .field textarea {
    font-size: 14px !important;
    min-height: 46px;
  }
  .branding-card {
    display: block;
  }
  .branding-card .section-title {
    margin-bottom: 25px;
  }
  .upload-panel {
    margin-bottom: 24px;
  }
  .upload-preview {
    height: 160px;
  }
  .sticky-actions {
    padding: 13px 11px;
    margin-left: -4px;
    margin-right: -4px;
    flex-wrap: wrap;
  }
  .sticky-actions > div {
    width: 100%;
    gap: 9px;
  }
  .sticky-actions .btn {
    flex: 1;
    font-size: 11px;
    padding: 10px;
  }
  .sticky-actions > span:empty {
    display: none;
  }
  .sticky-actions > span {
    font-size: 9px;
  }
  .settings-grid .sticky-actions .btn {
    flex: 0 0 auto;
    margin-left: auto;
  }
  .editor-grid {
    display: flex;
    flex-direction: column;
  }
  .editor-main {
    width: 100%;
  }
  .editor-preview {
    position: static;
    width: 100%;
    max-width: 390px;
    align-self: center;
    padding: 10px 20px;
  }
  .editor-preview .paper {
    min-height: 480px;
    padding: 25px 23px;
  }
  .editor-preview .paper-head h4 {
    font-size: 8px;
  }
  .editor-preview .paper-title strong {
    font-size: 13px;
  }
  .editor-preview .paper-head p {
    font-size: 6px;
  }
  .invoice-item {
    gap: 7px;
  }
  .item-index {
    width: 20px;
    font-size: 9px;
    margin-top: 32px;
  }
  .delete-item {
    margin-top: 30px;
    width: 25px;
    min-width: 25px;
  }
  .item-numbers .field input {
    padding: 10px 7px !important;
  }
  .item-numbers .field > span {
    font-size: 10px;
  }
  .radio-card {
    padding: 12px 10px;
    gap: 7px;
  }
  .radio-card strong {
    font-size: 12px;
  }
  .report-card {
    display: block;
    padding: 25px;
  }
  .report-visual {
    width: 90px;
    height: 105px;
    margin-bottom: 25px;
  }
  .report-visual > .icon {
    width: 32px;
    height: 32px;
  }
  .report-visual > span {
    font-size: 17px;
  }
  .report-visual > i {
    bottom: 9px;
    font-size: 6px;
  }
  .report-card h2 {
    font-size: 20px;
  }
  .report-card p {
    font-size: 11px;
  }
  .pricing-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .price-card {
    padding: 20px 14px;
  }
  .price-card h2 {
    font-size: 14px;
  }
  .price {
    font-size: 29px;
  }
  .price-tag {
    font-size: 9px;
  }
  .price-card li {
    font-size: 10px;
  }
  .price-card .btn {
    font-size: 10px;
    padding: 8px;
  }
  .usage-card {
    flex-wrap: wrap;
    padding: 20px;
    gap: 20px;
  }
  .usage-card > div:first-child {
    width: 100%;
  }
  .usage-card > div:not(:first-child) {
    flex: 1;
  }
  .usage-card strong {
    font-size: 21px;
  }
  .billing-notice {
    padding: 15px;
  }
  .billing-notice strong {
    font-size: 12px;
  }
  .billing-notice p {
    font-size: 11px;
  }
  .fx-note {
    line-height: 1.9;
    font-size: 10px;
  }
  .modal-backdrop {
    padding: 12px;
  }
  .modal {
    max-height: calc(100dvh - 24px);
    border-radius: 13px;
  }
  .modal > header {
    padding: 14px 18px;
  }
  .modal-body {
    padding: 20px;
  }
  .modal-actions .btn {
    min-width: 90px;
  }
  .document-toolbar {
    padding: 13px;
    gap: 10px;
  }
  .document-toolbar > div {
    width: 100%;
    justify-content: space-between;
    margin: 0;
  }
  .document-toolbar .btn {
    font-size: 11px;
    padding: 8px;
  }
  .copy-option {
    font-size: 10px;
  }
  .document-frame {
    height: 66dvh;
  }
  .auth-layout {
    display: block;
  }
  .auth-intro {
    padding: 26px 25px 30px;
    min-height: 260px;
  }
  .auth-intro .brand > span {
    font-size: 21px;
  }
  .auth-copy {
    margin: 30px 0 0;
  }
  .auth-copy > .eyebrow {
    font-size: 8px;
  }
  .auth-copy h1 {
    font-size: 27px;
    margin: 10px 0;
    line-height: 1.4;
  }
  .auth-copy h1 br {
    display: none;
  }
  .auth-copy > p {
    font-size: 12px;
    max-width: 100%;
  }
  .auth-paper,
  .auth-intro-footer {
    display: none;
  }
  .auth-form-side {
    padding: 60px 25px 30px;
    min-height: 550px;
  }
  .auth-form {
    max-width: 380px;
  }
  .auth-form h2 {
    font-size: 26px;
  }
  .auth-lang {
    top: 17px;
    right: 24px;
  }
  .auth-form > p {
    margin-bottom: 25px;
  }
  .auth-trust {
    margin-top: 35px;
  }
  .auth-form .field input {
    font-size: 16px;
  }
  .auth-form .btn {
    font-size: 13px;
    min-height: 46px;
  }
  #toast {
    font-size: 12px;
    bottom: 18px;
    width: max-content;
    max-width: calc(100vw - 30px);
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* The paper's A4 aspect ratio must not impose a minimum width on small phones. */
@media (max-width: 620px) {
  .editor-preview .paper {
    width: 100%;
    min-width: 0;
    aspect-ratio: auto;
  }
  .paper-head {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  }
  .editor-preview .paper-title strong {
    font-size: 11px;
    white-space: normal;
  }
  .paper-table {
    table-layout: fixed;
  }
  .totals.compact {
    width: 90%;
  }
}

/* VAT evidence and review use the existing form surfaces and button hierarchy. */
.vat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 1fr);
  gap: 22px;
  align-items: start;
}
.vat-section {
  margin-top: 20px;
}
.vat-notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #faf4e8;
  border: 1px solid #e8ddc5;
  border-radius: 10px;
  color: #866538;
  padding: 16px 18px;
  font-size: 12px;
  margin-bottom: 20px;
}
.vat-notice.success {
  background: var(--accent-soft);
  border-color: #c8dfd0;
  color: var(--accent);
}
.vat-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 11px;
  white-space: nowrap;
  color: var(--warn);
  background: #faf6ed;
}
.vat-badge .icon {
  width: 15px;
  height: 15px;
}
.vat-approved {
  background: var(--accent-soft);
  color: var(--accent);
}
.vat-rejected {
  background: #f9ede8;
  color: var(--down);
}
.vat-form-fields {
  margin-top: 20px;
}
.vat-layout h2 {
  font-size: 16px;
  margin-bottom: 10px;
}
.vat-certificate {
  display: flex;
  align-items: center;
  gap: 13px;
  border: 1px dashed #c4d6c9;
  background: var(--panel-2);
  border-radius: 10px;
  padding: 17px;
  margin: 20px 0;
  flex-wrap: wrap;
}
.vat-certificate > .icon {
  width: 28px;
  height: 28px;
  color: var(--accent);
}
.vat-certificate > div {
  flex: 1;
  min-width: 0;
}
.vat-certificate strong {
  display: block;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.vat-certificate small {
  display: block;
  font-size: 10px;
  color: var(--ink-3);
  margin-top: 4px;
}
.vat-certificate .btn {
  font-size: 11px;
}
.vat-submit-actions {
  border-top: 1px solid var(--border);
  margin-top: 22px;
  padding-top: 20px;
  display: grid;
  gap: 12px;
}
.vat-submit-actions .btn {
  justify-self: start;
}
.vat-meta {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
  font-size: 11px;
  margin: 20px 0;
}
.vat-meta span {
  color: var(--ink-3);
}
.vat-meta small {
  font-size: 10px;
  overflow-wrap: anywhere;
}
.vat-official {
  border-top: 1px solid var(--border);
  margin: 20px 0;
  padding-top: 20px;
  font-size: 12px;
}
.vat-official h3 {
  font-size: 13px;
  margin-bottom: 10px;
}
.vat-official > p {
  margin: 8px 0;
  line-height: 1.8;
}
.vat-official > small {
  font-size: 10px;
  color: var(--ink-3);
}
.vat-registry-record {
  margin-top: 12px;
  padding: 12px;
  background: var(--panel-2);
  border-radius: 8px;
  font-size: 11px;
}
.vat-registry-record span {
  display: block;
  font-size: 10px;
  color: var(--ink-3);
  margin-top: 4px;
}
.vat-company-link {
  margin-top: 20px;
}
.vat-review-note {
  padding: 14px;
  border-radius: 8px;
  background: var(--panel-2);
  font-size: 12px;
}
.vat-review-note strong {
  font-size: 11px;
}
.vat-review-note p {
  white-space: pre-wrap;
  margin-top: 8px;
  overflow-wrap: anywhere;
}
.vat-review-detail {
  padding: 24px;
}
.vat-review-heading {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: start;
}
.vat-review-heading p {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 6px;
}
.vat-review-detail form {
  margin-top: 24px;
}
.vat-review-detail form > p {
  margin-top: 10px;
}
.vat-history {
  margin-top: 25px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
  font-size: 12px;
}
.vat-history summary {
  cursor: pointer;
  color: var(--accent);
}
.vat-history > div {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.vat-history small {
  display: block;
  color: var(--ink-3);
  font-size: 10px;
  margin-top: 5px;
}
.vat-history p {
  font-size: 11px;
  margin-top: 5px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
@media (max-width: 800px) {
  .vat-layout {
    grid-template-columns: 1fr;
  }
  .vat-review-heading {
    flex-wrap: wrap;
  }
  .vat-certificate .btn {
    width: 100%;
  }
  .vat-notice {
    font-size: 12px;
  }
  .vat-review-detail {
    padding: 19px;
  }
}

/* Reviewer navigation remains reachable on shorter laptop and phone screens. */
.sidebar {
  overflow-y: auto;
}
.sidebar-bottom {
  flex-shrink: 0;
}

/* Payment checkout consumes the workspace surface and spacing tokens. */
.payment-entitlements {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  margin-bottom: 24px;
}
.payment-entitlements small {
  display: block;
  color: var(--ink-3);
  margin-bottom: 8px;
}
.payment-entitlements h2 {
  margin: 0 0 8px;
}
.payment-entitlements p {
  margin: 0;
}
.payment-entitlements strong {
  display: block;
  font-size: 30px;
  font-variant-numeric: tabular-nums;
}
.payment-entitlements strong span {
  font-size: 14px;
  font-weight: 400;
}
.payment-checkout {
  text-align: center;
}
.payment-checkout p {
  color: var(--ink-3);
  line-height: 1.6;
}
.payment-checkout .payment-total,
.payment-total {
  color: var(--ink-1);
  font-size: 36px;
  font-weight: 600;
  margin: 12px 0;
  font-variant-numeric: tabular-nums;
}
.payment-plan-name {
  font-weight: 600;
}
.payment-qr {
  width: 280px;
  max-width: 100%;
  margin: 20px auto;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.payment-qr img {
  display: block;
  width: 100%;
  height: auto;
}
.payment-status {
  padding: 12px;
  border-radius: 10px;
  background: var(--bg);
  font-weight: 600;
}
.payment-checkout .payment-success {
  color: var(--accent);
}
.payment-order-id {
  font-size: 12px;
  overflow-wrap: anywhere;
}
.payment-history-row {
  gap: 16px;
  flex-wrap: wrap;
}
.payment-history-row small {
  display: block;
  overflow-wrap: anywhere;
}
@media (max-width: 600px) {
  .payment-entitlements {
    align-items: flex-start;
    flex-direction: column;
    padding: 20px;
  }
  .payment-history-row {
    align-items: flex-start;
  }
  .payment-checkout .modal-actions {
    flex-wrap: wrap;
  }
}
