:root {
  --bg: #eef3f7;
  --bg-soft: #f7fafc;
  --surface: #ffffff;
  --surface-2: #f9fbff;
  --text: #0f172a;
  --muted: #5f6b7a;
  --line: #dde5ef;
  --line-strong: #c9d5e5;
  --brand: #0f766e;
  --brand-strong: #0a4f50;
  --accent: #0b4a8a;
  --success: #166534;
  --warning: #92400e;
  --danger: #b42318;
  --shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 18px 42px rgba(15, 23, 42, 0.1);
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: 'Barlow', sans-serif;
  background:
    radial-gradient(circle at 8% -10%, rgba(15, 118, 110, 0.18), transparent 36%),
    radial-gradient(circle at 100% 10%, rgba(11, 74, 138, 0.14), transparent 32%),
    var(--bg);
}

.auth-shell-react {
  min-height: 100vh;
  background: #000;
}

.auth-form-section {
  background: #000;
  padding: 44px 16px 72px;
  display: grid;
  place-items: center;
}

.auth-form-card-dark {
  width: min(560px, 100%);
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  padding: 18px;
  color: #fff;
}

.auth-form-card-dark h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
  color: #fff;
}

.auth-form-card-dark > p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
}

.auth-form-card-dark form {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.auth-form-card-dark label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
}

.auth-form-card-dark input {
  width: 100%;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 10px 12px;
}

.auth-form-card-dark input::placeholder {
  color: rgba(255, 255, 255, 0.58);
}

.auth-form-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.auth-form-row p {
  margin: 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
}

.auth-form-btn {
  border: 1px solid #fff;
  border-radius: 2px;
  background: #000;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 16px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.auth-form-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.auth-form-toggle {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  margin-left: 5px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-form-status {
  margin: 0;
  min-height: 20px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
}

.dashboard-hero-inline {
  margin: 0 0 16px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: #000;
}

.auth-hero-shell {
  min-height: 100vh;
}

.crm-hero {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.crm-hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.crm-hero-layer {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.crm-hero-nav {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 30px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.crm-hero-brand {
  color: #fff;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.crm-hero-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.crm-hero-link {
  border: none;
  background: transparent;
  color: #fff;
  border-radius: 2px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.crm-hero-link:hover {
  background: rgba(255, 255, 255, 0.1);
}

.crm-hero-btn {
  border: none;
  border-radius: 2px;
  background: #f8f8f8;
  color: #171717;
  font-size: 15px;
  font-weight: 500;
  padding: 10px 18px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.crm-hero-btn:hover {
  background: #fff;
}

.crm-hero-content-wrap {
  min-height: calc(100vh - 92px);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 0 20px 250px;
}

.crm-hero-content {
  position: relative;
  width: min(1080px, 100%);
  text-align: center;
  color: #fff;
}

.corner-dot {
  position: absolute;
  width: 7px;
  height: 7px;
  background: #fff;
}

.corner-tl {
  top: -3.5px;
  left: -3.5px;
}

.corner-tr {
  top: -3.5px;
  right: -3.5px;
}

.corner-bl {
  bottom: -3.5px;
  left: -3.5px;
}

.corner-br {
  bottom: -3.5px;
  right: -3.5px;
}

.crm-featured-ring {
  display: inline-flex;
  margin-bottom: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
  padding: 4px;
  transition: background-color 0.2s ease;
}

.crm-featured-ring:hover {
  background: rgba(255, 255, 255, 0.15);
}

.crm-featured-pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 8px 18px;
  color: #171717;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.crm-featured-pill:hover {
  background: #fff;
}

.crm-title-main {
  margin: 0;
  font-size: 64px;
  font-weight: 300;
  line-height: 1.03;
  color: #fff;
}

.crm-title-accent {
  margin: 6px 0 0;
  font-size: 64px;
  font-weight: 400;
  line-height: 1.03;
  font-style: italic;
  font-family: 'Instrument Serif', serif;
  color: #fff;
}

.crm-subtitle {
  margin: 28px auto 0;
  max-width: 760px;
  font-size: 20px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.75);
}

.crm-cta-row {
  margin-top: 26px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.crm-auth-panel {
  margin: 26px auto 0;
  width: min(560px, 100%);
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
  padding: 18px;
  text-align: left;
}

.crm-auth-panel h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
  color: #fff;
}

.crm-auth-panel > p {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
}

.crm-auth-panel form {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.crm-auth-panel label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
}

.crm-auth-panel input {
  width: 100%;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 10px 12px;
}

.crm-auth-panel input::placeholder {
  color: rgba(255, 255, 255, 0.58);
}

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

.crm-auth-actions p {
  margin: 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
}

.crm-auth-toggle {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  margin-left: 5px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.crm-auth-status {
  margin: 0;
  min-height: 20px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
}

h1,
h2,
h3,
h4,
p,
ul {
  margin: 0;
}

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

a {
  color: inherit;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.auth-card {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: 1.15fr 0.9fr;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.auth-hero {
  padding: 42px;
  color: #e2f7f5;
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 255, 255, 0.16), transparent 35%),
    linear-gradient(145deg, #0a4f50, #0f766e 56%, #0b4a8a);
  display: grid;
  gap: 18px;
}

.auth-hero h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(28px, 3vw, 40px);
  letter-spacing: -0.02em;
}

.auth-hero p {
  line-height: 1.6;
  max-width: 46ch;
}

.auth-hero ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 12px;
}

.auth-hero li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-hero li::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #b8fff9;
  box-shadow: 0 0 0 5px rgba(184, 255, 249, 0.24);
}

.auth-form-wrap {
  padding: 42px;
  display: grid;
  align-content: center;
  gap: 10px;
}

.auth-form-wrap h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
}

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

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

.sidebar {
  background: linear-gradient(180deg, #fdfefe, #f4f8fb);
  border-right: 1px solid var(--line);
  padding: 18px 14px;
  display: grid;
  gap: 18px;
  grid-template-rows: auto 1fr auto;
}

.brand-card {
  background: linear-gradient(135deg, #0f766e, #0b4a8a);
  color: #e6f6ff;
  padding: 14px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
}

.brand-card h1 {
  font-size: 15px;
  font-family: 'Space Grotesk', sans-serif;
  margin-bottom: 2px;
}

.brand-card p {
  font-size: 12px;
  opacity: 0.9;
}

.nav-links {
  display: grid;
  gap: 6px;
}

.nav-link {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 11px 12px;
  text-decoration: none;
  color: #0f172a;
  font-weight: 600;
  transition: 0.2s ease;
}

.nav-link:hover {
  border-color: #d7e4f6;
  background: #edf4ff;
}

.nav-link.active {
  color: #0b4a8a;
  border-color: #bad4ff;
  background: #e8f2ff;
  box-shadow: inset 0 0 0 1px #d8e7ff;
}

.sidebar-footer {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
  display: grid;
  gap: 10px;
  background: #fff;
}

.sidebar-footer p {
  font-size: 12px;
  color: var(--muted);
  word-break: break-word;
}

.main-area {
  display: grid;
  grid-template-rows: auto 1fr;
}

.top-header {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
}

.header-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px;
  letter-spacing: -0.02em;
}

.header-subtitle {
  color: var(--muted);
  margin-top: 3px;
  font-size: 14px;
}

.header-meta {
  color: #0b4a8a;
  font-size: 13px;
  font-weight: 600;
}

.content {
  padding: 20px;
  display: grid;
  gap: 16px;
}

.panel {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 16px;
}

.panel.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.panel-head.wrap {
  flex-wrap: wrap;
}

.panel-head h3,
.panel-head h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
}

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

.metric-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff, #f9fbff);
}

.metric-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.metric-value {
  font-size: 28px;
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: -0.02em;
}

.stage-list {
  display: grid;
  gap: 10px;
}

.stage-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) 3fr 36px;
  gap: 10px;
  align-items: center;
}

.stage-label {
  font-size: 12px;
  color: #1e293b;
}

.stage-track {
  height: 10px;
  background: #eef2f8;
  border-radius: 999px;
  overflow: hidden;
}

.stage-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #0f766e, #0b4a8a);
  border-radius: inherit;
}

.stage-count {
  font-size: 12px;
  color: #334155;
  text-align: right;
}

.activity-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.activity-list li {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface-2);
}

.activity-list li p {
  font-size: 13px;
}

.activity-list li small {
  color: var(--muted);
  font-size: 12px;
}

.activity-list.compact li {
  justify-content: flex-start;
}

.table-wrap {
  overflow-x: auto;
}

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

.data-table th,
.data-table td {
  border-bottom: 1px solid #e9eef5;
  padding: 10px;
  text-align: left;
  font-size: 13px;
  vertical-align: middle;
}

.data-table th {
  color: #516176;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  background: #e0f2fe;
  color: #075985;
  border: 1px solid #bae6fd;
  font-size: 12px;
  font-weight: 700;
}

.score-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 700;
}

.score-pill.high {
  background: #dcfce7;
  border-color: #bbf7d0;
  color: #166534;
}

.score-pill.mid {
  background: #fef3c7;
  border-color: #fde68a;
  color: #92400e;
}

.score-pill.low {
  background: #fee2e2;
  border-color: #fecaca;
  color: #991b1b;
}

.table-stage {
  min-width: 130px;
}

.toolbar-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1.5fr 1fr 1fr;
  margin-bottom: 12px;
}

.toolbar-grid.ai-tools {
  margin-bottom: 16px;
}

.inline-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

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

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

.form-grid.single {
  grid-template-columns: 1fr;
}

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

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
  color: var(--text);
  transition: 0.18s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #7aa8e8;
  box-shadow: 0 0 0 4px rgba(122, 168, 232, 0.2);
}

textarea {
  min-height: 130px;
  resize: vertical;
}

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

.status-line {
  color: var(--muted);
  font-size: 13px;
}

.primary-btn,
.secondary-btn,
.danger-btn,
.link-btn {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.primary-btn {
  background: linear-gradient(135deg, #0f766e, #0b4a8a);
  color: white;
  box-shadow: 0 8px 18px rgba(11, 74, 138, 0.28);
}

.primary-btn:hover {
  transform: translateY(-1px);
}

.secondary-btn {
  background: #ecf3ff;
  color: #0b4a8a;
  border: 1px solid #d4e4ff;
}

.secondary-btn:hover {
  background: #e4efff;
}

.secondary-btn.small,
.danger-btn.small {
  padding: 7px 10px;
  font-size: 12px;
}

.danger-btn {
  background: #fee4e2;
  color: var(--danger);
  border: 1px solid #fecaca;
}

.link-btn {
  padding: 0;
  background: transparent;
  color: #0b4a8a;
}

.ghost-link {
  color: #0b4a8a;
  font-weight: 600;
  text-decoration: none;
}

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

.empty-state,
.empty-tile {
  border: 1px dashed #ccd7e6;
  border-radius: 12px;
  background: #f7fafe;
  padding: 16px;
  text-align: center;
  color: #4f5f75;
}

.pipeline-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.pipeline-column {
  background: #f8fbff;
  border: 1px solid #dbe7f7;
  border-radius: 14px;
  padding: 10px;
  min-height: 320px;
}

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

.pipeline-head h3 {
  font-size: 13px;
  font-family: 'Space Grotesk', sans-serif;
}

.pipeline-head span {
  font-size: 12px;
  color: #4b5c76;
}

.pipeline-list {
  display: grid;
  gap: 9px;
}

.pipeline-card {
  background: #fff;
  border: 1px solid #d8e3f3;
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: 7px;
  box-shadow: var(--shadow-sm);
}

.pipeline-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pipeline-card header h4 {
  font-size: 13px;
}

.pipeline-card p {
  font-size: 12px;
  color: #475569;
}

.pipeline-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 12px;
}

.pipeline-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-output {
  background: #f7fafe;
  border: 1px solid #d8e3f2;
  border-radius: 12px;
  padding: 12px;
  min-height: 180px;
  max-height: 440px;
  overflow: auto;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.58;
}

.subject-list,
.summary-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.subject-list li,
.summary-list li {
  font-size: 14px;
  color: #1f2937;
}

.next-action {
  border: 1px solid #dbe7f5;
  background: #f8fbff;
  border-radius: 12px;
  padding: 12px;
}

.next-action h4 {
  margin-bottom: 8px;
  font-size: 15px;
  font-family: 'Space Grotesk', sans-serif;
}

.next-action ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 7px;
}

@media (max-width: 1320px) {
  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pipeline-grid {
    grid-template-columns: repeat(3, minmax(250px, 1fr));
  }
}

@media (max-width: 1080px) {
  .crm-hero-links {
    display: none;
  }

  .crm-title-main,
  .crm-title-accent {
    font-size: 52px;
  }

  .crm-subtitle {
    font-size: 18px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .panel.two-col {
    grid-template-columns: 1fr;
  }

  .toolbar-grid {
    grid-template-columns: 1fr;
  }

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

  .form-grid {
    grid-template-columns: 1fr;
  }

  .full {
    grid-column: 1;
  }

  .auth-card {
    grid-template-columns: 1fr;
  }

  .auth-hero,
  .auth-form-wrap {
    padding: 28px;
  }
}

@media (max-width: 700px) {
  .dashboard-hero-inline {
    margin: 0 0 14px;
    border-radius: 14px;
  }

  .crm-hero-nav {
    padding-top: 20px;
  }

  .crm-hero-content-wrap {
    padding-left: 14px;
    padding-right: 14px;
  }

  .crm-title-main,
  .crm-title-accent {
    font-size: 42px;
  }

  .crm-subtitle {
    font-size: 16px;
    margin-top: 20px;
  }

  .crm-auth-panel {
    padding: 14px;
  }

  .content {
    padding: 14px;
  }

  .top-header {
    padding: 14px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .header-title {
    font-size: 21px;
  }

  .panel {
    padding: 12px;
  }
}
