/* Scorpedge ERP — self-contained foundation styles */
:root {
  --navy: #0e1b2e;
  --navy-2: #152742;
  --accent: #e2662a;
  --accent-dark: #c5521d;
  --ink: #16233a;
  --muted: #6b7890;
  --line: #e3e8f0;
  --bg: #f4f6fa;
  --white: #fff;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(14, 27, 46, .08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

/* ---------- Shell ---------- */
.erp-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px;
  flex: 0 0 248px;
  background: linear-gradient(180deg, var(--navy), var(--navy-2));
  color: #dbe4f2;
  display: flex;
  flex-direction: column;
  padding: 20px 14px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 20px;
  box-shadow: 0 6px 16px rgba(226, 102, 42, .35);
}
.brand-name { font-weight: 700; font-size: 16px; color: #fff; letter-spacing: .2px; }
.brand-name small { display: block; font-size: 10px; font-weight: 600; letter-spacing: 2px; color: #8fa5c4; }
.side-nav { flex: 1; }
.nav-label {
  margin: 18px 10px 8px; font-size: 10px; letter-spacing: 1.6px;
  text-transform: uppercase; color: #7f95b5; font-weight: 700;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px; margin-bottom: 3px;
  font-weight: 500; color: #cbd8ea; transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-item.active { background: var(--accent); color: #fff; font-weight: 600; }
.nav-item.disabled { opacity: .5; cursor: default; }
.nav-item.disabled:hover { background: transparent; color: #cbd8ea; }
.nav-item em {
  margin-left: auto; font-style: normal; font-size: 9px; letter-spacing: .6px;
  text-transform: uppercase; background: rgba(255, 255, 255, .1);
  padding: 2px 6px; border-radius: 10px;
}
.nav-icon { width: 18px; text-align: center; font-size: 15px; }
.sidebar-foot { font-size: 11px; color: #7189aa; padding: 12px 10px 0; border-top: 1px solid rgba(255,255,255,.08); }

.erp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 68px; background: var(--white); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
}
.topbar-title { font-weight: 700; font-size: 15px; }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--navy);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-meta strong { font-size: 12px; }
.user-meta small { font-size: 11px; color: var(--muted); }
.btn-link {
  border: 0; background: transparent; color: var(--accent-dark);
  font-weight: 600; cursor: pointer; margin-left: 10px; font-size: 12px;
}
.btn-link:hover { text-decoration: underline; }
.content { padding: 28px; max-width: 1400px; width: 100%; }

/* ---------- Page elements ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-head h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.3px; }
.page-head p { margin: 0; color: var(--muted); }
.pill {
  background: #eaf0fa; color: #33507c; border-radius: 999px;
  padding: 6px 12px; font-size: 11px; font-weight: 700; letter-spacing: .4px;
  white-space: nowrap;
}
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 4px;
  border-top: 3px solid var(--accent);
}
.stat-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 30px; line-height: 1.1; letter-spacing: -1px; }
.stat-note { font-size: 11px; color: var(--muted); }
.panel {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.panel h3 { margin: 0 0 12px; font-size: 16px; }
.check-list { list-style: none; padding: 0; margin: 0 0 14px; }
.check-list li { position: relative; padding-left: 22px; margin-bottom: 8px; }
.check-list li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  color: var(--accent); font-weight: 800;
}
.muted { color: var(--muted); font-size: 13px; }

/* ---------- Forms ---------- */
.form-stack { display: flex; flex-direction: column; gap: 7px; }
.form-stack label { font-size: 12px; font-weight: 600; margin-top: 6px; }
.form-stack input {
  padding: 11px 12px; border: 1px solid #ccd5e3; border-radius: 8px;
  outline: none; background: #fff;
}
.form-stack input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(226, 102, 42, .13); }
.field-error { color: #c0392b; font-size: 11px; }
.alert {
  background: #fdecea; color: #9b2c1f; border: 1px solid #f5c6c0;
  border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; font-size: 13px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 8px; padding: 11px 16px; font-weight: 700;
  cursor: pointer; color: #fff; background: var(--accent);
}
.btn:hover { background: var(--accent-dark); }

/* ---------- Login ---------- */
.login-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 20% 15%, #1c3253, var(--navy) 60%);
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 420px; background: #fff; border-radius: 16px;
  padding: 30px; box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
}
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.login-brand h1 { margin: 0; font-size: 20px; }
.login-brand p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.login-foot { text-align: center; color: var(--muted); font-size: 11px; margin: 20px 0 0; }

/* ---------- Errors ---------- */
.error-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}
.error-card {
  background: #fff; border-radius: var(--radius); padding: 36px;
  text-align: center; box-shadow: var(--shadow); border: 1px solid var(--line);
}
.error-card h1 { font-size: 52px; margin: 0; color: var(--accent); }
.error-card p { color: var(--muted); margin: 8px 0 20px; }

/* ---------- Phase 1A: profile, security and recovery UI ---------- */
.btn-primary { background: var(--accent); }
.btn-primary:hover { background: var(--accent-dark); }
.notice {
  background: #eaf7ef; color: #1d6b3a; border: 1px solid #bfe4cd;
  border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; font-size: 13px;
}
.login-help { margin: 4px 0 8px; font-size: 12px; text-align: right; }
.login-help a { color: var(--accent-dark); font-weight: 600; }
.recovery-box { margin-top: 18px; font-size: 12px; color: var(--muted); }
.recovery-box summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.recovery-box form { margin-top: 10px; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; align-items: start; }
.panel.narrow { max-width: 520px; }
.form-stack select {
  padding: 11px 12px; border: 1px solid #ccd5e3; border-radius: 8px;
  outline: none; background: #fff;
}
.form-stack select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(226, 102, 42, .13); }
.form-stack input[readonly] { background: #f4f6fa; color: var(--muted); }
.code-list {
  list-style: none; padding: 0; margin: 12px 0 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px;
}
.code-list li {
  font-family: Consolas, "Courier New", monospace; font-weight: 700;
  background: #f4f6fa; border: 1px dashed #ccd5e3; border-radius: 8px;
  padding: 8px 10px; text-align: center;
}
.setup-box { background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 16px; max-width: 520px; }
.setup-box .secret {
  font-family: Consolas, "Courier New", monospace; font-size: 15px; font-weight: 700;
  letter-spacing: 1px; background: #fff; border: 1px solid var(--line);
  border-radius: 6px; padding: 8px 10px; word-break: break-all;
}
.setup-box code { font-size: 11px; word-break: break-all; }
.status-on { color: #1d6b3a; }
.status-off { color: #9b2c1f; }

/* ---------- Reports ---------- */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td {
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top;
}
.data-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.data-table tr:last-child td { border-bottom: 0; }
.data-table .row-alert { background: #fdecea; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.filter-bar label { font-size: 12px; font-weight: 600; }
.filter-bar input {
  padding: 9px 10px; border: 1px solid #ccd5e3; border-radius: 8px; background: #fff;
}
.activity-list { list-style: none; padding: 0; margin: 0; }
.activity-list li {
  padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline;
}
.activity-list li:last-child { border-bottom: 0; }
.activity-list time { margin-left: auto; font-size: 11px; color: var(--muted); }

@media (max-width: 820px) {
  .sidebar { width: 74px; flex-basis: 74px; padding: 16px 8px; }
  .brand-name, .nav-label, .nav-item em, .sidebar-foot { display: none; }
  .nav-item { justify-content: center; font-size: 0; padding: 12px; }
  .nav-icon { font-size: 18px; }
  .topbar { padding: 0 16px; }
  .content { padding: 18px; }
  .user-meta, .topbar-user .btn-link { display: none; }
}
