/* Controle PC — base visual compartilhada (PC e celular) */
:root {
  /* tema branco e cinza (minimalista) */
  --bg: #070707;
  --bg-2: #0f0f0f;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.07);
  --surface-3: rgba(255, 255, 255, 0.10);
  --border: rgba(255, 255, 255, 0.08);
  --border-2: rgba(255, 255, 255, 0.14);
  --text: #f5f5f5;
  --text-2: #b5b5b5;
  --text-3: #7a7a7a;
  --accent: #e9e9e9;
  --accent-2: #bdbdbd;
  --accent-soft: rgba(255, 255, 255, 0.09);
  --on-accent: #0b0b0b; /* texto sobre fundo de destaque (claro) */
  --grad: linear-gradient(135deg, #ffffff 0%, #d4d4d4 55%, #a3a3a3 100%);
  --ok: #7ed492;
  --warn: #f6c453;
  --danger: #ff6a5c;
  --danger-soft: rgba(255, 106, 92, 0.14);
  --r: 22px;
  --r-sm: 14px;
  --shadow: 0 22px 50px -22px rgba(0, 0, 0, 0.75);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 620px at 0% 0%, rgba(255, 255, 255, 0.045), transparent 60%),
    radial-gradient(760px 600px at 100% 100%, rgba(255, 255, 255, 0.03), transparent 62%);
}
/* granulado bem leve */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.card { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
svg { display: block; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, 0.16); }

.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px;
  backdrop-filter: blur(20px);
}
.card h3 { margin: 0 0 14px; font: 600 13px var(--font); color: var(--text-2); letter-spacing: .02em; text-transform: uppercase; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border-2);
  font-weight: 600; transition: background .15s, transform .1s, border-color .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--grad); border-color: transparent; color: var(--on-accent); box-shadow: 0 8px 24px -12px rgba(255, 255, 255, .35); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: var(--danger-soft); border-color: rgba(251, 95, 122, .3); color: #ffb3c0; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { height: 32px; padding: 0 12px; border-radius: 10px; font-size: 13px; }
.btn.icon { width: 40px; padding: 0; }
.btn svg { width: 18px; height: 18px; }
.btn:disabled { opacity: .45; pointer-events: none; }

.input {
  height: 42px; padding: 0 14px; border-radius: 12px; width: 100%;
  background: rgba(0, 0, 0, .25); border: 1px solid var(--border-2); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select.input { padding-right: 8px; }

.pill { display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 11px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.pill.on { color: #a7f3d0; background: rgba(52, 211, 153, .12); }
.pill.on .dot { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.pill.warn { color: #fde68a; background: rgba(251, 191, 36, .12); }
.pill.warn .dot { background: var(--warn); }
.pill.off .dot { background: var(--danger); }

.bar { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 6px; background: var(--grad); transition: width .6s cubic-bezier(.2, .8, .2, 1); }

.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 26px; background: rgba(255, 255, 255, .1); transition: background .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s cubic-bezier(.3, 1.4, .5, 1); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { background: var(--on-accent); }
.switch input:checked + span::after { transform: translateX(18px); }

.empty { padding: 40px 20px; text-align: center; color: var(--text-3); }
.empty svg { width: 46px; height: 46px; margin: 0 auto 12px; opacity: .5; }

.toasts { position: fixed; z-index: 100; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
  pointer-events: auto; padding: 12px 16px; border-radius: 14px; max-width: 360px;
  background: rgba(22, 22, 22, .92); border: 1px solid var(--border-2); box-shadow: var(--shadow);
  backdrop-filter: blur(16px); display: flex; gap: 10px; align-items: flex-start;
  animation: toastIn .35s cubic-bezier(.2, 1.2, .4, 1);
}
.toast .ic { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--accent); }
.toast.ok .ic { background: var(--ok); }
.toast.warn .ic { background: var(--warn); }
.toast.err .ic { background: var(--danger); }
.toast.out { animation: toastOut .25s forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-6px) scale(.97); } }

.fade-in { animation: fadeIn .35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } }

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .15); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.app-ico { width: 40px; height: 40px; border-radius: 11px; flex: none; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; font-weight: 700; color: var(--text-2); }
.app-ico img { width: 100%; height: 100%; object-fit: cover; }
