/* Typography falls back to the operating system when local fonts are unavailable. */

:root {
  --bg: #f4f7f8;
  --surface: #fbfcfc;
  --surface-2: #eef3f3;
  --text: #172526;
  --muted: #617071;
  --line: #dce5e5;
  --accent: #087f78;
  --accent-dark: #07665f;
  --accent-soft: #def3f0;
  --navy: #102b2e;
  --danger: #c4414b;
  --warning: #a46617;
  --success: #237a50;
  --radius: 14px;
  --shadow: 0 14px 40px rgba(23, 53, 55, .08);
  --sidebar: 250px;
}

/* Operational workspace: touch-first controls and the same information on every screen. */
[hidden] { display: none !important; }
html { scrollbar-color: #8ca7a4 #eef3f3; }
::selection { color: #fff; background: #087f78; }
:focus-visible { outline: 3px solid #087f78; outline-offset: 3px; }
input,textarea { caret-color: #087f78; }
body { font-family: 'DM Sans', system-ui, -apple-system, sans-serif; }
h1,h2,h3,.brand { font-family: 'Manrope', system-ui, -apple-system, sans-serif; }
.app-page .app-content { max-width: 1240px; }
.app-page .metrics-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
.overview-intro { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; gap: 16px; }
.overview-intro h2 { margin: 0 0 6px; font-size: 30px; letter-spacing: -.03em; }
.overview-intro p { color: var(--muted); margin-bottom: 0; }
.overview-intro .welcome-date { margin-bottom: 8px; font-size: 13px; }
.record-list { display: grid; gap: 12px; }
.record { padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); min-width: 0; overflow-wrap: anywhere; }
.record h2 { margin: 4px 0 8px; font-size: 18px; line-height: 1.35; letter-spacing: -.02em; }
.record h3 { font-size: 16px; margin: 0 0 8px; }
.record p { margin: 6px 0; line-height: 1.6; color: var(--muted); font-size: 14px; }
.record small { color: var(--muted); font-size: 12px; }
.record-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; }
.record-heading > div { min-width: 0; }
.record-heading .status { flex-shrink: 0; }
.record-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:16px; align-items:center; }
.inline-action { margin:0; display:inline-flex; }
.record-actions .btn { min-height:44px; font-size:13px; }
.record-facts { display:flex; flex-wrap:wrap; gap:20px; margin:16px 0; font-variant-numeric:tabular-nums; align-items:center; }
.record-facts span { font-size:13px; color:var(--muted); }
.record-facts span strong { margin-left:6px; color:var(--text); }
.contact-link { color:var(--accent-dark); font-size:14px; padding:8px 0; }
.section-pad { padding:26px; margin-bottom:22px; }
.section-pad > h2 { font-size:20px; }
.section-pad > p { color:var(--muted); line-height:1.6; }
.section-pad .record-list { margin-top:18px; }
.section-pad .record { border-radius:0; border:0; border-top:1px solid var(--line); padding:18px 0; background:transparent; }
.section-actions { display:flex; gap:8px; margin-bottom:18px; }
.inline-settings { display:flex; align-items:end; gap:12px; flex-wrap:wrap; }
.help-text { margin-top:18px; color:var(--muted); font-size:13px; line-height:1.6; }
.api-code { display:block; margin:10px 0; padding:14px; border-radius:8px; background:var(--surface-2); word-break:break-all; white-space:pre-wrap; line-height:1.5; }
.history-entry { padding:16px 0; border-bottom:1px solid var(--line); }
.history-entry h3 { margin:6px 0; font-size:16px; }
.history-entry p { margin:6px 0; color:var(--muted); }
.agenda-records { margin-top:22px; }
.calendar-card .month-grid .day { min-width:0; overflow:hidden; }
.calendar-card .month-grid small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
details { margin:16px 0 0; }
summary { cursor:pointer; color:var(--accent-dark); font-size:14px; font-weight:600; min-height:36px; }
.bottom-nav,.drawer-backdrop { display:none; }
.pwa-ios-dialog { max-width:min(440px,calc(100% - 28px)); padding:24px; border:0; border-radius:16px; }
.pwa-ios-dialog::backdrop { background:rgba(16,43,46,.5); }
.pwa-ios-dialog li { margin:14px 0; line-height:1.6; }
.pwa-ios-dialog h2 { font-size:22px; }
.app-page .side-nav { flex:1; min-height:0; }
.app-page .sidebar-foot { flex-shrink:0; }
.status-cancelled,.status-expired { background:#fae5e6; color:#913741; }
@media (min-width:1024px) {
  .app-content > .record-list { grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; }
  .app-content > .agenda-records { grid-template-columns:1fr; }
}
@media (max-width:767px) {
  html:has(.app-page) { scroll-behavior:auto; overscroll-behavior-y:none; }
  .app-page { background:#f3f6f5; }
  .app-page .app-main { margin-left:0; padding-bottom:calc(88px + env(safe-area-inset-bottom)); }
  .app-page .app-header { position:sticky; top:0; z-index:15; padding:calc(12px + env(safe-area-inset-top)) 18px 12px; min-height:72px; background:#fbfcfc; }
  .app-page .app-header h1 { font-size:21px; }
  .app-page .sidebar-toggle { display:none; }
  .app-page .header-actions .icon-btn:first-child { display:inline-grid; }
  .app-page .app-content { padding:20px 16px 28px; }
  .app-page .metrics-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
  .app-page .metrics-grid article { min-height:104px; padding:14px 10px; border-radius:12px; }
  .app-page .metrics-grid strong { font-size:21px; margin:10px 0 0; word-break:break-word; }
  .app-page .metrics-grid span { font-size:11px; line-height:1.4; }
  .overview-intro { align-items:flex-start; }
  .overview-intro h2 { font-size:28px; }
  .overview-intro > .btn { max-width:120px; white-space:normal; font-size:12px; }
  .app-page .quick-actions { flex-wrap:wrap; overflow:visible; }
  .app-page .quick-actions .btn { flex:1 1 40%; min-height:48px; }
  .app-page .toolbar { flex-direction:column; align-items:stretch; gap:12px; }
  .app-page .toolbar .search-box { width:100%; max-width:none; }
  .app-page .toolbar > .btn { min-height:48px; }
  .app-page .toolbar .calendar-nav { justify-content:space-between; width:100%; }
  .app-page .record { padding:18px 16px; border-color:#dfe7e4; }
  .app-page .record-heading { gap:12px; }
  .app-page .record-heading .contact-link { font-size:12px; }
  .app-page .record-actions { gap:8px; }
  .app-page .record-actions .btn { padding:0 12px; min-height:44px; }
  .app-page .section-pad { padding:20px 16px; }
  .app-page input,.app-page select,.app-page textarea,.auth-page input,.profile-page input,.profile-page select,.profile-page textarea { font-size:16px; min-height:48px; }
  .app-page .form-grid { grid-template-columns:minmax(0,1fr); }
  .app-page .span-2 { grid-column:auto; }
  .app-page .form-actions { position:sticky; bottom:0; background:#fbfcfc; padding:14px 0 max(8px,env(safe-area-inset-bottom)); margin:0; }
  .app-page .form-actions .btn { flex:1; min-height:48px; }
  .app-page .modal { inset:auto 0 0; margin:0; width:100%; max-width:100%; max-height:94dvh; border-radius:20px 20px 0 0; padding:0; }
  .app-page .modal-head { padding:18px; position:sticky; top:0; z-index:1; background:#fbfcfc; }
  .app-page .modal-head h2 { font-size:20px; }
  .app-page .modal-body { padding:20px 18px 0; }
  .app-page .quote-line { display:grid; grid-template-columns:minmax(0,1fr) 48px; gap:10px; padding-bottom:16px; border-bottom:1px solid var(--line); }
  .app-page .quote-line label:first-child { grid-column:1/-1; }
  .app-page .quote-line .icon-btn { width:48px; height:48px; align-self:end; }
  .app-page .sidebar { z-index:40; width:min(320px,88vw); inset:0 auto 0 0; padding-top:calc(22px + env(safe-area-inset-top)); padding-bottom:calc(18px + env(safe-area-inset-bottom)); transform:translateX(-101%); transition:transform .2s ease-out; }
  .app-page.sidebar-open .sidebar { transform:translateX(0); }
  .bottom-nav { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); position:fixed; z-index:30; bottom:0; left:0; right:0; padding:8px 6px calc(8px + env(safe-area-inset-bottom)); border-top:1px solid #dce5e1; background:#fbfcfc; }
  .bottom-nav a,.bottom-nav button { min-height:54px; color:#617071; background:transparent; border:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px; font-size:10px; font-weight:600; border-radius:10px; }
  .bottom-nav i { font-size:23px; }
  .bottom-nav [aria-current=page] { color:#07665f; background:#e5f3ee; }
  .bottom-nav button:active,.bottom-nav a:active { background:#e5f3ee; }
  .app-page.sidebar-open .drawer-backdrop { display:block; border:0; position:fixed; inset:0; z-index:35; background:rgba(16,43,46,.5); }
  .app-page .calendar-card { padding:12px 8px; }
  .app-page .month-grid .day { min-height:64px; padding:6px 3px; font-size:12px; }
  .app-page .month-grid .day small { font-size:9px; }
  .app-page .week-head span { font-size:10px; }
}
@media (prefers-reduced-motion:reduce) {
  html { scroll-behavior:auto; }
  *,*::before,*::after { transition:none !important; animation:none !important; }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--text); background: var(--bg); font-family: 'DM Sans', sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3, .brand { font-family: 'Manrope', sans-serif; }
button { color: inherit; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 600; letter-spacing: -.04em; white-space: nowrap; }
.brand strong { color: var(--accent); }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; color: #eefdfa; background: var(--accent); border-radius: 10px; font-size: 21px; }
.brand-light { color: #edf8f7; }
.brand-light strong { color: #75d6ca; }

.btn { min-height: 42px; border: 1px solid transparent; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; font-weight: 700; cursor: pointer; white-space: nowrap; transition: transform .16s ease, background .16s ease, border-color .16s ease; }
.btn:active, .icon-btn:active { transform: translateY(1px); }
.btn-primary { color: #f6fffd; background: var(--accent); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary { color: var(--text); background: var(--surface); border-color: var(--line); }
.btn-secondary:hover, .btn-ghost:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-light { color: var(--navy); background: #eefaf8; }
.btn-lg { min-height: 50px; padding: 0 22px; }
.btn-block { width: 100%; }
.icon-btn { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); display: inline-grid; place-items: center; cursor: pointer; }
.text-link { color: var(--accent-dark); display: inline-flex; align-items: center; gap: 7px; font-weight: 700; }
.text-button { color: var(--accent-dark); background: none; border: 0; padding: 0; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; cursor: pointer; }

/* Marketing */
.marketing { background: #f8fbfa; }
.site-nav { height: 72px; max-width: 1260px; margin: 0 auto; padding: 0 26px; display: flex; align-items: center; justify-content: space-between; }
.site-nav nav { display: flex; align-items: center; gap: 26px; font-size: 14px; font-weight: 600; }
.site-nav nav > a:not(.btn):hover { color: var(--accent); }
.mobile-menu { display: none; border: 0; background: none; font-size: 25px; }
.hero { max-width: 1260px; min-height: calc(100dvh - 72px); margin: 0 auto; padding: 54px 26px 72px; display: grid; grid-template-columns: minmax(0, .88fr) minmax(480px, 1.12fr); align-items: center; gap: 66px; }
.hero-copy { padding-left: 3vw; }
.eyebrow { color: var(--accent-dark); display: inline-block; margin-bottom: 17px; font-size: 12px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.hero h1 { max-width: 650px; margin-bottom: 22px; font-size: clamp(43px, 5.2vw, 71px); line-height: .99; letter-spacing: -.06em; }
.hero-copy > p { max-width: 490px; margin-bottom: 30px; color: var(--muted); font-size: 19px; line-height: 1.55; }
.hero-actions { display: flex; gap: 11px; }
.hero-media { position: relative; overflow: hidden; border-radius: 22px; box-shadow: 0 28px 70px rgba(17, 47, 49, .15); }
.hero-media::after { content: ''; position: absolute; inset: 0; border: 1px solid rgba(255,255,255,.45); border-radius: inherit; pointer-events: none; }
.hero-media img { width: 100%; min-height: 570px; object-fit: cover; object-position: 58% center; }
.proof-strip { max-width: 1120px; margin: -24px auto 0; padding: 24px 26px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; justify-content: space-around; gap: 20px; color: var(--muted); }
.proof-strip span { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.proof-strip i { color: var(--accent); font-size: 20px; }
.section { max-width: 1120px; margin: 0 auto; padding: 118px 26px; }
.section-heading { max-width: 640px; margin-bottom: 48px; }
.section-heading h2, .workflow h2 { margin-bottom: 15px; font-size: clamp(34px, 4vw, 52px); line-height: 1.05; letter-spacing: -.05em; }
.section-heading p, .workflow p { color: var(--muted); font-size: 18px; line-height: 1.6; }
.feature-grid { display: grid; grid-template-columns: 1.2fr .8fr .8fr; grid-template-rows: repeat(2, minmax(250px, auto)); gap: 16px; }
.feature { padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.feature > i { color: var(--accent); font-size: 30px; }
.feature h3 { margin: 25px 0 10px; font-size: 21px; }
.feature p { margin: 0; color: var(--muted); line-height: 1.55; }
.feature-large { grid-row: span 2; padding: 36px; background: #e8f3f1; }
.feature-tinted { background: #d9eeea; }
.feature-dark { color: #ecf7f5; background: var(--navy); border-color: var(--navy); }
.feature-dark p { color: #afc2c2; }
.feature-dark > i { color: #72d4c9; }
.quote-sample { margin-top: 60px; padding: 24px; background: #f9fcfb; border-radius: 12px; box-shadow: var(--shadow); }
.quote-sample span, .quote-sample small { display: block; color: var(--muted); }
.quote-sample strong { display: block; margin: 14px 0 5px; font-family: 'Manrope'; font-size: 28px; }
.workflow { max-width: none; padding-left: max(26px, calc((100% - 1068px) / 2)); padding-right: max(26px, calc((100% - 1068px) / 2)); display: grid; grid-template-columns: .85fr 1.15fr; gap: 100px; align-items: center; background: #edf4f3; }
.workflow-copy p { max-width: 500px; }
.workflow-list { margin: 0; padding: 0; list-style: none; counter-reset: flow; }
.workflow-list li { position: relative; min-height: 108px; padding: 23px 30px 23px 75px; border-bottom: 1px solid #cddada; display: flex; flex-direction: column; justify-content: center; counter-increment: flow; }
.workflow-list li::before { content: counter(flow); position: absolute; left: 18px; top: 32px; width: 34px; height: 34px; border-radius: 50%; color: #effbf8; background: var(--accent); display: grid; place-items: center; font-weight: 800; }
.workflow-list span { color: var(--muted); font-size: 13px; }
.workflow-list strong { margin-top: 4px; font-family: 'Manrope'; font-size: 19px; }
.cta-section { max-width: 1120px; margin: 110px auto; padding: 50px; border-radius: 18px; color: #effbf9; background: var(--navy); display: flex; align-items: center; justify-content: space-between; gap: 40px; }
.cta-section h2 { max-width: 670px; margin-bottom: 10px; font-size: 34px; letter-spacing: -.04em; }
.cta-section p { margin: 0; color: #b4c7c7; }
.site-footer { max-width: 1120px; margin: 0 auto; padding: 32px 0 46px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 30px; color: var(--muted); font-size: 13px; }
.site-footer p { flex: 1; margin: 0; }

/* Authentication */
.auth-page { min-height: 100dvh; background: #edf4f3; }
.auth-shell { min-height: 100dvh; display: grid; grid-template-columns: 1.05fr .95fr; }
.auth-panel { padding: 48px clamp(40px, 7vw, 110px); color: #eff9f7; background: var(--navy); display: flex; flex-direction: column; justify-content: space-between; }
.auth-panel .brand { color: #eff9f7; }
.auth-copy { max-width: 530px; }
.auth-copy .eyebrow { color: #75d6ca; }
.auth-copy h1 { margin-bottom: 20px; font-size: clamp(45px, 5vw, 68px); line-height: 1.02; letter-spacing: -.06em; }
.auth-copy p { color: #b3c7c6; font-size: 19px; line-height: 1.6; }
.auth-proof { display: flex; align-items: center; gap: 14px; color: #c5d8d6; }
.auth-proof > i { font-size: 27px; }
.auth-proof span { display: flex; flex-direction: column; }
.auth-proof small { color: #8fa8a7; }
.login-card { width: min(460px, calc(100% - 50px)); margin: auto; }
.login-card > div:first-child { margin-bottom: 30px; }
.registration-card { padding:36px 0; }
.checkbox-label { display:flex; align-items:center; gap:12px; line-height:1.5; }
.checkbox-label input { width:22px; min-height:22px; height:22px; accent-color:var(--accent); flex-shrink:0; }
.app-page .metrics-grid strong { font-family:inherit; }
.app-page .empty-state.tall { min-height:200px; padding:28px 18px; }
.app-page.sidebar-open { overflow:hidden; }
.login-card h2 { margin-bottom: 7px; font-size: 34px; letter-spacing: -.04em; }
.login-card p { color: var(--muted); }
.form-stack { display: grid; gap: 20px; }
label { color: #354546; display: grid; gap: 8px; font-size: 13px; font-weight: 700; }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #cfdada; border-radius: 9px; outline: none; color: var(--text); background: #fafcfc; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(8,127,120,.12); }
.password-field { position: relative; }
.password-field button { position: absolute; right: 8px; top: 5px; width: 34px; height: 34px; border: 0; background: none; cursor: pointer; }
.form-error { margin-bottom: 18px; padding: 12px 14px; border: 1px solid #e9b8bd; border-radius: 9px; color: #98343c; background: #fff0f1; display: flex; align-items: center; gap: 8px; font-size: 14px; }
.demo-access { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.demo-access > strong { margin-bottom: 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.demo-access button { padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); display: flex; justify-content: space-between; cursor: pointer; }
.demo-access button:hover { border-color: var(--accent); }
.demo-access button small { color: var(--muted); }
.back-link { margin-top: 24px; display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }

/* Application shell */
.app-page { min-height: 100dvh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: var(--sidebar); padding: 24px 16px 18px; color: #afc2c2; background: #102a2d; display: flex; flex-direction: column; }
.sidebar .brand { margin: 0 12px 24px; }
.company-switch { margin-bottom: 18px; padding: 10px; border: 1px solid #274348; border-radius: 11px; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 9px; background: #173539; }
.company-avatar, .user-avatar, .header-avatar { display: grid; place-items: center; border-radius: 9px; color: #effaf8; background: var(--accent); font-weight: 800; }
.company-avatar { width: 34px; height: 34px; }
.company-switch span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
.company-switch small { color: #789294; font-size: 10px; }
.company-switch strong { overflow: hidden; color: #eaf6f4; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.side-nav { display: grid; gap: 3px; overflow-y: auto; }
.side-nav a, .sidebar-foot > a, .sidebar-foot form button { width: 100%; min-height: 42px; padding: 0 11px; border: 0; border-radius: 9px; color: inherit; background: transparent; display: flex; align-items: center; gap: 11px; font-size: 13px; font-weight: 600; cursor: pointer; }
.side-nav i, .sidebar-foot i { width: 21px; font-size: 19px; }
.side-nav a:hover, .sidebar-foot > a:hover, .sidebar-foot form button:hover { color: #effaf8; background: #1b3a3e; }
.side-nav a.active { color: #effaf8; background: #1b4949; }
.side-nav a.active i { color: #78d8cc; }
.sidebar-foot { margin-top: auto; padding-top: 13px; border-top: 1px solid #234045; }
.user-chip { margin-top: 12px; padding: 10px; display: flex; align-items: center; gap: 9px; }
.user-avatar { width: 33px; height: 33px; flex: 0 0 auto; }
.user-chip span:last-child { min-width: 0; display: flex; flex-direction: column; }
.user-chip strong, .user-chip small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip strong { color: #e9f4f2; font-size: 12px; }
.user-chip small { color: #789294; font-size: 10px; }
.app-main { min-height: 100dvh; margin-left: var(--sidebar); }
.app-header { min-height: 86px; padding: 17px 30px; border-bottom: 1px solid var(--line); background: rgba(250,252,252,.92); display: flex; align-items: center; gap: 16px; }
.app-header h1 { margin: 0; font-size: 22px; letter-spacing: -.035em; }
.app-header p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.header-avatar { width: 38px; height: 38px; margin-left: 6px; }
.notification { position: relative; }
.notification span { position: absolute; right: 7px; top: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--danger); }
.sidebar-toggle { display: none; border: 0; background: none; font-size: 24px; }
.app-content { max-width: 1500px; margin: 0 auto; padding: 26px 30px 48px; }
.flash { margin-bottom: 20px; padding: 13px 15px; border-radius: 10px; display: flex; align-items: center; gap: 9px; font-size: 13px; }
.flash-success { color: #185f40; background: #def3e8; border: 1px solid #b8e2ce; }
.flash-error { color: #8d3038; background: #fce9eb; border: 1px solid #edc0c4; }
.quick-actions, .toolbar { margin-bottom: 21px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.quick-actions { justify-content: flex-start; }
.metrics-grid { margin-bottom: 22px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.metrics-grid article { min-height: 132px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); display: flex; flex-direction: column; }
.metrics-grid span, .mini-metrics span { color: var(--muted); font-size: 12px; font-weight: 600; }
.metrics-grid strong { margin: 12px 0 7px; font-family: 'Manrope'; font-size: 26px; letter-spacing: -.04em; }
.metrics-grid small { margin-top: auto; color: #728081; font-size: 11px; }
.metrics-grid small i { color: var(--success); }
.metrics-grid .metric-alert { border-color: #ebd0a5; background: #fff9ee; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, .8fr); gap: 18px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.panel-head { min-height: 76px; padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.panel-head h2 { margin: 0 0 4px; font-size: 16px; }
.panel-head p { margin: 0; color: var(--muted); font-size: 11px; }
.panel-head > a { color: var(--accent-dark); font-size: 12px; font-weight: 700; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--muted); background: #f3f6f6; text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .055em; }
td { padding: 14px 16px; border-bottom: 1px solid #e8eeee; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8fafa; }
td > strong, td > small { display: block; }
td > small { margin-top: 3px; color: var(--muted); }
td a { color: var(--accent-dark); font-weight: 700; }
.money-cell { font-weight: 800; font-variant-numeric: tabular-nums; }
.status { min-height: 24px; padding: 3px 8px; border-radius: 7px; display: inline-flex; align-items: center; color: #536263; background: #e9eeee; font-size: 10px; font-weight: 700; }
.status-sent, .status-scheduled, .status-open { color: #73511c; background: #f7ead2; }
.status-accepted, .status-confirmed, .status-completed, .status-paid { color: #1d6847; background: #dcefe5; }
.status-rejected { color: #913741; background: #f8e1e4; }
.status-in_progress, .status-pending { color: #315f88; background: #dfeaf4; }
.schedule-list { padding: 6px 18px 12px; }
.schedule-list article { padding: 15px 0; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 13px; }
.schedule-list article:last-child { border: 0; }
.schedule-list time { width: 42px; height: 48px; border-radius: 9px; color: var(--accent-dark); background: var(--accent-soft); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.schedule-list time strong { font-size: 17px; line-height: 1; }
.schedule-list time small { margin-top: 3px; font-size: 8px; }
.schedule-list article div { display: flex; flex-direction: column; }
.schedule-list article strong { font-size: 12px; }
.schedule-list article span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.empty-row { height: 130px; color: var(--muted); text-align: center; }
.empty-state { min-height: 140px; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.empty-state > i { color: #9badad; font-size: 34px; }
.empty-state.tall { min-height: 330px; }
.empty-state.tall h3 { margin: 14px 0 6px; color: var(--text); }
.empty-state.tall p { max-width: 420px; }

.search-box { width: min(390px, 100%); height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); display: flex; align-items: center; gap: 8px; }
.search-box input { min-height: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.toolbar > div:last-child { display: flex; gap: 8px; }
.identity-cell { display: flex; align-items: center; gap: 10px; }
.identity-cell > span { width: 34px; height: 34px; border-radius: 9px; color: var(--accent-dark); background: var(--accent-soft); display: grid; place-items: center; font-weight: 800; }
.identity-cell div { display: flex; flex-direction: column; }
.identity-cell small { color: var(--muted); }
.mini-metrics { margin-bottom: 18px; display: flex; gap: 1px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line); }
.mini-metrics > div { min-height: 82px; flex: 1; padding: 17px 20px; background: var(--surface); display: flex; flex-direction: column; }
.mini-metrics strong { margin-top: 8px; font-family: 'Manrope'; font-size: 20px; }
.stock-state { padding: 5px 8px; border-radius: 7px; font-size: 10px; font-weight: 700; }
.stock-state.ok { color: var(--success); background: #def1e7; }
.stock-state.low { color: var(--warning); background: #f8ead2; }
.integration-banner { margin-bottom: 20px; padding: 16px 18px; border: 1px solid #bce1db; border-radius: var(--radius); background: #e7f5f2; display: flex; align-items: center; gap: 14px; }
.integration-icon, .api-icon { display: grid; place-items: center; color: #effdfa; background: var(--accent); border-radius: 11px; }
.integration-icon { width: 42px; height: 42px; }
.integration-banner div:nth-child(2) { flex: 1; }
.integration-banner strong { font-size: 13px; }
.integration-banner p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.filter-tabs { padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.filter-tabs button { min-height: 32px; padding: 0 13px; border: 0; border-radius: 7px; color: var(--muted); background: none; font-size: 11px; cursor: pointer; }
.filter-tabs button.active { color: var(--text); background: var(--surface-2); font-weight: 700; }
.copy-link { display: inline-flex; align-items: center; gap: 5px; }

.agenda-layout { display: grid; grid-template-columns: minmax(600px, 1fr) 310px; gap: 18px; }
.calendar-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.week-head, .month-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.week-head { color: var(--muted); background: #edf2f2; }
.week-head span { padding: 12px; text-align: center; font-size: 10px; font-weight: 700; }
.day { min-height: 112px; padding: 10px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); }
.day:nth-child(7n) { border-right: 0; }
.day > span { width: 26px; height: 26px; display: grid; place-items: center; font-size: 11px; }
.day.today > span { border-radius: 50%; color: white; background: var(--accent); font-weight: 800; }
.day small { margin-top: 6px; padding: 5px 6px; border-radius: 5px; color: var(--accent-dark); background: var(--accent-soft); display: block; overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.day-list article { margin: 0 17px; padding: 15px 0; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.day-list time { color: var(--accent-dark); font-size: 10px; font-weight: 800; }
.day-list strong { font-size: 12px; }
.day-list span:not(.status) { color: var(--muted); font-size: 10px; }
.day-list .status { width: max-content; margin-top: 4px; }
.calendar-nav { display: flex; align-items: center; gap: 12px; }

.profile-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; align-items: start; gap: 34px; }
.form-panel .form-grid { padding: 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.span-2 { grid-column: span 2; }
.form-actions { padding-top: 8px; display: flex; justify-content: flex-end; gap: 8px; }
.input-prefix { display: flex; align-items: center; border: 1px solid #cfdada; border-radius: 9px; overflow: hidden; background: #edf2f2; }
.input-prefix span { padding-left: 11px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.input-prefix span.suffix { padding: 0 11px 0 0; }
.input-prefix input { border: 0; box-shadow: none; }
.phone-preview { width: 310px; min-height: 620px; padding: 42px 22px 26px; border: 8px solid #203537; border-radius: 38px; position: relative; text-align: center; background: #edf5f3; box-shadow: var(--shadow); }
.phone-speaker { position: absolute; top: 12px; left: 50%; width: 72px; height: 6px; border-radius: 5px; background: #203537; transform: translateX(-50%); }
.preview-cover { height: 110px; margin: -10px -10px 0; display: grid; place-items: center; }
.preview-cover .brand-mark { width: 58px; height: 58px; font-size: 32px; border-radius: 17px; }
.phone-preview h3 { margin: 5px 0 8px; font-size: 19px; }
.phone-preview > p { color: var(--muted); font-size: 11px; line-height: 1.45; }
.preview-links { margin-top: 22px; display: grid; gap: 9px; }
.preview-links span { min-height: 48px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 11px; font-weight: 700; }
.preview-links i { color: var(--accent); font-size: 19px; }

.import-grid, .integration-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.upload-panel, .instructions, .api-panel, .webhook-panel { padding: 28px; }
.upload-panel > i { color: var(--accent); font-size: 38px; }
.upload-panel h2, .instructions h2, .api-panel h2, .webhook-panel h2 { margin: 15px 0 8px; font-size: 20px; }
.upload-panel > p, .instructions > p, .api-panel > p { color: var(--muted); font-size: 13px; line-height: 1.55; }
.file-drop { min-height: 170px; margin: 22px 0 15px; border: 1px dashed #9db9b6; border-radius: 12px; background: #f3f8f7; align-items: center; justify-content: center; text-align: center; cursor: pointer; }
.file-drop input { display: none; }
.file-drop i { color: var(--accent); font-size: 31px; }
.file-drop span { color: var(--muted); font-size: 10px; }
.instructions code { padding: 14px; border-radius: 8px; display: block; overflow-x: auto; color: #d6f7f2; background: var(--navy); font-size: 11px; }
.instructions ul { padding-left: 18px; color: var(--muted); font-size: 12px; line-height: 2; }
.api-icon { width: 50px; height: 50px; font-size: 27px; }
.api-panel > label { margin-top: 18px; }
.copy-field { min-height: 44px; border: 1px solid var(--line); border-radius: 9px; background: #f1f5f5; display: flex; align-items: center; }
.copy-field code { flex: 1; padding: 0 11px; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.copy-field button { width: 40px; align-self: stretch; border: 0; border-left: 1px solid var(--line); background: none; cursor: pointer; }
.code-example { margin-top: 22px; border-radius: 10px; overflow: hidden; background: var(--navy); }
.code-example span { padding: 9px 13px; border-bottom: 1px solid #284247; color: #8ca4a3; display: block; font-size: 9px; text-transform: uppercase; }
.code-example pre { margin: 0; padding: 15px; overflow-x: auto; color: #d8f3ef; font-size: 10px; white-space: pre-wrap; }
.webhook-panel article { padding: 17px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px; }
.integration-logo { width: 42px; height: 42px; border-radius: 10px; color: var(--accent); background: var(--accent-soft); display: grid; place-items: center; font-size: 21px; }
.webhook-panel article strong { font-size: 13px; }
.webhook-panel article p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.webhook-panel article > a { color: var(--accent-dark); font-size: 11px; font-weight: 700; }

/* Modal */
.modal { width: min(680px, calc(100% - 28px)); max-height: 90dvh; padding: 0; border: 0; border-radius: 16px; color: var(--text); background: var(--surface); box-shadow: 0 25px 80px rgba(10,35,37,.25); }
.modal::backdrop { background: rgba(9, 30, 32, .58); backdrop-filter: blur(3px); }
.modal-head { min-height: 66px; padding: 14px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-body { padding: 22px; overflow-y: auto; }
.quote-items { display: grid; gap: 9px; }
.quote-line { display: grid; grid-template-columns: 1fr 120px 38px; align-items: end; gap: 9px; }
.remove-line { margin-bottom: 1px; color: var(--danger); }

/* Public quote */
.quote-page { background: #edf2f2; }
.quote-shell { max-width: 1100px; margin: 0 auto; padding: 0 24px 50px; }
.quote-top { min-height: 76px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
.quote-notice { margin-bottom: 18px; padding: 14px 16px; border: 1px solid #b9dfcc; border-radius: 11px; color: var(--success); background: #e2f3e9; display: flex; align-items: center; gap: 8px; }
.quote-hero { padding: 40px 44px; border-radius: 16px 16px 0 0; color: #edf9f7; background: var(--navy); display: flex; justify-content: space-between; align-items: end; }
.quote-hero .eyebrow { color: #70d2c6; }
.quote-hero h1 { margin-bottom: 10px; font-size: 38px; letter-spacing: -.045em; }
.quote-hero p { margin: 0; color: #b1c4c3; }
.quote-status-block { text-align: right; }
.quote-status-block small { margin-bottom: 7px; display: block; color: #8ca5a4; }
.quote-content { display: grid; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; gap: 18px; }
.quote-document { padding: 38px 44px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 16px 16px; background: var(--surface); }
.document-head { margin-bottom: 42px; padding-bottom: 26px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.document-head > div { display: flex; flex-direction: column; gap: 4px; }
.document-head small { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; }
.document-head strong { margin: 5px 0; }
.document-head span { color: var(--muted); font-size: 11px; }
.quote-document h2 { margin-bottom: 15px; font-size: 17px; }
.quote-row { min-height: 52px; display: grid; grid-template-columns: 1fr 65px 110px 110px; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); font-size: 11px; }
.quote-row span:not(:first-child) { text-align: right; }
.quote-row-head { min-height: 38px; color: var(--muted); background: #f3f6f6; font-size: 9px; font-weight: 700; text-transform: uppercase; }
.quote-row-head span:first-child { padding-left: 8px; }
.quote-summary { width: min(370px, 100%); margin: 28px 0 28px auto; }
.quote-summary div { padding: 7px 0; display: flex; justify-content: space-between; font-size: 12px; }
.quote-summary span { color: var(--muted); }
.quote-summary .quote-total { margin-top: 8px; padding-top: 15px; border-top: 1px solid var(--text); font-size: 16px; }
.quote-summary .quote-total span { color: var(--text); font-weight: 700; }
.terms-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.terms-grid article { padding: 15px; border-radius: 10px; background: var(--surface-2); display: flex; align-items: center; gap: 11px; }
.terms-grid i { color: var(--accent); font-size: 24px; }
.terms-grid div { display: flex; flex-direction: column; }
.terms-grid strong { font-size: 11px; }
.terms-grid span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.quote-notes { margin-top: 30px; }
.quote-notes h3 { font-size: 14px; }
.quote-notes p { color: var(--muted); font-size: 11px; line-height: 1.65; }
.quote-action-card { position: sticky; top: 18px; margin-top: 18px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.quote-action-card h2 { font-size: 18px; }
.quote-action-card > p { color: var(--muted); font-size: 12px; line-height: 1.55; }
.quote-action-card form { display: grid; gap: 8px; }
.whatsapp-link { margin-top: 17px; padding-top: 17px; border-top: 1px solid var(--line); color: var(--accent-dark); display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; }
.accepted-state { padding: 18px; border-radius: 11px; background: #e2f2e9; text-align: center; }
.accepted-state > i { color: var(--success); font-size: 38px; }
.accepted-state strong { margin: 8px 0 4px; display: block; }
.accepted-state p { margin: 0; color: var(--muted); font-size: 11px; }
.quote-footer { padding: 24px 0; color: var(--muted); text-align: center; font-size: 10px; }

/* Public Link profile */
.profile-page { min-height: 100dvh; background: #dce9e7; }
.public-profile { min-height: 100dvh; padding: 50px 20px; display: grid; place-items: center; }
.profile-card { width: min(500px, 100%); padding: 38px; border: 1px solid rgba(255,255,255,.75); border-radius: 24px; background: rgba(250,252,252,.92); box-shadow: 0 24px 70px rgba(20,50,52,.13); text-align: center; }
.profile-brand { display: flex; justify-content: center; }
.profile-brand .brand-mark { width: 66px; height: 66px; border-radius: 19px; font-size: 35px; }
.profile-card h1 { margin: 19px 0 9px; font-size: 27px; letter-spacing: -.045em; }
.profile-card > p { max-width: 380px; margin: 0 auto; color: var(--muted); font-size: 13px; line-height: 1.55; }
.profile-actions { margin-top: 28px; display: grid; gap: 10px; }
.profile-actions a, .profile-actions button { width: 100%; min-height: 62px; padding: 10px 15px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: var(--surface); display: grid; grid-template-columns: 32px 1fr 22px; align-items: center; gap: 9px; text-align: left; cursor: pointer; }
.profile-actions a:hover, .profile-actions button:hover { border-color: var(--accent); transform: translateY(-1px); }
.profile-actions > * > i:first-child { color: var(--accent); font-size: 24px; }
.profile-actions span { display: flex; flex-direction: column; }
.profile-actions strong { font-size: 13px; }
.profile-actions small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.profile-contact { margin-top: 22px; color: var(--muted); display: flex; justify-content: center; gap: 6px; font-size: 10px; }
.profile-card footer { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); color: #849293; font-size: 9px; }
.profile-card footer a { color: var(--accent-dark); font-weight: 700; }
.success-state { padding: 20px 0; text-align: center; }
.success-state > i { color: var(--success); font-size: 52px; }
.success-state h3 { margin: 14px 0 7px; }
.success-state p { color: var(--muted); font-size: 13px; }
.not-found { min-height: 100dvh; display: grid; place-content: center; text-align: center; }
.not-found i { color: var(--muted); font-size: 54px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media (max-width: 1080px) {
  .hero { grid-template-columns: .9fr 1.1fr; gap: 30px; }
  .hero-copy { padding-left: 0; }
  .hero-media img { min-height: 500px; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .agenda-layout { grid-template-columns: 1fr; }
  .day-list { display: none; }
  .quote-content { grid-template-columns: 1fr; }
  .quote-action-card { position: static; margin-top: 0; }
}

@media (max-width: 820px) {
  .site-nav nav { display: none; position: absolute; z-index: 30; top: 64px; left: 16px; right: 16px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); flex-direction: column; align-items: stretch; }
  .site-nav nav.open { display: flex; }
  .mobile-menu { display: block; }
  .hero { min-height: auto; padding: 44px 20px 70px; grid-template-columns: 1fr; }
  .hero h1 { font-size: clamp(42px, 12vw, 60px); }
  .hero-media { order: -1; }
  .hero-media img { min-height: 360px; }
  .proof-strip { margin: 0 20px; overflow-x: auto; justify-content: flex-start; }
  .proof-strip span { flex: 0 0 auto; }
  .section { padding: 80px 20px; }
  .feature-grid { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .feature-large { grid-column: span 2; grid-row: auto; }
  .workflow { padding: 80px 20px; grid-template-columns: 1fr; gap: 40px; }
  .cta-section { margin: 70px 20px; padding: 36px; flex-direction: column; align-items: flex-start; }
  .site-footer { margin: 0 20px; flex-wrap: wrap; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-panel { min-height: 280px; padding: 30px; }
  .auth-copy { margin: 50px 0 0; }
  .auth-copy h1 { font-size: 42px; }
  .auth-proof { display: none; }
  .login-card { margin: 50px auto; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar-open .sidebar { transform: translateX(0); }
  .app-main { margin-left: 0; }
  .sidebar-toggle { display: block; }
  .profile-layout { grid-template-columns: 1fr; }
  .phone-preview { display: none; }
  .import-grid, .integration-grid { grid-template-columns: 1fr; }
  .agenda-layout { display: block; }
  .calendar-card { overflow-x: auto; }
  .week-head, .month-grid { min-width: 680px; }
}

@media (max-width: 560px) {
  .site-nav { height: 64px; padding: 0 18px; }
  .hero { padding-top: 24px; }
  .hero-media img { min-height: 260px; }
  .hero-copy > p { font-size: 17px; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-large { grid-column: auto; }
  .quote-sample { margin-top: 30px; }
  .cta-section h2 { font-size: 28px; }
  .site-footer { align-items: flex-start; flex-direction: column; }
  .app-header { padding: 14px 16px; }
  .app-header p { display: none; }
  .header-actions .icon-btn:first-child { display: none; }
  .app-content { padding: 18px 14px 36px; }
  .quick-actions { overflow-x: auto; }
  .metrics-grid { grid-template-columns: 1fr; }
  .metrics-grid article { min-height: 112px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar > .btn, .toolbar > div:last-child { width: 100%; }
  .toolbar > div:last-child .btn { flex: 1; }
  .mini-metrics { flex-direction: column; }
  .mini-metrics > div { min-height: 68px; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .quote-line { grid-template-columns: 1fr 88px 38px; }
  .modal-body { padding: 17px; }
  .quote-shell { padding: 0 10px 30px; }
  .quote-top { padding: 0 10px; }
  .quote-top > span { display: none; }
  .quote-hero { padding: 30px 22px; align-items: flex-start; flex-direction: column; gap: 20px; }
  .quote-hero h1 { font-size: 30px; }
  .quote-status-block { text-align: left; }
  .quote-document { padding: 26px 20px; }
  .document-head { grid-template-columns: 1fr; }
  .quote-row { grid-template-columns: 1fr 50px 86px; }
  .quote-row span:nth-child(3) { display: none; }
  .terms-grid { grid-template-columns: 1fr; }
  .profile-card { padding: 30px 18px; }
}

