/* ERP Advantage Admin — brand: #008CED blue, #084370 navy, #141414 ink, #FFFFFF */
:root {
  --blue: #008CED; --blue-deep: #0072c2; --navy: #084370; --ink: #141414;
  --muted: #5b6b84; --line: #e3e9f1; --bg: #f3f6fa; --card: #ffffff;
  --ok: #1c8a43; --warn: #9a6b00; --bad: #c62828;
}
* { box-sizing: border-box; margin: 0; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); font-size: 14px; }
button, input, select, textarea { font: inherit; }
.muted { color: var(--muted); }
.err { color: var(--bad); font-size: 13px; margin-top: 8px; }

.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100dvh; padding: 16px;
  background: linear-gradient(135deg, var(--navy), #0a5a96); }
.login-card { background: #fff; padding: 32px 28px; border-radius: 14px; box-shadow: 0 16px 40px rgba(0,0,0,.25); width: 100%; max-width: 360px; }
.login-logo { width: 200px; display: block; margin: 0 auto 10px; }
.login-card h1 { font-size: 18px; text-align: center; margin-bottom: 14px; color: var(--navy); }
.login-card input { width: 100%; padding: 11px 12px; margin: 2px 0 8px; border: 1px solid #ccd6e3; border-radius: 8px; font-size: 16px; }
.login-card button { width: 100%; padding: 12px; margin-top: 8px; background: var(--blue); color: #fff; border: 0; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; }
.login-card button:hover { background: var(--blue-deep); }

#shell { display: flex; min-height: 100dvh; }
#sidebar { width: 220px; background: var(--navy); color: #fff; padding: 14px 0; display: flex; flex-direction: column; flex-shrink: 0; }
#sidebar .brand { padding: 6px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 10px; }
#sidebar .brand img { width: 170px; max-width: 100%; display: block; }
.navlinks { display: flex; flex-direction: column; flex: 1; }
#sidebar a { color: #cfe0f2; text-decoration: none; padding: 10px 20px; cursor: pointer; white-space: nowrap; }
#sidebar a:hover { background: rgba(255,255,255,.08); color: #fff; }
#sidebar a.active { background: var(--blue); color: #fff; }
#sidebar a.logout { margin-top: auto; color: #9db8d6; }
#main { flex: 1; padding: 26px 30px; min-width: 0; }
.tab { display: none; }
.tab.active { display: block; }
h2 { font-size: 20px; margin-bottom: 16px; color: var(--navy); }
h3 { font-size: 15px; margin-bottom: 8px; color: var(--navy); }

.card { background: var(--card); border-radius: 12px; padding: 18px; box-shadow: 0 2px 8px rgba(8,67,112,.07); margin-bottom: 16px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile { background: var(--card); border-radius: 12px; padding: 16px; box-shadow: 0 2px 8px rgba(8,67,112,.07); border-top: 3px solid var(--blue); }
.tile .n { font-size: 28px; font-weight: 700; color: var(--navy); }
.tile .l { color: var(--muted); font-size: 13px; margin-top: 2px; }

.tablewrap { overflow-x: auto; background: var(--card); border-radius: 12px; box-shadow: 0 2px 8px rgba(8,67,112,.07); }
table.tbl { width: 100%; border-collapse: collapse; background: var(--card); font-size: 13px; }
table.tbl th { text-align: left; padding: 10px 12px; background: #eaf2fb; font-weight: 600; color: var(--navy); white-space: nowrap; }
table.tbl td { padding: 9px 12px; border-top: 1px solid var(--line); vertical-align: top; }
table.tbl tr.clickable { cursor: pointer; }
table.tbl tr.clickable:hover td { background: #f7fbff; }
tr.detail td { background: #fafcff; }
.pre { white-space: pre-wrap; word-break: break-word; }

.btn { display: inline-block; padding: 7px 14px; background: var(--blue); color: #fff; border: 0; border-radius: 7px; font-size: 13px; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--blue-deep); }
.btn.secondary { background: #e5edf6; color: var(--navy); }
.btn.danger { background: var(--bad); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
input, select, textarea { padding: 8px 10px; border: 1px solid #ccd6e3; border-radius: 7px; background: #fff; }
label { font-size: 12px; color: var(--muted); display: block; margin: 8px 0 3px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 4px 14px; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: #e5edf6; color: var(--navy); white-space: nowrap; }
.badge.ok { background: #e3f4e9; color: var(--ok); }
.badge.warn { background: #fff4d6; color: var(--warn); }
.badge.bad { background: #fde7e7; color: var(--bad); }
.badge.new { background: #dff0fd; color: var(--blue-deep); }

@media (max-width: 760px) {
  #shell { flex-direction: column; }
  #sidebar { width: 100%; padding: 8px 0 0; }
  #sidebar .brand { border: 0; padding: 4px 16px 8px; margin: 0; }
  #sidebar .brand img { width: 140px; }
  .navlinks { flex-direction: row; overflow-x: auto; }
  #sidebar a { padding: 10px 14px; }
  #sidebar a.logout { margin-top: 0; margin-left: auto; }
  #main { padding: 18px 16px; }
  input, select, textarea { font-size: 16px; } /* iOS: <16px zooms the page */
}
