/* JuppIt web portal — self-contained styling (no Tailwind dependency so it
   doesn't rely on the marketing site's prebuilt utility classes). Dark theme
   matching the JuppIt brand (#020617 bg, #7C5BFF accent, Inter). */

:root {
  --bg: #020617;
  --panel: #0b1222;
  --panel-2: #111a2e;
  --border: #1e293b;
  --text: #e2e8f0;
  --muted: #8b9bb4;
  --accent: #7c5bff;
  --accent-2: #9d7bff;
  --green: #22c55e;
  --red: #ef4444;
  --amber: #f59e0b;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 600px at 50% -200px, #0e1530 0%, var(--bg) 60%);
  color: var(--text);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 14px; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── top bar ── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: rgba(2,6,23,.8); backdrop-filter: blur(8px); z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-logo { width: 30px; height: 30px; border-radius: 8px; display: block; }
.brand-name { font-weight: 700; font-size: 18px; letter-spacing: -.01em; }

/* inline icons (stroke-based, currentColor) */
.ic { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -2px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.user-email { color: var(--muted); font-size: 13px; }

/* ── layout ── */
.container { max-width: 1040px; margin: 0 auto; padding: 28px 22px 64px; }
.view { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── auth card ── */
.auth-view { display: grid; place-items: center; min-height: 70vh; }
.auth-card {
  width: 100%; max-width: 380px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 16px; padding: 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.auth-logo { width: 60px; height: 60px; border-radius: 15px; display: block; margin: 0 auto 16px; box-shadow: 0 8px 24px rgba(124,91,255,.35); }
.auth-card h1 { margin: 0 0 4px; font-size: 24px; text-align: center; }
.auth-card > .muted { text-align: center; }
.auth-card .muted { margin-bottom: 18px; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--panel-2); color: var(--text); font-size: 15px; outline: none;
}
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,91,255,.15); }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); margin: 16px 0; font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.error { color: #fca5a5; font-size: 13px; min-height: 18px; margin: 4px 0 10px; }
.row-between { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }

/* ── buttons ── */
.btn {
  appearance: none; border: 1px solid var(--border); background: var(--panel-2);
  color: var(--text); padding: 10px 14px; border-radius: 10px; font-size: 14px;
  font-weight: 600; cursor: pointer; font-family: inherit; transition: .15s;
}
.btn:hover { border-color: #2c3a52; background: #16223a; }
a.btn { display: inline-block; text-decoration: none; text-align: center; }
a.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: none; color: #fff; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.block { width: 100%; margin-top: 4px; margin-bottom: 8px; }
.btn.small { padding: 7px 12px; font-size: 13px; }
.btn.ghost { background: transparent; }
.btn.link { background: none; border: none; color: var(--accent-2); padding: 6px 2px; }
.btn.link:hover { text-decoration: underline; }
.btn.google { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; background: #fff; color: #1f2937; border: none; }
.btn.google:hover { background: #f3f4f6; }
.btn.loading { position: relative; color: transparent; }
.btn.loading::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── dashboard ── */
.dash-head { margin-bottom: 18px; }
.dash-head h1 { margin: 0 0 4px; font-size: 26px; letter-spacing: -.02em; }

/* tab bar */
.tabs { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.tab {
  display: inline-flex; align-items: center; gap: 7px;
  background: none; border: none; color: var(--muted);
  font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  padding: 10px 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: .15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tab .ic { font-size: 16px; }
.tab-panel { animation: fade .2s ease; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
@media (max-width: 760px) { .grid { grid-template-columns: 1fr; } }
.panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px 18px 20px; margin-bottom: 18px;
}
.panel h2 { margin: 0 0 14px; font-size: 16px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.panel h2 .ic { font-size: 17px; color: var(--accent-2); }
.panel-head { display: flex; align-items: center; justify-content: space-between; }
.list { display: flex; flex-direction: column; gap: 10px; }

/* ── device card ── */
.card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px;
}
.card.empty { display: block; text-align: left; }
.device-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.device-text { min-width: 0; }
.device-name { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.device-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.device-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.lock { color: var(--amber); }
.key-lock { font-size: 12px; margin-left: 4px; vertical-align: middle; }
.key-lock-text { color: var(--accent-2); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 3px rgba(255,255,255,.04); }
.dot.on { background: var(--green); box-shadow: 0 0 10px rgba(34,197,94,.7); }
.dot.off { background: #475569; }
.dot.phone { background: var(--accent); }
.badge { font-size: 11px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.badge.live { color: #c4b5fd; border-color: #4c3a8c; background: rgba(124,91,255,.12); }

/* ── activity ── */
.summary { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 18px; }
.stat {
  min-width: 110px; padding: 12px 16px; border-radius: 14px;
  background: rgba(255,255,255,.03); border: 1px solid var(--border); border-left: 3px solid var(--muted);
}
.stat-value { font-size: 22px; font-weight: 700; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 2px; }
/* Cycle accent colours across the summary cards so each metric is quick to spot. */
.summary .stat:nth-child(1) { border-left-color: #7C5BFF; } .summary .stat:nth-child(1) .stat-value { color: #c4b5fd; }
.summary .stat:nth-child(2) { border-left-color: #38bdf8; } .summary .stat:nth-child(2) .stat-value { color: #7dd3fc; }
.summary .stat:nth-child(3) { border-left-color: #34d399; } .summary .stat:nth-child(3) .stat-value { color: #6ee7b7; }
.summary .stat:nth-child(4) { border-left-color: #fbbf24; } .summary .stat:nth-child(4) .stat-value { color: #fcd34d; }
.summary .stat:nth-child(5) { border-left-color: #f472b6; } .summary .stat:nth-child(5) .stat-value { color: #f9a8d4; }

.table-wrap { overflow-x: auto; }
table.sessions { width: 100%; border-collapse: collapse; font-size: 13px; }
table.sessions th { text-align: left; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.sessions td { padding: 9px 10px; border-bottom: 1px solid #15203a; white-space: nowrap; }
table.sessions tbody tr:nth-child(even) td { background: rgba(255,255,255,.025); }   /* zebra striping */
table.sessions tr:hover td { background: rgba(124,91,255,.10); }
.route { font-size: 11px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); text-transform: uppercase; font-weight: 600; }
.route.lan { color: #86efac; border-color: #14532d; background: rgba(34,197,94,.12); }
.route.turn, .route.remote { color: #fcd34d; border-color: #854d0e; background: rgba(251,191,36,.12); }
.route.srflx { color: #93c5fd; border-color: #1e3a8a; background: rgba(59,130,246,.12); }
/* file-transfer arrows: download green, upload blue */
.files .dn { color: #6ee7b7; font-weight: 600; }
.files .up { color: #93c5fd; font-weight: 600; }
