/* ============================================================
   LUMILITE — folha de estilos (Lumikit Design System, unificada)
   Gerada a partir dos tokens + componentes originais.
   ============================================================ */

/* ===========================================================================
   Lumikit — Color tokens
   ---------------------------------------------------------------------------
   Dark, low-power palette for embedded device interfaces. Teal-slate
   surfaces (deepest → lightest), a PURE-WHITE accent, and three semantic
   hues. Tuned for legibility in low-light environments (labs, racks, field).

   Canonical variable names (--acc, --bg, --bg2, --bg3, --card, --border,
   --txt, --txt-m, --ok, --err, --warn) are the brand's public contract —
   product code references these directly. Do not rename them.
   =========================================================================== */

:root {
  /* ---- Accent: pure white -------------------------------------------- */
  --acc:      #ffffff;               /* primary accent (pure white) */
  --acc-d:    #cccccc;               /* darkened accent (hover) */
  --acc-glow: rgba(255, 255, 255, .08); /* soft accent halo / hover wash */

  /* ---- Backgrounds (deepest → lightest) ------------------------------ */
  --bg:    #1B282E;   /* global background */
  --bg2:   #141e23;   /* sidebar / topbar / login (deepest chrome) */
  --bg3:   #223039;   /* section backgrounds / inputs */
  --card:  #1e2d34;   /* cards / panels */

  /* ---- Borders & text ------------------------------------------------ */
  --border: #2b3e48;
  --txt:    #d8eaec;  /* primary text */
  --txt-m:  #7a9ea6;  /* secondary / muted text */

  /* ---- Semantic ------------------------------------------------------- */
  --ok:    #4caf86;
  --err:   #d9534f;
  --warn:  #e0973a;

  /* Soft semantic fills (badges, banners) — derived from the hues above */
  --ok-bg:   rgba(76, 175, 134, .15);
  --err-bg:  rgba(217, 83, 79, .12);
  --warn-bg: rgba(224, 151, 58, .12);

  /* ---- Convenience aliases (optional, map to the canonical names) ----- */
  --surface-app:   var(--bg);
  --surface-chrome: var(--bg2);
  --surface-inset: var(--bg3);
  --surface-card:  var(--card);
  --text-body:     var(--txt);
  --text-muted:    var(--txt-m);
  --focus:         var(--acc);

  /* Selection: subtle white wash, keep text legible */
  --selection-bg: rgba(255, 255, 255, .16);
}

::selection { background: var(--selection-bg); color: var(--acc); }

/* ===========================================================================
   Lumikit — Typography tokens
   ---------------------------------------------------------------------------
   System-font first. Embedded device UIs are flash-constrained and run
   offline — so NO webfont downloads. The UI font is the platform default
   ('Segoe UI' / system-ui), which keeps payloads tiny and rendering crisp
   on the low-light panels these interfaces ship on.

   Monospace is reserved for technical identifiers only — IPs, UIDs, MACs,
   metric read-outs, stepper values. Do not set body copy in mono.
   =========================================================================== */

:root {
  /* ---- Families ------------------------------------------------------- */
  --font-sans: 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* Brand-semantic aliases */
  --font-ui:     var(--font-sans);  /* everything by default */
  --font-data:   var(--font-mono);  /* IPs, UIDs, metric values */

  /* ---- Weights -------------------------------------------------------- */
  --fw-regular:  400;  /* @kind font */
  --fw-medium:   600;  /* @kind font */
  --fw-bold:     700;  /* @kind font */

  /* ---- Type scale (rem, 16px base) ------------------------------------ */
  --fs-metric:     1.55rem;  /* large metric read-out (weight 800, accent) */
  --fs-page-title: 1.05rem;  /* page-bar <h2> */
  --fs-body-lg:    .9rem;    /* primary body */
  --fs-body:       .88rem;   /* body / card content */
  --fs-btn:        .85rem;   /* button label */
  --fs-data:       .82rem;   /* monospace identifiers */
  --fs-label:      .78rem;   /* form field label */
  --fs-muted:      .76rem;   /* subtitles / muted */
  --fs-badge:      .72rem;   /* badge / pill */

  /* Card-title is body-sized but bold, uppercase, accent — see helper */
  --fs-card-title: .88rem;

  /* ---- Line heights --------------------------------------------------- */
  --lh-tight:   1.2;   /* @kind other */
  --lh-body:    1.5;   /* @kind other */
  --lh-relaxed: 1.65;  /* @kind other */

  /* ---- Letter spacing ------------------------------------------------- */
  --ls-tight:    -0.01em;  /* @kind other */
  --ls-normal:   0em;      /* @kind other */
  --ls-label:    0.02em;   /* @kind other */
  --ls-btn:      0.03em;   /* @kind other */
  --ls-card:     0.04em;   /* @kind other */ /* uppercase card titles */
  --ls-table:    0.06em;   /* @kind other */ /* uppercase table headers */
}

/* ---- Helper classes (consumers may use tokens directly instead) ------- */
.lk-card-title {
  font-family: var(--font-ui);
  font-size: var(--fs-card-title);
  font-weight: var(--fw-bold);
  color: var(--acc);
  letter-spacing: var(--ls-card);
  text-transform: uppercase;
}
.lk-metric {
  font-family: var(--font-ui);
  font-size: var(--fs-metric);
  font-weight: 800;
  color: var(--acc);
  line-height: var(--lh-tight);
}
.lk-data {
  font-family: var(--font-data);
  font-size: var(--fs-data);
  color: var(--txt-m);
}
.lk-label {
  font-family: var(--font-ui);
  font-size: var(--fs-label);
  color: var(--txt-m);
  letter-spacing: var(--ls-label);
}

/* ===========================================================================
   Lumikit — Spacing, sizing & layout tokens
   ---------------------------------------------------------------------------
   The system is built on tight, dense spacing — these are control panels,
   not marketing pages. Values mirror the real component paddings/gaps.
   =========================================================================== */

:root {
  /* ---- Spacing scale -------------------------------------------------- */
  --space-1:  4px;
  --space-2:  6px;
  --space-3:  8px;
  --space-4:  10px;
  --space-5:  13px;
  --space-6:  16px;   /* default block gap (card margin-bottom) */
  --space-7:  20px;   /* card padding */
  --space-8:  28px;
  --space-9:  32px;
  --space-10: 44px;

  /* ---- Layout --------------------------------------------------------- */
  --sidebar:        200px;   /* fixed sidebar width */
  --page-pad:       20px;    /* .page-content padding */
  --field-gap:      13px;    /* gap between form-groups */
  --row-gap:        10px;    /* gap inside .form-row / .btn-row */

  /* ---- Control sizing ------------------------------------------------- */
  --control-h:      36px;    /* default input/button height (approx) */
  --hit-min:        40px;    /* minimum touch target */
  --btn-pad-y:      9px;
  --btn-pad-x:      18px;
  --input-pad-y:    8px;
  --input-pad-x:    11px;

  /* ---- Z-index ladder (from the spec's usage patterns) ---------------- */
  --z-sidebar:      80;      /* @kind other */
  --z-modal:        500;     /* @kind other */
  --z-popup:        1000;    /* @kind other */
  --z-toast:        2000;    /* @kind other */
}

/* ===========================================================================
   Lumikit — Effects: radius, borders, shadow, motion, scrollbar
   ---------------------------------------------------------------------------
   Restrained and functional. One elevation shadow, a single corner radius,
   fast utilitarian transitions. No glow, no gradients, no bounce.
   =========================================================================== */

:root {
  /* ---- Corner radius -------------------------------------------------- */
  --radius:    9px;    /* canonical radius — cards, inputs, buttons */
  --radius-sm: 7px;    /* steppers, small controls */
  --radius-pill: 10px; /* badges */
  --radius-round: 50%; /* avatars, spinners, dots */

  /* ---- Borders -------------------------------------------------------- */
  --border-w:       1px;    /* @kind other */
  --border-w-input: 1.5px;  /* @kind other */
  --border-w-sel:   2px;    /* @kind other */

  /* ---- Elevation ------------------------------------------------------ */
  --shadow:    0 4px 20px rgba(0, 0, 0, .4);   /* canonical panel shadow */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .3);
  --shadow-modal: 0 10px 40px rgba(0, 0, 0, .55);

  /* ---- Motion --------------------------------------------------------- */
  --ease:        cubic-bezier(.4, 0, .2, 1);  /* @kind other */
  --dur-fast:    .1s;    /* @kind other */
  --dur-base:    .15s;   /* @kind other */
  --dur-slow:    .3s;    /* @kind other */
  --press-scale: .97;    /* @kind other */
}

/* ---- Custom scrollbar (brand-standard, thin) -------------------------- */
*::-webkit-scrollbar       { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: var(--bg2); }
*::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
*::-webkit-scrollbar-thumb:hover { background: var(--acc-d); }

/* ===========================================================================
   Lumikit — Base / reset
   ---------------------------------------------------------------------------
   Minimal global defaults so any surface (card, UI kit, specimen) sits on the
   correct background with the correct text colour and font.
   =========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--txt);
  font-family: var(--font-ui);
  font-size: var(--fs-body-lg);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--acc); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Shared keyframes */
@keyframes lk-spin { to { transform: rotate(360deg); } }
@keyframes lk-toast-in  { from { opacity: 0; transform: translateX(-50%) translateY(60px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ===========================================================================
   Lumikit — Component styles
   ---------------------------------------------------------------------------
   The brand's components are class-based CSS (these ship to consumers via
   styles.css). The React primitives in /components are thin wrappers that
   apply these classes, so markup and behaviour stay identical whether a
   consumer writes raw HTML on a device or uses the React library.
   =========================================================================== */

/* ---- Card ------------------------------------------------------------- */
.card {
  background: var(--card);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-7);
  margin-bottom: var(--space-6);
}
.card-title {
  font-size: var(--fs-card-title);
  font-weight: var(--fw-bold);
  color: var(--acc);
  margin-bottom: var(--space-6);
  letter-spacing: var(--ls-card);
  text-transform: uppercase;
}

/* ---- Buttons ---------------------------------------------------------- */
.btn {
  padding: var(--btn-pad-y) var(--btn-pad-x);
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: var(--fs-btn);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-btn);
  transition: opacity var(--dur-base), transform var(--dur-fast);
}
.btn:hover  { opacity: .85; }
.btn:active { transform: scale(var(--press-scale)); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn-acc    { background: var(--acc);    color: var(--bg2); }
.btn-ghost  { background: var(--border); color: var(--txt); }
.btn-danger { background: var(--err);    color: #fff; }
.btn-row    { display: flex; gap: var(--row-gap); flex-wrap: wrap; margin-top: var(--space-6); }

/* ---- Icon button ------------------------------------------------------ */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  background: transparent; border: 1px solid transparent;
  border-radius: var(--radius-sm); color: var(--txt-m); cursor: pointer;
  transition: background var(--dur-base), color var(--dur-base), border-color var(--dur-base), transform var(--dur-fast);
}
.icon-btn:hover  { background: var(--acc-glow); color: var(--txt); border-color: var(--border); }
.icon-btn:active { transform: scale(var(--press-scale)); }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }
.icon-btn.solid  { background: var(--bg3); border-color: var(--border); }
.icon-btn svg, .icon-btn i { width: 18px; height: 18px; display: block; }

/* ---- Form ------------------------------------------------------------- */
.form-group { margin-bottom: var(--field-gap); }
.form-group label {
  display: block;
  font-size: var(--fs-label);
  color: var(--txt-m);
  margin-bottom: 5px;
  letter-spacing: var(--ls-label);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: var(--input-pad-y) var(--input-pad-x);
  background: var(--bg);
  border: var(--border-w-input) solid var(--border);
  border-radius: var(--radius);
  color: var(--txt);
  font-family: var(--font-ui);
  font-size: .9rem;
  transition: border-color .2s;
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--txt-m); opacity: .7; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: var(--acc); }
.form-row { display: flex; gap: var(--row-gap); flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 90px; }

/* Self-contained field controls (so React <Input>/<Select> work standalone,
   not only inside a .form-group). Same look as the .form-group children. */
.lk-input, .lk-select, .lk-textarea {
  width: 100%;
  padding: var(--input-pad-y) var(--input-pad-x);
  background: var(--bg);
  border: var(--border-w-input) solid var(--border);
  border-radius: var(--radius);
  color: var(--txt);
  font-family: var(--font-ui);
  font-size: .9rem;
  transition: border-color .2s;
}
.lk-input::placeholder, .lk-textarea::placeholder { color: var(--txt-m); opacity: .7; }
.lk-input:focus, .lk-select:focus, .lk-textarea:focus { outline: none; border-color: var(--acc); }
.lk-input:disabled, .lk-select:disabled { opacity: .5; cursor: not-allowed; }
.lk-input.mono { font-family: var(--font-data); font-size: var(--fs-data); letter-spacing: .02em; }

/* Monospace input for technical identifiers (IP, UID, MAC) */
.form-group input.mono { font-family: var(--font-data); font-size: var(--fs-data); letter-spacing: .02em; }

/* ---- Checkbox --------------------------------------------------------- */
label.check {
  display: flex;
  align-items: center;
  gap: var(--row-gap);
  cursor: pointer;
  padding: var(--space-2) 0;
  font-size: var(--fs-card-title);
  color: var(--txt);
}
label.check input { width: 16px; height: 16px; accent-color: var(--acc); flex-shrink: 0; }

/* ---- Radio cards ------------------------------------------------------ */
.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: var(--row-gap); }
.radio-card {
  border: var(--border-w-sel) solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  text-align: center;
  transition: border-color var(--dur-base), background var(--dur-base);
}
.radio-card:hover { border-color: var(--acc-d); }
.radio-card.sel   { border-color: var(--acc); background: var(--acc-glow); }
.rc-icon  { display: flex; justify-content: center; margin-bottom: var(--space-2); color: var(--acc); }
.rc-title { font-weight: var(--fw-bold); font-size: .95rem; color: var(--txt); }
.rc-desc  { font-size: .75rem; color: var(--txt-m); margin-top: 2px; }

/* ---- Table ------------------------------------------------------------ */
.tbl { width: 100%; border-collapse: collapse; font-size: .82rem; }
.tbl th {
  color: var(--txt-m);
  font-size: var(--fs-muted);
  text-transform: uppercase;
  letter-spacing: var(--ls-table);
  padding: var(--space-2) var(--space-4);
  border-bottom: var(--border-w-input) solid var(--border);
  text-align: left;
  font-weight: var(--fw-bold);
}
.tbl td { padding: 7px var(--space-4); border-bottom: 1px solid rgba(43, 62, 72, .5); vertical-align: middle; }
.tbl tr:hover td { background: rgba(125, 172, 168, .04); }
.tbl td.mono { font-family: var(--font-data); color: var(--txt-m); font-size: var(--fs-data); }

/* ---- Badges ----------------------------------------------------------- */
.badge { display: inline-block; padding: 2px 8px; border-radius: var(--radius-pill); font-size: var(--fs-badge); font-weight: var(--fw-bold); }
.badge-ok   { background: var(--ok-bg);   color: var(--ok); }
.badge-err  { background: var(--err-bg);  color: var(--err); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-neutral { background: var(--bg3); color: var(--txt-m); }

/* ---- Sub-list (navigable list) ---------------------------------------- */
.sub-list { list-style: none; margin: 0; padding: 0; }
.sub-list li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--txt-m);
  font-size: var(--fs-card-title);
  border: 1px solid transparent;
  margin-bottom: var(--space-1);
  transition: background var(--dur-base), color var(--dur-base);
}
.sub-list li:hover { background: var(--acc-glow); color: var(--txt); border-color: var(--border); }
.sub-list .sub-arr { margin-left: auto; color: var(--border); font-size: 1.1rem; }
.sub-list .sub-title { font-weight: var(--fw-medium); color: var(--txt); }
.sub-list .sub-sub   { font-size: var(--fs-muted); color: var(--txt-m); }
.sub-list .sub-ic    { display: flex; align-items: center; color: var(--txt-m); }
.sub-list .sub-ic svg, .sub-list .sub-ic i { width: 18px; height: 18px; }
.sub-list li:hover .sub-ic { color: var(--txt); }

/* ---- Stepper ---------------------------------------------------------- */
.fx-stepper { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.fx-stepper button {
  background: var(--bg3); border: none; color: var(--txt);
  font-size: 1.1rem; padding: 6px 14px; cursor: pointer;
  transition: background var(--dur-base);
}
.fx-stepper button:hover { background: var(--acc-glow); }
.fx-stepper span { min-width: 44px; text-align: center; font-family: var(--font-data); font-size: .98rem; padding: 0 4px; }

/* ---- Spinner ---------------------------------------------------------- */
.lk-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--acc);
  border-radius: var(--radius-round);
  animation: lk-spin .8s linear infinite;
}

/* ---- Toast ------------------------------------------------------------ */
.lk-toast {
  position: fixed; bottom: 20px; left: 50%;
  transform: translateX(-50%) translateY(60px);
  background: var(--acc); color: var(--bg);
  padding: 10px 22px; border-radius: 8px;
  font-weight: var(--fw-bold); font-size: var(--fs-btn);
  z-index: var(--z-toast);
  transition: transform var(--dur-slow), opacity var(--dur-slow);
  opacity: 0; pointer-events: none;
}
.lk-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.lk-toast.err  { background: var(--err); color: #fff; }

/* ---- Modal / blocking overlay ----------------------------------------- */
.lk-overlay {
  position: fixed; inset: 0; z-index: var(--z-popup);
  background: rgba(0, 0, 0, .75);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.lk-modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-modal);
  padding: 26px 30px;
  min-width: 280px; max-width: 440px;
  text-align: center;
}
.lk-modal-title { font-weight: var(--fw-bold); font-size: 1rem; color: var(--txt); margin-bottom: 9px; }
.lk-modal-body  { color: var(--txt-m); font-size: .85rem; line-height: 1.55; }

/* ---- Sidebar navigation ----------------------------------------------- */
.nav-btn {
  display: flex; align-items: center; gap: 11px;
  width: 100%; text-align: left;
  padding: 9px 12px; margin-bottom: 2px;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius);
  color: var(--txt-m); font-family: var(--font-ui); font-size: var(--fs-card-title);
  cursor: pointer; transition: background var(--dur-base), color var(--dur-base);
}
.nav-btn:hover { background: var(--acc-glow); color: var(--txt); }
.nav-btn.act   { background: var(--acc-glow); color: var(--txt); border-color: var(--border); }
.nav-btn svg, .nav-btn i { width: 17px; height: 17px; flex-shrink: 0; }
.nav-sep { height: 1px; background: var(--border); margin: 10px 4px; opacity: .6; }

/* ============================================================
   Animações da landing page
   ============================================================ */
@keyframes lumi-blink { 0%,49%{opacity:1} 50%,100%{opacity:0} }
@keyframes lumi-pop { from{opacity:0;transform:translateY(8px) scale(.98)} to{opacity:1;transform:none} }

/* Fallback de hover para elementos com atributo [data-hover]
   (aplicado via app.js). Mantido aqui só como documentação. */
