/* Illuminise Interface Branding — applied exactly per ~/.claude/skills/illuminise-branding */

:root {
  --navy: #1e3a5f;
  --navy-hover: #2d5491;
  --green: #6db33f;

  --bg-page: #f0f2f5;
  --bg-surface: #ffffff;
  --bg-subtle: #f8fafc;

  --border: #e2e8f0;

  --text-primary: #1a1a2e;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-btn-secondary: #374151;

  --error: #ef4444;
  --error-bg: #fef2f2;
  --error-border: #fecaca;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  font-size: 14px;
  min-height: 100vh;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

a { color: var(--navy); }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

/* ---- Nav ---- */
nav.nav {
  background: var(--navy);
  height: 56px;
  display: flex; align-items: center;
  padding: 0 24px; gap: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.nav-logo {
  width: 36px; height: 36px;
  background: white; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; text-decoration: none;
  transition: opacity 0.15s;
}
.nav-logo:hover { opacity: 0.85; }
.nav-title { color: white; font-size: 16px; font-weight: 600; letter-spacing: 0.02em; }
.nav-spacer { flex: 1; }
.nav-link { color: rgba(255,255,255,0.85); font-size: 13px; text-decoration: none; }
.nav-link:hover { color: white; }

/* ---- Page ---- */
.page { width: 100%; margin: 0; padding: 40px 24px 64px; }

h1 { font-size: 24px; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.subtitle { font-size: 14px; color: var(--text-secondary); margin-bottom: 32px; }

/* ---- Section / card ---- */
.section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 24px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.section-title {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 16px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.stat-row { display: flex; gap: 12px; flex-wrap: wrap; }
.stat-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  min-width: 120px;
}
.stat-label { font-size: 11px; color: var(--text-secondary); margin-bottom: 4px; }
.stat-value { font-size: 22px; font-weight: 700; color: var(--navy); }

/* ---- Forms / toolbar ---- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.spacer { flex: 1; }

select, input[type="text"], input[type="email"], input[type="password"] {
  font-family: inherit;
  font-size: 13px;
  padding: 7px 10px;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  background: white;
  color: var(--text-primary);
}

label { font-size: 13px; color: var(--text-secondary); font-weight: 500; }

/* ---- Buttons ---- */
.btn {
  padding: 7px 16px;
  border-radius: 7px;
  font-size: 13px; font-weight: 600;
  cursor: pointer; border: 1px solid transparent;
  transition: background 0.15s;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary { background: var(--navy); color: white; border-color: var(--navy); }
.btn-primary:hover:not(:disabled) { background: var(--navy-hover); }

.btn-secondary { background: white; color: var(--text-btn-secondary); border-color: #d1d5db; }
.btn-secondary:hover:not(:disabled) { background: var(--bg-subtle); }

.btn-ghost { background: white; color: var(--text-secondary); border-color: #d1d5db; }
.btn-ghost:hover { background: var(--bg-subtle); }

/* ---- Table ---- */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 760px; }

th {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-secondary);
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: var(--bg-surface);
}
th.num, td.num { text-align: right; }

td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  font-size: 13px;
}

tbody tr:hover { background: var(--bg-subtle); }
tbody tr.error { background: var(--error-bg); }

.num { font-variant-numeric: tabular-nums; }

.cost-btn {
  all: unset;
  cursor: pointer;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  border-bottom: 1px dotted var(--text-muted);
}
.cost-btn:hover { color: var(--navy); border-color: var(--navy); }
.cost-btn:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
tr.error .cost-btn { color: var(--error); font-weight: 600; }

.receipt {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 4px 0 6px;
}
.receipt b { color: var(--text-primary); font-weight: 600; }
.receipt.flagged { color: var(--error); }

@media (prefers-reduced-motion: no-preference) {
  details[open] .receipt { animation: reveal 120ms ease-out; }
}
@keyframes reveal {
  from { opacity: 0; transform: translateY(-2px); }
  to { opacity: 1; transform: translateY(0); }
}

.badge { font-size: 11px; background: var(--bg-subtle); color: var(--text-muted); border: 1px solid var(--border); border-radius: 4px; padding: 2px 7px; }
.badge-danger { background: var(--error-bg); color: var(--error); border-color: var(--error-border); }

.empty-state {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  color: var(--text-secondary);
}

/* ---- Auth pages ---- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 340px;
  max-width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  text-align: center;
}
.auth-logo {
  width: 44px; height: 44px;
  background: var(--navy);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.auth-card h1 { font-size: 18px; text-align: left; margin-bottom: 16px; }
.auth-card form, .auth-card p { text-align: left; }
.auth-card label { display: block; margin-bottom: 4px; }
.auth-card input { width: 100%; margin-bottom: 14px; }
.auth-card .btn { width: 100%; justify-content: center; }
.auth-card p { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; }
.error-text { color: var(--error); font-size: 13px; margin-bottom: 14px; text-align: left; }
.message-text { color: var(--navy); font-size: 13px; margin-bottom: 14px; text-align: left; }
.links { margin-top: 16px; font-size: 13px; text-align: center; }

@media (max-width: 640px) {
  .page { padding: 24px 16px 48px; }
}
