/* Central de Tablets — visual no estilo iOS (claro/escuro automático). */
:root {
  --bg: #f2f2f7;
  --card: #ffffff;
  --card-2: #f2f2f7;
  --fill: rgba(118, 118, 128, .12);
  --fill-2: rgba(118, 118, 128, .2);
  --sep: rgba(60, 60, 67, .14);
  --label: #000000;
  --label-2: rgba(60, 60, 67, .62);
  --label-3: rgba(60, 60, 67, .32);
  --blue: #007aff;
  --green: #34c759;
  --orange: #ff9500;
  --red: #ff3b30;
  --gray: #8e8e93;
  --glass: rgba(255, 255, 255, .72);
  --glass-border: rgba(255, 255, 255, .6);
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 28px rgba(0, 0, 0, .1);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .06), 0 24px 60px rgba(0, 0, 0, .18);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI Variable Text", "Segoe UI", Roboto, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI Variable Display", "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1c1c1e;
    --card-2: #2c2c2e;
    --fill: rgba(118, 118, 128, .24);
    --fill-2: rgba(118, 118, 128, .32);
    --sep: rgba(84, 84, 88, .55);
    --label: #ffffff;
    --label-2: rgba(235, 235, 245, .62);
    --label-3: rgba(235, 235, 245, .3);
    --blue: #0a84ff;
    --green: #30d158;
    --orange: #ff9f0a;
    --red: #ff453a;
    --glass: rgba(30, 30, 32, .72);
    --glass-border: rgba(255, 255, 255, .08);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .45);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, .4), 0 24px 60px rgba(0, 0, 0, .6);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--label);
  font: 15px/1.4 var(--font); font-optical-sizing: auto; letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
[hidden] { display: none !important; }
button { font: inherit; letter-spacing: inherit; cursor: pointer; border: 0; background: none; color: inherit; padding: 0; }
input, select { font: inherit; letter-spacing: inherit; color: var(--label); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 45%, transparent); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }

/* botões */
.btn-primary { width: 100%; height: 50px; border-radius: 14px; background: var(--blue); color: #fff;
  font-weight: 600; font-size: 17px; transition: filter .15s, transform .1s; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:active { transform: scale(.985); }
.btn-primary:disabled { opacity: .5; }
.btn-plain { color: var(--blue); font-weight: 500; padding: 6px 4px; }
.btn-plain:hover { opacity: .7; }
.btn-tinted { display: block; width: 100%; margin-top: 10px; padding: 11px 14px; border-radius: 12px;
  background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); font-weight: 600; }
.btn-tinted:hover { background: color-mix(in srgb, var(--blue) 20%, transparent); }
.btn-close { width: 30px; height: 30px; border-radius: 50%; background: var(--fill); display: grid; place-items: center;
  flex: none; }
.btn-close svg { width: 11px; height: 11px; stroke: var(--label-2); stroke-width: 2.2; stroke-linecap: round; }
.btn-close:hover { background: var(--fill-2); }

/* ===================================================================== login / mfa */
.auth-view { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: min(380px, 100%); display: grid; gap: 14px; text-align: center; }
.auth-logo { width: 84px; height: 84px; border-radius: 20px; margin: 0 auto 4px; box-shadow: var(--shadow);
  background: #0b0f1a; object-fit: contain; }
.auth-title { margin: 0; font: 700 30px/1.15 var(--font-display); letter-spacing: -.025em; }
.auth-sub { margin: -6px 0 6px; color: var(--label-2); }
.field-group { background: var(--card); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); text-align: left; }
.field-group input { display: block; width: 100%; border: 0; background: transparent; padding: 15px 16px; font-size: 17px;
  outline: none; }
.field-group input + input { border-top: 1px solid var(--sep); }
.field-group input::placeholder { color: var(--label-3); }
.code-input { text-align: center; letter-spacing: .4em; font-size: 24px !important; font-variant-numeric: tabular-nums; }
.qr-box { justify-self: center; padding: 14px; border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
.qr-box img { display: block; width: 190px; height: 190px; }
.secret-line { margin: -4px 0 4px; font-size: 13px; color: var(--label-2); }
.secret-line code { display: block; margin-top: 4px; font: 600 14px/1.4 ui-monospace, "SF Mono", Consolas, monospace;
  letter-spacing: .06em; color: var(--label); overflow-wrap: anywhere; user-select: all; }
.auth-error { margin: 0; min-height: 1.3em; color: var(--red); font-size: 14px; }
.auth-foot { margin: 4px 0 0; text-align: center; font-size: 13px; color: var(--label-2); }
.auth-foot a { color: var(--blue); text-decoration: none; font-weight: 600; }

/* ===================================================================== estrutura */
#app-view { display: grid; grid-template-rows: auto 1fr; height: 100%; }
.navbar { display: flex; align-items: center; gap: 16px; height: 52px; padding: 0 18px;
  background: var(--glass); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--sep); position: relative; z-index: 1200; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; white-space: nowrap; }
.brand img { width: 28px; height: 28px; border-radius: 7px; background: #0b0f1a; object-fit: contain; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.sync { font-size: 13px; color: var(--label-2); white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.sync::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--label-3); }
.sync.ok::before { background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 22%, transparent); }
.sync.err::before { background: var(--red); }
.user { font-size: 13px; color: var(--label-2); white-space: nowrap; }

.workspace { display: grid; grid-template-columns: 420px 1fr; min-height: 0; }

/* ===================================================================== barra lateral */
.sidebar { display: flex; flex-direction: column; min-height: 0; background: var(--bg); border-right: 1px solid var(--sep); }
.sidebar-head { padding: 18px 18px 6px; display: grid; gap: 12px; }
.large-title { margin: 0; font: 700 34px/1.1 var(--font-display); letter-spacing: -.03em; }
.subtitle { margin: -8px 0 2px; color: var(--label-2); font-size: 14px; }

.searchfield { display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 10px; border-radius: 11px;
  background: var(--fill); }
.searchfield svg { width: 17px; height: 17px; fill: none; stroke: var(--label-2); stroke-width: 2; stroke-linecap: round; flex: none; }
.searchfield input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 16px; }
.searchfield input::placeholder { color: var(--label-2); }
.searchfield:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 30%, transparent); }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 2px; border-radius: 10px;
  background: var(--fill); gap: 2px; }
.segment { position: relative; padding: 6px 4px; border-radius: 8px; font-size: 13px; font-weight: 500; text-align: center;
  display: grid; gap: 0; line-height: 1.2; transition: background .15s; }
.segment .seg-count { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.segment .seg-label { font-size: 12px; color: var(--label-2); display: flex; align-items: center; justify-content: center; gap: 5px; }
.segment .seg-dot { width: 7px; height: 7px; border-radius: 50%; }
.segment:hover:not(.active) { background: var(--fill); }
.segment.active { background: var(--card); box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); }
@media (prefers-color-scheme: dark) { .segment.active { background: #636366; } .segment.active .seg-label { color: #fff; } }

/* escopo (tipo de ativo): abas de texto no estilo iOS */
.scope { display: flex; gap: 18px; margin-top: -2px; border-bottom: 1px solid var(--sep); }
.scope button { padding: 6px 0 9px; font-size: 15px; font-weight: 500; color: var(--label-2); position: relative;
  display: flex; align-items: center; gap: 6px; }
.scope button .scope-count { font-size: 12px; font-weight: 600; color: var(--label-2); background: var(--fill);
  border-radius: 999px; padding: 1px 7px; font-variant-numeric: tabular-nums; }
.scope button.active { color: var(--label); font-weight: 600; }
.scope button.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2.5px;
  border-radius: 2px; background: var(--blue); }
.scope button.active .scope-count { background: color-mix(in srgb, var(--blue) 15%, transparent); color: var(--blue); }

/* ícone do tipo de ativo na lista */
.kind-icon { width: 15px; height: 15px; flex: none; background: var(--label-2);
  -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.kind-icon.tablet { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='2.5' y='1.5' width='11' height='13' rx='2' fill='none' stroke='black' stroke-width='1.5'/%3E%3Ccircle cx='8' cy='12.2' r='.8'/%3E%3C/svg%3E"); }
.kind-icon.computer { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='2.5' y='2.5' width='11' height='8' rx='1.3' fill='none' stroke='black' stroke-width='1.5'/%3E%3Cpath d='M1 13.25h14' stroke='black' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); }
.row-title { display: flex; align-items: center; gap: 7px; min-width: 0; }

.alerts { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px 5px 8px; border-radius: 999px;
  font-size: 13px; font-weight: 500; background: color-mix(in srgb, var(--c) 13%, transparent); color: var(--c);
  transition: background .15s; }
.chip:hover { background: color-mix(in srgb, var(--c) 20%, transparent); }
.chip.active { background: var(--c); color: #fff; }
.chip .chip-count { font-weight: 700; font-variant-numeric: tabular-nums; }
.chip svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chip.c-red { --c: var(--red); }
.chip.c-orange { --c: var(--orange); }
.chip.c-blue { --c: var(--blue); }
.chip.c-green { --c: var(--green); cursor: default; }
.chip.c-green:hover { background: color-mix(in srgb, var(--c) 13%, transparent); }

.menus { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.menus select { appearance: none; -webkit-appearance: none; width: 100%; border: 0; border-radius: 10px; padding: 8px 30px 8px 12px;
  background-color: var(--card); box-shadow: var(--shadow); font-size: 14px; font-weight: 500; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%238e8e93' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 12px; text-overflow: ellipsis; }
.menus select option { background: var(--card); color: var(--label); }

.list-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 18px 18px; }
.section-header { margin: 10px 4px 6px; font-size: 13px; color: var(--label-2); text-transform: uppercase; letter-spacing: .02em; }

.inset-list { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow); }
.inset-list li { position: relative; display: grid; grid-template-columns: 12px 1fr auto 10px; gap: 1px 12px; align-items: center;
  padding: 11px 14px 11px 16px; cursor: pointer; transition: background .12s; }
.inset-list li + li::before { content: ""; position: absolute; top: 0; left: 40px; right: 0; border-top: 1px solid var(--sep); }
.inset-list li:hover { background: var(--card-2); }
.inset-list li.selected { background: color-mix(in srgb, var(--blue) 10%, var(--card)); }
.inset-list li::after { content: ""; grid-column: 4; grid-row: 1 / 3; width: 7px; height: 7px; justify-self: end;
  border-right: 2px solid var(--label-3); border-top: 2px solid var(--label-3); transform: rotate(45deg); }
.inset-list li.empty { display: block; padding: 28px 16px; text-align: center; color: var(--label-2); cursor: default; }
.inset-list li.empty::after { display: none; }
.row-name { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-right { grid-column: 3; display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--label-2);
  font-variant-numeric: tabular-nums; }
.row-meta { grid-column: 2 / 4; font-size: 13px; color: var(--label-2); display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
  overflow: hidden; }
.tag { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 6px;
  background: color-mix(in srgb, var(--red) 13%, transparent); color: var(--red); }
.tag.warn { background: color-mix(in srgb, var(--orange) 15%, transparent); color: var(--orange); }
.tag.info { background: color-mix(in srgb, var(--blue) 13%, transparent); color: var(--blue); }
.tag.ok { background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); }
.show-more { display: block; margin: 12px auto 0; }

.dot { width: 10px; height: 10px; border-radius: 50%; grid-row: 1 / 3; }
.dot.online { background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 22%, transparent); }
.dot.offline { background: var(--orange); }
.dot.lost { background: var(--red); }
.dot.revoked { background: var(--gray); }

/* bateria estilo iOS */
.battery { position: relative; display: inline-block; flex: none; width: 23px; height: 11px; border: 1.3px solid var(--label-3); border-radius: 3.5px; padding: 1px; }
.battery::after { content: ""; position: absolute; right: -3.5px; top: 3px; width: 2px; height: 4px; border-radius: 0 1px 1px 0;
  background: var(--label-3); }
.battery-fill { display: block; height: 100%; border-radius: 1.5px; background: var(--label); }
.battery.low .battery-fill { background: var(--red); }
.battery.charging .battery-fill { background: var(--green); }

/* ===================================================================== mapa */
.map-wrap { position: relative; min-height: 0; }
#map { position: absolute; inset: 0; background: var(--card-2); }
@media (prefers-color-scheme: dark) {
  .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.88) saturate(.6); }
}
.leaflet-container { font: inherit; }
.leaflet-bar { border: 0 !important; border-radius: 12px !important; overflow: hidden; box-shadow: var(--shadow) !important; }
.leaflet-bar a { width: 36px !important; height: 36px !important; line-height: 36px !important; background: var(--glass) !important;
  color: var(--label) !important; border-bottom-color: var(--sep) !important;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.leaflet-control-attribution { background: var(--glass) !important; color: var(--label-2) !important; border-radius: 8px 0 0 0;
  font-size: 11px; }
.leaflet-control-attribution a { color: var(--blue) !important; }

.pin { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.pin.online { background: var(--green); }
.pin.offline { background: var(--orange); }
.pin.lost { background: var(--red); }
.pin.revoked { background: var(--gray); }
.pin.computer { border-radius: 5px; }
.pin.selected { width: 22px; height: 22px; margin: -3px; box-shadow: 0 0 0 5px color-mix(in srgb, var(--blue) 35%, transparent), 0 2px 6px rgba(0, 0, 0, .35); }

.c-online { background: var(--green); }
.c-offline { background: var(--orange); }
.c-lost { background: var(--red); }
.c-revoked { background: var(--gray); }
.arc.online { stroke: var(--green); }
.arc.offline { stroke: var(--orange); }
.arc.lost { stroke: var(--red); }
.arc.revoked { stroke: var(--gray); }
.cluster { display: block; overflow: visible; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .25)); }
.cluster .cluster-bg { fill: var(--card); }
.cluster text { fill: var(--label); font-weight: 700; font-size: 12px; font-family: var(--font); }
.cluster:hover .cluster-bg { fill: var(--card-2); }

/* widget de saúde */
.widget { position: absolute; top: 16px; left: 16px; z-index: 1000; width: 250px; padding: 14px 16px 12px;
  border-radius: 22px; background: var(--glass); border: 1px solid var(--glass-border); box-shadow: var(--shadow);
  backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px); }
.widget-caption { margin: 0; font-size: 12px; font-weight: 600; color: var(--label-2); text-transform: uppercase; letter-spacing: .03em; }
.widget-main { display: flex; align-items: baseline; gap: 8px; margin: 2px 0 10px; }
.health-value { font: 700 34px/1.1 var(--font-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.health-label { color: var(--label-2); font-size: 14px; }
.health-bar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--fill); gap: 2px; }
.health-bar span { height: 100%; }
.health-legend { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.health-legend li { display: flex; align-items: center; gap: 8px; }
.health-legend .lg-dot { width: 8px; height: 8px; border-radius: 50%; }
.health-legend .lg-value { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ===================================================================== folha de detalhe */
.sheet { position: absolute; top: 16px; right: 16px; bottom: 16px; width: 390px; z-index: 1100; display: flex; flex-direction: column;
  border-radius: 22px; background: var(--glass); border: 1px solid var(--glass-border); box-shadow: var(--shadow-lg);
  backdrop-filter: saturate(180%) blur(30px); -webkit-backdrop-filter: saturate(180%) blur(30px); overflow: hidden;
  animation: sheet-in .22s cubic-bezier(.2, .8, .2, 1); }
@keyframes sheet-in { from { opacity: 0; transform: translateX(16px) scale(.98); } }
.sheet-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 18px 10px; }
.sheet-titles { min-width: 0; }
.sheet-title { margin: 0; font: 700 22px/1.2 var(--font-display); letter-spacing: -.02em; overflow-wrap: anywhere; }
.sheet-sub { margin: 2px 0 0; color: var(--label-2); font-size: 14px; }
.sheet-body { flex: 1; overflow-y: auto; padding: 0 18px 18px; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.pill { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.pill.online { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.pill.offline { background: color-mix(in srgb, var(--orange) 16%, transparent); color: var(--orange); }
.pill.lost, .pill.alert { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.pill.revoked { background: var(--fill); color: var(--label-2); }

.group-title { margin: 20px 4px 6px; font-size: 13px; color: var(--label-2); text-transform: uppercase; letter-spacing: .02em; }
.group { margin: 0; padding: 0; list-style: none; background: var(--card); border-radius: 12px; overflow: hidden; }
dl.group { display: grid; grid-template-columns: auto 1fr; }
dl.group dt, dl.group dd { margin: 0; padding: 10px 14px; font-size: 14px; border-top: 1px solid var(--sep); }
dl.group dt { color: var(--label); padding-right: 0; }
dl.group dd { text-align: right; color: var(--label-2); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
dl.group dt:first-of-type, dl.group dd:first-of-type { border-top: 0; }
dl.group dd.bad { color: var(--red); font-weight: 600; }
dl.group dd.good { color: var(--green); }
dl.group .empty { grid-column: 1 / -1; text-align: center; color: var(--label-2); }
.events li { display: grid; grid-template-columns: 1fr auto; gap: 1px 10px; padding: 10px 14px; font-size: 14px; }
.events li + li { border-top: 1px solid var(--sep); }
.events .ev-type { font-weight: 600; }
.events .ev-time { color: var(--label-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.events .ev-details { grid-column: 1 / -1; color: var(--label-2); font-size: 13px; overflow-wrap: anywhere; }
.events li.muted { display: block; color: var(--label-2); text-align: center; }

/* ===================================================================== ações remotas */
.list-header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.list-header .btn-plain { font-size: 14px; }

.actions { display: grid; }
.action-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 14px; text-align: left;
  font-size: 15px; color: var(--blue); }
.action-row + .action-row { border-top: 1px solid var(--sep); }
.action-row:hover { background: var(--card-2); }
.action-row.destructive { color: var(--red); }
.action-row .action-sub { margin-left: auto; font-size: 13px; color: var(--label-2); }

.cmd-status { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; justify-self: end; }
.cmd-status.pending, .cmd-status.delivered { background: var(--fill); color: var(--label-2); }
.cmd-status.executed { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.cmd-status.rejected, .cmd-status.expired { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }

/* alerta estilo iOS */
dialog { border: 0; padding: 0; color: var(--label); }
dialog::backdrop { background: rgba(0, 0, 0, .32); backdrop-filter: blur(2px); }
.ios-alert { width: min(300px, calc(100% - 32px)); border-radius: 16px; background: var(--glass); text-align: center;
  backdrop-filter: saturate(180%) blur(30px); -webkit-backdrop-filter: saturate(180%) blur(30px); box-shadow: var(--shadow-lg);
  animation: alert-in .18s ease-out; }
@keyframes alert-in { from { opacity: 0; transform: scale(1.08); } }
.alert-title { margin: 20px 16px 4px; font-size: 17px; font-weight: 600; }
.alert-message { margin: 0 16px 14px; font-size: 13px; color: var(--label); line-height: 1.35; }
.alert-input { width: calc(100% - 32px); margin: 0 16px 16px; padding: 7px 9px; font-size: 13px; border-radius: 8px;
  border: 1px solid var(--sep); background: var(--card); outline: none; }
.alert-buttons { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--sep); }
.alert-btn { padding: 12px; font-size: 17px; color: var(--blue); }
.alert-btn + .alert-btn { border-left: 1px solid var(--sep); }
.alert-btn.strong { font-weight: 600; }
.alert-btn.destructive { color: var(--red); }
.alert-btn:hover { background: var(--fill); }

/* folha de ações (lote) */
.action-sheet { width: min(420px, calc(100% - 16px)); margin: auto auto 12px; background: transparent; overflow: visible;
  animation: sheet-up .22s cubic-bezier(.2, .8, .2, 1); }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
.sheet-group, .sheet-cancel { border-radius: 14px; background: var(--glass); overflow: hidden;
  backdrop-filter: saturate(180%) blur(30px); -webkit-backdrop-filter: saturate(180%) blur(30px); }
.action-sheet-title { margin: 0; padding: 14px 16px; font-size: 13px; color: var(--label-2); text-align: center;
  border-bottom: 1px solid var(--sep); }
.sheet-action { display: block; width: 100%; padding: 16px; font-size: 18px; color: var(--blue); text-align: center; }
.sheet-action + .sheet-action { border-top: 1px solid var(--sep); }
.sheet-action.destructive { color: var(--red); }
.sheet-action:hover, .sheet-cancel:hover { background: var(--fill); }
.sheet-cancel { display: block; width: 100%; margin-top: 8px; padding: 16px; font-size: 18px; font-weight: 600; color: var(--blue); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 3000; max-width: calc(100% - 32px);
  padding: 11px 18px; border-radius: 999px; background: var(--glass); box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 500;
  backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px); animation: alert-in .18s ease-out; }
.toast.error { color: var(--red); }

/* ===================================================================== gerenciar */
.manage { width: min(560px, calc(100% - 24px)); max-height: min(860px, calc(100% - 32px)); border-radius: 22px;
  background: var(--bg); box-shadow: var(--shadow-lg); overflow: hidden; display: none; flex-direction: column;
  animation: alert-in .18s ease-out; }
.manage[open] { display: flex; }
.manage-body { overflow-y: auto; padding: 0 18px 22px; display: grid; gap: 4px; }
.manage-body .segmented { margin-top: 4px; }
.manage-body .segment .seg-count { font-size: 14px; font-weight: 600; }
.form-group { display: grid; }
.form-group input, .form-group select { width: 100%; border: 0; background: transparent; padding: 13px 14px; font-size: 16px;
  outline: none; appearance: none; -webkit-appearance: none; }
.form-group input + input { border-top: 1px solid var(--sep); }
.form-group select { cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%238e8e93' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 12px; }
.form-hint { margin: 8px 4px 12px; font-size: 13px; color: var(--label-2); }
#asset-form .btn-primary, #store-form .btn-primary { margin-top: 4px; }
.code-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.code-row code { flex: 1; min-width: 0; font: 600 15px/1.4 ui-monospace, "SF Mono", Consolas, monospace; overflow-wrap: anywhere;
  user-select: all; }
.howto { padding: 12px 14px; font-size: 14px; display: grid; gap: 8px; }
.howto ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.howto pre { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--fill); font: 13px/1.5 ui-monospace, Consolas, monospace;
  white-space: pre-wrap; overflow-wrap: anywhere; user-select: all; }
.wait-line { margin: 0; padding: 12px 14px; font-size: 14px; display: flex; align-items: center; gap: 10px; }
.wait-line.done { color: var(--green); font-weight: 600; }
.wait-line.expired { color: var(--red); }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--fill-2); border-top-color: var(--blue);
  animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.stores-list li { grid-template-columns: 1fr auto; align-items: center; }
.stores-list .store-meta { grid-column: 1; color: var(--label-2); font-size: 13px; }
.stores-list .store-actions { grid-row: 1 / 3; grid-column: 2; display: flex; gap: 10px; }
.btn-plain.destructive { color: var(--red); }
.form-actions { display: grid; gap: 6px; }
.form-group input + select, .form-group select + input { border-top: 1px solid var(--sep); }
.checks { display: grid; }
.check-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; font-size: 15px; cursor: pointer; }
.check-row + .check-row, #team-stores .check-row { border-top: 1px solid var(--sep); }
.check-row input { width: 18px; height: 18px; accent-color: var(--blue); }
.team-list li { grid-template-columns: 1fr auto; }
.team-list .member-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px;
  color: var(--label-2); }
.team-list .member-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 14px; margin-top: 4px; }
.team-list .member-actions .btn-plain { font-size: 14px; padding: 2px 0; }

/* instalador USB (programa) */
.usb { display: grid; gap: 10px; }
.usb p { margin: 0; }
.usb-device { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.usb-check, .usb-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.usb-check li { display: flex; justify-content: space-between; gap: 10px; }
.usb-check li.ok span:last-child { color: var(--green); }
.usb-check li.bad span:last-child, .usb-check li.problem { color: var(--red); }
.usb-check li.warning { color: var(--orange); }
.usb .group.form-group { margin: 10px 0; }
.usb-count:empty { display: none; }
.usb-actions { display: grid; gap: 6px; }
.usb-go:disabled { opacity: .45; }
.usb-steps li { display: grid; grid-template-columns: 20px 1fr; gap: 0 8px; }
.usb-steps .usb-icon { font-weight: 700; text-align: center; }
.usb-steps .usb-msg { grid-column: 2; font-size: 12px; color: var(--label-2); }
.usb-steps li.pending { color: var(--label-3); }
.usb-steps li.running .usb-icon { color: var(--blue); }
.usb-steps li.done .usb-icon { color: var(--green); }
.usb-steps li.failed .usb-icon, .usb-steps li.failed .usb-msg { color: var(--red); }

/* ===================================================================== telas menores */
@media (max-width: 1100px) {
  .widget { display: none; }
}
@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr; grid-template-rows: 42vh 1fr; }
  .sidebar { order: 2; border-right: 0; border-top: 1px solid var(--sep); }
  .map-wrap { order: 1; }
  .sheet { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: calc(100% - 16px); }
  .user, .brand span { display: none; }
  .large-title { font-size: 28px; }
}
