/* ===== LabExpert VDI ===== */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700;800&display=swap');

:root {
  --blue:    #212492;   /* principal */
  --sky:     #00A2FF;   /* secundária */
  --cyan:    #3FCFD5;   /* secundária */
  --yellow:  #F5EC5A;   /* secundária */
  --green:   #C0F021;   /* exclusiva */
  --blue-700:#1a1c75;
  --blue-50: #eef0ff;
  --ink:     #15173a;
  --muted:   #6b7191;
  --line:    #e6e9f2;
  --bg:      #f5f7fb;
  --card:    #ffffff;
  --ok:      #14b86a;
  --danger:  #e53958;
  --grad: linear-gradient(100deg, var(--blue) 0%, var(--sky) 45%, var(--cyan) 75%, var(--green) 100%);
  --shadow: 0 10px 30px rgba(33,36,146,.08);
  --shadow-sm: 0 4px 14px rgba(33,36,146,.06);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body {
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink); min-height: 100vh; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3 { font-weight: 800; letter-spacing: -.02em; }
h2 { margin: 30px 0 16px; font-size: 1.15rem; color: var(--ink); }
.muted { color: var(--muted); }
.error { color: var(--danger); font-size: .9rem; }

/* marca */
.logo { font-weight: 800; font-size: 1.35rem; letter-spacing: -.04em; color: #fff; }
.logo b { font-weight: 800; }
.logo .vdi { background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; }

button {
  cursor: pointer; border: none; border-radius: 12px; font-family: inherit;
  font-size: .95rem; font-weight: 700; padding: 12px 18px;
  background: var(--blue); color: #fff; transition: transform .08s, filter .15s, box-shadow .15s;
}
button:hover { filter: brightness(1.07); }
button:active { transform: scale(.98); }
button:disabled { opacity: .55; cursor: default; }
.btn-grad { background: var(--grad); color: #04114a; }
.btn-grad:hover { box-shadow: 0 8px 22px rgba(0,162,255,.35); filter: none; }
.ghost { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.25); }
button.mini { padding: 6px 12px; font-size: .82rem; border-radius: 9px; }
button.mini.danger { background: #fff; color: var(--danger); border: 1px solid #f3c6cf; }
select.mini { padding: 6px 10px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-family: inherit; }

input, select { font-family: inherit; }

/* ===== LOGIN ===== */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1100px 700px at 80% -20%, var(--sky) 0%, var(--blue) 45%, var(--blue-700) 100%); }
.login-card { width: 100%; max-width: 400px; background: var(--card); border-radius: 22px;
  padding: 34px 30px; box-shadow: 0 30px 60px rgba(10,12,60,.35); }
.login-card .brand-line { font-size: 1.7rem; font-weight: 800; letter-spacing: -.04em; color: var(--blue); }
.login-card .brand-line .vdi { background: var(--grad); -webkit-background-clip: text;
  background-clip: text; -webkit-text-fill-color: transparent; }
.login-card .sub { color: var(--muted); margin: 6px 0 22px; font-size: .92rem; }
label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 14px; font-weight: 600; }
input { width: 100%; margin-top: 6px; padding: 12px 14px; border-radius: 11px;
  border: 1.5px solid var(--line); background: #fbfcff; color: var(--ink); font-size: .95rem; }
input:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 4px rgba(0,162,255,.12); }
#login-btn { width: 100%; margin-top: 4px; }

/* ===== TOPBAR ===== */
.topbar { display: flex; justify-content: space-between; align-items: center;
  padding: 14px 28px; background: var(--blue); position: sticky; top: 0; z-index: 50; }
.topbar .user { display: flex; align-items: center; gap: 12px; color: #fff; font-size: .9rem; font-weight: 600; }
.topbar .user .chip { background: rgba(255,255,255,.14); padding: 5px 12px; border-radius: 20px; }
.container { max-width: 1180px; margin: 0 auto; padding: 26px; }
.page-title { font-size: 1.55rem; margin: 6px 0 2px; }
.page-sub { color: var(--muted); margin-bottom: 8px; }

/* ===== GAUGES (recursos do cliente) ===== */
.gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.gauge { background: var(--card); border-radius: 18px; padding: 22px; box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 18px; border: 1px solid var(--line); }
.gauge .ring { position: relative; width: 92px; height: 92px; flex-shrink: 0; }
.gauge .ring svg { transform: rotate(-90deg); }
.gauge .ring .pct { position: absolute; inset: 0; display: grid; place-items: center;
  font-weight: 800; font-size: 1.05rem; color: var(--blue); }
.gauge .info .lbl { font-size: .8rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.gauge .info .val { font-size: 1.15rem; font-weight: 800; margin-top: 4px; }
.gauge .info .val small { font-weight: 600; color: var(--muted); font-size: .8rem; }

/* ===== LOJA (cards de flavor) ===== */
.store { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.product { background: var(--card); border-radius: 18px; overflow: hidden; border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; transition: transform .12s, box-shadow .15s; }
.product:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.product .cap { height: 84px; background: var(--grad); position: relative; display: flex;
  align-items: flex-end; padding: 14px 18px; }
.product .cap .os { color: #fff; font-weight: 800; font-size: 1.05rem; text-shadow: 0 1px 6px rgba(0,0,0,.18); }
.product .cap .hook { position: absolute; top: 12px; right: 14px; width: 30px; height: 30px;
  border-radius: 9px 0 9px 9px; background: rgba(255,255,255,.85); }
.product .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.product .name { font-weight: 800; font-size: 1.05rem; }
.product .specs { display: flex; flex-wrap: wrap; gap: 8px; }
.product .spec { background: var(--blue-50); color: var(--blue); font-weight: 700; font-size: .78rem;
  padding: 5px 10px; border-radius: 8px; display: inline-flex; align-items: center; gap: 5px; }
.product .spec .spec-ico { width: 15px; height: 15px; flex: none; }
.product .body button { margin-top: auto; width: 100%; }

/* ===== DESKTOPS DO CLIENTE ===== */
.desktops { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.desktop { background: var(--card); border-radius: 18px; border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.desktop .dk-head { display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; }
.desktop .dk-name { font-weight: 800; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.desktop .dk-meta { font-size: .85rem; color: var(--muted); line-height: 1.6; text-align: center; }
.desktop .dk-thumb { display: block; width: 100%; max-height: 150px; object-fit: cover;
  border-radius: 12px; margin: 10px 0; background: #0b0d2a; border: 1px solid var(--blue-50, #e6ecff); }
.desktop .dk-actions { display: flex; gap: 8px; }
.desktop .dk-actions button { flex: 1; }
.badge { font-size: .72rem; padding: 4px 10px; border-radius: 20px; font-weight: 700; }
.badge.on { background: rgba(20,184,106,.13); color: var(--ok); }
.badge.off { background: rgba(107,113,145,.13); color: var(--muted); }
.badge.other { background: rgba(245,236,90,.25); color: #8a7a08; }
.btn-on { background: var(--green); color: #20330a; }
.btn-off { background: var(--danger); color: #fff; }

.empty { background: var(--card); border: 1.5px dashed var(--line); border-radius: 18px;
  padding: 34px; text-align: center; color: var(--muted); }

/* ===== ADMIN ===== */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tab { background: transparent; color: var(--muted); border-radius: 0; padding: 12px 16px;
  font-weight: 700; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tab.active { color: var(--blue); border-bottom-color: var(--sky); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px,1fr)); gap: 16px; }
.metric { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: var(--shadow-sm); }
.metric .lbl { font-size: .78rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing:.03em; }
.metric .val { font-size: 1.1rem; font-weight: 800; margin: 6px 0 10px; }
.bar { height: 8px; border-radius: 6px; background: var(--blue-50); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--grad); }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.inline-form input, .inline-form select { width: auto; margin: 0; flex: 1 1 130px; min-width: 90px; padding: 10px 12px; }
.inline-form button { flex: 0 0 auto; }
.tbl table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm); }
.tbl th, .tbl td { text-align: left; padding: 12px 14px; font-size: .9rem; border-bottom: 1px solid var(--line); }
.tbl th { color: var(--muted); font-weight: 700; background: #fafbff; text-transform: uppercase; font-size:.72rem; letter-spacing:.04em; }
.tbl tr:last-child td { border-bottom: none; }

/* ===== ADMIN OVERVIEW ===== */
#adm-overview { display: block; }
.ov-section { margin-bottom: 26px; }
.ov-head { font-weight: 800; font-size: 1rem; margin-bottom: 14px; color: var(--ink); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; box-shadow: var(--shadow-sm); }
.stat-num { font-size: 1.8rem; font-weight: 800; color: var(--blue); letter-spacing: -.02em; }
.stat-num small { font-size: .9rem; color: var(--muted); font-weight: 700; margin-left: 2px; }
.stat-lbl { font-size: .8rem; color: var(--muted); font-weight: 600; margin-top: 2px; }

/* ===== MODAL ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,17,58,.55); backdrop-filter: blur(3px);
  display: grid; place-items: center; z-index: 200; padding: 20px; }
.modal { background: var(--card); border-radius: 20px; padding: 28px; width: 100%; max-width: 420px;
  box-shadow: 0 30px 70px rgba(10,12,60,.4); position: relative; animation: pop .15s ease; }
@keyframes pop { from { transform: scale(.96); opacity: .6; } to { transform: scale(1); opacity: 1; } }
.modal h3 { font-size: 1.3rem; color: var(--blue); }
.modal-sub { color: var(--muted); margin: 4px 0 18px; font-size: .9rem; }
.modal-note { color: var(--muted); font-size: .8rem; text-align: center; margin-top: 12px; }
.modal-close { position: absolute; top: 14px; right: 16px; background: transparent; color: var(--muted);
  font-size: 1.5rem; padding: 0; width: 32px; height: 32px; line-height: 1; }
.modal-close:hover { color: var(--ink); filter: none; }

/* ícone de SO na loja */
.product .cap .os-ico { position: absolute; top: 12px; right: 14px; width: 34px; height: 34px; }
.product .cap .hook { display: none; }

/* provisionamento assíncrono: spinner + badges */
.spinner { width: 18px; height: 18px; border: 2px solid var(--blue-50, #cfe0ff);
  border-top-color: var(--blue, #212492); border-radius: 50%; display: inline-block;
  animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.prov-box { display: flex; align-items: center; gap: 10px; padding: 12px 0 6px;
  color: var(--blue, #212492); font-weight: 600; font-size: .92rem; }
.badge-prov { font-size: .72rem; font-weight: 700; color: #7a5b00; background: #fff4cc;
  padding: 3px 10px; border-radius: 999px; }
.badge-err { font-size: .72rem; font-weight: 700; color: #a11119; background: #ffe1e1;
  padding: 3px 10px; border-radius: 999px; }
.dk-meta.error { color: #a11119; }
