:root {
  --red: #c93434;
  --red-dark: #a71f25;
  --red-soft: #f9e9e8;
  --ink: #1e2024;
  --muted: #73777f;
  --line: #e9e8e5;
  --paper: #fff;
  --canvas: #f5f4f1;
  --shadow: 0 14px 34px rgba(39, 30, 25, .08);
  --radius: 22px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

[hidden] { display: none !important; }

/* Brand welcome runs while session/data load; no artificial minimum loading time. */
body.boot-loading { overflow: hidden; }
.boot-effects { position: absolute; inset: 0; overflow: hidden; z-index: -1; pointer-events: none; }
.boot-screen { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; overflow: auto; padding: max(32px,env(safe-area-inset-top)) 24px max(68px,env(safe-area-inset-bottom)); box-sizing: border-box; background: #f7f5f1; color: var(--ink); isolation: isolate; transition: opacity .28s ease, transform .28s ease; }
.boot-screen.boot-finished { opacity: 0; transform: scale(1.025); pointer-events: none; }
.boot-glow { position: absolute; z-index: -1; width: 440px; height: 440px; border-radius: 50%; pointer-events: none; background: radial-gradient(circle,rgba(201,52,52,.1),transparent 68%); }
.boot-glow-one { top: -160px; right: -220px; }
.boot-glow-two { bottom: -170px; left: -220px; background: radial-gradient(circle,rgba(201,52,52,.06),transparent 68%); }
.boot-content { width: min(100%,460px); text-align: center; animation: boot-enter .6s ease-out both; }
.boot-logo { display: block; width: min(230px,65vw); height: auto; margin: 0 auto 22px; mix-blend-mode: multiply; }
.boot-label { display: inline-block; margin: 0 0 25px; padding: 7px 15px; border: 1px solid #e6cbc7; border-radius: 100px; color: var(--red-dark); font-size: 10px; font-weight: 800; letter-spacing: .24em; }
.boot-content h1 { margin: 0; font-size: clamp(30px,8vw,44px); line-height: 1.12; letter-spacing: -.045em; font-weight: 800; }
.boot-content h1 span { color: var(--red); }
.boot-description { max-width: 300px; margin: 17px auto 0; color: #696c73; font-size: 13px; line-height: 1.65; }
.boot-route { position: relative; margin: 28px auto 22px; max-width: 330px; }
.boot-route svg { display: block; width: 100%; height: auto; }
.boot-route-guide { stroke: #e7ded8; stroke-width: 2; stroke-dasharray: 4 7; }
.boot-route-line { stroke: var(--red); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: boot-draw 1.65s ease-in-out .1s forwards; }
.boot-route-node { fill: var(--red); stroke: #f7f5f1; stroke-width: 4; }
.boot-route-pulse { stroke: var(--red); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; animation: boot-pulse 1.8s ease-out infinite; }
.boot-route-caption { position: absolute; left: 80px; bottom: 0; color: #73777f; font-size: 10px; letter-spacing: .025em; }
.boot-status { display: flex; align-items: center; justify-content: center; gap: 9px; color: #666a72; font-size: 11px; min-height: 22px; }
.boot-status-dot { flex: 0 0 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--red); animation: boot-breathe 1.4s ease-in-out infinite; }
.boot-footer { position: absolute; bottom: max(22px,env(safe-area-inset-bottom)); left: 20px; right: 20px; text-align: center; color: #777a80; font-size: 8px; font-weight: 700; letter-spacing: .14em; }
#bootRetry { display: block; margin: 12px auto 0; padding: 8px; }
@keyframes boot-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes boot-draw { to { stroke-dashoffset: 0; } }
@keyframes boot-pulse { from { opacity: .7; transform: scale(.75); } to { opacity: 0; transform: scale(1.8); } }
@keyframes boot-breathe { 50% { opacity: .35; } }
@media (max-height: 640px) { .boot-logo { width: 170px; margin-bottom: 14px; } .boot-label { margin-bottom: 16px; } .boot-route { max-width: 260px; margin: 16px auto; } .boot-content h1 { font-size: 30px; } }
@media (prefers-reduced-motion: reduce) { .boot-screen { transition: none; } .boot-content, .boot-route-line, .boot-route-pulse, .boot-status-dot { animation: none; } .boot-route-line { stroke-dashoffset: 0; } .boot-route-pulse { opacity: .35; } }

/* Operational feedback, without changing the existing Macinfor identity. */
.sync-status { border: 1px solid #cbe5d6; border-radius: 100px; padding: 9px 13px; color: #246241; background: #edf7f1; font-size: 11px; font-weight: 750; cursor: pointer; white-space: nowrap; }
.sync-status[data-state="pending"], .sync-status[data-state="busy"] { color: #80520b; background: #fff5df; border-color: #ead7ac; }
.sync-status[data-state="error"] { color: #a71f25; background: #f9e9e8; border-color: #e8bdbb; }
.data-tools { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin: -10px 0 22px; font-size: 11px; color: #73777f; }
.mobile-account-button, .mobile-account-menu { display: none; }
button:disabled { opacity: .6; cursor: wait; }
button:focus-visible, [role="button"]:focus-visible, a:focus-visible { outline: 3px solid #c93434; outline-offset: 3px; }
.toast { pointer-events: none; max-width: calc(100vw - 32px); width: max-content; visibility: hidden; }
.toast.show { visibility: visible; }
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: 14px; }
  .top-actions { margin-left: auto; }
  .sync-status { padding: 8px 10px; font-size: 10px; }
  .mobile-account-button { display: grid; }
  .metrics-grid .metric-card:nth-child(2) { display: flex; }
  .metrics-grid .metric-card:nth-child(3) { display: none; }
  .mobile-account-menu { display: grid; position: fixed; z-index: 80; top: 76px; right: 17px; background: #fff; border: 1px solid #e9e8e5; box-shadow: 0 15px 40px rgba(0,0,0,.12); border-radius: 14px; padding: 8px; }
  .mobile-account-menu button { border: 0; background: transparent; padding: 14px; text-align: left; }
  .data-tools { font-size: 10px; margin-top: 0; }
  .visit-row { grid-template-columns: 45px minmax(0,1fr) auto; }
  .visit-row .visit-status { display: none; }
  .toast { bottom: calc(94px + env(safe-area-inset-bottom)); }
  input, select, textarea { font-size: 16px !important; }
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(201, 52, 52, .24); outline-offset: 2px; }
[data-icon] { display: inline-grid; place-items: center; flex: 0 0 auto; line-height: 0; vertical-align: middle; }
[data-icon] > svg, button > svg, a > svg { display: block; flex: 0 0 auto; aspect-ratio: 1; stroke-linecap: round; stroke-linejoin: round; }
[data-icon] > svg, button > svg, a > svg { height: auto; }
.nav-item > [data-icon], .icon-button > [data-icon], .metric-icon > [data-icon], .mobile-nav button > [data-icon] { width: 20px; height: 20px; display: grid; place-items: center; }
.mobile-nav button > [data-icon] { width: 24px; height: 24px; }
.mobile-nav button > [data-icon] > svg { width: 20px; height: 20px; }
.metric-icon svg { color: inherit; }
.app-shell { min-height: 100vh; }

.sidebar { position: fixed; inset: 0 auto 0 0; width: 236px; background: #fff; border-right: 1px solid var(--line); padding: 30px 20px 22px; display: flex; flex-direction: column; z-index: 20; }
.brand { padding: 0 12px 38px; }
.brand img { display: block; width: 172px; height: auto; }
.brand-product { display: block; margin: 8px 0 0 58px; color: #9b9b9b; letter-spacing: .28em; font-size: 9px; font-weight: 800; }
.side-nav { display: grid; gap: 7px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 14px; padding: 13px 15px; border-radius: 13px; background: transparent; color: #686b70; text-align: left; font-weight: 650; transition: .2s ease; }
.nav-item:hover { background: #faf5f4; color: var(--red); }
.nav-item.active { color: var(--red); background: var(--red-soft); }
.nav-item svg { width: 20px; }
.sidebar-footer { margin-top: auto; border-top: 1px solid var(--line); padding-top: 18px; }
.user-card { display: grid; grid-template-columns: 38px 1fr 16px; width: 100%; align-items: center; gap: 10px; padding: 8px; background: transparent; text-align: left; border-radius: 12px; }
.user-card:hover { background: #f7f6f4; }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 12px; font-weight: 800; }
.user-card strong, .user-card small { display: block; }
.user-card strong { font-size: 12px; }
.user-card small { margin-top: 3px; color: var(--muted); font-size: 10px; }

.main-content { position: relative; margin-left: 236px; padding: 34px clamp(28px, 4vw, 64px) 60px; min-height: 100vh; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.eyebrow { margin: 0 0 5px; color: #929397; font-size: 10px; line-height: 1.4; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.topbar h1 { margin: 0; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.04em; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.icon-button { flex: 0 0 auto; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); background: #fff; border-radius: 13px; display: grid; place-items: center; line-height: 1; }
.icon-button:hover { color: var(--red); border-color: #e8bdbb; }
.icon-button svg { width: 19px; }
.notification-button { position: relative; }
.notification-button i { position: absolute; right: 9px; top: 8px; width: 7px; height: 7px; background: var(--red); border: 2px solid #fff; border-radius: 50%; }
.notification-button i[hidden] { display: none; }
.notification-center { position: fixed; z-index: 70; top: 88px; right: clamp(28px, 4vw, 64px); width: min(380px, calc(100vw - 34px)); max-height: min(520px, calc(100vh - 110px)); overflow: auto; padding: 18px; border: 1px solid var(--line); border-radius: 19px; background: rgba(255,255,255,.98); box-shadow: 0 24px 70px rgba(35,28,25,.18); opacity: 0; visibility: hidden; transform: translateY(-8px); transition: .2s ease; }
.notification-center.open { opacity: 1; visibility: visible; transform: none; }
.notification-center-head { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 12px; }
.notification-center-head h3 { margin: 0; font-size: 18px; }
.notification-list { display: grid; }
.notification-item { width: 100%; display: grid; grid-template-columns: 37px 1fr auto; align-items: start; gap: 11px; padding: 13px 4px; border-top: 1px solid var(--line); background: transparent; text-align: left; }
.notification-item:hover { color: var(--red); }
.notification-item.unread::after { content: ""; width: 7px; height: 7px; margin-top: 6px; border-radius: 50%; background: var(--red); }
.notification-item-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: var(--red); background: var(--red-soft); }
.notification-item-icon svg { width: 17px; }
.notification-item strong, .notification-item span, .notification-item small { display: block; }
.notification-item strong { font-size: 11px; }
.notification-item span { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.notification-item small { margin-top: 5px; color: #a2a2a2; font-size: 8px; }
.notification-empty { padding: 28px 10px; color: var(--muted); text-align: center; font-size: 11px; }
.primary-button, .secondary-button, .hero-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 17px; border-radius: 12px; font-size: 13px; line-height: 1.15; font-weight: 750; }
.primary-button { color: #fff; background: var(--red); box-shadow: 0 7px 18px rgba(201, 52, 52, .2); }
.primary-button:hover { background: var(--red-dark); transform: translateY(-1px); }
.secondary-button { background: #fff; border: 1px solid var(--line); }
.secondary-button:hover { border-color: #d7b0ae; color: var(--red); }
.primary-button svg, .secondary-button svg, .hero-button svg { width: 17px; }

.view { display: none; animation: enter .25s ease both; }
.view.active { display: block; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }
.hero-card { min-height: 270px; overflow: hidden; position: relative; display: grid; grid-template-columns: 1.15fr .85fr; border-radius: 28px; color: #fff; background: linear-gradient(125deg, #9e2228 0%, #cc3535 58%, #df5142 100%); box-shadow: 0 20px 45px rgba(150, 29, 34, .22); }
.hero-card::before { content: ""; position: absolute; width: 340px; height: 340px; border: 70px solid rgba(255,255,255,.04); border-radius: 50%; right: -150px; top: -190px; }
.hero-copy { padding: 34px 40px; position: relative; z-index: 2; }
.status-chip { display: inline-flex; gap: 8px; align-items: center; padding: 7px 11px; border-radius: 100px; background: rgba(255,255,255,.14); font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.status-chip i { width: 7px; height: 7px; border-radius: 50%; background: #bff3cb; box-shadow: 0 0 0 4px rgba(191,243,203,.13); }
.hero-copy h2 { margin: 20px 0 12px; font-size: clamp(29px, 3.4vw, 44px); line-height: 1.03; letter-spacing: -.045em; }
.hero-copy p { margin: 0; color: rgba(255,255,255,.75); font-size: 13px; }
.hero-copy p strong { color: #fff; }
.hero-button { margin-top: 25px; background: #fff; color: var(--red-dark); }
.hero-button:hover { transform: translateY(-2px); box-shadow: 0 9px 25px rgba(74,16,18,.2); }
.route-visual { position: relative; min-height: 250px; overflow: hidden; pointer-events: none; }
.route-visual svg { position: absolute; inset: 15px -5px 0 auto; width: min(100%, 370px); }
.route-grid { position: absolute; inset: 0; opacity: .09; background-image: linear-gradient(rgba(255,255,255,.7) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.7) 1px, transparent 1px); background-size: 32px 32px; transform: skewX(-12deg) scale(1.2); }
.route-badge { position: absolute; top: 91px; left: 47%; padding: 10px 14px; border-radius: 12px; color: var(--ink); background: #fff; box-shadow: 0 8px 25px rgba(65,15,17,.16); }
.route-badge span, .route-badge strong { display: block; }
.route-badge span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .12em; }
.route-badge strong { margin-top: 2px; font-size: 14px; }

.metrics-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin: 18px 0; }
.metric-card { min-height: 112px; display: flex; align-items: center; gap: 15px; padding: 20px; background: #fff; border: 1px solid rgba(232,231,228,.8); border-radius: 18px; box-shadow: 0 5px 18px rgba(42,35,31,.035); }
.metric-icon { flex: 0 0 auto; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; background: #f2f1ee; }
.metric-icon.red { color: #fff; background: var(--red); }
.metric-icon.dark { color: #fff; background: var(--ink); }
.metric-icon.soft { color: var(--red); background: var(--red-soft); }
.metric-icon svg { width: 20px; }
.metric-card span, .metric-card strong, .metric-card small { display: block; }
.metric-card > div:last-child { width: 100%; }
.metric-card span { color: var(--muted); font-size: 11px; font-weight: 650; }
.metric-card .metric-icon > [data-icon] { display: grid; color: inherit; }
.metric-card strong { margin: 3px 0 2px; font-size: 26px; letter-spacing: -.04em; }
.metric-card small { color: #9a9a9a; font-size: 9px; }
.metric-card small.positive { color: #3b8e57; }
.metric-card-link { font: inherit; color: inherit; text-align: left; cursor: pointer; }
.metric-card-link > .metric-icon { display: grid; }
.metric-card-link .metric-card-content { flex: 1; color: inherit; }
.metric-card-link .metric-card-arrow { display: grid; flex: none; place-items: center; }
.metric-card-link:hover, .metric-card-link:focus-visible { border-color: #b52528; }
.metric-card-link:focus-visible { outline: 2px solid #b52528; outline-offset: 2px; }
.progress { height: 5px; margin-top: 7px; border-radius: 10px; background: #eceae7; overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: inherit; background: var(--red); }

.dashboard-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
.panel { background: #fff; border: 1px solid rgba(232,231,228,.85); border-radius: var(--radius); box-shadow: 0 7px 24px rgba(42,35,31,.045); }
.schedule-panel, .quick-panel, .agenda-list-panel, .chart-panel, .result-panel { padding: 23px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 15px; }
.panel-heading h3, .quick-panel h3 { margin: 0; font-size: 17px; letter-spacing: -.025em; }
.text-button { display: inline-flex; align-items: center; gap: 6px; padding: 6px; color: var(--red); background: transparent; font-size: 11px; font-weight: 750; }
.text-button svg { width: 14px; }
.visit-list { display: grid; }
.visit-row { display: grid; grid-template-columns: 52px 1fr auto; gap: 14px; align-items: center; padding: 14px 4px; border-top: 1px solid var(--line); }
.visit-time { font-size: 12px; font-weight: 800; }
.visit-time small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 500; }
.visit-client { display: flex; align-items: center; min-width: 0; gap: 11px; }
.client-mark { flex: 0 0 auto; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--red); background: var(--red-soft); font-size: 10px; font-weight: 850; }
.visit-badge { flex: 0 0 42px; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; border: 1px solid rgba(201,52,52,.12); box-shadow: inset 0 1px 0 rgba(255,255,255,.8),0 3px 8px rgba(46,34,30,.04); }
.visit-badge svg { display: block; width: 23px; height: 23px; }
.visit-badge-scheduled { color: #b82b31; background: linear-gradient(145deg,#fff5f2,#f8e2df); }
.visit-badge-recorded { color: #287566; border-color: #d5e9e1; background: linear-gradient(145deg,#f4fcf8,#e0f0e9); }
.agenda-scope { display: flex; gap: 5px; padding: 5px; margin-bottom: 22px; width: fit-content; max-width: 100%; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.agenda-scope button { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; min-height: 44px; border-radius: 10px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 750; }
.agenda-scope button[aria-pressed="true"] { color: var(--red-dark); background: var(--red-soft); }
.agenda-scope svg { width: 18px; height: 18px; }
.agenda-date-heading { margin: 22px 0 6px; padding: 8px 0; color: var(--red-dark); font-size: 12px; text-transform: capitalize; border-bottom: 1px solid var(--line); }
.agenda-date-heading:first-child { margin-top: 0; }
@media (max-width: 760px) { .agenda-scope { width: 100%; } .agenda-scope button { flex: 1; padding: 10px 8px; } }
.visit-client > div:last-child { min-width: 0; }
.visit-client strong, .visit-client span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.visit-client strong { font-size: 12px; }
.visit-client span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.visit-status { padding: 5px 8px; border-radius: 100px; background: #f3f2ef; color: #727272; font-size: 9px; font-weight: 750; }
.visit-status.next { background: var(--red-soft); color: var(--red); }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-grid > button { min-height: 112px; display: flex; flex-direction: column; align-items: flex-start; padding: 14px; text-align: left; border: 1px solid var(--line); border-radius: 15px; background: #fff; transition: .2s ease; }
.quick-grid > button:hover { border-color: #e5b4b2; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(80,45,40,.07); }
.quick-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: #f1f0ed; color: #555; }
.quick-icon.red { color: #fff; background: var(--red); }
.quick-icon svg { width: 15px; }
.quick-grid strong { margin-top: 11px; font-size: 11px; }
.quick-grid small { margin-top: 3px; color: var(--muted); font-size: 9px; }

.section-tools { display: flex; gap: 12px; margin-bottom: 22px; }
.client-scope-filter { position: relative; display: grid; align-items: center; min-width: 160px; }
.client-scope-filter > span { position: absolute; top: -17px; left: 2px; font-size: 10px; color: var(--muted); }
.client-scope-filter select { min-height: 48px; width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 0 12px; background: #fff; color: var(--ink); font: inherit; font-size: 12px; }
.section-tools .search-field { min-width: 0; }
.client-grid > .history-empty { grid-column: 1 / -1; }
@media (max-width: 760px) { .client-scope-filter { margin-top: 9px; } }
.search-field { flex: 1; display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 16px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.search-field:focus-within { border-color: #dfaaa8; box-shadow: 0 0 0 3px rgba(201,52,52,.08); }
.search-field svg { width: 18px; color: var(--muted); }
.search-field input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; }
.results-meta { margin: -10px 2px 14px; color: var(--muted); font-size: 10px; }
.client-grid { display: grid; grid-template-columns: repeat(3, minmax(220px, 1fr)); gap: 15px; }
.client-card { padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 19px; transition: .2s ease; cursor: pointer; }
.client-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: transparent; }
.client-card-top { display: flex; align-items: flex-start; justify-content: space-between; }
.client-logo { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; color: var(--red); background: var(--red-soft); font-weight: 850; }
.client-card .icon-button { width: 34px; height: 34px; }
.client-card h3 { min-height: 38px; margin: 16px 0 5px; font-size: 15px; line-height: 1.28; }
.client-card p { min-height: 29px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.35; }
.client-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 19px; padding-top: 14px; border-top: 1px solid var(--line); }
.client-meta span { color: var(--muted); font-size: 9px; }
.client-meta strong { display: block; margin-top: 4px; color: var(--ink); font-size: 11px; }
.client-assignment { display: grid; gap: 8px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.client-assignment-status { font-size: 11px; color: var(--muted); }
.client-assignment-status.is-assigned { color: #246241; font-weight: 750; }
.client-assignment-button { width: 100%; min-height: 44px; }
.client-assignment-button:disabled { opacity: .55; cursor: wait; }
.push-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.notification-card > .push-actions { grid-column: 1 / -1; min-width: 0; }
.notification-card .push-actions button { white-space: normal; max-width: 100%; }
.push-actions button { min-height: 44px; }
.push-actions button:disabled { opacity: .55; cursor: wait; }
.client-code { display: inline-flex; margin-top: 10px; padding: 5px 8px; border-radius: 8px; color: var(--red); background: var(--red-soft); font-size: 9px; font-weight: 800; letter-spacing: .03em; }
.load-more { display: flex; margin: 18px auto 0; }
.load-more[hidden] { display: none; }
.client-detail-modal { max-width: 560px; }
.client-detail-identity { display: grid; grid-template-columns: 58px 1fr; align-items: center; gap: 14px; padding: 15px; border-radius: 15px; background: #f7f6f4; }
.client-logo.large { width: 50px; height: 50px; }
.client-detail-identity span, .client-detail-identity strong { display: block; }
.client-detail-identity span { color: var(--muted); font-size: 9px; }
.client-detail-identity strong { margin-top: 4px; font-size: 12px; }
.detail-list { display: grid; margin-top: 18px; border-top: 1px solid var(--line); }
.detail-row { display: grid; grid-template-columns: 40px 1fr; align-items: start; gap: 11px; padding: 16px 3px; border-bottom: 1px solid var(--line); }
.detail-icon { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 11px; color: var(--red); background: var(--red-soft); }
.detail-icon > [data-icon] { width: 20px; height: 20px; display: grid; place-items: center; }
.detail-icon svg { width: 17px; height: 17px; }
.detail-row small, .detail-row strong, .detail-row > div > span { display: block; }
.detail-row small { color: var(--muted); font-size: 9px; }
.detail-row strong { margin-top: 4px; font-size: 12px; line-height: 1.5; }
.verified-label { margin-top: 5px; color: #3d8956; font-size: 8px; font-weight: 750; }
.client-detail-actions { display: flex; gap: 9px; margin-top: 18px; }
.client-detail-actions > * { flex: 1; text-decoration: none; }
.client-detail-actions svg { width: 17px; }
.client-edit-form { display: grid; gap: 13px; margin-top: 18px; padding-top: 17px; border-top: 1px solid var(--line); }
.client-edit-form[hidden] { display: none; }
.client-edit-form label > span { display: block; margin-bottom: 7px; color: #595b60; font-size: 10px; font-weight: 750; }
.client-edit-form input { width: 100%; min-height: 46px; padding: 0 13px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: #fbfbfa; outline: 0; }
.client-edit-form input:focus { border-color: #dda6a4; background: #fff; box-shadow: 0 0 0 3px rgba(201,52,52,.08); }
.form-help { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.form-help svg { flex: 0 0 auto; width: 16px; color: var(--red); }
.client-empty-address { margin-top: 17px; padding: 14px; border-radius: 13px; color: #725b38; background: #fff7e8; }
.client-empty-address strong, .client-empty-address span { display: block; }
.client-empty-address strong { font-size: 10px; }
.client-empty-address span { margin-top: 4px; font-size: 9px; line-height: 1.5; }

.agenda-header { display: flex; justify-content: center; align-items: center; gap: 24px; margin: 15px 0 25px; text-align: center; }
.agenda-header h2 { margin: 0; font-size: 25px; }
.agenda-actions { display: flex; align-items: stretch; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.notification-card { flex: 1; display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px; min-height: 68px; padding: 10px 12px; border: 1px solid #ead6d4; border-radius: 16px; background: #fffafa; }
.notification-card.enabled { border-color: #cfe4d5; background: #f7fcf8; }
.notification-card-icon { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; color: var(--red); background: var(--red-soft); }
.notification-card.enabled .notification-card-icon { color: #2f7c49; background: #e5f4e9; }
.notification-card-icon svg { width: 18px; }
.notification-card strong, .notification-card small { display: block; }
.notification-card strong { font-size: 11px; }
.notification-card small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.notification-card .secondary-button { min-height: 37px; white-space: nowrap; }
.calendar-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 9px; margin-bottom: 18px; }
.calendar-day { width: 100%; padding: 16px 8px; border: 1px solid var(--line); border-radius: 15px; background: #fff; text-align: center; }
.calendar-day span, .calendar-day strong { display: block; }
.calendar-day span { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.calendar-day strong { margin-top: 8px; font-size: 17px; }
.calendar-day.active { color: #fff; background: var(--red); border-color: var(--red); box-shadow: 0 8px 22px rgba(201,52,52,.22); }
.calendar-day.active span { color: rgba(255,255,255,.7); }
.calendar-day:focus-visible { outline: 3px solid rgba(201,52,52,.24); outline-offset: 2px; }
.agenda-empty { display: grid; justify-items: center; gap: 7px; padding: 35px 15px; color: var(--muted); text-align: center; }
.agenda-empty-icon { width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 4px; border-radius: 13px; color: var(--red); background: var(--red-soft); }
.agenda-empty-icon svg { width: 20px; height: 20px; }
.agenda-empty strong { color: var(--ink); font-size: 12px; }
.agenda-empty > span:last-child { font-size: 10px; }
.count-badge { padding: 6px 9px; border-radius: 100px; color: var(--red); background: var(--red-soft); font-size: 9px; font-weight: 800; }

.activity-summary { display: grid; grid-template-columns: 1.4fr .6fr; gap: 18px; margin-bottom: 18px; }
.history-intro { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 4px 0 22px; }
.history-intro h2 { margin: 0; font-size: clamp(24px, 3vw, 32px); letter-spacing: -.04em; }
.history-intro p:not(.eyebrow) { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.user-chip { display: inline-flex; align-items: center; gap: 9px; padding: 8px 12px 8px 8px; border: 1px solid var(--line); border-radius: 14px; background: #fff; white-space: nowrap; }
.avatar.small { width: 32px; height: 32px; border-radius: 10px; font-size: 10px; }
.user-chip strong, .user-chip small { display: block; }
.user-chip strong { font-size: 11px; }
.user-chip small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.activity-chart-wrap { position: relative; min-height: 210px; padding-top: 18px; border-top: 1px solid var(--line); }
.activity-chart-wrap canvas { display: block; width: 100% !important; height: 210px !important; }
.bar-chart { height: 210px; display: flex; gap: 14px; align-items: flex-end; padding: 24px 8px 0; border-top: 1px solid var(--line); }
.activity-chart-wrap .bar-chart { border-top: 0; padding-top: 6px; }
.bar-item { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; }
.bar-item i { display: block; width: min(32px, 70%); min-height: 8px; border-radius: 7px 7px 3px 3px; background: #e8e5e1; transition: .4s ease; }
.bar-item.active i { background: var(--red); }
.bar-item span { color: var(--muted); font-size: 9px; }
.donut { width: 150px; height: 150px; margin: 20px auto; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--red) 0 68%, #eceae7 68% 100%); }
.donut::before { content: ""; grid-area: 1/1; width: 104px; height: 104px; border-radius: 50%; background: #fff; }
.donut div { grid-area: 1/1; z-index: 1; text-align: center; }
.donut strong, .donut span { display: block; }
.donut strong { font-size: 27px; }
.donut span { color: var(--muted); font-size: 9px; }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 12px; color: var(--muted); font-size: 9px; }
.legend span { white-space: nowrap; }
.legend b { color: var(--ink); font-weight: 800; }
.dot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: #ddd; }
.dot.red { background: var(--red); }.dot.amber { background: #d9a441; }.dot.dark { background: #73777f; }.dot.gray { background: #ddd; }
.activity-table { overflow: auto; }
.skip-link { position: fixed; z-index: 999; top: 12px; left: 12px; transform: translateY(-160%); padding: 11px 14px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 750; transition: transform .16s ease; }
.skip-link:focus { transform: translateY(0); outline: 3px solid #fff; outline-offset: 2px; }
.activity-record { min-width: 560px; display: grid; grid-template-columns: 1.2fr 1fr .7fr .6fr; gap: 14px; align-items: center; padding: 14px 4px; border-top: 1px solid var(--line); font-size: 11px; }
.activity-record strong { font-size: 12px; }
.activity-record span { color: var(--muted); }
.activity-client { min-width: 0; display: flex; align-items: flex-start; gap: 10px; }
.activity-client-copy { min-width: 0; flex: 1; }
.activity-client strong, .activity-client small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-client small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.visit-location { display: block; margin-top: 6px; font-size: 11px; line-height: 1.5; color: var(--muted); }
.visit-location .location-coordinates, .visit-location .location-accuracy { display: block; overflow-wrap: anywhere; }
.visit-location a { display: inline-block; color: var(--primary, #ad3434); font-weight: 700; text-decoration: underline; padding: 4px 0; }
.history-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(270px, .55fr); gap: 18px; }
.history-panel { min-width: 0; padding: 23px; }
.history-panel .activity-table { max-height: 570px; overflow: auto; }
.history-side { display: grid; align-content: start; gap: 18px; }
.assigned-panel, .ranking-panel { padding: 23px; }
.assigned-list, .ranking-list { display: grid; gap: 8px; }
.assigned-item, .ranking-item { display: grid; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.assigned-item { grid-template-columns: 34px minmax(0, 1fr); }
.assigned-item:first-child, .ranking-item:first-child { border-top: 0; }
.assigned-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--red); background: var(--red-soft); font-size: 9px; font-weight: 850; }
.assigned-copy, .ranking-copy { min-width: 0; }
.assigned-copy strong, .assigned-copy small, .ranking-copy strong, .ranking-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assigned-copy strong, .ranking-copy strong { font-size: 10px; }
.assigned-copy small, .ranking-copy small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.panel-note { margin: 13px 0 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; line-height: 1.45; }
.ranking-item { grid-template-columns: 25px minmax(0, 1fr) auto; }
.ranking-position { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 8px; color: var(--red); background: var(--red-soft); font-size: 10px; font-weight: 850; }
.ranking-count { color: var(--red); font-size: 9px; font-weight: 800; white-space: nowrap; }
.history-empty { padding: 28px 12px; color: var(--muted); text-align: center; font-size: 10px; line-height: 1.5; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(21,21,21,.52); backdrop-filter: blur(5px); opacity: 0; visibility: hidden; transition: .2s ease; }
.modal-backdrop.open { opacity: 1; visibility: visible; }
.modal { width: min(620px, 100%); max-height: calc(100vh - 30px); overflow: auto; padding: 27px; background: #fff; border-radius: 25px; box-shadow: 0 30px 80px rgba(0,0,0,.25); transform: translateY(12px) scale(.985); transition: .2s ease; }
.modal-backdrop.open .modal { transform: none; }
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 22px; }
.modal-header h2 { margin: 0; font-size: 25px; letter-spacing: -.035em; }
.modal form { display: grid; gap: 16px; }
.modal form > label > span, .form-row label > span { display: block; margin-bottom: 7px; color: #595b60; font-size: 10px; font-weight: 750; }
.modal input, .modal select, .modal textarea { width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 12px; color: var(--ink); background: #fbfbfa; outline: 0; }
.modal textarea { resize: vertical; }
.modal input:focus, .modal select:focus, .modal textarea:focus { border-color: #dda6a4; background: #fff; }
.client-picker-field { position: relative; z-index: 8; }
.client-picker { position: relative; }
.client-picker-control { min-height: 48px; display: grid; grid-template-columns: 19px 1fr; align-items: center; gap: 10px; padding: 0 13px; border: 1px solid var(--line); border-radius: 12px; background: #fbfbfa; transition: .18s ease; }
.client-picker-control:focus-within { border-color: #dda6a4; background: #fff; box-shadow: 0 0 0 3px rgba(201,52,52,.08); }
.client-picker.invalid .client-picker-control { border-color: var(--red); box-shadow: 0 0 0 3px rgba(201,52,52,.08); }
.client-picker-control [data-icon] { color: #8a8d93; }
.picker-scope-field select { min-height: 44px; background: #faf8f6; }
.client-picker-control svg { width: 18px; height: 18px; }
.modal .client-picker-control input { min-width: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.client-picker-results { position: absolute; z-index: 30; top: calc(100% + 7px); left: 0; right: 0; max-height: 284px; overflow: auto; padding: 6px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 18px 45px rgba(32,25,22,.16); }
.client-picker-option { width: 100%; min-height: 58px; display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 8px 9px; border-radius: 11px; background: transparent; text-align: left; }
.client-picker-option:hover, .client-picker-option:focus-visible, .client-picker-option.active { color: var(--red); background: #fff5f4; outline: 0; }
.client-picker-avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: var(--red); background: var(--red-soft); font-size: 10px; font-weight: 850; }
.client-picker-copy { min-width: 0; }
.client-picker-copy strong, .client-picker-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-picker-copy strong { font-size: 11px; }
.client-picker-copy small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.client-picker-code { padding: 5px 7px; border-radius: 7px; color: var(--red); background: var(--red-soft); font-size: 9px; font-weight: 800; white-space: nowrap; }
.client-picker-empty { padding: 22px 12px; color: var(--muted); text-align: center; font-size: 10px; line-height: 1.45; }
.modal form > label > span small { color: #999b9f; font-size: 9px; font-weight: 600; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.segment-control { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; padding: 4px; border-radius: 12px; background: #f1f0ed; }
.segment-control input { position: absolute; opacity: 0; pointer-events: none; }
.segment-control label { padding: 9px 5px; border-radius: 9px; text-align: center; color: var(--muted); font-size: 10px; font-weight: 700; cursor: pointer; }
.segment-control input:checked + label { color: var(--red); background: #fff; box-shadow: 0 2px 8px rgba(40,33,30,.08); }
.location-button { display: grid; grid-template-columns: 35px 1fr 17px; align-items: center; gap: 11px; padding: 12px; border: 1px dashed #d9b2b0; border-radius: 13px; color: var(--red); background: #fffafa; text-align: left; }
.location-button > [data-icon]:first-child { width: 35px; height: 35px; justify-self: center; }
.location-button > [data-icon]:first-child svg { width: 19px; height: 19px; }
.location-button > i[data-icon] { width: 17px; height: 17px; }
.location-button > i[data-icon] svg { width: 17px; height: 17px; }
.location-button strong, .location-button small { display: block; }
.location-button strong { font-size: 11px; }
.location-button small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.reminder-fieldset { display: grid; gap: 8px; margin: 0; padding: 13px; border: 1px solid var(--line); border-radius: 13px; }
.reminder-fieldset legend { padding: 0 6px; color: #595b60; font-size: 10px; font-weight: 750; }
.check-option { display: grid; grid-template-columns: 20px 1fr; align-items: center; gap: 10px; padding: 9px; border-radius: 10px; background: #f8f7f5; cursor: pointer; }
.check-option input { width: 17px !important; height: 17px; padding: 0 !important; accent-color: var(--red); }
.check-option span, .check-option strong, .check-option small { display: block; }
.check-option strong { font-size: 10px; }
.check-option small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.privacy-note { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 9px; }
.privacy-note svg { flex: 0 0 auto; width: 16px; color: var(--red); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 8px; }
.toast { position: fixed; left: 50%; bottom: 30px; z-index: 200; display: flex; align-items: center; gap: 10px; padding: 13px 17px; border-radius: 13px; color: #fff; background: #202225; box-shadow: 0 15px 40px rgba(0,0,0,.2); font-size: 11px; font-weight: 700; transform: translate(-50%, 80px); opacity: 0; transition: .25s ease; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast svg { width: 17px; color: #84d79e; }
.mobile-nav { display: none; }

@media (max-width: 1000px) {
  .sidebar { width: 210px; }
  .main-content { margin-left: 210px; padding: 28px; }
  .hero-card { grid-template-columns: 1.2fr .8fr; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .metric-card:last-child { grid-column: 1 / -1; }
  .dashboard-grid, .activity-summary { grid-template-columns: 1fr; }
  .client-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  body { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
  .sidebar { display: none; }
  .main-content { margin: 0; padding: 21px 17px 30px; }
  .topbar { margin-bottom: 22px; }
  .topbar .eyebrow { font-size: 9px; }
  .topbar h1 { font-size: 24px; line-height: 1.08; }
  .desktop-new { display: none; }
  .top-actions .icon-button:first-child { display: none; }
  .hero-card { display: block; min-height: 325px; border-radius: 23px; }
  .hero-copy { padding: 26px 24px; }
  .hero-copy h2 { font-size: 31px; }
  .route-visual { position: absolute; inset: 135px -20px -50px 36%; opacity: .8; }
  .route-badge { top: 91px; left: 45%; }
  .metrics-grid { grid-template-columns: 1fr 1fr; gap: 10px; overflow: hidden; }
  .metric-card { min-height: 103px; padding: 15px; gap: 10px; }
  .metric-card:nth-child(2) { display: none; }
  .metric-card:last-child { grid-column: auto; }
  .metric-icon { width: 36px; height: 36px; }
  .metric-card strong { font-size: 22px; }
  .schedule-panel, .quick-panel, .agenda-list-panel, .chart-panel, .result-panel { padding: 18px; }
  .dashboard-grid { display: flex; flex-direction: column; }
  .quick-panel { order: -1; }
  .quick-grid { grid-template-columns: repeat(4, minmax(105px, 1fr)); overflow-x: auto; padding-bottom: 3px; }
  .quick-grid > button { min-height: 105px; }
  .visit-row { grid-template-columns: 45px 1fr; }
  .visit-status { display: none; }
  .section-tools { flex-direction: column; }
  .client-grid { grid-template-columns: 1fr; }
  .client-card { padding: 18px; }
  .client-card h3 { min-height: 0; font-size: 14px; }
  .client-card p { min-height: 0; font-size: 10px; }
  .calendar-strip { gap: 5px; overflow: auto; }
  .calendar-day { min-width: 47px; padding: 13px 6px; }
  .activity-summary { grid-template-columns: 1fr; }
  .history-intro { align-items: flex-start; flex-direction: column; gap: 13px; }
  .history-grid { grid-template-columns: 1fr; }
  .history-panel, .assigned-panel, .ranking-panel { padding: 18px; }
  .history-panel .activity-table { max-height: none; }
  .history-panel .activity-record { min-width: 0; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; padding: 13px 2px; }
  .history-panel .activity-record > span:first-of-type { grid-column: 2; grid-row: 1; white-space: nowrap; }
  .history-panel .activity-record > span:nth-of-type(2) { grid-column: 1; grid-row: 2; font-size: 9px; }
  .history-panel .activity-record > span:nth-of-type(3) { grid-column: 2; grid-row: 2; }
  .history-panel .activity-client small { max-width: 170px; }
  .agenda-actions { flex-direction: column; }
  .notification-card { grid-template-columns: 38px 1fr; }
  .notification-card .secondary-button { grid-column: 1 / -1; width: 100%; }
  .notification-center { top: 73px; right: 17px; left: 17px; width: auto; }
  .mobile-nav { position: fixed; inset: auto 0 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; padding: 7px 8px calc(7px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); border-top: 1px solid var(--line); backdrop-filter: blur(12px); }
  .mobile-nav button { min-height: 48px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 3px; background: transparent; color: #919398; }
  .mobile-nav button.active { color: var(--red); }
  .mobile-nav svg { width: 19px; }
  .mobile-nav small { font-size: 8px; font-weight: 700; }
  .mobile-nav .mobile-create { width: 49px; height: 49px; min-height: 49px; justify-self: center; color: #fff; background: var(--red); border-radius: 16px; transform: translateY(-14px); box-shadow: 0 8px 20px rgba(201,52,52,.32); }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal { width: 100%; max-height: 92vh; border-radius: 25px 25px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); }
  .segment-control label { font-size: 9px; }
  .client-detail-actions { flex-direction: column; }
  .client-detail-actions > * { width: 100%; flex: auto; }
  .client-edit-form .modal-actions { position: sticky; bottom: 0; padding: 10px 0 0; background: #fff; }
}

@media (max-width: 390px) {
  .main-content { padding-right: 13px; padding-left: 13px; }
  .topbar h1 { font-size: 21px; }
  .hero-copy h2 { font-size: 27px; }
  .form-row { grid-template-columns: 1fr; }
  .segment-control { grid-template-columns: 1fr; }
  .segment-control label { min-height: 38px; display: grid; place-items: center; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions button { width: 100%; }
}

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

.assigned-summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -4px 0 7px; }
.assigned-progress { color: #3d8956; font-size: 9px; font-weight: 800; }
.assigned-item { grid-template-columns: 34px minmax(0, 1fr) auto; }
.assigned-status { padding: 4px 6px; border-radius: 7px; color: #a56b2c; background: #fff4df; font-size: 8px; font-weight: 800; white-space: nowrap; }
.assigned-item.visited .assigned-status { color: #3d8956; background: #eaf7ed; }
.unvisited-alert-option { display: grid; grid-template-columns: 19px 1fr; align-items: start; gap: 9px; margin-top: 14px; padding: 11px; border: 1px solid #ead6d4; border-radius: 12px; background: #fffafa; cursor: pointer; }
.unvisited-alert-option input { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--red); }
.unvisited-alert-option strong, .unvisited-alert-option small { display: block; }
.unvisited-alert-option strong { font-size: 10px; }
.unvisited-alert-option small { margin-top: 3px; color: var(--muted); font-size: 8px; line-height: 1.4; }
.assignment-modal { max-width: 650px; }
.modal-intro { margin: -8px 0 16px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.assignment-search { margin-bottom: 12px; }
.assignment-list { max-height: min(430px, 48vh); overflow: auto; display: grid; gap: 5px; padding: 4px; border: 1px solid var(--line); border-radius: 14px; }
.assignment-option { display: grid; grid-template-columns: 20px 34px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 8px; border-radius: 10px; cursor: pointer; }
.assignment-option:hover { background: #fff5f4; }
.assignment-option input { width: 17px; height: 17px; margin: 0; accent-color: var(--red); }
.assignment-copy { min-width: 0; }
.assignment-copy strong, .assignment-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assignment-copy strong { font-size: 10px; }
.assignment-copy small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.assignment-code { padding: 4px 6px; border-radius: 7px; color: var(--red); background: var(--red-soft); font-size: 8px; font-weight: 800; }
@media (max-width: 760px) { .assigned-item { grid-template-columns: 34px minmax(0, 1fr) auto; } .assigned-status { font-size: 7px; } .assignment-modal .modal-actions { position: sticky; bottom: 0; padding: 10px 0 0; background: #fff; } }

/* Microinteracciones: rápidas, discretas y optimizadas para móvil */
button { -webkit-tap-highlight-color: transparent; }
.modal .segment-control input { width: auto; }
.nav-item { transition: background .2s ease, color .2s ease, transform .2s ease; }
.nav-item:hover { transform: translateX(2px); }
.nav-item:active, .client-card:active, .quick-grid > button:active { transform: scale(.98); }
.icon-button { transition: color .2s ease, border-color .2s ease, background .2s ease, transform .2s ease, box-shadow .2s ease; }
.icon-button:hover { background: #fffafa; transform: translateY(-2px); box-shadow: 0 7px 16px rgba(75,35,30,.08); }
.icon-button:active { transform: scale(.94); }
.primary-button, .secondary-button, .hero-button { transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease; }
.primary-button:hover { box-shadow: 0 10px 24px rgba(201,52,52,.28); }
.primary-button:active, .secondary-button:active, .hero-button:active { transform: scale(.97); }
.notification-button i:not([hidden]) { animation: notificationPulse 1.8s ease-in-out infinite; }
.view.active { animation: enter .25s ease both; }
.metric-icon { transition: transform .25s ease, box-shadow .25s ease; }
.metric-card:hover .metric-icon { transform: scale(1.04); box-shadow: 0 7px 15px rgba(48,35,30,.12); }
.calendar-day { transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.calendar-day:hover { transform: translateY(-3px); border-color: #e5b4b2; box-shadow: 0 8px 18px rgba(80,45,40,.08); }
.client-picker-option, .activity-record, .assigned-item, .ranking-item { animation: itemIn .24s ease both; }
.client-picker-option:nth-child(2) { animation-delay: 25ms; }.client-picker-option:nth-child(3) { animation-delay: 50ms; }.client-picker-option:nth-child(4) { animation-delay: 75ms; }.client-picker-option:nth-child(5) { animation-delay: 100ms; }
.bar-item i { transform-origin: bottom; animation: barGrow .7s cubic-bezier(.2,.8,.2,1) both; }
.bar-item:nth-child(2) i { animation-delay: 70ms; }.bar-item:nth-child(3) i { animation-delay: 140ms; }.bar-item:nth-child(4) i { animation-delay: 210ms; }.bar-item:nth-child(5) i { animation-delay: 280ms; }.bar-item:nth-child(6) i { animation-delay: 350ms; }.bar-item:nth-child(7) i { animation-delay: 420ms; }
.donut { animation: donutIn .8s ease both; }
.donut::after { content: ""; grid-area: 1/1; width: 100%; height: 100%; border-radius: 50%; border: 2px solid rgba(201,52,52,.14); animation: donutPulse 2.8s ease-in-out infinite; }
.modal-backdrop { transition: opacity .22s ease, visibility .22s ease; }
.modal-backdrop.open .modal { animation: modalIn .28s cubic-bezier(.2,.8,.2,1) both; }
.location-button { transition: border-color .2s ease, background .2s ease, transform .2s ease; }
.location-button:hover { border-color: var(--red); background: #fff5f4; transform: translateY(-2px); }
.location-button.loading > [data-icon]:first-child svg { animation: spin .9s linear infinite; }
.toast.show { animation: toastIn .28s cubic-bezier(.2,.8,.2,1) both; }
.toast.show svg { animation: popIn .35s ease both; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes itemIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes notificationPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.28); } }
@keyframes barGrow { from { transform: scaleY(0); opacity: .2; } to { transform: scaleY(1); opacity: 1; } }
@keyframes donutIn { from { opacity: 0; transform: scale(.8) rotate(-35deg); } to { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes donutPulse { 0%, 100% { transform: scale(1); opacity: .4; } 50% { transform: scale(1.08); opacity: 0; } }

.delete-record { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: #fff; cursor: pointer; transition: .2s ease; }
.delete-record svg { width: 13px; height: 13px; }
.delete-record:hover, .delete-record:focus-visible { color: var(--red); border-color: rgba(201,52,52,.35); background: var(--red-soft); transform: translateY(-1px); }
.activity-meta { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }
.notification-head-actions { display: flex; align-items: center; gap: 10px; }
.danger-text { color: var(--red); }
.home-panels-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.home-info-panel { padding: 23px; }
.home-info-value { margin: 18px 0 6px; color: var(--ink); font-size: 24px; font-weight: 850; }
.home-client-list { display: grid; gap: 8px; }
.home-client-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.home-client-row:first-child { border-top: 0; }
.home-client-row > span:last-child { min-width: 0; }
.home-client-row strong, .home-client-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-client-row strong { font-size: 10px; }
.home-client-row small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.home-recent-panel { grid-column: 1 / -1; }
.sidebar-footer { position: relative; }
.profile-menu { position: absolute; z-index: 20; right: 0; bottom: 72px; width: 210px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 14px 35px rgba(30,25,25,.14); }
.profile-menu-name { display: grid; gap: 3px; padding: 4px 6px 10px; border-bottom: 1px solid var(--line); }
.profile-menu-name strong { font-size: 11px; }
.profile-menu-name small { color: var(--muted); font-size: 9px; }
.profile-menu-action { width: 100%; margin-top: 8px; padding: 10px 6px; border: 0; border-radius: 9px; color: var(--red); background: var(--red-soft); text-align: left; font-size: 10px; font-weight: 800; cursor: pointer; }
.logged-out-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 24px; background: var(--canvas); text-align: center; }
.logged-out-screen img { width: 190px; margin-bottom: 12px; }
.logged-out-screen h2 { margin: 0; }
.logged-out-screen p { margin: 0 0 10px; color: var(--muted); }
.login-form { width: min(100%, 330px); display: grid; gap: 14px; text-align: left; }
.login-form { padding: 24px; border: 1px solid rgba(201,52,52,.12); border-radius: 20px; background: rgba(255,255,255,.9); box-shadow: 0 18px 45px rgba(54,35,35,.1); }
.login-form label, .settings-panel form label { display: grid; gap: 7px; }
.login-form label > span, .settings-panel form label > span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .02em; }
.login-form input, .settings-panel form input, .settings-panel form select { min-height: 44px; padding: 0 13px; border: 1px solid #e2deda; border-radius: 11px; outline: 0; background: #fff; color: var(--ink); font: inherit; transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.settings-panel form input, .settings-panel form select { width: 100%; box-sizing: border-box; }
.login-form input:focus, .settings-panel form input:focus, .settings-panel form select:focus { border-color: var(--red); box-shadow: 0 0 0 4px rgba(201,52,52,.1); transform: translateY(-1px); }
.login-form .primary-button { justify-self: stretch; margin-top: 4px; }
.login-error { margin: 0 !important; color: var(--red) !important; font-size: 10px; }
.login-hint { color: var(--muted); font-size: 9px; }
.remember-session { display: flex !important; grid-template-columns: auto 1fr; align-items: start; gap: 8px !important; color: var(--muted); font-size: 10px; line-height: 1.35; }
.remember-session input { width: 16px; min-height: 16px; margin: 0; accent-color: var(--red); }
.legal-links { display: flex; justify-content: center; gap: 7px; color: var(--muted); font-size: 9px; }
.legal-links a, .legal-page a { color: var(--red); }
.legal-page { min-height: 100vh; margin: 0; padding: 28px 16px; box-sizing: border-box; background: var(--canvas); color: var(--ink); }
.legal-card { width: min(100%, 820px); margin: 0 auto; padding: clamp(22px, 5vw, 46px); box-sizing: border-box; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: 0 18px 45px rgba(54,35,35,.08); }
.legal-card h1 { margin: 0 0 8px; font-size: clamp(26px, 5vw, 40px); }
.legal-card h2 { margin: 30px 0 10px; font-size: 20px; }
.legal-card h3 { margin: 22px 0 7px; font-size: 14px; }
.legal-card p { color: #4d4643; font-size: 13px; line-height: 1.65; }
.legal-updated { color: var(--muted) !important; font-size: 11px !important; }
.legal-warning { padding: 13px 15px; border-radius: 10px; background: var(--red-soft); color: var(--ink) !important; }
.settings-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
.global-report-panel { margin-top: 18px; padding: 26px; }
.report-filters { display: grid; grid-template-columns: 1.2fr .8fr .8fr 1.4fr auto; gap: 12px; align-items: end; margin: 18px 0; }
.report-filters label { display: grid; gap: 7px; min-width: 0; }
.report-filters label > span { color: var(--muted); font-size: 10px; font-weight: 800; }
.report-filters input, .report-filters select { min-height: 42px; width: 100%; box-sizing: border-box; padding: 0 11px; border: 1px solid #e2deda; border-radius: 10px; background: #fff; color: var(--ink); font: inherit; }
.global-report-table-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
.global-report-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 10px; }
.global-report-table th { padding: 12px 9px 9px; color: var(--muted); text-align: left; font-size: 9px; text-transform: uppercase; letter-spacing: .04em; }
.global-report-table td { padding: 11px 9px; border-top: 1px solid var(--line); vertical-align: top; }
.global-report-table td:first-child { white-space: nowrap; font-weight: 800; }
.global-report-table .history-empty { padding: 24px 9px; text-align: center; color: var(--muted); }
.settings-panel { padding: 26px; }
.settings-panel, .settings-panel form, .settings-panel label { min-width: 0; }
.settings-panel form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 14px; margin-top: 20px; align-items: end; }
.settings-panel form .primary-button { grid-column: 1 / -1; justify-self: start; margin-top: 3px; }
.settings-panel form .primary-button { justify-self: start; margin-top: 4px; }
.user-list { display: grid; gap: 8px; }
.user-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.user-row:first-child { border-top: 0; }
.user-row > span:nth-child(2) { min-width: 0; }
.user-row strong, .user-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row strong { font-size: 10px; }
.user-row small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.user-row-actions { display: flex; align-items: center; gap: 12px; }
.agenda-list-panel .visit-row { grid-template-columns: 52px minmax(0, 1fr) auto auto; }
.agenda-list-panel .delete-record { justify-self: end; }
.activity-record { grid-template-columns: 1.2fr 1fr .7fr .6fr auto; }
@media (max-width: 760px) { .history-panel .activity-record { grid-template-columns: minmax(0,1fr) auto auto; } .history-panel .activity-record .delete-record { grid-column: 3; grid-row: 1; } }
@media (max-width: 760px) { .agenda-list-panel .visit-row { grid-template-columns: 45px minmax(0,1fr) auto; } .agenda-list-panel .visit-status { display: none; } }
@media (max-width: 760px) { .home-panels-grid { grid-template-columns: 1fr; gap: 12px; } .home-info-panel { padding: 18px; } .home-recent-panel { grid-column: auto; } }
@media (max-width: 760px) { .settings-grid { grid-template-columns: 1fr; } .settings-panel { padding: 18px; } .user-row { grid-template-columns: 34px minmax(0,1fr); } .user-row .text-button { grid-column: 2; justify-self: start; } }
@media (max-width: 1000px) { .settings-panel form { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .report-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } .report-filters .primary-button { width: 100%; } }
@media (max-width: 760px) { .settings-panel form { grid-template-columns: 1fr; gap: 13px; margin-top: 14px; } .settings-panel form .primary-button { grid-column: auto; width: 100%; } }
@media (max-width: 760px) { .global-report-panel { padding: 18px; } .report-filters { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .user-row-actions { grid-column: 2; flex-wrap: wrap; gap: 8px; } }
@keyframes modalIn { from { opacity: .4; transform: translateY(20px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastIn { from { transform: translate(-50%, 80px) scale(.96); } to { transform: translate(-50%, 0) scale(1); } }
@keyframes popIn { 0% { opacity: 0; transform: scale(.82); } 70% { transform: scale(1.04); } 100% { opacity: 1; transform: scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
  .mobile-nav button.active { animation: navIn .25s ease both; }
  .mobile-nav .mobile-create:hover { transform: translateY(-16px) scale(1.04); }
  .mobile-nav .mobile-create:active { transform: translateY(-14px) scale(.93); }
  @keyframes navIn { from { opacity: .35; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
}

.mobile-account-button { display: none; }
.data-tools-links { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.data-tools-links a { color: var(--red); font-weight: 750; }
.help-page li { color: #4d4643; font-size: 13px; line-height: 1.65; margin-bottom: 9px; }
.help-steps { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.help-steps section { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--canvas); }
.help-steps h3 { margin-top: 0; }
.help-steps p { margin-bottom: 0; }
.help-page a.primary-button { color: #fff; display: inline-flex; text-decoration: none; }
@media (max-width: 600px) { .help-steps { grid-template-columns: 1fr; } }
@media print { .help-page { background: #fff; padding: 0; } .help-page .legal-card { box-shadow: none; border: 0; width: 100%; padding: 0; } .help-page .primary-button, .help-page .legal-links { display: none; } .help-steps section { break-inside: avoid; } }
.visit-row { grid-template-columns: 60px minmax(0,1fr) auto 32px; }
.modal-backdrop { pointer-events: none; }
.modal-backdrop.open { pointer-events: auto; }
.report-filters { grid-template-columns: repeat(4, minmax(0,1fr)); }
.report-filters > button { min-height: 44px; }
.report-filters > button:disabled { opacity: .55; cursor: not-allowed; }
#globalReportSummary { margin-bottom: 16px; overflow-wrap: anywhere; }
.modal input[type="checkbox"] { width: 18px; min-height: 18px; accent-color: var(--red); }
@media (max-width: 760px) {
  .mobile-account-button { display: grid; }
  .report-filters { grid-template-columns: 1fr; }
  .visit-row { grid-template-columns: 45px minmax(0,1fr) auto; }
  .toast { bottom: calc(94px + env(safe-area-inset-bottom)); }
  .topbar h1 { overflow-wrap: anywhere; }
  .topbar > div:first-child { min-width: 0; }
}
