: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;
}

.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);
}

.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);
}

.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-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;
}

.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;
}

.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;
}

.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-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 {
    margin-top: 1.4rem;
  }

  .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;
  }
}

@media (max-width: 720px) {
  .main,
  .sidebar {
    padding: 1rem;
  }

  .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;
  }

  .mail-actions,
  .send-status-grid,
  .status-edit {
    grid-template-columns: 1fr;
  }

  .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;
  }
}

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

  html,
  body {
    background: #fff;
  }

  .print-actions,
  .mail-panel {
    display: none;
  }

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