:root {
  --hrms-bg: #edf1f7;
  --hrms-panel: #ffffff;
  --hrms-border: #e3e9f0;
  --hrms-line: #eff3f8;
  --hrms-title: #1a2233;
  --hrms-text: #2e3950;
  --hrms-muted: #6b7789;
  --hrms-faint: #a3aebf;
  --hrms-accent: #c2410c;
  --hrms-accent-soft: #fbf0e9;
  --bs-primary: #c2410c;
  --bs-primary-rgb: 194, 65, 12;
  --bs-body-color: #2e3950;
  --bs-body-bg: #edf1f7;
  --bs-border-color: #e3e9f0;
  --bs-link-color: #c2410c;
  --bs-link-hover-color: #9a330a;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--hrms-bg);
  color: var(--hrms-text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
}

/* ---- shell ---- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 262px; flex: 0 0 262px; background: var(--hrms-panel);
  border-right: 1px solid var(--hrms-border); position: sticky; top: 0;
  height: 100vh; overflow-y: auto;
}
.app-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.app-content { padding: 30px 34px 60px; flex: 1 1 auto; }

/* ---- brand ---- */
.brand { display: flex; align-items: center; gap: 12px; padding: 24px 22px 18px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 9px; background: var(--hrms-accent);
  color: #fff; font-weight: 700; font-size: 20px; display: grid; place-items: center;
}
.brand-name { font-weight: 700; font-size: 15px; color: var(--hrms-title); line-height: 1.1; }
.brand-sub { font-size: 10.5px; color: var(--hrms-muted); }

/* ---- nav ---- */
.nav-section { padding: 10px 0 4px; }
.nav-heading { font-size: 9.5px; font-weight: 700; letter-spacing: .04em;
  color: #9aa6b8; padding: 8px 24px 6px; }
.nav-sep { height: 1px; background: var(--hrms-line); margin: 8px 20px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 9px 24px;
  color: var(--hrms-muted); text-decoration: none; font-size: 13px; position: relative;
}
.nav-link:hover { background: #f6f8fb; color: var(--hrms-text); }
.nav-link.active {
  background: var(--hrms-accent-soft); color: var(--hrms-accent); font-weight: 600;
}
.nav-link.active::after {
  content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 3px;
  background: var(--hrms-accent);
}
.nav-link svg { flex: 0 0 18px; }

/* ---- topbar ---- */
.topbar {
  height: 56px; background: var(--hrms-panel); border-bottom: 1px solid var(--hrms-border);
  display: flex; align-items: center; gap: 24px; padding: 0 24px;
  position: sticky; top: 0; z-index: 5;
}
.clock { display: flex; align-items: center; gap: 8px; color: var(--hrms-muted); font-size: 11px; }
.clock .tz {
  width: 20px; height: 20px; border-radius: 50%; background: #2563eb; color: #fff;
  font-size: 8.5px; font-weight: 700; display: grid; place-items: center;
}
.clock .tz.pst { background: #1e3a8a; }
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar-user .avatar {
  width: 26px; height: 26px; border-radius: 50%; background: #b23a2e; color: #fff;
  font-size: 11px; font-weight: 700; display: grid; place-items: center;
}
.topbar-user .name { font-size: 12px; font-weight: 600; color: var(--hrms-text); }
.bell { color: var(--hrms-muted); position: relative; }
.bell .dot { position: absolute; top: -2px; right: -2px; width: 7px; height: 7px;
  background: #e11d48; border-radius: 50%; }

/* ---- cards & headers ---- */
.card-panel {
  background: var(--hrms-panel); border: 1px solid var(--hrms-border);
  border-radius: 10px; padding: 22px;
}
.card-panel + .card-panel { margin-top: 22px; }
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.page-head .bar { width: 4px; height: 26px; background: var(--hrms-accent); border-radius: 2px;
  margin-top: 3px; }
.page-title { font-size: 21px; font-weight: 700; color: var(--hrms-title); margin: 0; }
.page-sub { font-size: 12px; color: var(--hrms-muted); margin: 4px 0 0; }
.page-head .actions { margin-left: auto; display: flex; gap: 10px; }

/* ---- buttons ---- */
.btn { border-radius: 6px; font-size: 13px; font-weight: 600; display: inline-flex;
  align-items: center; gap: 7px; }
.btn-accent { background: var(--hrms-accent); border-color: var(--hrms-accent); color: #fff; }
.btn-accent:hover { background: #a5360a; border-color: #a5360a; color: #fff; }
.btn-blue { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn-blue:hover { background: #1d4ed8; color: #fff; }
.btn-dark2 { background: #1f2937; color: #fff; }
.btn-dark2:hover { background: #111827; color: #fff; }

/* ---- chips ---- */
.chip { display: inline-block; padding: 3px 11px; border-radius: 5px; font-size: 11px;
  font-weight: 600; }
.chip-blue { background: #dce9fd; color: #1d4ed8; }
.chip-hold { background: #fdf0d2; color: #a0620b; }
.chip-ok { background: #dbf3e3; color: #177245; }
.chip-red { background: #fbe3e0; color: #b3261e; }
.chip-grey { background: #eceff3; color: #55617a; }

/* ---- stat cards ---- */
.stat-grid { display: grid; gap: 20px; grid-template-columns: repeat(4, 1fr); }
.stat-card { background: var(--hrms-panel); border: 1px solid var(--hrms-border);
  border-radius: 10px; padding: 18px 20px; display: flex; align-items: center; gap: 14px; }
.stat-icon { width: 42px; height: 42px; border-radius: 9px; background: #f4f7fb;
  display: grid; place-items: center; }
.stat-body { margin-left: auto; text-align: right; }
.stat-value { font-size: 23px; font-weight: 700; color: var(--hrms-title); line-height: 1; }
.stat-label { font-size: 11px; margin-top: 4px; }

/* ---- tables ---- */
.table-hrms { width: 100%; border-collapse: collapse; background: var(--hrms-panel);
  border: 1px solid var(--hrms-border); border-radius: 8px; overflow: hidden; }
.table-hrms thead th { background: #f5eadc; color: #8a5a2b; font-size: 12px; font-weight: 600;
  text-align: left; padding: 13px 16px; white-space: nowrap; }
.table-hrms tbody td { padding: 13px 16px; border-top: 1px solid var(--hrms-line);
  font-size: 13px; vertical-align: middle; }
.table-hrms tbody tr:hover { background: #fafbfd; }
.table-hrms .actions { display: flex; gap: 12px; color: var(--hrms-faint); }
.table-hrms .actions a { color: var(--hrms-faint); }
.table-hrms .actions a:hover { color: var(--hrms-accent); }
.table-wrap { overflow-x: auto; }

/* ---- forms ---- */
.form-label { font-size: 12px; font-weight: 600; color: var(--hrms-text); margin-bottom: 6px; }
.form-control, .form-select { font-size: 13px; border-color: var(--hrms-border);
  background: #f8fafc; border-radius: 6px; padding: 9px 12px; }
.form-control:focus, .form-select:focus { border-color: var(--hrms-accent);
  box-shadow: 0 0 0 3px rgba(194,65,12,.12); }
.filter-grid { display: grid; gap: 18px 22px; grid-template-columns: repeat(4, 1fr); }
.avatar-sm { width: 30px; height: 30px; border-radius: 50%; background: #d7dee8;
  display: grid; place-items: center; color: #8494aa; }

/* ---- tabs (employee form) ---- */
.wizard { display: flex; gap: 4px; background: #f6f8fb; border-radius: 8px; padding: 6px;
  flex-wrap: wrap; }
.wizard a { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 6px;
  text-decoration: none; color: var(--hrms-text); font-size: 13px; }
.wizard a.active { background: #fff; border: 1px solid var(--hrms-border); font-weight: 600;
  color: var(--hrms-accent); }
.wizard .num { width: 20px; height: 20px; border-radius: 50%; background: #e6eaf0;
  color: var(--hrms-muted); font-size: 9.5px; font-weight: 700; display: grid; place-items: center; }
.wizard a.active .num { background: var(--hrms-accent); color: #fff; }
.section-title { font-size: 17px; font-weight: 700; color: var(--hrms-title);
  border-bottom: 1px solid var(--hrms-line); padding-bottom: 10px; margin: 26px 0 20px; }

/* ---- login ---- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: #f4f6fa; }
.login-card { width: 440px; max-width: 92vw; background: #fff; border: 1px solid var(--hrms-border);
  border-radius: 14px; padding: 40px 44px; }
.login-brand { width: 60px; height: 60px; border-radius: 13px; background: var(--hrms-accent);
  color: #fff; font-size: 30px; font-weight: 700; display: grid; place-items: center;
  margin: 0 auto 16px; }

@media (max-width: 900px) {
  .sidebar { display: none; }
  .stat-grid, .filter-grid { grid-template-columns: repeat(2, 1fr); }
}
