/* =====================================================
   GEOINT — minimal, modern, restrained.
   ===================================================== */

:root {
  --bg:        #0a0a0b;
  --surface:   #131418;
  --surface-2: #1a1c21;
  --line:      rgba(255, 255, 255, 0.07);
  --line-2:    rgba(255, 255, 255, 0.14);
  --text:      #f4f5f7;
  --text-dim:  #8b919b;
  --text-mute: #5a6068;
  --accent:    #ff5622;
  --accent-h:  #ff6738;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.2, .6, .2, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* Ambient background canvas — sits behind everything */
.bg-canvas {
  position: fixed; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

/* Content layers ride above the canvas */
.signin, .workspace { position: relative; z-index: 1; }

/* =====================================================
   NAV — one line, brand left, optional content right
   ===================================================== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
  padding: 0 28px;
  background: rgba(10, 10, 11, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav__brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text);
  font-weight: 500;
  letter-spacing: 0.04em;
  font-size: 14px;
}
.nav__brand-mark {
  display: block;
  height: 22px;
  width: auto;
}
.nav__right { display: inline-flex; align-items: center; gap: 18px; }
.nav__link {
  color: var(--text-dim);
  font-size: 13px;
  letter-spacing: 0.01em;
  transition: color .15s var(--ease);
}
.nav__link:hover { color: var(--text); }

/* =====================================================
   FOOT — barely-there version line
   ===================================================== */
.foot {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: flex; justify-content: space-between;
  padding: 16px 28px;
  font-size: 12px;
  color: var(--text-mute);
}

/* =====================================================
   LOGIN — centered single column, no decoration
   ===================================================== */
.signin {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 80px 24px;
}
.signin__panel {
  width: 100%;
  max-width: 360px;
}
.signin__title {
  margin: 0 0 6px;
  font-weight: 500;
  font-size: 28px;
  letter-spacing: -0.015em;
  line-height: 1.1;
}
.signin__sub {
  margin: 0 0 36px;
  color: var(--text-dim);
  font-size: 14px;
}
.signin__form { display: grid; gap: 22px; }

.signin__error {
  padding: 10px 14px;
  border: 1px solid rgba(255, 86, 34, 0.45);
  background: rgba(255, 86, 34, 0.07);
  color: var(--text);
  font-size: 13px;
}

.field { display: grid; gap: 8px; }
.field > span {
  font-size: 13px;
  color: var(--text-dim);
}
.field input {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-2);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  padding: 8px 0 10px;
  outline: none;
  transition: border-color .2s var(--ease);
}
.field input:focus { border-bottom-color: var(--accent); }

.btn-primary {
  margin-top: 6px;
  background: var(--accent);
  color: #0a0a0a;
  border: 0;
  padding: 12px 16px;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.01em;
  transition: background .15s var(--ease);
}
.btn-primary:hover { background: var(--accent-h); }

/* =====================================================
   DASHBOARD — greeting + 2x2 cards
   ===================================================== */
.workspace {
  max-width: 1080px;
  margin: 0 auto;
  padding: 140px 28px 96px;
}
.workspace__head { margin-bottom: 56px; }
.workspace__head h1 {
  margin: 0 0 6px;
  font-weight: 500;
  font-size: 32px;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.workspace__head p {
  margin: 0;
  color: var(--text-dim);
  font-size: 15px;
}
.workspace__meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.01em;
}
.workspace__meta-sep {
  color: var(--text-mute);
}

.apps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.app-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 24px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  min-height: 220px;
  align-items: center;
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
  overflow: hidden;
}
.app-card:hover {
  background: var(--surface-2);
  border-color: var(--line-2);
  transform: translateY(-1px);
}

.app-card__copy {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 10px;
  align-self: stretch;
}
.app-card h2 {
  margin: 0;
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.005em;
}
.app-card p {
  margin: 0;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.5;
  max-width: 42ch;
}
.app-card__cta {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  align-self: end;
  transition: color .2s var(--ease);
}
.app-card__cta svg { transition: transform .2s var(--ease); }
.app-card:hover .app-card__cta { color: var(--accent); }
.app-card:hover .app-card__cta svg { transform: translateX(3px); }

.app-card__canvas {
  display: block;
  width: 140px;
  height: 140px;
  justify-self: end;
  align-self: center;
}

/* =====================================================
   FLASH MESSAGES
   ===================================================== */
.flashes {
  position: fixed;
  top: 76px; left: 50%; transform: translateX(-50%);
  z-index: 30;
  display: grid; gap: 8px;
  width: min(560px, calc(100% - 36px));
}
.flash {
  padding: 10px 14px;
  font-size: 13px;
  border: 1px solid var(--line-2);
  background: rgba(20, 21, 25, 0.92);
  backdrop-filter: blur(8px);
}
.flash--ok    { border-color: rgba(78, 204, 130, 0.5); }
.flash--info  { border-color: rgba(120, 160, 220, 0.45); }
.flash--error { border-color: rgba(255, 86, 34, 0.55); background: rgba(255, 86, 34, 0.08); }

/* =====================================================
   ADMIN / ACCOUNT PAGES
   ===================================================== */
.admin {
  position: relative; z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 120px 28px 96px;
}
.admin--narrow { max-width: 640px; }

.admin__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
}
.admin__head h1 {
  margin: 0 0 6px;
  font-weight: 500;
  font-size: 26px;
  letter-spacing: -0.015em;
  line-height: 1.1;
}
.admin__sub { margin: 0; color: var(--text-dim); font-size: 14px; }
.admin__head-actions { display: inline-flex; gap: 10px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 20px 24px;
  margin-bottom: 18px;
}
.card__title {
  margin: 0 0 12px;
  font-size: 15px; font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.01em;
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th, .table td {
  text-align: left;
  padding: 12px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table th {
  font-weight: 500;
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table__actions { text-align: right; white-space: nowrap; }
.table .inline { display: inline; margin-left: 12px; }
.table .inline button { background: transparent; border: 0; padding: 0; }

.muted { color: var(--text-dim); }
.link {
  background: transparent; border: 0;
  color: var(--text-dim);
  font: inherit;
  cursor: pointer;
  transition: color .15s var(--ease);
}
.link:hover { color: var(--text); }
.link--danger:hover { color: var(--accent); }

/* Chips / badges */
.chip {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid var(--line-2);
  margin-right: 6px;
}
.chip--superuser { color: var(--accent); border-color: rgba(255, 86, 34, 0.5); }
.chip--admin     { color: #f4d27a; border-color: rgba(244, 210, 122, 0.4); }
.chip--user      { color: var(--text-dim); }
.chip--ok        { color: #4ecc82; border-color: rgba(78, 204, 130, 0.4); }
.chip--off       { color: #c87070; border-color: rgba(200, 112, 112, 0.4); }
.chip--warn      { color: #f4d27a; border-color: rgba(244, 210, 122, 0.4); }
.chip--muted     { color: var(--text-mute); }

/* Forms */
.form { display: grid; gap: 22px; }
.form select {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-2);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  padding: 8px 0 10px;
  outline: none;
  transition: border-color .2s var(--ease);
}
.form select:focus { border-bottom-color: var(--accent); }
.form select option { color: #111; }
.form__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 6px;
}
.hint { color: var(--text-mute); font-size: 12px; }

.btn-ghost {
  display: inline-flex; align-items: center;
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--text);
  padding: 11px 16px;
  font-weight: 500;
  font-size: 14px;
  transition: border-color .15s var(--ease);
}
.btn-ghost:hover { border-color: var(--text); }

/* Definition list */
.kv {
  display: grid; gap: 10px;
  margin: 0 0 18px;
}
.kv > div {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 10px;
  font-size: 13px;
}
.kv dt {
  color: var(--text-dim);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
  align-self: center;
}
.kv dd { margin: 0; }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 720px) {
  .nav, .foot { padding-left: 18px; padding-right: 18px; }
  .nav__right { gap: 12px; }
  .workspace { padding: 120px 18px 80px; }
  .workspace__head h1 { font-size: 26px; }
  .apps { grid-template-columns: 1fr; }
  .app-card { grid-template-columns: minmax(0, 1fr) 100px; padding: 22px; }
  .app-card__canvas { width: 100px; height: 100px; }
  .admin { padding: 100px 18px 80px; }
  .admin__head { flex-direction: column; align-items: flex-start; }
  .table th:nth-child(2), .table td:nth-child(2) { display: none; }
  .kv > div { grid-template-columns: 1fr; gap: 2px; }
}
