/* AirBoost Optimizer: replica interativa do painel do app (pagina /otimizador).
   Mesmas cores do app em C++ (src/App.cpp, namespace C). Tudo e demonstracao: nada fala com o PC. */
.abd {
  --abd-bg: #060912; --abd-rail: #070b15; --abd-side: #080d19; --abd-card: #0b111f; --abd-card-hi: #0e1628;
  --abd-surface: rgba(160, 200, 255, .04); --abd-surface2: rgba(160, 200, 255, .075); --abd-surface3: rgba(160, 200, 255, .12);
  --abd-border: rgba(170, 205, 255, .09); --abd-border2: rgba(170, 205, 255, .15);
  --abd-brand: #6cc4ff; --abd-blue: #3d9bff; --abd-blue-text: #9fd2ff; --abd-btn-top: #5aaeff; --abd-btn-bot: #2f8cf0;
  --abd-ok: #4ade80; --abd-warn: #fbbf24; --abd-bad: #f87171; --abd-orange: #fb923c; --abd-violet: #a78bfa;
  --abd-teal: #2dd4bf; --abd-slate: #94a3b8;
  position: relative; max-width: 1120px; margin: 0 auto; border-radius: 18px; overflow: hidden;
  background: var(--abd-bg); border: 1px solid rgba(30, 42, 66, 1);
  box-shadow: 0 30px 90px -30px rgba(61, 155, 255, .35), 0 0 0 1px rgba(170, 205, 255, .04);
  color: var(--fg); font-size: 13px; line-height: 1.45; text-align: left;
  display: grid; grid-template-rows: 48px 1fr; height: 640px; user-select: none;
}
.abd svg { flex: none; }
.abd button { border: 0; background: none; color: inherit; cursor: pointer; font: inherit; padding: 0; }
.abd button:focus-visible { outline: 2px solid var(--abd-brand); outline-offset: 2px; }

/* barra de titulo */
.abd-title { display: flex; align-items: center; gap: 10px; padding: 0 0 0 18px; border-bottom: 1px solid var(--abd-border);
  background: rgba(6, 9, 18, .55); }
.abd-logo { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(180deg, var(--abd-btn-top), var(--abd-btn-bot)); box-shadow: 0 0 18px rgba(61, 155, 255, .35); }
.abd-brand { font-size: 16px; letter-spacing: -.01em; }
.abd-brand b { font-weight: 700; }
.abd-demo-tag { margin-left: 6px; font-size: 11px; color: var(--fg-50); padding: 2px 9px; border-radius: 999px;
  background: var(--abd-surface2); border: 1px solid var(--abd-border2); }
.abd-winbtns { margin-left: auto; display: flex; height: 100%; }
.abd-winbtns span { width: 46px; display: grid; place-items: center; color: var(--fg-70); }

.abd-body { display: grid; grid-template-columns: 68px 1fr; min-height: 0; }
.abd-body.has-side { grid-template-columns: 68px 214px 1fr; }

/* rail */
.abd-rail { background: var(--abd-rail); border-right: 1px solid var(--abd-border); display: flex; flex-direction: column;
  align-items: center; gap: 10px; padding: 16px 0; }
.abd-rail .sp { flex: 1; }
.abd-rail button { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; color: var(--fg-50);
  position: relative; transition: background .15s, color .15s; }
.abd-rail button:hover { background: rgba(160, 200, 255, .06); color: var(--fg); }
.abd-rail button.on { background: rgba(61, 155, 255, .14); box-shadow: inset 0 0 0 1px rgba(61, 155, 255, .3); color: var(--abd-brand); }
.abd-rail button.on::before { content: ""; position: absolute; left: -13px; top: 11px; width: 3px; height: 20px; border-radius: 2px;
  background: linear-gradient(180deg, var(--abd-btn-top), var(--abd-btn-bot)); }

/* sidebar */
.abd-side { background: var(--abd-side); border-right: 1px solid var(--abd-border); padding: 18px 10px 14px; display: flex;
  flex-direction: column; min-height: 0; }
.abd-side h4 { margin: 0 12px 16px; font-size: 15px; font-weight: 700; }
.abd-side .sep { height: 1px; background: var(--abd-border); margin: 4px 6px 9px; }
.abd-side button { display: flex; align-items: center; gap: 12px; width: 100%; height: 40px; padding: 0 12px; border-radius: 9px;
  color: var(--fg-70); font-weight: 500; position: relative; margin-bottom: 4px; transition: background .15s; }
.abd-side button:hover { background: rgba(160, 200, 255, .04); color: var(--fg); }
.abd-side button.on { background: rgba(160, 200, 255, .06); color: var(--fg); font-weight: 600; }
.abd-side button.on svg { color: var(--abd-brand); }
.abd-side button.on::before { content: ""; position: absolute; left: 1px; top: 11px; width: 2.5px; height: 18px; border-radius: 2px;
  background: linear-gradient(180deg, var(--abd-btn-top), var(--abd-btn-bot)); }
.abd-side button svg { color: var(--fg-50); }
.abd-side .cnt { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--fg-30); }
.abd-side .cnt.full { color: var(--abd-blue-text); }
.abd-status { margin-top: auto; padding: 12px 14px 14px; border-radius: 12px; background: var(--abd-card);
  border: 1px solid rgba(170, 205, 255, .1); }
.abd-status small { display: block; font-size: 11px; color: var(--fg-50); font-weight: 600; }
.abd-status .row2 { display: flex; align-items: baseline; justify-content: space-between; margin: 6px 0 10px; }
.abd-status b { font-size: 22px; font-weight: 700; }
.abd-status span { font-size: 11px; color: var(--fg-30); }

/* area principal */
.abd-main { position: relative; overflow-y: auto; overflow-x: hidden; padding: 26px 30px 30px; min-height: 0;
  background: radial-gradient(60% 260px at 50% -60px, rgba(61, 155, 255, .16), transparent 70%); scrollbar-width: thin;
  scrollbar-color: rgba(200, 215, 242, .15) transparent; }
.abd-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.abd-head h3 { margin: 0; font-size: 25px; font-weight: 700; letter-spacing: -.02em; line-height: 34px; }
.abd-head p { margin: 2px 0 0; color: var(--fg-50); font-size: 13px; }
.abd-head p i { font-style: normal; color: var(--fg-30); font-size: 12px; margin-left: 6px; }
.abd-label { font-size: 11px; font-weight: 700; color: var(--fg-30); letter-spacing: .06em; text-transform: uppercase; margin: 22px 0 12px; }
.abd-label span { font-weight: 400; letter-spacing: 0; text-transform: none; margin-left: 8px; }

/* botoes */
.abd-btn { height: 42px; padding: 0 20px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; font-weight: 600; font-size: 13px; white-space: nowrap; transition: filter .15s, box-shadow .15s, opacity .15s; }
.abd-btn.primary { color: #fff; background: linear-gradient(180deg, var(--abd-btn-top), var(--abd-btn-bot));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3); }
.abd-btn.primary:hover:not(:disabled) { filter: brightness(1.12); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 8px 26px -6px rgba(61, 155, 255, .55); }
.abd-btn.ghost { background: var(--abd-surface2); box-shadow: inset 0 0 0 1px var(--abd-border2); color: var(--fg); }
.abd-btn.ghost:hover:not(:disabled) { background: var(--abd-surface3); }
.abd-btn.small { height: 34px; padding: 0 16px; }
.abd-btn:disabled { opacity: .45; cursor: default; }

/* chips */
.abd-chip { display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 8px; border-radius: 6px; font-size: 11px;
  font-weight: 600; color: var(--c); background: color-mix(in srgb, var(--c) 10%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 28%, transparent); white-space: nowrap; }

/* toggle */
.abd-tg { width: 42px; height: 22px; border-radius: 11px; position: relative; background: #1a2234; flex: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05); transition: background .2s; }
.abd-tg::after { content: ""; position: absolute; top: 3.5px; left: 3.5px; width: 15px; height: 15px; border-radius: 50%;
  background: #8a97b0; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: transform .22s cubic-bezier(.3, .7, .3, 1), background .2s; }
.abd-tg.on { background: linear-gradient(180deg, var(--abd-btn-top), var(--abd-btn-bot)); }
.abd-tg.on::after { --abd-tg-x: 20px; transform: translateX(20px); background: #fff; }
.abd-tg.busy::after { box-sizing: border-box; background: transparent; box-shadow: none;
  border: 2px solid var(--abd-btn-bot); border-right-color: transparent; animation: abd-spin .7s linear infinite; }
.abd-tg.on.busy::after { background: transparent; border-color: #fff; border-right-color: transparent; }
/* gira no proprio eixo: a translacao do "ligado" vem antes da rotacao, senao a bolinha orbita */
@keyframes abd-spin {
  from { transform: translateX(var(--abd-tg-x, 0px)) rotate(0deg); }
  to { transform: translateX(var(--abd-tg-x, 0px)) rotate(360deg); }
}

/* cards de otimizacao */
.abd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.abd-card { position: relative; padding: 18px 18px 16px; border-radius: 14px; background: var(--abd-card); cursor: pointer;
  border: 1px solid rgba(170, 205, 255, .1); display: flex; flex-direction: column; transition: background .15s, border-color .2s; }
.abd-card:hover { background: var(--abd-card-hi); border-color: rgba(170, 205, 255, .18); }
.abd-card.on { border-color: rgba(61, 155, 255, .45); background: linear-gradient(180deg, rgba(61, 155, 255, .085), transparent 70%), var(--abd-card); }
.abd-card .t { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.abd-card h5 { margin: 0; font-size: 14.5px; font-weight: 600; line-height: 22px; }
.abd-card p { margin: 8px 0 14px; color: var(--fg-50); font-size: 12.5px; line-height: 1.5; flex: 1; }
.abd-card .chips { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 12px; border-top: 1px solid var(--abd-border); }

/* abas segmentadas */
.abd-seg { display: inline-flex; padding: 4px; border-radius: 11px; background: var(--abd-surface);
  box-shadow: inset 0 0 0 1px var(--abd-border); margin-bottom: 4px; flex-wrap: wrap; }
.abd-seg button { height: 30px; padding: 0 13px; border-radius: 8px; color: var(--fg-50); font-weight: 600; font-size: 12.5px;
  display: inline-flex; align-items: center; gap: 7px; transition: color .15s, background .15s; }
.abd-seg button:hover { color: var(--fg-70); }
.abd-seg button.on { color: var(--fg); background: linear-gradient(180deg, rgba(160, 200, 255, .13), rgba(160, 200, 255, .07));
  box-shadow: inset 0 0 0 1px var(--abd-border2); }
.abd-seg em { font-style: normal; font-size: 10.5px; padding: 1px 6px; border-radius: 5px; background: var(--abd-surface2); color: var(--fg-50); }
.abd-seg button.on em { background: rgba(61, 155, 255, .22); color: var(--abd-blue-text); }

/* hero (inicio / smart boost) */
.abd-hero { position: relative; display: flex; align-items: center; gap: 34px; padding: 26px 28px 26px 38px; border-radius: 18px;
  overflow: hidden; background: linear-gradient(90deg, #0f2547, #0a101e); border: 1px solid rgba(108, 196, 255, .3); }
.abd-hero::before { content: ""; position: absolute; left: -80px; top: -110px; width: 380px; height: 280px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(61, 155, 255, .3), transparent); pointer-events: none; }
.abd-ring { position: relative; width: 124px; height: 124px; flex: none; }
.abd-ring svg { width: 100%; height: 100%; rotate: -90deg; }
.abd-ring circle { fill: none; stroke-width: 10; stroke-linecap: round; }
.abd-ring .bg { stroke: rgba(160, 200, 255, .1); }
.abd-ring .fg { stroke: var(--abd-btn-top); transition: stroke-dashoffset .6s cubic-bezier(.3, .7, .3, 1); }
.abd-ring .val { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.abd-ring b { font-size: 26px; font-weight: 700; line-height: 1; }
.abd-ring small { font-size: 11px; color: var(--fg-50); margin-top: 4px; }
.abd-hero .txt { position: relative; flex: 1; min-width: 0; }
.abd-hero h4 { margin: 0 0 8px; font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.abd-hero p { margin: 0 0 14px; color: var(--fg-70); font-size: 13px; max-width: 460px; }
.abd-hero .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.abd-hero .acts { position: relative; display: flex; flex-direction: column; gap: 10px; width: 176px; flex: none; }

/* cards de estatistica / acoes */
.abd-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 18px; }
.abd-box { padding: 16px; border-radius: 14px; background: var(--abd-card); border: 1px solid rgba(170, 205, 255, .1); }
.abd-box .top { display: flex; gap: 10px; align-items: center; }
.abd-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; color: var(--c);
  background: color-mix(in srgb, var(--c) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 25%, transparent); }
.abd-box .lbl { font-size: 11.5px; font-weight: 600; color: var(--fg-50); }
.abd-box .sub { font-size: 11px; color: var(--fg-30); }
.abd-box .big { font-size: 24px; font-weight: 700; margin: 12px 0 10px; letter-spacing: -.01em; }
.abd-bar { height: 5px; border-radius: 3px; background: var(--abd-surface2); overflow: hidden; }
.abd-bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--a, var(--abd-btn-top)), var(--b, var(--abd-btn-bot)));
  transition: width .6s cubic-bezier(.3, .7, .3, 1); }
.abd-acts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.abd-act { text-align: left; padding: 16px; border-radius: 14px; background: var(--abd-card); border: 1px solid rgba(170, 205, 255, .1);
  transition: background .15s, border-color .15s; display: flex; flex-direction: column; gap: 4px; }
.abd-act:hover { background: var(--abd-card-hi); border-color: rgba(170, 205, 255, .2); }
.abd-act .abd-ico { width: 38px; height: 38px; margin-bottom: 10px; }
.abd-act b { font-size: 13.5px; font-weight: 600; }
.abd-act span { font-size: 11.5px; color: var(--fg-30); }
.abd-act.busy span { color: var(--c); }
.abd-groups { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.abd-group { text-align: left; padding: 16px; border-radius: 14px; background: var(--abd-card); border: 1px solid rgba(170, 205, 255, .1);
  transition: background .15s; }
.abd-group:hover { background: var(--abd-card-hi); }
.abd-group .top { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.abd-group b { display: block; font-size: 13.5px; font-weight: 600; }
.abd-group small { font-size: 11.5px; color: var(--fg-50); }

/* limpeza */
.abd-mem { display: flex; align-items: center; gap: 24px; padding: 22px; border-radius: 16px; position: relative; overflow: hidden;
  background: linear-gradient(90deg, #16123a, #0a101e); border: 1px solid rgba(167, 139, 250, .3); }
.abd-mem .info { flex: 1; min-width: 0; }
.abd-mem .n { font-size: 34px; font-weight: 700; margin: 10px 0 8px; }
.abd-mem .n span { font-size: 13px; font-weight: 400; color: var(--fg-50); margin-left: 6px; }
.abd-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.abd-tool { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 14px; background: var(--abd-card);
  border: 1px solid rgba(170, 205, 255, .1); }
.abd-tool .d { flex: 1; min-width: 0; }
.abd-tool b { display: block; font-size: 14px; font-weight: 600; }
.abd-tool small { display: block; font-size: 12px; color: var(--fg-50); margin-top: 2px; }
.abd-auto { margin-top: 14px; padding: 18px 22px; border-radius: 16px; background: var(--abd-card); border: 1px solid rgba(170, 205, 255, .1); }
.abd-auto .top { display: flex; gap: 14px; align-items: flex-start; }
.abd-auto .top .d { flex: 1; }
.abd-auto b { font-size: 15px; font-weight: 600; }
.abd-auto small { display: block; color: var(--fg-50); font-size: 12px; margin-top: 2px; }
.abd-auto .st { margin-top: 14px; font-size: 11.5px; color: var(--fg-50); display: flex; align-items: center; gap: 8px; }
.abd-auto .st i { width: 7px; height: 7px; border-radius: 50%; background: var(--fg-30); }
.abd-auto.on .st i { background: var(--abd-ok); box-shadow: 0 0 8px rgba(74, 222, 128, .6); }

/* toast */
.abd-toast { position: absolute; left: 50%; bottom: 22px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 10px; padding: 0 20px 0 12px; height: 44px; border-radius: 22px; background: #111a2e;
  box-shadow: inset 0 0 0 1px rgba(74, 222, 128, .4), 0 12px 30px rgba(0, 0, 0, .4); font-weight: 500; white-space: nowrap;
  transition: opacity .25s, transform .25s; z-index: 5; }
.abd-toast.show { opacity: 1; transform: translate(-50%, 0); }
.abd-toast i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: var(--abd-ok);
  background: rgba(74, 222, 128, .16); }

.abd-note { text-align: center; color: var(--fg-30); font-size: 12.5px; margin: 14px 0 0; }

/* telas menores: sem sidebar (vira abas em cima) e cards em 1 coluna */
.abd-mtabs { display: none; }
@media (max-width: 980px) {
  .abd-body.has-side { grid-template-columns: 68px 1fr; }
  .abd-side { display: none; }
  .abd-mtabs { display: flex; gap: 6px; overflow-x: auto; margin: -6px 0 18px; scrollbar-width: none; }
  .abd-mtabs button { height: 32px; padding: 0 12px; border-radius: 8px; background: var(--abd-surface2); color: var(--fg-70);
    font-weight: 600; font-size: 12px; white-space: nowrap; }
  .abd-mtabs button.on { background: rgba(61, 155, 255, .2); color: var(--fg); }
  .abd-stats, .abd-acts { grid-template-columns: 1fr 1fr; }
  .abd-groups { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .abd { height: 620px; border-radius: 14px; }
  .abd-body, .abd-body.has-side { grid-template-columns: 52px 1fr; }
  .abd-rail button { width: 38px; height: 38px; }
  .abd-rail button.on::before { left: -7px; }
  .abd-main { padding: 20px 16px 24px; }
  .abd-grid, .abd-tools, .abd-groups { grid-template-columns: 1fr; }
  .abd-head { flex-direction: column; }
  .abd-hero { flex-direction: column; align-items: flex-start; padding: 22px; gap: 18px; }
  .abd-hero .acts { width: 100%; }
  .abd-mem { flex-direction: column; align-items: flex-start; }
  .abd-demo-tag { display: none; }
}
