:root {
  color-scheme: light;
  --navy-950: #08112c;
  --navy-900: #0b1739;
  --navy-800: #12234b;
  --blue-600: #2563eb;
  --blue-500: #3676f5;
  --teal-500: #16a89a;
  --amber-500: #f4a524;
  --ink: #17223b;
  --muted: #68738a;
  --line: #dfe5ef;
  --line-strong: #cfd7e5;
  --surface: #ffffff;
  --surface-soft: #f6f8fc;
  --background: #eef2f8;
  --success: #16866f;
  --danger: #c94854;
  --shadow: 0 16px 45px rgba(20, 34, 66, 0.08);
  --radius-lg: 18px;
  --radius-md: 12px;
  --sidebar: 250px;
  font-family: "SF Arabic", "Noto Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--background); overflow-x: hidden; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 88% -10%, rgba(37, 99, 235, 0.10), transparent 27rem),
    var(--background);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.24);
  outline-offset: 2px;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 20;
  display: flex;
  flex-direction: column;
  padding: 26px 18px 20px;
  color: #fff;
  overflow: hidden;
  background:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px),
    radial-gradient(circle at 50% -5%, rgba(54,118,245,.33), transparent 18rem),
    var(--navy-950);
  background-size: 28px 28px, 28px 28px, auto, auto;
}

.sidebar::after {
  content: "";
  position: absolute;
  inset-inline-start: -80px;
  bottom: 70px;
  width: 180px;
  height: 180px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 50%;
  box-shadow: 0 0 0 32px rgba(255,255,255,.018), 0 0 0 64px rgba(255,255,255,.012);
  pointer-events: none;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 28px; position: relative; z-index: 1; }
.brand-mark {
  display: block;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  object-fit: cover;
  box-shadow: 0 9px 24px rgba(37,99,235,.20);
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.35; }
.brand-copy strong { font-size: 1.32rem; letter-spacing: -.02em; }
.brand-copy small { color: #9faaca; font-size: .73rem; }

.side-nav { display: grid; gap: 8px; position: relative; z-index: 1; }
.nav-item {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 13px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #aeb8d2;
  text-align: start;
  font-weight: 650;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.07); transform: translateY(-1px); }
.nav-item.active { color: #fff; background: rgba(54,118,245,.21); border-color: rgba(100,149,255,.22); }
.nav-item.active::before { content: ""; width: 3px; height: 22px; background: var(--amber-500); border-radius: 99px; margin-inline-start: -14px; }
.nav-icon { width: 22px; color: currentColor; text-align: center; font-size: 1.2rem; }
.nav-count { margin-inline-start: auto; min-width: 25px; padding: 1px 7px; border-radius: 99px; background: rgba(255,255,255,.10); color: #e3e9f9; font-size: .78rem; text-align: center; }
.nav-create { margin-top: 10px; background: linear-gradient(135deg, #2d6cf1, #2157cc); color: #fff; box-shadow: 0 10px 25px rgba(18,77,205,.25); }
.nav-create:hover { background: linear-gradient(135deg, #3b7afa, #2862df); }

.sidebar-note {
  position: relative;
  z-index: 1;
  margin-top: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 12px;
  background: rgba(255,255,255,.045);
}
.sidebar-note div { display: flex; flex-direction: column; }
.sidebar-note strong { font-size: .86rem; }
.sidebar-note small { color: #98a4c4; font-size: .72rem; }
.pulse-dot { width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: #49d6a8; box-shadow: 0 0 0 5px rgba(73,214,168,.12); }

.main-content { width: 100%; min-width: 0; overflow-x: clip; }
.topbar {
  height: 76px;
  padding: 0 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(205,215,230,.8);
  background: rgba(246,248,252,.88);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 15;
}
.mobile-brand { display: none; align-items: center; gap: 9px; }
.mobile-brand-logo { display: block; width: 136px; height: auto; }
.company-context { display: flex; flex-direction: column; line-height: 1.35; }
.eyebrow, .overline { margin: 0; color: var(--blue-600); font-size: .76rem; font-weight: 800; letter-spacing: .04em; }
.company-context strong { font-size: .97rem; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.language-switch { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.lang-btn { min-width: 35px; height: 30px; padding: 0 8px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: .78rem; font-weight: 800; }
.lang-btn.active { color: #fff; background: var(--navy-900); }
.avatar { width: 38px; height: 38px; border: 0; border-radius: 12px; background: #dfe7f9; color: var(--navy-800); font-weight: 800; }
.top-trial-btn { min-height: 36px; display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border: 1px solid #cbd9fb; border-radius: 10px; color: #1f55c8; background: #edf3ff; font-size: .78rem; font-weight: 800; }
.top-trial-btn:hover { border-color: #9db8f3; background: #e2ecff; }
.trial-spark { color: var(--amber-500); }

.view { display: none; width: 100%; min-width: 0; padding: 34px; max-width: 1520px; margin: 0 auto; animation: view-in .24s ease; }
.view.active { display: block; }
@keyframes view-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.page-heading h1, .editor-heading h1 { margin: 2px 0 3px; font-size: clamp(1.55rem, 2vw, 2.15rem); line-height: 1.25; letter-spacing: -.035em; }
.page-heading p:not(.overline) { margin: 0; color: var(--muted); }

.primary-btn, .outline-btn, .ghost-btn, .whatsapp-btn, .text-action, .back-btn, .icon-btn {
  border-radius: 10px;
  font-weight: 750;
  transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.primary-btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border: 1px solid #1c55d8; color: #fff; background: linear-gradient(135deg, var(--blue-500), #2457c8); box-shadow: 0 8px 22px rgba(37,99,235,.20); }
.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 11px 25px rgba(37,99,235,.26); }
.outline-btn { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 13px; border: 1px solid var(--line-strong); background: #fff; color: var(--ink); }
.outline-btn:hover, .ghost-btn:hover { border-color: #a9b8d0; background: #f8faff; }
.ghost-btn { min-height: 39px; padding: 7px 13px; border: 1px solid var(--line); color: #38445c; background: transparent; }
.text-action { padding: 0; border: 0; color: var(--blue-600); background: transparent; }
.text-action:hover { text-decoration: underline; }

.metrics-grid { display: grid; grid-template-columns: 1.35fr repeat(3, 1fr); gap: 16px; }
.metric-card, .panel { border: 1px solid rgba(211,220,233,.88); border-radius: var(--radius-lg); background: var(--surface); box-shadow: 0 10px 30px rgba(29,42,74,.045); }
.metric-card { min-height: 174px; padding: 20px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.metric-featured { color: #fff; border-color: transparent; background:
  linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
  linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px),
  radial-gradient(circle at 90% 10%, rgba(54,118,245,.55), transparent 15rem),
  var(--navy-900); background-size: 22px 22px, 22px 22px, auto, auto; box-shadow: 0 16px 35px rgba(8,17,44,.18); }
.metric-featured::after { content: ""; position: absolute; width: 150px; height: 150px; inset-inline-end: -60px; bottom: -80px; border-radius: 50%; border: 18px solid rgba(255,255,255,.06); }
.metric-topline, .metric-foot, .progress-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.metric-topline { color: #c5d0ed; font-size: .86rem; }
.period-chip { padding: 3px 8px; border: 1px solid rgba(255,255,255,.15); border-radius: 99px; background: rgba(255,255,255,.08); font-size: .72rem; }
.metric-value { margin-top: 13px; font-size: clamp(1.75rem, 2.2vw, 2.45rem); line-height: 1.1; letter-spacing: -.035em; }
.metric-value small { font-size: .78rem; font-weight: 700; color: #b8c4e3; }
.metric-value.dark { color: var(--ink); }
.metric-value.dark small { color: var(--muted); }
.metric-label { color: var(--muted); font-size: .86rem; }
.metric-foot { margin-top: auto; position: relative; z-index: 1; }
.trend-up { color: #77e4c4; font-size: .75rem; font-weight: 700; }
.mini-bars { display: flex; align-items: end; gap: 3px; height: 23px; }
.mini-bars i { width: 4px; border-radius: 4px; background: #4b7eef; }
.mini-bars i:nth-child(1) { height: 8px; }.mini-bars i:nth-child(2) { height: 14px; }.mini-bars i:nth-child(3) { height: 11px; }.mini-bars i:nth-child(4) { height: 20px; }.mini-bars i:nth-child(5) { height: 17px; background: var(--amber-500); }
.progress-row { margin-top: auto; color: var(--muted); font-size: .76rem; }
.progress-row strong { color: var(--success); }
.progress-track { height: 6px; margin-top: 8px; border-radius: 99px; background: #edf1f7; overflow: hidden; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal-500), #4ac6a7); transition: width .3s ease; }
.metric-caption { margin: auto 0 0; color: var(--muted); font-size: .76rem; }
.attention-card::before { content: ""; position: absolute; inset-inline-start: 0; top: 18px; bottom: 18px; width: 3px; border-radius: 99px; background: var(--amber-500); }
.attention-card .text-action { margin-top: auto; align-self: flex-start; font-size: .78rem; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(280px, .75fr); gap: 16px; margin-top: 16px; }
.panel { overflow: hidden; }
.panel-header { padding: 20px 22px 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.panel-header h2, .focus-head h2, .section-title h2, .summary-heading h2 { margin: 1px 0 0; font-size: 1.08rem; line-height: 1.35; }
.responsive-table { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 18px; background: #f8f9fc; border-block: 1px solid var(--line); color: #737e92; font-size: .74rem; font-weight: 800; text-align: start; white-space: nowrap; }
td { padding: 15px 18px; border-bottom: 1px solid #edf0f5; font-size: .86rem; text-align: start; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafbfe; }
.client-cell { display: flex; align-items: center; gap: 10px; min-width: 165px; }
.client-logo { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; background: #e8edfb; color: #304b91; font-size: .75rem; font-weight: 850; }
.client-cell div, .quote-project { display: flex; flex-direction: column; }
.client-cell small, .quote-project small { color: var(--muted); font-size: .72rem; }
.number-cell { direction: ltr; unicode-bidi: isolate; font-weight: 700; color: #4a5770; }
.amount-cell { direction: ltr; unicode-bidi: isolate; font-weight: 800; color: var(--ink); white-space: nowrap; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 99px; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-accepted { color: #127960; background: #e5f7f0; }
.status-sent { color: #245dcb; background: #e9f0ff; }
.status-draft { color: #6a7181; background: #eef0f4; }
.status-rejected { color: #b6404b; background: #fcebed; }
.focus-panel { padding: 21px; display: flex; flex-direction: column; background: linear-gradient(160deg, #fff 30%, #f7f9fe); }
.focus-head { display: flex; gap: 11px; align-items: flex-start; }
.focus-icon { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; color: #9c6510; background: #fff1d8; font-weight: 800; }
.focus-client { margin: 24px 0 12px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #fff; display: flex; flex-direction: column; }
.focus-client span { color: var(--muted); font-size: .78rem; direction: ltr; unicode-bidi: isolate; text-align: start; }
.focus-panel > p { margin: 0 0 20px; color: var(--muted); font-size: .83rem; }
.whatsapp-btn { width: 100%; min-height: 43px; margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid #bddfd7; color: #116f5d; background: #ebf8f5; }
.whatsapp-btn:hover { background: #def4ef; transform: translateY(-1px); }

.quotes-panel { min-height: 500px; }
.quote-toolbar { padding: 17px 20px; display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.search-field { min-width: min(380px, 100%); min-height: 42px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; background: #f9fafe; color: var(--muted); }
.search-field:focus-within { border-color: #9ab5ec; box-shadow: 0 0 0 3px rgba(37,99,235,.08); background: #fff; }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); }
.filter-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-pill { min-height: 36px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 99px; background: #fff; color: var(--muted); font-size: .78rem; font-weight: 750; }
.filter-pill.active { color: #fff; border-color: var(--navy-900); background: var(--navy-900); }
.roomy-table td { padding-block: 17px; }
.mobile-quotes-list { display: none; }
.row-action { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--muted); font-weight: 900; }
.row-action:hover { border-color: #aec0e0; color: var(--blue-600); background: #f5f8ff; }
.margin-positive { color: var(--success); font-weight: 800; direction: ltr; unicode-bidi: isolate; }
.empty-state { min-height: 280px; padding: 40px; display: grid; place-content: center; justify-items: center; text-align: center; color: var(--muted); }
.empty-state[hidden] { display: none; }
.empty-state > span { width: 48px; height: 48px; margin-bottom: 12px; display: grid; place-items: center; border-radius: 15px; background: #eef2f8; font-size: 1.5rem; }
.empty-state strong { color: var(--ink); }
.empty-state p { margin: 4px 0 0; font-size: .84rem; }

.editor-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.editor-heading > div:nth-child(2) { flex: 1; }
.back-btn { width: 42px; height: 42px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 1.25rem; }
.editor-actions { display: flex; gap: 9px; }
.editor-layout { width: 100%; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 315px; gap: 17px; align-items: start; }
.editor-main { display: grid; gap: 17px; min-width: 0; }
.form-panel { padding: 22px; }
.section-title { display: flex; align-items: center; gap: 11px; margin-bottom: 20px; }
.section-title p { margin: 1px 0 0; color: var(--muted); font-size: .76rem; }
.section-number { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; background: #eaf0ff; color: var(--blue-600); font-size: .72rem; font-weight: 900; direction: ltr; }
.section-title-row { justify-content: space-between; }
.section-title-copy { display: flex; align-items: center; gap: 11px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.field { display: grid; gap: 7px; color: #4f5b72; font-size: .79rem; font-weight: 750; }
.field-wide { grid-column: 1 / -1; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 43px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: .88rem;
  font-weight: 500;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea { min-height: 78px; resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #8aacee; box-shadow: 0 0 0 3px rgba(37,99,235,.08); outline: 0; }
.line-items-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.line-items-table { min-width: 830px; }
.line-items-table th { padding: 9px 8px; font-size: .69rem; }
.line-items-table td { padding: 8px; }
.line-items-table input, .line-items-table select { width: 100%; height: 39px; padding: 6px 8px; border: 1px solid transparent; border-radius: 8px; background: #f7f9fc; color: var(--ink); font-size: .78rem; }
.line-items-table input:hover, .line-items-table select:hover { border-color: var(--line); background: #fff; }
.line-items-table input:focus, .line-items-table select:focus { border-color: #8aacee; background: #fff; outline: 0; }
.line-items-table .desc-input { min-width: 240px; }
.line-items-table .number-input { width: 78px; direction: ltr; text-align: center; }
.item-index { width: 32px; text-align: center; }
.line-number { color: var(--muted); text-align: center; font-size: .75rem; }
.item-total { direction: ltr; unicode-bidi: isolate; font-weight: 800; font-size: .78rem; white-space: nowrap; }
.remove-item { width: 31px; height: 31px; border: 0; border-radius: 8px; background: transparent; color: #9aa3b4; font-size: 1.1rem; }
.remove-item:hover { color: var(--danger); background: #fff0f1; }

.editor-summary { position: sticky; top: 94px; }
.summary-card { padding: 20px; }
.summary-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.calc-badge { padding: 3px 8px; border-radius: 99px; color: #147765; background: #e7f6f1; font-size: .69rem; font-weight: 800; }
.totals-list { margin: 15px 0 0; }
.totals-list > div { min-height: 39px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .79rem; }
.totals-list dt, .totals-list dd { margin: 0; }
.totals-list dd { direction: ltr; unicode-bidi: isolate; color: var(--ink); font-weight: 800; text-align: end; }
.totals-list small { color: var(--muted); font-size: .67rem; }
.editable-total input { width: 78px; height: 32px; padding: 3px 7px; border: 1px solid var(--line); border-radius: 8px; text-align: end; direction: ltr; }
.grand-total { margin-top: 8px; padding-top: 12px; border-top: 1px dashed var(--line-strong); }
.grand-total dt { color: var(--ink); font-weight: 800; }
.grand-total dd { color: var(--blue-600); font-size: 1.15rem; }
.profit-box { margin-top: 16px; padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #d7e9e4; border-radius: 13px; background: linear-gradient(140deg, #f1faf7, #fff); }
.profit-box > div:first-child { display: flex; flex-direction: column; color: var(--muted); font-size: .72rem; }
.profit-box strong { color: var(--success); font-size: 1.06rem; direction: ltr; unicode-bidi: isolate; }
.profit-box small { font-size: .65rem; }
.margin-ring { --margin: 0; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--teal-500) calc(var(--margin) * 1%), #dcebe7 0); position: relative; }
.margin-ring::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: #fff; }
.margin-ring span { position: relative; z-index: 1; color: var(--success); font-size: .69rem; font-weight: 900; direction: ltr; }
.private-note { margin: 12px 0 0; color: var(--muted); font-size: .68rem; }
.private-note > span:first-child { color: var(--blue-600); }
.summary-actions { display: grid; gap: 8px; margin-top: 17px; }
.full-btn { width: 100%; }

.pricing-view { max-width: 1320px; }
.pricing-hero { min-height: 300px; padding: clamp(26px, 4vw, 50px); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 42px; position: relative; overflow: hidden; border-radius: 24px; color: #fff; background:
  linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
  linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px),
  radial-gradient(circle at 15% 5%, rgba(54,118,245,.6), transparent 23rem),
  var(--navy-950); background-size: 25px 25px, 25px 25px, auto, auto; box-shadow: 0 24px 55px rgba(8,17,44,.2); }
.pricing-hero::after { content: ""; position: absolute; width: 300px; height: 300px; inset-inline-end: -125px; bottom: -180px; border: 24px solid rgba(255,255,255,.055); border-radius: 50%; box-shadow: 0 0 0 38px rgba(255,255,255,.022), 0 0 0 76px rgba(255,255,255,.015); pointer-events: none; }
.pricing-hero-copy { position: relative; z-index: 1; max-width: 740px; }
.light-overline { color: #83aaff; }
.pricing-hero h1 { max-width: 720px; margin: 7px 0 12px; font-size: clamp(1.8rem, 3vw, 3.15rem); line-height: 1.25; letter-spacing: -.045em; }
.pricing-hero-copy > p:not(.overline) { max-width: 690px; margin: 0; color: #c5d0eb; font-size: clamp(.95rem, 1.25vw, 1.08rem); }
.trial-points { margin-top: 23px; display: flex; flex-wrap: wrap; gap: 10px 22px; color: #e7edfb; font-size: .82rem; font-weight: 700; }
.trial-points > span { display: inline-flex; align-items: center; gap: 7px; }
.trial-points i { width: 21px; height: 21px; display: inline-grid; place-items: center; border-radius: 50%; color: #73e2c4; background: rgba(72,211,174,.13); font-style: normal; }
.trial-seal { width: 146px; height: 146px; display: grid; place-content: center; position: relative; z-index: 1; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; background: rgba(255,255,255,.075); box-shadow: inset 0 0 0 8px rgba(255,255,255,.025), 0 15px 35px rgba(2,8,26,.28); text-align: center; }
.trial-seal strong { font-size: 3.4rem; line-height: .9; color: #fff; }
.trial-seal span { margin-top: 8px; color: #c9d5ee; font-size: .77rem; font-weight: 800; }

.founder-offer { margin-top: 18px; padding: 20px 22px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px; border: 1px solid #e7c67e; border-radius: 18px; background: linear-gradient(130deg, #fffaf0, #fff 52%, #f8fbff); box-shadow: 0 12px 32px rgba(60,48,17,.07); }
.founder-badge { min-width: 112px; min-height: 88px; padding: 12px; display: grid; place-content: center; gap: 5px; border: 1px solid #f1d59b; border-radius: 14px; color: #8a5c08; background: #fff4d9; text-align: center; font-size: .78rem; font-weight: 900; }
.founder-badge > span:first-child { color: var(--amber-500); font-size: 1.25rem; }
.founder-copy h2 { margin: 3px 0 4px; font-size: clamp(1.1rem, 1.7vw, 1.43rem); line-height: 1.4; }
.founder-copy > p:last-child { margin: 0; color: var(--muted); font-size: .84rem; }
.founder-action { display: flex; align-items: center; gap: 15px; }
.founder-price { min-width: 98px; display: grid; grid-template-columns: auto 1fr; align-items: end; column-gap: 5px; color: var(--muted); }
.founder-price > span { grid-column: 1 / -1; font-size: .66rem; font-weight: 800; }
.founder-price strong { color: var(--navy-900); font-size: 2.5rem; line-height: 1; }
.founder-price small { padding-bottom: 4px; font-size: .65rem; font-weight: 800; }
.founder-cta { width: auto; min-width: 178px; margin: 0; padding: 9px 14px; border-color: #9dd5c7; }

.pricing-intro { margin: 35px 0 18px; display: flex; align-items: end; justify-content: space-between; gap: 26px; }
.pricing-intro h2 { margin: 3px 0 0; font-size: clamp(1.35rem, 2vw, 1.75rem); }
.pricing-intro > p { max-width: 510px; margin: 0; color: var(--muted); font-size: .82rem; text-align: end; }
.pricing-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; gap: 16px; }
.plan-card { min-width: 0; padding: 24px; position: relative; border: 1px solid rgba(207,216,231,.95); border-radius: 19px; background: #fff; box-shadow: 0 12px 34px rgba(29,42,74,.055); }
.plan-card.featured-plan { border: 2px solid #6f98f4; box-shadow: 0 17px 44px rgba(37,99,235,.13); transform: translateY(-5px); }
.popular-ribbon { position: absolute; inset-inline-end: 18px; top: -12px; padding: 5px 11px; border-radius: 99px; color: #fff; background: linear-gradient(135deg, var(--blue-500), #2457c8); box-shadow: 0 6px 16px rgba(37,99,235,.24); font-size: .7rem; font-weight: 850; }
.plan-head { min-height: 66px; display: flex; align-items: flex-start; gap: 12px; }
.plan-head h3 { margin: 0; font-size: 1.18rem; }
.plan-head p { margin: 2px 0 0; color: var(--muted); font-size: .76rem; line-height: 1.5; }
.plan-icon { width: 43px; height: 43px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; font-size: .7rem; font-weight: 900; }
.starter-icon { color: #4b5c81; background: #edf1f8; }
.business-icon { color: #245dcb; background: #e9f0ff; }
.pro-icon { color: #8b610b; background: #fff2d3; }
.plan-price { margin-top: 18px; display: flex; align-items: center; gap: 9px; direction: ltr; }
.plan-price > strong { color: var(--navy-900); font-size: 3rem; line-height: 1; letter-spacing: -.055em; }
.plan-price > span { display: flex; flex-direction: column; align-items: flex-start; color: var(--muted); line-height: 1.3; }
.plan-price b { color: var(--ink); font-size: .78rem; }
.plan-price small { font-size: .67rem; }
.annual-price { min-height: 25px; margin: 7px 0 17px; color: var(--muted); font-size: .72rem; }
.annual-price strong { color: var(--success); }
.plan-cta { width: 100%; min-height: 45px; }
.feature-list { margin: 20px 0 0; padding: 17px 0 0; display: grid; gap: 11px; border-top: 1px solid var(--line); list-style: none; }
.feature-list li { display: flex; align-items: flex-start; gap: 9px; color: #445069; font-size: .78rem; }
.feature-list li > span:first-child { width: 19px; height: 19px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: var(--success); background: #e9f7f2; font-size: .68rem; font-weight: 900; }
.feature-list em { margin-inline-start: auto; padding: 2px 6px; border-radius: 99px; color: #8a5c08; background: #fff3d8; font-size: .58rem; font-style: normal; font-weight: 850; white-space: nowrap; }

.pricing-steps { margin-top: 22px; padding: 22px 24px; display: grid; grid-template-columns: minmax(220px, .72fr) minmax(0, 1.5fr); align-items: center; gap: 28px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.steps-heading h2 { margin: 3px 0 0; font-size: 1.15rem; }
.pricing-steps ol { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; list-style: none; }
.pricing-steps li { min-width: 0; display: flex; align-items: center; gap: 10px; }
.pricing-steps li > span { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--navy-900); font-size: .78rem; font-weight: 900; }
.pricing-steps li div { min-width: 0; display: flex; flex-direction: column; }
.pricing-steps li strong { font-size: .8rem; }
.pricing-steps li small { color: var(--muted); font-size: .68rem; line-height: 1.45; }
.pricing-footnote { margin: 13px 4px 0; color: var(--muted); font-size: .68rem; text-align: center; }

.preview-dialog { width: min(1050px, calc(100% - 28px)); max-height: calc(100vh - 28px); padding: 0; border: 0; border-radius: 18px; background: #eef2f7; box-shadow: 0 30px 90px rgba(8,17,44,.28); overflow: auto; }
.preview-dialog::backdrop { background: rgba(5,11,28,.66); backdrop-filter: blur(4px); }
.preview-toolbar { position: sticky; top: 0; z-index: 2; min-height: 70px; padding: 12px 18px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.95); backdrop-filter: blur(10px); }
.preview-toolbar > div:first-child { display: flex; flex-direction: column; }
.preview-toolbar span { color: var(--muted); font-size: .74rem; }
.preview-actions { display: flex; gap: 8px; align-items: center; }
.icon-btn { width: 39px; height: 39px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 1.35rem; }
.document-sheet { width: min(794px, calc(100% - 28px)); min-height: 1050px; margin: 24px auto; padding: 54px; background: #fff; box-shadow: var(--shadow); color: #1c2740; }
.doc-header { padding-bottom: 24px; display: flex; justify-content: space-between; gap: 30px; border-bottom: 3px solid var(--navy-900); }
.doc-brand { display: flex; align-items: center; gap: 12px; }
.doc-brand-mark { width: 46px; height: 46px; display: block; flex: 0 0 auto; border-radius: 13px; object-fit: cover; }
.doc-brand div { display: flex; flex-direction: column; }
.doc-brand small, .doc-meta small { color: #7b8496; font-size: .7rem; }
.doc-meta { display: flex; flex-direction: column; align-items: flex-end; text-align: end; }
.doc-meta strong { direction: ltr; unicode-bidi: isolate; }
.doc-title { margin: 32px 0 20px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.doc-title h1 { margin: 0; font-size: 1.65rem; }
.doc-title p { margin: 4px 0 0; color: #6d778b; font-size: .8rem; }
.doc-total-chip { padding: 10px 14px; border-radius: 12px; color: #fff; background: var(--navy-900); text-align: end; }
.doc-total-chip small { display: block; color: #bdc9e5; font-size: .65rem; }
.doc-total-chip strong { direction: ltr; unicode-bidi: isolate; }
.doc-customer { margin-bottom: 22px; padding: 15px 17px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; border: 1px solid #dfe5ef; border-radius: 11px; background: #f8f9fc; }
.doc-customer span { display: block; color: #788297; font-size: .68rem; }
.doc-customer strong { font-size: .86rem; }
.doc-table { font-size: .76rem; }
.doc-table th { padding: 10px; color: #fff; background: var(--navy-900); border: 0; }
.doc-table td { padding: 11px 10px; }
.doc-table .doc-num { direction: ltr; unicode-bidi: isolate; text-align: end; }
.doc-summary { width: min(330px, 100%); margin: 22px 0 0 auto; }
[dir="rtl"] .doc-summary { margin-left: 0; margin-right: auto; }
.doc-summary div { padding: 7px 0; display: flex; justify-content: space-between; gap: 20px; font-size: .78rem; }
.doc-summary strong { direction: ltr; unicode-bidi: isolate; }
.doc-summary .doc-grand { margin-top: 6px; padding-top: 12px; border-top: 2px solid var(--navy-900); color: var(--navy-900); font-size: .96rem; }
.doc-terms { margin-top: 35px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.doc-note-box { padding: 15px; border: 1px solid #e1e6ee; border-radius: 10px; }
.doc-note-box h3 { margin: 0 0 7px; font-size: .82rem; }
.doc-note-box p { margin: 0; color: #677187; font-size: .72rem; white-space: pre-line; }
.doc-footer { margin-top: 55px; padding-top: 12px; display: flex; justify-content: space-between; border-top: 1px solid #e2e6ed; color: #828b9c; font-size: .65rem; }

.toast { position: fixed; z-index: 80; inset-inline-end: 24px; bottom: 24px; min-width: 260px; max-width: calc(100% - 40px); padding: 13px 16px; border-radius: 11px; color: #fff; background: var(--navy-900); box-shadow: 0 15px 40px rgba(8,17,44,.24); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s ease, transform .2s ease; font-size: .85rem; }
.toast.show { opacity: 1; transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 1180px) {
  .metrics-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .editor-layout { grid-template-columns: 1fr; }
  .editor-summary { position: static; }
  .summary-card { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(260px, 1fr); gap: 0 24px; }
  .summary-heading { grid-column: 1 / -1; }
  .summary-actions { align-content: end; }
  .founder-offer { grid-template-columns: auto minmax(0, 1fr); }
  .founder-action { grid-column: 1 / -1; padding-inline-start: 130px; }
}

@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; inset: auto 0 0; width: 100%; height: auto; padding: 6px 8px max(6px, env(safe-area-inset-bottom)); border-top: 1px solid rgba(120,151,221,.2); background: rgba(8,17,44,.98); box-shadow: 0 -10px 28px rgba(8,17,44,.16); backdrop-filter: blur(14px); }
  .brand, .sidebar-note { display: none; }
  .side-nav { grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .nav-item { min-width: 0; min-height: 54px; padding: 5px 3px; flex-direction: column; justify-content: center; gap: 1px; border-radius: 10px; font-size: .64rem; line-height: 1.25; }
  .nav-item > span[data-i18n] { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-icon { width: auto; height: 21px; font-size: 1rem; }
  .nav-count, .nav-item.active::before { display: none; }
  .nav-create { margin-top: 0; }
  .topbar { height: 66px; padding: 0 18px; }
  .mobile-brand { display: flex; }
  .company-context { display: none; }
  .view { padding: 24px 18px calc(96px + env(safe-area-inset-bottom)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .focus-panel { min-height: 220px; }
  .quote-toolbar { align-items: stretch; flex-direction: column; }
  .search-field { width: 100%; }
  .top-editor-actions { display: none; }
  .editor-heading { align-items: flex-start; }
  .toast { bottom: 88px; }
  .pricing-hero { min-height: 270px; }
  .pricing-grid { max-width: 620px; margin-inline: auto; grid-template-columns: 1fr; }
  .plan-card.featured-plan { transform: none; }
  .pricing-steps { grid-template-columns: 1fr; }
}

@media (max-width: 650px) {
  body { font-size: 15px; }
  .topbar { height: 62px; padding: 0 15px; }
  .mobile-brand { gap: 8px; }
  .mobile-brand-logo { width: 126px; }
  .language-switch { border-radius: 9px; }
  .lang-btn { min-width: 33px; height: 29px; }
  .topbar-actions { gap: 8px; }
  .top-trial-btn { display: none; }
  .avatar { display: none; }
  .view { padding: 20px 15px calc(92px + env(safe-area-inset-bottom)); }
  .page-heading { margin-bottom: 18px; align-items: stretch; flex-direction: column; gap: 14px; }
  .page-heading h1, .editor-heading h1 { margin-top: 3px; font-size: 1.55rem; }
  .page-heading p:not(.overline) { font-size: .84rem; line-height: 1.6; }
  .page-heading .primary-btn { width: 100%; }
  .metrics-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-card { min-height: 132px; padding: 14px; border-radius: 15px; }
  .metric-featured { grid-column: 1 / -1; }
  .metric-value { margin-top: 10px; font-size: 1.48rem; }
  .metric-label, .metric-topline { font-size: .76rem; }
  .attention-card { grid-column: 1 / -1; min-height: 112px; }
  .dashboard-grid { margin-top: 12px; }
  .focus-panel { min-height: 0; }
  .panel-header { padding: 17px 15px 12px; }
  .recent-panel th:nth-child(2), .recent-panel td:nth-child(2), .recent-panel th:nth-child(5), .recent-panel td:nth-child(5) { display: none; }
  th, td { padding-inline: 12px; }
  .quotes-panel { min-height: 0; overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .quote-toolbar { margin-bottom: 12px; padding: 14px; border: 1px solid rgba(211,220,233,.95); border-radius: 16px; background: #fff; box-shadow: 0 8px 24px rgba(29,42,74,.045); }
  .search-field { min-width: 0; min-height: 46px; }
  .filter-pills { width: 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .filter-pills::-webkit-scrollbar { display: none; }
  .filter-pill { flex: 1 0 auto; min-height: 42px; }
  .roomy-table { display: none; }
  .mobile-quotes-list { display: grid; gap: 11px; }
  .mobile-quote-card { padding: 16px; border: 1px solid rgba(211,220,233,.95); border-radius: 16px; background: #fff; box-shadow: 0 8px 24px rgba(29,42,74,.045); }
  .mobile-quote-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
  .mobile-quote-card-head .quote-project { min-width: 0; }
  .mobile-quote-card-head .quote-project strong { font-size: .93rem; }
  .mobile-quote-card-head .quote-project small { margin-top: 2px; }
  .mobile-quote-meta { margin: 14px 0 0; padding: 12px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; border-block: 1px solid var(--line); }
  .mobile-quote-meta > div { min-width: 0; }
  .mobile-quote-meta dt, .mobile-quote-meta dd { margin: 0; }
  .mobile-quote-meta dt { margin-bottom: 2px; color: var(--muted); font-size: .66rem; }
  .mobile-quote-meta dd { color: var(--ink); font-size: .78rem; font-weight: 800; }
  .mobile-quote-meta .number-cell { direction: ltr; text-align: start; }
  .mobile-quote-action { width: 100%; min-height: 39px; margin-top: 12px; padding: 6px 10px; display: flex; align-items: center; justify-content: space-between; border: 0; border-radius: 9px; color: var(--blue-600); background: #edf3ff; font-size: .76rem; font-weight: 800; }
  .form-panel { padding: 17px 14px; }
  .editor-heading { width: 100%; margin-bottom: 16px; align-items: center; }
  .editor-heading > div:nth-child(2) { min-width: 0; }
  .editor-heading .overline { white-space: normal; }
  .back-btn { width: 40px; height: 40px; flex: 0 0 auto; }
  .editor-layout, .editor-main, .form-panel { width: 100%; min-width: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .section-title-row { align-items: flex-start; gap: 12px; }
  .section-title-row .outline-btn { min-width: 95px; }
  .line-items-wrap { overflow: visible; border: 0; }
  .line-items-table { display: block; min-width: 0; }
  .line-items-table thead { display: none; }
  .line-items-table tbody { display: grid; gap: 11px; }
  .line-items-table tr { padding: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; position: relative; border: 1px solid var(--line); border-radius: 13px; background: #fbfcff; }
  .line-items-table td { min-width: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; border: 0; }
  .line-items-table td::before { content: attr(data-label); color: var(--muted); font-size: .65rem; font-weight: 800; }
  .line-items-table td:nth-child(1) { grid-column: 1; grid-row: 1; display: block; text-align: start; }
  .line-items-table td:nth-child(1)::before { content: attr(data-label) " "; }
  .line-items-table td:nth-child(2) { grid-column: 1 / -1; }
  .line-items-table td:nth-child(7) { grid-column: 1 / -1; padding: 9px 10px; flex-direction: row; align-items: center; justify-content: space-between; border-radius: 9px; background: #eef4ff; }
  .line-items-table .item-total { direction: inherit; }
  .line-items-table td:nth-child(8) { position: absolute; inset-inline-end: 8px; top: 7px; display: block; }
  .line-items-table td:nth-child(8)::before { content: none; }
  .line-items-table input, .line-items-table select, .line-items-table .number-input { width: 100%; min-width: 0; height: 42px; border-color: var(--line); background: #fff; }
  .line-items-table .desc-input { min-width: 0; }
  .remove-item { color: var(--danger); background: #fff0f1; }
  .summary-card { display: block; }
  .summary-actions { margin-top: 16px; }
  .preview-toolbar { align-items: flex-start; }
  .preview-toolbar > div:first-child { display: none; }
  .preview-actions { width: 100%; justify-content: flex-end; flex-wrap: wrap; }
  .preview-actions .outline-btn, .preview-actions .primary-btn { flex: 1; }
  .document-sheet { width: calc(100% - 16px); min-height: 900px; margin: 8px auto; padding: 28px 20px; }
  .doc-header, .doc-title { align-items: flex-start; flex-direction: column; }
  .doc-meta { align-items: flex-start; text-align: start; }
  .doc-customer, .doc-terms { grid-template-columns: 1fr; }
  .doc-table { min-width: 560px; }
  .document-sheet { overflow-x: auto; }
  .pricing-hero { padding: 28px 22px; grid-template-columns: 1fr; gap: 24px; }
  .pricing-hero h1 { font-size: 1.65rem; }
  .trial-points { display: grid; }
  .trial-seal { width: 105px; height: 105px; position: absolute; inset-inline-end: 18px; top: 18px; opacity: .16; }
  .founder-offer { padding: 18px; grid-template-columns: 1fr; }
  .founder-badge { width: max-content; min-width: 0; min-height: 0; display: flex; align-items: center; gap: 7px; }
  .founder-action { grid-column: auto; padding-inline-start: 0; align-items: stretch; flex-direction: column; }
  .founder-price { grid-template-columns: auto auto; }
  .founder-cta { width: 100%; }
  .pricing-intro { align-items: flex-start; flex-direction: column; gap: 8px; }
  .pricing-intro > p { text-align: start; }
  .plan-card { padding: 21px 19px; }
  .pricing-steps { padding: 20px; }
  .pricing-steps ol { grid-template-columns: 1fr; }
}

@media (max-width: 410px) {
  .language-switch { margin-inline-start: auto; }
  .mobile-brand-logo { width: 116px; }
}

@media (max-width: 360px) {
  .metrics-grid { grid-template-columns: 1fr; }
  .metric-featured, .attention-card { grid-column: auto; }
}

@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff; }
  body > *:not(.preview-dialog) { display: none !important; }
  .preview-dialog { position: static; display: block; width: 100%; max-height: none; margin: 0; border-radius: 0; overflow: visible; box-shadow: none; background: #fff; }
  .preview-dialog::backdrop, .preview-toolbar { display: none; }
  .document-sheet { width: 100%; min-height: 0; margin: 0; padding: 15mm; box-shadow: none; overflow: visible; }
  .doc-table { min-width: 0; }
}
