:root {
  --ink: #111111;
  --road: #191817;
  --anthracite: #252321;
  --muted: #746d64;
  --line: #ded5c7;
  --paper: #fffdf8;
  --cream: #f3eee5;
  --soft: #faf7f0;
  --gold: #d6a545;
  --blue: #2f6df6;
  --green: #15803d;
  --red: #dc2626;
  --orange: #f59e0b;
  --shadow: 0 24px 70px rgba(30, 25, 18, .14);
  --radius: 28px;
  --font: "Inter", "Segoe UI", system-ui, sans-serif;
  --title: "Manrope", "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 3%, rgba(214, 165, 69, .20), transparent 26rem),
    radial-gradient(circle at 92% 8%, rgba(47, 109, 246, .10), transparent 28rem),
    linear-gradient(180deg, #fbf8f1 0%, #f1eadf 100%);
  font-family: var(--font);
  font-weight: 550;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.app { min-height: 100vh; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; font-weight: 950; letter-spacing: -.04em; }
.brand-mark {
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 15px; background: var(--road); color: #fff;
  font-weight: 950; box-shadow: inset 0 -5px 0 rgba(255,255,255,.08), 0 15px 35px rgba(17,17,17,.2);
}
.eyebrow { margin: 0 0 10px; color: #5b544c; font-size: 12px; font-weight: 950; text-transform: uppercase; letter-spacing: .16em; }
.lead { color: var(--muted); font-size: clamp(17px, 2.2vw, 21px); line-height: 1.55; }
.muted { color: var(--muted); line-height: 1.55; }

.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, .55fr);
  gap: 30px;
  align-items: center;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0;
}
.auth-hero, .auth-card, .card, .hero-panel, .sidebar, .topbar {
  border: 1px solid rgba(222, 213, 199, .92);
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,252,247,.86));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.auth-hero { padding: clamp(28px, 5vw, 58px); }
.auth-hero h1, .hero-panel h1 {
  margin: 24px 0 18px;
  font: 950 clamp(42px, 7.5vw, 82px)/.88 var(--title);
  letter-spacing: -.08em;
}
.auth-points { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.auth-points span, .badge {
  display: inline-flex; align-items: center; min-height: 34px;
  padding: 7px 12px; border-radius: 999px; background: #fff;
  border: 1px solid var(--line); color: #423c36; font-weight: 850; font-size: 13px;
}
.auth-card { padding: 26px; display: grid; gap: 16px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 5px; border-radius: 999px; background: #ede6db; }
.auth-tabs button {
  border: 0; min-height: 46px; border-radius: 999px; background: transparent; color: #61584f; font-weight: 950;
}
.auth-tabs button.active { background: var(--road); color: #fff; box-shadow: 0 12px 24px rgba(17,17,17,.14); }

label { display: grid; gap: 8px; color: #514a42; font-size: 12px; font-weight: 950; text-transform: uppercase; letter-spacing: .08em; }
input, select, textarea {
  width: 100%; border: 1px solid #d8cebf; border-radius: 17px;
  background: rgba(255,255,255,.92); color: var(--ink);
  padding: 14px 15px; outline: none; font-weight: 750; text-transform: none; letter-spacing: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(17,17,17,.08); }
.check { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 17px; padding: 13px; background: rgba(255,255,255,.7); }
.check input { width: 18px; height: 18px; }

.primary, .ghost, .link-button {
  min-height: 48px; border-radius: 999px; padding: 0 18px; font-weight: 950; border: 1px solid var(--road);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.primary { background: var(--road); color: #fff; box-shadow: 0 16px 34px rgba(17,17,17,.16); }
.primary:hover, .ghost:hover, .link-button:hover { transform: translateY(-1px); }
.ghost { background: rgba(255,255,255,.75); color: var(--ink); border-color: var(--line); }
.link-button { border: 0; background: transparent; color: var(--ink); padding: 0 8px; min-height: 34px; }
.small { min-height: 38px; padding: 0 13px; font-size: 13px; }
.form-message { min-height: 20px; margin: 0; color: var(--muted); font-weight: 850; }
.form-message.error { color: var(--red); }
.form-message.success { color: var(--green); }

.shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 22px;
  width: min(1480px, calc(100% - 24px));
  margin: 0 auto;
  padding: 18px 0 36px;
}
.sidebar { position: sticky; top: 18px; height: calc(100vh - 36px); padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.sidebar nav { display: grid; gap: 7px; }
.nav-link {
  display: flex; align-items: center; gap: 10px; min-height: 46px; border: 0; border-radius: 16px;
  background: transparent; padding: 0 14px; text-align: left; color: #625a51; font-weight: 900;
}
.nav-link span {
  width: 26px; height: 26px; display: grid; place-items: center; border-radius: 999px;
  background: rgba(17,17,17,.06); color: #8a8177; font-size: 11px; font-weight: 950;
}
.nav-link.active { background: var(--road); color: #fff; box-shadow: 0 14px 30px rgba(17,17,17,.14); }
.nav-link.active span { background: rgba(255,255,255,.15); color: #fff; }
.plan-card { margin-top: auto; border-radius: 22px; background: linear-gradient(135deg, #161514, #2b2418); color: #fff; padding: 18px; }
.plan-card span { color: #d8c8aa; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; font-weight: 950; }
.plan-card strong { display: block; margin: 10px 0 4px; font-size: 25px; letter-spacing: -.04em; }
.plan-card small { color: #d6d0c7; }

.content { display: grid; gap: 18px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 20px 22px; }
.topbar h2 { margin: 0; font: 950 clamp(28px, 3.4vw, 44px)/.95 var(--title); letter-spacing: -.07em; }
.top-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.view { display: none; }
.view.active { display: grid; gap: 18px; }
.hero-panel { padding: clamp(24px, 4vw, 42px); display: grid; grid-template-columns: 1fr 300px; gap: 22px; align-items: end; }
.hero-panel h1 { font-size: clamp(36px, 5vw, 64px); }
.quick-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.premium-box { border-radius: 26px; background: linear-gradient(150deg, #171615, #332819); color: #fff; padding: 24px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.premium-box span { color: var(--gold); font-size: 12px; font-weight: 950; text-transform: uppercase; letter-spacing: .14em; }
.premium-box strong { display: block; margin: 10px 0 4px; font-size: 34px; letter-spacing: -.06em; }
.premium-box small { display: block; color: #d7cec0; margin-bottom: 18px; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 12px; }
.stats-grid.mini { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.stats-grid.mini .stat-card { min-height: 86px; padding: 14px; }
.stats-grid.mini .stat-card strong { font-size: 20px; }
.stat-card {
  min-height: 118px; padding: 18px; border-radius: 24px; border: 1px solid var(--line);
  background: rgba(255,255,255,.76); box-shadow: 0 14px 36px rgba(35,28,18,.08);
}
.stat-card small { color: var(--muted); font-size: 12px; font-weight: 950; text-transform: uppercase; letter-spacing: .1em; }
.stat-card strong { display: block; margin-top: 10px; font-size: 30px; letter-spacing: -.05em; }
.two-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(330px, .55fr); gap: 18px; }
.card { padding: 22px; min-width: 0; }
.card h3 { margin: 0 0 12px; font: 950 24px/1 var(--title); letter-spacing: -.05em; }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-head p { margin: 6px 0 0; color: var(--muted); }
.list, .mission-list { display: grid; gap: 10px; }
.empty { border: 1px dashed #cabdac; border-radius: 18px; padding: 16px; color: var(--muted); background: rgba(255,255,255,.55); }
.list-item, .mission-item {
  border: 1px solid var(--line); border-radius: 20px; padding: 14px;
  background: rgba(255,255,255,.72); display: grid; gap: 10px;
}
.item-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.item-row strong { letter-spacing: -.02em; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions a, .actions button {
  min-height: 36px; border-radius: 999px; padding: 0 12px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); text-decoration: none; font-weight: 900; font-size: 13px;
}
.actions .dark { background: var(--road); color: #fff; border-color: var(--road); }
.actions .danger, .danger { color: #991b1b; border-color: #fecaca; background: #fff5f5; }
.status {
  display: inline-flex; align-items: center; min-height: 28px; padding: 5px 10px;
  border-radius: 999px; background: #f1eadf; color: #4d463f; font-size: 12px; font-weight: 950;
}
.status.paid { background: #dcfce7; color: #166534; }
.status.invoiced, .status.accepted { background: #dbeafe; color: #1d4ed8; }
.status.quote_sent { background: #fef3c7; color: #92400e; }

.grid-2, .grid-3, .grid-4, .grid-5 { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.form-card, .mission-form { display: grid; gap: 14px; }
.wide { max-width: 980px; }
.form-section {
  display: grid; gap: 14px; padding: 16px; border: 1px solid rgba(222,213,199,.92);
  border-radius: 24px; background: rgba(255,255,255,.54);
}
.form-section-title { display: flex; align-items: center; gap: 12px; }
.form-section-title > span {
  width: 34px; height: 34px; border-radius: 999px; display: grid; place-items: center;
  background: var(--road); color: #fff; font-weight: 950;
}
.form-section-title strong { display: block; font-size: 17px; letter-spacing: -.03em; }
.form-section-title small { display: block; color: var(--muted); margin-top: 2px; }
.calc-panel {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px;
  border-radius: 24px; background: var(--road); color: #fff; padding: 14px;
}
.calc-tile { padding: 12px; border-radius: 18px; background: rgba(255,255,255,.08); }
.calc-tile small { display: block; color: #c9c1b7; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; font-weight: 950; }
.calc-tile strong { display: block; margin-top: 8px; font-size: 20px; letter-spacing: -.04em; }
.formula { display: grid; gap: 8px; margin-top: 18px; }
.formula span { padding: 12px; border-radius: 16px; background: rgba(255,255,255,.7); border: 1px solid var(--line); font-weight: 900; }
.inline-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
.plan-badge {
  display: inline-flex; min-height: 28px; align-items: center; border-radius: 999px; padding: 4px 10px;
  background: #f1eadf; color: #5b544c; font-size: 12px; font-weight: 950;
}
.plan-badge.premium { background: #1f1a11; color: #f5d47c; box-shadow: inset 0 0 0 1px rgba(214,165,69,.35); }
.premium-layout { display: grid; grid-template-columns: .8fr 1.2fr; gap: 18px; }
.premium-hero-card {
  background: radial-gradient(circle at 90% 0%, rgba(214,165,69,.24), transparent 16rem), linear-gradient(150deg, #171615, #2c261f);
  color: #fff;
}
.premium-hero-card .eyebrow, .premium-hero-card .muted { color: #e2d7c5; }
.premium-hero-card h3 { font-size: clamp(32px, 4vw, 52px); line-height: .96; }
.premium-pill {
  display: inline-flex; align-items: center; min-height: 34px; padding: 6px 12px; border-radius: 999px;
  background: #1f1a11; color: #f5d47c; font-weight: 950; box-shadow: inset 0 0 0 1px rgba(214,165,69,.35);
}
.compare-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.compare-plan {
  border: 1px solid var(--line); border-radius: 24px; padding: 18px; background: rgba(255,255,255,.72);
}
.compare-plan.premium { border-color: rgba(214,165,69,.55); box-shadow: inset 0 0 0 1px rgba(214,165,69,.20); }
.compare-plan span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; font-weight: 950; }
.compare-plan strong { display: block; margin: 8px 0 12px; font-size: 30px; letter-spacing: -.06em; }
.compare-plan ul { margin: 0; padding-left: 18px; display: grid; gap: 8px; color: #3f3933; font-weight: 750; }
.premium-lock {
  display: grid; gap: 7px; border: 1px solid rgba(214,165,69,.45); border-radius: 18px;
  padding: 13px; background: #fff7e6; color: #4d3611;
}
.premium-lock strong { font-size: 14px; }
.premium-lock span { font-size: 13px; line-height: 1.45; }
.premium-lock button {
  width: fit-content; min-height: 34px; border: 0; border-radius: 999px; padding: 0 12px;
  background: var(--road); color: #fff; font-weight: 950;
}
.primary:disabled, .ghost:disabled { cursor: not-allowed; opacity: .6; transform: none; }

@media (max-width: 1060px) {
  .auth-screen { grid-template-columns: 1fr; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .sidebar nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-panel, .two-columns { grid-template-columns: 1fr; }
  .premium-layout { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4, .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calc-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .auth-screen { width: min(100% - 18px, 560px); padding: 14px 0; }
  .auth-hero, .auth-card, .card, .topbar, .hero-panel { border-radius: 22px; padding: 18px; }
  .auth-hero h1, .hero-panel h1 { font-size: 42px; }
  .shell { width: min(100% - 12px, 640px); padding-top: 8px; }
  .sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar, .section-head, .item-row { flex-direction: column; align-items: stretch; }
  .top-actions { justify-content: stretch; }
  .top-actions button, .primary, .ghost { width: 100%; }
  .stats-grid, .grid-2, .grid-3, .grid-4, .grid-5, .calc-panel, .inline-form { grid-template-columns: 1fr; }
  .compare-grid { grid-template-columns: 1fr; }
  .quick-actions { display: grid; }
  .premium-box strong { font-size: 28px; }
}
