:root {
  --bg: #070816;
  --bg-2: #0b0b18;
  --panel: rgba(17, 20, 41, 0.92);
  --panel-2: rgba(22, 26, 51, 0.94);
  --sidebar: #070a14;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f8fafc;
  --muted: #a5adcb;
  --soft: #dbe3ff;
  --brand: #5b5cff;
  --brand-2: #7c5cff;
  --blue: #5b5cff;
  --green: #22c55e;
  --yellow: #facc15;
  --red: #ef4444;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  --glow: 0 0 0 1px rgba(124, 92, 255, 0.18), 0 22px 60px rgba(91, 92, 255, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
}

body {
  margin: 0;
  min-width: 0;
  background:
    radial-gradient(circle at 18% 0%, rgba(91, 92, 255, 0.34), transparent 28%),
    radial-gradient(circle at 88% 12%, rgba(124, 92, 255, 0.24), transparent 28%),
    linear-gradient(145deg, var(--bg), var(--bg-2) 52%, #080a1b);
  color: var(--text);
  font-family: "DM Sans", system-ui, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

h1,
h2,
h3,
.metric-value,
.brand-mark,
.service-card strong {
  font-family: "Space Grotesk", "DM Sans", system-ui, sans-serif;
  letter-spacing: 0;
}

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

button {
  border: 0;
  cursor: pointer;
}

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

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.service-card:focus-visible,
.check-item:focus-within {
  outline: 3px solid rgba(124, 92, 255, 0.9);
  outline-offset: 3px;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
}

.auth-brand {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(135deg, rgba(91, 92, 255, 0.18), rgba(124, 92, 255, 0.08)),
    #070a14;
  color: var(--text);
}

.auth-brand::after {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  right: -180px;
  bottom: -160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91, 92, 255, 0.34), transparent 65%);
}

.auth-brand > * {
  position: relative;
  z-index: 1;
}

.auth-brand h1 {
  margin: 0;
  max-width: 660px;
  font-size: clamp(42px, 6vw, 76px);
  line-height: 0.95;
}

.auth-brand p {
  max-width: 560px;
  color: var(--soft);
  font-size: 18px;
  line-height: 1.6;
}

.demo-note {
  width: fit-content;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
}

.brand-mark span:last-child {
  display: grid;
  gap: 1px;
}

.brand-mark small {
  color: var(--muted);
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
}

.brand-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: white;
  box-shadow: 0 12px 34px rgba(91, 92, 255, 0.34);
  font-size: 13px;
}

.auth-panel {
  display: grid;
  place-items: center;
  padding: clamp(20px, 4vw, 40px);
}

.auth-card,
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025)), var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-card {
  width: min(460px, 100%);
  padding: clamp(24px, 4vw, 36px);
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 10px;
  color: #c7ccff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.auth-card h2,
.page-title h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
}

.auth-card p,
.page-title p,
.muted {
  color: var(--muted);
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  min-width: 0;
}

.field label {
  color: var(--soft);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 10, 20, 0.76);
  color: var(--text);
  padding: 12px 13px;
  outline: none;
}

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

input::placeholder,
textarea::placeholder {
  color: rgba(165, 173, 203, 0.7);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.14);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 8px;
  padding: 11px 16px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid var(--line);
  font-weight: 900;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.12);
}

.btn.primary,
.btn.accent {
  border-color: rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: white;
  box-shadow: 0 14px 34px rgba(91, 92, 255, 0.24);
}

.btn.danger {
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.04);
}

.btn.full {
  width: 100%;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.switch-auth {
  margin-top: 16px;
  color: var(--muted);
  text-align: center;
}

.switch-auth button {
  background: transparent;
  color: #c7ccff;
  font-weight: 900;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background:
    linear-gradient(180deg, rgba(91, 92, 255, 0.11), transparent 32%),
    var(--sidebar);
  color: var(--text);
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.side-nav {
  display: grid;
  gap: 7px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  font-weight: 800;
}

.nav-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #c7ccff;
  font-size: 13px;
}

.nav-link.active,
.nav-link:hover {
  border-color: rgba(124, 92, 255, 0.42);
  background: linear-gradient(135deg, rgba(91, 92, 255, 0.2), rgba(124, 92, 255, 0.12));
  color: white;
}

.nav-link.active .nav-icon {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: white;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 12px;
}

.user-pill {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.main {
  min-width: 0;
  width: 100%;
  max-width: 1540px;
  padding: clamp(18px, 3vw, 34px);
}

.app-topline {
  position: relative;
  min-height: 46px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.mobile-menu {
  display: none;
}

.notification-wrap {
  position: relative;
  margin-left: auto;
}

.bell-btn {
  position: relative;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  box-shadow: var(--shadow);
}

.bell-icon {
  font-size: 18px;
  line-height: 1;
}

.bell-count {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 2px solid var(--bg);
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.notification-menu {
  position: absolute;
  top: 54px;
  right: 0;
  z-index: 20;
  width: min(420px, calc(100vw - 36px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101328;
  box-shadow: var(--shadow);
}

.notification-menu-head,
.notification-item {
  border-bottom: 1px solid var(--line);
}

.notification-menu-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
}

.notification-menu-head button,
.notification-item button {
  background: transparent;
  color: #c7ccff;
  font-weight: 900;
}

.notification-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 13px 14px;
}

.notification-item.unread,
.notification-history.unread {
  background: rgba(91, 92, 255, 0.1);
}

.notification-item a {
  display: grid;
  gap: 4px;
}

.notification-item span,
.notification-item small {
  color: var(--muted);
}

.notification-all,
.notification-empty {
  display: block;
  padding: 13px 14px;
  color: var(--muted);
}

.notification-all {
  color: #c7ccff;
  font-weight: 900;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.topbar-actions {
  flex: 0 0 auto;
}

.grid {
  display: grid;
  gap: 16px;
}

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

.grid.two {
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
}

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

.card {
  min-width: 0;
  padding: 18px;
}

.cinematic-note {
  margin-bottom: 16px;
  border-color: rgba(124, 92, 255, 0.28);
  background: linear-gradient(135deg, rgba(91, 92, 255, 0.16), rgba(124, 92, 255, 0.08)), var(--panel);
}

.metric-card {
  position: relative;
  overflow: hidden;
}

.metric-card::after {
  content: "";
  position: absolute;
  right: -36px;
  top: -36px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(91, 92, 255, 0.18);
}

.metric-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.metric-value {
  margin-top: 8px;
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 900;
}

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

.section-head h2,
.card h3,
.card h2 {
  margin: 0;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

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

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 8px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.badge.blue {
  background: rgba(91, 92, 255, 0.16);
  color: #c7ccff;
}

.badge.green {
  background: rgba(34, 197, 94, 0.14);
  color: #86efac;
}

.badge.yellow {
  background: rgba(250, 204, 21, 0.14);
  color: #fde68a;
}

.badge.red {
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
}

.badge.gray {
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

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

.form-grid .wide {
  grid-column: 1 / -1;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(7, 10, 20, 0.52);
  color: var(--soft);
  font-weight: 800;
}

.check-item input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--brand-2);
}

.request-layout,
.request-form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 16px;
  align-items: start;
}

.credit-sidebar {
  position: sticky;
  top: 22px;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  border-left: 3px solid var(--brand-2);
  padding: 4px 0 4px 12px;
}

.empty {
  padding: 24px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.credit-alert {
  margin: 8px 0 18px;
  padding: 18px;
  border: 1px solid rgba(250, 204, 21, 0.34);
  border-radius: 8px;
  background: rgba(250, 204, 21, 0.09);
}

.credit-alert p {
  max-width: 760px;
}

.credit-alert .btn {
  margin: 4px 8px 0 0;
}

.credit-preview {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 8px 0 18px;
}

.credit-preview div,
.plan-row {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 10, 20, 0.54);
}

.credit-preview span,
.plan-row small {
  color: var(--muted);
  font-size: 13px;
}

.credit-preview strong {
  font-size: 20px;
}

.credit-preview strong.negative-balance {
  color: #fca5a5;
}

.credit-explainer {
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid rgba(124, 92, 255, 0.28);
  border-radius: 8px;
  background: rgba(91, 92, 255, 0.1);
  color: var(--soft);
  font-weight: 800;
}

.step-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 8px;
}

.step-title span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: white;
  font-weight: 900;
}

.step-title div {
  display: grid;
}

.step-title small {
  color: var(--muted);
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.segmented button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  background: rgba(7, 10, 20, 0.54);
  color: var(--soft);
  font-weight: 900;
}

.segmented button.active {
  border-color: rgba(124, 92, 255, 0.72);
  background: rgba(91, 92, 255, 0.18);
  box-shadow: var(--glow);
  color: white;
}

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

.service-card {
  position: relative;
  display: grid;
  gap: 10px;
  min-height: 218px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 10, 20, 0.6);
  color: var(--text);
  text-align: left;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.service-card:hover,
.service-card.selected {
  border-color: rgba(124, 92, 255, 0.72);
  background: rgba(91, 92, 255, 0.12);
  box-shadow: var(--glow);
  transform: translateY(-1px);
}

.service-check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 26px;
  height: 26px;
  display: none;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: white;
  font-weight: 900;
}

.service-card.selected .service-check {
  display: grid;
}

.service-card strong {
  font-size: 20px;
}

.service-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.service-card div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: auto;
}

.service-card b {
  color: #c7ccff;
}

.estimate-summary {
  margin-bottom: 18px;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.summary-grid div {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 10, 20, 0.52);
}

.summary-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.included-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.included-pill {
  display: inline-grid;
  gap: 2px;
  min-height: 42px;
  border: 1px solid rgba(124, 92, 255, 0.28);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(91, 92, 255, 0.1);
  color: var(--soft);
  font-weight: 900;
}

.included-pill small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.notification-history {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.notification-history p {
  margin: 6px 0;
}

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

.team-card {
  display: grid;
  gap: 14px;
}

.team-card-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.team-card-head h2 {
  margin: 0;
}

.team-avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: white;
  font-weight: 900;
  box-shadow: 0 14px 34px rgba(91, 92, 255, 0.24);
}

.team-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  max-width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--line);
  background: linear-gradient(135deg, #141833, #0d1024);
  color: white;
  padding: 13px 16px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hidden {
  display: none !important;
}

@media (max-width: 1180px) {
  .grid.metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .credit-sidebar {
    position: static;
  }
}

@media (max-width: 980px) {
  .auth-shell,
  .app-shell,
  .grid.two {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    min-height: 360px;
  }

  .sidebar {
    position: fixed;
    z-index: 30;
    inset: 0 auto 0 0;
    width: min(310px, 86vw);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-menu {
    display: inline-flex;
  }

  .main {
    padding: 18px;
  }

  .topbar {
    flex-direction: column;
  }

  .topbar-actions,
  .topbar-actions .btn {
    width: 100%;
  }

  .form-grid,
  .check-grid,
  .service-card-grid,
  .grid.three {
    grid-template-columns: 1fr;
  }

  .notification-history {
    flex-direction: column;
  }

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

@media (max-width: 560px) {
  .auth-panel,
  .main {
    padding: 14px;
  }

  .auth-card,
  .card {
    padding: 16px;
  }

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

  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .section-head .btn,
  .credit-alert .btn {
    width: 100%;
  }

  .segmented {
    display: grid;
  }

  .notification-menu {
    right: -8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
