:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #172033;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --sidebar: #111113;
  --sidebar-soft: #1a1a1c;
  --brass: #a77c3f;
  --brass-dark: #7f5d2d;
  --brass-soft: #f3f4f6;
  --green: #14795d;
  --green-soft: #eaf6f1;
  --amber: #a86112;
  --amber-soft: #fff4df;
  --red: #b42318;
  --red-soft: #fff0ee;
  --blue: #315a76;
  --blue-soft: #edf4f8;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(17, 17, 19, .04), 0 8px 24px rgba(17, 17, 19, .035);
  --sidebar-width: 236px;
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid rgba(167, 124, 63, .3); outline-offset: 2px; }
.app { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100vh; }

.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; background: var(--sidebar); color: #f3efe5; border-right: 1px solid #26262a; z-index: 30; }
.brand { display: flex; align-items: center; gap: 12px; padding: 22px 18px 20px; border-bottom: 1px solid #29292c; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid rgba(176, 138, 79, .7); border-radius: 10px; color: #d8b77c; font-family: Georgia, serif; font-weight: 700; letter-spacing: -.04em; }
.brand-copy { min-width: 0; }
.brand-title { overflow: hidden; margin: 0; color: #fff; font-size: 14px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.brand-subtitle { margin: 4px 0 0; color: #8d8b84; font-size: 10px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; }
.nav-scroll { flex: 1; overflow-y: auto; padding: 15px 10px; }
.nav-group + .nav-group { margin-top: 20px; }
.nav-heading { margin: 0 10px 7px; color: #68676b; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.nav-button { position: relative; display: flex; align-items: center; gap: 11px; width: 100%; min-height: 42px; margin: 2px 0; padding: 9px 10px; border: 0; border-radius: 9px; background: transparent; color: #aaa8a2; cursor: pointer; font-size: 13px; font-weight: 550; text-align: left; }
.nav-button:hover { background: #1b1b1e; color: #fff; }
.nav-button.active { background: #202022; color: #fff; }
.nav-button.active::before { position: absolute; top: 9px; bottom: 9px; left: 0; width: 2px; border-radius: 999px; background: #c49a5a; content: ""; }
.nav-button .lucide { width: 17px; height: 17px; color: #77777c; stroke-width: 1.8; }
.nav-button.active .lucide { color: #d1aa6d; }
.nav-text { flex: 1; }
.nav-count { min-width: 21px; padding: 2px 6px; border: 1px solid #38383c; border-radius: 999px; color: #c7c4bc; font-size: 10px; font-weight: 700; text-align: center; }
.sidebar-footer { padding: 14px; border-top: 1px solid #29292c; }

.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: minmax(220px, 1fr) minmax(280px, 420px) auto; align-items: center; gap: 18px; min-height: 72px; padding: 12px 26px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .94); backdrop-filter: blur(14px); }
.page-title { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.035em; }
.page-subtitle { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.search-wrap { position: relative; }
.search-wrap .lucide { position: absolute; top: 11px; left: 13px; width: 17px; height: 17px; color: #8b8982; pointer-events: none; }
.search-input { width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 0 38px; color: var(--ink); outline: 0; font-size: 13px; }
.search-input:focus { border-color: #b79a6d; box-shadow: 0 0 0 3px rgba(167, 124, 63, .1); }
.search-shortcut { position: absolute; top: 9px; right: 10px; padding: 2px 5px; border: 1px solid var(--line); border-radius: 5px; color: #99968f; font-size: 10px; }
.profile { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--sidebar); color: #fff; font-size: 11px; font-weight: 700; }
.profile-copy { line-height: 1.25; }
.profile-copy strong { display: block; font-size: 12px; }
.profile-copy span { color: var(--muted); font-size: 10px; text-transform: capitalize; }
.workspace { width: min(1500px, 100%); margin: 0 auto; padding: 24px 26px 40px; }

.eyebrow { color: var(--brass-dark); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 55px; padding: 14px 17px; border-bottom: 1px solid var(--line); }
.panel-header h2, .panel-header h3 { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: -.015em; }
.panel-body { padding: 16px; }
.panel-link { border: 0; background: transparent; color: var(--brass-dark); cursor: pointer; font-size: 12px; font-weight: 650; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: #fff; color: #363532; cursor: pointer; font-size: 12px; font-weight: 650; text-decoration: none; }
.btn:hover { border-color: #b8b1a4; background: var(--surface-soft); }
.btn.primary { border-color: var(--sidebar); background: var(--sidebar); color: #fff; }
.btn.primary:hover { background: #2a2a2c; }
.btn.brass { border-color: var(--brass-dark); background: var(--brass-dark); color: #fff; }
.btn.danger { border-color: #e8b7b1; color: var(--red); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { min-height: 30px; padding: 5px 9px; font-size: 11px; }
.btn.wide { width: 100%; }
.btn .lucide { width: 15px; height: 15px; }
.badge { display: inline-flex; align-items: center; gap: 5px; min-height: 25px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; background: #f8fafc; color: #5e5c57; font-size: 10px; font-weight: 650; white-space: nowrap; }
.badge.hot { border-color: #efbbb5; background: var(--red-soft); color: var(--red); }
.badge.warm { border-color: #f1d19c; background: var(--amber-soft); color: var(--amber); }
.badge.good { border-color: #a9d9c9; background: var(--green-soft); color: var(--green); }
.badge.info { border-color: #c1d4df; background: var(--blue-soft); color: var(--blue); }
.badge .status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.subtle { color: var(--muted); }
.empty-state { display: grid; place-items: center; min-height: 180px; padding: 24px; color: var(--muted); text-align: center; }
.empty-state .lucide { width: 28px; height: 28px; margin-bottom: 10px; color: #aaa69d; }

.welcome-row { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.welcome-row h2 { margin: 4px 0 0; font-size: 26px; letter-spacing: -.04em; }
.date-label { color: var(--muted); font-size: 12px; }
.kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.kpi-card { display: flex; align-items: center; gap: 14px; min-height: 100px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.kpi-icon { display: grid; flex: 0 0 auto; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--brass-soft); color: var(--brass-dark); }
.kpi-icon .lucide { width: 18px; height: 18px; }
.kpi-card strong { display: block; font-size: 25px; line-height: 1; letter-spacing: -.045em; }
.kpi-card span { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; font-weight: 600; }
.alert-strip { display: flex; align-items: center; gap: 12px; margin: 14px 0; padding: 12px 14px; border: 1px solid #edc989; border-radius: var(--radius); background: var(--amber-soft); color: #6f430d; }
.alert-strip .lucide { flex: 0 0 auto; width: 18px; height: 18px; }
.alert-strip p { flex: 1; margin: 0; font-size: 12px; line-height: 1.45; }
.today-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: 14px; }
.priority-list, .agenda-list { display: grid; gap: 10px; }
.priority-card { display: grid; grid-template-columns: 4px minmax(0, 1fr) auto; gap: 13px; padding: 13px 13px 13px 0; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.priority-bar { border-radius: 999px; background: var(--amber); }
.priority-bar.overdue { background: var(--red); }
.priority-main { min-width: 0; }
.priority-top { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.priority-top strong { font-size: 13px; }
.priority-main p { margin: 7px 0 0; color: #5f5d58; font-size: 12px; line-height: 1.45; }
.priority-next { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--brass-dark); font-size: 11px; font-weight: 650; }
.priority-actions { display: flex; align-items: center; gap: 7px; }
.agenda-item { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 11px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.agenda-item:last-child { border-bottom: 0; }
.agenda-time { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.agenda-main strong { display: block; font-size: 12px; }
.agenda-main span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.value-strip { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.value-item { padding: 14px 16px; border-right: 1px solid var(--line); }
.value-item:last-child { border-right: 0; }
.value-item strong { display: block; font-size: 16px; }
.value-item span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }

.view-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.view-head h2 { margin: 0; font-size: 21px; letter-spacing: -.035em; }
.view-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.filter-select, .field { min-height: 38px; border: 1px solid var(--line); border-radius: 9px; background: #fff; padding: 0 11px; color: #474641; font-size: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { position: sticky; top: 0; z-index: 1; padding: 10px 13px; border-bottom: 1px solid var(--line); background: #f8fafc; color: #77746e; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-align: left; text-transform: uppercase; }
td { padding: 13px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8fafc; }
.lead-cell strong { display: block; font-size: 12px; }
.lead-cell span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; text-transform: capitalize; }
.next-action { max-width: 330px; color: #5e5c57; line-height: 1.4; }
.row-actions { display: flex; justify-content: flex-end; }
.mobile-list { display: none; }
.mobile-card { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }

.lead-detail { display: grid; gap: 14px; }
.lead-summary-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 17px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.lead-summary-header h2 { margin: 0 0 8px; font-size: 18px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.lead-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(310px, .55fr); gap: 14px; align-items: start; }
.conversation-panel { overflow: hidden; }
.conversation-head { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 12px 15px; border-bottom: 1px solid var(--line); }
.contact-avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #343436; color: #fff; font-size: 11px; font-weight: 700; }
.conversation-head strong { display: block; font-size: 12px; }
.conversation-head span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; text-transform: capitalize; }
.chat { display: flex; flex-direction: column; gap: 10px; min-height: 350px; max-height: 480px; overflow-y: auto; padding: 18px; background: radial-gradient(circle at 1px 1px, rgba(111, 110, 104, .12) 1px, transparent 0) 0 0 / 18px 18px, #f1f5f9; }
.bubble { align-self: flex-start; max-width: min(78%, 560px); padding: 10px 12px 8px; border: 1px solid var(--line); border-radius: 4px 12px 12px 12px; background: #fff; box-shadow: 0 1px 2px rgba(17, 17, 19, .04); font-size: 12px; line-height: 1.5; }
.bubble.out { align-self: flex-end; border-color: #cce5da; border-radius: 12px 4px 12px 12px; background: #e9f6f0; }
.bubble-time { display: block; margin-top: 5px; color: #8c8982; font-size: 9px; text-align: right; }
.composer { padding: 14px; border-top: 1px solid var(--line); background: #fff; }
.side-stack { position: sticky; top: 90px; display: grid; gap: 12px; }
.summary-points { display: grid; gap: 9px; }
.summary-point { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; color: #514f4a; font-size: 12px; line-height: 1.45; }
.summary-point .lucide { width: 15px; height: 15px; color: var(--brass-dark); }
.next-step { margin-top: 13px; padding: 11px; border: 1px solid #ead4ad; border-radius: 10px; background: var(--brass-soft); color: #65491f; font-size: 11px; line-height: 1.45; }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.action-grid .btn { width: 100%; }
.action-grid .wide { grid-column: 1 / -1; }
.danger-zone { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.segmented button { min-height: 30px; border: 0; border-radius: 6px; background: transparent; padding: 4px 10px; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 650; }
.segmented button.active { background: var(--sidebar); color: #fff; }
.calendar-grid { display: grid; grid-template-columns: repeat(6, minmax(150px, 1fr)); min-width: 900px; }
.calendar-day { min-height: 430px; border-right: 1px solid var(--line); background: #fff; }
.calendar-day:last-child { border-right: 0; }
.calendar-day.today { background: #f8fafc; }
.day-head { padding: 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; font-weight: 650; text-align: center; }
.day-head strong { display: block; margin-top: 4px; color: var(--ink); font-size: 15px; }
.day-events { display: grid; gap: 8px; padding: 10px; }
.appointment-card { padding: 10px; border: 1px solid var(--line); border-left: 3px solid var(--brass); border-radius: 9px; background: #fff; }
.appointment-card.confirmed { border-left-color: var(--green); }
.appointment-card.propuesta { border-left-color: var(--blue); }
.appointment-time { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; font-weight: 700; }
.appointment-card p { margin: 7px 0 3px; font-size: 11px; font-weight: 650; }
.appointment-card small { color: var(--muted); font-size: 9px; text-transform: capitalize; }
.appointment-actions { display: flex; gap: 5px; margin-top: 8px; }
.appointment-actions .btn { flex: 1; }
.closed-day { display: grid; place-items: center; min-height: 170px; color: #aaa69e; font-size: 10px; }
.agenda-mobile { display: none; }
.calendar-today-view { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 14px; }
.today-appointments { display: grid; gap: 10px; }
.today-hours { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.today-hours h3 { margin: 0 0 12px; font-size: 13px; }
.hours-block { padding: 10px 0; border-top: 1px solid var(--line); }
.hours-block strong { display: block; font-size: 11px; }
.hours-block span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.month-wrap { overflow-x: auto; }
.calendar-month-grid { display: grid; grid-template-columns: repeat(7, minmax(105px, 1fr)); min-width: 760px; background: #fff; }
.month-weekday { padding: 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #f8fafc; color: var(--muted); font-size: 10px; font-weight: 700; text-align: center; text-transform: uppercase; }
.month-cell { min-height: 112px; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; }
.month-cell.outside { background: #f8fafc; color: #a1a8b3; }
.month-cell.today { background: #f6f8fb; box-shadow: inset 0 0 0 2px #94a3b8; }
.month-day-number { display: block; margin-bottom: 7px; font-size: 11px; font-weight: 700; }
.month-event { display: block; width: 100%; margin-top: 5px; padding: 5px 6px; overflow: hidden; border: 0; border-left: 2px solid var(--blue); border-radius: 5px; background: var(--blue-soft); color: var(--blue); cursor: pointer; font-size: 9px; font-weight: 650; text-align: left; text-overflow: ellipsis; white-space: nowrap; }

.stock-grid { display: grid; grid-template-columns: repeat(3, minmax(240px, 1fr)); gap: 14px; }
.vehicle-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow); }
.vehicle-art { position: relative; display: grid; place-items: center; height: 155px; overflow: hidden; background: linear-gradient(145deg, var(--car-soft, #eef2f7), #eef2f7); }
.vehicle-art::after { position: absolute; right: -40px; bottom: -70px; width: 180px; height: 180px; border: 1px solid rgba(255, 255, 255, .6); border-radius: 50%; content: ""; }
.vehicle-art svg { position: relative; z-index: 1; width: 72%; max-width: 240px; filter: drop-shadow(0 14px 8px rgba(17, 17, 19, .15)); }
.vehicle-body { padding: 15px; }
.vehicle-title-row { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.vehicle-title-row h3 { margin: 0; font-size: 15px; }
.vehicle-meta { margin: 6px 0 0; color: var(--muted); font-size: 10px; }
.vehicle-price { margin: 15px 0 12px; font-size: 19px; font-weight: 700; letter-spacing: -.03em; }
.vehicle-price.pending { color: var(--amber); font-size: 14px; }
.readiness { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 9px; background: var(--green-soft); color: var(--green); font-size: 10px; font-weight: 650; }
.readiness.blocked { background: var(--amber-soft); color: var(--amber); }
.readiness .lucide { width: 14px; height: 14px; }
.vehicle-actions { display: flex; gap: 7px; margin-top: 13px; }
.vehicle-specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 12px; margin: 12px 0; padding: 11px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.vehicle-spec { min-width: 0; }
.vehicle-spec span { display: block; color: var(--muted); font-size: 9px; }
.vehicle-spec strong { display: block; overflow: hidden; margin-top: 3px; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .wide { grid-column: 1 / -1; }
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.check-card { display: flex; align-items: flex-start; gap: 8px; min-height: 44px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #f8fafc; color: #384152; font-size: 11px; line-height: 1.35; }
.check-card input { margin-top: 1px; accent-color: var(--green); }
.vehicle-detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }

.metric-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.metric-card { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.metric-card span { color: var(--muted); font-size: 10px; font-weight: 650; }
.metric-card strong { display: block; margin: 10px 0 5px; font-size: 24px; letter-spacing: -.05em; }
.metric-card small { color: #99958d; font-size: 9px; }
.metrics-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); gap: 14px; }
.chart-wrap { min-height: 280px; padding: 16px; }
.chart-legend { display: flex; gap: 14px; margin-bottom: 10px; color: var(--muted); font-size: 10px; }
.legend-dot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--blue); }
.legend-dot.green { background: var(--green); }
.line-chart { width: 100%; height: 230px; overflow: visible; }
.funnel { display: grid; gap: 13px; }
.funnel-row { display: grid; grid-template-columns: 95px minmax(0, 1fr) 34px; gap: 10px; align-items: center; font-size: 10px; }
.funnel-track { height: 10px; overflow: hidden; border-radius: 999px; background: #e5e7eb; }
.funnel-fill { height: 100%; border-radius: inherit; background: var(--brass); }
.channel-list { display: grid; gap: 12px; margin-top: 18px; padding-top: 17px; border-top: 1px solid var(--line); }
.channel-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) 26px; gap: 9px; align-items: center; font-size: 10px; }
.channel-track { height: 7px; border-radius: 999px; background: #e5e7eb; }
.channel-fill { height: 100%; border-radius: inherit; background: var(--blue); }
.metric-note { display: flex; align-items: center; gap: 8px; margin-top: 14px; color: var(--muted); font-size: 10px; }
.metric-note .lucide { width: 14px; height: 14px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; padding: 18px; background: rgba(17, 17, 19, .56); backdrop-filter: blur(4px); }
.modal-backdrop.open { display: grid; }
.modal { width: min(520px, 100%); max-height: min(720px, 90vh); overflow-y: auto; border: 1px solid rgba(255,255,255,.3); border-radius: 16px; background: #fff; box-shadow: 0 24px 70px rgba(17,17,19,.25); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 16px; }
.icon-btn { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.icon-btn .lucide { width: 15px; height: 15px; }
.modal-body { display: grid; gap: 13px; padding: 18px; }
.form-group { display: grid; gap: 6px; }
.form-group label { color: #514f4a; font-size: 11px; font-weight: 650; }
.form-group input, .form-group select, .form-group textarea { width: 100%; min-height: 40px; border: 1px solid var(--line-strong); border-radius: 9px; background: #fff; padding: 9px 10px; color: var(--ink); font-size: 12px; }
.form-group textarea { min-height: 80px; resize: vertical; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 18px; border-top: 1px solid var(--line); background: #f8fafc; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 120; max-width: 360px; transform: translateY(20px); opacity: 0; padding: 11px 14px; border: 1px solid #3a3936; border-radius: 10px; background: #1e1e20; color: #fff; box-shadow: 0 15px 40px rgba(17,17,19,.22); font-size: 11px; pointer-events: none; transition: opacity .16s ease, transform .16s ease; }
.toast.show { transform: translateY(0); opacity: 1; }
.mobile-nav, .mobile-more { display: none; }

/* NUEVAS VISTAS: Login, Handoff, Notes */
.login-wrapper { display: grid; place-items: center; min-height: 100vh; background: var(--bg); padding: 24px; }
.login-panel { width: min(400px, 100%); padding: 32px 24px; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-bottom: 32px; text-align: center; }
.login-brand .brand-mark { width: 48px; height: 48px; font-size: 20px; color: var(--brass-dark); border-color: var(--brass); }
.login-brand .brand-title { color: var(--ink); font-size: 18px; font-weight: 700; margin: 0 0 4px; }
.login-brand .brand-subtitle { color: var(--muted); font-size: 12px; margin: 0; text-transform: none; }
.login-error { padding: 10px; margin-bottom: 16px; border-radius: var(--radius-sm); background: var(--red-soft); color: var(--red); font-size: 12px; text-align: center; }

.handoff-card { padding: 18px; border: 1px solid var(--amber); border-radius: var(--radius); background: var(--amber-soft); box-shadow: var(--shadow); margin-bottom: 18px; }
.handoff-head { display: flex; justify-content: space-between; align-items: start; margin-bottom: 12px; }
.handoff-title { font-size: 14px; font-weight: 700; color: var(--ink); margin: 0 0 4px; }
.handoff-summary { font-size: 12px; color: var(--amber); margin: 0; }
.handoff-chat { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; padding: 12px; background: #fff; border-radius: var(--radius-sm); border: 1px solid #edc989; }
.handoff-message { font-size: 11px; line-height: 1.4; padding: 8px; border-radius: 8px; max-width: 85%; }
.handoff-message.in { background: var(--bg); align-self: flex-start; }
.handoff-message.out { background: var(--green-soft); color: var(--green); align-self: flex-end; }
.handoff-action { font-size: 12px; font-weight: 650; color: #6f430d; margin: 12px 0; }

.notes-panel { display: flex; flex-direction: column; gap: 12px; }
.note-card { padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.note-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.note-author { font-size: 11px; font-weight: 650; color: var(--ink); }
.note-time { font-size: 9px; color: var(--muted); }
.note-text { font-size: 11px; color: var(--muted); line-height: 1.4; margin: 0; }
.note-struct { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 10px; color: #514f4a; }
.note-form { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-soft); }

.audio-recorder { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; margin-bottom: 12px; }
.audio-recorder .btn.recording { background: var(--red-soft); color: var(--red); border-color: var(--red); animation: pulse 2s infinite; }
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.6; } 100% { opacity: 1; } }

@media (max-width: 1180px) {
  :root { --sidebar-width: 218px; }
  .workspace { padding-inline: 20px; }
  .today-grid { grid-template-columns: 1fr; }
  .stock-grid { grid-template-columns: repeat(2, minmax(240px, 1fr)); }
  .lead-layout { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 900px) {
  .app { display: block; }
  .sidebar { display: none; }
  .topbar { grid-template-columns: minmax(0, 1fr) auto; padding: 11px 16px; }
  .topbar .search-wrap { grid-column: 1 / -1; grid-row: 2; }
  .profile-copy { display: none; }
  .workspace { padding: 18px 16px 92px; }
  .mobile-nav { position: fixed; right: 0; bottom: 0; left: 0; z-index: 80; display: grid; grid-template-columns: repeat(5, 1fr); min-height: 66px; padding: 6px max(8px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); border-top: 1px solid #2b2b2e; background: #111113; }
  .mobile-nav button { display: grid; place-items: center; align-content: center; gap: 4px; border: 0; border-radius: 8px; background: transparent; color: #8f8e91; cursor: pointer; font-size: 9px; font-weight: 600; }
  .mobile-nav button.active { color: #e0bd85; }
  .mobile-nav .lucide { width: 18px; height: 18px; }
  .mobile-more { position: fixed; right: 12px; bottom: 74px; z-index: 79; width: 210px; padding: 7px; border: 1px solid #343438; border-radius: 12px; background: #19191b; box-shadow: 0 18px 50px rgba(17,17,19,.32); }
  .mobile-more.open { display: grid; }
  .mobile-more button, .mobile-more select { width: 100%; min-height: 39px; border: 0; border-radius: 7px; background: transparent; color: #e8e4da; padding: 8px 10px; text-align: left; font-size: 11px; }
  .mobile-more button:hover { background: #252528; }
  .kpi-grid, .metric-kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid .kpi-card:last-child { grid-column: 1 / -1; }
  .lead-layout, .metrics-grid { grid-template-columns: 1fr; }
  .calendar-today-view { grid-template-columns: 1fr; }
  .side-stack { position: static; }
}
@media (max-width: 640px) {
  .page-title { font-size: 17px; }
  .page-subtitle { display: none; }
  .topbar { min-height: 62px; }
  .search-input { height: 38px; }
  .welcome-row { align-items: start; margin-bottom: 14px; }
  .welcome-row h2 { font-size: 22px; }
  .date-label { display: none; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .kpi-grid .kpi-card:last-child { grid-column: 1 / -1; }
  .kpi-card { min-height: 82px; padding: 12px; }
  .kpi-icon { width: 34px; height: 34px; }
  .kpi-card strong { font-size: 21px; }
  .today-grid { gap: 10px; }
  .panel-header { padding: 12px 14px; }
  .panel-body { padding: 12px; }
  .priority-card { grid-template-columns: 4px minmax(0, 1fr); }
  .priority-actions { grid-column: 2; justify-content: flex-start; }
  .value-strip { grid-template-columns: 1fr; }
  .value-item { border-right: 0; border-bottom: 1px solid var(--line); }
  .value-item:last-child { border-bottom: 0; }
  .desktop-table { display: none; }
  .mobile-list { display: grid; gap: 9px; }
  .stock-grid, .metric-kpis { grid-template-columns: 1fr; }
  .metric-kpis { gap: 8px; }
  .metric-card { display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 12px 14px; }
  .metric-card strong { grid-row: 1 / span 2; grid-column: 2; margin: 0; }
  .metric-card small { margin-top: 3px; }
  .calendar-desktop { display: none; }
  .agenda-mobile { display: grid; gap: 9px; }
  .calendar-toolbar { align-items: flex-start; flex-direction: column; }
  .lead-summary-header { align-items: flex-start; flex-direction: column; }
  .lead-summary-header > .btn { width: 100%; }
  .chat { min-height: 300px; max-height: 390px; padding: 13px; }
  .bubble { max-width: 88%; }
  .composer-actions { align-items: stretch; flex-direction: column; }
  .composer-actions > div { display: grid; grid-template-columns: 1fr 1fr; }
  .action-grid { grid-template-columns: 1fr; }
  .action-grid .wide { grid-column: auto; }
  .view-head { align-items: flex-start; flex-direction: column; }
  .view-head .btn { width: 100%; }
  .toast { right: 12px; bottom: 80px; left: 12px; max-width: none; }
  .form-grid, .check-grid, .vehicle-detail-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; } }
