/* FisioRadar AI · Premium Dark */
@font-face { font-family: "Inter"; src: url("../fonts/inter-Regular.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-Medium.woff") format("woff"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-SemiBold.woff") format("woff"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-Bold.woff") format("woff"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-ExtraBold.woff") format("woff"); font-weight: 800; font-style: normal; font-display: swap; }

:root {
  --bg-main: #030D17;
  --bg-secondary: #061624;
  --bg-sidebar: #04111E;
  --bg-header: #071A29;
  --bg-card: #082032;
  --bg-card-secondary: #0B283A;
  --bg-elevated: #103448;
  --bg-input: #0A2031;
  --bg-modal: #071725;
  --accent-cyan: #00DDE5;
  --accent-turquoise: #00E5C4;
  --accent-emerald: #00CFA7;
  --accent-blue: #159FFF;
  --accent-electric: #2878FF;
  --accent-purple: #9365F5;
  --accent-yellow: #F2C14E;
  --success: #20D69C;
  --danger: #FF6474;
  --text-title: #F4FBFF;
  --text-primary: #D7E9F2;
  --text-secondary: #96B6C7;
  --text-muted: #64879B;
  --text-on-accent: #03202B;
  --border-default: #174156;
  --border-active: #087F94;
  --border-divider: #123144;
  --radius-small: 10px;
  --radius-medium: 14px;
  --radius-card: 18px;
  --radius-large: 24px;
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.24);
  --shadow-accent: 0 0 22px rgba(0, 221, 229, 0.15);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sidebar-w: 252px;
  --header-h: 84px;
  --gutter: 28px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-main);
  background-image:
    radial-gradient(1100px 600px at 78% -12%, rgba(0, 221, 229, 0.07), transparent 60%),
    radial-gradient(900px 600px at -10% 40%, rgba(40, 120, 255, 0.06), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--text-title); margin: 0; line-height: 1.22; text-wrap: balance; }
p { margin: 0; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-secondary); }
.dim { color: var(--text-muted); }
.ico { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico.sm { width: 16px; height: 16px; }
.ico.lg { width: 24px; height: 24px; }

/* ===================== Estrutura ===================== */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-divider);
  padding: calc(22px + var(--safe-top)) 16px 20px calc(16px + var(--safe-left));
  display: flex; flex-direction: column; gap: 22px;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px; text-decoration: none !important; }
.brand img { width: 46px; height: 46px; border-radius: 12px; filter: drop-shadow(0 0 12px rgba(0, 221, 229, 0.28)); }
.brand-name { font-size: 22px; font-weight: 800; color: var(--text-title); letter-spacing: -0.02em; line-height: 1; white-space: nowrap; }
.brand-name b { background: linear-gradient(90deg, var(--accent-cyan), var(--accent-turquoise)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-tag { font-size: 8px; letter-spacing: 0.06em; color: var(--text-secondary); text-transform: uppercase; margin-top: 6px; white-space: nowrap; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 14px; padding: 11px 14px;
  border-radius: 12px; color: var(--text-secondary); font-weight: 500; font-size: 14.5px;
  text-decoration: none; border: 1px solid transparent; position: relative; transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(16, 52, 72, 0.5); color: var(--text-primary); }
.nav a.active {
  background: linear-gradient(90deg, rgba(0, 221, 229, 0.16), rgba(16, 52, 72, 0.6));
  border-color: var(--border-active); color: var(--text-title);
  box-shadow: var(--shadow-accent);
}
.nav a.active .ico { color: var(--accent-cyan); }
.nav .badge-count { margin-left: auto; font-size: 11px; background: var(--danger); color: #fff; border-radius: 999px; padding: 1px 7px; font-weight: 700; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; font-size: 12.5px; color: var(--text-muted); padding: 0 6px; }
.sync-chip { display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: var(--bg-card); border: 1px solid var(--border-divider); border-radius: 12px; color: var(--text-secondary); cursor: pointer; text-align: left; width: 100%; }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); flex: none; box-shadow: 0 0 8px var(--success); }
.sync-dot.off { background: var(--text-muted); box-shadow: none; }
.sync-dot.warn { background: var(--accent-yellow); box-shadow: 0 0 8px var(--accent-yellow); }
.sync-dot.busy { background: var(--accent-cyan); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.collapse-btn { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  padding: calc(16px + var(--safe-top)) calc(var(--gutter) + var(--safe-right)) 16px var(--gutter);
  background: rgba(3, 13, 23, 0.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(18, 49, 68, 0.6);
}
.search {
  flex: 1; max-width: 560px; display: flex; align-items: center; gap: 10px;
  background: var(--bg-input); border: 1px solid var(--border-default); border-radius: 999px;
  padding: 0 18px; height: 50px; color: var(--text-secondary);
}
.search:focus-within { border-color: var(--accent-cyan); box-shadow: var(--shadow-accent); }
.search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--text-title); font-size: 15px; height: 100%; }
.search input::placeholder { color: var(--text-secondary); }
.icon-btn {
  width: 50px; height: 50px; border-radius: 50%; flex: none;
  display: grid; place-items: center; background: var(--bg-card); border: 1px solid var(--border-default); color: var(--text-primary);
  transition: border-color .15s, box-shadow .15s, transform .15s; position: relative;
}
.icon-btn:hover { border-color: var(--accent-cyan); box-shadow: var(--shadow-accent); }
.icon-btn .dot { position: absolute; top: 10px; right: 11px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent-turquoise); border: 2px solid var(--bg-card); }
.next-scan {
  margin-left: auto; display: flex; align-items: center; gap: 14px; text-align: left;
  background: linear-gradient(120deg, var(--bg-card), var(--bg-card-secondary));
  border: 1px solid var(--border-default); border-radius: 16px; padding: 8px 8px 8px 18px; height: 60px; color: var(--text-title);
}
.next-scan:hover { border-color: var(--border-active); box-shadow: var(--shadow-accent); }
.next-scan small { display: block; font-size: 12.5px; color: var(--accent-cyan); font-weight: 500; }
.next-scan strong { font-size: 16px; font-weight: 600; white-space: nowrap; }
.next-scan .moon { width: 42px; height: 42px; border-radius: 12px; background: var(--bg-elevated); display: grid; place-items: center; color: var(--accent-cyan); }
.mobile-head { display: none; }

.content { padding: 26px var(--gutter) 40px; padding-right: calc(var(--gutter) + var(--safe-right)); display: flex; flex-direction: column; gap: 26px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.01em; }
.page-head p { color: var(--text-secondary); margin-top: 6px; max-width: 70ch; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-head h2 { font-size: 21px; font-weight: 650; }
.link-btn { background: none; border: 0; color: var(--accent-cyan); font-size: 14px; font-weight: 500; padding: 4px 2px; }
.link-btn:hover { text-decoration: underline; }

/* ===================== Botões ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 46px; padding: 0 20px; border-radius: 14px; font-weight: 600; font-size: 14.5px;
  border: 1px solid var(--border-default); background: var(--bg-card-secondary); color: var(--text-title);
  transition: transform .12s, box-shadow .15s, border-color .15s, opacity .15s; white-space: nowrap; text-decoration: none !important;
}
.btn:hover:not(:disabled) { border-color: var(--accent-cyan); box-shadow: var(--shadow-accent); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn.primary { background: linear-gradient(90deg, var(--accent-cyan), var(--accent-turquoise)); color: var(--text-on-accent); border-color: transparent; box-shadow: 0 6px 24px rgba(0, 221, 229, 0.25); }
.btn.primary:hover:not(:disabled) { box-shadow: 0 8px 30px rgba(0, 229, 196, 0.38); }
.btn.ghost { background: transparent; }
.btn.danger { border-color: rgba(255, 100, 116, 0.5); color: var(--danger); background: rgba(255, 100, 116, 0.08); }
.btn.danger:hover:not(:disabled) { border-color: var(--danger); box-shadow: 0 0 18px rgba(255, 100, 116, 0.2); }
.btn.sm { height: 36px; padding: 0 14px; font-size: 13px; border-radius: 11px; gap: 7px; }
.btn.xs { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 9px; gap: 6px; }
.btn.pill { border-radius: 999px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.loading { pointer-events: none; opacity: .85; }
.btn.loading::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.btn.loading .ico { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn.ok { border-color: var(--success); color: var(--success); }

/* ===================== Cartões ===================== */
.card { background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-card); box-shadow: var(--shadow-card); min-width: 0; }
.card.pad { padding: 22px; }
.card.hover { transition: transform .15s, border-color .15s, box-shadow .15s; cursor: pointer; }
.card.hover:hover { transform: translateY(-2px); border-color: var(--border-active); box-shadow: var(--shadow-card), var(--shadow-accent); }
.card-title { font-size: 17px; font-weight: 650; color: var(--text-title); }

/* Hero */
.dash-top { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(300px, 1fr); gap: 22px; }
.hero {
  position: relative; overflow: hidden; border-radius: var(--radius-large); min-height: 300px;
  background: radial-gradient(120% 140% at 85% 30%, #0B3A55 0%, #082032 45%, #061624 100%);
  border: 1px solid var(--border-default); box-shadow: var(--shadow-card);
  display: flex; align-items: center;
}
.hero-art { position: absolute; inset: 0 0 0 auto; width: 58%; pointer-events: none; }
.hero-art svg { width: 100%; height: 100%; }
.hero-body { position: relative; z-index: 1; padding: 30px 32px; max-width: 470px; display: flex; flex-direction: column; gap: 14px; }
.hero h1 { font-size: 27px; font-weight: 800; letter-spacing: -0.01em; text-transform: uppercase; line-height: 1.18; }
.hero h1 span { color: var(--accent-cyan); display: block; }
.hero p { color: var(--text-primary); font-size: 14.5px; max-width: 42ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.scan-progress { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-secondary); }
.bar { height: 6px; border-radius: 999px; background: var(--bg-elevated); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-cyan), var(--accent-turquoise)); border-radius: inherit; transition: width .3s; }

.radar { padding: 22px 22px 14px; display: flex; flex-direction: column; }
.radar .row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border-divider); font-size: 14.5px; color: var(--text-primary); }
.radar .row:first-of-type { border-top: 0; }
.tile { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none; background: rgba(21, 159, 255, 0.12); color: var(--accent-blue); border: 1px solid rgba(21, 159, 255, 0.25); }
.tile.cyan { background: rgba(0, 221, 229, 0.12); color: var(--accent-cyan); border-color: rgba(0, 221, 229, 0.3); }
.tile.yellow { background: rgba(242, 193, 78, 0.13); color: var(--accent-yellow); border-color: rgba(242, 193, 78, 0.3); }
.tile.green { background: rgba(32, 214, 156, 0.12); color: var(--success); border-color: rgba(32, 214, 156, 0.3); }
.tile.purple { background: rgba(147, 101, 245, 0.15); color: var(--accent-purple); border-color: rgba(147, 101, 245, 0.35); }
.tile.red { background: rgba(255, 100, 116, 0.12); color: var(--danger); border-color: rgba(255, 100, 116, 0.3); }
.tile.big { width: 58px; height: 58px; border-radius: 14px; }
.tile.big .ico { width: 28px; height: 28px; }
.pulse-ico { margin-left: auto; color: var(--accent-turquoise); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat { display: flex; gap: 16px; align-items: center; padding: 18px; text-align: left; width: 100%; color: inherit; }
.stat .label { font-size: 13.5px; font-weight: 600; color: var(--text-title); }
.stat .value { font-size: 32px; font-weight: 700; line-height: 1.1; margin: 4px 0 2px; }
.stat .sub { font-size: 13px; color: var(--text-secondary); }
.c-green { color: var(--success); } .c-blue { color: var(--accent-blue); } .c-purple { color: #B08BFF; } .c-yellow { color: var(--accent-yellow); } .c-cyan { color: var(--accent-cyan); } .c-red { color: var(--danger); }

/* Cartões de notícia */
.grid-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.ncard { display: flex; flex-direction: column; overflow: hidden; }
.ncard .media { position: relative; aspect-ratio: 16 / 7.8; background: var(--bg-secondary); overflow: hidden; max-width: 100%; }
.ncard .media img, .ncard .media svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.ncard .media .cat { position: absolute; top: 12px; left: 12px; }
.ncard .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.ncard h3 { font-size: 17px; font-weight: 600; line-height: 1.32; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ncard .meta { font-size: 12.5px; color: var(--text-muted); }
.ncard .foot { margin-top: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ncard .foot .btn { margin-left: auto; }
.bars-ico { color: var(--success); }

.cat {
  display: inline-flex; align-items: center; height: 26px; padding: 0 12px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #fff; white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}
.cat-inovacao { background: linear-gradient(90deg, #2878FF, #159FFF); }
.cat-msk { background: linear-gradient(90deg, #0A8FA6, #00B9C4); }
.cat-manual { background: linear-gradient(90deg, #7A4FE8, #9365F5); }
.cat-saude { background: linear-gradient(90deg, #0E9C7F, #00CFA7); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 8px;
  font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid var(--border-default); background: var(--bg-card-secondary); color: var(--text-primary);
}
.chip.green { background: rgba(32, 214, 156, 0.12); border-color: rgba(32, 214, 156, 0.35); color: var(--success); }
.chip.yellow { background: rgba(242, 193, 78, 0.13); border-color: rgba(242, 193, 78, 0.38); color: var(--accent-yellow); }
.chip.purple { background: rgba(147, 101, 245, 0.16); border-color: rgba(147, 101, 245, 0.42); color: #C2A8FF; }
.chip.red { background: rgba(255, 100, 116, 0.12); border-color: rgba(255, 100, 116, 0.38); color: var(--danger); }
.chip.blue { background: rgba(21, 159, 255, 0.12); border-color: rgba(21, 159, 255, 0.38); color: #6FC2FF; }
.chip.cyan { background: rgba(0, 221, 229, 0.1); border-color: rgba(0, 221, 229, 0.35); color: var(--accent-cyan); }
.chip.muted { color: var(--text-secondary); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.feature { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: linear-gradient(160deg, var(--bg-card), var(--bg-secondary)); }
.feature-strip { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; }
.feature-strip .card { padding: 16px 10px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.feature-strip .ico { width: 34px; height: 34px; stroke-width: 1.6; }
.feature-strip strong { font-size: 11.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-title); }
.feature-strip span { font-size: 11.5px; color: var(--text-secondary); line-height: 1.35; }

.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 14px; padding: 13px 4px; border-top: 1px solid var(--border-divider); background: none; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; color: inherit; width: 100%; }
.li:first-child { border-top: 0; }
.li:hover .li-title { color: var(--accent-cyan); }
.li-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.li-title { font-weight: 600; color: var(--text-title); font-size: 14.5px; line-height: 1.35; overflow-wrap: anywhere; }
.li-sub { font-size: 12.5px; color: var(--text-secondary); }
.li .thumb { width: 64px; height: 56px; border-radius: 10px; overflow: hidden; flex: none; background: var(--bg-secondary); }
.li .thumb svg, .li .thumb img { width: 100%; height: 100%; object-fit: cover; }
.rank { font-size: 22px; font-weight: 700; color: var(--accent-cyan); width: 22px; text-align: center; flex: none; }

.feature-card { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr); overflow: hidden; }
.feature-card .media { min-height: 220px; background: var(--bg-secondary); position: relative; }
.feature-card .media > * { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.feature-card .body { padding: 22px 24px; display: flex; flex-direction: column; gap: 12px; }
.feature-card h3 { font-size: 20px; font-weight: 650; }
.clamp3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ===================== Filtros e formulários ===================== */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .label { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); letter-spacing: 0.02em; }
.input, select.input, textarea.input {
  width: 100%; min-width: 0; background: var(--bg-input); border: 1px solid var(--border-default); color: var(--text-title);
  border-radius: 12px; padding: 0 14px; height: 44px; outline: 0; font-size: 14.5px; transition: border-color .15s, box-shadow .15s;
}
textarea.input { padding: 12px 14px; height: auto; min-height: 92px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--accent-cyan); box-shadow: 0 0 0 3px rgba(0, 221, 229, 0.14); }
.input.invalid { border-color: var(--danger); }
select.input { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2396B6C7' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.toolbar .input { height: 40px; width: auto; min-width: 140px; }
.toolbar .search-local { flex: 1; min-width: 200px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.hint { font-size: 12.5px; color: var(--text-muted); }
.err-text { font-size: 12.5px; color: var(--danger); }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--bg-elevated); border-radius: 999px; border: 1px solid var(--border-default); transition: background .15s; }
.switch span::after { content: ""; position: absolute; width: 18px; height: 18px; top: 3px; left: 3px; background: var(--text-secondary); border-radius: 50%; transition: transform .15s, background .15s; }
.switch input:checked + span { background: rgba(0, 221, 229, 0.25); border-color: var(--accent-cyan); }
.switch input:checked + span::after { transform: translateX(18px); background: var(--accent-cyan); }
.switch input:focus-visible + span { outline: 2px solid var(--accent-cyan); outline-offset: 2px; }
.range-row { display: grid; grid-template-columns: 180px minmax(0, 1fr) 54px; gap: 14px; align-items: center; padding: 8px 0; }
input[type="range"] { width: 100%; accent-color: var(--accent-cyan); }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--border-divider); }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; color: var(--text-secondary); font-weight: 600; font-size: 14px; margin-bottom: -1px; }
.tab:hover { color: var(--text-title); }
.tab.active { color: var(--accent-cyan); border-bottom-color: var(--accent-cyan); }
.seg { display: inline-flex; background: var(--bg-input); border: 1px solid var(--border-default); border-radius: 12px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 7px 12px; border-radius: 9px; color: var(--text-secondary); font-size: 13px; font-weight: 600; }
.seg button.active { background: var(--bg-elevated); color: var(--text-title); box-shadow: inset 0 0 0 1px var(--border-active); }

.empty { padding: 34px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--text-secondary); }
.empty .ico { width: 40px; height: 40px; color: var(--text-muted); stroke-width: 1.4; }
.empty h3 { font-size: 17px; }
.empty p { max-width: 52ch; font-size: 14px; }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-medium); background: rgba(21, 159, 255, 0.08); border: 1px solid rgba(21, 159, 255, 0.3); font-size: 14px; color: var(--text-primary); }
.notice .ico { color: var(--accent-blue); margin-top: 1px; }
.notice.warn { background: rgba(242, 193, 78, 0.08); border-color: rgba(242, 193, 78, 0.35); }
.notice.warn .ico { color: var(--accent-yellow); }
.notice.err { background: rgba(255, 100, 116, 0.08); border-color: rgba(255, 100, 116, 0.35); }
.notice.err .ico { color: var(--danger); }
.notice.ok { background: rgba(32, 214, 156, 0.08); border-color: rgba(32, 214, 156, 0.35); }
.notice.ok .ico { color: var(--success); }

/* Item de lista em linha (ideias, roteiros, etc.) */
.rows { display: flex; flex-direction: column; gap: 12px; }
.row-card { display: flex; gap: 16px; align-items: flex-start; padding: 16px 18px; }
.row-card .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.row-card h3 { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.icon-sm { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--bg-card-secondary); border: 1px solid var(--border-default); color: var(--text-secondary); flex: none; }
.icon-sm:hover { color: var(--accent-cyan); border-color: var(--accent-cyan); }
.icon-sm.on { color: var(--accent-yellow); border-color: rgba(242, 193, 78, 0.5); }
.icon-sm.on .ico { fill: var(--accent-yellow); }
.icon-sm.del:hover { color: var(--danger); border-color: var(--danger); }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }

/* Detalhes */
.detail-head { display: flex; flex-direction: column; gap: 12px; }
.detail-head h2 { font-size: 22px; font-weight: 700; overflow-wrap: anywhere; }
.kv { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; color: var(--text-primary); overflow-wrap: anywhere; }
.block { background: var(--bg-card-secondary); border: 1px solid var(--border-divider); border-radius: var(--radius-medium); padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.block h4 { font-size: 14.5px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.block ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.original { font-size: 14px; color: var(--text-primary); white-space: pre-line; max-height: 280px; overflow: auto; }
.score-ring { width: 64px; height: 64px; flex: none; }
.score-parts { display: flex; flex-direction: column; gap: 8px; }
.score-parts .sp { display: grid; grid-template-columns: 170px minmax(0, 1fr) 40px; gap: 10px; align-items: center; font-size: 13px; }
.sparkline { width: 100%; height: 48px; }

/* Roteiro */
.script-field { display: flex; flex-direction: column; gap: 8px; }
.script-field .head { display: flex; align-items: center; gap: 10px; }
.script-field .head .step-n { width: 26px; height: 26px; border-radius: 8px; background: var(--bg-elevated); color: var(--accent-cyan); display: grid; place-items: center; font-size: 12.5px; font-weight: 700; flex: none; }
.script-field .head label { font-size: 14px; font-weight: 650; color: var(--text-title); }
.script-field .head .btn { margin-left: auto; }

/* ===================== Modal / folha / toast ===================== */
.overlay { position: fixed; inset: 0; z-index: 80; background: rgba(1, 7, 13, 0.72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 20px; padding-top: calc(20px + var(--safe-top)); padding-bottom: calc(20px + var(--safe-bottom)); animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(760px, 100%); max-height: 100%; overflow: hidden; display: flex; flex-direction: column; background: var(--bg-modal); border: 1px solid var(--border-default); border-radius: var(--radius-large); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55); animation: rise .18s; }
.modal.wide { width: min(980px, 100%); }
.modal.narrow { width: min(460px, 100%); }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border-divider); }
.modal-head h3 { font-size: 18px; font-weight: 650; flex: 1; min-width: 0; }
.modal-body { padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; -webkit-overflow-scrolling: touch; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border-divider); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.sheet-actions { display: flex; flex-direction: column; gap: 10px; }
.sheet-actions .btn { justify-content: flex-start; height: 54px; font-size: 15px; }

.toasts { position: fixed; z-index: 120; right: calc(20px + var(--safe-right)); top: calc(96px + var(--safe-top)); pointer-events: none; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; gap: 12px; align-items: center; padding: 13px 16px; border-radius: 14px; background: var(--bg-elevated); border: 1px solid var(--border-active); color: var(--text-title); box-shadow: var(--shadow-card); font-size: 14px; animation: rise .2s; pointer-events: none; }
.toast .btn { pointer-events: auto; }
.toast.err { border-color: var(--danger); }
.toast.ok .ico { color: var(--success); }
.toast.err .ico { color: var(--danger); }
.toast .btn { margin-left: auto; }

.offline-bar { display: flex; align-items: center; gap: 10px; padding: 10px var(--gutter); background: rgba(242, 193, 78, 0.1); border-bottom: 1px solid rgba(242, 193, 78, 0.3); color: var(--accent-yellow); font-size: 13.5px; }

/* ===================== Login ===================== */
.auth { min-height: 100vh; display: grid; place-items: center; padding: calc(24px + var(--safe-top)) max(16px, var(--safe-right)) calc(24px + var(--safe-bottom)) max(16px, var(--safe-left)); }
.auth .card { width: min(440px, 100%); padding: 32px 28px; display: flex; flex-direction: column; gap: 18px; }
.auth .brand { flex-direction: column; text-align: center; gap: 14px; }
.auth .brand img { width: 84px; height: 84px; border-radius: 20px; }
.auth .brand-name { font-size: 30px; }

/* ===================== Barra inferior (celular) ===================== */
.bottom-nav { display: none; }

/* ===================== Responsivo ===================== */
@media (max-width: 1360px) {
  .feature-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1200px) {
  :root { --gutter: 22px; }
  .app { grid-template-columns: 84px minmax(0, 1fr); }
  .app.expanded { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .app:not(.expanded) .sidebar { padding-left: 12px; padding-right: 12px; align-items: center; }
  .app:not(.expanded) .sidebar .brand-text, .app:not(.expanded) .nav a span, .app:not(.expanded) .sidebar-foot .txt, .app:not(.expanded) .nav .badge-count { display: none; }
  .app:not(.expanded) .nav a { justify-content: center; padding: 12px; }
  .app:not(.expanded) .sync-chip { justify-content: center; padding: 10px; }
  .collapse-btn { display: grid; }
  .dash-top { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-art { width: 52%; opacity: .9; }
}
@media (max-width: 920px) {
  .two-col { grid-template-columns: 1fr; }
  .next-scan .lbl { display: none; }
  .next-scan { padding: 8px; }
  .feature-card { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
}
@media (max-width: 760px) {
  :root { --gutter: 16px; }
  body { font-size: 15px; }
  .app { display: block; }
  .sidebar { display: none; }
  .topbar { display: none; }
  .mobile-head {
    display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; z-index: 30;
    padding: calc(12px + var(--safe-top)) max(16px, var(--safe-right)) 12px max(16px, var(--safe-left));
    background: rgba(3, 13, 23, 0.9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(18, 49, 68, 0.6);
  }
  .mobile-head .top { display: flex; align-items: center; gap: 12px; }
  .mobile-head .avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--bg-elevated); border: 1px solid var(--border-active); display: grid; place-items: center; color: var(--accent-cyan); font-weight: 700; font-size: 13px; flex: none; }
  .mobile-head .brand { flex: 1; justify-content: center; padding: 0; min-width: 0; }
  .mobile-head .brand img { width: 36px; height: 36px; border-radius: 10px; }
  .mobile-head .brand-name { font-size: 21px; }
  .mobile-head .brand-tag { font-size: 8px; margin-top: 4px; }
  .mobile-head .icon-btn { width: 40px; height: 40px; }
  .mobile-head .search { height: 44px; max-width: none; }
  .content { padding: 18px max(16px, var(--safe-right)) calc(110px + var(--safe-bottom)) max(16px, var(--safe-left)); gap: 22px; }
  .page-head h1 { font-size: 24px; }
  .hero { min-height: 0; }
  .hero-art { width: 100%; opacity: .35; }
  .hero-body { padding: 22px 20px; }
  .hero h1 { font-size: 22px; }
  .stats { gap: 12px; }
  .stat { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; }
  .stat .value { font-size: 28px; }
  .tile.big { width: 44px; height: 44px; }
  .grid-cards { grid-template-columns: 1fr; }
  .feature-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: 1fr; }
  .range-row { grid-template-columns: 1fr 48px; }
  .range-row .label { grid-column: 1 / -1; }
  .score-parts .sp { grid-template-columns: 1fr 40px; }
  .score-parts .sp .bar { grid-column: 1 / -1; grid-row: 2; }
  .toolbar .input { flex: 1 1 140px; }
  .overlay { padding: 0; align-items: flex-end; }
  .modal, .modal.wide, .modal.narrow { width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; padding-bottom: var(--safe-bottom); }
  .toasts { left: 16px; right: 16px; top: calc(72px + var(--safe-top)); max-width: none; }
  .row-card { flex-direction: column; }
  .offline-bar { padding: 10px 16px; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 8px max(8px, var(--safe-right)) calc(8px + var(--safe-bottom)) max(8px, var(--safe-left));
    background: rgba(4, 17, 30, 0.96); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border-divider);
  }
  .bottom-nav a, .bottom-nav button.nb { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0; font-size: 11.5px; color: var(--text-secondary); background: none; border: 0; text-decoration: none; position: relative; }
  .bottom-nav a.active { color: var(--accent-cyan); }
  .bottom-nav a.active::after { content: ""; position: absolute; bottom: -2px; width: 22px; height: 2px; border-radius: 2px; background: var(--accent-cyan); }
  .bottom-nav .fab-wrap { display: flex; justify-content: center; }
  .fab { width: 62px; height: 62px; border-radius: 50%; border: 4px solid var(--bg-sidebar); margin-top: -30px; display: grid; place-items: center; color: #fff; background: radial-gradient(circle at 35% 30%, #4FA3FF, #2878FF 60%, #1A5BD6); box-shadow: 0 0 0 1px rgba(21, 159, 255, 0.5), 0 0 26px rgba(40, 120, 255, 0.55); }
  .fab .ico { width: 28px; height: 28px; stroke-width: 2.4; }
}
@media (max-width: 380px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat .value { font-size: 24px; }
  .hero-actions .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Visibilidade por tamanho de tela */
@media (min-width: 761px) { .m-only { display: none !important; } }
@media (max-width: 760px) { .d-only { display: none !important; } }
.next-scan.m-only { margin-left: 0; width: 100%; height: 64px; padding: 10px 14px; }
