/* HYDOR — interface styles
   Palette taken from the workshop rather than from a template: cold rolled
   steel for structure, brass for anything you act on, patina green for an open
   vault, oxide red for destructive actions. Anything decrypted in the browser
   carries a brass edge, so you always know which numbers left the server as
   ciphertext. */

:root {
  --steel-900: #16262e;
  --steel-700: #24404c;
  --steel-500: #3d5c69;
  --paper:     #edf0f1;
  --surface:   #ffffff;
  --line:      #d3dbde;
  --ink:       #14202a;
  --muted:     #5b6b75;
  --brass:     #a9752b;
  --brass-dk:  #8a5e1f;
  --patina:    #2f6b52;
  --oxide:     #9c3b22;
  --radius:    4px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2 { font-weight: 600; letter-spacing: -0.011em; margin: 0; }

.muted { color: var(--muted); font-size: 14px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- gate (setup, sign in, recovery) ---------- */

.gate {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background: linear-gradient(160deg, var(--steel-900), var(--steel-700));
}

.gate-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--radius);
  border-top: 3px solid var(--brass);
  padding: 30px 28px 26px;
  box-shadow: 0 18px 44px rgba(10, 22, 28, 0.35);
}

.gate-title { font-size: 24px; margin-bottom: 6px; }
.gate-note { color: var(--muted); font-size: 13.5px; margin: 0 0 20px; }

.recovery {
  margin: 20px 0;
  padding: 14px 16px;
  background: #fbf6ec;
  border: 1px solid #e4d3ae;
  border-radius: var(--radius);
}
.recovery-title { font-size: 14px; margin-bottom: 8px; }
.recovery-body {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 15px;
  letter-spacing: 0.06em;
  word-break: break-all;
  margin: 0 0 10px;
  color: var(--brass-dk);
}

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

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }

.input {
  width: 100%;
  padding: 9px 11px;
  font: inherit;
  font-size: 14.5px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.input:focus { outline: 2px solid var(--brass); outline-offset: 1px; border-color: var(--brass); }

.btn {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
}
.btn:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.btn:disabled { opacity: 0.55; cursor: default; }

.btn-primary { background: var(--brass); color: #fff; width: 100%; }
.btn-primary:hover:not(:disabled) { background: var(--brass-dk); }

.btn-quiet {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
  width: 100%;
  margin-top: 10px;
  font-weight: 500;
}
.btn-quiet:hover { color: var(--ink); }

.btn-danger { background: var(--oxide); color: #fff; }

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

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 216px;
  flex: 0 0 216px;
  background: var(--steel-900);
  color: #cfdae0;
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mark { padding: 0 8px 20px; }
.mark-name { display: block; color: #fff; font-size: 18px; font-weight: 700; letter-spacing: 0.02em; }
.mark-sub  { display: block; color: #7d939e; font-size: 11.5px; margin-top: 2px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  text-align: left;
  font: inherit;
  font-size: 14px;
  color: #cfdae0;
  background: transparent;
  border: 0;
  border-left: 2px solid transparent;
  padding: 9px 10px;
  border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.06); }
.nav-item.is-current { background: rgba(255, 255, 255, 0.1); border-left-color: var(--brass); color: #fff; }

.vault-state {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: #9fb3bc;
  padding: 12px 10px 6px;
}
.vault-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--patina);
  box-shadow: 0 0 0 3px rgba(47, 107, 82, 0.25);
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 16px 26px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.topbar-title { font-size: 19px; }
.topbar-user { font-size: 13px; color: var(--muted); }

.page { padding: 24px 26px 40px; }

/* ---------- cards, tables ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 22px;
}
.card-title { font-size: 15px; margin-bottom: 12px; }
.card-danger { border-color: #e3bfb4; }
.card-danger .card-title { color: var(--oxide); }

.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14px;
}
.table th {
  text-align: left;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #f7f9fa;
  white-space: nowrap;
}
.table td { padding: 10px 12px; border-bottom: 1px solid #eef2f3; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafcfc; }

/* Decrypted in this browser, never readable by the server. */
.sensitive { border-left: 2px solid var(--brass); background: #fdfaf4; }

.footnote { font-size: 12.5px; color: var(--muted); margin-top: 14px; }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 340px;
  background: var(--steel-900);
  color: #fff;
  font-size: 13.5px;
  padding: 12px 15px;
  border-radius: var(--radius);
  border-left: 3px solid var(--patina);
  box-shadow: 0 10px 28px rgba(10, 22, 28, 0.3);
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
}
.toast.show { opacity: 1; transform: none; }
.toast-error { border-left-color: var(--oxide); }

@media (prefers-reduced-motion: reduce) {
  .toast { transition: none; }
}

@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; flex: none; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px; }
  .mark { padding: 0 10px 0 4px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .vault-state { margin: 0 0 0 auto; }
  .page { padding: 18px 14px 34px; }
}
