/* IAMMAN People/HR Admin workspace — reuses the shared CSS custom
   properties from :root in dashboard.html, same as Creative/Planner/
   Employee Portal, so it stays visually consistent app-wide. */

.hr-root { color: var(--text); background: var(--bg); min-height: 100vh; font-size: 14px; }
.hr-shell { display: flex; min-height: 100vh; }

.hr-sidebar {
  width: 232px; flex-shrink: 0; background: var(--bg-elev);
  border-right: 1px solid var(--border); padding: 18px 12px; min-height: 100vh;
  position: sticky; top: 0; align-self: flex-start; transition: width 0.15s ease;
  display: flex; flex-direction: column; justify-content: space-between;
}
.hr-sidebar-top { display: flex; flex-direction: column; }
.hr-sidebar-bottom { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.hr-sidebar.collapsed { width: 64px; }
.hr-sidebar.collapsed .hr-sidebar-bottom { display: none; }
.hr-sidebar-brand { display: flex; align-items: center; gap: 8px; padding: 4px 8px 18px; white-space: nowrap; overflow: hidden; }
.hr-sidebar-brand img { width: 30px; height: 30px; border-radius: 8px; }
.hr-sidebar-brand .label { font-weight: 800; font-size: 14px; }
.hr-sidebar-brand .label b { color: var(--accent); }
.hr-sidebar.collapsed .hr-sidebar-brand .label { display: none; }

.hr-group-label { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); padding: 14px 10px 6px; white-space: nowrap; overflow: hidden; }
.hr-sidebar.collapsed .hr-group-label { display: none; }
.hr-nav-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  font: inherit; background: transparent; border: none; border-left: 3px solid transparent;
  color: var(--text-dim); padding: 9px 10px; border-radius: 0 9px 9px 0; cursor: pointer; font-size: 13.5px;
  white-space: nowrap; overflow: hidden; transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.hr-nav-btn:hover { background: var(--bg-card); color: var(--text); }
.hr-nav-btn.active { background: rgba(255, 230, 0, 0.12); color: var(--accent); font-weight: 600; border-left-color: var(--accent); }
.hr-nav-btn .icon { flex-shrink: 0; width: 18px; text-align: center; }
.hr-sidebar.collapsed .hr-nav-btn .label { display: none; }

.hr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hr-header { display: flex; align-items: center; gap: 14px; padding: 14px 22px; border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.hr-collapse-btn { font: inherit; background: transparent; border: 1px solid var(--border); color: var(--text-dim); border-radius: 8px; padding: 6px 9px; cursor: pointer; }
.hr-header-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.hr-header button { font: inherit; background: var(--bg-elev); border: 1px solid var(--border); color: var(--text); padding: 8px 14px; border-radius: 10px; cursor: pointer; font-size: 12.5px; }
.hr-header button:hover { border-color: var(--accent); }
.hr-btn-danger { border-color: rgba(239, 68, 68, 0.4) !important; color: var(--red) !important; }

.hr-notif-wrap { position: relative; }
.hr-notif-bell { position: relative; font-size: 15px; }
.hr-notif-badge { position: absolute; top: -4px; right: -4px; background: var(--red); color: #fff; font-size: 9.5px; font-weight: 700; border-radius: 999px; padding: 1px 5px; min-width: 14px; text-align: center; }
.hr-notif-panel { position: absolute; top: calc(100% + 8px); right: 0; width: 320px; max-height: 380px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); z-index: 30; display: flex; flex-direction: column; }
.hr-notif-panel-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.hr-notif-markall-btn { background: none; border: none; color: var(--blue); cursor: pointer; font-size: 12px; padding: 0; }
.hr-notif-list { overflow-y: auto; }
.hr-notif-item { padding: 10px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); font-size: 12.5px; cursor: pointer; }
.hr-notif-item:hover { background: rgba(255, 255, 255, 0.03); }
.hr-notif-item.read { opacity: 0.55; }
.hr-notif-item:last-child { border-bottom: none; }

.hr-content { flex: 1; padding: 22px; overflow-y: auto; max-width: 1100px; }
.hr-greet { margin-bottom: 16px; }
.hr-greet h2 { margin: 0 0 4px; font-size: 20px; }
.hr-greet p, .hr-hint { margin: 0; color: var(--text-dim); font-size: 12.5px; }
.hr-greet-row { display: flex; justify-content: space-between; align-items: center; }
.hr-empty { text-align: center; padding: 30px 10px; color: var(--text-faint); }

.hr-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }

.hr-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.hr-kpi { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.hr-kpi .n { font-size: 26px; font-weight: 800; }
.hr-kpi .l { font-size: 11.5px; color: var(--text-dim); margin-top: 4px; }

.hr-search { width: 100%; font: inherit; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border); color: var(--text); padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; }

.hr-table { width: 100%; border-collapse: collapse; font-size: 12.5px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.hr-table th { text-align: left; color: var(--text-faint); font-weight: 600; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.03em; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.hr-table td { padding: 10px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); vertical-align: top; }
.hr-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 230, 0, 0.12); color: var(--accent); font-size: 13px; font-weight: 800;
}
.hr-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hr-table tr:last-child td { border-bottom: none; }

/* HR Dashboard — per-employee cards, same footprint as MAN Gateway's own
   Main Menu quick-menu cards (.man-quick-card in dashboard.html: 3 per
   row, 18px gap, same responsive breakpoints) so they read as the same
   "size class" of card across the app, just laid out vertically for a
   photo instead of horizontally for an icon. */
.hr-emp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 980px) { .hr-emp-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .hr-emp-grid { grid-template-columns: 1fr; } }
.hr-emp-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 18px;
  padding: 32px 24px; display: flex; flex-direction: column; align-items: center; text-align: center;
}
.hr-emp-avatar-lg {
  width: 140px; height: 140px; border-radius: 50%; flex-shrink: 0; overflow: hidden; margin-bottom: 18px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 230, 0, 0.12); color: var(--accent); font-size: 48px; font-weight: 800;
}
.hr-emp-avatar-lg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hr-emp-name { font-size: 18px; font-weight: 700; }
.hr-emp-stats { display: flex; gap: 28px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); width: 100%; justify-content: center; }
.hr-emp-stats div { display: flex; flex-direction: column; align-items: center; }
.hr-emp-stats b { font-size: 24px; font-weight: 800; }
.hr-emp-stats span { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.hr-badge { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.hr-badge.ok { background: rgba(34, 197, 94, 0.15); color: var(--green); }
.hr-badge.warn { background: rgba(250, 204, 21, 0.15); color: var(--yellow); }
.hr-badge.err { background: rgba(239, 68, 68, 0.15); color: var(--red); }
.hr-badge.info { background: rgba(56, 189, 248, 0.15); color: var(--blue); }
.hr-badge.muted { background: rgba(148, 163, 184, 0.15); color: var(--text-dim); }

.hr-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.hr-tab { font: inherit; background: var(--bg-card); border: 1px solid var(--border); color: var(--text-dim); padding: 7px 14px; border-radius: 999px; cursor: pointer; font-size: 12.5px; }
.hr-tab:hover { color: var(--text); }
.hr-tab.active { background: rgba(255, 230, 0, 0.12); border-color: var(--accent); color: var(--accent); font-weight: 600; }

.hr-leave-card { display: flex; justify-content: space-between; align-items: center; gap: 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }
.hr-leave-main { font-size: 13px; }
.hr-leave-reason { color: var(--text-dim); font-size: 12px; margin-top: 4px; font-style: italic; }
.hr-leave-actions { display: flex; gap: 8px; flex-shrink: 0; }
.hr-btn-ok, .hr-btn-err { font: inherit; border: none; padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 12.5px; font-weight: 600; }
.hr-btn-ok { background: rgba(34, 197, 94, 0.15); color: var(--green); }
.hr-btn-err { background: rgba(239, 68, 68, 0.15); color: var(--red); }
.hr-btn-ok:disabled, .hr-btn-err:disabled { opacity: 0.5; cursor: not-allowed; }
.hr-leave-edit { width: 100%; }
.hr-leave-edit .hr-form-field { margin-bottom: 10px; }

.hr-form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.hr-form-field label { font-size: 12px; color: var(--text-dim); }
.hr-form-field input, .hr-form-field select { font: inherit; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border); color: var(--text); padding: 10px 12px; border-radius: 10px; }
.hr-btn-primary { font: inherit; background: var(--accent); color: #1a1408; border: none; padding: 9px 16px; border-radius: 10px; font-weight: 700; cursor: pointer; font-size: 13px; }

.hr-holiday-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.hr-holiday-row:last-child { border-bottom: none; }
.hr-link-btn { background: none; border: none; color: var(--red); cursor: pointer; font-size: 12px; padding: 0; margin-right: 10px; }

/* Payroll — salary certificate / payslip print view, same pattern as
   Employee Portal's own (public/employee-portal/employee-portal.css) —
   duplicated rather than shared since there's no bundler in this app. */
.hr-print-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.75); z-index: 200;
  display: flex; flex-direction: column; align-items: center; overflow-y: auto; padding: 24px 16px;
}
.hr-print-toolbar { display: flex; gap: 10px; margin-bottom: 16px; }
.hr-print-toolbar button { font: inherit; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); cursor: pointer; }
.hr-print-doc {
  background: #fff; color: #111; width: 210mm; max-width: 100%; min-height: 297mm;
  padding: 20mm; box-shadow: 0 0 30px rgba(0, 0, 0, 0.5); font-size: 14px; line-height: 1.6;
}
.hr-print-company { font-size: 20px; font-weight: 800; }
.hr-print-info, .hr-print-slip { width: 100%; border-collapse: collapse; margin-top: 14px; }
.hr-print-info td { padding: 4px 8px 4px 0; }
.hr-print-slip th, .hr-print-slip td { padding: 8px; border-bottom: 1px solid #ddd; text-align: left; }
.hr-print-slip th { background: #f5f5f5; }

@media print {
  body * { visibility: hidden; }
  .hr-print-doc, .hr-print-doc * { visibility: visible; }
  .hr-print-overlay { position: static; background: none; padding: 0; }
  .hr-print-doc { position: absolute; top: 0; left: 0; width: 100%; box-shadow: none; padding: 10mm; }
  .hr-print-toolbar { display: none; }
}

@media (max-width: 720px) {
  /* Hidden off-canvas by default (was always-visible + fixed, permanently
     covering ~60% of a phone screen with no way to dismiss it) — opens via
     the .open class (mobileDrawerOpen state), same pattern as the classic
     dashboard's .man-sidebar / .ct-sidebar. */
  .hr-sidebar { position: fixed; left: 0; top: 0; z-index: 20; height: 100vh; width: 232px !important; transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: 0 0 40px rgba(0,0,0,0.5); }
  .hr-sidebar.open { transform: translateX(0); }
  .hr-content { padding: 16px; }
  .hr-leave-card { flex-direction: column; align-items: flex-start; }
}
