:root {
  --font-body: Inter, system-ui, sans-serif;
  --brand-navy: #142D50;
  --brand-primary: #2454B8;
  --brand-highlight: #B52C39;
  --brand-page: #F3F5F8;
  --brand-surface: #FFFFFF;
  --brand-text: #263345;
  --page: var(--brand-page);
  --surface: var(--brand-surface);
  --text: var(--brand-text);
  --muted: #4A5A70;
  --line: #DCE3ED;
  --accent: var(--brand-primary);
  --accent-bg: #EAF0FC;
  --backdrop: rgb(10 22 40 / 60%);
  color-scheme: light;
}

[data-dotas-theme="dark"] {
  --page: #0F1929;
  --surface: #18263C;
  --text: #F3F5F8;
  --muted: #BCC9DC;
  --line: #354660;
  --accent: #AFC7FF;
  --accent-bg: #243E69;
  --backdrop: rgb(3 8 17 / 75%);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 400 15px/1.45 var(--font-body);
}
button { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
:is(a,button):focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1:focus { outline: none; }

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon.MuiSvgIcon-root { fill: currentColor; stroke: none; width: 20px; height: 20px; }
.tile > .icon.MuiSvgIcon-root { width: 17px; height: 17px; }

.shell {
  width: min(100%, 940px);
  margin-inline: auto;
  padding: clamp(16px, 4vw, 40px) clamp(12px, 4vw, 30px) max(24px, env(safe-area-inset-bottom));
  display: grid;
  gap: 16px;
}

.intro {
  display: grid;
  gap: 7px;
  padding: clamp(17px, 4vw, 28px);
  background: var(--brand-navy);
  color: var(--brand-surface);
  border-inline-start: 5px solid var(--brand-highlight);
  border-radius: 14px;
}
.intro :is(h1,p) { margin: 0; }
.intro h1 { font-size: clamp(25px, 4vw, 36px); line-height: 1.15; }
.intro .eyebrow { color: #DBE7FF; font-size: 12px; font-weight: 650; }
.note { margin: 0; color: var(--muted); font-size: 13px; }

.tile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tile {
  position: relative;
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 7px;
  min-width: 0;
  min-height: 105px;
  padding: 12px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: start;
  cursor: pointer;
}
.tile strong { line-height: 1.25; padding-inline-end: 9px; overflow-wrap: anywhere; }
.tile-detail { font-size: 13px; color: var(--muted); }
.tile > .icon { position: absolute; inset: 12px 10px auto auto; color: var(--accent); width: 17px; }
.tile:hover { border-color: var(--accent); }
.tile-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--accent-bg);
  color: var(--accent);
}

.toolbar { display: flex; justify-content: space-between; gap: 8px; }
.nav-button, .icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  gap: 6px;
  padding-inline: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--accent);
  cursor: pointer;
}
.icon-button { width: 44px; padding: 0; }
.empty {
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
}

#app-dialog {
  width: min(calc(100% - 24px), 500px);
  max-width: none;
  max-height: min(84vh, 650px);
  max-height: min(84dvh, 650px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  transform: translateY(var(--window-offset, 0px));
  transition: transform 160ms ease-out;
}
#app-dialog::backdrop { background: var(--backdrop); }
#app-dialog.window-full { width: min(calc(100% - 24px), 680px); }
#app-dialog.window-dragging { transition: none; }
.window { display: flex; flex-direction: column; }
.window-header {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 10px;
  padding: 8px 14px 9px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  touch-action: none;
}
.window-grip {
  grid-column: 1/-1;
  justify-self: center;
  width: 36px;
  height: 4px;
  border-radius: 4px;
  background: var(--line);
}
.window-header h2 { margin: 0; font-size: 18px; }
.window-body { padding: 14px; }
.window-description { margin: 0 0 12px; color: var(--muted); }
.window-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.window-item {
  display: flex;
  align-items: center;
  text-align: start;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
}
.window-item .tile-icon { flex: none; }
.window-item small { display: block; color: var(--muted); }
button.window-item { cursor: pointer; }
button.window-item:is(:hover,[aria-pressed="true"]) { background: var(--accent-bg); border-color: var(--accent); }

@media (min-width: 690px) {
  .tile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  #app-dialog {
    margin-block: auto max(8px, env(safe-area-inset-bottom));
  }
  #app-dialog.window-full { min-height: 60vh; min-height: 60dvh; }
}
@media (max-width: 340px) {
  .tile-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    #app-dialog { transition: none; }
}

.dev-fab{position:fixed;z-index:900;width:48px;height:48px;border:1px solid var(--line);border-radius:50%;background:var(--brand-navy);color:white;font-weight:800;box-shadow:0 4px 14px #0004;touch-action:none;cursor:grab;user-select:none}.dev-fab:active{cursor:grabbing}

.dev-dashboard{display:grid;grid-template-columns:repeat(auto-fit,minmax(145px,1fr));gap:10px}.dev-dashboard article{display:grid;gap:8px;padding:16px;background:var(--surface);border:1px solid var(--line);border-radius:12px}.dev-dashboard small{color:var(--muted)}.dev-dashboard strong{font-size:18px;overflow-wrap:anywhere}

.dev-fab-wrap{position:fixed;z-index:900;width:48px;display:grid;justify-items:center;gap:2px}.dev-fab-wrap .dev-fab{position:relative;inset:auto}.dev-fab-version{font-size:9px;font-weight:700;white-space:nowrap;color:var(--text);background:var(--surface);border-radius:4px;padding:1px 3px;line-height:14px;pointer-events:none}

.page-skeleton{display:grid;gap:12px}.skeleton-header,.skeleton-card{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:18px;display:grid;gap:12px}.skeleton-header{min-height:128px}.skeleton-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(145px,100%),1fr));gap:10px}.skeleton-card{min-height:104px}.skeleton-form{grid-template-columns:1fr}.skeleton-line,.skeleton-icon{position:relative;overflow:hidden;background:var(--line);border-radius:6px;opacity:.72;height:12px}.skeleton-line.short{width:35%}.skeleton-line.medium{width:65%}.skeleton-line.heading{width:55%;height:24px}.skeleton-icon{width:36px;height:36px;border-radius:10px}.skeleton-line::after,.skeleton-icon::after{content:"";position:absolute;inset:0;background:linear-gradient(100deg,transparent,var(--surface),transparent);transform:translateX(-100%);animation:skeleton-shimmer 1.25s ease-in-out infinite}@keyframes skeleton-shimmer{to{transform:translateX(100%)}}.skeleton-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}@media(prefers-reduced-motion:reduce){.skeleton-line::after,.skeleton-icon::after{animation:none}}

.dev-version-fixed{position:fixed;z-index:1000;line-height:13px;font-weight:600;font-variant-numeric:tabular-nums}.dev-version-fixed[hidden]{display:none}

.dev-version-fixed{display:inline-flex;align-items:center;gap:4px;pointer-events:auto;cursor:pointer;opacity:1;padding:3px 7px;border:1px solid var(--line);border-radius:7px;background:var(--surface);color:var(--text);font-size:10px;box-shadow:0 2px 6px #0002}.dev-version-fixed span:first-child{font-size:14px;line-height:14px}.dev-version-fixed:hover,.dev-version-fixed:focus-visible{background:var(--accent-bg);border-color:var(--accent)}.dev-version-fixed:active{transform:scale(.96)}

html,body{width:100%;height:100%;margin:0;overflow:hidden;overscroll-behavior:none}body{position:relative;height:100dvh;min-height:0}.shell{height:100%;min-height:0;min-width:0;max-width:100%;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;align-content:start;scrollbar-width:none;padding-bottom:max(48px,calc(32px + env(safe-area-inset-bottom)))}.shell::-webkit-scrollbar{display:none}.shell>*{min-width:0}#dev-host{position:fixed;inset:0;pointer-events:none;z-index:900}#dev-host .dev-fab{pointer-events:auto}.dev-version-fixed{bottom:calc(5px + env(safe-area-inset-bottom));right:calc(5px + env(safe-area-inset-right));margin:0;white-space:nowrap;max-width:calc(100% - 10px)}


.dev-fab{display:grid;place-items:center}.dev-fab .icon{width:23px;height:23px}.dev-window{pointer-events:auto;width:min(620px,calc(100% - 20px));max-height:calc(100dvh - 20px);padding:0;border:1px solid var(--line);border-radius:16px;background:var(--surface);color:var(--text);overflow:hidden;margin:auto;box-shadow:0 16px 50px #0005}.dev-window::backdrop{background:var(--backdrop)}.dev-window-inner{display:flex;flex-direction:column;max-height:calc(100dvh - 22px)}.dev-window-head{display:flex;align-items:center;justify-content:space-between;background:var(--brand-navy);color:white;padding:12px 16px;gap:8px}.dev-window-head strong{font-size:18px}.dev-window-head small{display:block;color:#dbe7ff;font-size:11px}.dev-window-head button{background:transparent;color:white;border:0;font-size:26px;cursor:pointer;min-width:36px}.dev-window-content{padding:10px;overflow:auto;scrollbar-width:none;min-height:0;overscroll-behavior:contain}.dev-window-content::-webkit-scrollbar{display:none}.dev-window-content h3{font-size:11px;text-transform:uppercase;color:var(--muted);margin:6px 0}.dev-route-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.dev-route-grid a{display:flex;align-items:center;gap:7px;padding:7px;border:1px solid var(--line);border-radius:9px;min-width:0;font-size:12px;line-height:1.2;overflow-wrap:anywhere}.dev-route-grid a[aria-current=page]{border-color:var(--accent);background:var(--accent-bg)}.dev-avatar{display:grid;place-items:center;flex:none;width:28px;height:28px;border-radius:8px;background:var(--accent-bg);color:var(--accent);font-weight:700}.dev-avatar .icon{width:17px;height:17px}.dev-window-tools{display:flex;gap:8px;padding:10px;border-top:1px solid var(--line)}.dev-window-tools button{flex:1;border:1px solid var(--line);background:var(--surface);color:var(--text);border-radius:8px;padding:8px;font-size:12px;cursor:pointer}@media(max-width:420px){.dev-route-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-height:450px) and (min-width:500px){.dev-window-content{display:grid;grid-template-columns:1fr 1fr 2fr;gap:8px}.dev-route-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.dev-window-content section:first-child .dev-route-grid{grid-template-columns:1fr}}

.dev-route-label{display:grid;gap:3px;min-width:0}.dev-route-label small{font-size:10px;color:var(--muted);font-variant-numeric:tabular-nums;line-height:1.1}

.landing-simple{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:12px;min-height:100%;padding:24px}.landing-simple h1,.landing-simple p{margin:0}.landing-simple p{color:var(--muted)}.landing-enter{display:flex;align-items:center;justify-content:center;gap:12px;background:var(--brand-navy);color:white;border-radius:10px;min-height:48px;padding:10px 32px;font-weight:700;margin-top:12px;width:min(100%,260px)}

.dev-mode-switch{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 14px;border-bottom:1px solid var(--line);background:var(--accent-bg)}.dev-mode-switch small{display:block;font-size:11px;color:var(--muted)}.dev-mode-switch button,.preview-return{border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--text);padding:9px;font-size:12px;cursor:pointer}

.preview-return{position:fixed;pointer-events:auto;z-index:1100;display:inline-flex;align-items:center;min-height:44px;right:max(10px,env(safe-area-inset-right));bottom:max(10px,env(safe-area-inset-bottom));box-shadow:0 3px 12px #0003;opacity:1;font-weight:600}.preview-return:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

/* Fallback para navegadores sem unidades dinâmicas e margens de telas com recortes. */
body{height:100vh;height:100dvh}
.shell{padding-top:max(clamp(16px,4vw,40px),env(safe-area-inset-top,0px));padding-left:max(clamp(12px,4vw,30px),env(safe-area-inset-left,0px));padding-right:max(clamp(12px,4vw,30px),env(safe-area-inset-right,0px));-webkit-overflow-scrolling:touch}
.dev-window{max-height:calc(100vh - 20px);max-height:calc(100dvh - 20px)}
.dev-window-inner{max-height:calc(100vh - 22px);max-height:calc(100dvh - 22px)}
.dev-window-content{-webkit-overflow-scrolling:touch}
.dev-route-grid a{min-height:44px}
@media (prefers-reduced-motion:reduce){.MuiSkeleton-root{animation:none}}

/* Superfícies e espaçamentos compartilhados da interface Material. */
.shell{width:min(100%,1100px);gap:20px;padding-top:max(16px,env(safe-area-inset-top,0px))}
.material-appbar.MuiAppBar-root{border-radius:12px;background:var(--brand-navy);color:#fff}
.material-appbar .nav-button,.material-appbar .icon-button{border:0;background:transparent;color:inherit}
.material-appbar .nav-button:hover,.material-appbar .icon-button:hover{background:rgb(255 255 255 / 12%)}
.intro{display:block;background:transparent;color:var(--text);border:0;border-radius:0;padding:clamp(8px,2vw,20px) 2px}
.intro h1{font-size:clamp(1.8rem,4vw,2.4rem);line-height:1.2}
.tile-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,215px),1fr));gap:16px}
.material-card.MuiCard-root{background:var(--surface);border-color:var(--line);border-radius:16px;transition:box-shadow .2s,transform .2s}
.material-card.MuiCard-root:hover{box-shadow:0 8px 24px rgb(20 45 80 / 12%);transform:translateY(-2px)}
.material-card .tile.MuiCardActionArea-root{min-height:156px;padding:0;border:0;border-radius:0;background:transparent;color:var(--text)}
.tile-icon{width:46px;height:46px;border-radius:12px}
.tile-icon .icon.MuiSvgIcon-root{width:24px;height:24px}
.empty{padding:24px;border-radius:16px;font-size:1rem}
.window-header{padding:14px 20px;gap:6px 12px;z-index:1}
.window-body{padding:16px}
.window-list{gap:4px}
.window-item.MuiListItemButton-root,.window-item{border:0;background:transparent;padding:10px 12px;min-height:60px;gap:16px}
button.window-item:is(:hover,[aria-pressed="true"]){background:var(--accent-bg)}
.landing-simple{padding:16px}
.landing-paper.MuiPaper-root{width:min(100%,520px);padding:clamp(28px,7vw,56px);border-radius:20px;background:var(--surface);border-color:var(--line)}
.dev-window-head{background:var(--brand-navy)}
.dev-mode-switch button.MuiButton-root,.dev-window-tools button.MuiButton-root{color:var(--accent);border-color:var(--line);background:var(--surface);font-size:.875rem}
.dev-fab.MuiFab-root{background:var(--brand-primary);color:#fff;width:48px;height:48px;min-height:48px}
@media (prefers-reduced-motion:reduce){.material-card.MuiCard-root{transition:none}}

/* Barra superior contínua, nas cores da marca, respeitando os recortes da tela. */
.shell{width:100%;max-width:none;padding-top:0}
.shell > :not(.material-appbar){width:100%;max-width:1040px;justify-self:center}
.material-appbar.MuiAppBar-root{position:sticky;top:0;z-index:100;width:100vw;max-width:none;justify-self:center;margin-inline:0;padding-top:env(safe-area-inset-top,0px);border:0;border-bottom:4px solid var(--brand-highlight);border-radius:0;background:var(--brand-navy);color:#fff}
.material-toolbar.MuiToolbar-root{width:100%;max-width:1100px;min-height:60px;margin-inline:auto;padding-inline:max(4px,env(safe-area-inset-left,0px)) max(4px,env(safe-area-inset-right,0px));gap:8px}
.material-appbar .icon-button{width:48px;height:48px;min-height:48px;border:0;background:transparent;color:inherit}
.shell{grid-template-columns:minmax(0,1fr)}
.material-appbar.MuiAppBar-root{justify-self:start;margin-inline-start:calc(-1 * max(clamp(12px, 4vw, 30px), env(safe-area-inset-left, 0px)))}

/* Seleção de perfil e áreas demonstrativas do aplicativo. */
.profile-selector,.profile-page{width:100%;max-width:780px;margin-inline:auto;display:grid;gap:24px;padding-top:clamp(8px,2vw,20px)}
.profile-selector-heading{padding:4px 2px}
.profile-list.MuiPaper-root,.profile-features.MuiPaper-root{border-radius:16px;border-color:var(--line);background:var(--surface);overflow:hidden}
.profile-list ul{list-style:none;margin:0;padding:0}
.profile-list li+li{border-top:1px solid var(--line)}
.profile-choice.MuiListItemButton-root{min-height:86px;gap:16px;padding:15px 18px;color:var(--text)}
.profile-choice-icon,.profile-welcome-icon{display:grid;place-items:center;flex:none;width:48px;height:48px;border-radius:14px;background:var(--accent-bg);color:var(--accent)}
.profile-choice-icon .icon.MuiSvgIcon-root,.profile-welcome-icon .icon.MuiSvgIcon-root{width:25px;height:25px}
.profile-choice-copy{display:grid;gap:3px;min-width:0;flex:1}
.profile-choice-copy strong{font-size:1rem;line-height:1.3}
.profile-choice-copy span{font-size:.875rem;line-height:1.4;color:var(--muted)}
.profile-choice > .icon{color:var(--muted)}
.profile-demo-note{padding-inline:2px}
.profile-welcome{display:flex;align-items:flex-start;gap:16px;flex-wrap:wrap}
.profile-welcome > div:nth-child(2){flex:1;min-width:180px}
.profile-welcome-icon{width:56px;height:56px}
.profile-section-title{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:14px}
.profile-features ul{list-style:none;padding:0;margin:0}
.profile-features li{display:flex;align-items:center;gap:14px;min-height:62px;padding:12px 18px;font-weight:600}
.profile-features li+li{border-top:1px solid var(--line)}
.profile-feature-number{display:grid;place-items:center;flex:none;width:34px;height:34px;border-radius:10px;background:var(--accent-bg);color:var(--accent);font-size:.75rem}
.profile-feature-status{margin-inline-start:auto;color:var(--muted);font-size:.75rem;font-weight:500}
@media(max-width:420px){.profile-choice.MuiListItemButton-root{gap:12px;padding:13px 12px}.profile-choice-copy span{font-size:.8125rem}.profile-feature-status{font-size:.7rem}.profile-welcome > div:nth-child(2){min-width:150px}}
