/* SAP Migration — same family look as Fincore (forest sidebar, off-white page, brand green). */
@font-face { font-family: "Inter"; src: url("fonts/inter-latin-var.260c81a4759b.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --forest: #0c1a14;
  --forest-2: #13261e;
  --brand: #17855f;
  --brand-600: #12704f;
  --brand-50: #ecfbf5;
  --brand-100: #d1f5e6;
  --mint: #7fdcb8;
  --page: #f6f5f2;
  --card: #ffffff;
  --ink: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-2: #eef2f6;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --ok: #047857;
  --ok-bg: #d1fae5;
  --info: #0369a1;
  --info-bg: #e0f2fe;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .04);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.5; color: var(--ink); background: var(--page); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 12.5px; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }

/* ---------- shell */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { background: var(--forest); color: #cbd5d1; display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; color: #fff; }
.brand img { width: 34px; height: 34px; border-radius: 50%; background: #fff; }
.brand b { display: block; font-size: 15px; font-weight: 650; }
.brand small { display: block; color: #8fa69c; font-size: 11.5px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: #6f857b; padding: 16px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: #cbd5d1; font-weight: 500; }
.nav a:hover { background: var(--forest-2); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(127, 220, 184, .12); color: #fff; box-shadow: inset 3px 0 0 var(--mint); }
.nav svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.sidebar-foot { margin-top: auto; border-top: 1px solid #1f3329; padding: 14px 8px 0; font-size: 12.5px; }
.sidebar-foot .who { color: #fff; font-weight: 600; }
.sidebar-foot .role { color: #8fa69c; }
.sidebar-foot .links { display: flex; gap: 12px; margin-top: 8px; }
.sidebar-foot a, .sidebar-foot button { color: var(--mint); background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }

.main { padding: 28px 36px 60px; max-width: 1180px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); font-weight: 650; margin-bottom: 4px; }
.page-head h1 { font-size: 24px; font-weight: 700; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

/* ---------- cards and layout */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; }
.card + .card { margin-top: 16px; }
.card-title { font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.card-sub { color: var(--muted); margin: 2px 0 0; font-size: 13px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.stack > * + * { margin-top: 16px; }
.step { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; background: var(--brand-50); color: var(--brand); font-size: 12px; font-weight: 700; align-items: center; justify-content: center; }
.section + .section { border-top: 1px solid var(--line-2); margin-top: 18px; padding-top: 18px; }

/* ---------- forms */
label.field { display: block; font-weight: 550; font-size: 13px; margin-bottom: 6px; }
.input, select, input[type=text], input[type=email], input[type=password], input[type=date], input[type=url] {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; color: var(--ink); background: #fff; transition: border-color .15s, box-shadow .15s;
}
.input:focus, select:focus, input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(23, 133, 95, .15); }
.help { color: var(--muted); font-size: 12px; margin-top: 4px; }
.errorlist { list-style: none; margin: 6px 0 0; padding: 0; color: var(--danger); font-size: 12.5px; }
.form-row { margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--brand); flex: none; }

.ds-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.ds-group h3 { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; font-weight: 650; }
.ds { display: flex; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; margin-bottom: 8px; cursor: pointer; transition: border-color .15s, background .15s; }
.ds:hover { border-color: #b8d9cb; }
.ds input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--brand); flex: none; }
.ds:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.ds b { display: block; font-size: 13.5px; font-weight: 600; }
.ds span { display: block; font-size: 12px; color: var(--muted); line-height: 1.4; }
.tag { display: inline-block; font-size: 10.5px; font-weight: 600; color: var(--info); background: var(--info-bg); border-radius: 999px; padding: 1px 7px; margin-left: 4px; vertical-align: 1px; }

/* ---------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; padding: 10px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none !important; line-height: 1.2; white-space: nowrap; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { border-color: #cbd5e1; background: #fafafa; }
.btn-ghost { background: transparent; color: var(--brand); padding: 6px 8px; }
.btn-danger { background: #fff; color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: var(--danger-bg); }
.btn-sm { padding: 7px 11px; font-size: 13px; border-radius: 9px; }
.btn-lg { padding: 12px 20px; font-size: 15px; }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }

/* ---------- badges and alerts */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--line-2); color: var(--muted); white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.ok, .badge.done { background: var(--ok-bg); color: var(--ok); }
.badge.partial, .badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.failed, .badge.bad { background: var(--danger-bg); color: var(--danger); }
.badge.running, .badge.queued { background: var(--info-bg); color: var(--info); }
.badge.running::before { animation: pulse 1s infinite alternate; }
@keyframes pulse { from { opacity: .3; } to { opacity: 1; } }

.messages { list-style: none; margin: 0 0 18px; padding: 0; }
.alert { border-radius: 12px; padding: 12px 14px; border: 1px solid; font-size: 13.5px; margin-bottom: 8px; }
.alert.success { background: var(--ok-bg); border-color: #a7f3d0; color: #065f46; }
.alert.error { background: var(--danger-bg); border-color: #fecaca; color: #7f1d1d; }
.alert.warning { background: var(--warn-bg); border-color: #fde68a; color: #78350f; }
.alert.info { background: var(--info-bg); border-color: #bae6fd; color: #0c4a6e; }

/* ---------- tables */
.table-wrap { overflow-x: auto; margin: 0 -22px -20px; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table caption { text-align: left; padding: 0 22px 10px; color: var(--muted); font-size: 12.5px; }
.table th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 10px 22px; background: #fafbfc; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.table td { padding: 12px 22px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.empty { text-align: center; padding: 34px 20px; color: var(--muted); }
.empty h3 { color: var(--ink); font-size: 16px; margin-bottom: 6px; }

/* ---------- progress */
.progress-list { list-style: none; margin: 0; padding: 0; }
.progress-list li { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.progress-list li:last-child { border-bottom: 0; }
.state-dot { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--line-2); color: var(--muted); }
.state-dot svg { width: 14px; height: 14px; }
.state-done { background: var(--ok-bg); color: var(--ok); }
.state-failed { background: var(--danger-bg); color: var(--danger); }
.state-running { background: var(--info-bg); color: var(--info); }
.state-running svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress-list b { font-weight: 600; }
.progress-list .msg { color: var(--muted); font-size: 12.5px; word-break: break-word; }
.progress-list .msg.bad { color: var(--danger); }
.bar { height: 6px; background: var(--line-2); border-radius: 99px; overflow: hidden; margin-top: 14px; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .4s; }

.files { display: grid; gap: 10px; }
.file { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.file .icon { width: 38px; height: 38px; border-radius: 10px; background: var(--brand-50); color: var(--brand); display: flex; align-items: center; justify-content: center; flex: none; }
.file .icon svg { width: 20px; height: 20px; }
.file .meta { flex: 1; min-width: 0; }
.file b { display: block; font-weight: 600; }
.file small { color: var(--muted); }
.file.primary { border-color: var(--brand); background: linear-gradient(0deg, var(--brand-50), #fff); }
details.more summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: 13px; margin-top: 12px; }
.notes { margin: 0; padding-left: 18px; color: var(--ink); }
.notes li + li { margin-top: 6px; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; font-size: 13px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.howto { counter-reset: step; list-style: none; margin: 0; padding: 0; }
.howto li { position: relative; padding-left: 34px; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.howto li b { color: var(--ink); display: block; font-weight: 600; }
.howto li::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--brand-50); color: var(--brand); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* ---------- sign in */
.auth { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }
.auth-art { position: relative; background: radial-gradient(1200px 600px at 10% 10%, #183a2d 0%, var(--forest) 55%, #07110d 100%); color: #e8f2ee; padding: 48px; display: flex; flex-direction: column; overflow: hidden; }
.auth-art .brand { padding: 0; }
.auth-art .pitch { margin-top: auto; margin-bottom: auto; max-width: 460px; position: relative; z-index: 1; }
.auth-art .eyebrow { color: var(--mint); }
.auth-art h1 { font-size: 38px; line-height: 1.12; font-weight: 700; color: #fff; margin: 10px 0 22px; }
.auth-art ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; color: #b9cbc3; }
.auth-art li { display: flex; gap: 12px; align-items: center; }
.auth-art li i { width: 30px; height: 30px; border-radius: 8px; border: 1px solid #24443a; display: flex; align-items: center; justify-content: center; color: var(--mint); flex: none; }
.auth-art li svg { width: 15px; height: 15px; }
.auth-art .foot { color: #6f857b; font-size: 12px; position: relative; z-index: 1; }
.auth-art .flow { position: absolute; right: -40px; bottom: 80px; opacity: .22; width: 420px; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-form form { width: 100%; max-width: 380px; }
.auth-form h2 { font-size: 24px; font-weight: 700; }
.auth-form p.sub { color: var(--muted); margin: 4px 0 26px; }

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px; }
  .brand { padding: 0 8px 0 0; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav-label { display: none; }
  .sidebar-foot { margin: 0 0 0 auto; border: 0; padding: 0; }
  .main { padding: 20px 16px 40px; }
  .grid-2, .ds-groups, .form-grid { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
}
.ds .tag { display: inline-block; font-size: 10.5px; color: var(--info); line-height: 1.5; }
.file b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file .btn { padding: 7px 10px; }
.files { grid-template-columns: minmax(0, 1fr); }
.file { min-width: 0; }
