/* ═══════════════════════════════════════════════════════════════════════════════════════════════
   Rental Blacklist – Oberfläche im RENT360-Look (v1.8.0)

   Helles Grundgerüst mit dunkler Seitenleiste, goldenem Akzent, ohne Rundungen – dieselben
   Marken-Werte wie assets/app.css des ERP (Schrift Inter, Flächen #f3f3f1 / #fff, Text #191a1d,
   Gold #b79b58, Seitenleiste #181816). Die Klassennamen sind unverändert geblieben; index.php und
   src/helpers.php mussten dafür nicht angefasst werden.
   ═══════════════════════════════════════════════════════════════════════════════════════════════ */
:root {
  --font: Inter, Arial, Helvetica, sans-serif;
  --bg: #f3f3f1;
  --bg-soft: #f8f8f6;
  --surface: #ffffff;
  --surface-2: #f8f8f6;
  --surface-3: #f1f1ee;
  --text: #191a1d;
  --text-soft: #3f3f39;
  --muted: #737780;
  --muted-2: #9c9c92;
  --line: #e6e6e2;
  --line-strong: #c4c4bb;
  --gold: #b79b58;
  --gold-light: #c8ac68;
  --gold-dark: #8e6a31;
  --gold-soft: #f4eedf;
  --danger: #9d3636;
  --danger-soft: #f7e9e9;
  --success: #2f7d4c;
  --success-soft: #e8f2ec;
  --warning: #a76b2f;
  --warning-soft: #f8efe3;
  --sidebar: #181816;
  --sb-line: rgba(255,255,255,.07);
  --sb-text: #cfcfc8;
  --sb-muted: #8a8a82;
  --sb-hover: rgba(255,255,255,.055);
  --sb-active: rgba(183,155,88,.14);
  --radius-sm: 0;
  --radius: 0;
  --radius-lg: 0;
  --sidebar-width: 256px;
  --topbar-height: 58px;
  --shadow-sm: 0 1px 2px rgba(20,20,15,.05), 0 1px 1px rgba(20,20,15,.04);
  --shadow-md: 0 6px 20px rgba(20,20,15,.07);
  --shadow: 0 18px 44px rgba(20,20,15,.14);
  --focus-ring: 0 0 0 3px rgba(200,178,116,.32);
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 13px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body::before { content: none; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, .button { -webkit-tap-highlight-color: transparent; }
svg { display: block; }

/* Application shell */
.nav-toggle-input { position: fixed; opacity: 0; pointer-events: none; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 60; width: var(--sidebar-width); display: flex; flex-direction: column; padding: 0 12px 14px; background: var(--sidebar); color: var(--sb-text); border-right: 1px solid rgba(0,0,0,.2); }
.sidebar-brand { min-height: var(--topbar-height); display: flex; align-items: center; justify-content: space-between; margin: 0 -12px 0; padding: 0 10px 0 20px; border-bottom: 1px solid var(--sb-line); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; min-width: 0; }
.brand > span:last-child { min-width: 0; }
.brand strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; }
.brand small { display: block; margin-top: 2px; color: var(--sb-muted); font-size: 9.5px; text-transform: uppercase; letter-spacing: .14em; }
.brand-mark { display: inline-grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border: 1px solid rgba(183,155,88,.55); background: var(--gold); color: #1a1712; font-weight: 800; font-size: 12px; letter-spacing: -.02em; }
.brand-mark.large { width: 56px; height: 56px; font-size: 19px; }
.sidebar-close { display: none; color: var(--sb-muted); font-size: 27px; cursor: pointer; }
.sidebar-create { display: flex; align-items: center; justify-content: center; gap: 9px; height: 40px; margin: 14px 0 4px; padding: 0 12px; border: 0; background: var(--gold); color: #1a1712; text-decoration: none; font-size: 12.5px; font-weight: 700; letter-spacing: .01em; white-space: nowrap; transition: background-color .15s ease, transform .1s ease; }
.sidebar-create:hover { background: var(--gold-light); transform: translateY(-1px); }
.sidebar-create.active { box-shadow: inset 0 0 0 2px rgba(0,0,0,.18); }
.sidebar-nav { display: flex; flex-direction: column; gap: 1px; overflow-y: auto; padding: 10px 0 6px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.14) transparent; }
.sidebar-link, .sidebar-return { position: relative; display: flex; align-items: center; gap: 11px; height: 36px; padding: 0 10px 0 12px; border: 0; color: var(--sb-text); text-decoration: none; font-size: 13.5px; font-weight: 500; white-space: nowrap; transition: background-color .12s ease, color .12s ease; }
.sidebar-link:hover, .sidebar-return:hover { color: #fff; background: var(--sb-hover); }
.sidebar-link.active { color: #fff; background: var(--sb-active); }
.sidebar-link.active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--gold); }
.sidebar-return { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--sb-line); height: auto; min-height: 46px; color: var(--gold-light); font-weight: 600; }
.nav-icon, .button-icon { width: 17px; height: 17px; flex: 0 0 auto; }
.sidebar-section-label { margin: 14px 10px 6px; color: var(--sb-muted); font-size: 9.5px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.nav-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: auto; padding: 0 6px; background: var(--gold); color: #1a1712; font-size: 10px; font-weight: 800; }
.sidebar-account { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--sb-line); }
.account-summary { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 10px; border: 0; text-decoration: none; color: var(--sb-text); transition: background-color .12s ease; }
.account-summary:hover, .account-summary.active { background: var(--sb-hover); }
.avatar { display: inline-grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border: 1px solid rgba(183,155,88,.35); background: rgba(183,155,88,.14); color: var(--gold-light); font-size: 11px; font-weight: 800; }
.avatar.small { width: 32px; height: 32px; }
.account-copy { min-width: 0; flex: 1; }
.account-copy strong, .topbar-profile strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; }
.account-copy small, .topbar-profile small { display: block; margin-top: 1px; color: var(--sb-muted); font-size: 10px; }
.topbar-profile small { color: var(--muted); }
.account-chevron { width: 14px; height: 14px; color: var(--sb-muted); }
.sidebar-account form { margin: 2px 0 0; }
.sidebar-logout { width: 100%; display: flex; align-items: center; gap: 11px; height: 36px; padding: 0 10px 0 12px; border: 0; background: transparent; color: var(--sb-muted); cursor: pointer; font-size: 12.5px; font-weight: 500; transition: background-color .12s ease, color .12s ease; }
.sidebar-logout:hover { color: #fff; background: var(--sb-hover); }
.sidebar-overlay { display: none; }
.workspace { min-height: 100vh; margin-left: var(--sidebar-width); display: flex; flex-direction: column; background: var(--bg); }
.workspace-topbar { position: sticky; top: 0; z-index: 40; min-height: var(--topbar-height); display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 8px clamp(18px, 2.6vw, 34px); background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-left, .topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-left { min-width: 0; flex: 1; }
.mobile-menu-button { display: none; width: 40px; height: 40px; place-content: center; gap: 4px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.mobile-menu-button span { display: block; width: 17px; height: 1.5px; background: var(--text); }
.global-search { position: relative; width: min(520px, 100%); margin: 0; }
.global-search .search-icon { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.global-search input { height: 40px; min-height: 40px; padding-left: 38px; border-color: var(--line); background: var(--bg-soft); font-size: 13px; }
.global-search input:focus { background: var(--surface); }
.quick-create { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border: 1px solid #1c1d20; background: #1c1d20; color: #fff; text-decoration: none; font-size: 12px; font-weight: 650; transition: background-color .15s ease; }
.quick-create:hover { background: #303136; }
.topbar-return { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none; font-size: 12px; font-weight: 650; transition: background-color .15s ease, border-color .15s ease; }
.topbar-return:hover { background: var(--bg-soft); border-color: var(--line-strong); }
.topbar-profile { min-width: 0; display: flex; align-items: center; gap: 9px; padding: 4px 5px 4px 4px; color: var(--text); text-decoration: none; }
.topbar-profile > span:last-child { max-width: 145px; }

/* Page structure */
.page { width: min(1480px, calc(100% - clamp(32px, 5vw, 68px))); margin: 0 auto; padding: clamp(22px, 2.6vw, 34px) 0 56px; flex: 1; }
.auth-page { width: min(440px, calc(100% - 28px)); min-height: calc(100vh - 75px); display: grid; place-items: center; margin: 0 auto; padding: 34px 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 0 0 22px; }
.page-head h1, .auth-card h1, .install-card h1, .install-intro h1 { margin: 3px 0 6px; font-size: clamp(22px, 2.4vw, 28px); line-height: 1.15; letter-spacing: -.02em; font-weight: 700; }
.page-head .actions { margin-top: 0; }
h2 { margin: 0 0 16px; font-size: 16px; letter-spacing: -.01em; font-weight: 700; }
.eyebrow { margin: 0; color: var(--gold); font-weight: 700; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; }
.muted { margin: 0; color: var(--muted); }
.lead { color: var(--muted); font-size: 15px; line-height: 1.7; }
.panel, .auth-card, .install-card, .dashboard-card { background: var(--surface); border: 1px solid rgba(25,26,29,.07); box-shadow: var(--shadow-sm); padding: clamp(18px, 2.2vw, 26px); }
.panel + .panel { margin-top: 17px; }
.panel.narrow { max-width: 690px; margin-left: auto; margin-right: auto; }
.auth-card { width: 100%; box-shadow: var(--shadow-md); }
.auth-brand, .install-brand { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.auth-card form { margin-top: 20px; }

/* Forms */
label { min-width: 0; display: grid; gap: 6px; color: var(--text-soft); font-size: 11px; font-weight: 700; letter-spacing: .03em; }
label small, .field-help { color: var(--muted); font-size: 10.5px; font-weight: 400; letter-spacing: 0; margin: 0; }
input, select, textarea { font-size: 13px; width: 100%; max-width: 100%; min-height: 42px; border: 1px solid #dcdedb; background: var(--surface); color: var(--text); padding: 10px 11px; outline: none; font-weight: 400; transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease; }
input::placeholder, textarea::placeholder { color: var(--muted-2); }
select { color-scheme: light; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'><path d='M5.5 8L10 12.5L14.5 8' stroke='%2377776f' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>"); background-repeat: no-repeat; background-position: right 12px center; background-size: 14px; padding-right: 34px; cursor: pointer; }
input:hover:not(:disabled):not(:focus), select:hover:not(:disabled):not(:focus), textarea:hover:not(:disabled):not(:focus) { border-color: var(--line-strong); }
input:focus, select:focus, textarea:focus { border-color: var(--gold); background: var(--surface); box-shadow: var(--focus-ring); }
input[readonly] { background: var(--bg-soft); color: var(--text-soft); }
textarea { resize: vertical; min-height: 120px; line-height: 1.55; }
input[type="file"] { padding: 7px 9px; font-size: 12px; background: var(--bg-soft); cursor: pointer; }
input[type="file"]::file-selector-button { margin-right: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 7px 12px; font-weight: 700; font-size: 11px; cursor: pointer; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--gold); width: 17px; height: 17px; min-height: 0; cursor: pointer; flex-shrink: 0; }
form > label + label, fieldset > label + label { margin-top: 14px; }
.form-grid { display: grid; gap: 14px; margin-bottom: 14px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.form-grid.three { grid-template-columns: 1.5fr .55fr 1fr; }
.user-create { grid-template-columns: 1.2fr 1.5fr .8fr auto; align-items: end; }
.align-end { align-self: end; }
fieldset { min-width: 0; border: 0; padding: 0; margin: 0 0 26px; }
legend { width: 100%; padding: 0 0 10px; margin: 0 0 16px; border-bottom: 1px solid var(--line); color: var(--text); font-size: 14px; font-weight: 700; }
.form-shell { padding: 0; overflow: hidden; }
.form-shell form { padding: 0; }
.form-section { display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 26px; padding: 22px 26px; border-bottom: 1px solid var(--line); }
.form-section:last-of-type { border-bottom: 0; }
.form-section-heading { display: flex; align-items: flex-start; gap: 11px; }
.form-section-heading .section-icon { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border: 1px solid rgba(183,155,88,.35); background: var(--gold-soft); color: var(--gold-dark); }
.form-section-heading .section-icon svg { width: 16px; height: 16px; }
.form-section-heading h2 { margin: 1px 0 4px; font-size: 14px; }
.form-section-heading p { margin: 0; color: var(--muted); font-size: 11px; font-weight: 400; }
.form-section-fields { min-width: 0; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 16px 26px; border-top: 1px solid var(--line); background: var(--bg-soft); }
.label-caption { display: inline-flex; align-items: baseline; justify-content: flex-start; gap: 4px; width: fit-content; max-width: 100%; line-height: 1.25; }
.required-marker { display: inline-block; flex: 0 0 auto; color: var(--danger); font-weight: 900; line-height: 1; }
.check { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; font-weight: 500; font-size: 12px; letter-spacing: 0; color: var(--text); }
.check input { width: 17px; height: 17px; margin-top: 1px; accent-color: var(--gold); }
.danger-check { color: var(--danger); }

/* Buttons */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 8px 13px; text-decoration: none; font-size: 12px; font-weight: 650; letter-spacing: -.01em; cursor: pointer; box-shadow: var(--shadow-sm); transition: background-color .15s ease, box-shadow .15s ease, border-color .15s ease, transform .06s ease; }
.button:hover { background: #faf9f6; border-color: var(--line-strong); }
.button.primary { margin-top: 18px; color: #fff; background: #1c1d20; border-color: #1c1d20; box-shadow: 0 4px 14px rgba(24,24,22,.2); }
.button.primary:hover { background: #303136; box-shadow: 0 6px 18px rgba(24,24,22,.26); transform: translateY(-1px); }
.button.primary:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(24,24,22,.2); }
.button.danger { border-color: rgba(157,54,54,.35); background: var(--surface); color: var(--danger); }
.button.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.button.ghost { background: transparent; box-shadow: none; }
.button.small { min-height: 32px; padding: 5px 10px; font-size: 11px; }
.button.full { width: 100%; }
.button[disabled] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
.create-customer-cta { min-height: 42px; padding: 10px 16px; font-size: 12.5px; }
.text-link { display: inline-block; color: var(--gold-dark); font-weight: 650; text-decoration: none; margin-top: 16px; }
.text-link:hover { text-decoration: underline; }
.centered { width: 100%; text-align: center; }

/* Notifications */
.alert { padding: 11px 14px; margin: 0 0 16px; border: 1px solid; border-left-width: 4px; font-size: 12.5px; background: var(--surface); }
.alert.success { color: var(--success); background: var(--success-soft); border-color: rgba(47,125,76,.35); border-left-color: var(--success); }
.alert.error { color: var(--danger); background: var(--danger-soft); border-color: rgba(157,54,54,.35); border-left-color: var(--danger); }
.alert.warning { color: var(--warning); background: var(--warning-soft); border-color: rgba(167,107,47,.35); border-left-color: var(--warning); }
.approval-banner { margin-bottom: 18px; }
.review-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.review-actions form { margin: 0; }
.notice { display: grid; gap: 6px; margin: 22px 0; padding: 14px; background: var(--gold-soft); border: 1px solid rgba(183,155,88,.35); color: var(--text-soft); }
.notice span { font-size: 12px; line-height: 1.55; }
code { background: var(--bg-soft); border: 1px solid var(--line); color: var(--text); padding: 2px 5px; font-size: 12px; overflow-wrap: anywhere; }

/* Dashboard */
.dashboard-head { align-items: center; }
.dashboard-stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 17px; }
.stat-card { min-width: 0; display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 1px solid var(--line); border-left: 4px solid var(--gold); background: var(--surface); text-decoration: none; box-shadow: var(--shadow-sm); transition: box-shadow .15s ease, border-color .15s ease; }
.stat-card:hover { box-shadow: var(--shadow-md); border-color: var(--line-strong); border-left-color: var(--gold); }
.stat-icon { display: grid; place-items: center; flex: 0 0 auto; width: 40px; height: 40px; border: 1px solid rgba(183,155,88,.3); background: var(--gold-soft); color: var(--gold-dark); }
.stat-icon svg { width: 18px; height: 18px; }
.stat-card.urgent { border-left-color: var(--warning); }
.stat-card.urgent .stat-icon { border-color: rgba(167,107,47,.3); background: var(--warning-soft); color: var(--warning); }
.stat-copy { min-width: 0; display: grid; grid-template-columns: 1fr auto; align-items: end; flex: 1; }
.stat-copy small { grid-column: 1; color: var(--muted); font-size: 11px; font-weight: 600; }
.stat-copy strong { grid-column: 2; grid-row: 1 / span 2; align-self: center; margin-left: 10px; font-size: 26px; line-height: 1; letter-spacing: -.03em; font-weight: 700; }
.stat-copy em { grid-column: 1; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted-2); font-size: 10px; font-style: normal; }
.dashboard-layout { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(310px,.75fr); gap: 17px; align-items: start; }
.dashboard-card { min-width: 0; padding: 0; overflow: hidden; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 20px 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.card-heading h2 { margin: 2px 0 0; }
.card-heading > a { display: inline-flex; align-items: center; gap: 6px; color: var(--gold-dark); text-decoration: none; font-size: 11px; font-weight: 650; white-space: nowrap; }
.card-heading > a:hover { text-decoration: underline; }
.link-icon { width: 14px; height: 14px; }
.activity-list, .approval-list { display: grid; }
.activity-item { position: relative; display: grid; grid-template-columns: auto minmax(0,1fr) auto auto; align-items: center; gap: 13px; min-height: 66px; padding: 12px 20px; border-bottom: 1px solid var(--line); text-decoration: none; transition: background-color .12s ease; }
.activity-item:last-child { border-bottom: 0; }
.activity-item:hover { background: var(--bg-soft); }
.activity-avatar { display: grid; place-items: center; width: 36px; height: 36px; background: var(--surface-3); color: var(--text-soft); font-size: 10px; font-weight: 800; }
.activity-main { min-width: 0; }
.activity-main strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 650; }
.activity-main small { display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 10.5px; }
.activity-meta { display: grid; justify-items: end; gap: 5px; }
.activity-meta time { color: var(--muted-2); font-size: 10px; }
.activity-arrow { width: 15px; height: 15px; color: var(--muted-2); }
.approval-item { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 12px; min-height: 62px; padding: 12px 18px; border-bottom: 1px solid var(--line); text-decoration: none; transition: background-color .12s ease; }
.approval-item:last-child { border-bottom: 0; }
.approval-item:hover { background: var(--bg-soft); }
.approval-icon { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid rgba(167,107,47,.3); background: var(--warning-soft); color: var(--warning); }
.approval-icon svg { width: 16px; height: 16px; }
.approval-item strong { display: block; font-size: 12px; font-weight: 650; }
.approval-item small { display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 10px; }
.approval-item time { color: var(--muted-2); font-size: 10px; white-space: nowrap; }
.dashboard-empty { padding: 40px 20px; color: var(--muted); text-align: center; font-size: 12px; }
.dashboard-empty.compact { padding: 32px 20px; }
.quick-card { padding: 24px; }
.quick-card h2 { margin: 5px 0 8px; }
.quick-card .button { margin-top: 20px; }

/* Data lists and tables */
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin-bottom: 17px; }
.metric { padding: 16px 18px; border: 1px solid var(--line); border-left: 4px solid var(--gold); background: var(--surface); box-shadow: var(--shadow-sm); }
.metric strong { display: block; font-size: 24px; line-height: 1.1; letter-spacing: -.02em; font-weight: 700; }
.metric span { display: block; margin-top: 4px; color: var(--muted); font-size: 10.5px; }
.filter-tabs { display: flex; flex-wrap: wrap; gap: 0; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.filter-tabs a { padding: 9px 13px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); text-decoration: none; font-size: 11.5px; font-weight: 650; }
.filter-tabs a:hover { color: var(--text); }
.filter-tabs a.active { border-bottom-color: var(--gold); color: var(--text); }
.searchbar { display: grid; grid-template-columns: minmax(200px,1fr) auto auto; gap: 9px; margin-bottom: 16px; }
.searchbar .button { min-height: 42px; }
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); background: var(--surface); }
table { width: 100%; border-collapse: collapse; min-width: 780px; }
th, td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { background: var(--bg-soft); color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
td { color: var(--text); font-size: 12.5px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color .12s ease; }
tbody tr:hover { background: var(--bg-soft); }
.table-title { display: block; color: var(--text); font-weight: 650; text-decoration: none; }
.table-title:hover { color: var(--gold-dark); }
td small { display: block; margin-top: 2px; color: var(--muted); font-size: 10.5px; }
.empty { text-align: center; color: var(--muted); padding: 34px; }
.badge, .status { display: inline-flex; align-items: center; padding: 3px 8px; border: 1px solid transparent; font-size: 10px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; }
.badge { background: var(--surface-3); color: var(--text-soft); border-color: var(--line); }
.status.active, .status.approved { background: var(--success-soft); color: var(--success); border-color: rgba(47,125,76,.25); }
.status.disabled { background: var(--surface-3); color: var(--muted); border-color: var(--line); }
.status.invited, .status.pending { background: var(--warning-soft); color: var(--warning); border-color: rgba(167,107,47,.25); }
.status.rejected { background: var(--danger-soft); color: var(--danger); border-color: rgba(157,54,54,.25); }
.compact-form { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin-bottom: 7px; }
.compact-form select { width: auto; min-width: 108px; min-height: 34px; padding: 5px 30px 5px 8px; font-size: 11px; }
.compact-form .button { min-height: 34px; }

/* Pagination and detail navigation */
.page-back-row { display: flex; align-items: center; margin: -4px 0 16px; }
.back-button { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 6px 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text-soft); text-decoration: none; font-size: 11.5px; font-weight: 650; transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
.back-button:hover { color: var(--text); border-color: var(--line-strong); background: var(--bg-soft); }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.pagination.single { justify-content: flex-end; }
.pagination-summary { color: var(--muted); font-size: 11px; font-weight: 500; white-space: nowrap; }
.pagination-controls, .pagination-pages { display: flex; align-items: center; gap: 4px; }
.pagination-nav, .pagination-page { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; border: 1px solid var(--line); background: var(--surface); color: var(--text-soft); text-decoration: none; font-size: 11px; font-weight: 650; transition: border-color .15s ease, background-color .15s ease, color .15s ease; }
.pagination-nav { padding: 6px 10px; }
.pagination-page { min-width: 32px; padding: 6px 9px; }
.pagination-nav:hover, .pagination-page:hover { border-color: var(--line-strong); background: var(--bg-soft); color: var(--text); }
.pagination-page.active { border-color: #1c1d20; background: #1c1d20; color: #fff; }
.pagination-nav.disabled { opacity: .4; cursor: default; }
.pagination-icon { width: 14px; height: 14px; }
.pagination-gap { display: inline-grid; place-items: center; min-width: 22px; color: var(--muted); font-size: 12px; }

/* Detail view */
.detail-grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(310px,.75fr); gap: 17px; align-items: start; }
.details { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px 30px; margin: 0; }
.details .wide { grid-column: 1 / -1; }
dt { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
dd { margin: 5px 0 0; color: var(--text); font-weight: 500; font-size: 13px; }
.preserve { white-space: pre-wrap; color: var(--text); font-weight: 400; line-height: 1.7; }
.photo-card { display: grid; gap: 8px; color: var(--gold-dark); text-decoration: none; font-size: 11px; font-weight: 650; }
.photo-card img { display: block; width: 100%; max-height: 430px; object-fit: contain; border: 1px solid var(--line); background: var(--bg-soft); }
.photo-placeholder { display: grid; place-items: center; min-height: 220px; border: 1px dashed var(--line-strong); background: var(--bg-soft); color: var(--muted); }
.danger-panel { border-color: rgba(157,54,54,.3); border-left: 4px solid var(--danger); }
.danger-zone { border-color: rgba(157,54,54,.3); }

/* Account */
.account-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 17px; align-items: start; }
.account-grid .panel { min-width: 0; }
.account-intro { margin: -8px 0 18px; }
.account-grid form > .button { margin-top: 18px; }

/* Installation and public views */
.public-body { display: flex; min-height: 100vh; flex-direction: column; background: var(--bg); }
.public-body::after { content: none; }
.install-page { width: 100%; max-width: none; min-height: calc(100vh - 70px); margin: 0; padding: 1px 0 36px; display: block; overflow-x: clip; }
.install-grid { width: min(1180px, calc(100vw - 36px)); display: grid; grid-template-columns: .82fr 1.18fr; align-items: start; gap: clamp(28px,6vw,75px); margin: 35px auto; }
.install-grid > *, .install-card, .install-card fieldset, .install-card .form-grid, .install-card label { min-width: 0; }
.install-intro { position: sticky; top: 35px; padding-top: 20px; }
.install-intro .brand-mark { margin-bottom: 22px; }
.install-card { width: 100%; }
.install-card input, .install-card select, .install-card textarea { max-width: 100%; }
.install-complete { width: min(680px, calc(100% - 28px)); margin: 50px auto; }
.form-grid.db-connection { grid-template-columns: minmax(0,1fr) minmax(110px,.28fr); }
.requirements { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.requirement { display: flex; gap: 9px; align-items: center; color: var(--text-soft); font-size: 12px; }
.requirement span { display: inline-grid; place-items: center; width: 21px; height: 21px; font-weight: 800; }
.requirement.ok span { color: var(--success); background: var(--success-soft); }
.requirement.fail span { color: var(--danger); background: var(--danger-soft); }
.footer { width: calc(100% - clamp(32px,5vw,68px)); max-width: 1480px; display: flex; justify-content: space-between; gap: 20px; margin: 0 auto 20px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 10px; }
.public-footer { max-width: 1180px; }
.persistent-key-warning { margin-bottom: 16px; }
.persistent-key-warning a { color: var(--danger); font-weight: 700; }

@media (max-width: 1220px) {
  .dashboard-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-layout { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .sidebar { transform: translateX(-102%); transition: transform .24s ease; box-shadow: 20px 0 70px rgba(0,0,0,.35); }
  .sidebar-close { display: block; }
  .workspace { margin-left: 0; }
  .mobile-menu-button { display: grid; }
  .sidebar-overlay { position: fixed; inset: 0; z-index: 50; display: block; background: rgba(24,24,22,.55); opacity: 0; visibility: hidden; transition: opacity .22s, visibility .22s; }
  .nav-toggle-input:checked ~ .app-shell .sidebar { transform: translateX(0); }
  .nav-toggle-input:checked ~ .app-shell .sidebar-overlay { opacity: 1; visibility: visible; }
  .install-grid { grid-template-columns: 1fr; max-width: 760px; }
  .install-intro { position: static; padding-top: 0; }
  .user-create { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .form-section { grid-template-columns: 1fr; gap: 17px; }
  .form-section-heading p { max-width: 560px; }
}

@media (max-width: 720px) {
  .workspace-topbar { min-height: 56px; padding: 8px 12px; }
  .global-search { width: 40px; }
  .global-search input { width: 40px; padding: 0; color: transparent; cursor: pointer; }
  .global-search input::placeholder { color: transparent; }
  .global-search:focus-within { position: absolute; left: 60px; right: 12px; z-index: 5; width: auto; }
  .global-search:focus-within input { width: 100%; padding: 10px 13px 10px 38px; color: var(--text); cursor: text; }
  .global-search:focus-within input::placeholder { color: var(--muted-2); }
  .topbar-profile > span:last-child { display: none; }
  .quick-create span, .topbar-return span { display: none; }
  .quick-create, .topbar-return { width: 38px; padding: 0; justify-content: center; }
  .page { width: min(100% - 22px, 1480px); padding-top: 20px; }
  .page-head { align-items: stretch; flex-direction: column; gap: 15px; }
  .page-head .create-customer-cta { width: 100%; }
  .dashboard-stats, .metrics { grid-template-columns: 1fr; }
  .form-grid.two, .form-grid.three, .user-create, .account-grid { grid-template-columns: 1fr; }
  .searchbar { grid-template-columns: 1fr 1fr; }
  .searchbar input { grid-column: 1 / -1; }
  .details { grid-template-columns: 1fr; }
  .details .wide { grid-column: auto; }
  .panel, .auth-card, .install-card { padding: 17px; }
  .form-shell { padding: 0; }
  .form-section { padding: 19px 16px; }
  .form-actions { padding: 16px; }
  .activity-item { grid-template-columns: auto minmax(0,1fr) auto; padding: 12px 15px; }
  .activity-meta { display: none; }
  .approval-item { padding: 12px 15px; }
  .card-heading { padding: 15px 16px; }
  .install-grid { width: calc(100% - 18px); margin-top: 18px; }
  .form-grid.db-connection { grid-template-columns: 1fr; }
  .footer { width: calc(100% - 22px); flex-direction: column; gap: 4px; }
}

@media (max-width: 420px) {
  .sidebar { width: min(88vw, 294px); }
  .dashboard-stats { gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-copy strong { font-size: 22px; }
  .searchbar { grid-template-columns: 1fr; }
  .searchbar input { grid-column: auto; }
  .button { width: 100%; }
  .actions .button, .review-actions .button { width: 100%; }
}

/* Entity types, multi-photo documents and legacy migration */
.entity-switch { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-bottom: 18px; }
.entity-option { display: block; cursor: pointer; letter-spacing: 0; }
.entity-option > input { position: absolute; opacity: 0; pointer-events: none; }
.entity-option > span { display: grid; grid-template-columns: auto minmax(0,1fr); grid-template-rows: auto auto; column-gap: 11px; align-items: center; min-height: 68px; padding: 13px 14px; border: 1px solid var(--line); background: var(--surface); transition: border-color .15s ease, background-color .15s ease; }
.entity-option:hover > span { border-color: var(--line-strong); }
.entity-option input:checked + span { border-color: var(--gold); background: var(--gold-soft); box-shadow: inset 0 0 0 1px var(--gold); }
.entity-icon { grid-row: 1 / 3; width: 22px; height: 22px; color: var(--gold-dark); }
.entity-option strong { color: var(--text); font-size: 12.5px; font-weight: 650; }
.entity-option small { margin: 1px 0 0; color: var(--muted); font-size: 10.5px; font-weight: 400; }
.company-fields { display: none; }
.customer-form:has(input[name="entity_type"][value="COMPANY"]:checked) .person-fields { display: none; }
.customer-form:has(input[name="entity_type"][value="COMPANY"]:checked) .company-fields { display: block; }
.customer-form:has(input[name="entity_type"][value="PERSON"]:checked) .person-fields { display: block; }
.customer-form:has(input[name="entity_type"][value="PERSON"]:checked) .company-fields { display: none; }
.photo-gallery { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; }
.photo-gallery .photo-card img { height: 210px; }
.existing-photo-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 11px; margin-bottom: 18px; }
.existing-photo-item { display: grid; gap: 8px; padding: 9px; border: 1px solid var(--line); background: var(--bg-soft); }
.existing-photo-item > img { width: 100%; height: 145px; object-fit: contain; background: var(--surface); }
.existing-photo-item .check { margin: 0; font-size: 10.5px; }
.review-flag { display: inline-flex; margin-left: 5px; padding: 2px 6px; border: 1px solid rgba(167,107,47,.3); background: var(--warning-soft); color: var(--warning); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.migration-stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 11px; margin-bottom: 18px; }
.migration-stat { padding: 16px; border: 1px solid var(--line); border-left: 4px solid var(--gold); background: var(--surface); }
.migration-stat strong { display: block; color: var(--text); font-size: 24px; letter-spacing: -.02em; font-weight: 700; }
.migration-stat span { display: block; margin-top: 4px; color: var(--muted); font-size: 10.5px; }
.migration-summary { display: grid; gap: 20px; }
.migration-summary > div:first-child p { max-width: 860px; margin-bottom: 0; color: var(--muted); }
.migration-summary dl { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin: 0; }
.migration-summary dl > div { padding: 13px; border: 1px solid var(--line); background: var(--bg-soft); }
.migration-summary dd { font-size: 20px; }
.migration-actions { display: flex; justify-content: space-between; gap: 18px; align-items: center; padding-top: 4px; }
.migration-actions .check { margin: 0; }
.migration-result { margin-top: 18px; }
.migration-result-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 10px; }
.migration-result-grid > div { padding: 13px; border: 1px solid var(--line); background: var(--bg-soft); }
.migration-result-grid strong { display: block; font-size: 21px; }
.migration-result-grid span { color: var(--muted); font-size: 10.5px; }
.migration-errors { margin-top: 17px; color: var(--muted); font-size: 11px; }
.migration-errors summary { cursor: pointer; color: var(--warning); font-weight: 700; }
.migration-errors ul { max-height: 260px; overflow: auto; line-height: 1.6; }
.migration-auto-panel { max-width: 980px; }
.migration-progress-head { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; margin-bottom: 12px; }
.migration-progress-head strong { color: var(--text); font-size: 28px; letter-spacing: -.03em; }
.migration-progress-head span { color: var(--muted); text-align: right; }
.migration-progress { height: 10px; overflow: hidden; margin-bottom: 20px; border: 1px solid var(--line); background: var(--bg-soft); }
.migration-progress > span { display: block; min-width: 2px; height: 100%; background: var(--gold); transition: width .35s ease; }
.migration-auto-panel .migration-stats { grid-template-columns: repeat(3,minmax(0,1fr)); }

@media (max-width: 980px) {
  .migration-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .migration-result-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .existing-photo-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 720px) {
  .entity-switch, .photo-gallery, .migration-summary dl, .migration-action-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .migration-actions { align-items: stretch; flex-direction: column; }
  .migration-actions .button { width: 100%; }
  .migration-result-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .migration-progress-head { align-items: flex-start; flex-direction: column; gap: 5px; }
  .migration-progress-head span { text-align: left; }
  .migration-auto-panel .migration-stats { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .migration-stats, .migration-result-grid, .existing-photo-grid { grid-template-columns: 1fr; }
}

.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.section-heading h2 { margin: 2px 0 7px; }
.section-heading p { margin: 0; color: var(--muted); }
.migration-action-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.migration-action-grid > .migration-actions { min-width: 0; align-content: start; display: grid; justify-content: stretch; gap: 13px; padding: 16px; border: 1px solid var(--line); background: var(--bg-soft); }
.migration-action-grid .migration-actions .button { justify-self: start; }
.migration-result.compact { margin: 0; padding: 15px; border: 1px solid var(--line); background: var(--bg-soft); }
.migration-result.compact h3 { margin: 0 0 12px; font-size: 13px; }
.migration-result.compact .migration-result-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }

/* Migration diagnostics */
.migration-diagnostics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin: 16px 0 20px; }
.migration-diagnostics > div { padding: 14px; border: 1px solid var(--line); background: var(--bg-soft); }
.migration-diagnostics dt { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.migration-diagnostics dd { margin: 6px 0 0; font-size: 17px; font-weight: 700; }
@media (max-width: 720px) { .migration-diagnostics { grid-template-columns: 1fr; } }

@media (max-width: 720px) {
  .pagination { align-items: stretch; flex-direction: column; }
  .pagination-summary { text-align: center; }
  .pagination-controls { justify-content: space-between; width: 100%; }
  .pagination-pages { max-width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .pagination-nav span { display: none; }
  .pagination-nav { min-width: 34px; padding: 6px; }
  .page-back-row { margin-top: -3px; }
}

@media (max-width: 420px) {
  .pagination-pages .pagination-page:not(.active) { display: none; }
  .pagination-gap { display: none; }
  .back-button { width: auto; }
}

/* API integration */
.api-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 18px; margin-bottom: 18px; }
.api-grid > .panel { margin: 0; }
.api-secret-panel { border-color: rgba(183,155,88,.6); border-left: 4px solid var(--gold); background: var(--gold-soft); margin-bottom: 18px; }
.api-key-secret, .code-block { margin-top: 14px; padding: 14px 16px; background: #181816; border: 1px solid #181816; overflow: auto; }
.api-key-secret code, .code-block code { font: 600 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; color: #e2c47f; background: transparent; border: 0; padding: 0; white-space: nowrap; }
.details.compact { margin-top: 16px; }
.details.compact > div { padding: 10px 0; }
.contact-cell { display: flex; flex-direction: column; gap: 3px; }
.contact-cell small { color: var(--muted); }
@media (max-width: 900px) { .api-grid { grid-template-columns: 1fr; } }

/* Personal API access in account settings */
.api-account-panel { grid-column: 1 / -1; }
.api-account-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 22px; align-items: start; }
.api-account-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.api-account-actions form { margin: 0; }
.api-account-actions .button { margin: 0; }
.account-api-secret { padding: 16px; border: 1px solid rgba(183,155,88,.6); border-left: 4px solid var(--gold); background: var(--gold-soft); margin: 16px 0; }
.api-account-details { margin-top: 0; }
.api-account-panel .card-heading { gap: 16px; align-items: flex-start; }
.api-account-panel .card-heading > .actions { margin-left: auto; }
@media (max-width: 900px) {
  .api-account-grid { grid-template-columns: 1fr; }
  .api-account-panel .card-heading { flex-direction: column; }
  .api-account-panel .card-heading > .actions { margin-left: 0; }
}

/* Live customer search */
.live-search-form { position: relative; }
.live-search-dropdown { position: absolute; z-index: 120; top: calc(100% + 6px); left: 0; right: 0; overflow: hidden; border: 1px solid var(--line-strong); background: var(--surface); box-shadow: var(--shadow); }
.live-search-dropdown[hidden] { display: none; }
.live-search-results { max-height: min(520px, 62vh); overflow-y: auto; overscroll-behavior: contain; }
.live-search-result { display: grid; grid-template-columns: 40px minmax(0,1fr) auto; align-items: center; gap: 12px; min-width: 0; padding: 11px 14px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line); transition: background-color .12s ease; }
.live-search-result:last-child { border-bottom: 0; }
.live-search-result:hover, .live-search-result.active { background: var(--bg-soft); }
.live-search-result.active { box-shadow: inset 3px 0 0 var(--gold); }
.live-search-avatar { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid rgba(183,155,88,.35); color: var(--gold-dark); background: var(--gold-soft); font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.live-search-result-body { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.live-search-result-heading { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.live-search-result-heading strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.live-search-result-heading small { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.live-search-result-meta { overflow: hidden; color: var(--muted); font-size: 11.5px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.live-search-result > .status { justify-self: end; white-space: nowrap; }
.live-search-message { padding: 18px 16px; color: var(--text-soft); text-align: center; font-size: 12.5px; }
.live-search-message.hint { color: var(--muted); }
.live-search-message.loading::before { display: inline-block; width: 13px; height: 13px; margin-right: 8px; vertical-align: -2px; content: ''; border: 2px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: live-search-spin .7s linear infinite; }
.live-search-message.error { color: var(--danger); }
.live-search-footer { border-top: 1px solid var(--line); background: var(--bg-soft); }
.live-search-footer:empty { display: none; }
.live-search-all { display: block; padding: 10px 14px; color: var(--gold-dark); font-size: 12px; font-weight: 700; text-align: center; text-decoration: none; }
.live-search-all:hover { background: var(--gold-soft); }
@keyframes live-search-spin { to { transform: rotate(360deg); } }
.global-search .live-search-dropdown { left: 0; right: 0; min-width: 420px; }
.searchbar .live-search-dropdown { grid-column: 1 / -1; }
@media (max-width: 760px) {
  .global-search .live-search-dropdown { min-width: 0; }
  .live-search-result { grid-template-columns: 36px minmax(0,1fr); padding: 10px 12px; }
  .live-search-avatar { width: 36px; height: 36px; }
  .live-search-result > .status { display: none; }
  .live-search-result-heading { align-items: flex-start; flex-direction: column; gap: 1px; }
}

/* Compact account settings */
.account-page-head { align-items: center; margin-bottom: 15px; }
.account-page-head h1 { margin: 2px 0 0; font-size: clamp(22px, 2.4vw, 28px); }
.account-title-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 16px; }
.account-email { color: var(--muted); font-size: 13px; font-weight: 500; }
.account-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; align-items: start; }
.account-settings-grid .panel { min-width: 0; margin: 0; }
.account-settings-grid .panel + .panel { margin-top: 0; }
.account-card { padding: 18px 20px; }
.account-card-header { min-height: 40px; display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.account-card-header h2 { margin: 0 0 2px; font-size: 15px; }
.account-card-header p:not(.eyebrow) { font-size: 11px; line-height: 1.4; }
.account-card-icon { display: grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; border: 1px solid rgba(183,155,88,.35); background: var(--gold-soft); color: var(--gold-dark); }
.account-card-svg { width: 16px; height: 16px; }
.account-compact-form { display: grid; gap: 11px; }
.account-compact-form label { gap: 5px; font-size: 11px; }
.account-compact-form input { min-height: 40px; padding: 9px 11px; }
.account-compact-form > .button { width: fit-content; min-height: 36px; margin-top: 2px; padding: 8px 13px; }
.api-card-header { align-items: center; flex-wrap: wrap; }
.api-card-header > div:nth-child(2) { min-width: 100px; }
.account-doc-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.account-doc-actions .button { min-height: 32px; padding: 6px 9px; font-size: 11px; }
.account-api-content { display: grid; gap: 11px; }
.account-api-card .api-account-details { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 12px; margin: 0; }
.account-api-card .api-account-details > div { min-width: 0; padding: 7px 0; }
.account-api-card .api-account-details dt { font-size: 9px; }
.account-api-card .api-account-details dd { margin-top: 3px; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.account-api-card .api-account-details code { font-size: 11px; white-space: nowrap; }
.account-api-card .api-account-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 0; }
.account-api-card .api-account-actions form { margin: 0; }
.account-api-card .api-account-actions .button { min-height: 34px; padding: 7px 10px; font-size: 11px; }
.account-endpoint { display: grid; gap: 5px; min-width: 0; padding-top: 10px; border-top: 1px solid var(--line); }
.account-endpoint > span { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.account-endpoint code { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 8px 9px; font-size: 10.5px; }
.account-api-note { font-size: 10.5px; line-height: 1.45; }
.account-api-card .account-api-secret { margin: 0 0 12px; padding: 12px; }
.account-api-card .account-api-secret h3 { margin: 2px 0 4px; font-size: 14px; }
.account-api-card .account-api-secret p { font-size: 10.5px; }
.account-api-card .api-key-secret { margin-top: 8px; padding: 9px 10px; }
.account-api-card .api-key-secret code { font-size: 10.5px; }
.account-card .alert { margin-bottom: 12px; padding: 9px 11px; font-size: 11.5px; }
.account-api-card { grid-column: 1 / -1; padding: 15px 18px; }
.account-api-card .account-card-header { min-height: 36px; margin-bottom: 9px; }
.account-api-card .account-card-icon { width: 34px; height: 34px; }
.account-api-card .account-card-header h2 { font-size: 15px; }
.account-api-card .account-card-header .eyebrow { margin-bottom: 1px; font-size: 9px; }
.account-api-card .account-api-content { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(250px, .95fr) auto; grid-template-rows: auto auto; align-items: center; gap: 5px 18px; }
.account-api-card .api-account-details { grid-column: 1; grid-row: 1 / span 2; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 14px; }
.account-api-card .api-account-details > div { padding: 4px 0; }
.account-api-card .api-account-actions { grid-column: 3; grid-row: 1 / span 2; justify-content: flex-end; flex-wrap: nowrap; }
.account-api-card .account-endpoint { grid-column: 2; grid-row: 1; padding-top: 0; border-top: 0; }
.account-api-card .account-endpoint code { padding: 6px 8px; }
.account-api-card .account-api-note { grid-column: 2; grid-row: 2; margin: 0; }
.account-api-card .account-api-secret { margin: 0 0 9px; padding: 10px 12px; }

@media (max-width: 1120px) {
  .account-api-card .account-api-content { grid-template-columns: minmax(0, 1fr) minmax(230px, .8fr); }
  .account-api-card .api-account-details { grid-column: 1; grid-row: 1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-api-card .account-endpoint { grid-column: 2; grid-row: 1; }
  .account-api-card .account-api-note { grid-column: 2; grid-row: 2; }
  .account-api-card .api-account-actions { grid-column: 1; grid-row: 2; justify-content: flex-start; }
}

@media (max-width: 760px) {
  .account-title-row { display: grid; gap: 3px; }
  .account-settings-grid { grid-template-columns: 1fr; }
  .account-api-card { grid-column: auto; }
  .account-api-card .account-api-content { grid-template-columns: 1fr; gap: 9px; }
  .account-api-card .api-account-details,
  .account-api-card .account-endpoint,
  .account-api-card .account-api-note,
  .account-api-card .api-account-actions { grid-column: 1; grid-row: auto; }
  .account-api-card .api-account-actions { justify-content: flex-start; flex-wrap: wrap; }
  .account-doc-actions { width: 100%; margin-left: 47px; }
}
