/* Intelibs RF Studio dashboard — same light palette as the apps. */
:root {
  --navy: #0a1a2f;
  --blue: #1d5fae;
  --blue-soft: #e8f1fb;
  --teal: #0e9f8e;
  --teal-soft: #e2f7f4;
  --green: #1fa463;
  --amber: #d98a00;
  --red: #d64545;
  --lime: #8dc63f;

  --bg: #f5f7fa;
  --card: #ffffff;
  --card-alt: #f0f4f9;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;

  --ink: #0f1b2d;
  --ink2: #475569;
  --ink3: #7a8699;
  --ink4: #a3aebf;

  --radius: 16px;
  --shadow: 0 1px 2px rgba(15, 27, 45, 0.06), 0 8px 24px rgba(15, 27, 45, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.loading { padding: 80px; text-align: center; color: var(--ink3); }

button {
  font: inherit;
  cursor: pointer;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  transition: filter 0.15s ease, transform 0.08s ease;
}
button:hover { filter: brightness(1.06); }
button:active { transform: translateY(1px); }
button.ghost { background: transparent; color: var(--blue); border: 1px solid var(--line-strong); }
button.ghost:hover { background: var(--blue-soft); }
button.danger { background: var(--red); }
button.small { padding: 6px 12px; font-size: 13px; border-radius: 8px; }

input, select {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--blue); outline-offset: -1px; border-color: var(--blue); }
label { display: block; font-size: 12.5px; color: var(--ink3); margin-bottom: 5px; font-weight: 600; }
.field { margin-bottom: 14px; }

/* ---- sign in ------------------------------------------------------------ */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(1200px 600px at 50% -10%, #e9f1fb, var(--bg));
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border-radius: 22px;
  padding: 30px;
  box-shadow: var(--shadow);
}
.auth-card img { height: 46px; margin-bottom: 18px; }
.auth-card h1 { font-size: 21px; margin: 0 0 4px; }
.auth-card p.sub { margin: 0 0 22px; color: var(--ink3); font-size: 13.5px; }
.auth-card button { width: 100%; padding: 12px; }

.error { background: #fdecec; color: #8c2a2a; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; margin-bottom: 14px; }
.ok { background: #e6f6ed; color: #14603b; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; margin-bottom: 14px; }

/* ---- shell -------------------------------------------------------------- */
header.top {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 12px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  position: sticky;
  top: 0;
  z-index: 10;
}
header.top img { height: 30px; }
header.top nav { display: flex; gap: 6px; margin-left: 10px; }
header.top nav button {
  background: transparent;
  color: var(--ink2);
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 600;
}
header.top nav button.active { background: var(--blue-soft); color: var(--blue); }
header.top .spacer { flex: 1; }
header.top .who { font-size: 13px; color: var(--ink3); text-align: right; line-height: 1.3; }
header.top .who b { display: block; color: var(--ink); font-size: 13.5px; }

main { padding: 22px; max-width: 1280px; margin: 0 auto; }
h2.section { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink3); margin: 26px 0 12px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.stat .label { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink3); font-weight: 600; }
.stat .value { font-size: 30px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .hint { font-size: 12.5px; color: var(--ink3); }

.list { display: flex; flex-direction: column; gap: 10px; }
.row {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.08s ease;
}
.row:hover { border-color: var(--blue); transform: translateY(-1px); }
.row .grow { flex: 1; min-width: 0; }
.row .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta { font-size: 12.5px; color: var(--ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--card-alt);
  color: var(--ink2);
  white-space: nowrap;
}
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.teal { background: var(--teal-soft); color: var(--teal); }
.badge.green { background: #e6f6ed; color: var(--green); }
.badge.amber { background: #fff4e0; color: var(--amber); }
.badge.red { background: #fdecec; color: var(--red); }

.bar { height: 9px; border-radius: 999px; background: var(--card-alt); overflow: hidden; display: flex; min-width: 120px; }
.bar i { display: block; height: 100%; }
.bar .g { background: var(--green); }
.bar .f { background: var(--amber); }
.bar .p { background: var(--red); }

.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink4); display: inline-block; }
.dot.live { background: var(--green); box-shadow: 0 0 0 4px rgba(31, 164, 99, 0.18); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(31, 164, 99, 0.05); } }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink3); padding: 8px 10px; border-bottom: 2px solid var(--line); }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: none; }

.detail-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.detail-head h1 { margin: 0; font-size: 24px; }
.detail-head .sub { color: var(--ink3); font-size: 13.5px; }
.split { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }

canvas.map { width: 100%; border-radius: 12px; background: var(--card-alt); display: block; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; cursor: pointer; background: var(--card-alt); }

.modal-back { position: fixed; inset: 0; background: rgba(10, 26, 47, 0.55); display: grid; place-items: center; padding: 20px; z-index: 50; }
.modal { background: var(--card); border-radius: 18px; padding: 22px; width: 100%; max-width: 440px; box-shadow: var(--shadow); }
.modal h3 { margin: 0 0 14px; font-size: 18px; }
.modal img { max-width: 100%; border-radius: 12px; }
.modal.wide { max-width: 860px; }
.actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

.empty { text-align: center; padding: 50px 20px; color: var(--ink3); }
.empty b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 6px; }
.mono { font-family: "Cascadia Mono", Consolas, ui-monospace, monospace; }
.right { text-align: right; }
.muted { color: var(--ink3); }
