/* NorthStar — shared look (same palette and wordmark font as the desktop app). */
@font-face {
  font-family: 'NS Cascadia';
  src: local('Cascadia Code'), local('CascadiaCode-Regular'), url('/fonts/CascadiaCode.ttf') format('truetype');
  font-weight: 200 700;
  font-display: swap;
}

:root {
  --bg: #2f2f42;
  --bg-2: #2a2a3b;
  --nav-bg: #3c4057;
  --card: rgba(60, 64, 87, 0.42);
  --card-solid: #36384d;
  --line: rgba(223, 237, 249, 0.09);
  --line-2: rgba(223, 237, 249, 0.16);
  --accent: #4e94ce;
  --accent-hi: #63a6dd;
  --accent-soft: rgba(78, 148, 206, 0.16);
  --text: #dfedf9;
  --text-2: rgba(223, 237, 249, 0.68);
  --text-3: rgba(223, 237, 249, 0.44);
  --red: #e74c3c;
  --amber: #f1c40f;
  --green: #2ecc71;
  --radius: 14px;
  --shadow: 0 0 13px rgba(0, 0, 0, 0.45);
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
  --mono: 'NS Cascadia', 'Cascadia Code', ui-monospace, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-hi); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
img, svg { display: block; }
::selection { background: rgba(78, 148, 206, 0.45); }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }

.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.wordmark { font-family: var(--mono); font-weight: 600; letter-spacing: 0.2px; }
.mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 0.95em; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.hidden { display: none !important; }

/* starfield canvas (same seeded sky as the app) */
.starfield { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }

/* ---------- navbar ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 22px;
  background: var(--nav-bg);
  box-shadow: 0 1px 13px rgba(0, 0, 0, 0.5);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); flex: none; }
.brand:hover { text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.brand .wordmark { font-size: 19px; }
.nav-tabs { flex: 1; display: flex; justify-content: center; gap: 4px; min-width: 0; }
.nav-tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 13px;
  border-radius: 10px;
  color: var(--text-2);
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.nav-tab:hover { color: var(--text); background: rgba(223, 237, 249, 0.06); text-decoration: none; }
.nav-tab.active { color: var(--text); background: var(--accent-soft); }
.nav-tab.active::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: -12px; height: 2px; border-radius: 2px; background: var(--accent); }
.nav-tab .chev { width: 14px; height: 14px; transition: transform 0.2s var(--ease); }
.nav-tab[aria-expanded='true'] .chev { transform: rotate(180deg); }
.nav-right { display: flex; align-items: center; gap: 6px; flex: none; }
.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--text-2);
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: rgba(223, 237, 249, 0.07); color: var(--text); text-decoration: none; }
.icon-btn.active { color: var(--text); background: var(--accent-soft); }
.icon-btn .icon { width: 20px; height: 20px; }
/* animal profile pictures */
.avatar, .nav-avatar { display: inline-grid; place-items: center; flex: none; border-radius: 50%; background: radial-gradient(circle at 35% 30%, rgba(99, 166, 221, 0.35), rgba(78, 148, 206, 0.12) 70%); box-shadow: inset 0 0 0 1px rgba(223, 237, 249, 0.14); overflow: hidden; }
.avatar { width: 40px; height: 40px; }
.avatar img, .nav-avatar img { width: 78%; height: 78%; }
.avatar.sm { width: 30px; height: 30px; }
.avatar.lg { width: 64px; height: 64px; }
.nav-avatar { width: 30px; height: 30px; transition: box-shadow 0.15s; }
.icon-btn:hover .nav-avatar, .icon-btn.active .nav-avatar { box-shadow: inset 0 0 0 1.5px var(--accent-hi); }
.icon-btn.logout:hover { color: var(--red); background: rgba(231, 76, 60, 0.12); }

.menu {
  position: absolute;
  min-width: 190px;
  padding: 6px;
  border-radius: 12px;
  background: #3a3d54;
  border: 1px solid var(--line-2);
  box-shadow: 0 14px 34px -8px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.16s var(--ease), transform 0.16s var(--ease);
  z-index: 60;
}
.menu.open { opacity: 1; transform: none; pointer-events: auto; }
.menu a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text-2); }
.menu a:hover, .menu a.active { background: rgba(223, 237, 249, 0.07); color: var(--text); text-decoration: none; }

.burger { display: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
  box-shadow: 0 6px 18px -8px rgba(78, 148, 206, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: background 0.15s, transform 0.1s, opacity 0.15s;
}
.btn:hover { background: var(--accent-hi); text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.btn.ghost { background: rgba(223, 237, 249, 0.06); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.ghost:hover { background: rgba(223, 237, 249, 0.1); }
.btn.danger { background: transparent; color: var(--red); box-shadow: inset 0 0 0 1px rgba(231, 76, 60, 0.55); }
.btn.danger:hover { background: rgba(231, 76, 60, 0.12); }
.btn.danger.solid { background: var(--red); color: #fff; box-shadow: none; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn.lg { height: 48px; padding: 0 24px; font-size: 15px; border-radius: 13px; }
.btn.block { width: 100%; }
.btn .spinner { width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- cards ---------- */
.card {
  position: relative;
  border-radius: var(--radius);
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012) 45%, rgba(255, 255, 255, 0) 70%), var(--card);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), var(--shadow);
}
.card-pad { padding: 22px; }
.card h2 { font-size: 17px; font-weight: 650; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.label { font-size: 11px; font-weight: 650; letter-spacing: 1.1px; text-transform: uppercase; color: var(--text-3); }
.input, .select, .textarea {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border-radius: 10px;
  background: rgba(20, 20, 32, 0.35);
  border: 1px solid var(--line-2);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.textarea { height: auto; min-height: 120px; padding: 11px 13px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23dfedf9' stroke-opacity='.6' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; background-size: 16px; }
.select option { background: #36384d; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(78, 148, 206, 0.2); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.hint { font-size: 12px; color: var(--text-3); }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }

/* checkbox: same as the installer (accent border + tick; checked fills with the tick cut out) */
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check svg { width: 19px; height: 19px; flex: none; overflow: visible; }
.check .box { fill: none; stroke: var(--accent); stroke-width: 1.6; }
.check .fill { fill: var(--accent); opacity: 0; transition: opacity 0.16s var(--ease); }
.check .tick { fill: none; stroke: var(--accent); stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; transition: opacity 0.16s var(--ease); }
.check input:checked + svg .fill { opacity: 1; }
.check input:checked + svg .tick { opacity: 0; }
.check input:focus-visible + svg .box { stroke: var(--accent-hi); stroke-width: 2.2; }

/* toggle */
.toggle { position: relative; width: 40px; height: 23px; flex: none; }
.toggle input { position: absolute; opacity: 0; inset: 0; cursor: pointer; z-index: 1; }
.toggle span { position: absolute; inset: 0; border-radius: 99px; background: rgba(223, 237, 249, 0.14); transition: background 0.18s; }
.toggle span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform 0.2s var(--ease); }
.toggle input:checked + span { background: var(--accent); }
.toggle input:checked + span::after { transform: translateX(17px); }

/* ---------- misc ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: rgba(223, 237, 249, 0.08); color: var(--text-2); white-space: nowrap; }
.badge.green { background: rgba(46, 204, 113, 0.14); color: var(--green); }
.badge.red { background: rgba(231, 76, 60, 0.14); color: var(--red); }
.badge.amber { background: rgba(241, 196, 15, 0.14); color: var(--amber); }
.badge.blue { background: var(--accent-soft); color: var(--accent-hi); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.dot.green { background: var(--green); box-shadow: 0 0 8px rgba(46, 204, 113, 0.6); }
.dot.red { background: var(--red); }
.flag { width: 22px; height: 16.5px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25); flex: none; }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 11px; font-size: 13px; line-height: 1.5; }
.alert .icon { margin-top: 1px; }
.alert.warn { background: rgba(241, 196, 15, 0.1); border: 1px solid rgba(241, 196, 15, 0.35); color: #f5d94e; }
.alert.error { background: rgba(231, 76, 60, 0.1); border: 1px solid rgba(231, 76, 60, 0.4); color: #f08377; }
.alert.info { background: var(--accent-soft); border: 1px solid rgba(78, 148, 206, 0.35); color: var(--text); }
.alert.ok { background: rgba(46, 204, 113, 0.1); border: 1px solid rgba(46, 204, 113, 0.35); color: #6ee3a0; }

.footer { position: relative; z-index: 1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; max-width: 1180px; margin: 0 auto; padding: 28px 22px 34px; color: var(--text-3); font-size: 12.5px; }
.footer nav { display: flex; gap: 18px; }
.footer a { color: var(--text-2); }

@media (max-width: 900px) {
  .nav { padding: 0 14px; gap: 10px; }
  .burger { display: grid; }
  .nav-tabs {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 2px;
    padding: 10px;
    background: var(--nav-bg);
    box-shadow: 0 14px 24px -10px rgba(0, 0, 0, 0.6);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
  }
  .nav-tabs.open { opacity: 1; transform: none; pointer-events: auto; }
  .nav-tab { height: 42px; }
  .nav-tab.active::after { display: none; }
  .brand .wordmark { font-size: 17px; }
  .row { flex-direction: column; gap: 0; }
}
