:root {
  --ink: #17242d;
  --ink-2: #253640;
  --green: #145c4a;
  --green-2: #1f7a61;
  --green-soft: #e6f2ed;
  --orange: #c65c35;
  --orange-2: #e7895e;
  --orange-soft: #faece5;
  --sand: #f4efe8;
  --paper: #fbfaf7;
  --white: #fff;
  --muted: #667780;
  --line: #ddd6ce;
  --red: #a53b33;
  --red-soft: #fbe9e7;
  --yellow: #9a6c00;
  --yellow-soft: #fff4cf;
  --blue: #335e85;
  --shadow: 0 18px 48px rgba(23, 36, 45, .09);
  --radius: 22px;
  --font: Vazirmatn, Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); font-family: var(--font); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: linear-gradient(180deg, #f5f1eb 0, #fbfaf7 280px); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
[hidden] { display: none !important; }

.app-boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 16px; color: var(--muted); }
.boot-spinner { width: 46px; height: 46px; border: 4px solid var(--green-soft); border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(100%, 440px); background: rgba(255,255,255,.94); border: 1px solid rgba(255,255,255,.75); border-radius: 30px; padding: 30px; box-shadow: var(--shadow); }
.brand-lockup { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.brand-mark { width: 54px; height: 54px; border-radius: 17px; display: grid; place-items: center; background: linear-gradient(145deg, var(--green), var(--green-2)); color: #fff; font: 900 19px/1 Arial, sans-serif; letter-spacing: -.04em; box-shadow: 0 12px 24px rgba(20,92,74,.23); flex: 0 0 auto; }
.brand-lockup h1 { margin: 0; font-size: 20px; }
.brand-lockup p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.login-card .intro { margin: 0 0 22px; color: var(--muted); line-height: 1.9; }
.login-card .primary-btn { width: 100%; }

.app-shell { min-height: 100vh; }
.desktop-sidebar { display: none; }
.app-header { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(12px, env(safe-area-inset-top)) 16px 12px; background: rgba(251,250,247,.91); backdrop-filter: blur(18px); border-bottom: 1px solid rgba(221,214,206,.72); }
.header-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.header-brand .brand-mark { width: 42px; height: 42px; border-radius: 14px; font-size: 15px; }
.header-brand strong { display: block; max-width: 56vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.header-brand small { display: block; color: var(--muted); margin-top: 2px; font-size: 11px; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.connection-dot { width: 10px; height: 10px; border-radius: 50%; background: #26a66c; box-shadow: 0 0 0 5px rgba(38,166,108,.11); }
.connection-dot.offline { background: var(--red); box-shadow: 0 0 0 5px rgba(165,59,51,.1); }
.icon-btn { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 14px; background: var(--white); color: var(--ink); }

.app-main { padding: 18px 16px calc(94px + env(safe-area-inset-bottom)); max-width: 1120px; margin: 0 auto; }
.view-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin: 4px 0 20px; }
.view-head h2 { margin: 0; font-size: clamp(22px, 5vw, 34px); line-height: 1.35; letter-spacing: -.03em; }
.view-head p { margin: 7px 0 0; color: var(--muted); line-height: 1.8; font-size: 13px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.primary-btn, .secondary-btn, .danger-btn, .ghost-btn { border: 0; border-radius: 15px; min-height: 46px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 800; transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease; }
.primary-btn { background: linear-gradient(135deg, var(--orange), #b74a28); color: #fff; box-shadow: 0 10px 22px rgba(198,92,53,.19); }
.secondary-btn { background: var(--green); color: #fff; }
.ghost-btn { background: var(--white); color: var(--ink); border: 1px solid var(--line); }
.danger-btn { background: var(--red-soft); color: var(--red); }
.primary-btn:active, .secondary-btn:active, .ghost-btn:active, .danger-btn:active { transform: scale(.98); }
button:disabled { opacity: .55; cursor: not-allowed; }
.small-btn { min-height: 38px; padding: 0 13px; border-radius: 12px; font-size: 12px; }

.kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.kpi-card { min-height: 126px; padding: 18px; border-radius: var(--radius); color: #fff; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; position: relative; box-shadow: var(--shadow); }
.kpi-card::after { content: ""; position: absolute; width: 90px; height: 90px; border-radius: 50%; background: rgba(255,255,255,.07); left: -20px; bottom: -34px; }
.kpi-card.ink { background: var(--ink); }
.kpi-card.green { background: linear-gradient(145deg, var(--green), var(--green-2)); }
.kpi-card.orange { background: linear-gradient(145deg, var(--orange), #b64a28); }
.kpi-card.blue { background: linear-gradient(145deg, var(--blue), #284d70); }
.kpi-card.red { background: linear-gradient(145deg, #a33b32, #842a25); }
.kpi-card span { font-size: 11px; opacity: .88; line-height: 1.6; }
.kpi-card strong { font: 800 clamp(28px, 8vw, 42px)/1 var(--font); }

.quick-capture { margin: 14px 0 20px; padding: 18px; background: linear-gradient(135deg, var(--orange-soft), #fff); border: 1px solid #f2cfbe; border-radius: var(--radius); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.quick-capture strong { display: block; color: var(--orange); font-size: 16px; }
.quick-capture p { margin: 5px 0 0; color: var(--muted); line-height: 1.7; font-size: 12px; }
.capture-plus { width: 56px; height: 56px; border: 0; border-radius: 18px; background: var(--orange); color: #fff; font-size: 31px; line-height: 1; flex: 0 0 auto; box-shadow: 0 12px 26px rgba(198,92,53,.25); }

.focus-snapshot { margin: 0 0 20px; padding: 18px; border-radius: var(--radius); display: grid; gap: 16px; color: #fff; background: linear-gradient(135deg, var(--green), #123f36); box-shadow: var(--shadow); overflow: hidden; position: relative; }
.focus-snapshot::after { content: ""; position: absolute; width: 180px; height: 180px; left: -70px; bottom: -110px; border-radius: 50%; background: rgba(255,255,255,.06); }
.focus-snapshot-copy, .focus-snapshot-actions { position: relative; z-index: 1; }
.focus-kicker { display: block; margin-bottom: 7px; color: #ffd7c6; font-size: 10px; font-weight: 900; }
.focus-snapshot h3 { margin: 0; font-size: 18px; }
.focus-snapshot p { margin: 7px 0 0; color: rgba(255,255,255,.72); font-size: 11px; line-height: 1.9; }
.focus-snapshot-actions { display: grid; gap: 10px; align-content: center; }
.focus-chip-row { display: flex; gap: 7px; flex-wrap: wrap; }
.focus-chip { border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 8px 11px; background: rgba(255,255,255,.1); color: #fff; font-size: 10px; font-weight: 900; }
.focus-snapshot .secondary-btn { width: 100%; background: var(--orange); }

.dashboard-grid { display: grid; gap: 14px; }
.panel { background: rgba(255,255,255,.9); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: 0 10px 34px rgba(23,36,45,.04); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-head h3 { margin: 0; font-size: 16px; }
.panel-head small { color: var(--muted); }
.focus-policy { margin-bottom: 14px; padding: 18px; border: 1px solid #efc5b3; border-radius: var(--radius); background: linear-gradient(135deg, var(--orange-soft), #fff); }
.focus-policy span { display: block; color: var(--orange); font-size: 10px; font-weight: 900; }
.focus-policy strong { display: block; margin-top: 5px; font-size: 18px; }
.focus-policy p { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.9; }
.wave-stack { display: grid; gap: 14px; }
.focus-wave { background: rgba(255,255,255,.9); border: 1px solid var(--line); border-right: 6px solid var(--green); border-radius: var(--radius); padding: 17px; box-shadow: 0 10px 34px rgba(23,36,45,.04); }
.focus-wave.critical { border-right-color: var(--red); }
.focus-wave.high { border-right-color: var(--orange); }
.focus-wave.medium { border-right-color: var(--green); }
.wave-head { display: grid; grid-template-columns: 46px 1fr; gap: 12px; align-items: start; margin-bottom: 15px; }
.wave-number { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 15px; background: var(--ink); color: #fff; font-size: 19px; font-weight: 900; }
.focus-wave.critical .wave-number { background: var(--red); }
.focus-wave.high .wave-number { background: var(--orange); }
.focus-wave.medium .wave-number { background: var(--green); }
.wave-head small { color: var(--muted); font-size: 9px; font-weight: 900; }
.wave-head h2 { margin: 3px 0 5px; font-size: 17px; }
.wave-head p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.8; }
.priority-grid { display: grid; gap: 10px; }
.priority-card { padding: 14px; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); display: grid; gap: 11px; }
.priority-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.priority-category { color: var(--green); font-size: 9px; font-weight: 900; }
.priority-card h3 { margin: 4px 0 0; font-size: 14px; }
.priority-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.9; }
.coverage-pill { flex: 0 0 auto; border-radius: 999px; padding: 6px 9px; background: var(--yellow-soft); color: var(--yellow); font-size: 8px; font-weight: 900; }
.coverage-pill.empty { background: var(--red-soft); color: var(--red); }
.coverage-pill.covered { background: var(--green-soft); color: var(--green); }
.keyword-row { display: flex; flex-wrap: wrap; gap: 6px; }
.keyword-row span { border-radius: 999px; padding: 5px 8px; background: var(--white); border: 1px solid var(--line); color: var(--ink-2); font-size: 8px; font-weight: 800; }
.priority-card .ghost-btn { justify-self: start; }
.funnel-list { display: grid; gap: 12px; }
.funnel-row { display: grid; grid-template-columns: 112px 1fr 32px; align-items: center; gap: 10px; font-size: 12px; }
.funnel-track { height: 12px; border-radius: 999px; background: var(--sand); overflow: hidden; }
.funnel-fill { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: linear-gradient(90deg, var(--green), var(--orange)); }
.funnel-row b { text-align: center; }
.category-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.category-item { border: 1px solid var(--line); border-radius: 14px; padding: 11px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; background: var(--paper); }
.category-item.zero { background: var(--red-soft); border-color: #edc7c3; color: var(--red); }
.category-item b { font-size: 15px; }

.due-list, .lead-list, .queue-list { display: grid; gap: 10px; }
.lead-card { background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 15px; display: grid; gap: 12px; box-shadow: 0 8px 24px rgba(23,36,45,.035); }
.lead-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.lead-card h3 { margin: 0; font-size: 16px; }
.lead-card p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.lead-meta { display: flex; gap: 7px; flex-wrap: wrap; }
.lead-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid #eee8e1; padding-top: 11px; }
.lead-actions small { color: var(--muted); }

.chip { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 6px 10px; background: var(--sand); color: var(--ink-2); font-size: 10px; font-weight: 800; line-height: 1; }
.chip.green, .grade-a { background: var(--green-soft); color: var(--green); }
.chip.orange, .grade-b { background: var(--orange-soft); color: var(--orange); }
.chip.yellow, .grade-c { background: var(--yellow-soft); color: var(--yellow); }
.chip.red, .grade-rejected, .grade-d { background: var(--red-soft); color: var(--red); }
.chip.blue { background: #e7eff6; color: var(--blue); }

.filters { display: grid; gap: 10px; margin-bottom: 14px; }
.search-box { position: relative; }
.search-box input { padding-right: 46px; }
.search-box::before { content: "⌕"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 22px; z-index: 1; }
.filter-row { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip { flex: 0 0 auto; border: 1px solid var(--line); background: var(--white); color: var(--muted); border-radius: 999px; padding: 9px 13px; font-size: 11px; font-weight: 800; }
.filter-chip.active { border-color: var(--green); background: var(--green); color: #fff; }

.form-shell { display: grid; gap: 14px; }
.form-section { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: 0 8px 26px rgba(23,36,45,.035); }
.section-title { display: flex; align-items: center; gap: 10px; margin-bottom: 17px; }
.section-number { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; background: var(--green-soft); color: var(--green); font-weight: 900; }
.section-title h3 { margin: 0; font-size: 15px; }
.section-title small { display: block; color: var(--muted); margin-top: 3px; font-size: 10px; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 13px; }
.category-focus-tip { grid-column: 1/-1; padding: 14px; border: 1px solid #efc5b3; border-right: 5px solid var(--orange); border-radius: 16px; background: var(--orange-soft); }
.category-focus-tip.critical { border-color: #e5b7b1; border-right-color: var(--red); background: var(--red-soft); }
.category-focus-tip.high { border-right-color: var(--orange); background: var(--orange-soft); }
.category-focus-tip.medium { border-color: #bfdace; border-right-color: var(--green); background: var(--green-soft); }
.category-focus-tip.neutral { border-color: var(--line); border-right-color: var(--muted); background: var(--paper); }
.category-focus-tip > span { display: block; color: var(--orange); font-size: 9px; font-weight: 900; }
.category-focus-tip.critical > span { color: var(--red); }
.category-focus-tip.medium > span, .category-focus-tip.neutral > span { color: var(--green); }
.category-focus-tip strong { display: block; margin-top: 4px; font-size: 14px; }
.category-focus-tip p { margin: 6px 0 10px; color: var(--muted); font-size: 10px; line-height: 1.85; }
.focus-tools-card > p { margin: 0 0 13px; color: var(--muted); font-size: 11px; line-height: 1.9; }
label { display: grid; gap: 7px; font-size: 12px; font-weight: 800; color: var(--ink-2); }
label > span { display: flex; align-items: center; justify-content: space-between; }
label small { color: var(--muted); font-weight: 400; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); color: var(--ink); min-height: 48px; padding: 11px 13px; outline: none; transition: border .15s ease, box-shadow .15s ease, background .15s ease; }
textarea { min-height: 112px; resize: vertical; line-height: 1.85; }
input:focus, select:focus, textarea:focus { border-color: var(--green-2); box-shadow: 0 0 0 4px rgba(31,122,97,.09); background: var(--white); }
input[dir="ltr"] { text-align: left; }
.required::after { content: "*"; color: var(--orange); margin-right: 4px; }
.file-drop { position: relative; display: grid; place-items: center; min-height: 122px; border: 1.5px dashed #c8bdb2; border-radius: 18px; background: var(--paper); color: var(--muted); text-align: center; padding: 18px; }
.file-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-drop b { display: block; color: var(--green); margin-bottom: 5px; }
.file-preview { margin-top: 8px; font-size: 11px; color: var(--muted); }
.form-sticky { position: sticky; bottom: calc(74px + env(safe-area-inset-bottom)); z-index: 20; display: flex; gap: 9px; padding: 10px; background: rgba(251,250,247,.92); backdrop-filter: blur(14px); border: 1px solid rgba(221,214,206,.8); border-radius: 18px; box-shadow: var(--shadow); }
.form-sticky .primary-btn { flex: 1; }
details.more-fields { border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
details.more-fields summary { padding: 14px; font-weight: 800; cursor: pointer; }
details.more-fields .form-grid { padding: 0 14px 14px; }

.detail-hero { background: linear-gradient(145deg, var(--ink), #263944); color: #fff; border-radius: 26px; padding: 22px; margin-bottom: 14px; box-shadow: var(--shadow); }
.detail-hero .eyebrow { color: rgba(255,255,255,.65); font-size: 11px; }
.detail-hero h2 { margin: 7px 0 4px; font-size: 25px; }
.detail-hero p { margin: 0; color: rgba(255,255,255,.75); }
.detail-hero .lead-meta { margin-top: 15px; }
.detail-hero .chip { background: rgba(255,255,255,.1); color: #fff; }
.detail-grid { display: grid; gap: 14px; }
.info-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.info-item { background: var(--paper); border-radius: 14px; padding: 12px; min-height: 72px; }
.info-item small { color: var(--muted); display: block; margin-bottom: 5px; font-size: 10px; }
.info-item strong { font-size: 12px; line-height: 1.6; word-break: break-word; }
.info-item.wide { grid-column: 1/-1; }

.score-hero { display: grid; grid-template-columns: 104px 1fr; gap: 14px; align-items: center; background: var(--ink); color: #fff; border-radius: 20px; padding: 16px; margin-bottom: 15px; }
.score-circle { width: 94px; height: 94px; border-radius: 50%; display: grid; place-items: center; border: 8px solid rgba(255,255,255,.12); background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.12), transparent 55%); }
.score-circle strong { font-size: 30px; }
.score-hero h3 { margin: 0 0 8px; }
.score-hero p { margin: 0; color: rgba(255,255,255,.7); font-size: 11px; line-height: 1.8; }
.score-row { display: grid; grid-template-columns: 1fr 60px; gap: 10px; align-items: center; margin-bottom: 12px; }
.score-row label { gap: 5px; }
.score-row input[type="range"] { min-height: 30px; padding: 0; accent-color: var(--orange); border: 0; background: transparent; }
.score-value { height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--orange-soft); color: var(--orange); font-weight: 900; }
.gate-box { border-radius: 16px; padding: 14px; margin-top: 12px; background: var(--yellow-soft); color: var(--yellow); font-weight: 800; line-height: 1.8; font-size: 12px; }
.gate-box.ready { background: var(--green-soft); color: var(--green); }
.attachments { display: grid; gap: 8px; }
.attachment { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 13px; padding: 10px; background: var(--paper); font-size: 11px; }

.queue-card { background: var(--white); border: 1px solid var(--line); border-right: 5px solid var(--green); border-radius: 18px; padding: 16px; display: grid; gap: 12px; }
.queue-card h3 { margin: 0; }
.queue-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.queue-metric { background: var(--paper); border-radius: 12px; padding: 10px; }
.queue-metric small { color: var(--muted); display: block; font-size: 9px; }
.queue-metric strong { display: block; margin-top: 4px; font-size: 12px; }
.empty-state { text-align: center; padding: 44px 20px; background: var(--white); border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.empty-state .empty-icon { width: 70px; height: 70px; margin: 0 auto 15px; border-radius: 22px; display: grid; place-items: center; background: var(--sand); color: var(--green); font-size: 28px; }
.empty-state h3 { color: var(--ink); margin: 0 0 8px; }
.empty-state p { margin: 0; line-height: 1.8; font-size: 12px; }

.report-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.report-table th, .report-table td { padding: 10px; border-bottom: 1px solid var(--line); text-align: right; }
.report-table th { color: var(--muted); font-size: 9px; }
.report-table tr:last-child td { border-bottom: 0; }

.bottom-nav { position: fixed; z-index: 50; bottom: 0; left: 0; right: 0; height: calc(72px + env(safe-area-inset-bottom)); padding: 7px 10px env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(5,1fr); align-items: center; background: rgba(255,255,255,.95); backdrop-filter: blur(18px); border-top: 1px solid var(--line); box-shadow: 0 -12px 34px rgba(23,36,45,.07); }
.nav-btn { min-width: 0; height: 54px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; align-content: center; gap: 3px; border-radius: 15px; font-size: 9px; font-weight: 800; }
.nav-icon { font: 700 20px/1 Arial,sans-serif; }
.nav-btn.active { color: var(--green); background: var(--green-soft); }
.nav-btn.capture { width: 58px; height: 58px; justify-self: center; margin-top: -23px; border-radius: 19px; background: var(--orange); color: #fff; box-shadow: 0 10px 22px rgba(198,92,53,.28); font-size: 11px; }
.nav-btn.capture .nav-icon { font-size: 26px; }

.toast-stack { position: fixed; z-index: 100; top: calc(72px + env(safe-area-inset-top)); left: 14px; right: 14px; display: grid; gap: 8px; pointer-events: none; }
.toast { padding: 13px 15px; border-radius: 14px; background: var(--ink); color: #fff; box-shadow: var(--shadow); font-size: 12px; line-height: 1.7; transform-origin: top; animation: toastIn .2s ease both; }
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }
@keyframes toastIn { from { transform: translateY(-8px); opacity: 0; } }
.modal-backdrop { position: fixed; z-index: 80; inset: 0; background: rgba(10,20,26,.52); backdrop-filter: blur(5px); display: grid; align-items: end; }
.modal { background: var(--white); border-radius: 25px 25px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); max-height: 90vh; overflow-y: auto; }
.modal h3 { margin: 0 0 8px; }
.modal p { color: var(--muted); line-height: 1.8; font-size: 12px; }
.modal-actions { display: flex; gap: 9px; margin-top: 16px; }
.modal-actions > * { flex: 1; }

.install-body { background: linear-gradient(145deg, #e8f1ed, #f7eee9); min-height: 100vh; }
.install-shell { width: min(100% - 28px, 820px); margin: 0 auto; padding: 26px 0 50px; }
.install-hero { display: flex; align-items: center; gap: 15px; padding: 14px 4px 23px; }
.install-hero p, .install-hero h1, .install-hero span { margin: 0; }
.install-hero p { color: var(--green); font-weight: 900; font-size: 11px; letter-spacing: .08em; }
.install-hero h1 { margin: 3px 0; font-size: 25px; }
.install-hero span { color: var(--muted); font-size: 11px; }
.install-card { background: rgba(255,255,255,.92); border: 1px solid rgba(255,255,255,.8); border-radius: 25px; padding: 20px; box-shadow: var(--shadow); margin-bottom: 14px; }
.install-step { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.install-step > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: var(--green); color: #fff; font-weight: 900; }
.install-step strong { display: block; }
.install-step small { color: var(--muted); display: block; margin-top: 3px; font-weight: 400; }
.check-grid { display: grid; gap: 8px; }
.check-item { display: flex; align-items: center; gap: 9px; border-radius: 12px; padding: 10px; background: var(--paper); font-size: 11px; }
.check-item > span { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font-weight: 900; }
.check-item.ok > span { background: var(--green-soft); color: var(--green); }
.check-item.bad > span { background: var(--red-soft); color: var(--red); }
.install-errors { margin-bottom: 14px; border-radius: 18px; padding: 16px; background: var(--red-soft); color: var(--red); line-height: 1.8; font-size: 12px; }
.install-errors ul { margin-bottom: 0; }
.install-note { border-radius: 14px; padding: 13px; background: var(--yellow-soft); color: var(--yellow); line-height: 1.8; font-size: 11px; }

@media (min-width: 700px) {
  .app-main { padding: 24px 24px 104px; }
  .focus-snapshot { grid-template-columns: 1.25fr .75fr; align-items: center; }
  .kpi-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns: 1.1fr .9fr; }
  .dashboard-grid .wide { grid-column: 1/-1; }
  .form-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .form-grid .span-2 { grid-column: 1/-1; }
  .detail-grid { grid-template-columns: .95fr 1.05fr; align-items: start; }
  .filters { grid-template-columns: minmax(260px,1fr) 1.4fr; align-items: center; }
  .lead-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .queue-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .priority-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .category-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .modal-backdrop { align-items: center; justify-items: center; padding: 24px; }
  .modal { width: min(100%,480px); border-radius: 25px; }
  .install-card.form-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (min-width: 1060px) {
  .app-shell { padding-right: 246px; }
  .desktop-sidebar { position: fixed; right: 0; top: 0; bottom: 0; z-index: 45; width: 246px; display: flex; flex-direction: column; padding: 24px 16px; background: var(--ink); color: #fff; }
  .sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 0 6px 28px; }
  .sidebar-brand strong { display: block; font-size: 14px; }
  .sidebar-brand small { color: rgba(255,255,255,.52); font-size: 10px; }
  .sidebar-nav { display: grid; gap: 6px; }
  .sidebar-btn { min-height: 48px; border: 0; background: transparent; color: rgba(255,255,255,.65); border-radius: 14px; padding: 0 14px; text-align: right; display: flex; align-items: center; gap: 11px; font-size: 12px; font-weight: 800; }
  .sidebar-btn.active { background: rgba(255,255,255,.1); color: #fff; }
  .sidebar-btn.capture { margin-top: 9px; background: var(--orange); color: #fff; }
  .sidebar-foot { margin-top: auto; padding: 15px 8px 0; border-top: 1px solid rgba(255,255,255,.1); color: rgba(255,255,255,.55); font-size: 10px; line-height: 1.9; }
  .app-header { padding-right: 28px; }
  .header-brand .brand-mark { display: none; }
  .app-main { padding: 30px 34px 46px; }
  .bottom-nav { display: none; }
  .form-sticky { bottom: 16px; }
  .toast-stack { right: auto; width: 360px; }
}

@media print {
  body { background: #fff; }
  .desktop-sidebar, .app-header, .bottom-nav, .head-actions, .form-sticky, .no-print { display: none !important; }
  .app-shell { padding: 0; }
  .app-main { padding: 0; max-width: none; }
  .panel, .lead-card, .detail-hero { box-shadow: none; break-inside: avoid; }
  .detail-hero { color: #000; background: #fff; border: 2px solid #222; }
  .detail-hero p, .detail-hero .eyebrow { color: #444; }
  .detail-hero .chip { color: #222; border: 1px solid #aaa; background: #fff; }
}
