:root {
  --ink: #202720;
  --muted: #70766f;
  --soft-muted: #9ba097;
  --paper: #f7f4ed;
  --panel: #fffdfa;
  --line: #e8e3d9;
  --green: #1f6c4d;
  --green-dark: #184d39;
  --mint: #dcefe2;
  --mint-bright: #b9e0c5;
  --orange: #e8814f;
  --peach: #fae4d7;
  --lilac: #e8e2f5;
  --yellow: #f2d66d;
  --shadow: 0 18px 55px rgba(53, 59, 48, 0.08);
  --radius: 22px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; }
button { color: inherit; }

.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: 250px;
  display: flex;
  flex-direction: column;
  padding: 30px 20px 24px;
  background: #173e31;
  color: white;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 28px; }
.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #f4d96f;
  color: #173e31;
  box-shadow: 0 8px 20px rgba(0,0,0,.12);
}
.brand-mark svg { width: 25px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.brand div:last-child { display: flex; flex-direction: column; }
.brand strong { font: 800 20px/1.1 "Manrope", sans-serif; letter-spacing: -.5px; }
.brand span { margin-top: 4px; color: #aac0b6; font-size: 11px; }

.main-nav { display: flex; flex-direction: column; gap: 5px; }
.nav-item {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 13px;
  border: 0;
  border-radius: 12px;
  padding: 0 13px;
  background: transparent;
  color: #b9cbc3;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: .2s ease;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: white; }
.nav-item.active { background: #2e5a48; color: white; box-shadow: inset 0 0 0 1px rgba(255,255,255,.04); }
.nav-icon { width: 20px; height: 20px; display: grid; place-items: center; }
.nav-icon svg, [data-icon] svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-count, .nav-alert { margin-left: auto; font-size: 11px; }
.nav-count { color: #aac0b6; }
.nav-alert { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: #ef936a; color: #173e31; font-weight: 800; }
.sidebar-spacer { flex: 1; }

.pro-card {
  position: relative;
  overflow: hidden;
  margin: 16px 0;
  padding: 18px;
  border-radius: 16px;
  background: #214b3c;
}
.pro-card::after { content:""; position:absolute; width:90px; height:90px; right:-40px; bottom:-44px; border:16px solid rgba(245,218,112,.08); border-radius:50%; }
.pro-card .spark { color: var(--yellow); font-size: 20px; }
.pro-card strong { display: block; margin-top: 8px; font: 700 13px "Manrope"; }
.pro-card p { margin: 7px 0 12px; color: #afc2ba; font-size: 11px; line-height: 1.5; }
.text-button { border: 0; padding: 0; background: transparent; color: var(--green); font-weight: 700; font-size: 12px; cursor: pointer; }
.pro-card .text-button { position: relative; z-index: 1; color: #f3dc7b; }
.settings-link { margin-bottom: 10px; }
.profile-mini { display: flex; align-items: center; gap: 10px; padding: 14px 7px 0; border-top: 1px solid rgba(255,255,255,.1); }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: #efb78f; color: #5c3825; font-weight: 800; }
.profile-mini div:nth-child(2) { display: flex; flex: 1; flex-direction: column; }
.profile-mini strong { font-size: 12px; }
.profile-mini span { margin-top: 3px; color: #9fb5ab; font-size: 10px; }
.profile-mini button { border:0; background:transparent; color:#94aa9f; cursor:pointer; }

.mobile-topbar { display: none; }
.main-content { min-height: 100vh; margin-left: 250px; padding: 44px clamp(28px, 4vw, 70px) 70px; }
.view { display: none; max-width: 1240px; margin: 0 auto; animation: reveal .35s ease; }
.view.active { display: block; }
@keyframes reveal { from { opacity: 0; transform: translateY(5px); } to { opacity:1; transform:none; } }

.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-header h1 { margin: 4px 0 7px; font: 800 clamp(28px, 3vw, 38px)/1.15 "Manrope"; letter-spacing: -1.5px; }
.page-header p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 14px; }
.eyebrow, .section-kicker { color: #8a8e85; font-size: 10px; font-weight: 800; letter-spacing: 1.7px; }
.eyebrow { margin: 0; }
.wave { font-size: .8em; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.icon-button {
  position: relative;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  cursor: pointer;
}
.icon-button > span { width: 19px; height: 19px; }
.notification-button i, .mobile-topbar .icon-button i { position:absolute; width:7px; height:7px; top:8px; right:8px; border:2px solid var(--panel); border-radius:50%; background:#ec8255; }
.primary-button, .secondary-button, .dark-button, .whatsapp-button, .magic-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 12px;
  padding: 0 17px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.primary-button:hover, .dark-button:hover, .whatsapp-button:hover, .magic-button:hover { transform: translateY(-1px); box-shadow: 0 9px 20px rgba(27,73,54,.15); }
.primary-button { border: 1px solid var(--green); background: var(--green); color: white; }
.primary-button span, .secondary-button span, .dark-button span, .whatsapp-button span { width: 16px; height: 16px; }
.secondary-button { border: 1px solid var(--line); background: var(--panel); color: var(--ink); }
.dark-button { border: 0; background: #1f2923; color: white; }
.whatsapp-button { border: 0; background: #217a56; color: white; }

.focus-card {
  position: relative;
  overflow: hidden;
  min-height: 220px;
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  padding: 38px 42px;
  border-radius: 26px;
  background: linear-gradient(115deg, #cbe7d2, #ddefd9);
}
.focus-card::before { content:""; position:absolute; width:320px; height:320px; right:-80px; top:-130px; border:50px solid rgba(255,255,255,.22); border-radius:50%; }
.focus-copy { position: relative; z-index: 2; max-width: 610px; }
.section-kicker { display: inline-flex; align-items: center; gap: 7px; }
.section-kicker i { width: 6px; height: 6px; border-radius:50%; background: var(--orange); }
.focus-copy h2 { margin: 14px 0 8px; font: 600 clamp(24px, 3vw, 34px)/1.2 "Manrope"; letter-spacing:-1px; }
.focus-copy h2 strong { color: var(--green-dark); }
.focus-copy p { max-width: 540px; margin: 0 0 23px; color: #5d6e61; font-size: 13px; line-height: 1.55; }
.focus-art { position:absolute; width: 310px; height: 190px; right: 20px; bottom: 3px; }
.focus-art svg { width: 100%; height: 100%; fill:none; stroke:#2c7253; stroke-width:2.3; stroke-dasharray:5 6; }
.focus-art circle { fill:#f5db73; stroke:#275d46; stroke-dasharray:none; }
.coin { position:absolute; z-index:2; display:grid; place-items:center; border-radius:50%; background:#f3d66b; color:#2a5c45; font:800 16px "Manrope"; box-shadow:0 8px 20px rgba(40,84,61,.15); }
.coin-one { width:47px; height:47px; left:48px; top:80px; }
.coin-two { width:37px; height:37px; left:135px; top:57px; }
.coin-three { width:56px; height:56px; right:23px; top:8px; }

.stats-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-bottom: 20px; }
.business-stats-grid { grid-template-columns: repeat(4,1fr); }
.stat-card, .panel { border: 1px solid rgba(222,217,207,.8); background: var(--panel); box-shadow: 0 8px 30px rgba(58,62,52,.035); }
.stat-card { min-height: 160px; padding: 20px 22px; border-radius: 18px; }
.stat-top { display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.stat-icon { width:35px; height:35px; display:grid; place-items:center; padding:9px; border-radius:11px; color:#365848; }
.stat-icon.mint { background:var(--mint); }
.stat-icon.lilac { background:var(--lilac); color:#5d527a; }
.stat-icon.peach { background:var(--peach); color:#9a5b3d; }
.trend { padding:5px 8px; border-radius:20px; font-size:9px; font-weight:800; }
.trend.up { background:#e4f2e5; color:#28704e; }
.trend.neutral { background:#f0eee9; color:#777b74; }
.trend.warning { background:#fae8df; color:#a15e3e; }
.stat-label { display:block; margin-bottom:4px; color:var(--muted); font-size:11px; }
.stat-card strong { display:block; font:800 24px "Manrope"; letter-spacing:-.6px; }
.stat-card small { display:block; margin-top:5px; color:#a2a39d; font-size:9px; }

.content-grid { display:grid; grid-template-columns:minmax(0,1.5fr) minmax(300px,.8fr); gap:20px; }
.panel { border-radius: var(--radius); }
.tasks-panel, .activity-panel { padding: 24px; }
.panel-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:15px; margin-bottom:15px; }
.panel-heading h2 { margin:5px 0 0; font:800 18px "Manrope"; letter-spacing:-.4px; }
.task-list { display:flex; flex-direction:column; }
.task-item {
  display:grid;
  grid-template-columns:43px 1fr auto;
  align-items:center;
  gap:13px;
  padding:15px 0;
  border-top:1px solid #eee9df;
}
.task-icon { width:40px; height:40px; display:grid; place-items:center; padding:11px; border-radius:12px; }
.task-icon.overdue { background:var(--peach); color:#a95e3e; }
.task-icon.followup { background:var(--lilac); color:#63537f; }
.task-icon.delivery { background:var(--mint); color:#2f694d; }
.task-copy { min-width:0; }
.task-copy strong { display:block; font-size:12px; }
.task-copy span { display:block; overflow:hidden; margin-top:4px; color:var(--muted); font-size:10px; white-space:nowrap; text-overflow:ellipsis; }
.task-action { min-height:34px; border:1px solid var(--line); border-radius:9px; padding:0 11px; background:#fff; font-size:10px; font-weight:700; cursor:pointer; }
.task-action:hover { border-color:#b7c7bc; background:#f7faf7; }
.activity-list { display:flex; flex-direction:column; }
.activity-item { display:grid; grid-template-columns:34px 1fr; gap:11px; padding:12px 0; border-bottom:1px solid #eee9df; }
.activity-dot { width:32px; height:32px; display:grid; place-items:center; padding:9px; border-radius:50%; }
.activity-dot.success { background:var(--mint); color:#26704c; }
.activity-dot.payment { background:var(--peach); color:#a65c3b; }
.activity-dot.sent { background:var(--lilac); color:#64547f; }
.activity-item div { display:flex; flex-direction:column; }
.activity-item strong { font-size:10px; }
.activity-item span { margin-top:3px; color:var(--muted); font-size:9px; }
.activity-item small { margin-top:5px; color:#aaa9a2; font-size:8px; }
.mini-insight { display:flex; align-items:flex-start; gap:10px; margin-top:16px; padding:13px; border-radius:12px; background:#f4f1e9; }
.mini-insight > span { color:#d9a937; }
.mini-insight p { display:flex; flex-direction:column; gap:3px; margin:0; color:var(--muted); font-size:9px; line-height:1.4; }
.mini-insight strong { color:var(--ink); font-size:10px; }

.compact-header { align-items:end; margin-bottom:30px; }
.toolbar { display:flex; align-items:center; justify-content:space-between; gap:18px; margin-bottom:18px; }
.search-field { flex:1; max-width:390px; min-height:43px; display:flex; align-items:center; gap:9px; padding:0 13px; border:1px solid var(--line); border-radius:12px; background:var(--panel); }
.search-field span { width:17px; height:17px; color:#969a93; }
.search-field input { width:100%; border:0; outline:0; background:transparent; font-size:12px; }
.filter-pills { display:flex; gap:5px; padding:4px; border:1px solid var(--line); border-radius:12px; background:#eeeae2; }
.filter-pills button { min-height:32px; border:0; border-radius:8px; padding:0 11px; background:transparent; color:var(--muted); font-size:10px; font-weight:700; cursor:pointer; }
.filter-pills button.active { background:white; color:var(--ink); box-shadow:0 3px 10px rgba(0,0,0,.05); }
.quotes-table { overflow:hidden; }
.table-head, .quote-row { display:grid; grid-template-columns:1.15fr 1.4fr .8fr .7fr .8fr 30px; align-items:center; gap:15px; }
.table-head { min-height:43px; padding:0 20px; background:#f1eee7; color:#92958e; font-size:9px; font-weight:800; letter-spacing:.7px; text-transform:uppercase; }
.quote-row { min-height:72px; padding:0 20px; border-top:1px solid #eee9df; font-size:11px; }
.quote-row:first-child { border-top:0; }
.quote-client { display:flex; align-items:center; gap:10px; }
.client-initial { width:34px; height:34px; display:grid; place-items:center; border-radius:50%; background:#e1eee4; color:#2b684b; font-weight:800; }
.quote-client div { display:flex; flex-direction:column; gap:2px; }
.quote-client small, .quote-date, .quote-service small { color:#969a92; font-size:9px; }
.quote-service { display:flex; flex-direction:column; gap:3px; font-weight:600; }
.quote-amount { font-weight:800; }
.status { width:max-content; padding:6px 9px; border-radius:20px; font-size:9px; font-weight:800; }
.status.Pendiente { background:#fbebdf; color:#a25c3d; }
.status.Aprobada { background:#e6e1f3; color:#63537f; }
.status.Pagada { background:#dfeee3; color:#2f704f; }
.row-menu { width:30px; height:30px; border:0; border-radius:8px; background:transparent; color:#888c85; cursor:pointer; }
.row-menu:hover { background:#eeeae2; }
.empty-state { padding:50px 20px; text-align:center; color:var(--muted); }

.client-summary { display:flex; gap:1px; overflow:hidden; margin-bottom:20px; border:1px solid var(--line); border-radius:16px; background:var(--line); }
.client-summary div { flex:1; display:flex; flex-direction:column; align-items:center; padding:20px; background:var(--panel); }
.client-summary strong { font:800 21px "Manrope"; }
.client-summary span { margin-top:4px; color:var(--muted); font-size:10px; }
.client-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }
.client-card { padding:20px; border:1px solid var(--line); border-radius:18px; background:var(--panel); }
.client-card-top { display:flex; align-items:center; gap:11px; }
.client-card .client-initial { width:42px; height:42px; }
.client-card h3 { margin:0; font:700 13px "Manrope"; }
.client-card p { margin:3px 0 0; color:var(--muted); font-size:9px; }
.client-metrics { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:18px 0; }
.client-metrics div { display:flex; flex-direction:column; padding:11px; border-radius:11px; background:#f4f1ea; }
.client-metrics strong { font-size:12px; }
.client-metrics span { margin-top:3px; color:var(--muted); font-size:8px; }
.client-card button { width:100%; min-height:36px; border:1px solid var(--line); border-radius:9px; background:white; font-size:10px; font-weight:700; cursor:pointer; }
.client-card-actions { display:grid; grid-template-columns:1.2fr 1fr; gap:7px; }
.client-card-actions button:first-child { border-color:var(--green); background:var(--green); color:white; }

.catalog-summary { display:flex; align-items:center; justify-content:space-between; gap:30px; margin-bottom:20px; padding:22px 26px; }
.catalog-summary div { display:flex; align-items:baseline; gap:10px; }
.catalog-summary span { color:var(--muted); font-size:10px; }
.catalog-summary strong { font:800 24px "Manrope"; color:var(--green); }
.catalog-summary p { max-width:500px; margin:0; color:var(--muted); font-size:10px; line-height:1.5; }
.catalog-insights { display:grid; grid-template-columns:repeat(3,1fr); gap:1px; overflow:hidden; margin-bottom:20px; padding:0; background:var(--line); }
.catalog-insights > div { min-height:88px; display:flex; flex-direction:column; justify-content:center; padding:18px; background:white; }
.catalog-insights span { color:var(--muted); font-size:9px; font-weight:800; letter-spacing:.5px; text-transform:uppercase; }
.catalog-insights strong { margin:5px 0 3px; font:800 20px "Manrope"; color:var(--green); }
.catalog-insights small { color:var(--soft-muted); font-size:8px; }
.catalog-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }
.product-card { overflow:hidden; border:1px solid var(--line); border-radius:19px; background:var(--panel); }
.product-art { height:112px; display:grid; place-items:center; overflow:hidden; background:linear-gradient(135deg,#dcefe2,#f1e3b0); }
.product-art img { width:100%; height:100%; object-fit:cover; }
.product-art span { width:48px; height:48px; display:grid; place-items:center; border:2px solid rgba(31,108,77,.35); border-radius:15px; color:var(--green); font:800 22px "Manrope"; transform:rotate(-4deg); }
.product-content { padding:18px; }
.product-deposit { display:inline-block; padding:5px 8px; border-radius:20px; background:#f4eee0; color:#8c713e; font-size:8px; font-weight:800; }
.product-content h3 { margin:12px 0 5px; font:800 14px "Manrope"; }
.product-content p { min-height:42px; margin:0 0 14px; color:var(--muted); font-size:9px; line-height:1.5; }
.product-content > div:not(.product-actions) { display:flex; align-items:baseline; gap:6px; }
.product-content > div strong { font:800 17px "Manrope"; }
.product-content > div span { color:var(--muted); font-size:8px; }
.product-meta { display:grid !important; grid-template-columns:1fr 1fr; gap:8px !important; margin-top:12px; }
.product-meta div { display:flex; flex-direction:column; padding:9px; border-radius:10px; background:#f6f1e8; }
.product-meta strong { font-size:13px !important; }
.product-meta span { margin-top:2px; }
.product-gallery { display:flex; gap:5px; margin-top:11px; }
.product-gallery img { width:34px; height:34px; border-radius:8px; object-fit:cover; border:1px solid var(--line); }
.product-actions { display:grid; grid-template-columns:1fr 38px; gap:7px; margin-top:15px; }
.product-actions button { min-height:36px; border:1px solid var(--line); border-radius:9px; background:white; font-size:10px; font-weight:700; cursor:pointer; }
.product-actions button:first-child { border-color:var(--green); background:var(--green); color:white; }
.product-actions button span { display:block; width:15px; height:15px; margin:auto; }

.payments-hero { display:flex; align-items:center; justify-content:space-between; margin-bottom:20px; padding:30px 34px; border-radius:22px; background:#1d4a39; color:white; }
.payments-hero > div:first-child { display:flex; flex-direction:column; }
.payments-hero span { color:#adc4b9; font-size:11px; }
.payments-hero strong { margin:5px 0; font:800 34px "Manrope"; color:#f2d873; }
.payments-hero small { color:#adc4b9; font-size:9px; }
.progress-ring { --collection:0deg; position:relative; width:92px; height:92px; display:flex; flex-direction:column; align-items:center; justify-content:center; border-radius:50%; background:conic-gradient(#f1d66f var(--collection),rgba(255,255,255,.15) 0); }
.progress-ring::after { content:""; position:absolute; inset:8px; border-radius:50%; background:#1d4a39; }
.progress-ring span, .progress-ring small { position:relative; z-index:1; }
.progress-ring span { color:white; font:800 19px "Manrope"; }
.aging-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-bottom:20px; }
.aging-card { padding:15px 17px; border:1px solid var(--line); border-radius:14px; background:var(--panel); }
.aging-card::before { content:""; display:block; width:28px; height:4px; margin-bottom:12px; border-radius:4px; background:var(--aging-color); }
.aging-card span { display:block; color:var(--muted); font-size:9px; }
.aging-card strong { display:block; margin:4px 0 2px; font:800 17px "Manrope"; }
.aging-card small { color:var(--soft-muted); font-size:8px; }
.aging-card.current { --aging-color:#6ba67d; }
.aging-card.watch { --aging-color:#e0bf55; }
.aging-card.late { --aging-color:#e28b55; }
.aging-card.critical { --aging-color:#c85f4d; }
.payment-list { overflow:hidden; }
.payment-item { display:grid; grid-template-columns:1fr auto auto; align-items:center; gap:20px; min-height:92px; padding:0 22px; border-top:1px solid var(--line); }
.payment-item:first-child { border-top:0; }
.payment-person { display:flex; align-items:center; gap:12px; }
.payment-person div { display:flex; flex-direction:column; }
.payment-person strong { font-size:12px; }
.payment-person span { margin-top:4px; color:var(--muted); font-size:9px; }
.payment-money { display:flex; flex-direction:column; align-items:flex-end; }
.payment-money strong { font:800 15px "Manrope"; }
.payment-money span { margin-top:3px; color:#a65d3e; font-size:8px; }
.payment-row-actions { display:flex; gap:7px; }
.task-action.subtle { border-color:transparent; background:#f2efe8; color:var(--muted); }

.settings-form { overflow:hidden; }
.form-section { display:grid; grid-template-columns:250px 1fr; gap:45px; padding:32px; border-bottom:1px solid var(--line); }
.form-section h2 { margin:0 0 6px; font:800 16px "Manrope"; }
.form-section > div:first-child p { margin:0; color:var(--muted); font-size:10px; line-height:1.5; }
.form-fields { display:grid; grid-template-columns:1fr 1fr; gap:17px; }
.form-fields label { display:flex; flex-direction:column; gap:7px; color:#60655f; font-size:10px; font-weight:700; }
.form-fields label.full { grid-column:1/-1; }
.photo-preview { display:flex; flex-wrap:wrap; gap:8px; min-height:0; }
.photo-preview img { width:58px; height:58px; border-radius:10px; object-fit:cover; border:1px solid var(--line); }
.photo-preview span { display:inline-flex; min-height:34px; align-items:center; padding:0 10px; border-radius:10px; background:#f4efe6; color:var(--muted); font-size:9px; }
input, textarea, select { width:100%; border:1px solid #ded9cf; border-radius:10px; outline:0; background:#fff; color:var(--ink); }
input, select { min-height:42px; padding:0 12px; }
textarea { min-height:86px; resize:vertical; padding:12px; line-height:1.5; }
input:focus, textarea:focus, select:focus { border-color:#68947e; box-shadow:0 0 0 3px rgba(65,120,91,.1); }
.form-footer { display:flex; align-items:center; justify-content:flex-end; gap:15px; padding:20px 32px; }
.form-footer span { color:var(--green); font-size:10px; }

.modal-backdrop { position:fixed; inset:0; z-index:100; display:flex; align-items:center; justify-content:center; padding:20px; background:rgba(18,28,22,.57); backdrop-filter:blur(4px); opacity:0; pointer-events:none; transition:.25s ease; }
.modal-backdrop.open { opacity:1; pointer-events:auto; }
.modal { position:relative; width:min(680px,100%); max-height:92vh; overflow:auto; border-radius:24px; background:var(--panel); box-shadow:0 30px 100px rgba(15,31,22,.3); transform:translateY(15px) scale(.98); transition:.25s ease; }
.modal-backdrop.open .modal { transform:none; }
.modal-header { display:flex; align-items:flex-start; justify-content:space-between; padding:25px 28px 18px; }
.modal-header h2 { margin:5px 0 0; font:800 22px "Manrope"; }
.quote-mode-tabs { display:flex; margin:0 28px 20px; padding:4px; border-radius:12px; background:#efebe3; }
.quote-mode-tabs button { flex:1; min-height:38px; display:flex; align-items:center; justify-content:center; gap:7px; border:0; border-radius:9px; background:transparent; color:var(--muted); font-size:10px; font-weight:700; cursor:pointer; }
.quote-mode-tabs button span { width:15px; height:15px; }
.quote-mode-tabs button.active { background:white; color:var(--green); box-shadow:0 4px 13px rgba(0,0,0,.06); }
.ai-entry, .quote-fields { padding:0 28px 28px; }
.ai-entry > label { display:block; margin-bottom:8px; font-size:11px; font-weight:700; }
.ai-entry textarea { min-height:140px; }
.ai-hint { display:flex; align-items:flex-start; gap:8px; margin:10px 0 15px; color:#7c827a; }
.ai-hint span { color:#d1a629; }
.ai-hint p { margin:0; font-size:9px; line-height:1.45; }
.magic-button { width:100%; border:1px solid #cbdccc; background:#e5f1e6; color:#245a43; }
.quote-fields { display:none; }
.quote-fields.visible { display:block; animation:reveal .3s ease; }
.quote-fields .form-fields { margin-bottom:17px; }
.quote-summary { display:flex; flex-direction:column; align-items:center; margin-bottom:15px; padding:14px; border-radius:12px; background:#f2efe8; }
.quote-summary span, .quote-summary small { color:var(--muted); font-size:9px; }
.quote-summary strong { margin:2px 0; font:800 22px "Manrope"; color:var(--green); }
.wide { width:100%; }

.preview-modal { width:min(520px,100%); overflow:visible; background:#f6f2e9; }
.close-preview { position:absolute; z-index:2; top:14px; right:14px; background:white; }
.quote-document { padding:45px 40px 30px; }
.quote-doc-brand { display:flex; align-items:center; gap:9px; color:var(--green); }
.quote-doc-brand .brand-mark { width:34px; height:34px; }
.quote-doc-brand strong { font:800 16px "Manrope"; }
.quote-document .doc-label { display:block; margin-top:32px; color:#9b9c96; font-size:9px; font-weight:800; letter-spacing:1.5px; }
.quote-document h2 { margin:7px 0 5px; font:800 27px "Manrope"; letter-spacing:-1px; }
.quote-document .doc-to { color:var(--muted); font-size:11px; }
.doc-service { margin:26px 0; padding:18px; border:1px solid var(--line); border-radius:14px; background:white; }
.doc-service div { display:flex; justify-content:space-between; gap:20px; }
.doc-service strong { font-size:12px; }
.doc-service b { font:800 15px "Manrope"; }
.doc-service p { margin:7px 0 0; color:var(--muted); font-size:9px; line-height:1.5; }
.doc-totals { display:flex; justify-content:space-between; gap:20px; padding:0 5px; }
.doc-totals div { display:flex; flex-direction:column; }
.doc-totals span { color:var(--muted); font-size:9px; }
.doc-totals strong { margin-top:3px; font:800 18px "Manrope"; }
.doc-totals div:last-child { align-items:flex-end; }
.doc-totals div:last-child strong { color:var(--green); }
.doc-date { margin:20px 0; padding:12px; border-radius:10px; background:#e7f0e5; color:#3f6550; font-size:10px; text-align:center; }
.paid-progress { display:flex; align-items:center; justify-content:space-between; margin-top:18px; padding:10px 12px; border-radius:10px; background:#f2efe8; color:var(--muted); font-size:9px; }
.paid-progress strong { color:var(--green); font-size:11px; }
.doc-toolbar { display:flex; gap:7px; margin:-8px 0 12px; }
.doc-toolbar button { flex:1; min-height:34px; display:flex; align-items:center; justify-content:center; gap:6px; border:1px solid var(--line); border-radius:9px; background:white; color:var(--muted); font-size:9px; font-weight:700; cursor:pointer; }
.doc-toolbar button span { width:13px; height:13px; }
.doc-actions { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.doc-actions button { min-height:44px; border-radius:11px; font-size:11px; font-weight:800; cursor:pointer; }
.approve-quote { border:0; background:var(--green); color:white; }
.share-quote { border:1px solid var(--line); background:white; }
.powered-by { margin:23px 0 0; color:#9b9c95; font-size:8px; text-align:center; }
.powered-by strong { color:var(--green); }

.reminder-modal { width:min(500px,100%); padding-bottom:24px; }
.message-preview { position:relative; margin:5px 28px 20px 70px; padding:16px 18px 23px; border-radius:4px 15px 15px 15px; background:#dff0da; box-shadow:0 4px 14px rgba(0,0,0,.05); }
.message-preview::before { content:""; position:absolute; left:-9px; top:0; border-top:10px solid #dff0da; border-left:10px solid transparent; }
.whatsapp-avatar { position:absolute; width:35px; height:35px; left:-48px; top:0; display:grid; place-items:center; border-radius:50%; background:#efb88f; color:#70452d; font-size:9px; font-weight:800; }
.message-preview p { margin:0; font-size:11px; line-height:1.55; white-space:pre-line; }
.message-preview > span { position:absolute; right:9px; bottom:6px; color:#6a876e; font-size:8px; }
.reminder-actions { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:0 28px; }
.safe-note { display:block; margin:14px 28px 0; color:#969a92; font-size:8px; text-align:center; }
.small-modal { width:min(520px,100%); }
.modal-form { padding:0 28px 28px; }
.payment-balance-preview { display:flex; flex-direction:column; align-items:center; margin:18px 0; padding:14px; border-radius:12px; background:#e8f1e7; }
.payment-balance-preview span, .payment-balance-preview small { color:var(--muted); font-size:9px; }
.payment-balance-preview strong { margin:3px 0; font:800 21px "Manrope"; color:var(--green); }
.account-modal { width:min(760px,100%); }
.account-summary { display:grid; grid-template-columns:1.35fr repeat(3,1fr); gap:1px; margin:0 28px 20px; overflow:hidden; border:1px solid var(--line); border-radius:14px; background:var(--line); }
.account-summary > div { display:flex; flex-direction:column; justify-content:center; min-height:78px; padding:15px; background:white; }
.account-summary > div:first-child { background:#e6f0e5; }
.account-summary span { color:var(--muted); font-size:8px; }
.account-summary strong { margin-top:4px; font:800 17px "Manrope"; }
.account-summary > div:first-child strong { color:var(--green); font-size:21px; }
.account-actions { display:flex; gap:9px; margin:0 28px 20px; }
.account-actions button { flex:1; }
.account-table { margin:0 28px 25px; overflow:hidden; border:1px solid var(--line); border-radius:14px; }
.account-head, .account-row { display:grid; grid-template-columns:.7fr 1.25fr .8fr .8fr .75fr .8fr; align-items:center; gap:10px; padding:0 14px; }
.account-head { min-height:36px; background:#f0ede6; color:#92958e; font-size:8px; font-weight:800; letter-spacing:.5px; text-transform:uppercase; }
.account-row { min-height:60px; border-top:1px solid var(--line); font-size:9px; }
.account-row strong { font-size:10px; }
.account-row .task-action { min-height:30px; padding:0 8px; font-size:8px; }
.age-pill { width:max-content; padding:5px 7px; border-radius:12px; font-size:8px; font-weight:800; }
.age-pill.current { background:#e1eee3; color:#2d704c; }
.age-pill.watch { background:#f7efcf; color:#90731d; }
.age-pill.late { background:#fae4d7; color:#a55e3e; }
.age-pill.critical { background:#f3d9d5; color:#a44237; }
.account-history { margin:0 28px 28px; padding-top:4px; }
.account-history h3 { margin:0 0 10px; font:800 13px "Manrope"; }
.history-item { display:flex; align-items:center; justify-content:space-between; gap:15px; padding:10px 0; border-top:1px solid var(--line); }
.history-item div { display:flex; flex-direction:column; }
.history-item strong { font-size:10px; }
.history-item span, .history-item small { color:var(--muted); font-size:8px; }
.history-item b { color:var(--green); font:800 11px "Manrope"; }
.fifo-explanation { display:flex; gap:10px; margin-bottom:18px; padding:13px; border-radius:12px; background:#e7f0e5; color:#486455; }
.fifo-explanation span { font-size:20px; }
.fifo-explanation p { margin:0; font-size:9px; line-height:1.5; }
.fifo-preview { margin:18px 0; padding:14px; border:1px solid var(--line); border-radius:12px; background:#f7f4ed; }
.fifo-preview:empty { display:none; }
.fifo-preview > span { display:block; margin-bottom:8px; color:var(--muted); font-size:8px; font-weight:800; letter-spacing:.7px; }
.allocation-line { display:flex; justify-content:space-between; gap:15px; padding:7px 0; border-top:1px solid var(--line); font-size:9px; }
.allocation-line:first-of-type { border-top:0; }
.allocation-line strong { color:var(--green); }

.toast { position:fixed; z-index:200; left:50%; bottom:28px; display:flex; align-items:center; gap:10px; min-width:260px; padding:13px 17px; border-radius:12px; background:#1e2c25; color:white; box-shadow:0 15px 45px rgba(0,0,0,.2); opacity:0; pointer-events:none; transform:translate(-50%,15px); transition:.25s ease; }
.toast.show { opacity:1; transform:translate(-50%,0); }
.toast span { width:18px; height:18px; color:#b8e2c4; }
.toast p { margin:0; font-size:11px; }
.sidebar-overlay { display:none; }

@media (max-width: 1050px) {
  .focus-art { opacity:.55; right:-20px; }
  .focus-copy { max-width:65%; }
  .business-stats-grid { grid-template-columns:repeat(2,1fr); }
  .content-grid { grid-template-columns:1fr; }
  .client-grid { grid-template-columns:repeat(2,1fr); }
  .catalog-grid { grid-template-columns:repeat(2,1fr); }
  .aging-grid { grid-template-columns:repeat(2,1fr); }
}

@media (max-width: 780px) {
  body { padding-top:64px; }
  .sidebar { width:270px; transform:translateX(-105%); transition:.25s ease; }
  .sidebar.open { transform:none; }
  .sidebar-overlay { position:fixed; inset:0; z-index:19; background:rgba(19,28,23,.45); }
  .sidebar-overlay.show { display:block; }
  .mobile-topbar { position:fixed; inset:0 0 auto 0; z-index:15; height:64px; display:flex; align-items:center; justify-content:space-between; padding:0 16px; border-bottom:1px solid var(--line); background:rgba(247,244,237,.92); backdrop-filter:blur(12px); }
  .mobile-topbar .brand { padding:0; }
  .mobile-topbar .brand-mark { width:32px; height:32px; border-radius:10px; }
  .mobile-topbar .brand strong { color:var(--ink); font-size:17px; }
  .mobile-topbar .icon-button { width:38px; height:38px; background:transparent; }
  .main-content { margin-left:0; padding:25px 16px 60px; }
  .notification-button { display:none; }
  .page-header { align-items:flex-end; }
  .page-header h1 { font-size:26px; }
  .page-header p:not(.eyebrow) { font-size:12px; }
  .primary-button { padding:0 13px; }
  .focus-card { min-height:240px; padding:28px 24px; }
  .focus-copy { max-width:100%; }
  .focus-copy h2 { font-size:26px; }
  .focus-art { width:220px; height:140px; right:-50px; bottom:-18px; opacity:.25; }
  .stats-grid { grid-template-columns:1fr; }
  .business-stats-grid { grid-template-columns:1fr; }
  .stat-card { min-height:auto; }
  .toolbar { align-items:stretch; flex-direction:column; }
  .search-field { max-width:none; }
  .filter-pills { overflow:auto; }
  .quotes-table { overflow-x:auto; }
  .table-head, .quote-row { min-width:760px; }
  .client-grid { grid-template-columns:1fr; }
  .catalog-grid { grid-template-columns:1fr; }
  .catalog-summary { align-items:flex-start; flex-direction:column; gap:10px; }
  .catalog-insights { grid-template-columns:1fr; }
  .form-section { grid-template-columns:1fr; gap:20px; padding:24px; }
}

@media (max-width: 520px) {
  .page-header { align-items:flex-start; }
  .page-header .primary-button { width:44px; overflow:hidden; padding:0; font-size:0; }
  .page-header .primary-button span { width:18px; height:18px; }
  .focus-card { min-height:270px; }
  .focus-copy p { max-width:90%; }
  .content-grid { gap:14px; }
  .tasks-panel, .activity-panel { padding:18px; }
  .task-item { grid-template-columns:40px 1fr; }
  .task-action { grid-column:2; width:max-content; }
  .client-summary { display:grid; grid-template-columns:1fr 1fr; }
  .client-summary div:last-child { grid-column:1/-1; }
  .payments-hero { padding:24px; }
  .payment-item { grid-template-columns:1fr auto; padding:15px 18px; }
  .payment-row-actions { grid-column:1/-1; }
  .payment-row-actions .task-action { flex:1; width:100%; }
  .form-fields { grid-template-columns:1fr; }
  .form-fields label.full { grid-column:auto; }
  .modal-backdrop { align-items:flex-end; padding:0; }
  .modal { width:100%; max-height:94vh; border-radius:24px 24px 0 0; }
  .modal-header { padding:22px 20px 16px; }
  .quote-mode-tabs { margin:0 20px 18px; }
  .ai-entry, .quote-fields { padding:0 20px 24px; }
  .quote-document { padding:42px 22px 25px; }
  .reminder-actions { grid-template-columns:1fr; }
  .account-summary { grid-template-columns:1fr 1fr; margin:0 18px 16px; }
  .account-actions { flex-direction:column; margin:0 18px 16px; }
  .account-table { margin:0 18px 20px; overflow-x:auto; }
  .account-head, .account-row { min-width:650px; }
  .account-history { margin:0 18px 22px; }
}

@media print {
  body * { visibility:hidden !important; }
  #previewModal, #previewModal *, #quotePreview, #quotePreview * { visibility:visible !important; }
  #previewModal { position:absolute; inset:0; display:block; padding:0; background:white; opacity:1; }
  .preview-modal { width:100%; max-height:none; overflow:visible; box-shadow:none; transform:none; }
  .close-preview, .doc-toolbar, .doc-actions { display:none !important; }
  .quote-document { max-width:700px; margin:auto; }
}
