:root {
  --bg: #090909;
  --bg-2: #111111;
  --panel: #141414;
  --panel-2: #1a1a1a;
  --panel-3: #101010;
  --line: rgba(201, 164, 92, 0.14);
  --line-strong: rgba(201, 164, 92, 0.24);
  --text: #f4efe6;
  --muted: #b1a38a;
  --gold: #c9a45c;
  --gold-soft: rgba(201, 164, 92, 0.14);
  --gold-strong: #dfba72;
  --danger: #d48b8b;
  --warning: #d9b27a;
  --success: #8fbd9d;
  --shadow: 0 24px 50px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(201, 164, 92, 0.11), transparent 20%),
    linear-gradient(180deg, #070707, #0c0c0c 40%, #090909);
  font-family: "Avenir Next", "Segoe UI", Inter, system-ui, sans-serif;
}

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

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

.app-sidebar {
  padding: 28px 20px;
  border-right: 1px solid var(--line);
  background: rgba(10, 10, 10, 0.96);
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand h1,
.topbar h2,
.surface-head h3 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  letter-spacing: 0.01em;
}

.brand-kicker,
.label {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--gold);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.sidebar-copy,
.topbar-copy,
.muted {
  color: var(--muted);
}

.tab-nav {
  display: grid;
  gap: 8px;
  margin: 30px 0;
}

.tab-button {
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.tab-button:hover,
.tab-button.is-active {
  color: var(--text);
  background: linear-gradient(180deg, rgba(201, 164, 92, 0.12), rgba(201, 164, 92, 0.05));
  border-color: var(--line);
}

.sidebar-panel,
.surface,
.stat-card,
.stack-item,
.metric-item,
.directory-row,
.kanban-column,
.lead-card {
  background: linear-gradient(180deg, rgba(25, 25, 25, 0.98), rgba(15, 15, 15, 0.98));
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.sidebar-panel {
  padding: 16px;
  margin-top: 16px;
}

.app-main {
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  padding-bottom: 22px;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.top-search {
  min-width: 340px;
}

.btn {
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(180deg, var(--gold-strong), var(--gold));
  color: #16110a;
}

.btn-secondary {
  background: #141414;
  color: var(--text);
}

.stats-grid,
.content-grid,
.metric-list,
.stack-list,
.toolbar-form,
.form-grid,
.directory-list,
.kanban-board {
  display: grid;
  gap: 16px;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 20px;
}

.stat-card {
  padding: 18px;
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 28px;
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.content-grid {
  margin-bottom: 20px;
}

.two-col {
  grid-template-columns: 1.05fr 0.95fr;
}

.leads-layout {
  grid-template-columns: 1.25fr 0.75fr;
}

.surface {
  padding: 18px;
}

.surface-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.surface-divider {
  height: 1px;
  background: var(--line);
  margin: 18px 0;
}

.stack-item,
.metric-item {
  padding: 14px;
}

.stack-item strong,
.metric-item strong {
  display: block;
  margin-bottom: 6px;
}

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

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

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

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

.span-2 {
  grid-column: span 2;
}

input,
select {
  width: 100%;
  min-height: 46px;
  padding: 12px 13px;
  border-radius: 12px;
  border: 1px solid rgba(201, 164, 92, 0.12);
  background: #0e0e0e;
  color: var(--text);
}

input::placeholder {
  color: #8e816d;
}

.toggle {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 46px;
  padding: 12px 13px;
  border-radius: 12px;
  border: 1px solid rgba(201, 164, 92, 0.12);
  background: #0e0e0e;
}

.toggle input {
  width: 16px;
  min-height: auto;
}

.directory-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.8fr 0.8fr 0.9fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
}

.tag-row,
.lead-actions,
.inline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag,
.agent-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
}

.tag {
  background: var(--gold-soft);
  color: var(--gold);
}

.tag.high {
  background: rgba(212, 139, 139, 0.12);
  color: var(--danger);
}

.tag.medium {
  background: rgba(217, 178, 122, 0.16);
  color: var(--warning);
}

.agent-chip {
  background: rgba(143, 189, 157, 0.12);
  color: var(--success);
}

.agent-chip.off {
  background: rgba(212, 139, 139, 0.12);
  color: var(--danger);
}

.kanban-board {
  grid-template-columns: repeat(6, minmax(260px, 1fr));
  overflow-x: auto;
  padding-bottom: 8px;
}

.kanban-column {
  min-height: 520px;
  padding: 14px;
  background: linear-gradient(180deg, rgba(23, 23, 23, 0.98), rgba(14, 14, 14, 0.98));
}

.kanban-column h4 {
  margin: 0;
}

.kanban-meta {
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 12px;
}

.lead-card {
  padding: 14px;
  margin-bottom: 12px;
  border-left: 3px solid rgba(201, 164, 92, 0.35);
}

.lead-card:last-child {
  margin-bottom: 0;
}

.action-btn {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #101010;
  color: var(--text);
  cursor: pointer;
}

.empty {
  color: var(--muted);
  font-style: italic;
}

@media (max-width: 1280px) {
  .app-shell,
  .two-col,
  .leads-layout,
  .stats-grid,
  .metric-list,
  .toolbar-form,
  .form-grid,
  .settings-grid,
  .directory-row {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: static;
    height: auto;
  }

  .topbar {
    flex-direction: column;
  }

  .top-search {
    min-width: 100%;
  }
}
