:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --ink: #152033;
  --muted: #6d7789;
  --line: #e5eaf1;
  --primary: #175cd3;
  --primary-dark: #1248a7;
  --primary-soft: #edf4ff;
  --navy: #101b31;
  --navy-2: #182944;
  --green: #15803d;
  --green-soft: #ecfdf3;
  --red: #c73535;
  --red-soft: #fff1f1;
  --orange: #c36b11;
  --orange-soft: #fff7e8;
  --violet: #6d4fd4;
  --violet-soft: #f4f0ff;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 14px rgba(16, 24, 40, .04);
  --shadow-md: 0 12px 32px rgba(16, 24, 40, .09);
  --radius: 18px;
  --radius-sm: 12px;
  --sidebar: 264px;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 50; width: var(--sidebar);
  display: flex; flex-direction: column; padding: 26px 18px 20px;
  background: linear-gradient(180deg, #101b31 0%, #0d1729 100%); color: #fff;
  border-right: 1px solid rgba(255,255,255,.04);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  display: grid; place-items: center; flex: 0 0 auto; width: 42px; height: 42px;
  border-radius: 13px; background: linear-gradient(145deg, #2d79ef, #1753b7); color: #fff;
  font-weight: 800; letter-spacing: -.5px; box-shadow: 0 9px 24px rgba(23, 92, 211, .32);
}
.brand > div:last-child { display: flex; flex-direction: column; min-width: 0; }
.brand strong { font-size: 15px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand span { color: #98a7bd; font-size: 11px; letter-spacing: .09em; text-transform: uppercase; }
.nav-list { display: flex; flex-direction: column; gap: 6px; margin-top: 38px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 13px; min-height: 46px; padding: 0 13px;
  border-radius: 12px; color: #aab7ca; font-weight: 600; transition: .18s ease;
}
.nav-item .icon { display: grid; place-items: center; font-size: 20px; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-item.active { color: #fff; background: linear-gradient(90deg, rgba(45,121,239,.27), rgba(45,121,239,.11)); }
.nav-item.active::before { content: ""; position: absolute; left: -18px; width: 4px; height: 25px; border-radius: 0 6px 6px 0; background: #4b8efa; }
.sidebar-foot { margin-top: auto; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.08); }
.account-mini { display: flex; align-items: center; gap: 10px; padding: 4px 5px 15px; }
.account-mini > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.account-mini strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-mini small { color: #8190a6; font-size: 11px; }
.avatar {
  display: inline-grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px;
  border-radius: 11px; background: #eaf2ff; color: #175cd3; font-weight: 800;
}
.sidebar .avatar { background: rgba(75,142,250,.16); color: #83b2ff; }
.avatar-link { border: 1px solid #dbe5f3; }
.avatar-xl { width: 62px; height: 62px; border-radius: 18px; font-size: 22px; }
.logout-link { display: flex; align-items: center; gap: 11px; padding: 11px 8px; color: #98a7bd; font-weight: 600; }
.logout-link:hover { color: #fff; }
.logout-link .icon { font-size: 19px; }
.sidebar-backdrop { display: none; }
.main { min-height: 100vh; margin-left: var(--sidebar); display: flex; flex-direction: column; }
.topbar {
  min-height: 92px; display: flex; align-items: center; gap: 14px; padding: 18px 34px;
  background: rgba(255,255,255,.88); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px);
  position: sticky; top: 0; z-index: 30;
}
.page-heading { min-width: 0; }
.page-heading h1 { margin: 0; font-size: 23px; line-height: 1.25; letter-spacing: -.035em; }
.page-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.topbar-date { color: var(--muted); font-size: 12px; }
.mobile-menu { display: none !important; }
.content { width: 100%; max-width: 1600px; margin: 0 auto; padding: 28px 34px 40px; }
.footer { margin-top: auto; padding: 18px 34px 24px; text-align: center; color: #8b95a4; font-size: 11px; }

.icon { display: inline-grid; place-items: center; line-height: 1; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px;
  border: 1px solid transparent; border-radius: 11px; background: transparent; color: var(--ink);
  font-weight: 700; font-size: 13px; cursor: pointer; transition: .16s ease; white-space: nowrap;
}
.btn .icon { font-size: 17px; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 7px 18px rgba(23,92,211,.19); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: #fff; border-color: #dce3ec; color: #344054; }
.btn-secondary:hover { background: #f8fafc; border-color: #cfd8e5; }
.btn-light { background: #fff; color: #143461; box-shadow: 0 8px 22px rgba(3,15,35,.14); }
.btn-ghost { color: var(--muted); }
.btn-danger { background: var(--red-soft); color: var(--red); border-color: #f6caca; }
.btn-lg { min-height: 48px; padding-inline: 21px; border-radius: 13px; }
.btn-block { width: 100%; }
.btn.is-loading { opacity: .7; cursor: wait; }
.icon-button {
  display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid #e1e7ef;
  border-radius: 10px; background: #fff; color: #5f6b7d; cursor: pointer; transition: .16s ease;
}
.icon-button:hover { color: var(--primary); border-color: #bdd2f6; background: #f6f9ff; }
.icon-button.danger:hover { color: var(--red); border-color: #f2c7c7; background: var(--red-soft); }
.icon-button .icon { font-size: 17px; }

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.panel-head.compact { padding: 0 0 20px; margin-bottom: 22px; }
.panel-head h3 { margin: 0; font-size: 17px; letter-spacing: -.025em; }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.panel-head-actions { flex-wrap: wrap; }
.text-link { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); font-weight: 700; font-size: 12px; }
.text-link .icon { font-size: 15px; }

.alert {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; padding: 13px 15px;
  border: 1px solid; border-radius: 12px; font-weight: 600; font-size: 12px;
}
.alert-success { color: #116932; background: var(--green-soft); border-color: #bfe9ce; }
.alert-danger { color: #a52b2b; background: var(--red-soft); border-color: #f2caca; }
.alert-warning { color: #9a580e; background: var(--orange-soft); border-color: #f3d8a8; }
.alert-close { border: 0; background: none; color: inherit; font-size: 20px; line-height: 1; cursor: pointer; }

.hero-card {
  position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .75fr); gap: 30px;
  margin-bottom: 22px; padding: 35px; border-radius: 22px; color: #fff;
  background: radial-gradient(circle at 84% 15%, rgba(95,156,255,.33), transparent 35%), linear-gradient(130deg, #14294c 0%, #163d79 55%, #175cd3 100%);
  box-shadow: 0 18px 45px rgba(18,52,101,.18);
}
.hero-card::after { content: ""; position: absolute; right: -85px; bottom: -135px; width: 320px; height: 320px; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; box-shadow: 0 0 0 45px rgba(255,255,255,.03), 0 0 0 90px rgba(255,255,255,.02); }
.eyebrow { display: inline-block; color: #70a6ff; font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.hero-card .eyebrow { color: #a9caff; }
.hero-card h2 { max-width: 610px; margin: 9px 0 8px; font-size: 28px; line-height: 1.2; letter-spacing: -.045em; }
.hero-card p { max-width: 690px; margin: 0 0 23px; color: #c6d6eb; font-size: 13px; }
.hero-formula {
  position: relative; z-index: 2; align-self: center; display: flex; flex-direction: column; gap: 8px; padding: 22px;
  border: 1px solid rgba(255,255,255,.13); border-radius: 16px; background: rgba(6,20,45,.27); backdrop-filter: blur(10px);
}
.hero-formula span { color: #9dbbe3; font-size: 11px; }
.hero-formula strong { font-size: 15px; line-height: 1.55; }
.hero-formula small { color: #9dbbe3; }

.stats-grid { display: grid; gap: 16px; margin-bottom: 22px; }
.stats-grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.stats-grid.four { grid-template-columns: repeat(4, minmax(0,1fr)); }
.stat-card { display: flex; align-items: center; gap: 16px; min-width: 0; padding: 19px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm); }
.stat-icon { display: grid; place-items: center; flex: 0 0 auto; width: 44px; height: 44px; border-radius: 13px; font-size: 21px; }
.soft-blue { color: #175cd3; background: var(--primary-soft); }
.soft-violet { color: var(--violet); background: var(--violet-soft); }
.soft-green { color: var(--green); background: var(--green-soft); }
.soft-orange { color: var(--orange); background: var(--orange-soft); }
.stat-card > div { min-width: 0; display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 8px; }
.stat-card small { grid-column: 1 / -1; color: var(--muted); font-size: 11px; }
.stat-card strong { font-size: 24px; line-height: 1.25; letter-spacing: -.04em; }
.stat-card span:last-child { overflow: hidden; color: #8b95a4; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 840px; }
th { padding: 12px 16px; background: #f8fafc; color: #7b8595; text-align: left; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
td { padding: 15px 16px; border-top: 1px solid #edf0f4; color: #3b4658; vertical-align: middle; font-size: 12px; }
tbody tr { transition: .14s ease; }
tbody tr:hover { background: #fbfcfe; }
td > strong, td > span { display: block; }
td > small { display: block; margin-top: 3px; color: #929baa; font-size: 10px; }
.money-strong { color: #14294c; font-size: 13px; }
.actions-cell { white-space: nowrap; text-align: right; }
.actions-cell .icon-button, .actions-cell form { display: inline-grid; vertical-align: middle; }
.profile-pill, .role-badge, .status-badge, .default-badge, .fixed-badge {
  display: inline-flex; align-items: center; width: fit-content; padding: 5px 9px; border-radius: 999px; font-size: 10px; font-weight: 800;
}
.profile-pill { color: #4d399d; background: var(--violet-soft); }
.role-badge { color: #596579; background: #f0f3f7; }
.role-badge.admin { color: #1756b9; background: var(--primary-soft); }
.status-badge { gap: 6px; }
.status-badge i { width: 6px; height: 6px; border-radius: 50%; }
.status-badge.active { color: #14723a; background: var(--green-soft); }
.status-badge.active i { background: #25a153; }
.status-badge.passive { color: #7e8796; background: #f2f4f7; }
.status-badge.passive i { background: #99a2af; }
.rate-line { white-space: nowrap; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell > div { min-width: 0; }
.user-cell strong, .user-cell small { display: block; }
.user-cell small { color: var(--muted); font-size: 10px; }

.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 290px; padding: 35px; text-align: center; }
.empty-state.large { min-height: 520px; }
.empty-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; color: var(--primary); background: var(--primary-soft); font-size: 25px; }
.empty-state h4, .empty-state h2 { margin: 15px 0 5px; }
.empty-state p { max-width: 420px; margin: 0 0 18px; color: var(--muted); }
.error-code { color: #d6e4f9; font-size: 70px; font-weight: 900; letter-spacing: -.08em; }
.pagination { display: flex; justify-content: center; gap: 6px; padding: 20px; }
.pagination a { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: #5e697a; font-weight: 700; }
.pagination a.active { border-color: var(--primary); background: var(--primary); color: #fff; }

.filter-bar { display: flex; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--line); background: #fbfcfe; }
.filter-bar select { min-width: 190px; }
.search-field { position: relative; flex: 1; min-width: 220px; }
.search-field input { width: 100%; padding-left: 38px !important; }
.search-icon { position: absolute; top: 50%; left: 13px; transform: translateY(-50%); color: #8f98a7; font-size: 20px; }

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > span { color: #344054; font-size: 11px; font-weight: 800; }
.field > span em { color: #98a2b3; font-style: normal; font-weight: 500; }
.field > span strong { color: var(--primary); }
.field small { color: #8b95a5; font-size: 10px; }
input, select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #dce3ec; border-radius: 11px;
  outline: none; background: #fff; color: #1f2937; transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { border-color: #76a5ed; box-shadow: 0 0 0 4px rgba(23,92,211,.08); }
input::placeholder, textarea::placeholder { color: #b4bbc6; }
select { cursor: pointer; }
.form-grid { display: grid; gap: 18px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.form-grid.four { grid-template-columns: repeat(4, minmax(0,1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.form-grid .span-two { grid-column: span 2; }
.input-affix, .password-wrap { position: relative; }
.input-affix input { padding-right: 56px; }
.input-affix b { position: absolute; top: 50%; right: 13px; transform: translateY(-50%); color: #5e6b7e; font-size: 11px; }
.input-affix:not(.suffix) input { padding-left: 12px; }
.password-wrap input { padding-right: 70px; }
.password-toggle { position: absolute; top: 50%; right: 12px; transform: translateY(-50%); padding: 5px; border: 0; background: transparent; color: var(--primary); font-size: 10px; font-weight: 800; cursor: pointer; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.form-panel { padding: 25px; }
.form-page-wrap { max-width: 860px; margin: 0 auto; }
.section-divider { display: flex; align-items: center; gap: 12px; margin: 25px 0 19px; color: #687386; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.section-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.fixed-badge { color: #116932; background: var(--green-soft); }

.calculator-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(330px, .72fr); gap: 22px; align-items: start; }
.calculator-inputs { padding: 24px; }
.profile-rate-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; padding: 12px; border-radius: 13px; background: #f6f8fb; }
.profile-rate-strip > div { padding: 8px 12px; border-right: 1px solid #e3e8ef; }
.profile-rate-strip > div:last-child { border-right: 0; }
.profile-rate-strip span, .profile-rate-strip strong { display: block; }
.profile-rate-strip span { color: var(--muted); font-size: 10px; }
.profile-rate-strip strong { margin-top: 3px; color: #20304a; font-size: 14px; }
.calculator-result { position: sticky; top: 118px; }
.result-card { overflow: hidden; border-radius: 20px; background: #11223e; color: #fff; box-shadow: 0 18px 42px rgba(17,34,62,.19); }
.result-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 22px 22px 8px; }
.result-head span { color: #8da4c3; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.result-head h3 { margin: 4px 0 0; font-size: 16px; }
.live-dot { display: inline-flex !important; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 999px; background: rgba(44,198,106,.1); color: #73db9d !important; letter-spacing: 0 !important; }
.live-dot i { width: 6px; height: 6px; border-radius: 50%; background: #4bd07f; box-shadow: 0 0 0 4px rgba(75,208,127,.1); }
.final-price { padding: 16px 22px 20px; }
.final-price strong { display: block; font-size: clamp(31px, 3vw, 44px); line-height: 1; letter-spacing: -.055em; overflow-wrap: anywhere; }
.final-price span { display: block; margin-top: 8px; color: #8198b9; font-size: 10px; }
.tl-price, .quantity-total { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 22px; padding: 13px 14px; border-radius: 11px; }
.tl-price { background: rgba(54,128,242,.16); }
.quantity-total { margin-top: 8px; background: rgba(255,255,255,.05); }
.tl-price span, .quantity-total span { color: #9eb0c8; font-size: 10px; }
.tl-price strong { color: #8fbcff; font-size: 18px; }
.quantity-total strong { font-size: 13px; }
.result-steps { margin-top: 18px; border-top: 1px solid rgba(255,255,255,.08); }
.result-steps > div { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 12px 22px; border-bottom: 1px solid rgba(255,255,255,.06); }
.result-steps span { display: flex; align-items: center; color: #9bacbf; font-size: 10px; }
.result-steps i { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 8px; border-radius: 7px; background: rgba(255,255,255,.06); color: #8197b5; font-style: normal; font-size: 9px; }
.result-steps strong { font-size: 12px; white-space: nowrap; }
.result-steps .highlight { background: rgba(55,128,242,.13); }
.result-steps .highlight span, .result-steps .highlight strong { color: #a8c8fb; }
.formula-note { margin: 16px; padding: 12px; border-radius: 11px; background: rgba(255,255,255,.05); }
.formula-note strong { display: block; margin-bottom: 5px; color: #8fa1b9; font-size: 9px; text-transform: uppercase; letter-spacing: .1em; }
.formula-note code { display: block; color: #c3d0e1; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 9px; line-height: 1.6; overflow-wrap: anywhere; }
.formula-note.wide { margin: 20px 0 0; background: #f5f8fc; }
.formula-note.wide strong { color: #667085; }
.formula-note.wide code { color: #344054; }

.profile-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; padding: 20px; }
.profile-card { padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: #fff; transition: .16s ease; }
.profile-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.profile-card.disabled { opacity: .58; }
.profile-card-head { display: flex; align-items: center; gap: 11px; }
.company-avatar { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 13px; background: #edf4ff; color: var(--primary); font-weight: 900; }
.profile-card-head > div:nth-child(2) { min-width: 0; }
.profile-card-head h3 { margin: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-card-head span { color: var(--muted); font-size: 10px; }
.profile-card-head .default-badge { margin-left: auto; color: #1756b9; background: var(--primary-soft); white-space: nowrap; }
.profile-values { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin-top: 17px; }
.profile-values > div { padding: 10px; border-radius: 10px; background: #f8fafc; }
.profile-values span, .profile-values strong { display: block; }
.profile-values span { color: var(--muted); font-size: 9px; }
.profile-values strong { margin-top: 4px; font-size: 12px; }
.profile-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--line); }
.profile-card-foot > span { color: var(--muted); font-size: 9px; }
.profile-card-foot > div { display: flex; gap: 5px; }
.profile-card-foot form { display: inline-grid; }
.info-box { margin-top: 18px; padding: 17px 19px; border: 1px solid #cfe0f8; border-radius: 14px; background: #f3f8ff; }
.info-box strong { color: #234f8f; font-size: 12px; }
.info-box p { margin: 4px 0 0; color: #5d7290; font-size: 11px; }
.toggle-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; margin-top: 20px; }
.toggle-row { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; cursor: pointer; }
.toggle-row.single { margin-top: 20px; }
.toggle-row input { display: none; }
.toggle { position: relative; flex: 0 0 auto; width: 38px; height: 22px; border-radius: 999px; background: #cfd6df; transition: .18s; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18); transition: .18s; }
.toggle-row input:checked + .toggle { background: var(--primary); }
.toggle-row input:checked + .toggle::after { transform: translateX(16px); }
.toggle-row > span:last-child { display: flex; flex-direction: column; }
.toggle-row strong { font-size: 11px; }
.toggle-row small { color: var(--muted); font-size: 9px; }
.account-head { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.account-head h3 { margin: 0; font-size: 18px; }
.account-head p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }

.detail-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.detail-actions > div { display: flex; gap: 8px; }
.invoice-card { max-width: 1080px; margin: 0 auto; padding: 30px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: var(--shadow-sm); }
.invoice-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.invoice-head > div:first-child { display: flex; align-items: center; gap: 12px; }
.invoice-head > div:first-child > div:last-child { display: flex; flex-direction: column; }
.invoice-head > div:first-child span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.invoice-head > div:first-child strong { font-size: 16px; }
.invoice-meta { text-align: right; }
.invoice-meta span, .invoice-meta strong, .invoice-meta small { display: block; }
.invoice-meta span { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.invoice-meta strong { font-size: 19px; }
.invoice-meta small { color: var(--muted); }
.invoice-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin: 20px 0; }
.invoice-summary > div { padding: 15px; border-radius: 12px; background: #f7f9fc; }
.invoice-summary span, .invoice-summary strong, .invoice-summary small { display: block; }
.invoice-summary span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.invoice-summary strong { margin-top: 5px; font-size: 13px; }
.invoice-summary small { margin-top: 2px; color: #8b95a4; font-size: 9px; }
.invoice-price-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; overflow: hidden; margin-bottom: 22px; border-radius: 15px; background: #253a5e; }
.invoice-price-hero > div { padding: 22px; background: #14294c; color: #fff; }
.invoice-price-hero > div:last-child { background: #175cd3; }
.invoice-price-hero span, .invoice-price-hero strong, .invoice-price-hero small { display: block; }
.invoice-price-hero span { color: #a9bad2; font-size: 10px; }
.invoice-price-hero strong { margin: 7px 0 4px; font-size: 27px; letter-spacing: -.04em; }
.invoice-price-hero small { color: #b8c7dc; font-size: 9px; }
.detail-grid { display: grid; grid-template-columns: .78fr 1.22fr; gap: 22px; }
.detail-section { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.detail-section h3 { margin: 0; padding: 14px 16px; background: #f8fafc; border-bottom: 1px solid var(--line); font-size: 12px; }
dl { margin: 0; }
dl > div { display: flex; justify-content: space-between; gap: 15px; padding: 11px 15px; border-bottom: 1px solid #edf0f4; }
dl > div:last-child { border-bottom: 0; }
dt { color: var(--muted); font-size: 10px; }
dd { margin: 0; font-size: 11px; font-weight: 800; white-space: nowrap; }
dl > div.total { background: #f0f6ff; }
dl > div.total dt, dl > div.total dd { color: #1756b9; font-weight: 800; }
.invoice-note { margin-top: 20px; padding: 15px; border-left: 3px solid #8eb6f2; background: #f8fbff; }
.invoice-note strong { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.invoice-note p { margin: 5px 0 0; color: var(--muted); }
.danger-zone { max-width: 1080px; margin: 18px auto 0; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 16px 18px; border: 1px solid #f1cece; border-radius: 14px; background: #fff8f8; }
.danger-zone > div { display: flex; flex-direction: column; }
.danger-zone strong { color: #8f2f2f; font-size: 11px; }
.danger-zone span { color: #a56d6d; font-size: 9px; }

/* Login */
.login-body { background: #fff; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, .95fr) minmax(420px, 1.05fr); }
.login-visual { position: relative; overflow: hidden; display: flex; flex-direction: column; padding: 38px 46px; background: radial-gradient(circle at 80% 20%, rgba(72,139,247,.36), transparent 32%), linear-gradient(145deg, #101b31 0%, #14305a 62%, #175cd3 140%); color: #fff; }
.login-visual::before, .login-visual::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.08); }
.login-visual::before { width: 390px; height: 390px; right: -170px; bottom: -150px; box-shadow: 0 0 0 55px rgba(255,255,255,.025), 0 0 0 110px rgba(255,255,255,.018); }
.login-visual::after { width: 160px; height: 160px; right: 10%; top: 14%; }
.brand-light .brand-mark { box-shadow: 0 10px 26px rgba(0,0,0,.18); }
.brand-light span { color: #9db0cc; }
.login-copy { position: relative; z-index: 2; margin: auto 0; max-width: 570px; }
.login-copy h1 { margin: 12px 0 18px; font-size: clamp(44px, 5vw, 70px); line-height: .98; letter-spacing: -.065em; }
.login-copy p { max-width: 530px; color: #b8c8dd; font-size: 14px; line-height: 1.7; }
.login-metric-card { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 17px 19px; border: 1px solid rgba(255,255,255,.11); border-radius: 15px; background: rgba(8,20,42,.25); backdrop-filter: blur(10px); }
.login-metric-card > div { display: flex; flex-direction: column; }
.login-metric-card span { color: #90a5c1; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.login-metric-card strong { margin-top: 4px; font-size: 12px; }
.metric-status { display: flex !important; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 999px; background: rgba(39,190,100,.12); color: #76dba0 !important; }
.metric-status i { width: 6px; height: 6px; border-radius: 50%; background: #50d086; }
.login-form-wrap { display: grid; place-items: center; padding: 40px; }
.login-card { width: min(100%, 430px); }
.login-card h2 { margin: 8px 0 4px; font-size: 28px; letter-spacing: -.045em; }
.login-card > p { margin: 0 0 25px; color: var(--muted); font-size: 12px; }
.login-card .field { margin-bottom: 15px; }
.login-card .btn { margin-top: 6px; }
.login-help { display: block; margin-top: 16px; color: #98a2b3; text-align: center; font-size: 9px; }

/* Installer */
.install-body { background: #f2f5fa; }
.install-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(340px, .72fr) minmax(600px, 1.28fr); }
.install-aside { position: sticky; top: 0; height: 100vh; overflow: hidden; display: flex; flex-direction: column; padding: 38px 42px; background: radial-gradient(circle at 78% 18%, rgba(75,142,250,.32), transparent 32%), linear-gradient(145deg, #101b31, #183866); color: #fff; }
.install-aside::after { content: ""; position: absolute; width: 340px; height: 340px; border-radius: 50%; border: 1px solid rgba(255,255,255,.08); right: -180px; bottom: -130px; box-shadow: 0 0 0 55px rgba(255,255,255,.025); }
.install-copy { margin: auto 0 30px; position: relative; z-index: 2; }
.install-copy h1 { margin: 10px 0 16px; font-size: clamp(30px, 3.4vw, 49px); line-height: 1.08; letter-spacing: -.055em; }
.install-copy p { color: #b8c9df; line-height: 1.7; }
.install-features { position: relative; z-index: 2; display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; color: #b9c8dc; font-size: 11px; }
.install-features span { display: inline-grid; place-items: center; width: 19px; height: 19px; margin-right: 7px; border-radius: 6px; background: rgba(75,142,250,.17); color: #87b5ff; }
.install-main { padding: 45px clamp(30px, 5vw, 80px); }
.install-header { max-width: 720px; margin: 0 auto 24px; }
.install-header h2 { margin: 7px 0 4px; font-size: 27px; letter-spacing: -.04em; }
.install-header p { margin: 0; color: var(--muted); }
.install-form { max-width: 720px; margin: 0 auto; padding: 26px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: var(--shadow-sm); }
.form-section-title { display: flex; align-items: center; gap: 11px; margin: 27px 0 15px; }
.form-section-title:first-of-type { margin-top: 0; }
.form-section-title > span { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); font-size: 11px; font-weight: 900; }
.form-section-title > div { display: flex; flex-direction: column; }
.form-section-title strong { font-size: 12px; }
.form-section-title small { color: var(--muted); font-size: 9px; }
.requirement-row { max-width: 720px; margin: 0 auto 16px; display: flex; flex-wrap: wrap; gap: 7px; }
.requirement { padding: 5px 8px; border-radius: 999px; font-size: 9px; font-weight: 700; }
.requirement.ok { color: #14723a; background: var(--green-soft); }
.requirement.bad { color: #a52b2b; background: var(--red-soft); }
.install-main > .alert { max-width: 720px; margin-inline: auto; }
.install-success { max-width: 600px; margin: 14vh auto 0; text-align: center; }
.success-icon { display: grid; place-items: center; width: 68px; height: 68px; margin: 0 auto 18px; border-radius: 22px; background: var(--green-soft); color: var(--green); font-size: 31px; font-weight: 900; }
.install-success h2 { margin: 8px 0; font-size: 31px; }
.install-success p { margin: 0 auto 24px; color: var(--muted); }

@media (max-width: 1180px) {
  .stats-grid.four { grid-template-columns: repeat(2,1fr); }
  .profile-grid { grid-template-columns: repeat(2,1fr); }
  .calculator-layout { grid-template-columns: minmax(0,1fr) 340px; }
}

@media (max-width: 980px) {
  :root { --sidebar: 250px; }
  .sidebar { transform: translateX(-105%); transition: transform .22s ease; box-shadow: 20px 0 50px rgba(7,18,38,.25); }
  .sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 45; background: rgba(7,15,29,.52); backdrop-filter: blur(2px); }
  .sidebar-open .sidebar-backdrop { display: block; }
  .main { margin-left: 0; }
  .mobile-menu { display: inline-grid !important; }
  .topbar { padding-inline: 22px; }
  .content { padding: 22px; }
  .calculator-layout { grid-template-columns: 1fr; }
  .calculator-result { position: static; }
  .result-card { max-width: none; }
  .hero-card { grid-template-columns: 1fr; }
  .hero-formula { max-width: 580px; }
  .login-shell { grid-template-columns: 1fr; }
  .login-visual { min-height: 390px; padding: 30px; }
  .login-copy { margin: 60px 0 35px; }
  .login-copy h1 { font-size: 47px; }
  .login-form-wrap { padding: 50px 25px; }
  .install-shell { grid-template-columns: 1fr; }
  .install-aside { position: relative; height: auto; min-height: 420px; }
  .install-copy { margin: 80px 0 30px; }
}

@media (max-width: 720px) {
  .topbar { min-height: 76px; padding: 14px 16px; }
  .page-heading h1 { font-size: 18px; }
  .page-heading p, .topbar-date { display: none; }
  .content { padding: 16px 12px 28px; }
  .footer { padding-inline: 16px; }
  .hero-card { padding: 25px 20px; border-radius: 18px; }
  .hero-card h2 { font-size: 24px; }
  .hero-formula { padding: 16px; }
  .stats-grid.three, .stats-grid.four { grid-template-columns: 1fr 1fr; }
  .stat-card { padding: 14px; gap: 11px; }
  .stat-icon { width: 39px; height: 39px; font-size: 18px; }
  .stat-card strong { font-size: 20px; }
  .panel { border-radius: 15px; }
  .panel-head { padding: 17px; }
  .panel-head-actions .btn { width: 100%; }
  .filter-bar { flex-wrap: wrap; padding: 12px; }
  .filter-bar .search-field, .filter-bar select { width: 100%; min-width: 0; }
  .calculator-inputs { padding: 17px; }
  .form-grid.two, .form-grid.three, .form-grid.four { grid-template-columns: 1fr; }
  .form-grid .span-two { grid-column: auto; }
  .profile-rate-strip { grid-template-columns: 1fr; }
  .profile-rate-strip > div { border-right: 0; border-bottom: 1px solid #e3e8ef; }
  .profile-rate-strip > div:last-child { border-bottom: 0; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; }
  .result-card { border-radius: 17px; }
  .profile-grid { grid-template-columns: 1fr; padding: 14px; }
  .profile-values { grid-template-columns: 1fr 1fr 1fr; }
  .toggle-grid { grid-template-columns: 1fr; }
  .detail-actions { align-items: stretch; flex-direction: column; }
  .detail-actions > div { display: grid; grid-template-columns: 1fr 1fr; }
  .detail-actions > .btn, .detail-actions > div .btn:last-child { grid-column: 1 / -1; }
  .invoice-card { padding: 17px; border-radius: 15px; }
  .invoice-head { align-items: flex-start; }
  .invoice-summary { grid-template-columns: 1fr; }
  .invoice-price-hero { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .danger-zone { align-items: stretch; flex-direction: column; }
  .login-visual { min-height: 350px; }
  .login-copy { margin: 45px 0 25px; }
  .login-copy h1 { font-size: 40px; }
  .login-metric-card { align-items: flex-start; flex-direction: column; }
  .install-aside { padding: 28px 24px; }
  .install-main { padding: 32px 16px; }
  .install-form { padding: 18px; border-radius: 15px; }
}

@media (max-width: 480px) {
  .stats-grid.three, .stats-grid.four { grid-template-columns: 1fr; }
  .stat-card > div { grid-template-columns: auto 1fr; }
  .profile-values { grid-template-columns: 1fr; }
  .final-price strong { font-size: 34px; }
  .result-steps > div { align-items: flex-start; }
  .result-steps span { max-width: 62%; }
  .detail-actions > div { grid-template-columns: 1fr; }
  .detail-actions > div .btn { grid-column: auto !important; }
}

@media print {
  body { background: #fff; }
  .sidebar, .topbar, .footer, .no-print { display: none !important; }
  .main { margin: 0; }
  .content { max-width: none; padding: 0; }
  .invoice-card { max-width: none; border: 0; box-shadow: none; padding: 0; }
  .invoice-price-hero, .profile-pill { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
