:root {
  --bg: #0b1017;
  --bg-elevated: #121923;
  --bg-muted: #182030;
  --border: #243041;
  --text: #eef2f7;
  --text-muted: #9aa8bc;
  --muted: #9aa8bc;
  --accent: #0f6e7c;
  --accent-hover: #128496;
  --accent-soft: rgba(15, 110, 124, 0.16);
  --success: #3ecf8e;
  --warning: #f5b942;
  --danger: #ef6464;
  --radius: 12px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  --font: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.hidden { display: none !important; }

.brand-mark {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffd27a, #f59e0b 55%, #c2410c 100%);
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.45);
  display: inline-block;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(circle at 20% 20%, rgba(15, 110, 124, 0.18), transparent 35%),
    radial-gradient(circle at 80% 0%, rgba(245, 158, 11, 0.12), transparent 28%),
    var(--bg);
}

.login-card {
  width: min(100%, 420px);
  padding: 2rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  display: grid;
  gap: 1rem;
}

.login-card h1 {
  margin: 0.75rem 0 0.25rem;
  font-size: 1.5rem;
}

.login-card p {
  margin: 0;
  color: var(--text-muted);
}

label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

input, select, textarea {
  width: 100%;
  padding: 0.75rem 0.875rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-muted);
  color: var(--text);
  font: inherit;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(15, 110, 124, 0.35);
  border-color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.72rem 1rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}

.btn-sm { padding: 0.45rem 0.7rem; font-size: 0.8125rem; }

.form-error, .form-status {
  min-height: 1.25rem;
  margin: 0;
  font-size: 0.875rem;
}

.form-error { color: var(--danger); }
.form-status { color: var(--success); }

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
}

.sidebar {
  border-right: 1px solid var(--border);
  background: var(--bg-elevated);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 0.5rem;
}

.sidebar-brand strong { display: block; font-size: 1rem; }
.sidebar-brand small { color: var(--text-muted); }

.sidebar-nav {
  display: grid;
  gap: 1rem;
  overflow-y: auto;
  max-height: calc(100vh - 11rem);
  padding-right: 0.15rem;
}

.nav-group {
  display: grid;
  gap: 0.35rem;
}

.nav-group-label {
  margin: 0 0 0.15rem;
  padding: 0 0.7rem;
  color: var(--text-muted);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.nav-item {
  text-align: left;
  padding: 0.72rem 0.85rem;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.nav-item span {
  display: block;
  color: inherit;
}

.nav-item small {
  display: block;
  margin-top: 0.15rem;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 500;
}

.nav-item-secondary {
  padding: 0.5rem 0.8rem;
  font-size: 0.82rem;
}

.nav-item:hover,
.nav-item.is-active {
  background: var(--accent-soft);
  color: var(--text);
}

.nav-more {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 0.35rem;
}

.nav-more-toggle {
  width: 100%;
  text-align: left;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.5rem 0.8rem;
  font-size: 0.82rem;
  border: none;
  background: transparent;
  font: inherit;
  font-weight: 500;
  border-radius: 10px;
}

.nav-more-toggle::after {
  content: ">";
  float: right;
  transition: transform 0.15s ease;
}

.nav-more.is-open .nav-more-toggle {
  color: var(--text);
  background: var(--accent-soft);
}

.nav-more.is-open .nav-more-toggle::after {
  transform: rotate(90deg);
}

.nav-more-menu {
  display: grid;
  gap: 0.25rem;
  padding-top: 0.25rem;
}

.sidebar-foot {
  margin-top: auto;
  display: grid;
  gap: 0.5rem;
  padding: 0.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.main {
  padding: 1.5rem;
  min-width: 0;
}

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

.topbar h2 {
  margin: 0;
  font-size: 1.5rem;
}

.topbar p {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  gap: 0.75rem;
}

.panel {
  display: grid;
  gap: 1rem;
}

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

.stat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  min-width: 0;
  overflow: hidden;
}

.stat-card strong {
  display: block;
  font-size: 1.75rem;
  line-height: 1.1;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.stat-card span {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.panel-block,
.toolbar,
.settings-form {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.pricing-form {
  margin-top: 1rem;
}

.pricing-grid {
  border: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem 1rem;
}

.pricing-group-title {
  grid-column: 1 / -1;
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 600;
}

.pricing-group-note {
  grid-column: 1 / -1;
  margin: 0 0 0.25rem;
  font-size: 0.8125rem;
}

.pricing-studio-dedicated span em {
  font-style: normal;
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.pricing-studio-map-note {
  line-height: 1.5;
}

.pricing-grid label span {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.panel-head {
  margin-bottom: 0.75rem;
}

.panel-head h3,
.settings-form h3 {
  margin: 0;
  font-size: 1rem;
}

.muted {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.toolbar input,
.toolbar select {
  width: auto;
  min-width: 220px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

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

.data-table th {
  color: var(--text-muted);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.02);
}

.data-table tbody tr {
  cursor: pointer;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--bg-muted);
  color: var(--text-muted);
}

.badge-new { background: rgba(62, 207, 142, 0.14); color: var(--success); }
.badge-contacted { background: rgba(245, 185, 66, 0.14); color: var(--warning); }
.badge-paid,
.badge-won,
.badge-delivered { background: rgba(15, 110, 124, 0.18); color: #7dd3fc; }
.badge-lost { background: rgba(239, 100, 100, 0.14); color: var(--danger); }
.badge-client-request {
  background: rgba(0, 212, 160, 0.14);
  color: #00D4A0;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
}
.badge-admin-run {
  background: rgba(154, 168, 188, 0.12);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
}

.modal {
  border: none;
  padding: 0;
  background: transparent;
  color: var(--text);
  width: min(720px, calc(100vw - 2rem));
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.modal-card {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadow);
  margin: 0;
  width: 100%;
}

.modal-head h3 {
  margin: 0;
  color: var(--text);
}

.modal-head,
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  background: var(--bg-elevated);
}

.modal-foot {
  border-bottom: none;
  border-top: 1px solid var(--border);
  justify-content: flex-end;
}

.modal-body {
  padding: 1rem 1.1rem 1.1rem;
  display: grid;
  gap: 0.85rem;
  color: var(--text);
  background: var(--bg-elevated);
}

.modal-body p,
.modal-body li,
.modal-body td,
.modal-body label {
  color: inherit;
}

.modal-body a {
  color: #7dd3fc;
}

.modal-body a:hover {
  color: #bae6fd;
  text-decoration: underline;
}

.modal-body .data-table th {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
}

.modal-body .data-table td {
  color: var(--text);
}

.modal-body .data-table tbody tr:hover {
  background: rgba(15, 110, 124, 0.12);
}

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

.detail-grid .full { grid-column: 1 / -1; }

.detail-block {
  display: grid;
  gap: 0.45rem;
}

.detail-block > span {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 500;
}

.client-link-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.customer-section {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-muted);
}

.customer-section:first-child {
  margin-top: 0;
}

.customer-section h4 {
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: #7dd3fc;
  letter-spacing: 0.02em;
}

.customer-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 1rem;
  padding: 0.85rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
}

.customer-profile-grid p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--text);
}

.customer-profile-grid strong {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.customer-admin-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.customer-admin-form label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--text);
}

.customer-admin-form label span {
  font-weight: 600;
  color: var(--text-muted);
}

.customer-admin-form input,
.customer-admin-form select {
  width: 100%;
}

.customer-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: end;
  grid-column: 1 / -1;
}

.modal-body .customer-section .table-wrap {
  max-height: 220px;
  overflow: auto;
  background: rgba(0, 0, 0, 0.18);
  border-color: var(--border);
}

.modal-card-wide.is-customer-profile {
  width: min(980px, calc(100vw - 2rem));
}

.modal-card-wide.is-customer-profile .modal-body {
  max-height: min(72vh, 780px);
  overflow-y: auto;
}

#detail-modal.is-customer-profile {
  width: min(980px, calc(100vw - 2rem));
}

.client-link-row input {
  flex: 1;
  min-width: 0;
}

.deliverable-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.deliverable-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.deliverable-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.upload-field {
  display: grid;
  gap: 0.35rem;
}

.upload-field input[type="file"] {
  width: 100%;
}

.icon-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 1.25rem;
  cursor: pointer;
}

.settings-form {
  display: grid;
  gap: 1rem;
  max-width: 720px;
}

.modal-card-wide {
  width: min(960px, 96vw);
}

.modal-card-wide .modal-body {
  max-height: min(68vh, 720px);
  overflow-y: auto;
}

.production-meta-grid {
  margin-bottom: 0.25rem;
}

.production-meta-grid p {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.review-output-primary {
  border-color: rgba(15, 110, 124, 0.45);
}

.review-pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.55;
  margin: 0;
  max-height: 420px;
  overflow: auto;
  color: var(--text);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem;
}

.review-pre-compact {
  max-height: 160px;
  margin-top: 0.5rem;
}

.review-empty {
  margin: 0;
  color: var(--text-muted);
  font-style: italic;
}

.review-media-panel .review-media {
  margin: 0.75rem 0 0;
}

.review-media img,
.review-media video {
  display: block;
  max-width: 100%;
  max-height: 360px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #000;
}

.review-media audio {
  width: 100%;
  margin-top: 0.5rem;
}

.review-brief-meta {
  margin-top: 0.75rem;
}

.review-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.review-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
}

.review-panel h4 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.production-foot {
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
}

.review-notes-field {
  display: grid;
  gap: 0.35rem;
  width: 100%;
}

.production-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.asset-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.asset-list a {
  color: var(--accent);
}

.quota-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
}

.quota-badge-warning {
  color: #f5c542;
  border-color: rgba(245, 197, 66, 0.45);
  background: rgba(245, 197, 66, 0.08);
}

.quota-badge-blocked {
  color: #ff7b7b;
  border-color: rgba(255, 123, 123, 0.45);
  background: rgba(255, 123, 123, 0.08);
}

.quota-badge-muted {
  color: var(--muted);
}

.insights-list {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--muted);
  line-height: 1.6;
}

/* Founder OS v2 */
.action-center-block {
  border-color: rgba(245, 185, 66, 0.35);
  background: linear-gradient(180deg, rgba(245, 185, 66, 0.08), var(--bg-elevated));
}

.action-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.action-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-muted);
}

.action-item span {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.action-urgent { border-color: rgba(239, 100, 100, 0.5); background: rgba(239, 100, 100, 0.08); }
.action-high { border-color: rgba(245, 185, 66, 0.45); }
.action-ok { border-color: rgba(62, 207, 142, 0.35); }

.founder-toolbar {
  justify-content: space-between;
}

.export-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.founder-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 1100px) {
  .founder-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .founder-section[data-founder-section="free-sample"] {
    grid-column: 1 / -1;
  }
}

.founder-kpis {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.founder-subheading {
  margin: 1rem 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
}

.trust-grid {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.overview-loading {
  text-align: center;
  padding: 2rem 1rem;
}

.action-info { border-color: rgba(15, 110, 124, 0.45); }

.trend {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
}

.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }
.trend-flat { color: var(--text-muted); }

.funnel-step {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

.funnel-step-head {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
}

.funnel-step-head span {
  font-size: 1.25rem;
  font-weight: 700;
}

.funnel-meta {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.funnel-arrow {
  text-align: center;
  color: var(--text-muted);
  padding: 0.15rem 0;
}

.funnel-bottleneck {
  margin: 0.75rem 0 0;
  color: var(--warning);
  font-size: 0.875rem;
}

.funnel-toolbar {
  flex-wrap: wrap;
  gap: 0.5rem;
}

.funnel-date,
.funnel-segment-value {
  max-width: 10rem;
}

.funnel-viz {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.5rem 0;
}

.funnel-viz-step {
  display: flex;
  justify-content: center;
}

.funnel-viz-bar {
  min-width: 8rem;
  max-width: 100%;
  background: linear-gradient(90deg, rgba(0, 212, 160, 0.25), rgba(0, 212, 160, 0.08));
  border: 1px solid rgba(0, 212, 160, 0.35);
  border-radius: 0.5rem;
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.75rem;
  transition: width 0.3s ease;
}

.funnel-viz-label {
  font-weight: 600;
  flex: 1 1 auto;
}

.funnel-viz-count {
  font-size: 1.25rem;
  font-weight: 700;
}

.funnel-viz-pct {
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 600;
}

.progress-bar {
  height: 10px;
  border-radius: 999px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  overflow: hidden;
  margin: 0.5rem 0;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}

.progress-warning .progress-fill { background: var(--warning); }
.progress-danger .progress-fill { background: var(--danger); }

.capacity-panel h4 {
  margin: 0 0 0.5rem;
  font-size: 0.9375rem;
}

.sparkline {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  min-height: 52px;
  margin-top: 0.75rem;
}

.spark-bar {
  flex: 1;
  min-width: 4px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
  opacity: 0.85;
}

.row-overdue td {
  background: rgba(239, 100, 100, 0.08);
}

.provider-warning .stat-card strong {
  color: var(--warning);
}

.founder-mobile-bar {
  display: none;
}

.founder-limitations {
  font-size: 0.8125rem;
  line-height: 1.5;
}

.founder-kpis .stat-card strong {
  font-size: 1.45rem;
}

.founder-funnel-table {
  font-size: 0.8125rem;
}

.founder-cost-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.finance-kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.finance-card {
  position: relative;
  display: grid;
  gap: 0.35rem;
  min-height: 112px;
  border-color: rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015)),
    var(--bg-elevated);
}

.finance-card strong,
.founder-cost-grid .stat-card strong {
  font-size: clamp(1.08rem, 2.4vw, 1.55rem);
  letter-spacing: -0.02em;
  white-space: normal;
}

.finance-card span,
.founder-cost-grid .stat-card span {
  line-height: 1.25;
}

.finance-card small,
.founder-cost-grid .stat-card small {
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.finance-card-good {
  border-color: rgba(62, 207, 142, 0.35);
  background:
    linear-gradient(180deg, rgba(62, 207, 142, 0.09), rgba(62, 207, 142, 0.025)),
    var(--bg-elevated);
}

.finance-card-warning {
  border-color: rgba(245, 185, 66, 0.38);
  background:
    linear-gradient(180deg, rgba(245, 185, 66, 0.1), rgba(245, 185, 66, 0.025)),
    var(--bg-elevated);
}

.finance-card-danger {
  border-color: rgba(239, 100, 100, 0.42);
  background:
    linear-gradient(180deg, rgba(239, 100, 100, 0.1), rgba(239, 100, 100, 0.025)),
    var(--bg-elevated);
}

.finance-card-good strong { color: var(--success); }
.finance-card-warning strong { color: var(--warning); }
.finance-card-danger strong { color: var(--danger); }

.finance-status-line {
  margin: 0.75rem 0 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* AI Cost Intelligence */
.ai-cost-split {
  align-items: start;
}
.ai-cost-alerts {
  display: grid;
  gap: 0.65rem;
}
.ai-cost-alert {
  border-radius: 10px;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}
.ai-cost-alert strong {
  display: block;
  margin-bottom: 0.25rem;
}
.ai-cost-alert p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.ai-alert-warning {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
}
.ai-alert-critical {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.1);
}
.ai-cost-chart-legend {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.ai-legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.35rem;
  vertical-align: middle;
}
.ai-legend-rev { background: #00D4A0; }
.ai-legend-cost { background: #F59E0B; }
.ai-cost-bars {
  display: flex;
  gap: 4px;
  align-items: flex-end;
  min-height: 72px;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}
.ai-cost-bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 28px;
  flex-shrink: 0;
}
.ai-cost-bar-group small {
  font-size: 0.625rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}
.ai-cost-bar-pair {
  display: flex;
  gap: 2px;
  align-items: flex-end;
  height: 56px;
}
.ai-cost-bar {
  width: 10px;
  border-radius: 2px 2px 0 0;
  min-height: 3px;
}
.ai-cost-bar-rev { background: #00D4A0; opacity: 0.9; }
.ai-cost-bar-cost { background: #F59E0B; opacity: 0.85; }
.ai-cost-margin-spark {
  min-height: 52px;
}
.ai-cost-jobs-table {
  font-size: 0.75rem;
}
.ai-cost-jobs-table th,
.ai-cost-jobs-table td {
  white-space: nowrap;
}

.founder-sample-detail {
  margin-top: 1rem;
}

@media (max-width: 960px) {
  .founder-mobile-bar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .founder-section[data-founder-section="funnel"],
  .founder-section[data-founder-section="traffic"],
  .founder-section[data-founder-section="insights"],
  .founder-section[data-founder-section="ai"] {
    display: none;
  }

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

  .export-links .btn:nth-child(n+4) {
    display: none;
  }
}

@media (max-width: 640px) {
  .founder-mobile-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .founder-section:not([data-founder-section="revenue"]):not([data-founder-section="leads"]):not([data-founder-section="projects"]):not([data-founder-section="free-sample"]) {
    display: none;
  }

  .action-center-block {
    order: -1;
  }
}

.split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.inline-form input {
  min-width: 120px;
}

.status-panel {
  font-size: 0.9rem;
  line-height: 1.6;
}

@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: none;
  }
  .sidebar-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: none;
    overflow: visible;
  }
  .nav-item {
    text-align: center;
    font-size: 0.8125rem;
    padding: 0.55rem 0.4rem;
  }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { flex-direction: column; }
  .split-grid { grid-template-columns: 1fr; }
  .review-columns { grid-template-columns: 1fr; }
  .founder-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .export-links {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .stats-grid { grid-template-columns: 1fr; }
  .toolbar input, .toolbar select { width: 100%; min-width: 0; }
}

.trust-card { border-left: 3px solid var(--border); }
.trust-card .trust-sub {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.75rem;
  font-style: normal;
  color: var(--text-muted);
}
.trust-card.trust-ok { border-left-color: #18a957; }
.trust-card.trust-warn { border-left-color: #d99100; }
.trust-card.trust-danger { border-left-color: #d64545; }
.trust-warnings { margin-top: 0.75rem; line-height: 1.6; }

/* Customer Success */
.cs-dashboard-kpis .stat-card.cs-health-green strong { color: #18a957; }
.cs-dashboard-kpis .stat-card.cs-health-yellow strong { color: #d99100; }
.cs-dashboard-kpis .stat-card.cs-health-red strong { color: #d64545; }

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

.cs-mini-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cs-mini-item {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.cs-mini-item:last-child { border-bottom: none; }

.cs-mini-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.cs-mini-meta {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
}

.cs-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.82rem;
}

.cs-score--green { background: rgba(24, 169, 87, 0.16); color: #18a957; }
.cs-score--yellow { background: rgba(217, 145, 0, 0.16); color: #d99100; }
.cs-score--red { background: rgba(214, 69, 69, 0.16); color: #d64545; }

.cs-risk {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.cs-risk--green { background: rgba(24, 169, 87, 0.12); color: #18a957; }
.cs-risk--yellow { background: rgba(217, 145, 0, 0.12); color: #d99100; }
.cs-risk--red { background: rgba(214, 69, 69, 0.12); color: #d64545; }

.cs-insights-list {
  margin: 0;
  padding-left: 1.1rem;
  line-height: 1.6;
}

.cs-insight-cell {
  max-width: 260px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

@media (max-width: 960px) {
  .cs-dashboard-columns { grid-template-columns: 1fr; }
}

/* ─── Notification & Automation Engine ─────────────────────────────────────── */
.automation-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.automation-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.auto-tab {
  background: transparent; border: 1px solid #2a2a2a; color: #aaa;
  padding: 6px 14px; border-radius: 999px; cursor: pointer; font-size: 13px;
}
.auto-tab.is-active { background: #00c896; border-color: #00c896; color: #06231c; font-weight: 600; }
.automation-toolbar-actions { display: flex; align-items: center; gap: 8px; }
.automation-pill {
  font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px solid #2a2a2a; color: #ccc;
}
.automation-pill.is-live { background: rgba(255,107,107,0.15); border-color: #ff6b6b; color: #ff9b9b; }
.automation-pill.is-dry { background: rgba(0,200,150,0.12); border-color: #00c896; color: #6fe3c4; }
.automation-pill.is-off { opacity: 0.6; }
.auto-section { margin-top: 8px; }
.auto-badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; text-transform: uppercase; }
.auto-badge-ok { background: rgba(0,200,150,0.18); color: #6fe3c4; }
.auto-badge-warn { background: rgba(255,196,0,0.18); color: #ffd866; }
.auto-badge-bad { background: rgba(255,107,107,0.18); color: #ff9b9b; }
.auto-badge-muted { background: #222; color: #888; }
.auto-form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 12px 0; }
.auto-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #aaa; }
.auto-field input, .auto-field select, .auto-field textarea {
  background: #141414; border: 1px solid #2a2a2a; color: #eee; border-radius: 8px; padding: 8px;
}
.auto-form-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.auto-cond-row { display: grid; grid-template-columns: 1.4fr 0.8fr 1fr auto; gap: 8px; margin-bottom: 8px; }
.auto-cond-row select, .auto-cond-row input {
  background: #141414; border: 1px solid #2a2a2a; color: #eee; border-radius: 8px; padding: 8px;
}
.auto-preview { margin-top: 12px; padding: 12px; background: #fff; color: #111; border-radius: 8px; }
.auto-checkbox { display: flex; align-items: center; gap: 8px; }
@media (max-width: 960px) {
  .auto-form-grid { grid-template-columns: 1fr; }
  .auto-cond-row { grid-template-columns: 1fr 1fr; }
}

/* Admin simplification: home, messages, access labels */
.admin-section-intro {
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}
.admin-section-intro h3 { margin: 0.35rem 0 0.25rem; }
.admin-section-intro p { margin: 0; color: var(--text-muted); }
.access-chip {
  display: inline-flex;
  align-items: center;
  width: max-content;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.access-chip.normal { color: var(--success); background: rgba(62,207,142,0.12); border: 1px solid rgba(62,207,142,0.24); }
.access-chip.advanced { color: var(--warning); background: rgba(245,185,66,0.12); border: 1px solid rgba(245,185,66,0.24); }
.admin-home-grid,
.message-hub-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 1rem;
  margin-bottom: 1rem;
}
.admin-home-summary { grid-column: 1 / -1; }
.admin-home-kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.quick-action-grid {
  display: grid;
  gap: 0.55rem;
}
.quick-action {
  text-align: left;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-muted);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.quick-action:hover { border-color: var(--accent); background: var(--accent-soft); }
.status-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.7rem;
}
.status-card {
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,0.025);
}
.status-card strong { display: block; font-size: 1.05rem; }
.status-card span { display: block; color: var(--text-muted); font-size: 0.82rem; }
.status-card small { display: block; color: var(--text-muted); margin-top: 0.25rem; }
.status-card.status-ok { border-color: rgba(62,207,142,0.28); }
.status-card.status-warn { border-color: rgba(245,185,66,0.35); }
.action-list.compact { margin: 0; padding: 0; }
.compact-form { gap: 0.65rem; }
.form-row-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.message-summary-list { display: grid; gap: 0.65rem; }
.message-summary-list article {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-muted);
}
.message-summary-list strong { display: block; }
.message-summary-list span { color: var(--text-muted); font-size: 0.82rem; }
.insights-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.insight-card {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}
.insight-card h3 { margin: 0 0 0.4rem; }
.insight-card p { color: var(--text-muted); min-height: 3rem; }
@media (max-width: 960px) {
  .admin-home-grid,
  .message-hub-grid { grid-template-columns: 1fr; }
}

/* ─── Multi-market pricing (Iran) ─────────────────────────────────────────── */
.pricing-market-switch { margin-bottom: 1rem; }
.seg-control {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid var(--border, #d8dee9);
  border-radius: 10px;
  background: var(--surface-2, #f4f6fb);
}
.seg-btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
  color: var(--text-muted, #5b6472);
}
.seg-btn.is-active {
  background: var(--accent, #2f6df4);
  color: #fff;
  font-weight: 600;
}

.pricing-grid-iran { display: grid; gap: 0.5rem; }
.iran-price-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem 1rem;
  align-items: start;
  padding: 0.75rem;
  border: 1px solid var(--border, #e2e6ee);
  border-radius: 10px;
  background: var(--surface, #fff);
}
.iran-price-labels-edit {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}
.iran-label-field {
  display: grid;
  gap: 0.2rem;
  font-size: 0.82rem;
}
.iran-label-field span {
  color: var(--text-muted, #7a8290);
  font-weight: 600;
}
.iran-label-field input[type="text"] {
  width: 100%;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border, #d1d5db);
  font-size: 0.88rem;
}
.iran-price-labels-edit em {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted, #9aa3af);
  font-style: normal;
}
.iran-price-label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-weight: 600;
}
.iran-price-label em {
  font-style: normal;
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--text-muted, #7a8290);
}
.iran-price-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.iran-price-controls input[type="number"] {
  width: 140px;
  text-align: left;
  direction: ltr;
  font-variant-numeric: tabular-nums;
}
.iran-price-unit { font-size: 0.85rem; color: var(--text-muted, #7a8290); }
.iran-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  white-space: nowrap;
}
.iran-review-note { font-size: 0.78rem; opacity: 0.85; }
.pricing-warning {
  margin: 0.5rem 0 0.75rem;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  border: 1px solid #f0c36d;
  background: #fff6e0;
  color: #7a5a10;
  font-size: 0.88rem;
}

.credit-packages-table-wrap { overflow-x: auto; margin: 0.75rem 0 1rem; }
.credit-packages-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.credit-packages-table th,
.credit-packages-table td {
  padding: 0.45rem 0.35rem;
  border-bottom: 1px solid var(--border, #e5e7eb);
  vertical-align: middle;
}
.credit-packages-table th {
  text-align: left;
  font-size: 0.78rem;
  color: var(--text-muted, #7a8290);
  font-weight: 600;
}
.credit-packages-table input[type="number"],
.credit-packages-table input[type="text"] {
  width: 100%;
  min-width: 64px;
  padding: 0.3rem 0.4rem;
  border-radius: 6px;
  border: 1px solid var(--border, #d1d5db);
  font-size: 0.85rem;
}
.credit-packages-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

