/* Shared design tokens. All pages, including login, hardware and agent, own a complete theme. */
:root, html[data-theme="light"] {
  color-scheme: light;
  --bg:#f4f6f9; --surface:#fff; --surface2:#f7f9fc; --border:#dce2eb;
  --text:#182639; --muted:#536379; --accent:#2459c7; --accent-soft:#eaf0ff;
  --accent-ink:#fff; --green:#187147; --blue:#2459c7; --yellow:#916100;
  --red:#b72d39; --orange:#a34c13; --shadow:rgba(22,40,64,.04);
  --ring:#2459c7; --radius:14px;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg:#111720; --surface:#19222e; --surface2:#202c3b; --border:#344256;
  --text:#edf2f9; --muted:#adbbce; --accent:#92b8ff; --accent-soft:#243a59;
  --accent-ink:#10213d; --green:#7ad6a0; --blue:#92b8ff; --yellow:#e5bf6c;
  --red:#ff929b; --orange:#efb07e; --shadow:rgba(0,0,0,.12); --ring:#92b8ff;
}
*, *::before, *::after { box-sizing:border-box; }
html { scroll-padding-top:100px; }
body[data-page] { margin:0; min-height:100dvh; background:var(--bg); color:var(--text); font:15px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; background-image:none; }
body[data-page] button, body[data-page] input, body[data-page] select, body[data-page] textarea { font-family:inherit; }
body[data-page] button, body[data-page] a { -webkit-tap-highlight-color:transparent; }
body[data-page] button { cursor:pointer; }
body[data-page] button:disabled { cursor:not-allowed; opacity:.6; }
body[data-page] a { color:var(--accent); }
body[data-page] :focus-visible { outline:3px solid var(--ring); outline-offset:3px; }
[hidden] { display:none !important; }
body[data-page] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
body[data-page] select, body[data-page] textarea {
  min-height:44px; max-width:100%; padding:10px 12px; border:1px solid var(--border); border-radius:8px;
  color:var(--text); background:var(--surface2); font-size:16px; line-height:1.4;
}
body[data-page] input::placeholder, body[data-page] textarea::placeholder { color:var(--muted); opacity:.8; }
body[data-page] input[type="checkbox"], body[data-page] input[type="radio"] { accent-color:var(--accent); width:20px; height:20px; flex-shrink:0; }
body[data-page] label { color:var(--text); font-size:14px; line-height:1.45; }
body[data-page] h1, body[data-page] h2, body[data-page] h3 { color:var(--text); }
body[data-page] h2 { font-size:18px; line-height:1.35; }
body[data-page] p { line-height:1.6; }
body[data-page] button, body[data-page] .btn, body[data-page] .btn-sm { min-height:44px; }
.cip-inline-icon { display:inline-block; width:1.1em; height:1.1em; margin-right:.3em; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; vertical-align:-.16em; }
body[data-page] :is(.card,.chart-card,.room-card,.storico-card,.cip-panel,.tool-card) {
  min-width:0; padding:22px; border:1px solid var(--border); border-radius:var(--radius); background:var(--surface); box-shadow:none;
}
body[data-page] :is(.card,.room-card):hover { border-color:var(--border); transform:none; }
body[data-page] :is(.card-title,.chart-title,.room-name) { color:var(--text); font-size:16px; font-weight:650; }
body[data-page] :is(.card-label,.chart-subtitle,.card-sub,.power-item-lbl) { color:var(--muted); }
body[data-page] :is(.card-value,.power-value,.power-item-val,.stat-val) { font-variant-numeric:tabular-nums; letter-spacing:-.035em; }
body[data-page] :is(.cip-button,.btn,.api-btn) {
  display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:44px; padding:10px 16px;
  border:1px solid transparent; border-radius:8px; background:var(--accent); color:var(--accent-ink); font-size:14px; font-weight:600; line-height:1.35; text-decoration:none;
}
body[data-page] :is(.cip-button.secondary,.btn-outline,.api-btn-demo,.btn-sm,.session-action) {
  background:var(--surface); border:1px solid var(--border); color:var(--text); box-shadow:none;
}
body[data-page] :is(.btn-red,.cip-button.danger) { background:var(--surface); color:var(--red); border:1px solid var(--red); }
body[data-page] :is(.btn-green,.btn-yellow) { background:var(--surface2); border:1px solid var(--border); color:var(--text); }
body[data-page] .toast { background:var(--text); color:var(--bg); border:0; max-width:calc(100vw - 32px); font-size:14px; z-index:1500; }
body[data-page] .toast.red { background:var(--red); color:var(--surface); }
body[data-page] .progress-bar { background:var(--surface2); }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto !important; transition:none !important; animation:none !important; } }

body[data-page] .tool-form button[type="submit"] { min-height:44px; padding:10px 16px; border:0; border-radius:8px; background:var(--accent); color:var(--accent-ink); font-size:14px; font-weight:600; }
