:root {
  --bg: #edf3f1;
  --bg-accent: radial-gradient(circle at top left, rgba(255, 255, 255, 0.95), rgba(237, 243, 241, 0.7) 40%, rgba(221, 233, 229, 0.5) 100%);
  --panel: rgba(255, 255, 255, 0.88);
  --panel-strong: #ffffff;
  --line: rgba(17, 34, 29, 0.1);
  --text: #15231f;
  --muted: #5c6e68;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --accent-soft: rgba(15, 118, 110, 0.1);
  --warning: #b45309;
  --danger: #b42318;
  --danger-soft: rgba(180, 35, 24, 0.12);
  --success: #166534;
  --new: #365314;
  --sent: #075985;
  --accepted: #6d28d9;
  --done: #166534;
  --shadow: 0 18px 48px rgba(20, 35, 31, 0.08);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(11, 87, 83, 0.08), transparent 35%),
    linear-gradient(180deg, rgba(227, 235, 232, 0.8), rgba(237, 243, 241, 1)),
    var(--bg);
  color: var(--text);
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

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

.shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  padding: 28px;
  border-right: 1px solid var(--line);
  background: rgba(15, 23, 20, 0.96);
  color: #eff8f5;
}

.brand {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 32px;
}

.brand-copy {
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(135deg, #34d399, #0f766e);
  color: white;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.brand h1,
.hero h2,
.section-heading h3,
.assignment-header h4,
#dialogTitle {
  margin: 0;
  font-weight: 700;
}

.hero h2,
.section-heading h3,
.assignment-header h4,
#dialogTitle {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

.brand h1 {
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  letter-spacing: 0.05em;
  line-height: 1.2;
  white-space: nowrap;
}

.brand-line {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-subtitle {
  margin: 0;
  padding-left: 14px;
  border-left: 1px solid rgba(239, 248, 245, 0.28);
  color: rgba(239, 248, 245, 0.92);
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sidebar .eyebrow,
.sidebar .panel-label,
.sidebar .team-title {
  color: rgba(239, 248, 245, 0.72);
}

.sidebar-panel {
  margin-top: 22px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
}

.panel-label {
  margin: 0 0 14px;
  font-size: 0.9rem;
  font-weight: 600;
}

.workflow-list {
  margin: 0;
  padding-left: 18px;
  color: rgba(239, 248, 245, 0.9);
  display: grid;
  gap: 10px;
}

.team-columns {
  display: grid;
  gap: 16px;
}

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

.team-group li {
  color: rgba(239, 248, 245, 0.92);
  font-size: 0.95rem;
}

.main-content {
  padding: 30px;
  background: var(--bg-accent);
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-end;
  margin-bottom: 24px;
}

.hero h2 {
  font-size: clamp(2rem, 3vw, 3.2rem);
  max-width: 12ch;
}

.hero-title-inline {
  max-width: none !important;
  white-space: nowrap;
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(1.5rem, 2.4vw, 2.3rem);
  letter-spacing: 0.04em;
}

.hero-copy {
  max-width: 64ch;
  color: var(--muted);
  margin: 12px 0 0;
}

.card,
.summary-footer {
  background: var(--panel);
  backdrop-filter: blur(22px);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow);
  border-radius: var(--radius-lg);
}

.toolbar,
.table-card,
.summary-footer {
  padding: 22px;
}

.filter-grid,
.stats-grid,
.summary-grid {
  display: grid;
  gap: 16px;
}

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

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

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

.field,
.checkbox-field {
  display: grid;
  gap: 8px;
}

.field span,
.checkbox-field legend {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus,
button:focus {
  outline: 2px solid rgba(15, 118, 110, 0.18);
  outline-offset: 2px;
}

textarea {
  resize: vertical;
}

.primary-button,
.secondary-button,
.icon-button,
.sort-button {
  border: 0;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.primary-button:hover,
.secondary-button:hover,
.icon-button:hover,
.sort-button:hover {
  transform: translateY(-1px);
}

.primary-button {
  padding: 14px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: white;
  font-weight: 700;
}

.secondary-button {
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(20, 35, 31, 0.06);
  color: var(--text);
  font-weight: 600;
}

.danger-button {
  background: rgba(180, 35, 24, 0.1);
  color: var(--danger);
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(20, 35, 31, 0.08);
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 18px;
}

.table-meta {
  color: var(--muted);
  font-size: 0.95rem;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1100px;
}

th,
td {
  text-align: left;
  padding: 16px 14px;
  border-top: 1px solid rgba(17, 34, 29, 0.08);
  vertical-align: top;
}

th {
  padding-top: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-top: 0;
}

tbody tr {
  transition: background-color 0.18s ease;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.65);
}

.sort-button {
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
}

.row-company {
  font-weight: 700;
}

.row-subtext,
.muted {
  color: var(--muted);
  font-size: 0.92rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
}

.badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.badge-new {
  background: rgba(54, 83, 20, 0.1);
  color: var(--new);
}

.badge-sent {
  background: rgba(7, 89, 133, 0.1);
  color: var(--sent);
}

.badge-accepted {
  background: rgba(109, 40, 217, 0.11);
  color: var(--accepted);
}

.badge-done {
  background: rgba(22, 101, 52, 0.11);
  color: var(--done);
}

.type-list,
.assignment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(20, 35, 31, 0.08);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
}

.assignment-list .pill {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.row-actions {
  display: flex;
  gap: 8px;
}

.text-button {
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--accent-strong);
  cursor: pointer;
  font-weight: 700;
}

.text-button.danger {
  color: var(--danger);
}

.overdue-row {
  background: rgba(180, 35, 24, 0.05);
}

.overdue-cell {
  color: var(--danger);
  font-weight: 700;
}

.alert-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.8rem;
  font-weight: 700;
}

.stat-card,
.summary-card {
  padding: 18px;
  border-radius: 22px;
  background: var(--panel-strong);
  border: 1px solid rgba(17, 34, 29, 0.06);
}

.stat-card h4,
.summary-card h4 {
  margin: 8px 0 0;
  font-size: 1.8rem;
}

.stat-card p,
.summary-card p {
  margin: 0;
  color: var(--muted);
}

.summary-footer {
  margin: 24px 0 12px;
}

.lead-dialog {
  width: min(920px, calc(100vw - 32px));
  border: 0;
  border-radius: 30px;
  padding: 0;
  background: transparent;
}

.lead-dialog::backdrop {
  background: rgba(8, 15, 13, 0.45);
  backdrop-filter: blur(4px);
}

.lead-form {
  padding: 24px;
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 249, 0.98));
  box-shadow: 0 32px 80px rgba(8, 15, 13, 0.28);
}

.dialog-header,
.dialog-footer,
.dialog-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.dialog-footer {
  margin-top: 24px;
}

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

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

.checkbox-field {
  margin: 0;
  border: 1px solid rgba(17, 34, 29, 0.08);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.65);
}

.checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.checkbox-option {
  position: relative;
}

.checkbox-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.checkbox-option span {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(20, 35, 31, 0.06);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}

.checkbox-option input:checked + span {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.assignment-panel {
  margin-top: 20px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(15, 118, 110, 0.08);
  border: 1px solid rgba(15, 118, 110, 0.12);
}

.form-error {
  margin: 18px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 600;
}

.hidden {
  display: none !important;
}

@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

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

@media (max-width: 780px) {
  .main-content,
  .sidebar {
    padding: 18px;
  }

  .hero,
  .section-heading,
  .dialog-header,
  .dialog-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-grid,
  .form-grid,
  .stats-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

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

  .lead-dialog {
    width: calc(100vw - 20px);
  }

  .brand-line {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .brand-subtitle {
    padding-left: 0;
    border-left: 0;
  }
}
