/* ═══════════════════════════════════════════════════════════════
   WeatherGrid Portal — Terminal Green Dark Design System
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ── TOKENS ───────────────────────────────────────────────────── */
:root {
  /* surfaces */
  --bg: #0a0c0b;
  --surface-1: #101312;
  --surface-2: #151918;
  --surface-3: #1b201e;
  --border: #232927;
  --border-strong: #2e3634;

  /* text */
  --text: #e6ebe9;
  --text-2: #9aa5a1;
  --text-3: #6b7671;

  /* accent — green */
  --green: #3ecf8e;
  --green-bright: #4ade9c;
  --green-dim: #2aa06c;
  --green-glow: rgba(62, 207, 142, 0.14);
  --green-line: rgba(62, 207, 142, 0.28);

  /* semantic */
  --amber: #e5a13c;
  --amber-glow: rgba(229, 161, 60, 0.13);
  --amber-line: rgba(229, 161, 60, 0.28);
  --cyan: #4bb3d6;
  --cyan-glow: rgba(75, 179, 214, 0.13);
  --cyan-line: rgba(75, 179, 214, 0.28);
  --red: #ef4444;
  --red-glow: rgba(239, 68, 68, 0.13);

  /* typography */
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', 'Consolas', monospace;
  --sans: 'Inter', system-ui, sans-serif;

  /* spacing */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;

  /* radii */
  --r: 8px;
  --r-sm: 5px;
  --r-xs: 4px;

  /* motion */
  --duration-fast: 100ms;
  --duration-normal: 200ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── RESET ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: #070908;
  min-height: 100vh;
}
body {
  font-family: var(--sans);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  justify-content: center;
}
#app {
  width: 1440px;
  min-height: 100vh;
  background: var(--bg);
}

/* ── KEYFRAMES ────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInSubtle {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--green-glow); }
  50%      { box-shadow: 0 0 0 6px var(--green-glow); }
}
@keyframes navGlow {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(62, 207, 142, 0.28); }
  50%      { box-shadow: inset 0 0 0 1px rgba(62, 207, 142, 0.38), 0 0 12px -4px rgba(62, 207, 142, 0.1); }
}
@keyframes cardGlow {
  0%, 100% { box-shadow: 0 0 0 3px var(--green-glow), 0 0 20px rgba(62, 207, 142, 0.1); }
  50%      { box-shadow: 0 0 0 5px var(--green-glow), 0 0 24px rgba(62, 207, 142, 0.16); }
}

.screen-enter {
  animation: fadeIn var(--duration-normal) var(--ease-out) both;
}

/* ── SHELL ────────────────────────────────────────────────────── */
.shell {
  display: flex;
  min-height: 100vh;
  background-image: radial-gradient(900px 400px at 80% -10%, rgba(62, 207, 142, 0.05), transparent 70%);
}

/* sidebar */
.sidebar {
  width: 244px;
  flex: 0 0 244px;
  background: var(--surface-1);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}
.brand {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
}
.mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(150deg, var(--green), var(--green-dim));
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 1px rgba(62, 207, 142, 0.4), 0 4px 14px rgba(62, 207, 142, 0.22);
}
.mark svg { width: 16px; height: 16px; display: block; }
.brand h1 { font-size: 14.5px; font-weight: 600; letter-spacing: -0.2px; }
.brand span {
  display: block;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--text-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 1px;
}

.navwrap { padding: 18px 12px; flex: 1; overflow: auto; }
.navlabel {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0 8px 9px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-2);
  font-size: 13.2px;
  font-weight: 500;
  margin-bottom: 2px;
  cursor: default;
  transition: background var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out);
}
.nav a svg { width: 15px; height: 15px; flex: 0 0 15px; opacity: 0.75; }
.nav a.active {
  background: var(--green-glow);
  color: var(--green-bright);
  box-shadow: inset 0 0 0 1px var(--green-line);
  animation: navGlow 4s ease-in-out infinite;
}
.nav a.active svg { opacity: 1; }

.sidefoot {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.persona-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.persona-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--green);
  font-weight: 700;
}
.persona-details {
  flex: 1;
  min-width: 0;
}
.persona-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.persona-role {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.logout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 6px 10px;
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  width: 100%;
  transition: color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out);
}
.logout-btn:hover {
  color: var(--red);
  border-color: rgba(239, 68, 68, 0.3);
}
.logout-btn svg { width: 13px; height: 13px; }

/* main area */
.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 64px;
  border-bottom: 1px solid var(--border);
  background: rgba(16, 19, 18, 0.86);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
}
.crumb {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-3);
  letter-spacing: 0.02em;
}
.crumb b { color: var(--text-2); font-weight: 500; }
.crumb .sep { color: var(--border-strong); margin: 0 7px; }
.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-2);
  letter-spacing: 0.04em;
}
.avatar-topbar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--green);
  font-weight: 700;
}

.content { padding: 26px 28px 40px; display: flex; flex-direction: column; gap: 22px; }

/* page head */
.phead { display: flex; align-items: flex-end; gap: 18px; }
.phead h2 { font-size: 23px; font-weight: 650; letter-spacing: -0.5px; }
.phead p { font-size: 13px; color: var(--text-2); margin-top: 5px; }
.readonly {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px dashed var(--border-strong);
  background: var(--surface-1);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.readonly svg { width: 13px; height: 13px; }

/* footer */
.shell-footer {
  border-top: 1px solid var(--border);
  padding: 16px 28px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-3);
  letter-spacing: 0.04em;
}
.shell-footer .r { margin-left: auto; display: flex; gap: 18px; }

/* ── DATA TABLE ───────────────────────────────────────────────── */
.panel {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.phdr {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
}
.phdr .tico {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: var(--green-glow);
  box-shadow: inset 0 0 0 1px var(--green-line);
  color: var(--green-bright);
}
.phdr .tico svg { width: 14px; height: 14px; }
.phdr h3 { font-size: 14px; font-weight: 600; letter-spacing: -0.1px; }
.phdr .id {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.08em;
  margin-top: 2px;
}
.phdr .right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
}
.chip {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-2);
  border: 1px solid var(--border-strong);
  background: var(--surface-3);
  border-radius: var(--r-sm);
  padding: 4px 8px;
  letter-spacing: 0.03em;
}
.chip b { color: var(--green); font-weight: 700; }

table { width: 100%; border-collapse: separate; border-spacing: 0; }
thead th {
  text-align: left;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 10px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: default;
}
thead th.num { text-align: right; }
tbody td {
  padding: 12px 18px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid rgba(35, 41, 39, 0.7);
  vertical-align: middle;
  cursor: default;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr {
  transition: background var(--duration-fast) var(--ease-out);
}
tbody tr:hover td { background: rgba(62, 207, 142, 0.035); }
td.num {
  text-align: right;
  font-weight: 500;
  letter-spacing: -0.2px;
}
td.temp { color: var(--green-bright); }
td.ts {
  font-size: 11.5px;
  color: var(--text-2);
  white-space: nowrap;
}
td.ts span { color: var(--text-3); }

.who {
  display: flex;
  align-items: center;
  gap: 9px;
}
.ini {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  flex: 0 0 24px;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  color: var(--text-2);
}
.who-name {
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.loc-cell {
  font-size: 12.5px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}
.equip-cell { font-size: 12px; color: var(--text); }

.note-cell {
  font-size: 12.5px;
  color: var(--text-2);
  max-width: 330px;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.note-empty {
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 11px;
}

/* status badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--r-sm);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 500;
  white-space: nowrap;
}
.badge i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}
.b-ok {
  color: var(--green);
  background: var(--green-glow);
  box-shadow: inset 0 0 0 1px var(--green-line);
}
.b-warn {
  color: var(--amber);
  background: var(--amber-glow);
  box-shadow: inset 0 0 0 1px var(--amber-line);
}
.b-rep {
  color: var(--cyan);
  background: var(--cyan-glow);
  box-shadow: inset 0 0 0 1px var(--cyan-line);
}

/* panel footer */
.pfoot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-3);
  letter-spacing: 0.03em;
}

/* ── LOGIN SCREEN ─────────────────────────────────────────────── */
.login-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  background-image: radial-gradient(600px 300px at 50% 30%, rgba(62, 207, 142, 0.06), transparent 70%);
  animation: fadeInSubtle 300ms var(--ease-out) both;
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}
.login-brand .mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}
.login-brand .mark svg { width: 20px; height: 20px; }
.login-brand h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.login-brand span {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 2px;
  display: block;
}
.login-subtitle {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: 0.06em;
  margin-bottom: 32px;
  text-transform: uppercase;
}
.persona-cards {
  display: flex;
  gap: 16px;
  margin-bottom: 28px;
}
.persona-card {
  width: 200px;
  padding: 24px 20px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out),
              background var(--duration-fast) var(--ease-out);
  animation: fadeIn 300ms var(--ease-out) both;
}
.persona-card:nth-child(2) { animation-delay: 60ms; }
.persona-card:nth-child(3) { animation-delay: 120ms; }
.persona-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.persona-card.selected {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-glow), 0 0 20px rgba(62, 207, 142, 0.1);
  background: var(--surface-2);
  animation: cardGlow 3s ease-in-out infinite;
}
.persona-card .card-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 2px solid var(--border-strong);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-2);
  margin: 0 auto 14px;
  transition: border-color var(--duration-normal) var(--ease-out),
              color var(--duration-normal) var(--ease-out);
}
.persona-card.selected .card-avatar {
  border-color: var(--green);
  color: var(--green);
}
.persona-card .card-name {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.persona-card .card-role {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.enter-btn {
  height: 40px;
  padding: 0 28px;
  background: linear-gradient(150deg, var(--green), var(--green-dim));
  border: none;
  border-radius: 6px;
  color: #070908;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out);
}
.enter-btn:hover:not(:disabled) {
  box-shadow: 0 0 20px rgba(62, 207, 142, 0.25);
}
.enter-btn:disabled {
  opacity: 0.3;
  cursor: default;
}
