/* ============================================================================
   Device Logs — brand theme for app.devicelogs.com
   Visual language inspired by UniFi / UniFi OS consoles: a clean, neutral light
   surface, hairline borders, one bright blue accent, and a left sidebar shell.
   ========================================================================= */

:root {
  /* UniFi-style bright blue accent */
  --brand-50:  #eaf3ff;
  --brand-100: #d6e7ff;
  --brand-200: #adceff;
  --brand-300: #7db2ff;
  --brand-400: #3d8bff;
  --brand-500: #0f74ff;
  --brand-600: #006fff;   /* primary / active */
  --brand-700: #0057d6;   /* hover */
  --brand-800: #0046ab;
  --accent:    #00b3ff;

  /* Neutral ink + surfaces (cool grays, UniFi-like) */
  --ink:    #1b1c1f;     /* near-black headings */
  --ink-2:  #3b3f46;     /* body */
  --muted:  #6b7280;     /* secondary */
  --faint:  #9aa0aa;     /* tertiary / meta */
  --line:   #e7e8ec;     /* hairline borders */
  --line-2: #f0f1f4;     /* lightest dividers */
  --surface: #ffffff;
  --surface-2: #fafbfc;  /* table heads / subtle fills */
  --bg:     #f6f7f9;     /* app canvas */

  /* Status */
  --ok:   #16a34a;
  --warn: #d97706;
  --down: #e5484d;

  /* Compatibility aliases (legacy hooks) */
  --primary: var(--brand-600);
  --primary-dark: var(--brand-700);
  --panel-from: #0b1524;
  --panel-to: #0a3aa0;

  --sidebar: 15rem;
}

html, body { background-color: var(--bg); color: var(--ink-2); }

.text-ink   { color: var(--ink); }
.text-muted { color: var(--muted); }
.text-faint { color: var(--faint); }
.text-brand { color: var(--brand-600); }

/* ----- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  border-radius: 0.5rem; padding: 0.5rem 0.9rem;
  font-size: 0.875rem; font-weight: 600; line-height: 1;
  cursor: pointer; transition: background-color .14s ease, box-shadow .14s ease, border-color .14s ease, color .14s ease;
}
.btn-primary { background-color: var(--brand-600); color: #fff; }
.btn-primary:hover { background-color: var(--brand-700); }
.btn-ghost { background-color: #fff; color: var(--ink-2); border: 1px solid var(--line); }
.btn-ghost:hover { background-color: var(--surface-2); border-color: #d8dade; color: var(--ink); }
.btn-danger { background-color: #fff; color: var(--down); border: 1px solid #f4c8c9; }
.btn-danger:hover { background-color: #fef4f4; }

/* ----- Forms -------------------------------------------------------------- */
.field {
  margin-top: 0.35rem; display: block; width: 100%;
  border-radius: 0.5rem; border: 1px solid var(--line);
  padding: 0.55rem 0.75rem; color: var(--ink); background-color: #fff;
  font-size: 0.9rem; line-height: 1.25rem;
  transition: border-color .14s ease, box-shadow .14s ease;
}
.field::placeholder { color: var(--faint); }
.field:focus {
  outline: none; border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgb(0 111 255 / .14);
}
.label { display: block; font-size: 0.8125rem; font-weight: 600; color: var(--ink-2); }

/* ----- Surfaces ----------------------------------------------------------- */
.card {
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.625rem;
}
.card-hover { transition: box-shadow .16s ease, border-color .16s ease; }
.card-hover:hover { box-shadow: 0 4px 16px -8px rgb(15 23 42 / .14); border-color: #d8dade; }

.panel-gradient { background-image: linear-gradient(150deg, var(--panel-from), var(--panel-to)); }
.dot-grid {
  background-image: radial-gradient(circle at 1px 1px, rgb(15 23 42 / .05) 1px, transparent 0);
  background-size: 22px 22px;
}

/* ----- Stat tile (UniFi-style) ------------------------------------------- */
.tile { background: #fff; border: 1px solid var(--line); border-radius: 0.625rem; padding: 1.1rem 1.15rem; }
.tile-label { font-size: 0.72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); }
.tile-value { margin-top: 0.4rem; font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; color: var(--ink); line-height: 1; }
.tile-hint  { margin-top: 0.45rem; font-size: 0.78rem; color: var(--muted); }

/* ----- Sidebar nav -------------------------------------------------------- */
.nav-item {
  display: flex; align-items: center; gap: 0.7rem;
  border-radius: 0.5rem; padding: 0.5rem 0.65rem;
  font-size: 0.875rem; font-weight: 500; color: var(--ink-2);
  transition: background-color .12s ease, color .12s ease;
}
.nav-item:hover { background-color: var(--surface-2); color: var(--ink); }
.nav-item.active { background-color: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.nav-item svg { width: 1.15rem; height: 1.15rem; flex: none; color: currentColor; opacity: .9; }

/* ----- Badges ------------------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 0.35rem; border-radius: 999px; padding: 0.15rem 0.55rem; font-size: 0.7rem; font-weight: 600; }
.badge-neutral { background-color: #f1f2f4; color: #565a62; }
.badge-brand   { background-color: var(--brand-50); color: var(--brand-700); }
.badge-ok      { background-color: #e9f7ef; color: #15803d; }
.badge-warn    { background-color: #fdf3e7; color: #b45309; }
.badge-down    { background-color: #fdecec; color: #b42318; }

/* Status dot */
.dot { width: .5rem; height: .5rem; border-radius: 999px; display: inline-block; }
.dot-ok   { background: var(--ok);   box-shadow: 0 0 0 3px rgb(22 163 74 / .14); }
.dot-idle { background: #c4c8cf; }
.dot-down { background: var(--down); box-shadow: 0 0 0 3px rgb(229 72 77 / .14); }

.brand-mark { color: var(--brand-600); }
