/* Token values recorded from OKAMI Universal UI/UX Kit V5 Final Master — see DECISIONS.md #016.
   This bare foundation shell uses ONLY the token layer (color/radius/shadow/type), never the
   kit's component library — the real component build-out is Phase 02 (Universal Admin UI). */
:root {
  --bg: #f5f7f9;
  --surface: #fff;
  --ink: #11161b;
  --muted: #69747e;
  --line: #dce2e7;
  --accent: #285ff2;
  --soft: #edf2ff;
  --dark: #10161c;
  --success: #17855e;
  --warning: #a86d00;
  --danger: #c23e46;
  --r: 18px;
  --rs: 10px;
  --shadow: 0 12px 35px rgba(15, 22, 29, .07);
  /* Matches OKAMI Universal UI/UX Kit V5 Final Master's own `--max` token
     (1480px) — renamed --container here since it's used purely as a content
     max-width in this admin app, not a marketing hero. See DECISIONS.md #025. */
  --container: 1480px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.55 Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: inherit; text-decoration: none; }

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 32px;
  width: 100%;
  max-width: 380px;
}
.panel.wide { max-width: none; }
.panel.pad { padding: 22px; }
.mt { margin-top: 20px; }
.mb { margin-bottom: 20px; }

.eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--accent);
  font-weight: 900;
}

h1 { font-size: 24px; margin: 8px 0 4px; }
.muted { color: var(--muted); }

.field { margin: 16px 0; }
.field label { display: block; font-size: 11px; font-weight: 800; margin-bottom: 5px; }
.field input:not([type="checkbox"]):not([type="radio"]) {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--rs);
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}

.btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--rs);
  padding: 9px 14px;
  font-weight: 750;
  cursor: pointer;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { background: #fff; border-color: #edb3b3; color: var(--danger); }
.btn.danger:hover { background: #fff5f5; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { padding: 6px 10px; font-size: 12px; }
.btn.block { width: 100%; justify-content: center; }

.notice { border-radius: var(--rs); padding: 10px 12px; font-size: 12px; margin-bottom: 12px; border: 1px solid var(--line); }
.notice.error { border-color: #edb3b3; background: #fff5f5; color: var(--danger); }
.notice.success { border-color: #b8e3d2; background: #f3fbf7; color: var(--success); }
.notice.warning { border-color: #ecd09e; background: #fffaf0; color: var(--warning); }

.badge, .pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 800;
}
.pill.muted { background: #f0f3f5; color: var(--muted); }
.pill.danger { background: #fff0f0; color: var(--danger); border-color: #f3c9c9; }
.pill.success { background: #edfaf4; color: var(--success); border-color: #bfe8d5; }

/* ===== Admin Shell (Phase 02) ===== */
.app-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.app-sidebar {
  background: var(--dark);
  color: #cfd6dd;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.app-sidebar .brand { color: #fff; font-weight: 950; letter-spacing: .1em; padding: 6px 10px 20px; display: flex; align-items: baseline; gap: 8px; }
.app-sidebar .brand .version-tag { color: #7c8794; font-weight: 700; font-size: 10px; letter-spacing: .04em; }
.nav-group { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: #7c8794; padding: 14px 10px 6px; }
.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-radius: var(--rs);
  font-size: 13px;
  font-weight: 650;
  color: #cfd6dd;
}
.nav-link:hover { background: rgba(255,255,255,.06); }
.nav-link.active { background: var(--accent); color: #fff; }
.nav-link.disabled { color: #566270; cursor: default; }
.nav-link.disabled.active { background: rgba(40,95,242,.35); color: #dce2e7; }
.nav-link .soon { font-size: 9px; text-transform: uppercase; letter-spacing: .08em; background: rgba(255,255,255,.08); border-radius: 999px; padding: 2px 6px; }

.app-main { display: flex; flex-direction: column; min-height: 100vh; }
.app-top {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.app-search { flex: 1; max-width: 420px; position: relative; }
.app-search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--rs);
  padding: 9px 12px;
  font: inherit;
  background: var(--bg);
}
.app-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--rs);
  box-shadow: var(--shadow);
  max-height: 320px;
  overflow: auto;
  display: none;
  z-index: 50;
}
.app-search-results.open { display: block; }
.app-search-results a { display: block; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.app-search-results a:last-child { border-bottom: 0; }
.app-search-results a:hover { background: var(--soft); }
.app-search-empty { padding: 10px 12px; font-size: 12px; color: var(--muted); }

.app-content { padding: 28px; max-width: 1100px; width: 100%; margin: 0 auto; }
.breadcrumb { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.breadcrumb .sep { opacity: .5; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 20px; }
.page-head h1 { font-size: 22px; margin: 4px 0 0; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; }
.stat-card .label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 800; }
.stat-card .value { font-size: 28px; font-weight: 900; margin-top: 6px; }

.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.table th, .table td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; }
.table th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: #fafbfc; }
.table tr:last-child td { border-bottom: 0; }
.table .row-actions { display: flex; gap: 6px; justify-content: flex-end; }

.bulkbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--dark);
  color: #fff;
  border-radius: var(--rs);
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 13px;
}
.bulkbar.open { display: flex; }

.form { display: grid; gap: 14px; max-width: 480px; }
.field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: var(--rs); padding: 9px 12px; font: inherit; background: #fff; }
.checkrow { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 6px 0; }

.empty-state { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r); padding: 48px 24px; text-align: center; color: var(--muted); }
.empty-state .eyebrow { display: block; margin-bottom: 8px; }
.empty-state h2 { font-size: 18px; color: var(--ink); margin: 0 0 8px; }

.activity-row { font-size: 13px; }
.activity-row .meta { color: var(--muted); font-size: 11px; }

/* ===== V5 Kit utilities (adopted ad-hoc, DECISIONS.md #025) =====
   Genuinely-missing pieces UI-KIT-RECONCILIATION.md flagged as safe
   "ADOPT AS NEW" — copied verbatim from the real V5 Kit source
   (OKAMI-UNIVERSAL-UI-UX-KIT-V5-FINAL-MASTER.html), not re-derived from the
   older V4-era reconciliation notes. No brand-color or token changes. */
.container { max-width: var(--container); margin: 0 auto; }

.grid { display: grid; gap: 16px; }
.grid.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid.g5 { grid-template-columns: repeat(5, minmax(0,1fr)); }

.skeleton {
  background: linear-gradient(90deg, #edf0f2 25%, #fafbfc 37%, #edf0f2 63%);
  background-size: 400% 100%;
  animation: sk 1.2s infinite;
  border-radius: 9px;
}
@keyframes sk { to { background-position: -400% 0; } }
.skeleton.skbig { height: 160px; }
.skeleton.skline { height: 13px; margin-top: 9px; }
.skeleton.short { width: 55%; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-sidebar { display: none; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid.g4, .grid.g3, .grid.g5 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 560px) {
  .grid.g2 { grid-template-columns: 1fr; }
}

/* ===== UI Kit style guide page (DECISIONS.md #025) ===== */
.kit-section { margin: 0 0 40px; }
.kit-section h2 { font-size: 16px; margin: 0 0 4px; }
.kit-section .kit-desc { margin: 0 0 14px; }
.kit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.kit-swatch { display: flex; flex-direction: column; gap: 6px; width: 110px; }
.kit-swatch .chip { height: 54px; border-radius: var(--rs); border: 1px solid var(--line); }
.kit-swatch code { font-size: 10px; color: var(--muted); word-break: break-all; }
code.tag { background: var(--soft); color: var(--accent); border-radius: 6px; padding: 2px 6px; font-size: 11px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
pre.kit-code { background: var(--dark); color: #d8e0e8; border-radius: var(--rs); padding: 14px 16px; font-size: 12px; overflow-x: auto; margin: 10px 0 0; }
