/* KMBC HR System — Styles */
:root {
  --brand: #4A1A7C;
  --brand-dark: #3a1260;
  --accent: #C9A227;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: #f5f4f9; color: #1f1a2e; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.app { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar { width: 230px; background: var(--brand-dark); color: #fff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { padding: 22px 22px 16px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.brand-mark { font-size: 22px; font-weight: 800; color: var(--accent); letter-spacing: 1px; }
.brand-sub { font-size: 12px; color: rgba(255,255,255,0.7); letter-spacing: 2px; text-transform: uppercase; }
.sidebar nav { flex: 1; padding: 12px 0; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 22px; color: rgba(255,255,255,0.82); font-size: 14px; }
.nav-item:hover { background: rgba(255,255,255,0.05); text-decoration: none; color: #fff; }
.nav-item.active { background: var(--brand); color: #fff; border-left: 3px solid var(--accent); padding-left: 19px; }
.nav-icon { width: 18px; text-align: center; color: var(--accent); }
.sidebar-footer { padding: 16px 22px; font-size: 11px; color: rgba(255,255,255,0.6); border-top: 1px solid rgba(255,255,255,0.1); }
.sidebar-footer .muted { color: rgba(255,255,255,0.4); }

/* Main */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; background: #fff; padding: 16px 28px; border-bottom: 1px solid #e6e3ed; box-shadow: 0 1px 2px rgba(0,0,0,0.03); }
.topbar-title { font-size: 22px; font-weight: 700; color: var(--brand); }
.topbar-right { display: flex; align-items: center; gap: 20px; }
.topbar-search input { padding: 8px 12px; border: 1px solid #dcd7e6; border-radius: 6px; width: 280px; font-size: 13px; }
.user-chip { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.user-chip small { color: #6b6578; font-size: 11px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--brand); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }

/* Content */
.content { padding: 26px 28px; max-width: 1400px; }

/* Cards */
.card { background: #fff; border-radius: 8px; padding: 20px 22px; margin-bottom: 18px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); border: 1px solid #ece9f2; }
.card-title { font-size: 14px; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: 0.8px; margin: 0 0 14px; display: flex; align-items: center; justify-content: space-between; }
.card-title .accent { color: var(--accent); }

.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2,1fr); } .grid-3 { grid-template-columns: 1fr 1fr; } }

/* KPI */
.kpi { background: #fff; border-radius: 8px; padding: 18px 20px; border-left: 4px solid var(--brand); box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.kpi-label { font-size: 11px; color: #6b6578; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
.kpi-value { font-size: 30px; font-weight: 800; color: var(--brand); margin-top: 4px; }
.kpi-delta { font-size: 12px; color: #6b6578; margin-top: 4px; }
.kpi.accent { border-left-color: var(--accent); }
.kpi.accent .kpi-value { color: #8b6914; }

/* Tables */
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th { text-align: left; padding: 10px 12px; background: #f7f5fb; color: var(--brand); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; border-bottom: 2px solid #e6e3ed; }
table.data td { padding: 12px; border-bottom: 1px solid #f0edf5; vertical-align: middle; }
table.data tr:hover td { background: #fafafe; }

/* Badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
.badge-success { background: #e5f4e9; color: #2e7d32; }
.badge-warning { background: #fff4d6; color: #8b6914; }
.badge-danger  { background: #fde2e2; color: #c62828; }
.badge-info    { background: #e3e9fa; color: #2a4ba8; }
.badge-muted   { background: #ece9f2; color: #6b6578; }
.badge-default { background: #f2eef8; color: var(--brand); }

/* Progress */
.progress { position: relative; background: #ece9f2; height: 18px; border-radius: 9px; overflow: hidden; }
.progress-bar { background: linear-gradient(90deg, var(--brand), var(--accent)); height: 100%; transition: width 0.3s; }
.progress-label { position: absolute; right: 10px; top: 1px; font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.3); }

/* Buttons */
.btn { display: inline-block; padding: 8px 16px; border-radius: 6px; background: var(--brand); color: #fff; border: none; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--brand-dark); text-decoration: none; color: #fff; }
.btn.accent { background: var(--accent); color: #fff; }
.btn.accent:hover { background: #a8861e; }
.btn.ghost { background: transparent; color: var(--brand); border: 1px solid var(--brand); }
.btn.small { padding: 5px 10px; font-size: 12px; }

/* Form */
label { display: block; font-size: 12px; font-weight: 600; color: #4a4558; margin-bottom: 4px; }
input[type=text], input[type=number], input[type=date], input[type=email], textarea, select {
  width: 100%; padding: 8px 10px; border: 1px solid #dcd7e6; border-radius: 6px; font-size: 13px; font-family: inherit;
}
.form-row { margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Policy boxes */
.policy { background: #f7f5fb; border-left: 3px solid var(--accent); padding: 10px 14px; font-size: 12px; border-radius: 4px; margin-top: 10px; }
.policy strong { color: var(--brand); }

/* Sidebar (onboarding stage pills etc.) */
.stage-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.stage-pill { padding: 8px 14px; background: #fff; border: 1px solid #e6e3ed; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--brand); }
.stage-pill.active { background: var(--brand); color: #fff; }

/* Utility */
.muted { color: #6b6578; font-size: 12px; }
.right { text-align: right; }
.spaced { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.empty { padding: 40px; text-align: center; color: #6b6578; }
.hr { border: none; border-top: 1px solid #ece9f2; margin: 18px 0; }

/* Settings page tabs */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid #ece9f2; margin-bottom: 20px; }
.tabs a { padding: 10px 18px; color: #6b6578; font-size: 13px; font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs a.active { color: var(--brand); border-bottom-color: var(--accent); }
.tabs a:hover { text-decoration: none; color: var(--brand); }
