﻿:root {
  --bg: #071018;
  --panel: #0b1520;
  --card: rgba(255,255,255,.075);
  --card-strong: rgba(255,255,255,.12);
  --line: rgba(255,255,255,.12);
  --text: #f8fafc;
  --muted: #9eabba;
  --gold: #d7b56d;
  --gold-soft: rgba(215,181,109,.16);
  --green: #22c55e;
  --red: #ef4444;
  --radius: 24px;
  --shadow: 0 24px 80px rgba(0,0,0,.32);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 78% 0%, rgba(56,189,248,.12), transparent 34rem),
    radial-gradient(circle at 18% 4%, rgba(215,181,109,.15), transparent 28rem),
    var(--bg);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 294px;
  padding: 28px 22px;
  background: rgba(7,16,24,.88);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

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

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--gold), #f6e4a8);
  color: #10151f;
  font-weight: 950;
}

.brand strong {
  display: block;
}

.brand small,
.side-note small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav a {
  color: var(--muted);
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid transparent;
}

.nav a:hover,
.nav a.active {
  color: var(--text);
  background: rgba(255,255,255,.06);
  border-color: var(--line);
}

.side-note {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 22px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.055);
  padding: 16px;
}

.side-note span {
  color: var(--muted);
  font-size: 12px;
}

.side-note strong {
  display: block;
  margin-top: 6px;
  color: var(--gold);
}

.main {
  margin-left: 294px;
}

.topbar {
  padding: 46px min(6vw, 76px) 34px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: flex-start;
}

.eyebrow {
  display: inline-flex;
  width: fit-content;
  color: var(--gold);
  background: var(--gold-soft);
  border: 1px solid rgba(215,181,109,.24);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 800;
}

h1 {
  margin: 18px 0 10px;
  font-size: clamp(42px, 6vw, 72px);
  line-height: .95;
  letter-spacing: -.07em;
}

.topbar p {
  color: var(--muted);
  line-height: 1.7;
  max-width: 760px;
}

.api-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  padding: 12px 16px;
  white-space: nowrap;
}

.pulse {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 8px rgba(34,197,94,.14);
}

.section {
  padding: 66px min(6vw, 76px);
  border-bottom: 1px solid var(--line);
}

.section.soft {
  background: rgba(255,255,255,.035);
}

.section-head {
  max-width: 780px;
  margin-bottom: 28px;
}

.section-head h2 {
  margin: 16px 0 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: -.05em;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}

.metric-card,
.card,
.table-card {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 14px 60px rgba(0,0,0,.18);
}

.metric-card strong {
  display: block;
  font-size: 34px;
}

.metric-card span {
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.card {
  min-height: 220px;
}

.card:hover {
  background: var(--card-strong);
}

.card h3 {
  margin: 12px 0 10px;
  font-size: 22px;
  letter-spacing: -.03em;
}

.card p {
  color: var(--muted);
  line-height: 1.65;
}

.meta {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.meta span {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.055);
  border-radius: 12px;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 13px;
  word-break: break-word;
}

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

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

th,
td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--gold);
  font-size: 13px;
}

td {
  color: var(--muted);
  line-height: 1.5;
}

.badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(34,197,94,.14);
  color: #86efac;
  font-size: 12px;
  font-weight: 800;
}

.footer {
  min-height: 72px;
  padding: 0 min(6vw, 76px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .metric-grid,
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .topbar {
    flex-direction: column;
  }
}

@media (max-width: 760px) {
  .sidebar {
    position: static;
    width: auto;
  }

  .side-note {
    position: static;
    margin-top: 18px;
  }

  .main {
    margin-left: 0;
  }

  .metric-grid,
  .grid {
    grid-template-columns: 1fr;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
  }
}

.hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 78% 0%, rgba(56,189,248,.12), transparent 34rem),
    radial-gradient(circle at 18% 4%, rgba(215,181,109,.15), transparent 28rem),
    var(--bg);
}

.login-card {
  width: min(520px, 100%);
  border: 1px solid var(--line);
  background: rgba(255,255,255,.075);
  border-radius: 32px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 34px;
}

.login-brand strong {
  display: block;
}

.login-brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.login-head h1 {
  font-size: clamp(36px, 5vw, 58px);
  margin: 18px 0 10px;
  line-height: .95;
  letter-spacing: -.06em;
}

.login-head p,
.login-note {
  color: var(--muted);
  line-height: 1.65;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 26px;
}

.login-form label {
  display: grid;
  gap: 8px;
}

.login-form label span {
  color: var(--muted);
  font-size: 13px;
}

.login-form input {
  width: 100%;
  min-height: 52px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.22);
  color: var(--text);
  padding: 0 14px;
  outline: none;
  font: inherit;
}

.login-form input:focus {
  border-color: rgba(215,181,109,.55);
}

.login-message {
  min-height: 22px;
  color: var(--gold);
  font-size: 14px;
}

.login-note {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.055);
  padding: 14px;
  font-size: 13px;
}

.logout-btn {
  width: 100%;
  margin-top: 14px;
  min-height: 42px;
  cursor: pointer;
}

.security-card {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
}

.security-card h3 {
  margin: 0 0 10px;
}

.security-card p {
  color: var(--muted);
  line-height: 1.65;
}

.password-form {
  display: grid;
  gap: 16px;
  margin-top: 20px;
  max-width: 520px;
}

.password-form label {
  display: grid;
  gap: 8px;
}

.password-form label span {
  color: var(--muted);
  font-size: 13px;
}

.password-form input {
  width: 100%;
  min-height: 52px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.22);
  color: var(--text);
  padding: 0 14px;
  outline: none;
  font: inherit;
}

.password-form input:focus {
  border-color: rgba(215,181,109,.55);
}

.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrap input {
  padding-right: 56px !important;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .2s ease;
}

.password-toggle:hover {
  background: rgba(215,181,109,.14);
  border-color: rgba(215,181,109,.35);
}

.hidden-eye {
  display: none !important;
}

.login-form .btn {
  min-height: 52px;
  border: none;
  border-radius: 16px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .01em;
  cursor: pointer;
  transition: all .2s ease;
}

.login-form .btn-primary {
  background: linear-gradient(135deg, #e6cc7a 0%, #d7b56d 100%);
  color: #111827;
  box-shadow: 0 10px 30px rgba(215,181,109,.22);
}

.login-form .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 36px rgba(215,181,109,.28);
}

.login-message {
  min-height: 22px;
  font-size: 13px;
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 2px;
  border: 1px solid transparent;
}

.login-message.info {
  color: #d7b56d;
  background: rgba(215,181,109,.08);
  border-color: rgba(215,181,109,.18);
}

.login-message.error {
  color: #fca5a5;
  background: rgba(239,68,68,.10);
  border-color: rgba(239,68,68,.22);
}

.login-message.success {
  color: #86efac;
  background: rgba(34,197,94,.10);
  border-color: rgba(34,197,94,.22);
}

.login-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.04)),
    radial-gradient(circle at top left, rgba(215,181,109,.10), transparent 30rem),
    rgba(10,18,28,.88);
  backdrop-filter: blur(16px);
}

.login-form input {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

.login-form input:hover {
  border-color: rgba(255,255,255,.14);
}

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

.crm-table table {
  min-width: 980px;
}

.crm-table td strong {
  display: block;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}

.crm-table td small {
  display: block;
  color: var(--muted);
  line-height: 1.45;
}

.contact-stack {
  display: grid;
  gap: 4px;
}

.contact-stack span {
  color: var(--muted);
  font-size: 13px;
}

.mini-link {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.055);
  color: var(--gold);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  margin-right: 6px;
}

.mini-link:hover {
  border-color: rgba(215,181,109,.35);
  background: rgba(215,181,109,.11);
}

.crm-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .03em;
  border: 1px solid rgba(215,181,109,.22);
  background: rgba(215,181,109,.10);
  color: #f3d98a;
}

.status-contacted {
  border-color: rgba(56,189,248,.24);
  background: rgba(56,189,248,.10);
  color: #bae6fd;
}

.status-quoted {
  border-color: rgba(34,197,94,.24);
  background: rgba(34,197,94,.10);
  color: #bbf7d0;
}

.status-closed {
  border-color: rgba(148,163,184,.22);
  background: rgba(148,163,184,.10);
  color: #cbd5e1;
}

.note-cell {
  max-width: 280px;
  white-space: normal;
  line-height: 1.55;
  color: var(--muted);
}

.empty-state {
  border: 1px dashed rgba(255,255,255,.14);
  background: rgba(255,255,255,.04);
  border-radius: 22px;
  padding: 22px;
  display: grid;
  gap: 6px;
}

.empty-state strong {
  color: var(--text);
}

.empty-state span,
.muted {
  color: var(--muted);
}

@media (max-width: 900px) {
  .crm-table {
    border-radius: 20px;
  }

  .mini-link {
    margin-top: 4px;
  }
}

.crm-status-select {
  min-height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(215,181,109,.22);
  background: rgba(215,181,109,.10);
  color: #f3d98a;
  padding: 0 34px 0 12px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .03em;
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 15px) 14px,
    calc(100% - 10px) 14px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.crm-status-select:hover {
  border-color: rgba(215,181,109,.42);
  box-shadow: 0 8px 24px rgba(215,181,109,.10);
}

.crm-status-select:focus {
  box-shadow: 0 0 0 4px rgba(215,181,109,.08);
}

.crm-status-select:disabled {
  opacity: .62;
  cursor: wait;
}

.crm-status-select option {
  color: #111827;
  background: #ffffff;
  font-weight: 700;
}

.crm-status-select.status-contacted {
  border-color: rgba(56,189,248,.24);
  background-color: rgba(56,189,248,.10);
  color: #bae6fd;
}

.crm-status-select.status-quoted {
  border-color: rgba(34,197,94,.24);
  background-color: rgba(34,197,94,.10);
  color: #bbf7d0;
}

.crm-status-select.status-closed {
  border-color: rgba(148,163,184,.22);
  background-color: rgba(148,163,184,.10);
  color: #cbd5e1;
}

.action-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 210px;
}

.mini-action {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.055);
  color: var(--gold);
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.mini-action:hover {
  border-color: rgba(215,181,109,.35);
  background: rgba(215,181,109,.11);
}

.mini-action:disabled {
  opacity: .55;
  cursor: wait;
}

.link-action {
  display: inline-flex;
  align-items: center;
}

.progress-wrap {
  min-width: 160px;
}

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

.progress-bar {
  height: 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
  border: 1px solid var(--line);
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, #ecd58a, #d7b56d);
}

.customer-status-select,
.handover-status-select {
  min-height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(215,181,109,.22);
  background-color: rgba(215,181,109,.10);
  color: #f3d98a;
  padding: 0 34px 0 12px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .03em;
  cursor: pointer;
  outline: none;
}

.customer-status-select option,
.handover-status-select option {
  color: #111827;
  background: #ffffff;
  font-weight: 700;
}

.customer-status-select:disabled,
.handover-status-select:disabled {
  opacity: .6;
  cursor: wait;
}

.customer-status-select.status-active,
.handover-status-select.status-handed_over {
  border-color: rgba(34,197,94,.24);
  background-color: rgba(34,197,94,.10);
  color: #bbf7d0;
}

.customer-status-select.status-on_hold,
.handover-status-select.status-ready {
  border-color: rgba(56,189,248,.24);
  background-color: rgba(56,189,248,.10);
  color: #bae6fd;
}

.customer-status-select.status-suspended,
.customer-status-select.status-cancelled {
  border-color: rgba(239,68,68,.24);
  background-color: rgba(239,68,68,.10);
  color: #fecaca;
}
