:root {
  color-scheme: light;
  --ink:#211831; --muted:#635c71; --purple:#57217d; --purple-dark:#36154f;
  --teal:#097c82; --border:#e8e2ef; --page:#f7f6fa; --white:#fff; --soft:#f1e9f8;
  --shadow:0 2px 8px #27173307; --sidebar:252px;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif; color:var(--ink); background:var(--page);
  font-synthesis:none; text-rendering:optimizeLegibility;
}
* { box-sizing:border-box; }
body { margin:0; font-size:1rem; }
svg { width:1.25rem; height:1.25rem; display:block; flex:none; }
a { color:var(--purple); text-decoration:none; }
button,input,select,textarea { font:inherit; }
button,a,input,select,textarea { -webkit-tap-highlight-color:transparent; }
button { cursor:pointer; }
button:disabled { cursor:default; opacity:.55; }
:focus-visible { outline:3px solid #13878b; outline-offset:3px; }
h1,h2,h3,p { margin:0; }
h1 { font-size:clamp(1.65rem,3vw,2.28rem); font-weight:750; letter-spacing:-.045em; line-height:1.12; }
h2 { font-size:1.17rem; letter-spacing:-.025em; line-height:1.25; }
h3 { font-size:1rem; }
strong { font-weight:690; }
small,.muted { color:var(--muted); }
small { font-size:.82rem; }
.initial { margin:32px; }
.skip { position:fixed; z-index:15; background:white; padding:12px; transform:translateY(-150%); }
.skip:focus { transform:none; }
.brand { display:flex; align-items:center; gap:10px; color:var(--purple-dark); }
.brand img { width:45px; height:35px; object-fit:contain; }
.brand b { font-size:1.28rem; letter-spacing:-.05em; line-height:1; display:block; }
.brand small { color:#5c5270; display:block; margin-top:4px; font-size:.72rem; }
.login { min-height:100svh; display:grid; grid-template-columns:1.05fr .95fr; background:#fff; }
.login-photo { background:#49236b; position:relative; min-height:100svh; overflow:hidden; }
.login-photo img { width:100%; height:100%; position:absolute; object-fit:cover; object-position:center 35%; }
.login-photo::after { content:""; position:absolute; inset:0; background:linear-gradient(180deg,#24133220 42%,#271235eb); }
.login-copy { position:absolute; z-index:1; bottom:8%; left:8%; right:8%; color:white; }
.login-copy h2 { max-width:520px; font-size:clamp(2rem,5.2vw,4.55rem); line-height:1; letter-spacing:-.065em; }
.login-copy p { margin-top:16px; color:#f2e7fa; }
.login-main { display:flex; justify-content:center; align-items:center; padding:40px; }
.login-box { width:min(100%,410px); }
.login-box .brand { margin-bottom:56px; }
.login-box h1 { margin-bottom:10px; }
.login-box form { margin-top:30px; display:grid; gap:18px; }
.login-box .checkline { font-size:.88rem; justify-content:space-between; }
.login-box .footer-note { margin-top:35px; font-size:.82rem; color:var(--muted); }
.field { display:grid; gap:7px; min-width:0; font-size:.88rem; font-weight:620; }
.field em { font-style:normal; color:var(--muted); font-weight:400; }
input:not([type=checkbox]), select, textarea {
  width:100%; min-width:0; min-height:43px; padding:9px 11px; border:1px solid #dcd3e6; border-radius:9px;
  color:var(--ink); background:#fff; font-size:.92rem;
}
textarea { resize:vertical; min-height:93px; }
input[type=checkbox] { accent-color:var(--purple); width:17px; height:17px; margin:0; }
.checkline,.check { display:flex; align-items:center; gap:8px; }
.btn,.icon-button {
  display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:42px;
  border-radius:9px; border:1px solid transparent; font-weight:650; font-size:.88rem; padding:9px 14px;
  color:var(--purple); background:#f0e9f7; text-align:center;
}
.btn:hover,.icon-button:hover { filter:brightness(.965); }
.btn.primary { background:var(--purple); color:white; }
.btn.white { background:white; color:var(--purple-dark); }
.btn.outline,.icon-button { background:white; border-color:var(--border); color:var(--ink); }
.btn.whatsapp { color:#08735a; background:#e5f5ef; }
.btn.danger { color:#912e52; background:#f9e7ed; }
.btn.link { padding-inline:0; min-height:32px; background:none; }
.icon-button { padding:0; width:42px; flex:none; }
.btn svg,.icon-button svg { width:18px; height:18px; }
.link-button { background:none; padding:0; border:0; color:var(--purple); font-weight:650; text-align:left; }
.shell { display:grid; grid-template-columns:var(--sidebar) minmax(0,1fr); min-height:100svh; }
.sidebar { position:sticky; top:0; height:100svh; display:flex; flex-direction:column; background:white; border-right:1px solid var(--border); padding:26px 17px 17px; z-index:4; }
.sidebar .brand { margin:0 8px 41px; }
.navigation { display:grid; gap:5px; }
.nav-link { display:flex; gap:12px; align-items:center; min-height:45px; padding:10px 12px; border-radius:8px; color:#52495f; font-size:.9rem; line-height:1.25; font-weight:580; }
.nav-link:hover { background:#f9f6fb; }
.nav-link[aria-current=page] { background:#efe6f8; color:#542075; font-weight:700; }
.role-legend { margin-top:auto; border-top:1px solid var(--border); padding:17px 7px 0; display:flex; gap:10px; color:#514466; align-items:center; font-size:.8rem; }
.role-legend svg { color:#7a598e; }
.workspace { min-width:0; }
.topbar { position:sticky; top:0; z-index:3; min-height:66px; display:flex; align-items:center; justify-content:space-between; gap:16px; padding:0 clamp(17px,3vw,42px); border-bottom:1px solid var(--border); background:#fff; }
.topbar > span { color:#50465e; font-size:.91rem; font-weight:630; }
.topbar .actions { gap:10px; flex-wrap:nowrap; }
.topbar .icon-button { width:39px; min-height:39px; position:relative; }
.alert-dot { width:8px; height:8px; border-radius:50%; background:var(--teal); position:absolute; top:7px; right:7px; border:1px solid white; }
.avatar { display:grid; place-items:center; width:36px; height:36px; border-radius:50%; background:#efe6f7; color:var(--purple); font-size:.77rem; font-weight:800; flex:none; }
.profile-btn { display:flex; align-items:center; gap:9px; border:0; background:transparent; color:var(--ink); padding:0; font-size:.85rem; font-weight:650; text-align:left; }
.mobile-toggle,.mobile-nav { display:none; }
.content { max-width:1530px; padding:29px clamp(17px,3vw,42px) 50px; margin:auto; }
.page-head { display:flex; align-items:end; justify-content:space-between; gap:16px; margin-bottom:21px; }
.page-head p { margin-top:8px; color:var(--muted); font-size:.93rem; line-height:1.5; }
.hero { position:relative; isolation:isolate; overflow:hidden; color:white; min-height:173px; border-radius:17px;
  display:flex; align-items:center; padding:27px clamp(22px,3vw,35px); background:linear-gradient(108deg,#432065,#65298d 66%,#74349a); margin-bottom:23px; }
.hero h1 { font-size:clamp(1.75rem,3.1vw,2.52rem); }
.hero p { margin-top:9px; color:#f0e4f7; line-height:1.4; font-size:.95rem; }
.hero .btn { margin-top:17px; min-height:36px; }
.hero-shapes,.hero-shapes::before,.hero-shapes::after { border:1px solid #f1dbff4d; position:absolute; border-radius:50%; }
.hero-shapes { z-index:-1; width:393px; height:360px; right:-79px; bottom:-215px; background:#cab0ec1a; }
.hero-shapes::before { content:""; width:330px; height:305px; top:-102px; right:31px; background:#cba8f014; }
.hero-shapes::after { content:""; width:175px; height:160px; top:-40px; right:170px; background:#80c4cb33; border-color:#abf2ea50; }
.overview-bar { display:flex; align-items:center; justify-content:space-between; gap:14px; margin:0 0 13px; }
.period { display:flex; flex-wrap:wrap; align-items:center; gap:7px; }
.period select,.period input { min-height:38px; width:auto; max-width:100%; font-size:.86rem; }
.period .btn { min-height:38px; }
.kpis { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-bottom:16px; }
.panel { background:#fff; border:1px solid var(--border); border-radius:13px; box-shadow:var(--shadow); min-width:0; }
.kpi { padding:15px 16px 14px; min-height:119px; }
.kpi-icon { width:36px; height:36px; border-radius:9px; background:#f0e7f7; color:var(--purple); display:grid; place-items:center; margin-bottom:9px; }
.kpi-icon.teal { background:#e0f4f0; color:#097775; }
.kpi-icon.blue { background:#e8eefb; color:#405ea2; }
.kpi-icon.amber { background:#f8eddf; color:#9a6025; }
.kpi span { display:block; color:#5d5469; font-size:.85rem; }
.kpi strong { display:block; font-size:1.72rem; margin-top:4px; line-height:1.06; letter-spacing:-.045em; overflow-wrap:anywhere; }
.kpi strong.unavailable { font-size:.93rem; letter-spacing:0; margin-top:7px; color:#645871; }
.grid-split { display:grid; grid-template-columns:minmax(0,1.65fr) minmax(0,1fr); gap:15px; margin-bottom:15px; }
.grid-even { grid-template-columns:repeat(2,minmax(0,1fr)); }
.panel-body { padding:18px; }
.panel-head { display:flex; align-items:start; justify-content:space-between; gap:9px; margin-bottom:14px; }
.panel-head p { margin-top:5px; font-size:.85rem; color:var(--muted); }
.chart { width:100%; height:auto; min-height:157px; overflow:visible; }
.chart text { fill:#675e74; font:11px system-ui,sans-serif; }
.chart .grid { stroke:#eae6ef; stroke-width:1; }
.chart .line { fill:none; stroke:#703b97; stroke-width:2.4; vector-effect:non-scaling-stroke; }
.chart .prior { fill:none; stroke:#12868b; stroke-dasharray:6 5; stroke-width:2; vector-effect:non-scaling-stroke; }
.chart-note { color:var(--muted); font-size:.8rem; margin-top:3px; }
.bar-list { list-style:none; margin:0; padding:0; display:grid; gap:13px; }
.bar-list li { display:grid; gap:6px; }
.bar-title { display:flex; justify-content:space-between; gap:8px; color:#51455f; font-size:.87rem; }
progress { border:0; height:7px; border-radius:8px; width:100%; display:block; background:#f1ecf4; overflow:hidden; }
progress::-webkit-progress-bar { background:#f1ecf4; }
progress::-webkit-progress-value { background:#7845a0; border-radius:8px; }
progress::-moz-progress-bar { background:#7845a0; border-radius:8px; }
.bar-list li:nth-child(3n+2) progress::-webkit-progress-value { background:#169198; }
.bar-list li:nth-child(3n+2) progress::-moz-progress-bar { background:#169198; }
.bar-list li:nth-child(3n+3) progress::-webkit-progress-value { background:#aa76b8; }
.bar-list li:nth-child(3n+3) progress::-moz-progress-bar { background:#aa76b8; }
.empty { text-align:center; padding:28px 18px; color:#645a70; font-size:.9rem; line-height:1.45; }
.empty .kpi-icon { margin:0 auto 10px; }
.empty strong { display:block; margin-bottom:4px; color:var(--ink); }
.table-wrap { overflow:auto; }
table { width:100%; border-collapse:collapse; text-align:left; font-size:.875rem; }
th { color:#60566c; background:#f8f6fa; font-weight:680; white-space:nowrap; }
th,td { padding:11px 12px; border-bottom:1px solid #eee9f2; vertical-align:middle; }
td { overflow-wrap:anywhere; }
tr:last-child td { border-bottom:0; }
.table-name { font-weight:680; }
.table-name small { display:block; margin-top:3px; font-weight:400; }
.wide .btn { min-height:37px; padding:6px 8px; }
.tag { border-radius:99px; display:inline-block; background:#eee6f7; color:#5b287f; padding:4px 8px; font-size:.79rem; font-weight:650; line-height:1.28; }
.tag.teal { background:#dbf2ec; color:#096156; }
.tag.blue { background:#e6edfb; color:#315390; }
.tag.amber { background:#fcf0d9; color:#805616; }
.tag.gray { background:#edf0f3; color:#48515a; }
.actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.stack { display:grid; gap:15px; align-content:start; }
.filters { padding:15px; margin-bottom:15px; }
.filter-main,.filter-grid,.form-grid { display:grid; gap:12px; align-items:end; }
.filter-main { grid-template-columns:2fr 1.2fr 1.2fr auto; }
.filter-grid,.form-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.filter-grid { grid-template-columns:repeat(4,minmax(0,1fr)); padding-top:12px; }
.form-grid .full { grid-column:1/-1; }
details > summary { cursor:pointer; font-weight:650; color:var(--purple); font-size:.91rem; }
.filters details { margin-top:12px; }
.data-title { padding:14px 16px; display:flex; align-items:center; justify-content:space-between; gap:10px; }
.pagination { padding:13px; display:flex; align-items:center; justify-content:center; gap:12px; font-size:.86rem; }
.cards-mobile { display:none; }
.person-card { padding:13px; border-top:1px solid var(--border); display:grid; gap:9px; }
.person-card header { display:flex; justify-content:space-between; align-items:start; gap:8px; }
.person-card p { font-size:.86rem; color:var(--muted); line-height:1.4; }
.city-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.city-card header { display:flex; justify-content:space-between; gap:10px; align-items:start; }
.city-card dl,.facts { display:grid; grid-template-columns:1fr auto; gap:7px 12px; font-size:.88rem; margin:13px 0; }
.city-card dt,.facts dt { color:var(--muted); }
.city-card dd,.facts dd { margin:0; font-weight:650; }
.city-card .btn { margin-top:5px; }
.notice { border-radius:9px; background:#f2ecf8; color:#55386a; padding:12px 14px; font-size:.88rem; line-height:1.5; }
.notice.warn { background:#fcf1e0; color:#784f1b; }
.notice.error { background:#fae8ef; color:#852a50; }
.profile-grid { display:grid; grid-template-columns:minmax(0,1.25fr) minmax(0,1fr); gap:14px; }
.profile-grid .panel-head { border-bottom:1px solid var(--border); padding-bottom:10px; }
.profile-grid .facts { grid-template-columns:minmax(95px,.65fr) minmax(0,1fr); }
.profile-grid .facts dd { overflow-wrap:anywhere; }
.timeline { display:grid; gap:13px; list-style:none; padding:0; margin:0; }
.timeline li { border-left:2px solid #e6d9ef; padding-left:11px; font-size:.89rem; overflow-wrap:anywhere; }
.timeline li p { margin-top:4px; }
.timeline li details { margin-top:6px; }
.ad-image { width:52px; height:52px; object-fit:cover; border-radius:8px; background:#efe7f6; }
.ad-heading { display:flex; align-items:center; gap:9px; }
details.card-detail { padding:15px; background:white; border:1px solid var(--border); border-radius:12px; }
details.card-detail > :not(summary) { margin-top:13px; }
.setting-list { padding:0; margin:0; list-style:none; }
.setting-list li { display:flex; padding:8px 0; gap:10px; justify-content:space-between; align-items:center; border-bottom:1px solid var(--border); }
dialog { width:min(640px,calc(100% - 25px)); max-height:calc(100% - 25px); border:1px solid var(--border);
  border-radius:15px; padding:20px; color:var(--ink); background:#fff; box-shadow:0 15px 55px #28184134; }
dialog::backdrop { background:#21133165; }
.dialog-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:15px; }
dialog form { display:grid; gap:14px; }
.dialog-content { display:grid; gap:12px; }
.dialog-actions { display:flex; justify-content:end; gap:8px; flex-wrap:wrap; margin-top:5px; }
#toast { position:fixed; z-index:12; right:19px; bottom:19px; max-width:min(430px,calc(100% - 38px)); pointer-events:none; }
#toast:not(:empty) { color:#fff; background:#3c2550; border-radius:10px; padding:12px 16px; box-shadow:0 4px 25px #35184c45; }
@media(max-width:1120px) { :root{--sidebar:216px} .city-grid{grid-template-columns:repeat(2,minmax(0,1fr))} }
@media(max-width:850px) {
  .shell { display:block; } .sidebar { display:none; height:auto; position:fixed; inset:62px 0 auto; padding:12px 17px; box-shadow:0 15px 30px #17223b25; }
  .sidebar.open,.mobile-toggle { display:flex; } .sidebar .brand,.role-legend,.topbar .desktop-label { display:none; }
  .navigation { width:100%; } .topbar { min-height:62px; }
  .topbar .brand b { font-size:1.08rem; } .topbar .brand img { width:34px;height:29px; } .topbar .brand small { display:none; }
  .mobile-nav { display:grid; grid-template-columns:repeat(4,1fr); position:fixed; inset:auto 0 0; z-index:3;
    background:white; border-top:1px solid var(--border); padding:3px 6px max(3px,env(safe-area-inset-bottom)); }
  .mobile-nav .nav-link { display:flex; flex-direction:column; justify-content:center; gap:3px; padding:6px 2px; font-size:.72rem; text-align:center; }
  .content { padding-bottom:90px; } #toast { bottom:70px; }
}
@media(max-width:620px) {
  .login { display:flex; flex-direction:column-reverse; justify-content:start; }
  .login-photo { min-height:230px; max-height:290px; } .login-photo img { object-position:center 32%; }
  .login-copy h2 { font-size:1.6rem; } .login-copy p { display:none; } .login-main { padding:28px 22px 30px; }
  .login-box .brand { margin-bottom:27px; } .login-box form { margin-top:20px; }
  .profile-btn > span:not(.avatar) { display:none; }
  .page-head,.overview-bar { flex-wrap:wrap; align-items:flex-start; }
  .hero { min-height:152px; } .hero-shapes { right:-176px; }
  .kpis { grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
  .kpi { padding:12px; min-height:105px; }
  .grid-split,.profile-grid { grid-template-columns:1fr; }
  .filter-main,.filter-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .filter-main .search-field { grid-column:1/-1; }
  .city-grid { grid-template-columns:1fr; }
  .cards-mobile { display:block; }
  .table-wrap.desktop { display:none; }
  .content { padding-top:19px; }
  .form-grid .mobile-full { grid-column:1/-1; }
}
@media(prefers-reduced-motion:no-preference) {
  .btn,.nav-link { transition:background-color .15s ease,filter .15s ease; }
  dialog[open] { animation:arrive .15s ease-out; }
  @keyframes arrive { from { transform:translateY(6px); opacity:.65; } to { transform:translateY(0); opacity:1; } }
}
[hidden] { display:none !important; }
.demo-bar,.settings-nav { margin-bottom:16px; }
.login-box .notice { margin-top:14px; }
.city-card .kpi-icon,.ad-heading .kpi-icon { margin-bottom:0; flex:none; }
.table-name + small { display:block; margin-top:3px; }
.content > .actions:first-child { margin-bottom:13px; }
.content > .notice + .actions { margin-top:12px; }

.nowrap,.wide td .btn { white-space:nowrap; }
