:root {
  color-scheme: light;
  --bg: #f8fafc;
  --panel: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #059669;
  --danger: #dc2626;
  --warning: #d97706;
  --sidebar-w: 248px;
  --sidebar-bg: #0b1220;
  --sidebar-border: #1e293b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.hidden { display: none !important; }

/* ── Login ── */
.login-screen {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

.login-left {
  background: linear-gradient(145deg, #0b1220 0%, #1e3a5f 50%, #2563eb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  color: #fff;
}

.login-brand {
  max-width: 360px;
}

.login-mark, .brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: block;
  flex-shrink: 0;
  object-fit: contain;
}

.login-mark {
  margin-bottom: 24px;
}

.brand-mark {
  margin-bottom: 0;
}

.brand-mark:not(img) {
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -.03em;
}

.login-brand h1 {
  margin: 0 0 12px;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.login-brand p {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: rgba(255,255,255,.75);
}

.login-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  background: #fff;
}

.login-form {
  width: min(100%, 380px);
  display: grid;
  gap: 16px;
}

.login-form h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.login-lead {
  margin: -8px 0 8px;
  color: var(--muted);
  font-size: 15px;
}

.login-form label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
}

.login-form input {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  transition: border-color .15s, box-shadow .15s;
}

.login-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.login-legal {
  margin: 16px 0 0;
  text-align: center;
  font-size: 13px;
}

.login-legal a {
  color: var(--muted);
  text-decoration: none;
}

.login-legal a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* ── App shell ── */
.shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 40;
  transition: transform .22s ease;
}

.sidebar-close,
.mobile-header {
  display: none;
}

.sidebar-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.sidebar-close:hover {
  background: #1e293b;
  color: #e2e8f0;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(15, 23, 42, .45);
  display: none;
}

.mobile-header {
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.mobile-header-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.sidebar-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}

.sidebar-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  border-radius: 999px;
  background: currentColor;
}

body.sidebar-open {
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px;
  border-bottom: 1px solid var(--sidebar-border);
}

.brand-mark {
  margin-bottom: 0;
  flex-shrink: 0;
  font-size: 14px;
  overflow: hidden;
}

.brand-mark.has-logo {
  background: #fff;
  padding: 4px;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-title {
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
}

.brand-user {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.brand-org {
  font-size: 11px;
  color: #475569;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
}

.nav-group {
  margin-bottom: 16px;
}

.nav-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #475569;
  padding: 0 10px 6px;
}

.nav-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: #94a3b8;
  padding: 9px 10px;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background .12s, color .12s;
}

.nav-item:hover {
  background: #1e293b;
  color: #e2e8f0;
}

.nav-item.active {
  background: var(--primary);
  color: #fff;
  font-weight: 500;
}

.nav-item.subtle {
  font-size: 13px;
  color: #64748b;
}

.sidebar-footer {
  padding: 10px;
  border-top: 1px solid var(--sidebar-border);
  display: grid;
  gap: 2px;
}

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 28px 32px 48px;
  min-width: 0;
}

.page-intro {
  margin-bottom: 24px;
}

.page-intro h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.page-intro p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  min-height: 84px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-card .label {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.stat-card .value {
  font-size: 22px;
  font-weight: 700;
  margin-top: 8px;
  line-height: 1.2;
  word-break: break-word;
}

.stat-card.highlight {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #eff6ff 0%, var(--panel) 100%);
}

.stat-card.highlight .value {
  color: #1d4ed8;
}

.dashboard-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.login-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  margin: 16px 0;
}

.login-divider::before,
.login-divider::after {
  content: "";
  height: 1px;
  background: var(--border);
}

.btn-google {
  background: #fff;
  color: #1f2937;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
}

.btn-google::before {
  content: "G";
  display: inline-flex;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #4285f4;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  align-items: center;
  justify-content: center;
}

#googleLoginBtn:not(.hidden) {
  margin-top: 0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 20px;
}

.panel-head {
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.panel-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}

.panel > .field-hint {
  margin: 0 0 16px;
}

#view-dashboard .panel {
  margin-bottom: 24px;
}

#view-dashboard .panel:last-child {
  margin-bottom: 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.stack-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.stack-layout .panel {
  margin-bottom: 0;
}

.form {
  display: grid;
  gap: 12px;
}

.form-wide { max-width: 540px; }

.form label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
}

.form input,
.form select,
.form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
}

.checkbox {
  display: flex !important;
  align-items: center;
  gap: 8px;
  font-weight: 400 !important;
}

.checkbox input { width: auto; }

.line-items { display: grid; gap: 8px; }

.line-items-block {
  display: grid;
  gap: 8px;
}

.line-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(4.5rem, 5rem) minmax(6rem, 7rem);
  gap: 8px;
  align-items: end;
}

.line-item-field {
  display: grid;
  gap: 4px;
  margin: 0;
  min-width: 0;
}

.line-item-field input {
  min-width: 0;
  width: 100%;
}

.line-item-desc {
  min-width: 0;
}

.line-item-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--primary);
  color: white;
}

.btn:hover { background: var(--primary-dark); }
.btn-block { width: 100%; padding: 13px; font-size: 15px; border-radius: 10px; }
.btn.secondary { background: #eff6ff; color: var(--primary); }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn.danger { background: #fee2e2; color: var(--danger); }
.btn.saved {
  background: #047857;
  border-color: #047857;
  color: #fff;
  cursor: default;
}
.btn.saved:hover { background: #047857; }

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge.ok { background: #d1fae5; color: var(--success); }
.badge.warn { background: #fef3c7; color: var(--warning); }
.badge.bad { background: #fee2e2; color: var(--danger); }

.connection-status {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--border);
  font-size: 14px;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table {
  min-width: 760px;
}

th, td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.45;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}

td.cell-customer {
  min-width: 120px;
  max-width: 200px;
  word-break: break-word;
}

td.actions {
  min-width: 96px;
  white-space: normal;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.action-menu {
  position: relative;
  display: inline-block;
}

.action-menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  min-width: 168px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 12px 32px rgba(15, 23, 42, .12);
}

.action-menu-item {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  text-align: left;
  text-decoration: none;
  padding: 9px 10px;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.action-menu-item:hover {
  background: #f8fafc;
}

.action-menu-item.danger {
  color: var(--danger);
}

.status-bar {
  margin-bottom: 16px;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14px;
}

.status-bar.info { background: #eff6ff; color: #1d4ed8; }
.status-bar.success { background: #ecfdf5; color: #047857; }
.status-bar.error { background: #fef2f2; color: #b91c1c; }

.form-error {
  margin: 0;
  color: var(--danger);
  font-size: 14px;
}

.design-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.design-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 0;
}

.design-nav-item {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 10px;
  padding: 12px 14px;
  text-align: left;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  color: var(--text);
}

.design-nav-item:hover { border-color: #93c5fd; background: #f8fafc; }
.design-nav-item.active {
  border-color: var(--primary);
  background: #eff6ff;
  color: var(--primary);
}

.design-panels { min-width: 0; }

.design-panel { display: none; }
.design-panel.active { display: block; }

.design-panel .panel { margin-bottom: 0; }

.logo-field {
  display: grid;
  gap: 10px;
}

.logo-field .field-label {
  font-size: 14px;
  font-weight: 600;
}

.logo-preview-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
}

.logo-preview-wrap img {
  max-height: 48px;
  max-width: 180px;
  object-fit: contain;
}

.file-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px dashed #93c5fd;
  background: #eff6ff;
  color: var(--primary);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.file-upload-btn:hover { background: #dbeafe; }

.addon-templates-list,
.invoice-addons-section {
  display: grid;
  gap: 12px;
}

.addon-template-row,
.invoice-addon-row {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
}

.addon-template-row {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  align-items: end;
}

.invoice-addons-section .section-label {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.invoice-addon-row .addon-enable {
  margin: 0;
}

.customer-mode {
  border: none;
  margin: 0 0 16px;
  padding: 0;
}

.customer-mode legend {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.segmented {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.segmented label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.segmented label:has(input:checked) {
  border-color: var(--primary);
  background: #eff6ff;
  color: var(--primary);
}

.segmented input { margin: 0; }

.invoice-preview {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  max-width: 520px;
  width: 100%;
}

.preview-header { padding: 20px; color: #fff; }
.preview-body { padding: 20px; background: #fff; }
.preview-footer {
  padding: 12px 20px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
}

.panel-span { grid-column: 1 / -1; }

.field-hint {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.form > .field-hint,
.form label + .field-hint {
  margin-top: 4px;
}

.sandbox-oauth-hint {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 8%, var(--panel));
}

.sandbox-oauth-hint ol {
  margin: 8px 0 0;
  padding-left: 1.2rem;
}

.sandbox-oauth-hint li + li {
  margin-top: 4px;
}
}

.search-input {
  width: 100%;
  margin-top: 10px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
}

.contacts-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 20px;
  align-items: start;
}

.contacts-list {
  display: grid;
  gap: 6px;
  max-height: 620px;
  overflow-y: auto;
}

.contact-row {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  font: inherit;
  transition: border-color .12s, background .12s;
}

.contact-row:hover { border-color: #93c5fd; background: #f8fafc; }
.contact-row.active { border-color: var(--primary); background: #eff6ff; }

.contact-row-name { font-weight: 600; font-size: 14px; }
.contact-row-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }

.products-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(300px, 380px);
  gap: 20px;
  align-items: start;
}

.products-list,
.product-picker-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 520px;
  overflow-y: auto;
}

.product-row {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  font: inherit;
  transition: border-color .12s, background .12s;
}

.product-row:hover { border-color: #93c5fd; background: #f8fafc; }
.product-row.active { border-color: var(--primary); background: #eff6ff; }

.product-row-name { font-weight: 600; font-size: 14px; }
.product-row-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }

.product-picker {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: #f8fafc;
}

.product-picker-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.product-picker-search {
  min-width: 180px;
  max-width: 260px;
}

.product-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  font: inherit;
  transition: border-color .12s, background .12s, transform .12s;
}

.product-chip:hover {
  border-color: var(--primary);
  background: #eff6ff;
  transform: translateY(-1px);
}

.product-chip-name { font-size: 13px; font-weight: 600; }
.product-chip-price { font-size: 12px; color: var(--muted); }

.panel-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.badge.subtle {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: #1d4ed8;
  background: #dbeafe;
  border-radius: 999px;
  padding: 2px 8px;
}

.form-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}

@media (max-width: 900px) {
  .contacts-layout { grid-template-columns: 1fr; }
  .products-layout { grid-template-columns: 1fr; }

  .line-item {
    grid-template-columns: minmax(0, 1fr) minmax(3.5rem, 4.5rem) minmax(5rem, 6rem);
    gap: 6px;
  }
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .45);
}

.modal-card {
  position: relative;
  width: min(100%, 420px);
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0,0,0,.18);
}

.modal-card-wide {
  width: min(100%, 640px);
  max-height: calc(100vh - 48px);
  overflow: auto;
}

.invoice-detail-body {
  display: grid;
  gap: 16px;
}

.invoice-detail-meta {
  display: grid;
  gap: 8px;
  font-size: 14px;
  line-height: 1.5;
}

.invoice-detail-meta strong {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  display: inline-block;
  min-width: 88px;
}

.invoice-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  table-layout: fixed;
}

.invoice-detail-table th,
.invoice-detail-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  word-break: break-word;
}

.invoice-detail-table th:nth-child(1),
.invoice-detail-table td:nth-child(1) {
  width: 55%;
}

.invoice-detail-table th:nth-child(2),
.invoice-detail-table td:nth-child(2) {
  width: 15%;
}

.invoice-detail-table th:nth-child(3),
.invoice-detail-table td:nth-child(3) {
  width: 30%;
}

.invoice-detail-table th:last-child,
.invoice-detail-table td:last-child {
  text-align: right;
}

.invoice-detail-totals {
  display: grid;
  gap: 6px;
  justify-items: end;
  font-size: 14px;
}

.invoice-detail-totals .total {
  font-size: 18px;
  font-weight: 700;
}

.invoice-row {
  cursor: pointer;
}

.invoice-row:hover {
  background: #f8fafc;
}

.link-btn {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  text-align: left;
}

.link-btn:hover {
  text-decoration: underline;
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.table-pagination-label {
  font-size: 13px;
  color: var(--muted);
}

.modal-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.modal-message {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.account-details-list {
  margin: 0;
  display: grid;
  gap: 16px;
}

.account-details-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  align-items: baseline;
}

.account-details-row dt {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.account-details-row dd {
  margin: 0;
  font-size: 15px;
}

@media (max-width: 768px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-left { min-height: 200px; padding: 32px 24px; }
  .login-left h1 { font-size: 28px; }
  .mobile-header,
  .sidebar-close {
    display: flex;
  }
  .sidebar-backdrop:not(.hidden) {
    display: block;
  }
  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(0, 0, 0, .25);
  }
  .main {
    margin-left: 0;
    padding: 16px 16px 40px;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 20px;
  }
  .stat-card {
    padding: 12px;
    min-height: 72px;
  }
  .stat-card .value {
    font-size: 18px;
    margin-top: 6px;
  }
  .page-intro h2 {
    font-size: 22px;
  }
  #view-dashboard .data-table {
    min-width: 0;
  }
  #view-dashboard .data-table thead {
    display: none;
  }
  #view-dashboard .data-table tbody tr {
    display: block;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 12px;
    padding: 12px 14px;
    background: #fff;
  }
  #view-dashboard .data-table tbody tr:last-child {
    margin-bottom: 0;
  }
  #view-dashboard .data-table td {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 8px 0;
    border-bottom: none;
  }
  #view-dashboard .data-table td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    line-height: 1.45;
  }
  #view-dashboard .data-table td.actions {
    grid-template-columns: 1fr;
    padding-top: 10px;
    margin-top: 4px;
    border-top: 1px solid var(--border);
  }
  #view-dashboard .data-table td.actions::before {
    margin-bottom: 2px;
  }
  .action-menu-panel {
    right: auto;
    left: 0;
  }
  .line-item {
    grid-template-columns: 1fr;
  }
  .line-item-field { margin-bottom: 4px; }
  .design-layout { grid-template-columns: 1fr; }
  .design-nav { flex-direction: row; flex-wrap: wrap; position: static; }
  .account-details-row { grid-template-columns: 1fr; gap: 4px; }
}
