/*
 * One stylesheet, no CDN: the Praxis website admin. Same teal, card and table
 * treatment as the tracking console. Poppins comes from Google Fonts and falls
 * back to the system stack, so an offline machine looks plain, not broken.
 */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --brand: #289294;
  --brand-dark: #1f7476;
  --brand-tint: #eef8f5;
  --ink: #111827;
  --ink-muted: #6b7280;
  --ink-faint: #8d96a6;
  --line: #e5e9f0;
  --canvas: #f4f7fa;
  --online: #059669;
  --idle: #d97706;
  --offline: #9ca3af;
  --danger: #b3261e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Poppins, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--canvas);
  color: var(--ink);
  font-size: 14px;
}

a { color: var(--brand-dark); }

.tabular { font-variant-numeric: tabular-nums; }
.mono { font-family: "JetBrains Mono", ui-monospace, Consolas, monospace; }

/* --- shell ---------------------------------------------------------------- */

header.top {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 10;
}

header.top .brand { font-weight: 700; color: var(--brand-dark); letter-spacing: .01em; }
header.top .spacer { margin-left: auto; }
header.top .who { color: var(--ink-muted); font-size: 13px; }

nav.tabs {
  display: flex;
  gap: 4px;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

nav.tabs a {
  padding: 10px 14px;
  color: var(--ink-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  font-size: 14px;
}

nav.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
nav.tabs a:hover { color: var(--ink); }

main { padding: 24px; max-width: 1400px; margin: 0 auto; }

h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0 0 12px; }
.subtitle { color: var(--ink-muted); margin: 0 0 20px; }

/* --- cards and tables ----------------------------------------------------- */

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.card.flush { padding: 0; overflow: hidden; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.kpi .label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); }
.kpi .value { font-size: 24px; font-weight: 600; margin-top: 6px; }
.kpi .note { font-size: 12px; color: var(--ink-muted); margin-top: 4px; }

table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--canvas);
  white-space: nowrap;
}
td { padding: 12px 16px; border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--brand-tint); }
.scroll { overflow-x: auto; }

.muted { color: var(--ink-muted); }
/* A second line inside a cell: the offline note under idle. */
.small { display: block; font-size: 11px; color: var(--ink-faint); }
.faint { color: var(--ink-faint); }
.right { text-align: right; }

/* --- controls ------------------------------------------------------------- */

.bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bar .grow { flex: 1; }
.bar .push { margin-left: auto; }
.bar .spacer { margin-left: auto; }

/* --- status --------------------------------------------------------------- */

.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--brand-tint);
  color: var(--brand-dark);
}
.pill.working { background: #e7f6ef; color: var(--online); }
.pill.idle { background: #fdf1e3; color: var(--idle); }
.pill.offline { background: #f1f3f6; color: var(--offline); }
.pill.danger { background: #fdecea; color: var(--danger); }

.notice { border-left: 3px solid var(--online); background: #f2fbf6; }
.alert { border-left: 3px solid var(--danger); background: #fdf3f2; }

/* --- login ---------------------------------------------------------------- */

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login { width: 100%; max-width: 380px; }
.login .card { padding: 28px; }
.login label { display: block; font-size: 13px; color: var(--ink-muted); margin: 14px 0 6px; }
.login input { width: 100%; }
.login .btn { width: 100%; justify-content: center; margin-top: 20px; height: 40px; }

/* --- website CMS -------------------------------------------------------------
   Long forms: labelled fields on a two-column grid that folds to one on a
   phone, and text areas wide enough to write in. */
textarea, input[type="number"], input[type="url"] {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  color: var(--ink);
}
input[type="number"], input[type="url"] { height: 34px; }
textarea { width: 100%; min-height: 80px; resize: vertical; line-height: 1.5; }
textarea:focus, input[type="number"]:focus, input[type="url"]:focus { outline: none; border-color: var(--brand); }
textarea.code { font-family: "JetBrains Mono", ui-monospace, Consolas, monospace; font-size: 13px; min-height: 360px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; }
.form-grid .wide { grid-column: 1 / -1; }
.field > span { display: block; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 6px; }
.field input:not([type="checkbox"]):not([type="file"]), .field select { width: 100%; }
.field .hint { display: block; font-size: 12px; color: var(--ink-muted); margin-top: 4px; }
@media (max-width: 720px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }

.thumb { width: 96px; height: 60px; object-fit: cover; border-radius: 8px; background: var(--canvas); border: 1px solid var(--line); display: block; }
.image-field { display: flex; gap: 12px; align-items: flex-start; }
.image-field .grow { flex: 1; min-width: 0; }
.clip { max-width: 360px; white-space: pre-wrap; word-break: break-word; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; }
