:root {
  --ivory: #f8f5ef;
  --paper: #ffffff;
  --surface: #fbf8f2;
  --ink: #2b211a;
  --muted: #6b5d50;
  --line: #e7ddcb;
  --earth: #7a5230;
  --earth-dark: #4a3019;
  --clay: #a46a3d;
  --gold: #c8a046;
  --green: #3b6e4a;
  --blue: #345f7d;
  --red: #b4452f;
  --shadow: 0 20px 55px -32px rgba(43, 33, 26, .55);
  --radius: 14px;
  --display: "Fraunces", Georgia, serif;
  --body: "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--body);
  color: var(--ink);
  background: var(--ivory);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 8% 2%, rgba(59, 110, 74, .08), transparent 60%),
    radial-gradient(880px 520px at 92% 0%, rgba(52, 95, 125, .08), transparent 60%),
    linear-gradient(180deg, rgba(200, 160, 70, .06), transparent 36%);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; }

.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 800; }
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: var(--display);
  color: #fff;
  background: linear-gradient(145deg, var(--gold), var(--clay));
  box-shadow: 0 10px 24px -18px var(--earth-dark);
}
.brand-name { font-family: var(--display); font-size: 21px; letter-spacing: .02em; }
.brand-name span { color: var(--clay); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px clamp(18px, 5vw, 70px);
  border-bottom: 1px solid var(--line);
  background: rgba(248, 245, 239, .86);
  backdrop-filter: blur(14px);
}
.public-nav { display: flex; align-items: center; gap: 22px; color: var(--muted); font-size: 14px; font-weight: 700; }
.nav-toggle { display: none; border: 1px solid var(--line); background: var(--paper); border-radius: 10px; padding: 9px 12px; }

.btn {
  border: 0;
  border-radius: 11px;
  padding: 11px 16px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  color: var(--ink);
  background: var(--surface);
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--earth); color: #fff; box-shadow: 0 14px 30px -20px var(--earth-dark); }
.btn-primary:hover { background: var(--earth-dark); }
.btn-light { background: var(--paper); border: 1px solid var(--line); }
.btn-outline { background: transparent; border: 1px solid var(--line); }
.btn-danger { background: var(--red); color: #fff; }
.btn.small { min-height: 34px; padding: 7px 11px; border-radius: 9px; font-size: 12px; }
.btn.full { width: 100%; }

.landing { position: relative; z-index: 1; }
.hero {
  max-width: 1320px;
  margin: 0 auto;
  padding: clamp(36px, 7vw, 90px) clamp(18px, 5vw, 70px) 54px;
  display: grid;
  grid-template-columns: 1.02fr .98fr;
  gap: 50px;
  align-items: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(59, 110, 74, .22);
  background: rgba(59, 110, 74, .09);
  color: var(--green);
  border-radius: 99px;
  padding: 7px 12px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.eyebrow span { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.hero h1, .section h2 {
  font-family: var(--display);
  line-height: 1.03;
  letter-spacing: 0;
  margin: 20px 0 16px;
}
.hero h1 { font-size: clamp(40px, 5.2vw, 68px); max-width: 760px; }
.hero p { color: var(--muted); font-size: 18px; max-width: 650px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 13px; margin: 28px 0; }
.hero-metrics { display: flex; flex-wrap: wrap; gap: 28px; }
.hero-metrics strong { display: block; font-family: var(--display); font-size: 27px; color: var(--earth-dark); }
.hero-metrics span { color: var(--muted); font-size: 13px; font-weight: 700; }
.hero-product {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 22px;
  padding: 20px;
  box-shadow: var(--shadow);
}
.product-header { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 14px; color: var(--muted); font-weight: 800; }
.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.metric-card { border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 15px; }
.metric-card span { color: var(--muted); font-size: 12px; font-weight: 800; }
.metric-card strong { display: block; margin-top: 5px; font: 800 22px var(--mono); }
.metric-card.success strong { color: var(--green); }
.metric-card.danger strong { color: var(--red); }
.portfolio-bars { margin-top: 14px; border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: #fff; }
.portfolio-bars div { display: grid; grid-template-columns: 128px 1fr 44px; gap: 10px; align-items: center; margin: 9px 0; font-size: 12px; font-weight: 800; color: var(--muted); }
.portfolio-bars i { height: 9px; border-radius: 9px; background: linear-gradient(90deg, var(--green), var(--gold)); width: var(--w); display: block; }
.portfolio-bars b { color: var(--ink); font-family: var(--mono); text-align: right; }

.section { max-width: 1320px; margin: 0 auto; padding: clamp(44px, 7vw, 86px) clamp(18px, 5vw, 70px); position: relative; }
.section-head { max-width: 720px; margin: 0 auto 34px; text-align: center; }
.section h2 { font-size: clamp(29px, 4vw, 46px); }
.section p { color: var(--muted); }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.feature-grid article, .pricing-grid article, .security-list div, .card, .panel {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 1px 2px rgba(43, 33, 26, .04);
}
.feature-grid b { display: block; font-size: 17px; margin-bottom: 8px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: center; }
.security-list { display: grid; gap: 12px; }
.security-list div { display: grid; gap: 4px; }
.security-list span { color: var(--muted); }
.pricing-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.pricing-grid h3 { margin: 0 0 12px; text-transform: uppercase; color: var(--muted); font-size: 14px; letter-spacing: .06em; }
.pricing-grid strong { display: block; font-family: var(--display); font-size: 34px; margin-bottom: 8px; }
.pricing-grid .featured { border-color: var(--gold); box-shadow: 0 24px 50px -38px var(--gold); }
.pricing-grid .featured > span { display: inline-flex; color: #3a2c0c; background: var(--gold); padding: 5px 10px; border-radius: 99px; font-size: 11px; font-weight: 800; margin-bottom: 10px; }
.footer { border-top: 1px solid var(--line); color: var(--muted); padding: 26px clamp(18px, 5vw, 70px); display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; position: relative; z-index: 1; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(43, 33, 26, .58);
  backdrop-filter: blur(7px);
}
.auth-card { width: min(100%, 430px); position: relative; background: var(--paper); border-radius: 20px; padding: 28px; box-shadow: var(--shadow); }
.auth-brand { margin-bottom: 16px; }
.auth-card h2 { font-family: var(--display); margin: 6px 0; font-size: 29px; }
.auth-card p { color: var(--muted); margin: 0 0 18px; }
.auth-card label, .form-grid label { display: grid; gap: 7px; color: var(--muted); font-weight: 800; font-size: 13px; margin-bottom: 13px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  padding: 11px 12px;
  min-height: 42px;
}
textarea { resize: vertical; }
.icon-close { position: absolute; right: 16px; top: 16px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); width: 34px; height: 34px; }
.quick-logins { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 14px; }
.quick-logins button { border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 8px; font-weight: 800; }
.auth-note { margin: 13px 0 0 !important; font: 700 12px var(--mono); }
.form-error { color: var(--red) !important; min-height: 18px; font-weight: 800; }

.app-shell { min-height: 100vh; position: relative; z-index: 1; display: grid; grid-template-columns: 280px 1fr; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(14px);
  padding: 18px;
}
.profile { margin: 20px 0; padding: 15px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.profile strong { display: block; }
.profile span { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.side-nav { display: grid; gap: 6px; }
.side-nav button {
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  border-radius: 10px;
  padding: 11px 12px;
  font-weight: 800;
}
.side-nav button.active, .side-nav button:hover { background: var(--surface); color: var(--earth-dark); }
.main { min-width: 0; }
.app-top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px clamp(16px, 3vw, 34px);
  background: rgba(248, 245, 239, .86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.mobile-menu { display: none; }
.app-title h1 { margin: 0; font-family: var(--display); font-size: clamp(23px, 3vw, 34px); }
.app-title p { margin: 2px 0 0; color: var(--muted); }
.content { padding: clamp(16px, 3vw, 34px); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { border: 1px solid var(--line); background: var(--paper); border-radius: var(--radius); padding: 18px; }
.kpi span { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.kpi strong { display: block; margin-top: 7px; font: 800 26px var(--mono); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.panel-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.panel-title h2, .card h2 { margin: 0; font-size: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
table { border-collapse: collapse; width: 100%; min-width: 780px; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 13px 14px; vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
td { font-size: 14px; }
tbody tr:last-child td { border-bottom: 0; }
.mono { font-family: var(--mono); }
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; padding: 5px 9px; font-size: 12px; font-weight: 900; background: var(--surface); color: var(--muted); }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.green { color: var(--green); background: rgba(59, 110, 74, .1); }
.badge.red { color: var(--red); background: rgba(180, 69, 47, .1); }
.badge.blue { color: var(--blue); background: rgba(52, 95, 125, .1); }
.badge.gold { color: #8a650d; background: rgba(200, 160, 70, .18); }
.cards { display: grid; gap: 12px; }
.tenant-home { max-width: 620px; margin: 0 auto; }
.big-action { width: 100%; justify-content: flex-start; margin-top: 10px; min-height: 54px; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translate(-50%, 120px);
  z-index: 50;
  background: var(--earth-dark);
  color: #fff;
  border-radius: 12px;
  padding: 12px 15px;
  font-weight: 800;
  box-shadow: var(--shadow);
  transition: transform .2s ease;
}
.toast.show { transform: translate(-50%, 0); }
.empty { border: 1px dashed var(--line); border-radius: var(--radius); padding: 24px; text-align: center; color: var(--muted); background: rgba(255, 255, 255, .52); }

@media (max-width: 1040px) {
  .hero, .split { grid-template-columns: 1fr; }
  .feature-grid, .pricing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 20; width: min(86vw, 300px); transform: translateX(-105%); transition: transform .2s ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu { display: inline-flex; }
}

@media (max-width: 720px) {
  .topbar { align-items: flex-start; }
  .nav-toggle { display: inline-flex; }
  .public-nav { position: absolute; right: 18px; top: 64px; width: min(320px, calc(100vw - 36px)); padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: var(--shadow); display: none; flex-direction: column; align-items: stretch; }
  .public-nav.open { display: flex; }
  .hero { padding-top: 34px; }
  .hero h1 { font-size: 38px; }
  .product-grid, .feature-grid, .pricing-grid, .grid-2, .form-grid, .kpis { grid-template-columns: 1fr; }
  .portfolio-bars div { grid-template-columns: 1fr; gap: 6px; }
  .portfolio-bars b { text-align: left; }
  .app-top { align-items: flex-start; }
  .app-top .btn:not(.mobile-menu) { padding-inline: 10px; }
  .quick-logins { grid-template-columns: 1fr; }
  .auth-card { padding: 22px; }
}
