:root {
  color-scheme: light;
  --font-body: "Lato", "Be Vietnam Pro", "Noto Sans Arabic", "Noto Sans Devanagari", sans-serif;
  --font-heading: "Poppins", "Be Vietnam Pro", "Noto Sans Arabic", "Noto Serif Devanagari", sans-serif;
  --bg: #ece4d4;
  --bg-elevated: rgba(246, 240, 230, 0.92);
  --surface: rgba(253, 249, 241, 0.9);
  --surface-strong: rgba(255, 252, 247, 0.97);
  --surface-soft: rgba(233, 223, 204, 0.78);
  --text: #173221;
  --text-soft: #5a655f;
  --primary: #38985f;
  --primary-strong: #1f5d3c;
  --accent: #d2b06d;
  --accent-strong: #9c7740;
  --border: rgba(21, 50, 34, 0.14);
  --shadow: 0 24px 60px rgba(17, 30, 20, 0.14);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

body[data-theme="dark"] {
  color-scheme: dark;
  --bg: #050606;
  --bg-elevated: rgba(10, 12, 11, 0.92);
  --surface: rgba(18, 22, 20, 0.9);
  --surface-strong: rgba(22, 27, 24, 0.96);
  --surface-soft: rgba(36, 47, 40, 0.74);
  --text: #f4f0e8;
  --text-soft: #b6b8b0;
  --primary: #50af73;
  --primary-strong: #83d498;
  --accent: #d2b06d;
  --accent-strong: #ebcf9b;
  --border: rgba(255, 255, 255, 0.1);
  --shadow: 0 30px 70px rgba(0, 0, 0, 0.42);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

img {
  max-width: 100%;
}

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

.site-bg {
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  position: fixed;
  z-index: 0;
}

.site-glow {
  border-radius: 999px;
  filter: blur(30px);
  opacity: 0.6;
  position: absolute;
}

.site-glow-a {
  background: radial-gradient(circle, rgba(56, 152, 95, 0.32), transparent 70%);
  height: 32rem;
  left: -8rem;
  top: -10rem;
  width: 32rem;
}

.site-glow-b {
  background: radial-gradient(circle, rgba(210, 176, 109, 0.24), transparent 70%);
  bottom: -12rem;
  height: 36rem;
  right: -8rem;
  width: 36rem;
}

.site-grid {
  background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 72px 72px;
  inset: 0;
  opacity: 0.08;
  position: absolute;
}

.app-shell,
.auth-shell {
  position: relative;
  z-index: 1;
}

.app-shell {
  display: grid;
  gap: 1.15rem;
  grid-template-columns: 272px minmax(0, 1fr);
  min-height: 100vh;
  padding: 1.1rem;
}

.workspace-sidebar,
.panel,
.auth-topbar {
  backdrop-filter: blur(18px);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.workspace-sidebar {
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 1rem;
  position: sticky;
  top: 1.1rem;
  height: calc(100dvh - 2.2rem);
}

.workspace-main {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  min-width: 0;
}

.workspace-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
  padding-bottom: 2rem;
}

.auth-shell {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  min-height: 100vh;
  padding: 1.4rem;
}

.auth-topbar {
  align-items: center;
  border-radius: var(--radius-xl);
  display: flex;
  justify-content: space-between;
  padding: 1rem 1.2rem;
}

.auth-main {
  align-items: center;
  display: flex;
  flex: 1;
  justify-content: center;
}

.auth-stage {
  display: grid;
  gap: 1.3rem;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.9fr);
  width: min(1200px, 100%);
}

.auth-story,
.auth-panel,
.panel {
  border-radius: var(--radius-xl);
  padding: 1.4rem;
}

.accent-panel {
  background: linear-gradient(180deg, rgba(252, 249, 243, 0.96), rgba(235, 225, 205, 0.94));
}

body[data-theme="dark"] .accent-panel {
  background: linear-gradient(180deg, rgba(18, 23, 20, 0.96), rgba(11, 14, 12, 0.98));
}

.brand {
  align-items: center;
  display: inline-flex;
  gap: 0.75rem;
}

.brand-mark {
  align-items: center;
  background: rgba(15, 25, 18, 0.94);
  border: 1px solid rgba(210, 176, 109, 0.22);
  border-radius: 22px;
  display: inline-flex;
  flex-shrink: 0;
  height: 3rem;
  justify-content: center;
  overflow: hidden;
  width: 3rem;
}

.brand-logo {
  display: block;
  height: 100%;
  width: 100%;
}

.brand-copy {
  display: grid;
}

.brand-copy strong {
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-copy small {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-copy small,
.muted,
.meta-label,
.pagination-summary small,
.detail-list dt {
  color: var(--text-soft);
}

.sidebar-card,
.metric-card,
.credential-card,
.compact-card,
.value-card {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
}

.sidebar-card h3,
.metric-card strong,
.hero-point strong,
.value-card strong {
  display: block;
  font-size: 1.2rem;
}

.workspace-nav {
  display: grid;
  gap: 0.42rem;
  min-height: 0;
}

.workspace-link {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 0.92rem;
  line-height: 1.2;
  padding: 0.58rem 0.82rem;
  transition: 150ms ease;
}

.workspace-sidebar .brand-copy strong {
  font-size: 0.9rem;
  line-height: 1.18;
}

.workspace-sidebar .brand-copy small {
  font-size: 0.72rem;
}

.workspace-sidebar .sidebar-card {
  padding: 0.75rem 0.9rem;
}

.workspace-sidebar .sidebar-card p {
  font-size: 0.95rem;
  margin-top: 0.22rem;
}

.workspace-sidebar .sidebar-card-compact {
  border-radius: 18px;
  padding: 0.52rem 0.75rem;
}

.workspace-sidebar .sidebar-card-compact h3 {
  font-size: 0.98rem;
}

.workspace-sidebar .sidebar-card-compact p {
  font-size: 0.84rem;
  margin-top: 0.08rem;
}

.workspace-sidebar .sidebar-card .eyebrow {
  font-size: 0.72rem;
  margin-bottom: 0.15rem;
}

.workspace-sidebar::-webkit-scrollbar {
  width: 0.55rem;
}

.workspace-sidebar::-webkit-scrollbar-thumb {
  background: rgba(56, 152, 95, 0.28);
  border-radius: 999px;
}

.workspace-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.workspace-link:hover,
.ghost-button:hover,
.secondary-button:hover,
.primary-button:hover {
  transform: translateY(-1px);
}

.workspace-link:hover {
  background: rgba(47, 123, 81, 0.08);
  border-color: rgba(47, 123, 81, 0.24);
  color: var(--text);
}

.topbar {
  align-items: flex-start;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 1.2rem 1.3rem;
}

.topbar-copy h1,
.section-heading h2,
.section-inline-head h3,
.hero-panel h2,
.auth-story h1,
.auth-panel h2,
.panel h3,
.panel h4 {
  font-family: var(--font-heading);
  line-height: 1.05;
  margin: 0;
}

.topbar-copy h1 {
  font-size: clamp(2rem, 3vw, 3.2rem);
  letter-spacing: 0.01em;
}

.topbar-copy p,
.section-heading p,
.hero-panel p,
.auth-story p,
.panel p {
  margin: 0.5rem 0 0;
}

.header-actions,
.button-row,
.link-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.header-actions {
  justify-content: flex-end;
  max-width: 100%;
  min-width: 0;
}

.header-actions > * {
  max-width: 100%;
}

.mobile-only {
  display: none;
}

.inline-form {
  margin: 0;
}

.language-form .inline-select {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  display: inline-flex;
  max-width: 100%;
  min-height: 2.8rem;
  padding: 0 0.9rem;
}

.language-form .inline-select select {
  background: transparent;
  border: 0;
  flex: 1 1 auto;
  max-width: 100%;
  min-height: 2.2rem;
  min-width: 7.6rem;
  padding: 0;
}

.eyebrow {
  color: var(--accent-strong);
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

.hero-grid,
.postbox-grid,
.customer-grid,
.metric-grid,
.card-grid {
  display: grid;
  gap: 1rem;
}

.hero-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.95fr);
}

.customer-overview-grid {
  align-items: start;
  grid-template-columns: minmax(320px, 0.92fr) minmax(0, 1.08fr);
}

.auth-stage-compact {
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
}

.two-factor-box {
  display: grid;
  gap: 1rem;
}

.qr-panel,
.manual-secret-card {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
}

.qr-frame {
  align-items: center;
  background: rgba(255, 255, 255, 0.82);
  border-radius: var(--radius-md);
  display: flex;
  justify-content: center;
  min-height: 220px;
  padding: 1rem;
}

.qr-frame svg {
  height: auto;
  max-width: 100%;
  width: min(100%, 250px);
}

.manual-secret-card strong {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  word-break: break-all;
}

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

.metric-card-wide {
  grid-column: 1 / -1;
}

.customer-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

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

.hero-point,
.compact-row {
  align-items: flex-start;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.9rem 1rem;
}

.hero-points {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 1.2rem;
}

.customer-summary-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  padding: 1.15rem 1.2rem;
}

.customer-summary-card > p {
  margin-top: 0;
  max-width: 44ch;
}

.customer-summary-card h2 {
  font-size: clamp(1.55rem, 2vw, 2.2rem);
}

.customer-summary-head {
  align-items: flex-start;
}

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

.customer-summary-point {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.85rem 0.95rem;
}

.customer-summary-point strong {
  display: block;
  font-size: 1.5rem;
  line-height: 1;
}

.customer-summary-point span {
  color: var(--text-soft);
  display: block;
  font-size: 0.95rem;
  margin-top: 0.28rem;
}

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

.customer-jump-row .ghost-button,
.customer-jump-row .secondary-button,
.customer-jump-row .primary-button {
  flex: 1 1 10rem;
}

.customer-websites-card {
  min-height: 100%;
}

.metric-card-accent,
.primary-button {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fffef8;
}

.primary-button,
.secondary-button,
.ghost-button {
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  min-height: 2.8rem;
  padding: 0.7rem 1.1rem;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

.secondary-button {
  background: var(--surface-strong);
  border-color: rgba(56, 152, 95, 0.28);
  color: var(--primary-strong);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border);
  color: var(--text);
}

.workspace-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.section-heading,
.section-inline-head {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.section-heading {
  flex-direction: column;
}

.compact-heading h3 {
  font-size: 2rem;
}

.stack-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.inbox-item {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
}

.item-head,
.table-meta,
.pagination,
.compact-row {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.item-badges {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.status-pill,
.label-pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 700;
  gap: 0.3rem;
  padding: 0.32rem 0.7rem;
}

.status-pill {
  background: rgba(47, 123, 81, 0.12);
  color: var(--primary-strong);
}

.status-pill.warning {
  background: rgba(201, 168, 102, 0.18);
  color: var(--accent-strong);
}

.status-pill.success {
  background: rgba(84, 163, 112, 0.16);
  color: var(--primary);
}

.status-pill.danger {
  background: rgba(175, 56, 56, 0.16);
  color: #a23131;
}

.label-pill {
  background: var(--surface-soft);
  color: var(--text-soft);
}

.meta-grid,
.detail-list,
.credential-grid,
.form-grid {
  display: grid;
  gap: 0.85rem;
}

.meta-grid,
.detail-list,
.credential-grid {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

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

.form-field {
  display: grid;
  gap: 0.4rem;
}

.form-field span {
  font-size: 0.86rem;
  font-weight: 600;
}

.form-field input,
.form-field select,
.form-field textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  min-height: 2.95rem;
  padding: 0.8rem 0.9rem;
}

.form-field input[type="file"] {
  padding: 0.7rem;
}

.form-field-wide {
  grid-column: 1 / -1;
}

.filter-panel,
.table-panel,
.postbox-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.table-shell {
  min-width: 0;
  overflow: auto;
  width: 100%;
}

.data-table {
  border-collapse: collapse;
  min-width: 720px;
  width: 100%;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.data-table .table-secondary {
  color: var(--text-soft);
  font-size: 0.9rem;
  margin-top: 0.3rem;
}

.table-empty-copy {
  display: grid;
  gap: 0.35rem;
}

.data-table tr.is-selected {
  background: rgba(47, 123, 81, 0.08);
}

.invoice-data-table {
  min-width: 980px;
}

.invoice-column-head th {
  white-space: nowrap;
}

.invoice-filter-row th {
  padding-top: 0.55rem;
  text-transform: none;
}

.invoice-filter-row input,
.invoice-filter-row select {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  min-height: 2.6rem;
  padding: 0.65rem 0.8rem;
  width: 100%;
}

.filter-cell-stack,
.table-filter-actions,
.copy-grid {
  display: grid;
  gap: 0.6rem;
}

.table-filter-actions .ghost-button,
.table-filter-actions .secondary-button {
  width: 100%;
}

.invoice-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.invoice-action-cell {
  min-width: 0;
}

.payment-grid {
  align-items: stretch;
}

.payment-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.payment-qr-frame {
  align-items: center;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  justify-content: center;
  min-height: 220px;
  padding: 1rem;
}

.payment-qr-frame svg {
  height: auto;
  max-width: 100%;
  width: min(100%, 260px);
}

@media print {
  body.print-payment .site-bg,
  body.print-payment .workspace-sidebar,
  body.print-payment .topbar,
  body.print-payment .workspace-section:not(#rechnungen),
  body.print-payment .invoice-table-panel,
  body.print-payment .message-stack {
    display: none !important;
  }

  body.print-payment .workspace-content,
  body.print-payment #rechnungen,
  body.print-payment #zahlung,
  body.print-payment .payment-grid,
  body.print-payment .payment-panel {
    display: block !important;
  }

  body.print-payment .payment-panel {
    break-inside: avoid;
    box-shadow: none;
    margin-bottom: 1rem;
  }

  body.print-payment {
    background: #fff;
    color: #000;
  }
}

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

.copy-field {
  display: grid;
  gap: 0.4rem;
}

.copy-field span {
  color: var(--text-soft);
  font-size: 0.84rem;
  font-weight: 700;
}

.copy-field input {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  min-height: 2.9rem;
  padding: 0.8rem 0.9rem;
}

.copy-field-wide {
  grid-column: 1 / -1;
}

.detail-list {
  margin: 0;
}

.detail-list div {
  display: grid;
  gap: 0.1rem;
}

.detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.path-list {
  grid-template-columns: 1fr;
}

.path-code {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: block;
  font-family: var(--font-body);
  font-size: 0.92rem;
  line-height: 1.45;
  padding: 0.8rem 0.9rem;
  white-space: normal;
  word-break: break-all;
}

html[lang="vi"] .eyebrow {
  letter-spacing: 0.08em;
  text-transform: none;
}

html[lang="vi"] .topbar-copy h1,
html[lang="vi"] .section-heading h2,
html[lang="vi"] .section-inline-head h3,
html[lang="vi"] .hero-panel h2,
html[lang="vi"] .auth-story h1,
html[lang="vi"] .auth-panel h2,
html[lang="vi"] .panel h3,
html[lang="vi"] .panel h4 {
  line-height: 1.14;
}

html[dir="rtl"] body {
  direction: rtl;
}

html[dir="rtl"] .workspace-link,
html[dir="rtl"] .topbar-copy,
html[dir="rtl"] .section-heading,
html[dir="rtl"] .section-inline-head,
html[dir="rtl"] .detail-list,
html[dir="rtl"] .table-meta,
html[dir="rtl"] .compact-row,
html[dir="rtl"] .table-empty-copy {
  text-align: right;
}

html[dir="rtl"] .brand,
html[dir="rtl"] .header-actions,
html[dir="rtl"] .button-row,
html[dir="rtl"] .link-row,
html[dir="rtl"] .inline-select,
html[dir="rtl"] .invoice-action-row {
  flex-direction: row-reverse;
}

html[dir="rtl"] .data-table th,
html[dir="rtl"] .data-table td,
html[dir="rtl"] .copy-field input,
html[dir="rtl"] .form-field input,
html[dir="rtl"] .form-field select,
html[dir="rtl"] .form-field textarea {
  text-align: right;
}

.progress-bar {
  background: var(--surface-soft);
  border-radius: 999px;
  height: 0.8rem;
  overflow: hidden;
}

.progress-bar span {
  background: linear-gradient(90deg, var(--accent), var(--primary));
  display: block;
  height: 100%;
}

.pagination {
  align-items: center;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  padding-top: 1rem;
}

.pagination-form {
  margin-left: auto;
}

.inline-select {
  align-items: center;
  display: inline-flex;
  gap: 0.6rem;
}

.inline-select select {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  min-height: 2.4rem;
  padding: 0 0.85rem;
}

.empty-state {
  align-items: flex-start;
  background: var(--surface-strong);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.2rem;
}

.message-stack {
  display: grid;
  gap: 0.7rem;
}

.brand-panel {
  background:
    radial-gradient(circle at top left, rgba(56, 152, 95, 0.16), transparent 40%),
    radial-gradient(circle at bottom right, rgba(210, 176, 109, 0.2), transparent 42%),
    var(--surface);
}

.auth-utility-list {
  display: grid;
  gap: 0.9rem;
  margin-top: 1.2rem;
}

.utility-item {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.95rem 1rem;
}

.utility-item strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.compact-note {
  margin-top: 1rem;
}

.message-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 0.9rem 1rem;
}

.message-card.success {
  background: rgba(84, 163, 112, 0.12);
}

.message-card.warning {
  background: rgba(201, 168, 102, 0.14);
}

.message-card.error {
  background: rgba(175, 56, 56, 0.12);
}

.metric-link {
  display: inline-block;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.website-monitor-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.website-monitor-card h3 {
  font-size: 1.3rem;
}

.website-monitor-list {
  display: grid;
  gap: 0.8rem;
}

.website-monitor-item {
  align-items: center;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: grid;
  gap: 0.85rem;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 0.9rem 1rem;
}

.traffic-light {
  border-radius: 999px;
  box-shadow: 0 0 0 5px rgba(0, 0, 0, 0.05);
  display: inline-block;
  flex: 0 0 auto;
  height: 1rem;
  width: 1rem;
}

.traffic-light-green {
  background: #2f9b57;
}

.traffic-light-yellow {
  background: #d2b13d;
}

.traffic-light-red {
  background: #c94b4b;
}

.website-copy {
  display: grid;
  gap: 0.28rem;
  min-width: 0;
}

.website-copy strong {
  font-size: 1rem;
}

.website-status-inline {
  align-items: center;
  display: inline-flex;
  gap: 0.5rem;
}

.website-status-label {
  color: var(--text-soft);
  font-size: 0.9rem;
  font-weight: 700;
}

.credential-stack,
.value-grid,
.timeline {
  display: grid;
  gap: 0.9rem;
}

.message-channel {
  border-top: 1px solid var(--border);
  display: grid;
  gap: 0.9rem;
  padding-top: 1rem;
}

.message-channel:first-child {
  border-top: 0;
  padding-top: 0;
}

.credential-preview {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: grid;
  gap: 0.15rem;
  padding: 0.9rem 1rem;
}

.credential-preview p {
  margin: 0;
}

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

.task-copy {
  background: var(--surface-soft);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
}

code {
  background: rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  padding: 0.15rem 0.35rem;
}

body[data-theme="dark"] code {
  background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 1100px) {
  .app-shell,
  .hero-grid,
  .postbox-grid,
  .auth-stage {
    grid-template-columns: 1fr;
  }

  .workspace-sidebar {
    height: auto;
    overflow: visible;
    position: static;
  }

  .hero-points,
  .customer-summary-points,
  .metric-grid,
  .card-grid,
  .value-grid {
    grid-template-columns: 1fr 1fr;
  }

  .invoice-table-panel {
    overflow: hidden;
  }

  .invoice-data-table {
    min-width: 0;
  }

  .invoice-column-head {
    border: 0;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
  }

  .invoice-data-table,
  .invoice-data-table thead,
  .invoice-data-table tbody,
  .invoice-data-table tr,
  .invoice-data-table th,
  .invoice-data-table td {
    display: block;
    width: 100%;
  }

  .invoice-data-table thead {
    margin-bottom: 1rem;
  }

  .invoice-filter-row {
    background: var(--surface-strong);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem;
  }

  .invoice-filter-row th {
    border: 0;
    padding: 0 0 0.75rem;
  }

  .invoice-filter-row th:last-child {
    padding-bottom: 0;
  }

  .invoice-data-table tbody {
    display: grid;
    gap: 0.9rem;
  }

  .invoice-data-table tbody > tr {
    background: var(--surface-strong);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: grid;
    gap: 0.7rem;
    padding: 1rem;
  }

  .invoice-data-table tbody > tr.is-selected {
    background: rgba(47, 123, 81, 0.08);
  }

  .invoice-data-table td {
    border: 0;
    display: grid;
    gap: 0.32rem;
    padding: 0;
  }

  .invoice-data-table td::before {
    color: var(--text-soft);
    content: attr(data-label);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .invoice-data-table td:first-child strong {
    font-size: 1.15rem;
  }

  .invoice-action-row,
  .invoice-action-cell .ghost-button,
  .invoice-action-cell .secondary-button {
    width: 100%;
  }

  .invoice-empty-row {
    background: transparent;
    border: 0;
    padding: 0;
  }

  .invoice-empty-cell {
    padding: 0;
  }

  .invoice-empty-cell::before {
    content: none;
  }
}

@media (max-height: 920px) and (min-width: 861px) {
  .app-shell {
    gap: 1rem;
    grid-template-columns: 252px minmax(0, 1fr);
    padding: 1rem;
  }

  .workspace-sidebar {
    gap: 0.75rem;
    height: calc(100dvh - 2rem);
    padding: 0.9rem;
    top: 1rem;
  }

  .workspace-sidebar .brand {
    gap: 0.68rem;
  }

  .workspace-sidebar .brand-mark {
    height: 2.7rem;
    width: 2.7rem;
  }

  .workspace-sidebar .sidebar-card {
    padding: 0.68rem 0.8rem;
  }

  .workspace-sidebar .sidebar-card h3 {
    font-size: 1rem;
  }

  .workspace-link {
    font-size: 0.88rem;
    padding: 0.52rem 0.74rem;
  }
}

@media (max-height: 780px) and (min-width: 861px) {
  .app-shell {
    grid-template-columns: 240px minmax(0, 1fr);
    padding: 0.9rem;
  }

  .workspace-sidebar {
    gap: 0.65rem;
    height: calc(100dvh - 1.8rem);
    padding: 0.82rem;
    top: 0.9rem;
  }

  .workspace-sidebar .brand-copy strong {
    font-size: 0.84rem;
  }

  .workspace-sidebar .brand-copy small {
    font-size: 0.68rem;
  }

  .workspace-sidebar .sidebar-card h3 {
    font-size: 0.94rem;
  }

  .workspace-sidebar .sidebar-card p {
    font-size: 0.9rem;
  }

  .workspace-link {
    font-size: 0.84rem;
    padding: 0.48rem 0.68rem;
  }
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .workspace-sidebar {
    display: none;
    position: fixed;
    inset: 1rem;
    z-index: 20;
  }

  .workspace-sidebar.is-open {
    display: flex;
  }

  .mobile-only {
    display: inline-flex;
  }

  .topbar,
  .auth-topbar,
  .item-head,
  .table-meta,
  .pagination,
  .compact-row,
  .invoice-action-row {
    flex-direction: column;
  }

  .header-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .language-form {
    width: 100%;
  }

  .form-grid,
  .metric-grid,
  .card-grid,
  .hero-points,
  .customer-summary-points,
  .value-grid,
  .copy-grid {
    grid-template-columns: 1fr;
  }

  .website-monitor-item {
    grid-template-columns: 1fr;
  }

  .website-monitor-item .ghost-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .invoice-filter-row {
    padding: 0.9rem;
  }
}

@media (max-width: 640px) {
  .auth-shell,
  .app-shell {
    padding: 0.8rem;
  }

  .auth-story,
  .auth-panel,
  .panel,
  .workspace-sidebar,
  .auth-topbar,
  .topbar {
    border-radius: 22px;
    padding: 1rem;
  }

  .brand-copy strong {
    font-size: 0.92rem;
  }

  .auth-topbar,
  .topbar {
    align-items: stretch;
  }

  .header-actions > .ghost-button,
  .header-actions > .inline-form,
  .header-actions > a {
    width: 100%;
  }

  .language-form .inline-select {
    justify-content: space-between;
    width: 100%;
  }

  .language-form .inline-select span {
    flex: 0 0 auto;
  }

  .invoice-filter-row,
  .invoice-data-table tbody > tr {
    padding: 0.85rem;
  }
}
