:root {
  --bg: #f3f6fb;
  --bg-soft: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #162033;
  --text-soft: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --primary: #0f766e;
  --primary-dark: #0b5f59;
  --primary-soft: #ecfeff;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --amber: #b45309;
  --amber-soft: #fffbeb;
  --green: #15803d;
  --green-soft: #f0fdf4;
  --red: #b91c1c;
  --red-soft: #fef2f2;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 10px 30px rgba(15, 23, 42, 0.04);
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar: 252px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, select, input { font: inherit; }
a { color: inherit; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }

.app-shell { min-height: 100vh; }
.landing {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  background:
    radial-gradient(circle at top left, rgba(15,118,110,0.12), transparent 32%),
    radial-gradient(circle at bottom right, rgba(37,99,235,0.10), transparent 35%),
    var(--bg);
}
.landing-inner { max-width: 1120px; width: 100%; display: grid; gap: 28px; }
.brand-row { display: inline-flex; align-items: center; gap: 12px; }
.logo-mark {
  width: 38px; height: 38px; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--primary), #0891b2);
  box-shadow: 0 10px 22px rgba(15,118,110,0.20);
}
.logo-mark.blue { background: linear-gradient(135deg, #2563eb, #0f766e); }
.logo-mark.amber { background: linear-gradient(135deg, #b45309, #ea580c); }
.brand-title { font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.hero { text-align: center; max-width: 780px; margin: 0 auto; }
.hero h1 { margin: 18px 0 12px; font-size: clamp(30px, 5vw, 52px); line-height: 1.02; letter-spacing: -0.055em; }
.hero p { margin: 0; color: var(--muted); line-height: 1.7; font-size: 16px; }
.role-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.role-card {
  border: 1px solid var(--border); background: rgba(255,255,255,0.86);
  border-radius: 22px; padding: 24px; box-shadow: var(--shadow);
  cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.role-card:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: 0 18px 46px rgba(15, 23, 42, 0.10); }
.role-icon { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.role-icon.tc { color: var(--primary); background: var(--primary-soft); }
.role-icon.tr { color: var(--blue); background: var(--blue-soft); }
.role-icon.dr { color: var(--amber); background: #fff7ed; }
.role-card h3 { margin: 16px 0 8px; font-size: 18px; }
.role-card p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.role-card .enter { margin-top: 18px; font-size: 13px; font-weight: 800; }
.arch-card { background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 22px; box-shadow: var(--shadow); }
.arch-title { font-size: 12px; color: var(--muted); text-transform: uppercase; font-weight: 800; letter-spacing: .08em; margin-bottom: 14px; }
.arch-flow { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 13px; font-weight: 800; }
.arch-node { padding: 8px 13px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 999px; }
.arch-node.primary { color: var(--primary); background: var(--primary-soft); border-color: #b8f3ef; }
.arch-node.blue { color: var(--blue); background: var(--blue-soft); border-color: #bfdbfe; }
.arch-node.amber { color: var(--amber); background: #fff7ed; border-color: #fed7aa; }
.arrow { color: var(--muted-2); }

.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: #fff; border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 18px 14px; gap: 6px; position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }
.sidebar-logo { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; cursor: pointer; }
.sidebar-logo .small-mark { width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 800; background: var(--primary); }
.sidebar-logo .small-mark.blue { background: var(--blue); }
.sidebar-logo .small-mark.amber { background: var(--amber); }
.sidebar-logo strong { font-size: 15px; letter-spacing: -0.02em; }
.nav-btn { width: 100%; border: 0; background: transparent; color: #475569; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; cursor: pointer; font-weight: 750; text-align: left; font-size: 14px; }
.nav-btn:hover { background: var(--surface-soft); color: var(--text); }
.nav-btn.active.tc { background: var(--primary-soft); color: var(--primary); }
.nav-btn.active.tr { background: var(--blue-soft); color: var(--blue); }
.nav-btn.active.impact { background: #fff7ed; color: var(--amber); }
.nav-dot { width: 8px; height: 8px; border-radius: 3px; background: currentColor; opacity: .68; }
.nav-section-label { font-size: 10.5px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-2); padding: 16px 12px 6px; }
.nav-section-label.impact { color: var(--amber); }

.resonance-banner { border-radius: var(--radius); padding: 16px 18px; background: linear-gradient(135deg, #fff7ed, #fffbeb); border: 1px solid #fde68a; color: #7c2d12; font-size: 13.5px; line-height: 1.65; margin-bottom: 22px; }
.resonance-banner strong { color: #92400e; }
.resonance-tag { display: block; font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .07em; color: var(--amber); margin-bottom: 6px; }
.bar-row { margin-bottom: 14px; }
.bar-row:last-child { margin-bottom: 0; }
.bar-row-top { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 750; color: var(--text-soft); margin-bottom: 6px; }
.mini-bar-track { height: 8px; border-radius: 999px; overflow: hidden; background: #eef2f7; }
.mini-bar-fill { display: block; height: 100%; border-radius: 999px; }
.ontrip-row { display: flex; align-items: flex-start; gap: 14px; }
.ontrip-icon { width: 30px; height: 30px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 800; flex: 0 0 auto; }
.ontrip-payload { display: block; margin-top: 8px; background: #0f172a; color: #7dd3c0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; padding: 8px 10px; border-radius: 8px; overflow-x: auto; }
.whatsapp-bubble { margin-top: 12px; background: #dcf8c6; color: #1c2b1c; padding: 12px 14px; border-radius: 12px 12px 12px 2px; font-size: 13px; line-height: 1.55; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--border); padding: 14px 10px 4px; color: var(--muted); font-size: 13px; font-weight: 700; cursor: pointer; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 66px; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; position: sticky; top: 0; z-index: 4; }
.breadcrumb { color: var(--muted); font-size: 13px; }
.top-actions { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 13px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 12px; background: var(--primary); }
.avatar.blue { background: var(--blue); }
.content { padding: 28px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.page-title { margin: 0; font-size: 26px; letter-spacing: -0.035em; }
.page-subtitle { margin: 5px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.back-link { color: var(--primary); font-size: 13px; font-weight: 800; cursor: pointer; margin-bottom: 12px; display: inline-flex; }
.back-link.blue { color: var(--blue); }
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 18px; }
.section-title { color: var(--muted); font-size: 12px; font-weight: 850; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 12px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.kpi-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); }
.kpi-card.warn { border-color: #fde68a; }
.kpi-label { color: var(--muted); font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .07em; }
.kpi-value { font-size: 30px; line-height: 1; font-weight: 850; letter-spacing: -0.05em; margin-top: 9px; }
.kpi-note { color: var(--muted); font-size: 12px; margin-top: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.chip.small { font-size: 11px; padding: 3px 8px; }
.chip.primary { background: var(--primary-soft); color: var(--primary); }
.chip.blue { background: var(--blue-soft); color: var(--blue); }
.chip.amber { background: #fff7ed; color: var(--amber); }
.chip.green { background: var(--green-soft); color: var(--green); }
.chip.red { background: var(--red-soft); color: var(--red); }
.chip.slate { background: #f1f5f9; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: currentColor; }
.table-wrap { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th { text-align: left; padding: 11px 14px; color: var(--muted); font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border); background: #fff; }
td { padding: 13px 14px; border-bottom: 1px solid #f1f5f9; font-size: 13px; color: var(--text-soft); vertical-align: middle; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #fbfdff; }
td.clickable { cursor: pointer; }
td.clickable:hover { background: #fbfdff; text-decoration: underline; }
.td-main { font-weight: 800; color: var(--text); }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 14px 16px; }
select, input { border: 1px solid var(--border-strong); background: #fff; border-radius: 10px; padding: 8px 11px; color: var(--text-soft); font-size: 13px; }
.btn { border: 1px solid var(--border-strong); border-radius: 10px; padding: 10px 14px; background: #fff; color: var(--text-soft); font-size: 13px; font-weight: 850; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; justify-content: center; }
.btn:hover { background: var(--surface-soft); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.amber { background: var(--amber); border-color: var(--amber); color: #fff; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.block { width: 100%; }
.link { color: var(--primary); font-weight: 850; cursor: pointer; }
.link.blue { color: var(--blue); }
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid #f1f5f9; }
.list-row.clickable { cursor: pointer; }
.list-row.clickable:hover { background: #fbfdff; margin-left: -8px; margin-right: -8px; padding-left: 8px; padding-right: 8px; border-radius: 10px; }
.row-title { font-weight: 800; color: var(--text); font-size: 14px; }
.row-title.clickable { cursor: pointer; color: var(--primary); }
.row-title.clickable:hover { text-decoration: underline; }
.row-sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.map { min-height: 360px; border-radius: var(--radius); border: 1px solid var(--border); position: relative; overflow: hidden; background: #eaf0f7; }
.map::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 20% 25%, rgba(15,118,110,.13), transparent 18%), radial-gradient(circle at 72% 68%, rgba(37,99,235,.12), transparent 22%), repeating-linear-gradient(135deg, rgba(255,255,255,.38), rgba(255,255,255,.38) 10px, rgba(226,232,240,.48) 10px, rgba(226,232,240,.48) 20px); }
.map-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted-2); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; font-weight: 800; text-align: center; padding: 20px; }
.marker { position: absolute; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 6px rgba(15, 23, 42, .06); z-index: 2; }
.marker.teal { background: var(--primary); }
.marker.amber { background: var(--amber); }
.marker.blue { background: var(--blue); }
.timeline { display: flex; gap: 0; align-items: flex-start; overflow-x: auto; }
.timeline-item { min-width: 220px; flex: 1; padding-right: 18px; position: relative; }
.timeline-line { display: flex; align-items: center; gap: 8px; }
.timeline-dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; background: var(--primary); }
.timeline-bar { height: 2px; flex: 1; background: var(--border); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-label { color: var(--muted); font-size: 12px; font-weight: 750; margin-bottom: 4px; }
.field-value { color: var(--text); font-size: 14px; font-weight: 700; }
.alert { border-radius: var(--radius); padding: 14px 16px; line-height: 1.55; font-size: 13.5px; border: 1px solid var(--border); }
.alert.primary { background: var(--primary-soft); border-color: #99f6e4; color: var(--primary-dark); }
.alert.blue { background: var(--blue-soft); border-color: #bfdbfe; color: #1d4ed8; }
.alert.warn { background: var(--amber-soft); border-color: #fde68a; color: var(--amber); }
.alert.red { background: var(--red-soft); border-color: #fecaca; color: var(--red); }
.drop-zone { border: 1.5px dashed var(--border-strong); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--muted); background: var(--surface-soft); }
.progress { width: 126px; height: 8px; border-radius: 999px; overflow: hidden; background: #eef2f7; }
.progress > span { display: block; height: 100%; background: var(--primary); }

.phone-stage { min-height: 100vh; background: #0f172a; display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.phone { width: 100%; max-width: 404px; min-height: 730px; max-height: calc(100vh - 64px); background: #f8fafc; border-radius: 32px; overflow: hidden; box-shadow: 0 26px 70px rgba(0,0,0,.45); display: flex; flex-direction: column; }
.phone-top { background: #1e293b; color: #fff; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; }
.phone-tabs { display: flex; gap: 5px; padding: 8px; background: #fff; border-bottom: 1px solid var(--border); }
.phone-tab { flex: 1; border: 0; border-radius: 9px; padding: 9px 5px; font-size: 12px; font-weight: 850; color: var(--muted); background: transparent; cursor: pointer; }
.phone-tab.active { background: #1e293b; color: #fff; }
.phone-body { overflow: auto; padding: 20px; display: flex; flex-direction: column; gap: 15px; }
.route-card { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 16px; }
.route-point { display: flex; align-items: flex-start; gap: 10px; }
.route-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); margin-top: 5px; }
.route-dot.drop { background: var(--amber); }
.route-line { height: 18px; margin-left: 4px; border-left: 2px dashed var(--border-strong); }
.mobile-action-stack { display: flex; flex-direction: column; gap: 10px; }
.switch { width: 46px; height: 27px; border-radius: 999px; position: relative; background: var(--border-strong); transition: .18s ease; }
.switch.on { background: var(--primary); }
.switch span { width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25); position: absolute; top: 3px; left: 3px; transition: .18s ease; }
.switch.on span { left: 22px; }

.client-badge { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 800; background: #fff; border: 1px solid var(--border); padding: 7px 10px; border-radius: 999px; }
.compact { font-size: 12px; color: var(--muted); }
.hr { height: 1px; background: var(--border); margin: 12px 0; }

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .content { padding: 22px; }
  .role-grid { grid-template-columns: 1fr; }
}
@media (max-width: 840px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; overflow-x: auto; align-items: center; }
  .sidebar-logo { padding: 6px 8px; min-width: max-content; }
  .nav-btn { min-width: max-content; }
  .sidebar-foot { display: none; }
  .topbar { position: static; padding: 0 16px; }
  .content { padding: 16px; }
  .grid-4, .grid-3, .grid-2, .form-grid { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; }
  .map { min-height: 300px; }
}
@media (max-width: 520px) {
  .landing { padding: 28px 14px; }
  .arch-flow { align-items: flex-start; }
  .arrow { display: none; }
  .hero h1 { font-size: 32px; }
  .phone-stage { padding: 0; }
  .phone { max-height: none; min-height: 100vh; border-radius: 0; max-width: none; }
}
