:root {
  color-scheme: dark;
  --bg: #070605;
  --bg-soft: #100d0a;
  --night: #14110f;
  --panel: rgba(24, 19, 16, 0.66);
  --panel-strong: rgba(13, 10, 8, 0.92);
  --panel-soft: rgba(255, 247, 235, 0.055);
  --line: rgba(247, 230, 203, 0.11);
  --line-strong: rgba(247, 230, 203, 0.22);
  --text: #fff7eb;
  --muted: #b4a898;
  --gold: #d9a867;
  --gold-deep: #ad823f;
  --copper: #c97957;
  --sage: #9fb29c;
  --paper: #f4f1ea;
  --paper-text: #18130f;
  --danger: #e38b76;
  --shadow: 0 1.4rem 4.2rem rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 77% 5%, rgba(217, 168, 103, 0.17), transparent 27rem),
    radial-gradient(circle at 24% 92%, rgba(159, 178, 156, 0.1), transparent 24rem),
    linear-gradient(145deg, #0a0806 0%, #070605 48%, #120e0a 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.42;
  background-image:
    linear-gradient(rgba(255, 247, 235, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 247, 235, 0.026) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.8), transparent 78%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  position: relative;
  display: grid;
  min-height: 100vh;
  grid-template-columns: 19.5rem minmax(0, 1fr);
}

.app-shell > * {
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 247, 235, 0.04), transparent 42%),
    rgba(6, 5, 4, 0.84);
  padding: 1.45rem;
  backdrop-filter: blur(22px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  border: 1px solid rgba(255, 247, 235, 0.1);
  border-radius: 10px;
  background: rgba(255, 247, 235, 0.04);
  padding: 0.85rem;
}

.brand-mark {
  display: grid;
  width: 4.8rem;
  height: 3.25rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: #050403;
  box-shadow: inset 0 0 0 1px rgba(255, 247, 235, 0.08);
}

.brand img {
  width: 3.8rem;
  height: auto;
}

.brand-copy {
  display: grid;
  gap: 0.15rem;
}

.brand-copy strong {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
}

.brand-copy span {
  color: rgba(255, 247, 235, 0.58);
  font-size: 0.78rem;
  font-weight: 700;
}

.nav {
  display: grid;
  gap: 0.5rem;
  margin-top: 2.3rem;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  border: 1px solid transparent;
  border-radius: 10px;
  color: rgba(255, 247, 235, 0.68);
  font-weight: 650;
  padding: 0.92rem 0.95rem;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease, transform 180ms ease;
}

.nav-item:hover,
.nav-item.is-active {
  border-color: rgba(217, 168, 103, 0.28);
  background:
    linear-gradient(135deg, rgba(217, 168, 103, 0.15), rgba(255, 247, 235, 0.035));
  color: var(--text);
}

.nav-item:hover {
  transform: translateX(2px);
}

.nav-item.is-active::after {
  position: absolute;
  right: 0.72rem;
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 0 1.2rem rgba(217, 168, 103, 0.72);
  content: "";
}

.ui-icon {
  width: 1.08rem;
  height: 1.08rem;
  flex: 0 0 auto;
  color: currentColor;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.nav-item .ui-icon {
  color: var(--gold);
}

.sidebar-foot {
  display: grid;
  gap: 0.8rem;
  margin-top: auto;
}

.theme-toggle {
  display: flex;
  width: 100%;
  min-height: 2.8rem;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid rgba(217, 168, 103, 0.24);
  border-radius: 10px;
  background: rgba(217, 168, 103, 0.075);
  color: var(--gold);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 850;
  padding: 0.7rem 0.8rem;
  text-align: left;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.theme-toggle:hover {
  border-color: rgba(217, 168, 103, 0.48);
  background: rgba(217, 168, 103, 0.12);
}

.theme-toggle .ui-icon {
  transition: transform 240ms ease;
}

.theme-toggle span {
  color: inherit !important;
  font-size: inherit !important;
}

html[data-theme="light"] .theme-toggle .ui-icon {
  transform: rotate(35deg);
}

.privacy-card {
  display: grid;
  gap: 0.45rem;
  border: 1px solid rgba(217, 168, 103, 0.18);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(217, 168, 103, 0.1), rgba(255, 247, 235, 0.025));
  padding: 1rem;
}

.privacy-card .ui-icon {
  color: var(--gold);
}

.pwa-card {
  display: grid;
  gap: 0.55rem;
  border: 1px solid rgba(247, 230, 203, 0.08);
  border-radius: 10px;
  background: rgba(255, 247, 235, 0.03);
  padding: 0.85rem;
}

.connection-pill {
  display: inline-flex !important;
  width: fit-content;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid rgba(159, 178, 156, 0.34);
  border-radius: 999px;
  background: rgba(159, 178, 156, 0.1);
  color: #cfe3cb !important;
  font-size: 0.74rem !important;
  font-weight: 900;
  padding: 0.28rem 0.55rem;
}

.connection-pill::before {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.connection-pill.is-offline {
  border-color: rgba(227, 139, 118, 0.38);
  background: rgba(227, 139, 118, 0.12);
  color: #ffd8cc !important;
}

.pwa-action {
  width: 100%;
  border: 1px solid rgba(217, 168, 103, 0.3);
  border-radius: 8px;
  background: rgba(217, 168, 103, 0.09);
  color: var(--gold);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 850;
  padding: 0.58rem 0.7rem;
}

.pwa-action:hover {
  border-color: rgba(217, 168, 103, 0.56);
  background: rgba(217, 168, 103, 0.14);
}

.pwa-action[hidden] {
  display: none;
}

.sidebar-foot strong,
.sidebar-foot span,
.sidebar-foot a {
  display: block;
}

.sidebar-foot strong {
  font-size: 0.95rem;
}

.sidebar-foot span,
.sidebar-foot a {
  color: var(--muted);
  font-size: 0.84rem;
}

.logout-link {
  display: inline-flex !important;
  align-items: center;
  gap: 0.5rem;
  width: fit-content;
  padding: 0.35rem 0.15rem;
}

.main {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: clamp(1.25rem, 3vw, 2.7rem);
}

.mobile-tabbar {
  display: none;
}

.app-toast {
  position: fixed;
  z-index: 70;
  right: 1rem;
  bottom: 1rem;
  max-width: min(26rem, calc(100vw - 2rem));
  border: 1px solid rgba(217, 168, 103, 0.32);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(217, 168, 103, 0.18), rgba(255, 247, 235, 0.055)),
    rgba(7, 6, 5, 0.94);
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.45);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.35;
  padding: 0.85rem 1rem;
  backdrop-filter: blur(20px);
}

.app-toast[hidden],
.quick-sheet[hidden],
.quick-sheet-backdrop[hidden] {
  display: none;
}

.quick-sheet-backdrop {
  position: fixed;
  z-index: 55;
  inset: 0;
  background: rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(7px);
}

.quick-sheet {
  position: fixed;
  z-index: 60;
  right: 1rem;
  bottom: 1rem;
  width: min(28rem, calc(100vw - 2rem));
  border: 1px solid rgba(247, 230, 203, 0.14);
  border-radius: 18px;
  background:
    radial-gradient(circle at 80% 5%, rgba(217, 168, 103, 0.18), transparent 14rem),
    linear-gradient(180deg, rgba(255, 247, 235, 0.075), rgba(255, 247, 235, 0.032)),
    rgba(8, 7, 6, 0.96);
  box-shadow: 0 1.6rem 5rem rgba(0, 0, 0, 0.58);
  padding: 1rem;
  backdrop-filter: blur(24px);
}

.quick-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.85rem;
}

.quick-sheet-head strong,
.quick-sheet-head span {
  display: block;
}

.quick-sheet-head strong {
  font-size: 1rem;
}

.quick-sheet-head span {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 0.2rem;
}

.sheet-close {
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  border: 1px solid rgba(247, 230, 203, 0.12);
  border-radius: 999px;
  background: rgba(255, 247, 235, 0.04);
  color: var(--text);
  cursor: pointer;
  transform: rotate(45deg);
}

.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.9rem;
}

.quick-action-grid a,
.quick-action-grid button {
  display: flex;
  min-height: 4.2rem;
  align-items: center;
  gap: 0.7rem;
  border: 1px solid rgba(247, 230, 203, 0.1);
  border-radius: 13px;
  background:
    linear-gradient(145deg, rgba(255, 247, 235, 0.06), rgba(255, 247, 235, 0.018)),
    rgba(12, 9, 7, 0.72);
  color: var(--text);
  cursor: pointer;
  font-weight: 850;
  padding: 0.85rem;
  text-align: left;
}

.quick-action-grid a:hover,
.quick-action-grid button:hover {
  border-color: rgba(217, 168, 103, 0.34);
  background:
    linear-gradient(145deg, rgba(217, 168, 103, 0.13), rgba(255, 247, 235, 0.026)),
    rgba(12, 9, 7, 0.82);
}

.quick-action-grid .ui-icon {
  color: var(--gold);
}

.quick-action-grid button[hidden] {
  display: none;
}

.tab-item {
  display: grid;
  min-width: 0;
  place-items: center;
  gap: 0.26rem;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 247, 235, 0.56);
  cursor: pointer;
  font-size: 0.66rem;
  font-weight: 850;
  padding: 0.54rem 0.35rem;
}

.tab-item .ui-icon {
  width: 1.1rem;
  height: 1.1rem;
}

.tab-item.is-active {
  background:
    linear-gradient(135deg, rgba(217, 168, 103, 0.19), rgba(255, 247, 235, 0.05));
  color: var(--text);
}

.tab-item.is-active .ui-icon {
  color: var(--gold);
}

.tab-primary {
  position: relative;
  color: #170f08;
  transform: translateY(-0.42rem);
}

.tab-primary::before {
  position: absolute;
  inset: 0.08rem;
  border-radius: 16px;
  background: linear-gradient(180deg, #f0c77d, #d9a867);
  box-shadow: 0 0.9rem 2rem rgba(217, 168, 103, 0.32);
  content: "";
}

.tab-primary > * {
  position: relative;
  z-index: 1;
}

.tab-primary .ui-icon {
  color: #170f08 !important;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.4rem;
}

.topbar > * {
  min-width: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.topbar h1 {
  margin: 0;
  font-family: "Hanken Grotesk", Inter, sans-serif;
  font-size: clamp(2.25rem, 4.8vw, 5.25rem);
  line-height: 0.95;
}

.topbar p {
  max-width: min(44rem, 100%);
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
  overflow-wrap: break-word;
}

.dashboard-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(247, 230, 203, 0.12);
  border-radius: 14px;
  background:
    radial-gradient(circle at 76% 22%, rgba(217, 168, 103, 0.2), transparent 21rem),
    linear-gradient(135deg, rgba(255, 247, 235, 0.085), rgba(255, 247, 235, 0.02)),
    rgba(10, 8, 6, 0.78);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
  padding: clamp(1.25rem, 3vw, 2rem);
}

.dashboard-hero::after {
  position: absolute;
  right: clamp(1rem, 4vw, 3rem);
  bottom: -4.8rem;
  width: clamp(13rem, 22vw, 19rem);
  height: clamp(13rem, 22vw, 19rem);
  border: 1px solid rgba(217, 168, 103, 0.2);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(217, 168, 103, 0.08), transparent),
    repeating-linear-gradient(90deg, rgba(255, 247, 235, 0.1) 0 1px, transparent 1px 15px);
  content: "";
  opacity: 0.52;
  transform: rotate(-14deg);
}

.hero-copy,
.hero-actions {
  position: relative;
  z-index: 1;
  min-width: 0;
  max-width: 100%;
}

.hero-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  margin-bottom: 0.95rem;
  text-transform: uppercase;
}

.hero-actions {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.button {
  display: inline-flex;
  min-height: 2.9rem;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: rgba(255, 247, 235, 0.03);
  color: var(--text);
  cursor: pointer;
  font-weight: 750;
  padding: 0.8rem 1.1rem;
  text-align: center;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
  white-space: normal;
}

.button.primary {
  border-color: rgba(217, 168, 103, 0.8);
  background: linear-gradient(180deg, #efc478, #d9a867);
  color: #1a1007;
  box-shadow: 0 0.9rem 2.2rem rgba(217, 168, 103, 0.2);
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary:hover {
  box-shadow: 0 1.1rem 2.8rem rgba(217, 168, 103, 0.28);
}

.button.ghost:hover,
.button.small:hover {
  border-color: rgba(217, 168, 103, 0.48);
  background: rgba(217, 168, 103, 0.08);
}

.button.danger {
  border-color: rgba(227, 139, 118, 0.48);
  background: rgba(227, 139, 118, 0.12);
  color: #ffd8cc;
}

.button.small {
  min-height: 2.35rem;
  color: var(--gold);
  font-size: 0.88rem;
  padding: 0.55rem 0.8rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  min-width: 0;
  margin-bottom: 1rem;
}

.metric,
.panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 247, 235, 0.055), rgba(255, 247, 235, 0.018)),
    var(--panel);
  box-shadow: var(--shadow);
}

.metric {
  position: relative;
  display: grid;
  min-height: 10rem;
  align-content: end;
  gap: 0.55rem;
  overflow: hidden;
  padding: 1.15rem;
  transition: border-color 180ms ease, transform 180ms ease;
}

.metric::after {
  position: absolute;
  inset: auto -2rem -2.5rem auto;
  width: 8rem;
  height: 8rem;
  border-radius: 999px;
  background: rgba(217, 168, 103, 0.08);
  content: "";
}

.metric:hover {
  border-color: rgba(217, 168, 103, 0.3);
  transform: translateY(-2px);
}

.metric-icon {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: grid;
  width: 2.45rem;
  height: 2.45rem;
  place-items: center;
  border: 1px solid rgba(217, 168, 103, 0.22);
  border-radius: 10px;
  background: rgba(217, 168, 103, 0.09);
  color: var(--gold);
}

.metric span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.metric strong {
  position: relative;
  z-index: 1;
  font-size: clamp(1.28rem, 1.7vw, 2rem);
  line-height: 1.05;
}

.metric small {
  position: relative;
  z-index: 1;
  color: rgba(255, 247, 235, 0.5);
  font-size: 0.78rem;
  font-weight: 700;
}

.metric-open {
  border-color: rgba(159, 178, 156, 0.18);
}

.metric-open .metric-icon {
  border-color: rgba(159, 178, 156, 0.28);
  background: rgba(159, 178, 156, 0.09);
  color: var(--sage);
}

.panel {
  padding: 1.25rem;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  min-width: 0;
  margin-bottom: 1rem;
}

.quick-card {
  display: grid;
  gap: 0.45rem;
  min-height: 8.2rem;
  align-content: end;
  border: 1px solid rgba(247, 230, 203, 0.1);
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(255, 247, 235, 0.055), rgba(255, 247, 235, 0.014)),
    rgba(12, 9, 7, 0.68);
  color: var(--text);
  padding: 1rem;
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.quick-card:hover {
  border-color: rgba(217, 168, 103, 0.32);
  background:
    linear-gradient(145deg, rgba(217, 168, 103, 0.1), rgba(255, 247, 235, 0.018)),
    rgba(12, 9, 7, 0.78);
  transform: translateY(-2px);
}

.quick-card > span {
  display: grid;
  width: 2.3rem;
  height: 2.3rem;
  place-items: center;
  border-radius: 10px;
  background: rgba(217, 168, 103, 0.11);
  color: var(--gold);
}

.quick-card strong {
  font-size: 1rem;
}

.quick-card small {
  color: var(--muted);
  line-height: 1.35;
}

.reminder-panel {
  margin-bottom: 1rem;
}

.reminder-list {
  display: grid;
  gap: 0.7rem;
}

.reminder-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid rgba(227, 139, 118, 0.16);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(227, 139, 118, 0.09), rgba(255, 247, 235, 0.018)),
    rgba(7, 6, 5, 0.24);
  padding: 0.95rem;
}

.reminder-card strong,
.reminder-card small,
.reminder-kicker {
  display: block;
}

.reminder-card strong {
  margin-top: 0.18rem;
}

.reminder-card small {
  color: var(--muted);
  margin-top: 0.25rem;
}

.reminder-kicker {
  color: #f0a999;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.panel-head,
.items-head,
.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.panel-head {
  border-bottom: 1px solid var(--line);
  margin: -0.15rem 0 1rem;
  padding-bottom: 1rem;
}

.panel-head h2,
.items-head h2,
.settings-list h2 {
  margin: 0;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.22rem;
  font-weight: 500;
}

.panel-head span,
.panel-head a {
  color: var(--muted);
  font-size: 0.9rem;
}

.panel-head p {
  color: var(--muted);
  font-size: 0.86rem;
  margin: 0.3rem 0 0;
}

.panel-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--gold) !important;
  font-weight: 800;
}

.table {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid rgba(247, 230, 203, 0.07);
  border-radius: 10px;
  background: rgba(7, 6, 5, 0.22);
}

.table-row {
  display: grid;
  grid-template-columns: 1fr 1.6fr 0.9fr 0.8fr 0.9fr;
  gap: 1rem;
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: rgba(255, 247, 235, 0.82);
  padding: 0.95rem 1rem;
}

a.table-row {
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

a.table-row:hover {
  background: rgba(217, 168, 103, 0.07);
  color: var(--text);
  transform: translateX(3px);
}

.table-row:last-child {
  border-bottom: 0;
}

.table-head {
  background: rgba(255, 247, 235, 0.035);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.invoice-row span:first-child {
  color: var(--gold);
  font-weight: 850;
}

.invoice-row span:last-child {
  font-weight: 850;
  text-align: right;
}

mark {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 99px;
  background: rgba(217, 168, 103, 0.13);
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 850;
  padding: 0.25rem 0.48rem;
}

.status::before {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.status-paid {
  background: rgba(159, 178, 156, 0.14);
  color: #bfd1bb;
}

.status-open {
  background: rgba(217, 168, 103, 0.14);
  color: #f4c98d;
}

.status-sent {
  background: rgba(217, 168, 103, 0.14);
  color: var(--gold);
}

.status-draft {
  background: rgba(255, 247, 235, 0.09);
  color: rgba(255, 247, 235, 0.72);
}

.status-cancelled {
  background: rgba(227, 139, 118, 0.14);
  color: #f0a999;
}

.empty-state,
.alert,
.success {
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  padding: 1rem;
}

.empty-state {
  display: grid;
  min-height: 13rem;
  place-items: center;
  text-align: center;
}

.empty-state .ui-icon {
  width: 2.2rem;
  height: 2.2rem;
  color: var(--gold);
}

.empty-state strong {
  color: var(--text);
  display: block;
  margin-top: 0.8rem;
}

.empty-state span {
  display: block;
  margin-top: 0.35rem;
}

.alert {
  border-color: rgba(227, 139, 118, 0.4);
  background: rgba(227, 139, 118, 0.08);
  color: #ffd8cc;
  margin-bottom: 1rem;
}

.success {
  border-color: rgba(217, 168, 103, 0.44);
  background: rgba(217, 168, 103, 0.1);
  color: var(--text);
  margin-bottom: 1rem;
}

.invoice-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(23rem, 0.85fr);
  gap: 1.25rem;
  align-items: start;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

label {
  display: grid;
  gap: 0.45rem;
  color: rgba(255, 247, 235, 0.9);
  font-size: 0.9rem;
  font-weight: 700;
}

.span-2 {
  grid-column: span 2;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(247, 230, 203, 0.18);
  border-radius: 7px;
  outline: 0;
  background: rgba(7, 6, 5, 0.52);
  color: var(--text);
  padding: 0.78rem 0.85rem;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(217, 168, 103, 0.72);
  box-shadow: 0 0 0 3px rgba(217, 168, 103, 0.12);
}

textarea {
  resize: vertical;
}

.form-help {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.4;
}

.receipt-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid rgba(159, 178, 156, 0.22);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(159, 178, 156, 0.11), rgba(255, 247, 235, 0.02)),
    rgba(7, 6, 5, 0.22);
  padding: 0.9rem;
}

.receipt-current > div:first-child {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.65rem;
  min-width: 0;
}

.receipt-current .ui-icon {
  grid-row: span 2;
  color: var(--sage);
}

.receipt-current strong,
.receipt-current span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.receipt-current span {
  color: var(--muted);
  font-size: 0.78rem;
}

.receipt-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.receipt-remove {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #ffd8cc;
  font-size: 0.8rem;
}

.receipt-remove input {
  width: auto;
}

.items-head {
  border-top: 1px solid var(--line);
  margin-top: 1.15rem;
  padding-top: 1.15rem;
}

.items-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
}

.items-tools select {
  width: min(100%, 15rem);
}

.items {
  display: grid;
  gap: 0.6rem;
  margin: 1rem 0 1.2rem;
}

.item-row {
  display: grid;
  grid-template-columns: 2fr 0.65fr 0.75fr 0.9fr 0.65fr;
  gap: 0.55rem;
}

.item-row-small-business {
  grid-template-columns: 2fr 0.65fr 0.75fr 0.9fr;
}

.form-hint {
  border: 1px solid rgba(217, 168, 103, 0.26);
  border-radius: 7px;
  background: rgba(217, 168, 103, 0.08);
  color: rgba(255, 247, 235, 0.82);
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0 0 1.2rem;
  padding: 0.85rem;
}

.actions {
  border-top: 1px solid var(--line);
  margin-top: 1.15rem;
  padding-top: 1.15rem;
}

.preview {
  position: sticky;
  top: 1.25rem;
}

.paper-preview {
  min-height: 46rem;
  border-radius: 6px;
  border-top: 8px solid #070605;
  background: #fbfaf7;
  color: var(--paper-text);
  padding: 1.9rem;
  box-shadow: 0 1.6rem 4rem rgba(0, 0, 0, 0.34);
}

.preview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  border-bottom: 1px solid rgba(20, 17, 15, 0.18);
  padding-bottom: 1.7rem;
}

.preview-header img {
  width: 5.1rem;
  filter: invert(1);
  background: #070605;
  padding: 0.45rem;
}

.preview-header p {
  color: rgba(20, 17, 15, 0.56);
  font-size: 0.72rem;
  font-weight: 700;
  margin: 0.55rem 0 0;
}

.preview-header h3 {
  margin: 0;
  color: #111;
  font-family: "Hanken Grotesk", Inter, sans-serif;
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: 0;
  text-align: right;
  text-transform: uppercase;
}

.preview-header > div:last-child p {
  color: #ad823f;
  font-size: 0.86rem;
  font-weight: 800;
  text-align: right;
}

.preview-meta-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(10rem, 0.9fr);
  gap: 2rem;
  margin-top: 2rem;
}

.preview-recipient span {
  color: #ad823f;
  display: block;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  margin-bottom: 0.65rem;
  text-transform: uppercase;
}

.preview-recipient strong {
  display: block;
  font-size: 1rem;
}

.preview-recipient p {
  color: #17120e;
  font-size: 0.88rem;
  line-height: 1.45;
  margin: 0.45rem 0 0;
  min-height: 3.8rem;
  white-space: pre-line;
}

.preview-meta {
  display: grid;
  gap: 0;
  margin: 0;
}

.preview-meta div {
  display: grid;
  grid-template-columns: 1fr auto;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid rgba(20, 17, 15, 0.09);
  padding: 0 0 0.62rem;
  margin-bottom: 0.62rem;
}

.preview-meta dt {
  color: rgba(24, 19, 15, 0.56);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.preview-meta dd {
  color: #17120e;
  font-size: 0.76rem;
  font-weight: 800;
  margin: 0;
  text-align: right;
}

.preview-subject {
  border-left: 5px solid #ad823f;
  color: #17120e;
  font-size: 0.92rem;
  font-weight: 800;
  margin: 2rem 0 1.2rem;
  padding-left: 0.85rem;
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
  color: #17120e;
  font-size: 0.76rem;
}

.preview-table th,
.preview-table td {
  border-bottom: 1px solid rgba(20, 17, 15, 0.12);
  padding: 0.72rem 0.35rem;
  text-align: right;
  vertical-align: top;
}

.preview-table th:first-child,
.preview-table td:first-child {
  text-align: left;
}

.preview-table th {
  border-bottom-color: #ad823f;
  color: #17120e;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.preview-empty td {
  color: rgba(24, 19, 15, 0.48);
  text-align: left;
}

.preview-sums {
  display: grid;
  width: min(100%, 17rem);
  gap: 0;
  margin: 1.3rem 0 0 auto;
}

.preview-sums div {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgba(20, 17, 15, 0.11);
  color: #17120e;
  font-size: 0.8rem;
  padding: 0.58rem 0;
}

.preview-total {
  border-bottom: 0 !important;
  font-size: 0.98rem !important;
  font-weight: 900;
  padding-top: 0.85rem !important;
}

.preview-total strong {
  color: #ad823f;
}

.preview-tax-notice {
  color: #ad823f;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.35;
  margin: 1.5rem 0 0;
}

.customer-table .table-row {
  grid-template-columns: 0.45fr 1.45fr 1.1fr 1.45fr 1fr;
}

.expense-panel .expense-row {
  grid-template-columns: 0.7fr 1.35fr 1fr 0.75fr 0.8fr 0.8fr 0.7fr;
}

.expense-row strong,
.expense-row small {
  display: block;
}

.receipt-chip {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid rgba(247, 230, 203, 0.1);
  border-radius: 999px;
  background: rgba(255, 247, 235, 0.055);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  padding: 0.25rem 0.5rem;
}

.receipt-chip .ui-icon {
  width: 0.82rem;
  height: 0.82rem;
}

.receipt-chip.has-receipt {
  border-color: rgba(159, 178, 156, 0.32);
  background: rgba(159, 178, 156, 0.12);
  color: #cfe3cb;
}

.expense-row small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.35;
  margin-top: 0.2rem;
}

.tax-row {
  grid-template-columns: 1fr 1fr 1fr 1fr;
}

.category-row {
  grid-template-columns: 1fr 0.6fr;
}

.year-filter {
  min-width: 8rem;
}

.year-filter select {
  min-height: 2.8rem;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.row-actions a {
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 800;
}

.customer-form,
.settings-form {
  max-width: 58rem;
}

.settings-divider {
  height: 1px;
  background: var(--line);
  margin: 1.4rem 0;
}

.email-signature-setting {
  display: grid;
  gap: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(7, 6, 5, 0.22);
  padding: 1rem;
}

.email-signature-setting-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.email-signature-setting-head > div {
  display: grid;
  gap: 0.25rem;
}

.email-signature-setting-head strong {
  color: var(--text);
}

.email-signature-setting-head span {
  color: var(--muted);
  font-size: 0.84rem;
}

.signature-toggle {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(217, 168, 103, 0.07);
  padding: 0.85rem;
  cursor: pointer;
}

.signature-toggle input[type="checkbox"] {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--gold);
}

.signature-toggle span {
  display: grid;
  gap: 0.2rem;
}

.signature-toggle strong {
  color: var(--text);
}

.signature-toggle small,
.signature-preview-hint {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
}

.email-signature-fields {
  border-top: 1px solid var(--line);
  padding-top: 0.9rem;
}

.email-signature-preview {
  overflow-x: auto;
  border-radius: 9px;
  background: #fff;
  padding: 1.25rem;
}

.signature-preview-hint {
  margin: -0.25rem 0 0;
}

.settings-mini-list {
  display: grid;
  gap: 0.7rem;
  margin-top: 1.1rem;
}

.settings-mini-list > div {
  display: grid;
  gap: 0.25rem;
  border: 1px solid rgba(247, 230, 203, 0.09);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(217, 168, 103, 0.08), rgba(255, 247, 235, 0.015)),
    rgba(7, 6, 5, 0.24);
  padding: 0.9rem;
}

.settings-mini-list strong {
  color: var(--text);
}

.settings-mini-list span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.settings-list dl {
  display: grid;
  gap: 0.8rem;
  margin: 0;
}

.settings-list div {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.8rem;
}

.settings-list dt {
  color: var(--muted);
  font-weight: 700;
}

.settings-list dd {
  margin: 0;
}

.danger-zone {
  border-color: rgba(227, 139, 118, 0.24);
  margin-top: 1rem;
}

.danger-zone .panel-head {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.danger-zone h2 {
  color: #f0a999;
}

.login-screen,
.setup-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 1.25rem;
}

.login-card,
.setup-card {
  width: min(100%, 28rem);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  padding: 2rem;
}

.login-card img,
.setup-logo {
  width: 7.2rem;
}

.login-card h1,
.setup-card h1 {
  margin: 1.6rem 0 0.6rem;
  font-size: 2rem;
}

.login-card p,
.setup-card p {
  color: var(--muted);
  line-height: 1.55;
}

.login-card {
  display: grid;
  gap: 1rem;
}

pre,
code {
  border-radius: 6px;
  background: rgba(255, 247, 235, 0.08);
  color: var(--gold);
  white-space: pre-wrap;
}

pre {
  padding: 1rem;
}

.print-screen {
  background:
    radial-gradient(circle at 68% 0%, rgba(217, 168, 103, 0.18), transparent 28rem),
    #111;
  color: #17120e;
}

.print-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 1rem;
}

.print-actions form {
  margin: 0;
}

.mail-panel {
  width: min(210mm, calc(100% - 2rem));
  margin: 0 auto 1rem;
  color: var(--text);
}

.mail-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mail-log-topbar h1 {
  font-size: clamp(2.6rem, 4vw, 4.5rem);
}

.mail-log-panel {
  padding: clamp(1rem, 1.8vw, 1.45rem);
}

.mail-log-count {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(217, 168, 103, 0.22);
  border-radius: 999px;
  background: rgba(217, 168, 103, 0.08);
  color: var(--gold) !important;
  font-size: 0.76rem !important;
  font-weight: 850;
  padding: 0.4rem 0.65rem;
  white-space: nowrap;
}

.app-view-mail_log .mail-log-filters {
  display: grid;
  grid-template-columns: minmax(18rem, 1.7fr) minmax(9rem, 0.7fr) minmax(10rem, 0.7fr) auto;
  gap: 0.85rem;
  align-items: end;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.1rem;
  padding-bottom: 1.1rem;
}

.mail-log-filters label {
  min-width: 0;
}

.mail-filter-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.mail-filter-actions .button {
  min-width: 6.4rem;
}

.mail-log-list {
  overflow-x: auto;
  border: 1px solid rgba(247, 230, 203, 0.07);
  border-radius: 10px;
  background: rgba(7, 6, 5, 0.22);
  scrollbar-color: rgba(217, 168, 103, 0.32) transparent;
}

.mail-log-entry {
  border-bottom: 1px solid var(--line);
  transition: background 160ms ease;
}

.mail-log-entry:hover {
  background: rgba(217, 168, 103, 0.035);
}

.mail-log-entry:last-child {
  border-bottom: 0;
}

.app-view-mail_log .mail-log-grid {
  display: grid;
  grid-template-columns: 0.72fr 0.55fr 1.2fr minmax(11rem, 1.45fr) 1.05fr 0.75fr;
  gap: 0.85rem;
  align-items: center;
  min-width: 53rem;
  color: rgba(255, 247, 235, 0.82);
  padding: 1rem;
}

.mail-log-grid > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.mail-log-grid strong,
.mail-log-grid small {
  display: block;
}

.mail-log-grid small {
  color: var(--muted);
  margin-top: 0.25rem;
}

.mail-log-time strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.mail-log-time small {
  font-variant-numeric: tabular-nums;
}

.mail-log-head {
  background: rgba(255, 247, 235, 0.035);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.mail-recipient {
  color: var(--gold);
}

.mail-recipient strong {
  font-size: 0.86rem;
  line-height: 1.35;
}

.mail-kind {
  border: 1px solid rgba(217, 168, 103, 0.18);
  background: rgba(217, 168, 103, 0.08);
  color: var(--gold);
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.mail-kind-reminder {
  border-color: rgba(227, 139, 118, 0.24);
  background: rgba(227, 139, 118, 0.1);
  color: #f0a999;
}

.mail-delivery-stack {
  display: grid;
  justify-items: start;
  gap: 0.38rem;
}

.transport-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  background: rgba(255, 247, 235, 0.07);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.2;
  padding: 0.3rem 0.5rem;
}

.transport-badge::before {
  width: 0.42rem;
  height: 0.42rem;
  flex: 0 0 auto;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.transport-badge.is-secure {
  background: rgba(159, 178, 156, 0.14);
  color: #bfd1bb;
}

.transport-badge.is-insecure {
  background: rgba(227, 139, 118, 0.14);
  color: #f0a999;
}

.mail-log-copy {
  border-top: 1px solid rgba(247, 230, 203, 0.06);
  background: rgba(255, 247, 235, 0.025);
  color: var(--muted);
  padding: 0.85rem 1rem;
}

.mail-log-copy summary {
  width: fit-content;
  color: var(--gold);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
}

.mail-log-copy div {
  max-width: 52rem;
  color: rgba(255, 247, 235, 0.72);
  line-height: 1.6;
  padding: 1rem 0 0;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: var(--muted);
  margin-top: 1rem;
}

.mail-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.status-edit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.85rem;
  align-items: end;
  border: 1px solid rgba(217, 168, 103, 0.14);
  border-radius: 10px;
  background: rgba(217, 168, 103, 0.06);
  margin-bottom: 1rem;
  padding: 1rem;
}

.send-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.send-status-grid article {
  display: grid;
  gap: 0.25rem;
  border: 1px solid rgba(247, 230, 203, 0.09);
  border-radius: 10px;
  background: rgba(255, 247, 235, 0.035);
  padding: 0.9rem;
}

.send-status-grid span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.send-status-grid strong {
  color: var(--text);
  font-size: 0.95rem;
}

.send-status-grid small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.mail-actions form {
  display: grid;
  gap: 0.85rem;
  border: 1px solid rgba(247, 230, 203, 0.09);
  border-radius: 10px;
  background: rgba(7, 6, 5, 0.25);
  padding: 1rem;
}

.mail-actions textarea {
  min-height: 13rem;
  line-height: 1.5;
}

.invoice-page {
  position: relative;
  display: block;
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto 2rem;
  overflow: hidden;
  background: #fbfaf7;
  border-top: 7mm solid #070605;
  box-shadow: 0 2rem 5rem rgba(0, 0, 0, 0.46);
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.invoice-document {
  display: flex;
  min-height: 297mm;
  flex-direction: column;
  padding: 17mm 18mm 13mm;
}

.invoice-header {
  display: flex;
  justify-content: space-between;
  gap: 14mm;
  border-bottom: 0.35mm solid rgba(20, 17, 15, 0.18);
  padding-bottom: 12mm;
}

.invoice-brand-block img {
  width: 31mm;
  filter: invert(1);
  background: #070605;
  padding: 3mm;
}

.invoice-brand-block p {
  color: rgba(20, 17, 15, 0.62);
  font-size: 8.4pt;
  font-weight: 700;
  margin: 3mm 0 0;
}

.invoice-title-block {
  text-align: right;
}

.invoice-header h1 {
  margin: 0;
  color: #111;
  font-family: "Hanken Grotesk", Inter, sans-serif;
  font-size: 30pt;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.invoice-title-block p {
  color: #ad823f;
  font-size: 12pt;
  font-weight: 800;
  margin: 3mm 0 0;
}

.invoice-meta {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16mm;
  margin-top: 15mm;
}

.recipient span {
  color: #ad823f;
  display: block;
  font-size: 7.8pt;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin-bottom: 3mm;
  text-transform: uppercase;
}

.recipient strong {
  display: block;
  font-size: 13pt;
}

.recipient p,
.invoice-meta p {
  margin: 2mm 0 0;
  line-height: 1.45;
}

.invoice-meta dl {
  margin: 0;
}

.invoice-meta dl div {
  display: grid;
  grid-template-columns: 1fr auto;
  justify-content: space-between;
  gap: 8mm;
  border-bottom: 0.18mm solid rgba(20, 17, 15, 0.08);
  padding: 0 0 2.4mm;
  margin-bottom: 2.5mm;
}

.invoice-meta dt {
  color: rgba(24, 19, 15, 0.52);
  font-size: 6.45pt;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.invoice-meta dd {
  margin: 0;
  color: rgba(24, 19, 15, 0.76);
  font-size: 8.1pt;
  font-weight: 650;
  text-align: right;
  white-space: nowrap;
}

.invoice-subject {
  border-left: 2mm solid #ad823f;
  color: #111;
  font-size: 11pt;
  font-weight: 800;
  margin: 13mm 0 7mm;
  padding-left: 4mm;
}

.invoice-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 8.8pt;
}

.invoice-table th,
.invoice-table td {
  border-bottom: 0.22mm solid rgba(20, 17, 15, 0.13);
  padding: 3.2mm 1.3mm;
  text-align: right;
  vertical-align: top;
}

.invoice-table th:first-child,
.invoice-table td:first-child {
  text-align: left;
}

.invoice-table th {
  border-bottom: 0.35mm solid #ad823f;
  color: #111;
  font-size: 7pt;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.invoice-sums {
  display: grid;
  width: 74mm;
  gap: 0;
  align-self: flex-end;
  margin-top: 8mm;
  font-size: 8.6pt;
}

.invoice-sums div {
  display: flex;
  justify-content: space-between;
  border-bottom: 0.2mm solid rgba(20, 17, 15, 0.11);
  padding: 2.2mm 0;
}

.invoice-sums .grand {
  border-bottom: 0;
  color: #111;
  font-size: 12pt;
  font-weight: 900;
  padding-top: 3.5mm;
}

.invoice-sums .grand strong {
  color: #d9a867;
}

.invoice-afterword {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16mm;
  border-top: 0.25mm solid rgba(20, 17, 15, 0.14);
  margin-top: 8mm;
  padding-top: 6mm;
}

.invoice-bank,
.invoice-note {
  display: grid;
  gap: 1.5mm;
  font-size: 8pt;
  line-height: 1.42;
}

.invoice-bank strong,
.invoice-note strong {
  color: #ad823f;
  font-size: 7.4pt;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.invoice-note p {
  margin: 0;
}

.tax-notice {
  color: #ad823f;
  font-weight: 800;
}

.invoice-footer {
  display: grid;
  grid-template-columns: 0.82fr 0.82fr 1.36fr;
  gap: 7mm;
  border-top: 0.25mm solid rgba(173, 130, 63, 0.44);
  margin-top: auto;
  padding-top: 6mm;
}

.invoice-footer div {
  display: grid;
  align-content: start;
  gap: 1.2mm;
  font-size: 6.45pt;
  line-height: 1.35;
}

.invoice-footer strong {
  color: #111;
  font-size: 7.4pt;
  font-weight: 900;
}

@media (max-width: 1100px) {
  .app-shell,
  .invoice-workspace {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .preview {
    position: static;
  }

  .sidebar {
    height: auto;
  }

  .nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 1rem;
  }

  .nav-item {
    justify-content: center;
  }

  .sidebar-foot {
    margin-top: 1.4rem;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions {
    flex-wrap: wrap;
  }

  .app-view-mail_log .mail-log-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mail-filter-search,
  .mail-filter-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .app-body {
    padding-bottom: calc(5.8rem + env(safe-area-inset-bottom));
  }

  .main,
  .sidebar {
    padding: 1rem;
  }

  .main {
    padding-bottom: 1.1rem;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(6, 5, 4, 0.9);
  }

  .privacy-card {
    display: none;
  }

  .sidebar .nav {
    display: flex;
    gap: 0.45rem;
    width: calc(100vw - 2rem);
    max-width: 100%;
    margin-top: 0.8rem;
    overflow-x: auto;
    padding-bottom: 0.15rem;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar .nav::-webkit-scrollbar {
    display: none;
  }

  .sidebar .nav-item {
    flex: 0 0 auto;
    justify-content: center;
    gap: 0.45rem;
    min-height: 2.65rem;
    border-color: rgba(247, 230, 203, 0.09);
    background: rgba(255, 247, 235, 0.035);
    font-size: 0.82rem;
    padding: 0.68rem 0.78rem;
    white-space: nowrap;
  }

  .sidebar .nav-item:hover {
    transform: none;
  }

  .sidebar .nav-item.is-active::after {
    right: 0.42rem;
    top: 0.42rem;
  }

  .sidebar-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-top: 0.8rem;
  }

  .pwa-card {
    flex: 1 1 auto;
    grid-template-columns: auto 1fr;
    align-items: center;
    border-color: rgba(247, 230, 203, 0.06);
    background: rgba(255, 247, 235, 0.018);
    padding: 0.58rem;
  }

  .connection-pill {
    font-size: 0.68rem !important;
    padding: 0.22rem 0.46rem;
  }

  .pwa-action {
    justify-self: end;
    width: auto;
    min-height: 2rem;
    padding: 0.42rem 0.62rem;
  }

  .logout-link {
    flex: 0 0 auto;
  }

  .logout-link span {
    display: none;
  }

  .mobile-tabbar {
    position: fixed;
    z-index: 40;
    right: 0.8rem;
    bottom: 0.75rem;
    left: 0.8rem;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.22rem;
    border: 1px solid rgba(247, 230, 203, 0.14);
    border-radius: 18px;
    background:
      linear-gradient(180deg, rgba(255, 247, 235, 0.08), rgba(255, 247, 235, 0.035)),
      rgba(7, 6, 5, 0.92);
    box-shadow: 0 1.1rem 3rem rgba(0, 0, 0, 0.48);
    padding: 0.35rem;
    padding-bottom: calc(0.35rem + env(safe-area-inset-bottom));
    backdrop-filter: blur(24px);
  }

  .quick-sheet {
    right: 0.8rem;
    bottom: calc(5.6rem + env(safe-area-inset-bottom));
    left: 0.8rem;
    width: auto;
    border-radius: 18px;
  }

  .quick-action-grid {
    grid-template-columns: 1fr 1fr;
  }

  .app-toast {
    right: 0.8rem;
    bottom: calc(5.6rem + env(safe-area-inset-bottom));
    left: 0.8rem;
    max-width: none;
  }

  .is-offline .mobile-tabbar {
    border-color: rgba(227, 139, 118, 0.28);
  }

  .topbar,
  .topbar-actions,
  .hero-actions,
  .panel-head,
  .items-head,
  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .brand {
    width: 100%;
  }

  .topbar h1 {
    font-size: clamp(1.95rem, 9vw, 2.35rem);
    overflow-wrap: normal;
    word-break: normal;
  }

  .topbar p {
    font-size: 0.95rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
  }

  .dashboard-hero {
    overflow: hidden;
  }

  .button {
    width: 100%;
    min-width: 0;
  }

  .metric-grid,
  .quick-grid {
    grid-template-columns: 1fr;
  }

  .metric {
    min-height: 8.8rem;
  }

  .table {
    display: grid;
    gap: 0.75rem;
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .invoice-panel .table-head {
    display: none;
  }

  .invoice-panel .invoice-row {
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: 1fr;
    gap: 0.7rem;
    border: 1px solid rgba(247, 230, 203, 0.1);
    border-radius: 12px;
    background:
      linear-gradient(145deg, rgba(255, 247, 235, 0.055), rgba(255, 247, 235, 0.014)),
      rgba(12, 9, 7, 0.72);
    padding: 1rem;
  }

  .invoice-panel .invoice-row:hover {
    transform: none;
  }

  .invoice-panel .invoice-row span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: rgba(255, 247, 235, 0.86);
    font-weight: 700;
    text-align: right;
  }

  .invoice-panel .invoice-row span::before {
    color: var(--muted);
    content: attr(data-label);
    flex: 0 0 auto;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .invoice-panel .invoice-row span:first-child {
    align-items: flex-start;
    color: var(--gold);
    font-size: 1.05rem;
    padding-bottom: 0.15rem;
  }

  .invoice-panel .invoice-row span:first-child::before {
    padding-top: 0.12rem;
  }

  .invoice-panel .invoice-row span:last-child {
    color: var(--text);
    font-size: 1rem;
    text-align: right;
  }

  .expense-panel .table-head,
  .tax-table .table-head {
    display: none;
  }

  .expense-panel .expense-row,
  .tax-table .tax-row,
  .tax-table .category-row {
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: 1fr;
    gap: 0.7rem;
    border: 1px solid rgba(247, 230, 203, 0.1);
    border-radius: 12px;
    background:
      linear-gradient(145deg, rgba(255, 247, 235, 0.055), rgba(255, 247, 235, 0.014)),
      rgba(12, 9, 7, 0.72);
    padding: 1rem;
  }

  .expense-panel .expense-row span,
  .tax-table .tax-row span,
  .tax-table .category-row span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: rgba(255, 247, 235, 0.86);
    font-weight: 700;
    text-align: right;
  }

  .expense-panel .expense-row span::before,
  .tax-table .tax-row span::before,
  .tax-table .category-row span::before {
    color: var(--muted);
    content: attr(data-label);
    flex: 0 0 auto;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .expense-row small {
    text-align: right;
  }

  .receipt-current,
  .receipt-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .receipt-actions .button {
    width: 100%;
  }

  .mail-actions,
  .send-status-grid,
  .status-edit,
  .mail-metrics,
  .app-view-mail_log .mail-log-filters {
    grid-template-columns: 1fr;
  }

  .mail-filter-search,
  .mail-filter-actions {
    grid-column: auto;
  }

  .mail-filter-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mail-filter-actions .button:only-child {
    grid-column: 1 / -1;
  }

  .mail-log-list {
    display: grid;
    gap: 0.75rem;
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .app-view-mail_log .mail-log-head {
    display: none;
  }

  .mail-log-entry {
    border: 1px solid rgba(247, 230, 203, 0.1);
    border-radius: 12px;
    background:
      linear-gradient(145deg, rgba(255, 247, 235, 0.055), rgba(255, 247, 235, 0.014)),
      rgba(12, 9, 7, 0.72);
  }

  .app-view-mail_log .mail-log-grid {
    grid-template-columns: 1fr;
    gap: 0.7rem;
    min-width: 0;
  }

  .mail-log-grid > span {
    display: grid;
    grid-template-columns: 6.4rem minmax(0, 1fr);
    align-items: flex-start;
    gap: 0.25rem 1rem;
    text-align: right;
  }

  .mail-delivery-stack {
    display: grid !important;
    grid-template-columns: 6.4rem minmax(0, 1fr);
    justify-content: initial !important;
    justify-items: end;
  }

  .mail-log-grid > span::before {
    grid-column: 1;
    grid-row: 1 / span 3;
    color: var(--muted);
    content: attr(data-label);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-align: left;
    text-transform: uppercase;
  }

  .mail-log-grid > span > strong,
  .mail-log-grid > span > small,
  .mail-log-grid > span > mark,
  .mail-log-grid > span > a {
    grid-column: 2;
    justify-self: end;
  }

  .pagination {
    flex-wrap: wrap;
  }

  .items-tools,
  .items-tools select {
    width: 100%;
  }

  .reminder-card {
    align-items: stretch;
    flex-direction: column;
  }

  .mail-panel {
    width: calc(100% - 2rem);
  }

  .metric-grid,
  .form-grid,
  .item-row,
  .table-row,
  .customer-table .table-row {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f5efe5;
  --bg-soft: #fffaf3;
  --night: #e9dfd2;
  --panel: rgba(255, 253, 249, 0.86);
  --panel-strong: #fffdf9;
  --panel-soft: rgba(80, 55, 28, 0.045);
  --line: rgba(60, 42, 24, 0.13);
  --line-strong: rgba(60, 42, 24, 0.24);
  --text: #211810;
  --muted: #75695d;
  --gold: #a8742f;
  --gold-deep: #7d531e;
  --copper: #a95738;
  --sage: #60785e;
  --danger: #ad523d;
  --shadow: 0 1.2rem 3.6rem rgba(67, 45, 23, 0.12);
}

html[data-theme="light"] body {
  background:
    radial-gradient(circle at 77% 5%, rgba(217, 168, 103, 0.2), transparent 28rem),
    radial-gradient(circle at 24% 92%, rgba(159, 178, 156, 0.14), transparent 25rem),
    linear-gradient(145deg, #fbf7f0 0%, #f5efe5 48%, #efe4d6 100%);
  color: var(--text);
}

html[data-theme="light"] body::before {
  opacity: 0.32;
  background-image:
    linear-gradient(rgba(62, 43, 24, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(62, 43, 24, 0.04) 1px, transparent 1px);
}

html[data-theme="light"] .sidebar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), transparent 42%),
    rgba(250, 246, 239, 0.9);
}

html[data-theme="light"] .brand,
html[data-theme="light"] .pwa-card,
html[data-theme="light"] .theme-toggle,
html[data-theme="light"] .sheet-close,
html[data-theme="light"] .button {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.64);
}

html[data-theme="light"] .button.primary {
  border-color: rgba(168, 116, 47, 0.62);
  background: linear-gradient(180deg, #efc478, #d8a45e);
  color: #25170a;
}

html[data-theme="light"] .brand-copy span,
html[data-theme="light"] .nav-item,
html[data-theme="light"] .tab-item,
html[data-theme="light"] .metric small,
html[data-theme="light"] .table-row,
html[data-theme="light"] .mail-log-grid,
html[data-theme="light"] label,
html[data-theme="light"] .form-hint,
html[data-theme="light"] .mail-log-copy div {
  color: var(--muted);
}

html[data-theme="light"] .nav-item:hover,
html[data-theme="light"] .nav-item.is-active,
html[data-theme="light"] .tab-item.is-active {
  background: linear-gradient(135deg, rgba(168, 116, 47, 0.14), rgba(255, 255, 255, 0.7));
  color: var(--text);
}

html[data-theme="light"] .privacy-card,
html[data-theme="light"] .dashboard-hero,
html[data-theme="light"] .quick-card,
html[data-theme="light"] .reminder-card,
html[data-theme="light"] .receipt-current,
html[data-theme="light"] .settings-mini-list > div,
html[data-theme="light"] .email-signature-setting,
html[data-theme="light"] .send-status-grid article,
html[data-theme="light"] .mail-actions form,
html[data-theme="light"] .status-edit {
  background:
    linear-gradient(145deg, rgba(168, 116, 47, 0.07), rgba(255, 255, 255, 0.62)),
    rgba(255, 253, 249, 0.8);
}

html[data-theme="light"] .quick-sheet,
html[data-theme="light"] .app-toast {
  border-color: var(--line-strong);
  background:
    radial-gradient(circle at 80% 5%, rgba(217, 168, 103, 0.18), transparent 14rem),
    rgba(255, 253, 249, 0.96);
  box-shadow: 0 1.4rem 4rem rgba(67, 45, 23, 0.2);
  color: var(--text);
}

html[data-theme="light"] .quick-action-grid a,
html[data-theme="light"] .quick-action-grid button,
html[data-theme="light"] .invoice-panel .invoice-row,
html[data-theme="light"] .expense-panel .expense-row,
html[data-theme="light"] .tax-table .tax-row,
html[data-theme="light"] .tax-table .category-row,
html[data-theme="light"] .mail-log-entry {
  border-color: var(--line);
  background:
    linear-gradient(145deg, rgba(168, 116, 47, 0.055), rgba(255, 255, 255, 0.72)),
    #fffdf9;
  color: var(--text);
}

html[data-theme="light"] .quick-action-grid a:hover,
html[data-theme="light"] .quick-action-grid button:hover,
html[data-theme="light"] .quick-card:hover {
  background:
    linear-gradient(145deg, rgba(168, 116, 47, 0.12), rgba(255, 255, 255, 0.84)),
    #fffdf9;
}

html[data-theme="light"] .table,
html[data-theme="light"] .mail-log-list {
  border-color: var(--line);
  background: rgba(255, 253, 249, 0.7);
}

html[data-theme="light"] .table-head,
html[data-theme="light"] .mail-log-head {
  background: rgba(79, 55, 30, 0.055);
  color: #675847;
}

html[data-theme="light"] a.table-row:hover,
html[data-theme="light"] .mail-log-entry:hover {
  background: rgba(168, 116, 47, 0.07);
  color: var(--text);
}

html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  border-color: rgba(60, 42, 24, 0.2);
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
}

html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder {
  color: #948779;
}

html[data-theme="light"] .status-paid,
html[data-theme="light"] .transport-badge.is-secure,
html[data-theme="light"] .connection-pill,
html[data-theme="light"] .receipt-chip.has-receipt {
  color: #4f6c4c !important;
}

html[data-theme="light"] .status-open,
html[data-theme="light"] .status-sent {
  color: #8a5d1d;
}

html[data-theme="light"] .status-draft {
  background: rgba(60, 42, 24, 0.08);
  color: #675847;
}

html[data-theme="light"] .status-cancelled,
html[data-theme="light"] .transport-badge.is-insecure,
html[data-theme="light"] .reminder-kicker,
html[data-theme="light"] .danger-zone h2,
html[data-theme="light"] .receipt-remove {
  color: #a64d38;
}

html[data-theme="light"] .alert,
html[data-theme="light"] .button.danger {
  border-color: rgba(173, 82, 61, 0.3);
  background: rgba(173, 82, 61, 0.08);
  color: #873b2b;
}

html[data-theme="light"] .mail-log-copy,
html[data-theme="light"] pre,
html[data-theme="light"] code {
  background: rgba(79, 55, 30, 0.055);
}

html[data-theme="light"] .login-card,
html[data-theme="light"] .setup-card {
  box-shadow: var(--shadow);
}

html[data-theme="light"] .theme-toggle {
  border-color: rgba(168, 116, 47, 0.28);
  background: rgba(168, 116, 47, 0.08);
  color: var(--gold-deep);
}

html[data-theme="light"] .mobile-tabbar {
  border-color: var(--line-strong);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(250, 246, 239, 0.76)),
    rgba(255, 253, 249, 0.94);
  box-shadow: 0 1rem 2.6rem rgba(67, 45, 23, 0.18);
}

@media (max-width: 720px) {
  .sidebar .theme-toggle {
    width: 2.65rem;
    min-height: 2.65rem;
    flex: 0 0 2.65rem;
    justify-content: center;
    padding: 0.6rem;
  }

  .sidebar .theme-toggle [data-theme-label] {
    display: none;
  }

  html[data-theme="light"] .sidebar {
    border-bottom-color: var(--line);
    background: rgba(250, 246, 239, 0.94);
  }
}

/* OLSTE Workspace 2027
   A restrained finance workspace: open rails, continuous summaries and precise data rows. */
:root {
  --bg: #090a0a;
  --bg-soft: #0d0f0f;
  --night: #111313;
  --panel: #0d0f0f;
  --panel-strong: #111313;
  --panel-soft: rgba(255, 255, 255, 0.035);
  --line: rgba(255, 255, 255, 0.11);
  --line-strong: rgba(255, 255, 255, 0.21);
  --text: #f4f4f1;
  --muted: #979b99;
  --gold: #efb332;
  --gold-deep: #c88b10;
  --copper: #d37a55;
  --sage: #77b762;
  --paper: #fff;
  --paper-text: #151717;
  --danger: #ff645b;
  --warning: #f0ae20;
  --shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.24);
  --radius-sm: 7px;
  --radius-md: 11px;
  --radius-lg: 14px;
}

html,
body {
  background: var(--bg);
  font-family: Inter, "SF Pro Text", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
}

body::before {
  opacity: 0.16;
  background:
    radial-gradient(circle at 82% 0%, rgba(239, 179, 50, 0.08), transparent 34rem),
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: auto, 100% 72px;
  mask-image: linear-gradient(#000, transparent 82%);
}

::selection {
  background: rgba(239, 179, 50, 0.28);
  color: var(--text);
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.app-shell {
  grid-template-columns: 13.25rem minmax(0, 1fr);
}

.sidebar {
  border-right-color: var(--line);
  background: rgba(7, 8, 8, 0.96);
  padding: 1.45rem 1rem;
  backdrop-filter: blur(28px);
}

.brand {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0.55rem 0.5rem 1.15rem;
}

.brand-mark {
  width: 4.35rem;
  height: 2.9rem;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.brand img {
  width: 4.2rem;
}

.brand-copy strong {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
}

.brand-copy span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.nav {
  gap: 0.24rem;
  margin-top: 1rem;
}

.nav-item {
  min-height: 2.9rem;
  gap: 0.72rem;
  border-radius: var(--radius-sm);
  color: #aeb1af;
  font-size: 0.86rem;
  font-weight: 590;
  padding: 0.72rem 0.78rem;
}

.nav-item .ui-icon {
  width: 1.15rem;
  height: 1.15rem;
  color: #c2c5c3;
  stroke-width: 1.65;
}

.nav-item:hover,
.nav-item.is-active {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  transform: none;
}

.nav-item.is-active {
  box-shadow: inset 3px 0 0 var(--gold);
}

.nav-item.is-active .ui-icon {
  color: var(--gold);
}

.nav-item.is-active::after {
  display: none;
}

.sidebar-foot .app-switch {
  width: 100%;
  min-width: 0;
  margin: 0;
  border-color: rgba(217, 168, 103, .38);
  border-left: 3px solid var(--gold);
  background: linear-gradient(135deg, rgba(217, 168, 103, .16), rgba(217, 168, 103, .035));
  color: var(--text);
  box-shadow: 0 .7rem 1.8rem rgba(0, 0, 0, .24);
}
.sidebar-foot .app-switch > span { min-width:0;display:grid;gap:.08rem;overflow:hidden; }
.sidebar-foot .app-switch strong { font-size:.84rem; }
.sidebar-foot .app-switch strong,.sidebar-foot .app-switch small { overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.sidebar-foot .app-switch small { color:var(--gold);font-size:.56rem;font-weight:750;letter-spacing:.07em;text-transform:uppercase; }
.sidebar-foot .app-switch:hover { border-color:rgba(217,168,103,.72);background:linear-gradient(135deg,rgba(217,168,103,.24),rgba(217,168,103,.07));transform:translateY(-1px); }

.sidebar-foot {
  gap: 0.65rem;
}

.privacy-card {
  display: none;
}

.theme-toggle {
  min-height: 2.55rem;
  border-color: var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  color: #bfc2c0;
  font-size: 0.76rem;
  font-weight: 650;
  padding: 0.62rem 0.72rem;
}

.theme-toggle:hover {
  border-color: var(--line-strong);
  background: var(--panel-soft);
  color: var(--text);
}

.pwa-card {
  gap: 0.65rem;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 0.85rem 0.2rem 0.2rem;
}

.pwa-status-row {
  display: grid;
  gap: 0.55rem;
}

.connection-pill {
  border: 0;
  background: transparent;
  color: var(--sage) !important;
  font-size: 0.75rem !important;
  padding: 0;
}

.connection-pill.is-offline {
  border: 0;
  background: transparent;
  color: var(--danger) !important;
}

.pwa-mode {
  position: relative;
  display: flex !important;
  align-items: center;
  gap: 0.45rem;
  color: #c2c5c3 !important;
  font-size: 0.75rem !important;
  font-weight: 600;
}

.pwa-mode::before {
  display: grid;
  width: 1rem;
  height: 1rem;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  content: "✓";
  font-size: 0.62rem;
}

.pwa-action {
  border-color: rgba(239, 179, 50, 0.44);
  border-radius: var(--radius-sm);
  background: rgba(239, 179, 50, 0.08);
  color: var(--gold);
  font-size: 0.75rem;
}

.logout-link {
  color: var(--muted);
  font-size: 0.76rem;
}

.main {
  width: 100%;
  max-width: 105rem;
  margin: 0 auto;
  padding: clamp(1.35rem, 2.3vw, 2.45rem);
}

.offline-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid rgba(255, 100, 91, 0.32);
  border-radius: var(--radius-md);
  background: rgba(255, 100, 91, 0.08);
  color: #ffd6d2;
  font-size: 0.84rem;
  line-height: 1.45;
  margin-bottom: 1rem;
  padding: 0.82rem 1rem;
}

.offline-banner[hidden] {
  display: none;
}

.offline-banner .ui-icon {
  color: var(--danger);
}

.duplicate-notice {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid rgba(239, 179, 50, 0.28);
  border-radius: var(--radius-md);
  background: rgba(239, 179, 50, 0.055);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
  margin: -0.4rem 0 1.2rem;
  padding: 0.78rem 0.95rem;
}

.duplicate-notice .ui-icon {
  flex: 0 0 auto;
  color: var(--gold);
}

.duplicate-notice strong {
  color: var(--text);
}

.topbar {
  align-items: center;
  margin-bottom: 1.6rem;
}

.topbar h1,
.dashboard-hero h1 {
  max-width: none;
  color: var(--text);
  font-size: clamp(1.8rem, 2.55vw, 2.6rem);
  font-weight: 690;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.topbar p,
.dashboard-hero p {
  max-width: 48rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.dashboard-hero {
  grid-area: hero;
  min-height: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.dashboard-hero::after {
  display: none;
}

.hero-actions,
.topbar-actions,
.actions {
  gap: 0.7rem;
}

.button {
  min-height: 2.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 680;
  letter-spacing: -0.01em;
  padding: 0.72rem 1rem;
}

.button.primary {
  border-color: #f2bb43;
  background: linear-gradient(180deg, #f3bd47, #e5a825);
  box-shadow: 0 0.45rem 1.4rem rgba(239, 179, 50, 0.13);
  color: #17130a;
}

.button.primary:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.button.ghost,
.button:not(.primary):not(.danger) {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--text);
}

.button.ghost:hover,
.button:not(.primary):not(.danger):hover {
  border-color: rgba(239, 179, 50, 0.45);
  background: rgba(255, 255, 255, 0.035);
}

.button.small {
  min-height: 2.15rem;
  font-size: 0.74rem;
  padding: 0.48rem 0.68rem;
}

.app-view-dashboard .main {
  display: grid;
  grid-template-areas:
    "hero hero"
    "metrics metrics"
    "invoice overdue"
    "invoice recurring";
  grid-template-columns: minmax(0, 1.68fr) minmax(19rem, 0.92fr);
  gap: 1.25rem;
  align-items: start;
}

.app-view-dashboard .success {
  grid-column: 1 / -1;
}

.metric-grid {
  grid-area: metrics;
  display: grid;
  overflow: hidden;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.012);
}

.metric {
  position: relative;
  min-height: 8.1rem;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 1.35rem 1.2rem;
}

.metric:last-child {
  border-right: 0;
}

.metric::after,
.metric-icon {
  display: none;
}

.metric:hover {
  background: rgba(255, 255, 255, 0.022);
  transform: none;
}

.metric span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 560;
  letter-spacing: 0;
  text-transform: none;
}

.metric strong {
  margin-top: 0.7rem;
  color: var(--text);
  font-size: clamp(1.18rem, 1.45vw, 1.65rem);
  font-weight: 680;
  letter-spacing: -0.035em;
  white-space: nowrap;
}

.metric small {
  margin-top: 0.55rem;
  color: #777c79;
  font-size: 0.68rem;
  font-weight: 520;
}

.metric:nth-child(3) strong,
.metric:nth-child(6) strong {
  color: var(--sage);
}

.metric:nth-child(4) strong {
  color: var(--gold);
}

.metric:nth-child(5) strong {
  color: var(--danger);
}

.metric-open {
  border-color: var(--line);
  background: transparent;
}

.panel {
  border-color: var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.012);
  box-shadow: none;
  padding: 1.25rem;
}

.invoice-panel {
  grid-area: invoice;
}

.overdue-panel {
  grid-area: overdue;
}

.recurring-panel {
  grid-area: recurring;
}

.panel-head {
  min-height: 2.25rem;
  margin-bottom: 0.95rem;
  padding-bottom: 0.85rem;
}

.panel-head h2,
.items-head h2 {
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 660;
  letter-spacing: -0.015em;
}

.panel-head p {
  max-width: 44rem;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.panel-head > span,
.panel-head > a,
.panel-link {
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 650;
  text-decoration: none;
}

.table {
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.invoice-row span:first-child {
  color: #c9ccca;
}

.table-row {
  min-height: 3.1rem;
  border-bottom-color: var(--line);
  color: #c9ccca;
  font-size: 0.78rem;
  padding: 0 0.65rem;
}

.table-head {
  min-height: 2.6rem;
  background: rgba(255, 255, 255, 0.04);
  color: #9ca09e;
  font-size: 0.7rem;
  font-weight: 580;
  letter-spacing: 0;
  text-transform: none;
}

a.table-row {
  transition: background 150ms ease, color 150ms ease;
}

a.table-row:hover {
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  transform: none;
}

.status,
.transport-badge,
.mail-kind {
  border-radius: 4px;
  background: transparent;
  font-size: 0.68rem;
  font-weight: 650;
  padding: 0.27rem 0.46rem;
}

.status-paid {
  border-color: rgba(119, 183, 98, 0.34);
  background: rgba(119, 183, 98, 0.06);
  color: var(--sage);
}

.status-sent,
.status-draft {
  border-color: rgba(239, 179, 50, 0.32);
  background: rgba(239, 179, 50, 0.055);
  color: var(--gold);
}

.status-cancelled {
  border-color: rgba(255, 100, 91, 0.32);
  background: rgba(255, 100, 91, 0.06);
  color: var(--danger);
}

.reminder-list {
  gap: 0;
}

.reminder-card {
  position: relative;
  min-height: 4.1rem;
  gap: 0.8rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 0.8rem 0.25rem 0.8rem 0.85rem;
}

.reminder-card::before {
  position: absolute;
  top: 0.85rem;
  bottom: 0.85rem;
  left: 0;
  width: 2px;
  border-radius: 2px;
  background: var(--danger);
  content: "";
}

.recurring-panel .reminder-card::before {
  background: var(--sage);
}

.reminder-card:last-child {
  border-bottom: 0;
}

.reminder-card strong {
  color: var(--text);
  font-size: 0.81rem;
}

.reminder-kicker,
.reminder-card small {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.4;
}

.reminder-kicker {
  color: var(--danger);
  font-weight: 620;
}

.recurring-panel .reminder-kicker {
  color: var(--sage);
}

.empty-state {
  min-height: 8rem;
  border-color: var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.018);
}

.form-grid {
  gap: 0.9rem;
}

label {
  color: #c8cbc9;
  font-size: 0.75rem;
  font-weight: 580;
}

input,
select,
textarea {
  min-height: 2.75rem;
  border-color: var(--line-strong);
  border-radius: var(--radius-sm);
  background: #0a0c0c;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 520;
  padding: 0.7rem 0.78rem;
}

textarea {
  line-height: 1.55;
}

input::placeholder,
textarea::placeholder {
  color: #656967;
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(255, 255, 255, 0.29);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(239, 179, 50, 0.1);
  outline: 0;
}

.invoice-workspace {
  grid-template-columns: minmax(0, 1.12fr) minmax(25rem, 0.88fr);
  gap: 1rem;
}

.preview {
  top: 1rem;
}

.paper-preview,
.invoice-page {
  background: #fff;
  box-shadow: 0 1.8rem 4.5rem rgba(0, 0, 0, 0.36);
}

.item-row {
  gap: 0.45rem;
}

.settings-divider {
  background: var(--line);
  margin: 1.7rem 0;
}

.settings-form,
.customer-form {
  max-width: 66rem;
}

.support-state { display:inline-flex;align-items:center;gap:7px;color:var(--muted);font-size:12px;white-space:nowrap; }
.support-state::before { content:"";width:7px;height:7px;border-radius:50%;background:#69645b; }
.support-state.is-enabled { color:#8fd0a6; }
.support-state.is-enabled::before { background:#54c57d;box-shadow:0 0 0 4px rgba(84,197,125,.12); }

.settings-mini-list > div,
.receipt-current,
.send-status-grid article,
.mail-actions form,
.status-edit,
.email-signature-setting {
  border-color: var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.018);
}

.mail-log-panel {
  max-width: none;
}

.app-view-mail_log .mail-log-filters {
  gap: 0.75rem;
}

.mail-log-list {
  border-color: var(--line);
  background: transparent;
}

.mail-log-entry {
  border-color: var(--line);
}

.mail-log-entry:hover {
  background: rgba(255, 255, 255, 0.035);
}

.mail-log-head {
  background: rgba(255, 255, 255, 0.04);
}

.mail-log-copy {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.success,
.alert {
  border-radius: var(--radius-sm);
}

.app-toast {
  border-color: var(--line-strong);
  border-radius: var(--radius-md);
  background: rgba(17, 19, 19, 0.96);
  box-shadow: var(--shadow);
  font-size: 0.8rem;
  font-weight: 620;
}

.quick-sheet {
  border-color: var(--line-strong);
  border-radius: var(--radius-lg);
  background: #101212;
  box-shadow: 0 2rem 5rem rgba(0, 0, 0, 0.55);
}

.quick-action-grid > * {
  border-color: var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
}

.login-screen,
.offline-screen,
.setup-screen {
  background:
    radial-gradient(circle at 50% 0%, rgba(239, 179, 50, 0.09), transparent 34rem),
    var(--bg);
}

.login-card,
.setup-card,
.offline-card {
  width: min(31rem, calc(100% - 2rem));
  border-color: var(--line);
  border-radius: var(--radius-lg);
  background: #0d0f0f;
  box-shadow: 0 2.5rem 7rem rgba(0, 0, 0, 0.42);
}

.offline-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 1rem;
}

.offline-card {
  display: grid;
  gap: 1rem;
  padding: clamp(1.5rem, 5vw, 2.4rem);
}

.offline-card header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1rem;
}

.offline-card header img {
  width: 4.5rem;
}

.offline-card header span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.offline-symbol {
  display: grid;
  width: 3.25rem;
  height: 3.25rem;
  place-items: center;
  border: 1px solid rgba(255, 100, 91, 0.34);
  border-radius: 50%;
  background: rgba(255, 100, 91, 0.07);
  color: var(--danger);
  margin-top: 0.7rem;
}

.offline-symbol svg {
  width: 1.5rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.offline-card h1 {
  margin: 0;
  font-size: clamp(1.8rem, 7vw, 2.5rem);
  letter-spacing: -0.04em;
}

.offline-card > p {
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
}

.offline-note {
  display: grid;
  gap: 0.25rem;
  border-left: 2px solid var(--sage);
  background: rgba(119, 183, 98, 0.045);
  padding: 0.8rem 1rem;
}

.offline-note span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f8f8;
  --bg-soft: #f1f3f2;
  --night: #e8ebea;
  --panel: #fff;
  --panel-strong: #fff;
  --panel-soft: rgba(18, 22, 20, 0.035);
  --line: rgba(21, 25, 23, 0.11);
  --line-strong: rgba(21, 25, 23, 0.21);
  --text: #151817;
  --muted: #686e6b;
  --gold: #b97800;
  --gold-deep: #8f5d00;
  --sage: #4e8541;
  --danger: #c94840;
  --warning: #a86e00;
  --shadow: 0 1.5rem 4rem rgba(18, 22, 20, 0.1);
}

html[data-theme="light"] body {
  background: var(--bg);
}

html[data-theme="light"] body::before {
  opacity: 0.25;
  background:
    radial-gradient(circle at 82% 0%, rgba(185, 120, 0, 0.06), transparent 34rem),
    linear-gradient(rgba(18, 22, 20, 0.025) 1px, transparent 1px);
  background-size: auto, 100% 72px;
}

html[data-theme="light"] .sidebar {
  border-color: var(--line);
  background: rgba(251, 252, 252, 0.96);
}

html[data-theme="light"] .duplicate-notice {
  border-color: rgba(185, 120, 0, 0.24);
  background: rgba(185, 120, 0, 0.045);
}

html[data-theme="light"] .brand img {
  filter: invert(1);
}

html[data-theme="light"] .nav-item,
html[data-theme="light"] .nav-item .ui-icon {
  color: #666c69;
}

html[data-theme="light"] .nav-item:hover,
html[data-theme="light"] .nav-item.is-active {
  border-color: var(--line);
  background: rgba(18, 22, 20, 0.045);
  color: var(--text);
}

html[data-theme="light"] .metric-grid,
html[data-theme="light"] .metric,
html[data-theme="light"] .metric-open,
html[data-theme="light"] .panel,
html[data-theme="light"] .dashboard-hero,
html[data-theme="light"] .settings-mini-list > div,
html[data-theme="light"] .email-signature-setting,
html[data-theme="light"] .send-status-grid article,
html[data-theme="light"] .mail-actions form,
html[data-theme="light"] .status-edit {
  background: #fff;
}

html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  border-color: var(--line-strong);
  background: #fff;
  color: var(--text);
}

html[data-theme="light"] .table-head,
html[data-theme="light"] .mail-log-head {
  background: #f1f3f2;
}

html[data-theme="light"] a.table-row:hover,
html[data-theme="light"] .mail-log-entry:hover,
html[data-theme="light"] .metric:hover {
  background: #f5f6f6;
}

html[data-theme="light"] .button.primary {
  border-color: #d99a1a;
  background: linear-gradient(180deg, #efb53d, #dda01f);
  color: #17130a;
}

html[data-theme="light"] .quick-sheet,
html[data-theme="light"] .app-toast,
html[data-theme="light"] .login-card,
html[data-theme="light"] .setup-card,
html[data-theme="light"] .offline-card {
  border-color: var(--line);
  background: #fff;
  color: var(--text);
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 11.75rem minmax(0, 1fr);
  }

  .brand-copy {
    display: none;
  }

  .app-view-dashboard .main {
    grid-template-areas:
      "hero"
      "metrics"
      "invoice"
      "overdue"
      "recurring";
    grid-template-columns: minmax(0, 1fr);
  }

  .metric-grid {
    overflow-x: auto;
    grid-template-columns: repeat(6, minmax(10.5rem, 1fr));
    scrollbar-width: thin;
  }

  .invoice-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .preview {
    position: static;
  }
}

@media (max-width: 720px) {
  .app-body {
    padding-bottom: calc(5.1rem + env(safe-area-inset-bottom));
  }

  .print-screen {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .print-actions {
    display: grid;
    width: min(100%, 42rem);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    justify-content: stretch;
    gap: 0.6rem;
    margin: 0 auto;
    padding: 0.8rem 1rem;
  }

  .print-actions > .button,
  .print-actions > button,
  .print-actions > form,
  .print-actions > form .button {
    width: 100%;
    min-width: 0;
  }

  .print-actions > .button,
  .print-actions > button,
  .print-actions > form .button {
    min-height: 3rem;
    justify-content: center;
    font-size: 0.78rem;
    line-height: 1.2;
    padding: 0.7rem 0.65rem;
    text-align: center;
    white-space: normal;
  }

  .print-actions > .button.primary {
    grid-column: 1 / -1;
  }

  .print-actions > form {
    display: block;
    margin: 0;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    height: calc(4.35rem + env(safe-area-inset-top));
    min-height: 0;
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(9, 10, 10, 0.94);
    padding: env(safe-area-inset-top) 1rem 0.65rem;
  }

  .sidebar .brand {
    width: auto;
    padding: 0;
  }

  .sidebar .brand-mark {
    width: 4.55rem;
    height: 2.4rem;
  }

  .sidebar .brand img {
    width: 4.35rem;
  }

  .sidebar .brand-copy,
  .sidebar .nav,
  .sidebar .theme-toggle,
  .sidebar .sidebar-app-switch,
  .sidebar .logout-link,
  .sidebar .pwa-action {
    display: none;
  }

  .sidebar-foot {
    display: block;
    margin: 0 0 0.18rem;
  }

  .sidebar .pwa-card {
    display: block;
    border: 0;
    padding: 0;
  }

  .sidebar .pwa-status-row {
    display: block;
  }

  .sidebar .pwa-mode {
    display: none !important;
  }

  .main {
    max-width: none;
    padding: 1.35rem 1rem 1rem;
  }

  .offline-banner {
    align-items: flex-start;
    font-size: 0.76rem;
    margin: -0.35rem 0 1rem;
  }

  .duplicate-notice {
    align-items: flex-start;
    font-size: 0.76rem;
    margin: -0.35rem 0 1rem;
  }

  .topbar,
  .dashboard-hero {
    gap: 1rem;
    align-items: stretch;
    margin-bottom: 1.2rem;
  }

  .topbar h1,
  .dashboard-hero h1 {
    font-size: clamp(1.75rem, 8.5vw, 2.2rem);
  }

  .topbar p,
  .dashboard-hero p {
    font-size: 0.84rem;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-actions .button.ghost {
    display: none;
  }

  .button {
    width: 100%;
    min-height: 2.9rem;
  }

  .app-view-dashboard .main {
    display: grid;
    grid-template-areas:
      "hero"
      "metrics"
      "invoice"
      "overdue"
      "recurring";
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }

  .metric-grid {
    display: grid;
    overflow-x: auto;
    grid-auto-flow: column;
    grid-auto-columns: minmax(9.4rem, 62vw);
    grid-template-columns: none;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .metric-grid::-webkit-scrollbar {
    display: none;
  }

  .metric {
    min-height: 7.2rem;
    scroll-snap-align: start;
    padding: 1.15rem;
  }

  .metric strong {
    font-size: 1.28rem;
  }

  .panel {
    padding: 1rem;
  }

  .panel-head,
  .items-head {
    gap: 0.55rem;
    align-items: flex-start;
  }

  .panel-head > span,
  .panel-head > a {
    align-self: flex-start;
  }

  .invoice-panel .table {
    gap: 0;
  }

  .invoice-panel .table-head {
    display: none;
  }

  .invoice-panel .invoice-row {
    display: grid;
    min-height: 4rem;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.2rem 0.8rem;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    padding: 0.75rem 0.25rem;
  }

  .invoice-panel .invoice-row span {
    display: block;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 520;
    text-align: left;
  }

  .invoice-panel .invoice-row span::before {
    display: none;
  }

  .invoice-panel .invoice-row span:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 650;
    padding: 0;
  }

  .invoice-panel .invoice-row span:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
  }

  .invoice-panel .invoice-row span:nth-child(3) {
    display: none;
  }

  .invoice-panel .invoice-row span:nth-child(4) {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
  }

  .invoice-panel .invoice-row span:nth-child(5) {
    grid-column: 2;
    grid-row: 2;
    color: var(--text);
    font-size: 0.75rem;
    text-align: right;
  }

  .reminder-card {
    align-items: center;
    flex-direction: row;
  }

  .reminder-card .button {
    width: auto;
    min-height: 2.2rem;
  }

  .mobile-tabbar {
    right: 0;
    bottom: 0;
    left: 0;
    gap: 0;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    background: rgba(9, 10, 10, 0.96);
    box-shadow: 0 -0.75rem 2.2rem rgba(0, 0, 0, 0.2);
    padding: 0.35rem 0.45rem;
    padding-bottom: calc(0.35rem + env(safe-area-inset-bottom));
    backdrop-filter: blur(28px);
  }

  .tab-item {
    min-height: 3.55rem;
    gap: 0.22rem;
    border-radius: var(--radius-sm);
    color: #8d918f;
    font-size: 0.64rem;
    font-weight: 580;
  }

  .tab-item .ui-icon {
    width: 1.25rem;
    height: 1.25rem;
    stroke-width: 1.75;
  }

  .tab-item.is-active {
    background: transparent;
    color: var(--gold);
  }

  .tab-primary {
    position: relative;
    top: -0.48rem;
    min-height: 4rem;
    border: 1px solid #f2bb43;
    border-radius: 50%;
    background: linear-gradient(180deg, #f3bd47, #e5a825);
    color: #17130a;
    box-shadow: 0 0.6rem 1.4rem rgba(0, 0, 0, 0.28);
  }

  .tab-primary .ui-icon {
    width: 1.4rem;
    height: 1.4rem;
  }

  .tab-primary span {
    display: none;
  }

  .quick-sheet {
    right: 0.65rem;
    bottom: calc(4.9rem + env(safe-area-inset-bottom));
    left: 0.65rem;
    border-radius: var(--radius-lg);
  }

  .app-toast {
    right: 0.65rem;
    bottom: calc(5.1rem + env(safe-area-inset-bottom));
    left: 0.65rem;
  }

  .form-grid,
  .item-row,
  .item-row-small-business {
    grid-template-columns: minmax(0, 1fr);
  }

  .span-2 {
    grid-column: span 1;
  }

  .paper-preview {
    min-width: 42rem;
  }

  .preview {
    overflow-x: auto;
    padding-bottom: 0.75rem;
  }

  html[data-theme="light"] .sidebar,
  html[data-theme="light"] .mobile-tabbar {
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.96);
  }
}

@media print {
  @page {
    margin: 0;
    size: A4;
  }

  html,
  body {
    background: #fff;
  }

  .print-actions,
  .mail-panel,
  .mobile-tabbar,
  .pwa-card {
    display: none;
  }

  .invoice-page {
    box-shadow: none;
    margin: 0;
  }
}
