/* LUSM - Winfacil :: estilos (segue o design aprovado no canvas) */
:root {
  --bg: #0E1014;
  --bg-deep: #0A0C10;
  --panel: #14171D;
  --bar: #12151B;
  --field: #0E1014;
  --line: #242832;
  --line-2: #2E3340;
  --text: #E6E8EC;
  --text-2: #B9BFCA;
  --muted: #9AA1AE;
  --faint: #8B93A3;
  --accent: #5B9BFF;
  --accent-ink: #0B1220;
  --accent-bg: #1A2638;
  --ok: #6FD3A0;
  --warn-bg: #2A1E14;
  --warn-line: #5A3A1E;
  --warn-text: #F2C79A;
  --err-bg: #2A1418;
  --err-line: #5A1E28;
  --err-text: #F5A3AE;
  --radius: 12px;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
}
a { color: #7FB2FF; } a:hover { color: #B5D2FF; }
input, select, textarea, button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- topo ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 28px; border-bottom: 1px solid var(--line); background: var(--bar);
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 36px; height: 36px; border-radius: 8px; background: var(--accent);
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px; padding: 8px;
}
.logo span { background: var(--bg); border-radius: 1px; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: .2px; }
.brand-name .dot { color: var(--faint); font-weight: 500; }
.brand-sub { font-size: 12px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.actions label { display: flex; align-items: center; gap: 8px; color: var(--muted); }

.btn {
  height: 40px; padding: 0 14px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line-2); background: #171A21; color: var(--text);
}
.btn:hover { border-color: #3A4050; }
.btn-primary { border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 600; padding: 0 16px; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn-sm { height: 32px; padding: 0 10px; font-size: 13px; background: transparent; color: var(--text-2); }
.btn-xs { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.btn-dashed { border-style: dashed; background: transparent; color: var(--text-2); height: 36px; }

/* ---------- layout ---------- */
.layout {
  display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start;
  padding: 24px 28px 64px; max-width: 1520px; margin: 0 auto;
}
.sidenav { flex: 1 1 200px; max-width: 220px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 90px; }
.sidenav .title { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--faint); padding: 0 10px 8px; }
.sidenav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 6px;
  text-decoration: none; color: var(--text-2);
}
.sidenav a:hover { background: #171B23; color: var(--text); }
.sidenav a.active { background: var(--accent-bg); color: #fff; }
.sidenav .n { font-family: var(--mono); font-size: 11px; color: var(--faint); width: 18px; }
.privacy { margin-top: 16px; padding: 12px; border-radius: 8px; border: 1px solid var(--line); font-size: 12px; color: var(--muted); }

main { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.preview-col { flex: 1 1 380px; max-width: 480px; min-width: 0; position: sticky; top: 90px; }

/* ---------- cards ---------- */
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 20px; }
.card h2 { margin: 0 0 4px; font-family: var(--display); font-size: 18px; font-weight: 700; }
.card h3 { margin: 18px 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .8px; color: var(--faint); font-weight: 600; }
.card .hint { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h2 { margin: 0; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; color: var(--text-2); font-size: 13px; }
.row { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; color: var(--text-2); font-size: 13px; }
.mt { margin-top: 14px; }

.field { display: flex; flex-direction: column; gap: 6px; color: var(--text-2); font-size: 13px; }
.input, select.input, textarea.input {
  height: 40px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-2);
  background: var(--field); color: var(--text); width: 100%;
}
.input:hover { border-color: #3A4050; }
textarea.input { height: auto; min-height: 120px; padding: 10px; font-family: var(--mono); font-size: 12px; resize: vertical; }
.input.sm { height: 34px; }
.input.w-num { width: 110px; }
.inline { display: flex; align-items: center; gap: 8px; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; flex: none; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check small { display: block; color: var(--faint); font-size: 12px; }

/* edições */
.edition { position: relative; }
.edition input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.edition span {
  display: block; min-height: 64px; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--line-2); background: var(--field); transition: border-color .12s, background .12s;
}
.edition b { display: block; font-weight: 600; }
.edition small { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.edition input:checked + span { border-color: var(--accent); background: var(--accent-bg); }
.edition input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.edition:hover span { border-color: #3A4050; }
.edition input:disabled + span { opacity: .45; }

/* pílulas (segmentado) */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { position: relative; }
.pill input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.pill span {
  display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--text-2);
}
.pill input:checked + span { border-color: var(--accent); background: var(--accent-bg); color: var(--text); }
.pill input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* barra de partições */
.diskbar { display: flex; height: 28px; border-radius: 6px; overflow: hidden; font-size: 11px; font-family: var(--mono); margin-top: 14px; }
.diskbar div { display: flex; align-items: center; justify-content: center; white-space: nowrap; overflow: hidden; }
.diskbar .p-efi { width: 9%; background: #2B3A55; }
.diskbar .p-msr { width: 3%; background: #232B3B; }
.diskbar .p-win { flex: 1; background: #1E3A66; justify-content: flex-start; padding-left: 10px; }
.diskbar .p-rec { width: 13%; background: #3A2E52; }
.diskbar.manual { background: repeating-linear-gradient(45deg, #1A1E26 0 8px, #161A21 8px 16px); color: var(--muted); justify-content: center; align-items: center; }

/* avisos */
.alert { margin-top: 12px; padding: 10px 12px; border-radius: 8px; font-size: 13px; }
.alert.warn { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-text); }
.alert.err { background: var(--err-bg); border: 1px solid var(--err-line); color: var(--err-text); }
.alert ul { margin: 4px 0 0; padding-left: 18px; }

/* contas */
.users-head, .user-row { display: grid; grid-template-columns: 1fr 1fr 1fr 150px 40px; gap: 8px; }
.users-head { font-size: 12px; color: var(--faint); padding: 0 2px 6px; }
.user-row { margin-bottom: 8px; }
.icon-btn {
  height: 40px; width: 40px; border-radius: 8px; border: 1px solid var(--line-2); background: transparent;
  color: var(--muted); cursor: pointer; display: grid; place-items: center;
}
.icon-btn:hover { color: var(--err-text); border-color: var(--err-line); }

/* apps */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span {
  display: inline-block; padding: 7px 12px; border-radius: 999px; font-size: 13px;
  border: 1px solid var(--line-2); color: var(--muted);
}
.chip input:checked + span { border-color: var(--accent); background: var(--accent-bg); color: var(--text); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* prévia */
.preview { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-deep); overflow: hidden; }
.preview-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--bar); }
.preview-head .fname { font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.preview pre {
  margin: 0; padding: 14px; height: calc(100vh - 250px); min-height: 320px; overflow: auto;
  font: 12px/1.6 var(--mono); color: #C9D1DD; white-space: pre; tab-size: 2;
}
.preview pre .t { color: #7FB2FF; }
.preview pre .a { color: #F2C79A; }
.preview pre .c { color: #6B7385; }
.preview-foot { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.status-ok { color: var(--ok); }
.status-err { color: var(--err-text); }
.status-warn { color: var(--warn-text); }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #1F2430; border: 1px solid var(--line-2); color: var(--text); padding: 10px 16px; border-radius: 8px;
  opacity: 0; pointer-events: none; transition: .2s; z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%); }

footer { text-align: center; color: var(--faint); font-size: 12px; padding: 0 28px 32px; }

[hidden] { display: none !important; }

@media (max-width: 1100px) {
  .preview-col { position: static; max-width: none; flex-basis: 100%; }
  .preview pre { height: 420px; }
}
@media (max-width: 760px) {
  .topbar { position: static; padding: 12px 16px; }
  .layout { padding: 16px; }
  .sidenav { position: static; max-width: none; flex-basis: 100%; flex-direction: row; overflow-x: auto; }
  .sidenav .title, .privacy { display: none; }
  .sidenav a { white-space: nowrap; }
  .grid-2, .checks { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .users-head { display: none; }
  .user-row { grid-template-columns: 1fr 1fr; }
}
