/* =====================================================================
   moscode ERP - estilos base. Tokens tomados del handoff de diseno.
   ===================================================================== */

:root {
  --paper: #F7F6F2;
  --surface: #FFFFFF;
  --raised: #FBFAF7;
  --ink: #18191C;
  --muted: #71757C;
  --line: #E4E2DA;
  --line2: #EFEDE7;
  --accent: #0E9F6E;
  --accent-ink: #0B6E4B;
  --soft: rgba(14, 159, 110, .10);
  --warn: #B3801A;
  --bad: #C0392B;
  --shadow: 0 1px 2px rgba(24, 25, 28, .05);
  --rowpad: 7px 10px;
}

:root[data-theme="dark"] {
  --paper: #101114;
  --surface: #18191C;
  --raised: #1D1F23;
  --ink: #F2F1EC;
  --muted: #8E9299;
  --line: #292B30;
  --line2: #222428;
  --accent: #12B87E;
  --accent-ink: #5FE0B0;
  --soft: rgba(18, 184, 126, .13);
  --warn: #D3A03A;
  --bad: #E0705F;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--paper);
  color: var(--ink);
  font: 400 13px/1.4 'IBM Plex Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#app { height: 100vh; overflow: hidden; }

.boot {
  height: 100vh;
  display: grid;
  place-items: center;
  font: 400 12px/1 'IBM Plex Mono', monospace;
  color: var(--muted);
}

.mono { font-family: 'IBM Plex Mono', monospace; font-variant-numeric: tabular-nums; }
button { font-family: inherit; cursor: pointer; }
a { color: var(--accent-ink); }

/* ---------- inputs ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font: 400 11px/1 'IBM Plex Sans', sans-serif;
  color: var(--muted);
}
.field input, .field select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--ink);
  font: 400 13.5px/1 'IBM Plex Sans', sans-serif;
  outline: none;
}
.field input:focus, .field select:focus { border-color: var(--accent); }
.field .err { font: 400 11px/1.3 'IBM Plex Mono', monospace; color: var(--bad); }

.btn {
  border: 0;
  background: var(--ink);
  color: var(--paper);
  border-radius: 8px;
  padding: 12px 16px;
  font: 600 13px/1 'IBM Plex Sans', sans-serif;
}
.btn:hover { opacity: .9; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn-accent { background: var(--accent); color: #08130E; }
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--muted); }

.alert {
  border: 1px solid var(--bad);
  color: var(--bad);
  border-radius: 8px;
  padding: 10px 12px;
  font: 400 12px/1.4 'IBM Plex Mono', monospace;
  background: transparent;
}
.alert-ok { border-color: var(--accent); color: var(--accent-ink); }

/* ---------- login / onboarding (full bleed) ---------- */
.split {
  height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  overflow: auto;
}
.split .brand {
  background: var(--ink);
  color: #F2F1EC;
  padding: 48px 52px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.split .brand .logo { display: flex; align-items: center; gap: 11px; }
.split .brand .iso {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--accent); color: #08130E;
  display: grid; place-items: center;
  font: 600 13px/1 'IBM Plex Mono', monospace;
}
.split .brand .word { font: 500 19px/1 'IBM Plex Mono', monospace; letter-spacing: -.01em; }
.split .brand h1 { font: 600 40px/1.1 'IBM Plex Sans', sans-serif; letter-spacing: -.02em; max-width: 12em; margin: 16px 0 0; }
.split .brand p { font: 400 14px/1.6 'IBM Plex Sans', sans-serif; color: #9DA1A8; max-width: 34em; }
.split .brand .cli { font: 400 12px/1 'IBM Plex Mono', monospace; color: var(--accent); }
.split .brand .foot { font: 400 11.5px/1.6 'IBM Plex Mono', monospace; color: #71757C; }

.split .panel {
  background: var(--paper);
  padding: 48px 52px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  overflow: auto;
}
.split .panel .box { max-width: 420px; width: 100%; }
.split .panel .kicker {
  font: 500 10px/1 'IBM Plex Mono', monospace;
  letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
.split .panel h2 { font: 600 24px/1.2 'IBM Plex Sans', sans-serif; margin: 12px 0 22px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.links { display: flex; justify-content: space-between; font: 400 11.5px/1 'IBM Plex Sans', sans-serif; color: var(--muted); }
.links a { cursor: pointer; }

.steps { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.steps .step {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 9px;
  padding: 8px 11px; background: var(--surface);
  font: 500 11.5px/1 'IBM Plex Sans', sans-serif; color: var(--muted);
}
.steps .step .n {
  width: 20px; height: 20px; border-radius: 6px;
  display: grid; place-items: center;
  font: 600 10px/1 'IBM Plex Mono', monospace;
  background: var(--raised); color: var(--muted);
}
.steps .step.active { border-color: var(--accent); color: var(--ink); }
.steps .step.active .n { background: var(--soft); color: var(--accent-ink); }
.steps .step.done .n { background: var(--accent); color: #08130E; }

/* ---------- app shell ---------- */
.shell {
  height: 100vh;
  display: grid;
  grid-template-columns: 68px 218px minmax(0, 1fr);
  overflow: hidden;
}

.rail {
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  gap: 4px;
}
.rail .iso {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--ink); color: var(--paper);
  display: grid; place-items: center;
  font: 600 13px/1 'IBM Plex Mono', monospace;
  margin-bottom: 10px;
}
.rail button {
  width: 52px;
  border: 0; background: transparent;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 0; border-radius: 8px;
  color: var(--muted);
}
.rail button:hover { background: var(--line2); }
.rail button .box {
  width: 30px; height: 26px; border-radius: 7px;
  border: 1px solid var(--line);
  display: grid; place-items: center;
  font: 500 11px/1 'IBM Plex Mono', monospace;
}
.rail button .lbl { font: 500 8.5px/1 'IBM Plex Mono', monospace; letter-spacing: .06em; }
.rail button.active { background: var(--soft); }
.rail button.active .box { border-color: var(--accent); background: var(--soft); color: var(--accent-ink); }
.rail .spacer { flex: 1; }

.subnav {
  background: var(--raised);
  border-right: 1px solid var(--line);
  padding: 14px 12px;
  display: flex; flex-direction: column; gap: 3px;
  overflow: auto;
}
.subnav .modlabel {
  font: 500 9.5px/1 'IBM Plex Mono', monospace;
  letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 8px;
}
.subnav a {
  display: block; padding: 7px 9px; border-radius: 7px;
  font: 400 12.5px/1.3 'IBM Plex Sans', sans-serif;
  color: var(--ink); text-decoration: none; cursor: pointer;
  border-left: 3px solid transparent;
}
.subnav a:hover { background: var(--surface); }
.subnav a.active { background: var(--surface); font-weight: 500; border-left-color: var(--accent); }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 52px; flex: none;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px;
  padding: 0 18px;
}
.topbar .crumb { font: 400 11.5px/1 'IBM Plex Mono', monospace; color: var(--muted); }
.topbar .grow { flex: 1; }
.topbar select {
  border: 1px solid var(--line); border-radius: 7px;
  background: var(--raised); color: var(--ink);
  font: 400 11.5px/1 'IBM Plex Mono', monospace;
  padding: 6px 8px;
}
.topbar .avatar {
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--soft); color: var(--accent-ink);
  display: grid; place-items: center;
  font: 600 10px/1 'IBM Plex Mono', monospace;
  border: 0;
}

.content { flex: 1; overflow: auto; padding: 18px 20px 44px; }
.content h1 { font: 600 22px/1.15 'IBM Plex Sans', sans-serif; letter-spacing: -.01em; margin: 0; }
.content .sub { font: 400 12.5px/1.4 'IBM Plex Sans', sans-serif; color: var(--muted); margin-top: 5px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.card .card-title { font: 600 13px/1 'IBM Plex Sans', sans-serif; margin-bottom: 10px; }

.empty {
  margin-top: 16px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
}
.empty .big { font: 600 14px/1.3 'IBM Plex Sans', sans-serif; color: var(--ink); }
.empty .small { font: 400 12px/1.5 'IBM Plex Sans', sans-serif; margin-top: 6px; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px; box-shadow: var(--shadow); }
.kpi .k { font: 500 9.5px/1 'IBM Plex Mono', monospace; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.kpi .v { font: 600 23px/1.1 'IBM Plex Mono', monospace; letter-spacing: -.02em; margin-top: 10px; }

@media (max-width: 1100px) {
  .shell { grid-template-columns: 68px minmax(0, 1fr); }
  .subnav { display: none; }
  .split { grid-template-columns: 1fr; }
  .split .brand { display: none; }
}
