/* caveauMEM management console — authed app shell. Separate from the marketing
   caveaumem.css so console changes never touch the public site. Dark, calm,
   data-dense; brand mark reused from the marketing header. */
:root {
  --cm-bg: #0b1020;
  --cm-panel: #131a2e;
  --cm-panel-2: #1a2440;
  --cm-line: #263156;
  --cm-text: #e6ebf5;
  --cm-muted: #94a1c2;
  --cm-gold: #d8b45a;
  --cm-accent: #6ea8fe;
  --cm-danger: #e2607a;
  --cm-ok: #57c98a;
}
* { box-sizing: border-box; }
body.cm-app {
  margin: 0; background: var(--cm-bg); color: var(--cm-text);
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, Inter, system-ui, sans-serif;
}
a { color: var(--cm-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.cm-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: var(--cm-panel); border-bottom: 1px solid var(--cm-line);
  position: sticky; top: 0; z-index: 10;
}
.cm-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--cm-text); }
.cm-brand .mark {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--cm-gold), #b8902f); color: #1a1205; font-size: 13px; font-weight: 800;
}
.cm-brand small { display: block; font-weight: 500; color: var(--cm-muted); font-size: 11px; }
.cm-userchip { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--cm-muted); }
.cm-userchip strong { color: var(--cm-text); }
.cm-layout { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 55px); }
.cm-side { background: var(--cm-panel); border-right: 1px solid var(--cm-line); padding: 16px 10px; }
.cm-side a {
  display: block; padding: 9px 12px; border-radius: 8px; color: var(--cm-muted); font-weight: 500; margin-bottom: 2px;
}
.cm-side a:hover { background: var(--cm-panel-2); color: var(--cm-text); text-decoration: none; }
.cm-side a.active { background: var(--cm-panel-2); color: var(--cm-text); border-left: 3px solid var(--cm-gold); }
.cm-main { padding: 28px 32px; max-width: 960px; }
.cm-main h1 { font-size: 24px; margin: 0 0 4px; }
.cm-main h2 { font-size: 17px; margin: 28px 0 10px; }
.cm-sub { color: var(--cm-muted); margin: 0 0 20px; }
.cm-card {
  background: var(--cm-panel); border: 1px solid var(--cm-line); border-radius: 12px;
  padding: 20px 22px; margin-bottom: 18px;
}
.cm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.cm-stat { background: var(--cm-panel); border: 1px solid var(--cm-line); border-radius: 12px; padding: 16px 18px; }
.cm-stat .n { font-size: 26px; font-weight: 700; }
.cm-stat .l { color: var(--cm-muted); font-size: 13px; }
.cm-field { display: block; margin-bottom: 14px; }
.cm-field span { display: block; font-size: 13px; color: var(--cm-muted); margin-bottom: 5px; }
.cm-field input, .cm-field select, .cm-field textarea {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--cm-line);
  background: var(--cm-bg); color: var(--cm-text); font: inherit;
}
.cm-btn {
  display: inline-block; padding: 10px 18px; border-radius: 8px; border: 0; cursor: pointer;
  background: var(--cm-gold); color: #1a1205; font-weight: 700; font: inherit; font-weight: 700;
}
.cm-btn.secondary { background: var(--cm-panel-2); color: var(--cm-text); border: 1px solid var(--cm-line); }
.cm-btn:hover { filter: brightness(1.05); }
.cm-note { padding: 11px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.cm-note.err { background: rgba(226,96,122,.12); border: 1px solid #7d2f42; color: #f2b8c4; }
.cm-note.ok { background: rgba(87,201,138,.12); border: 1px solid #2f7d54; color: #b8f2cf; }
.cm-mono { font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace; }
.cm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.cm-table th, .cm-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--cm-line); }
.cm-table th { color: var(--cm-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
/* Standalone login screen (no shell) */
body.cm-login { display: grid; place-items: center; min-height: 100vh; }
.cm-login-card { width: 360px; max-width: 92vw; }
.cm-login-card .cm-brand { justify-content: center; margin-bottom: 18px; font-size: 20px; }
/* Blue Note ID SSO button + "or" divider above the local password form. Secondary
   styling on purpose: SSO is offered first but must not out-shout password login,
   which stays the fallback that guarantees nobody can be locked out. */
.cm-btn-sso {
  background: var(--cm-panel-2); color: var(--cm-text); border: 1px solid var(--cm-line);
  text-decoration: none; padding: 10px 18px; border-radius: 8px; font-weight: 700;
}
.cm-btn-sso:hover { filter: brightness(1.12); }
.cm-login-or {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 0; color: var(--cm-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
}
.cm-login-or::before, .cm-login-or::after {
  content: ""; flex: 1; height: 1px; background: var(--cm-line);
}
/* Password field with an inline show/hide (eye) reveal toggle. Brand-neutral. */
.cm-pw { position: relative; display: block; }
.cm-pw input { width: 100%; padding-right: 42px; }
.cm-pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 30px; height: 30px; padding: 0;
  background: transparent; border: 0; border-radius: 6px; cursor: pointer;
  color: var(--cm-muted);
}
.cm-pw-toggle:hover { color: var(--cm-text); background: var(--cm-panel-2); }
.cm-pw-toggle svg { width: 18px; height: 18px; display: block; }
.cm-pw-toggle .eye-off { display: none; }
.cm-pw-toggle[aria-pressed="true"] .eye-on { display: none; }
.cm-pw-toggle[aria-pressed="true"] .eye-off { display: block; }
