:root {
  --bg: #f2f5f8;
  --surface: #ffffff;
  --surface-soft: #f4f8fb;
  --text: #0d121a;
  --muted: #536173;
  --line: #d6dee8;
  --primary: #2fb2e5;
  --primary-600: #1c99ca;
  --primary-soft: #e7f7fd;
  --success: #129a62;
  --warn: #b7791f;
  --danger: #e52f2f;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-1: 0 10px 28px rgba(8, 20, 35, 0.08);
  --shadow-2: 0 18px 42px rgba(8, 20, 35, 0.14);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Manrope", "DM Sans", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at -10% -20%, #dff5ff 0%, rgba(223, 245, 255, 0) 55%),
    radial-gradient(900px 500px at 115% -10%, #e9faff 0%, rgba(233, 250, 255, 0) 50%),
    linear-gradient(180deg, #f9fcff 0%, #f2f5f8 40%, #eef2f6 100%);
}

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

h1, h2, h3, h4, h5 {
  font-family: "Space Grotesk", "Manrope", sans-serif;
  letter-spacing: -0.02em;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.logo { font-weight: 800; letter-spacing: -0.02em; font-size: 22px; }
.topbar nav { display: flex; gap: 12px; align-items: center; }
.topbar nav a { color: var(--muted); font-weight: 700; }
.topbar nav a:hover { color: var(--text); }

.btn {
  border: none;
  border-radius: 11px;
  padding: 10px 16px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: 0.18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn.secondary { background: #10161f; }
.btn.secondary:hover { background: #1b2430; }

.hero {
  max-width: 1160px;
  margin: 42px auto;
  padding: 0 18px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 22px;
}
.hero h1 {
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.03;
  margin: 8px 0;
}
.pill {
  display: inline-block;
  background: var(--primary-soft);
  color: var(--primary-600);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.hero-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.lp-hero { margin-top: 32px; align-items: stretch; }
.lp-hero-copy p { max-width: 64ch; }
.lp-proof-card { background: linear-gradient(180deg, #ffffff 0%, #f6faff 100%); }
.lp-quick-points { margin: 12px 0 0; padding-left: 18px; color: #304563; }
.lp-quick-points li { margin-bottom: 6px; font-weight: 600; }
.lp-kpi-row {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.lp-kpi-row div {
  background: #f7faff;
  border: 1px solid #d7e6ff;
  border-radius: 12px;
  padding: 10px;
}
.lp-kpi-row strong {
  display: block;
  font-size: 15px;
  color: #12356f;
}
.lp-kpi-row span {
  font-size: 12px;
  color: #516888;
  font-weight: 600;
}
.lp-trust-strip {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.lp-trust-strip span {
  background: #f3f7ff;
  border: 1px solid #d5e3ff;
  color: #214377;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  border-radius: 999px;
  padding: 6px 10px;
}
.lp-section { margin-top: 26px; margin-bottom: 0; }
.lp-head { margin-bottom: 14px; }
.lp-head h2 {
  margin: 0 0 6px;
  font-size: clamp(26px, 3.5vw, 40px);
  line-height: 1.1;
}
.lp-head p { color: var(--muted); margin: 0; max-width: 72ch; }
.lp-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.lp-feature {
  padding: 16px;
  border-radius: 12px;
}
.lp-feature h3 {
  font-size: 20px;
  margin: 0 0 8px;
}
.lp-feature p {
  margin: 0;
  color: #455a78;
  line-height: 1.55;
}
.lp-workflow .lp-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.lp-step {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  box-shadow: var(--shadow-1);
}
.lp-step-no {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #eaf2ff;
  color: #123b78;
  font-weight: 900;
  margin-bottom: 10px;
}
.lp-step h3 { margin: 0 0 6px; font-size: 18px; }
.lp-step p { margin: 0; color: #465a77; line-height: 1.5; }
.lp-why-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.lp-why-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
}
.lp-why-card p {
  margin: 0;
  color: #465a77;
}
.lp-final-cta .card {
  padding: 26px;
  background: linear-gradient(180deg, #ffffff 0%, #f3f8ff 100%);
}
.lp-final-cta h2 {
  margin: 0 0 8px;
  font-size: clamp(28px, 3vw, 42px);
}
.lp-final-cta p {
  margin: 0;
  max-width: 72ch;
  color: #3f5473;
}

.hero-card,
.card,
.auth-card,
.panel,
.kpi {
  background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}

.hero-card,
.panel,
.card { padding: 18px; }

.wrap { max-width: 1160px; margin: 30px auto; padding: 0 16px; }
.pricing-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.price { font-size: 34px; font-weight: 900; margin: 8px 0; letter-spacing: -0.02em; }

.auth-wrap {
  min-height: calc(100vh - 76px);
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(480px, 96vw);
  padding: 26px;
  display: grid;
  gap: 12px;
}

.auth-card.wide { width: min(700px, 96vw); }

label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  color: #344054;
}

input,
select,
textarea,
.form-control,
.form-select {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 12px;
  font-size: 14px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

input:focus,
select:focus,
textarea:focus,
.form-control:focus,
.form-select:focus {
  border-color: #8fb3ff;
  box-shadow: 0 0 0 3px rgba(15, 91, 217, 0.14);
}

.error, .success, .hint {
  border-radius: 11px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
}
.error { background: #fff1f2; color: #a3202f; border: 1px solid #fecdd3; }
.success { background: #ecfdf4; color: #0f7a4f; border: 1px solid #bbf7d0; }
.hint { background: #eef4ff; color: #2453b3; border: 1px solid #c7d7fe; }

.footer {
  text-align: center;
  padding: 22px;
  color: var(--muted);
  font-size: 13px;
}

.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 282px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #f8fbfd 0%, #f3f7fa 100%);
  padding: 0;
}

.sidebar .offcanvas-header {
  min-height: 68px;
  background: rgba(255, 255, 255, 0.6);
}

.sidebar .firm {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.sidebar .offcanvas-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  overflow-y: auto;
}

.menu-group-title {
  margin-top: 10px;
  margin-bottom: 3px;
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #90a0b8;
  font-weight: 800;
}

.sidebar a {
  padding: 10px 12px;
  border-radius: 11px;
  color: #304563;
  font-weight: 700;
  transition: 0.15s ease;
}

.menu-link {
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-link i {
  width: 18px;
  text-align: center;
  font-size: 15px;
}

.sidebar a.active,
.sidebar a:hover {
  background: #e8f7fd;
  color: #0c536e;
  box-shadow: inset 0 0 0 1px #cbeaf5;
}

.app-main {
  flex: 1;
  min-width: 0;
  padding: 20px;
  background: transparent;
}

.workspace-top {
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-1);
}

.workspace-icon {
  font-size: 14px;
  color: #4b5f7e;
}

.workspace-name {
  font-size: clamp(20px, 2.4vw, 32px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.app-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 10px;
}

.app-head h1,
h1 {
  margin: 0;
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 900;
  letter-spacing: -0.025em;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
  align-items: end;
}

.kpi { padding: 14px; border-radius: 13px; box-shadow: var(--shadow-1); }
.kpi span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.kpi strong {
  font-size: clamp(25px, 2.15vw, 40px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: #253651;
}

.split-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 12px; }
.panel { overflow: auto; margin-bottom: 12px; }
.panel h2 {
  margin: 0 0 8px;
  font-size: clamp(21px, 2vw, 31px);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.table,
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

.table th,
.table td,
th,
td {
  border: 1px solid var(--line);
  border-left-width: 0;
  border-top-width: 0;
  padding: 11px 12px;
  text-align: left;
  white-space: nowrap;
  background: #fff;
}

.table th,
th {
  background: #f6f9ff;
  color: #5d6e88;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.table tr > *:first-child,
tr > *:first-child { border-left-width: 1px; }
.table thead tr:first-child > *,
thead tr:first-child > * { border-top-width: 1px; }
.table tr:first-child th:first-child,
tr:first-child th:first-child { border-top-left-radius: 10px; }
.table tr:first-child th:last-child,
tr:first-child th:last-child { border-top-right-radius: 10px; }
.table tbody tr:last-child td:first-child,
tbody tr:last-child td:first-child { border-bottom-left-radius: 10px; }
.table tbody tr:last-child td:last-child,
tbody tr:last-child td:last-child { border-bottom-right-radius: 10px; }
.table tbody tr:hover td,
tbody tr:hover td { background: #fbfdff; }

.grid-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.inline-form { display: flex; gap: 8px; align-items: center; }
.grid-form.compact { grid-template-columns: repeat(3, minmax(0,1fr)); }

.orders-filter-row {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1.2fr auto auto;
  gap: 10px;
  margin: 10px 0;
  align-items: end;
}

.products-filter-row { grid-template-columns: 2fr 2fr auto; }

.chip-input {
  display: grid;
  gap: 4px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px;
}

.chip-input label {
  font-size: 12px;
  color: #6b7e9c;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.toggle-check {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  font-size: 13px;
}

.edit-link {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #344054;
  background: #fff;
}

.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  gap: 10px;
}

.rows-form label { display: flex; align-items: center; gap: 8px; }
.pager { color: var(--muted); font-weight: 700; }
.pager-btns { display: flex; gap: 6px; }
.btn.tiny { padding: 6px 10px; font-size: 12px; }
.btn.disabled { opacity: .45; pointer-events: none; }

.badge {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: #e9eef8;
  color: #425466;
}
.badge.success { background: #dbf7e8; color: #1a8452; }
.badge.warn { background: #fff2d5; color: #9a630d; }
.badge.danger { background: #ffe6e6; color: #bd2323; }

.pos { color: #16824f; font-weight: 800; }
.neg { color: #c63d4d; font-weight: 800; }
.muted-note { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.chart-sub { color: var(--muted); margin: 2px 0 14px; }

.userbox {
  margin-top: 12px;
  padding: 11px;
  background: #edf3ff;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
}
.userbox span { color: var(--muted); font-size: 12px; }
.account-dropdown { margin-top: auto; }
.account-dropdown .userbox { width: 100%; text-align: left; }
.account-dropdown .dropdown-toggle::after { margin-left: auto; }
.userbox-top { display: flex; align-items: center; gap: 10px; }
.avatar-circle {
  width: 31px;
  height: 31px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}

.navbar-brand span {
  font-family: "Space Grotesk", "Manrope", sans-serif;
  letter-spacing: -0.01em;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  overflow: hidden;
}

.brand-mark img {
  display: block;
  max-width: 100%;
  height: auto;
}

.nav-logo {
  width: 38px;
  height: 38px;
  border: 1px solid #d7e7f0;
  background: #fff;
}

.side-logo {
  width: 36px;
  height: 36px;
  border: 1px solid #d7e7f0;
  background: #fff;
}

.brand-fallback {
  min-width: 36px;
  min-height: 36px;
  padding: 0 8px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #0b1118;
  background: linear-gradient(135deg, #dff6ff 0%, #ffffff 100%);
  border: 1px solid #cae9f5;
}
.account-dropdown .dropdown-menu {
  border-radius: 11px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-2);
}
.account-dropdown .dropdown-item { font-weight: 700; }

.readonly-field {
  background: #f2f4f8;
  color: #344054;
}

.bulk-edit-row { background: #fffdf5; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 17, 36, 0.48);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 30;
}

.modal-card {
  width: min(660px, 95vw);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-2);
  padding: 18px;
}
.modal-card h2 { margin: 0 0 6px; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.chart-wrap {
  width: 100%;
  min-height: 330px;
}

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

.btn.btn-primary {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-600) 100%);
  border-color: var(--primary-600);
}

@media (max-width: 1180px) {
  .filter-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-grid { grid-template-columns: 1fr; }
  .grid-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lp-feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lp-workflow .lp-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lp-why-grid { grid-template-columns: 1fr; }
}

@media (max-width: 991px) {
  .app-layout { display: block; }
  .sidebar { width: auto; }
  .workspace-name { font-size: 23px; }
  .orders-filter-row,
  .products-filter-row,
  .date-top,
  .grid-form,
  .grid-form.compact,
  .filter-row { grid-template-columns: 1fr; }
  .table-footer { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 700px) {
  .hero { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .lp-kpi-row { grid-template-columns: 1fr; }
  .lp-feature-grid,
  .lp-workflow .lp-steps { grid-template-columns: 1fr; }
  .app-main { padding: 14px; }
  .workspace-top { padding: 10px 12px; }
  .panel,
  .card,
  .hero-card,
  .auth-card { padding: 14px; }
}
