/* ═══════════════════════════════════════════════════════════════════
   A4 Associates Staff Portal — Styles
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --portal-primary: #166534;
  --portal-primary-light: #dcfce7;
  --portal-gold: #B8960C;
  --portal-dark: #111827;
  --portal-gray: #6b7280;
  --portal-border: #e5e7eb;
  --portal-bg: #f0fdf4;
  --portal-white: #ffffff;
  --portal-radius: 12px;
  --portal-shadow: 0 4px 20px rgba(0,0,0,0.06);

  /* ── Dark dashboard theme ──────────────────────────────────────── */
  --bg-page:        #111827;
  --bg-sidebar:     #0F1F14;
  --bg-card:        #1F2937;
  --bg-card-hover:  #263340;
  --bg-topbar:      #1a1f2e;
  --clr-green:      #166534;
  --clr-green-lt:   #22C55E;
  --clr-gold:       #D97706;
  --clr-blue:       #3B82F6;
  --txt-primary:    #F9FAFB;
  --txt-secondary:  #D1D5DB;
  --txt-muted:      #9CA3AF;
  --dk-border:      #374151;
  --dk-border-light: #4B5563;
  --sb-active-bg:   rgba(22, 101, 52, 0.35);

  /* ── HR module light theme ────────────────────────────────────── */
  --hr-bg:          #F9FAFB;
  --hr-card:        #FFFFFF;
  --hr-border:      #E5E7EB;
  --hr-text:        #111827;
  --hr-muted:       #6B7280;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--portal-dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Login Page ───────────────────────────────────────────────────── */

.login-page {
  background: var(--portal-bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-wrapper {
  width: 100%;
  max-width: 440px;
  padding: 20px;
}

.login-card {
  background: var(--portal-white);
  border-radius: var(--portal-radius);
  box-shadow: var(--portal-shadow);
  padding: 40px 36px;
}

.login-logo {
  text-align: center;
  margin-bottom: 30px;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: var(--portal-primary);
  color: #fff;
  border-radius: 50%;
  font-weight: 800;
  font-size: 22px;
  margin-bottom: 16px;
}

.login-logo h1 {
  font-size: 1.5rem;
  color: var(--portal-primary);
  margin-bottom: 4px;
}

.login-subtitle {
  color: var(--portal-gray);
  font-size: 0.9rem;
}

/* ── Alerts ───────────────────────────────────────────────────────── */

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

/* ── Form Elements ────────────────────────────────────────────────── */

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--portal-dark);
  margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--portal-border);
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--portal-dark);
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fafafa;
}

.form-group input:focus {
  outline: none;
  border-color: var(--portal-primary);
  box-shadow: 0 0 0 3px rgba(22,101,52,0.1);
  background: #fff;
}

.form-hint {
  display: block;
  font-size: 0.78rem;
  color: var(--portal-gray);
  margin-top: 4px;
}

.password-wrapper {
  position: relative;
}

.password-wrapper input {
  padding-right: 48px;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--portal-gray);
  padding: 4px;
}

.eye-icon {
  width: 20px;
  height: 20px;
}

.form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--portal-gray);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  accent-color: var(--portal-primary);
  width: 16px;
  height: 16px;
}

.forgot-link {
  font-size: 0.88rem;
  color: var(--portal-primary);
  text-decoration: none;
  font-weight: 500;
}

.forgot-link:hover {
  text-decoration: underline;
}

/* ── OTP ──────────────────────────────────────────────────────────── */

.otp-info {
  text-align: center;
  margin-bottom: 24px;
}

.otp-icon {
  margin-bottom: 12px;
}

.otp-info p {
  color: var(--portal-gray);
  font-size: 0.95rem;
}

.otp-info strong {
  color: var(--portal-dark);
}

.otp-input {
  text-align: center;
  font-size: 1.8rem !important;
  letter-spacing: 10px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
}

.otp-actions {
  text-align: center;
  margin-top: 16px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--portal-primary);
  font-size: 0.88rem;
  cursor: pointer;
  font-weight: 500;
  text-decoration: none;
}

.link-btn:hover {
  text-decoration: underline;
}

.divider {
  color: var(--portal-border);
  margin: 0 10px;
}

/* ── Buttons ──────────────────────────────────────────────────────── */

.btn-login {
  width: 100%;
  padding: 14px;
  background: var(--portal-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn-login:hover {
  background: #14532d;
}

.btn-login:active {
  transform: scale(0.98);
}

.btn-small {
  padding: 6px 14px;
  background: var(--portal-primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  margin: 2px;
}

.btn-small:hover { background: #14532d; }

.btn-outline-small {
  background: transparent;
  color: var(--portal-primary);
  border: 1px solid var(--portal-primary);
}

.btn-outline-small:hover {
  background: var(--portal-primary-light);
  color: var(--portal-primary);
}

/* ── Login Footer ─────────────────────────────────────────────────── */

.login-footer {
  text-align: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--portal-border);
}

.login-footer p {
  font-size: 0.82rem;
  color: var(--portal-gray);
  margin-bottom: 4px;
}

.login-footer a {
  color: var(--portal-primary);
  text-decoration: none;
  font-weight: 500;
}

.login-footer a:hover {
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════════
   DASHBOARD LAYOUT — RBAC portal (Staff / Admin / Super Admin)
   ═══════════════════════════════════════════════════════════════════ */

.dashboard-body { background: var(--bg-page); }

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

/* ── Sidebar ──────────────────────────────────────────────────────── */

.sidebar {
  width: 260px;
  height: 100vh; /* bounds the fixed-position sidebar so .sidebar-nav's
                    flex:1 + overflow-y:auto below can actually scroll —
                    min-height let the flex column grow past the viewport
                    with no ceiling, pushing .sidebar-footer off-screen
                    with nothing left to scroll it into view. */
  background: var(--bg-sidebar);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  position: relative;
}

.sidebar-collapse-btn {
  margin-left: auto;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.2s;
}
.sidebar-collapse-btn:hover { background: rgba(255,255,255,0.2); }
.sidebar-collapse-btn svg { width: 14px; height: 14px; }

/* ── Collapsed sidebar (icon-only mode) ───────────────────────────── */

.sidebar.collapsed { width: 72px; }
.sidebar.collapsed .sidebar-brand span,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-badge-new,
.sidebar.collapsed .sidebar-section-label,
.sidebar.collapsed .sidebar-sublist {
  display: none;
}
.sidebar.collapsed .sidebar-brand { justify-content: center; padding: 22px 12px; }
.sidebar.collapsed .sidebar-collapse-btn { margin-left: 0; transform: rotate(180deg); }
.sidebar.collapsed .nav-item { justify-content: center; padding: 11px 0; }
.sidebar.collapsed + .sidebar-overlay + .main-wrap { margin-left: 72px; }

@media (max-width: 768px) {
  .sidebar.collapsed { width: 260px; }
  .sidebar.collapsed .sidebar-brand span,
  .sidebar.collapsed .nav-label,
  .sidebar.collapsed .nav-badge-new,
  .sidebar.collapsed .sidebar-section-label,
  .sidebar.collapsed .sidebar-sublist { display: revert; }
  .sidebar-collapse-btn { display: none; }
}

.sidebar-brand .logo-mark {
  width: 38px;
  height: 38px;
  background: rgba(255,255,255,0.15);
  font-size: 15px;
  margin-bottom: 0;
}

.sidebar-nav {
  flex: 1;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 5px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 10px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 8px;
  color: rgba(255,255,255,0.72);
  text-decoration: none;
  font-size: 0.88rem;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}

.nav-item:hover { background: rgba(255,255,255,0.1); color: #fff; }

.nav-item.active {
  background: var(--sb-active-bg);
  color: #fff;
  border-left-color: var(--clr-green-lt);
  font-weight: 600;
}

.nav-icon svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.12);
}

/* ── HR Department sidebar section ───────────────────────────────── */

.sidebar-section-label {
  margin: 14px 14px 4px;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--clr-gold);
  opacity: 0.85;
}

.nav-item-hr { position: relative; }

.nav-badge-new {
  margin-left: auto;
  background: var(--clr-gold);
  color: #1A2535;
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 7px;
  border-radius: 10px;
  flex-shrink: 0;
}

.sidebar-sublist {
  display: flex;
  flex-direction: column;
  margin: 2px 0 6px;
  padding-left: 30px;
}

.sidebar-subitem {
  padding: 8px 12px;
  font-size: 0.81rem;
  color: rgba(255,255,255,0.62);
  text-decoration: none;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  transition: all 0.15s;
}

.sidebar-subitem:hover { color: #fff; background: rgba(255,255,255,0.08); }

.sidebar-subitem.active {
  background: rgba(22,101,52,0.3);
  border-left-color: var(--clr-gold);
  color: #fff;
  font-weight: 600;
}

/* ── Main wrap / Topbar ───────────────────────────────────────────── */

.main-wrap {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-page);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 28px;
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--dk-border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.hamburger-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--txt-primary);
  padding: 6px;
}
.hamburger-btn svg { width: 24px; height: 24px; }

.topbar-greeting { white-space: nowrap; }
.topbar-greeting h1 { font-size: 1.25rem; font-weight: 700; color: var(--txt-primary); }
.topbar-greeting p { font-size: 0.82rem; color: var(--txt-muted); margin-top: 2px; display: flex; align-items: center; gap: 6px; }

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-role-staff { background: var(--clr-blue); color: #fff; }
.badge-role-admin { background: var(--dk-border-light); color: #fff; }
.badge-role-super { background: var(--clr-gold); color: #fff; }
.badge-role-owner { background: #7C3AED; color: #fff; }
.crown-icon { width: 12px; height: 12px; }

/* Topbar global search */
.topbar-search { flex: 1; position: relative; max-width: 420px; }
.topbar-search input {
  width: 100%;
  padding: 9px 14px;
  border: 1.5px solid var(--dk-border);
  border-radius: 20px;
  font-size: 0.85rem;
  background: var(--bg-card);
  color: var(--txt-primary);
}
.topbar-search input::placeholder { color: var(--txt-muted); }
.topbar-search input:focus { outline: none; border-color: var(--clr-green-lt); background: var(--bg-card-hover); }
.search-results {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--dk-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  max-height: 360px;
  overflow-y: auto;
  z-index: 80;
}
.search-results.open { display: block; }
.search-results .sr-group-label { padding: 8px 14px 4px; font-size: 0.72rem; text-transform: uppercase; color: var(--txt-muted); font-weight: 700; }
.search-results a.sr-item { display: block; padding: 8px 14px; color: var(--txt-primary); text-decoration: none; font-size: 0.85rem; }
.search-results a.sr-item:hover { background: var(--bg-card-hover); }
.search-results .sr-empty { padding: 14px; color: var(--txt-muted); font-size: 0.85rem; text-align: center; }

.topbar-actions { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }

.bell-btn {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--dk-border);
  cursor: pointer;
  color: var(--txt-muted);
  padding: 8px;
  border-radius: 8px;
  transition: background 0.2s;
}
.bell-btn:hover { background: var(--bg-card-hover); }
.bell-btn svg { width: 22px; height: 22px; }

.bell-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  background: #EF4444;
  color: #fff;
  border-radius: 10px;
  font-size: 0.62rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-topbar);
}

.notif-panel {
  display: none;
  position: absolute;
  top: 56px;
  right: 28px;
  width: 320px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--dk-border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 90;
}
.notif-panel.open { display: block; }
.notif-panel .notif-item { display: block; padding: 12px 16px; border-bottom: 1px solid var(--dk-border); color: var(--txt-primary); text-decoration: none; font-size: 0.85rem; }
.notif-panel .notif-item.unread { background: rgba(34,197,94,0.08); font-weight: 600; }
.notif-panel .notif-item small { display: block; color: var(--txt-muted); font-weight: 400; margin-top: 2px; }
.notif-panel .notif-empty { padding: 20px; text-align: center; color: var(--txt-muted); font-size: 0.85rem; }

.avatar-circle {
  width: 40px;
  height: 40px;
  background: var(--clr-green);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  overflow: hidden;
  flex-shrink: 0;
}
.avatar-circle img { width: 100%; height: 100%; object-fit: cover; }

.avatar-circle-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--clr-green);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
}

/* ── Content area ─────────────────────────────────────────────────── */

.content-area { padding: 28px; background: var(--bg-page); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--portal-radius);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--dk-border);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 24px; height: 24px; }

.chip-blue  { background: rgba(59,130,246,0.15); color: #3B82F6; }
.chip-green { background: rgba(34,197,94,0.15); color: #22C55E; }
.chip-amber { background: rgba(245,158,11,0.15); color: #F59E0B; }
.chip-gold  { background: rgba(217,119,6,0.15); color: #D97706; }
.chip-red   { background: rgba(239,68,68,0.15); color: #EF4444; }
.chip-red-stat { background: rgba(239,68,68,0.15); color: #EF4444; }

.stat-value { display: block; font-size: 1.7rem; font-weight: 800; color: var(--txt-primary); line-height: 1; }
.stat-label { display: block; font-size: 0.8rem; color: var(--txt-muted); margin-top: 4px; }

/* ── Welcome panel + Quick Links grid (Bizsoft-style dashboard) ──────── */

.welcome-panel { display: flex; align-items: center; }
.welcome-panel .panel-body { width: 100%; }

.quick-links-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.quick-link-item {
  display: block;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--dk-border);
  border-radius: 8px;
  color: var(--txt-primary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  transition: all 0.15s;
}
.quick-link-item:hover { background: var(--bg-card-hover); border-color: var(--clr-green-lt); color: var(--clr-green-lt); }

@media (max-width: 1024px) { .quick-links-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .quick-links-grid { grid-template-columns: repeat(2, 1fr); } }

/* ── Panels & list rows ───────────────────────────────────────────── */

.panels-row { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 24px; }
.panels-row-snapshot { grid-template-columns: 1.4fr 0.6fr; }

.panel {
  background: var(--bg-card);
  border-radius: var(--portal-radius);
  border: 1px solid var(--dk-border);
  overflow: hidden;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--dk-border);
}
.panel-header h3 { font-size: 1rem; font-weight: 700; color: var(--txt-primary); }
.panel-body { padding: 14px 22px; }

.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--dk-border);
}
.list-row:last-child { border-bottom: none; }
.list-title { font-size: 0.9rem; font-weight: 600; color: var(--txt-primary); }
.list-sub { font-size: 0.78rem; color: var(--txt-muted); margin-top: 2px; }

.empty-state { color: var(--txt-muted); font-size: 0.88rem; text-align: center; padding: 20px 0; }

/* ── Badges ───────────────────────────────────────────────────────── */

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.badge-active    { background: rgba(34,197,94,0.15); color: #22C55E; }  /* Active     */
.badge-review,
.badge-in-review { background: rgba(245,158,11,0.15); color: #F59E0B; }  /* In Review  */
.badge-hold,
.badge-on-hold   { background: rgba(156,163,175,0.15); color: #9CA3AF; }  /* On Hold    */
.badge-delayed   { background: rgba(239,68,68,0.15); color: #EF4444; }  /* Delayed    */
.badge-completed { background: rgba(20,184,166,0.15); color: #14B8A6; }  /* Completed  */
.badge-design     { background: rgba(59,130,246,0.15); color: #3B82F6; }
.badge-priority-low    { background: rgba(156,163,175,0.15); color: #9CA3AF; }
.badge-priority-medium { background: rgba(245,158,11,0.15); color: #F59E0B; }
.badge-priority-high   { background: rgba(239,68,68,0.15); color: #EF4444; }

/* HR-specific status badges */
.badge-pending    { background: rgba(245,158,11,0.15); color: #F59E0B; }
.badge-approved   { background: rgba(34,197,94,0.15); color: #22C55E; }
.badge-rejected   { background: rgba(239,68,68,0.15); color: #EF4444; }
.badge-not-started { background: rgba(156,163,175,0.15); color: #9CA3AF; }
.badge-in-progress { background: rgba(245,158,11,0.15); color: #F59E0B; }
.badge-submitted   { background: rgba(59,130,246,0.15); color: #3B82F6; }
.badge-reviewed    { background: rgba(20,184,166,0.15); color: #14B8A6; }
.badge-closed      { background: rgba(156,163,175,0.15); color: #9CA3AF; }

/* ── Breadcrumb (HR module) ───────────────────────────────────────── */

.breadcrumb {
  font-size: 0.84rem;
  color: var(--txt-muted);
  margin-bottom: 18px;
}
.breadcrumb a { color: var(--clr-green-lt); text-decoration: none; font-weight: 500; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .bc-sep { margin: 0 8px; color: var(--dk-border); }

/* ── HR sub-navigation tabs (thin green underline, not pills) ──────── */

.hr-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1.5px solid var(--dk-border);
  margin-bottom: 24px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.hr-tabs::-webkit-scrollbar { height: 4px; }

.hr-tab {
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--txt-muted);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2.5px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.hr-tab:hover { color: var(--clr-green-lt); }
.hr-tab.active { color: var(--clr-green-lt); border-bottom-color: var(--clr-green-lt); }

/* ── HR quick actions bar ─────────────────────────────────────────── */

.hr-quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

/* ── Leave approval inline actions ────────────────────────────────── */

.leave-action-btns { display: flex; gap: 8px; flex-shrink: 0; }

.btn-danger-small {
  background: #dc2626;
}
.btn-danger-small:hover { background: #b91c1c; }

/* ── Forms / tables shared across admin & staff pages ────────────── */

.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.form-grid textarea { width: 100%; padding: 10px 12px; border: 1.5px solid var(--dk-border); border-radius: 8px; font-size: 0.9rem; font-family: inherit; background: var(--bg-card); color: var(--txt-primary); }
.form-grid select, .form-grid input[type="date"], .form-grid input[type="datetime-local"], .form-grid input[type="number"], .form-grid input[type="file"] {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--dk-border); border-radius: 8px; font-size: 0.9rem; background: var(--bg-card); color: var(--txt-primary);
}

.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.inline-form input[type="text"], .inline-form input[type="file"] { padding: 9px 12px; border: 1.5px solid var(--dk-border); border-radius: 8px; background: var(--bg-card); color: var(--txt-primary); }

.inline-form-tight { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.inline-form-tight select, .inline-form-tight input[type="text"], .inline-form-tight input[type="number"] {
  padding: 6px 8px; border: 1.5px solid var(--dk-border); border-radius: 6px; font-size: 0.82rem; background: var(--bg-card); color: var(--txt-primary);
}

.table-search { display: flex; gap: 8px; }
.table-search input { padding: 8px 12px; border: 1.5px solid var(--dk-border); border-radius: 8px; font-size: 0.85rem; background: var(--bg-card); color: var(--txt-primary); }
.table-search button { padding: 8px 16px; background: var(--clr-green); color: #fff; border: none; border-radius: 8px; cursor: pointer; font-size: 0.85rem; }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.data-table th {
  text-align: left; padding: 12px 14px; background: var(--bg-card-hover); color: var(--txt-muted);
  font-weight: 600; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em;
  border-bottom: 2px solid var(--dk-border);
}
.data-table th a { color: inherit; text-decoration: none; }
.data-table th a:hover { color: var(--clr-green-lt); }
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--dk-border); vertical-align: middle; color: var(--txt-secondary); }
.data-table code { background: var(--bg-card-hover); color: var(--txt-primary); padding: 2px 8px; border-radius: 4px; font-size: 0.8rem; }

.pagination { display: flex; gap: 6px; justify-content: center; padding: 16px 0 4px; }
.pagination a { padding: 6px 12px; border-radius: 6px; color: var(--clr-green-lt); text-decoration: none; font-size: 0.85rem; border: 1px solid var(--dk-border); }
.pagination a.active { background: var(--clr-green); color: #fff; border-color: var(--clr-green); }

.progress-bar { width: 100px; height: 8px; background: var(--dk-border); border-radius: 4px; display: inline-block; vertical-align: middle; overflow: hidden; }
.progress-fill { height: 100%; background: var(--clr-green-lt); }
.progress-pct { font-size: 0.78rem; color: var(--txt-muted); margin-left: 6px; }

/* ── Kanban board (My Tasks) ──────────────────────────────────────── */

.kanban-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: start; }
.kanban-column { background: var(--bg-card-hover); border-radius: var(--portal-radius); padding: 12px; min-height: 200px; }
.kanban-column-header { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 12px; font-weight: 700; font-size: 0.88rem; color: var(--txt-primary); }
.kanban-count { background: var(--bg-card); border-radius: 12px; padding: 2px 8px; font-size: 0.75rem; color: var(--txt-muted); }
.kanban-cards { display: flex; flex-direction: column; gap: 10px; }
.kanban-card { background: var(--bg-card); border: 1px solid var(--dk-border); border-radius: 10px; padding: 12px 14px; }
.kanban-card-title { font-size: 0.88rem; font-weight: 600; color: var(--txt-primary); margin-bottom: 4px; }
.kanban-card-meta { font-size: 0.75rem; color: var(--clr-green-lt); margin-bottom: 4px; }
.kanban-card-desc { font-size: 0.8rem; color: var(--txt-muted); margin-bottom: 8px; }
.kanban-card-footer { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.kanban-due { font-size: 0.75rem; color: var(--txt-muted); }
.kanban-move { width: 100%; padding: 6px 8px; border: 1.5px solid var(--dk-border); border-radius: 6px; font-size: 0.78rem; background: var(--bg-card); color: var(--txt-primary); }

/* ── Leave calendar ───────────────────────────────────────────────── */

.leave-calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-head { text-align: center; font-size: 0.72rem; font-weight: 700; color: var(--txt-muted); padding: 6px 0; text-transform: uppercase; }
.cal-cell { min-height: 64px; border: 1px solid var(--dk-border); border-radius: 6px; padding: 6px; }
.cal-empty { background: transparent; border: none; }
.cal-day { font-size: 0.78rem; color: var(--txt-muted); font-weight: 600; }
.cal-leave-tags { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.cal-tag { background: rgba(34,197,94,0.15); color: var(--clr-green-lt); font-size: 0.62rem; font-weight: 700; padding: 1px 5px; border-radius: 4px; }

/* ── Simple bar charts (Analytics) ────────────────────────────────── */

.bar-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.bar-label { width: 130px; font-size: 0.8rem; color: var(--txt-primary); flex-shrink: 0; }
.bar-track { flex: 1; height: 14px; background: var(--dk-border); border-radius: 7px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--clr-green-lt); border-radius: 7px; transition: width 0.4s ease; }
.bar-fill-gold { background: var(--clr-gold); }
.bar-value { width: 110px; text-align: right; font-size: 0.78rem; color: var(--txt-muted); flex-shrink: 0; }

/* ── Modals ───────────────────────────────────────────────────────── */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-overlay .login-card { background: var(--bg-card); color: var(--txt-primary); }
.modal-overlay .form-group label { color: var(--txt-primary); }

/* ── Global loading overlay (ShowProgress) ────────────────────────── */

.a4-loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.7);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.a4-loading-overlay.open { display: flex; }
.a4-loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--portal-primary-light);
  border-top-color: var(--portal-primary);
  border-radius: 50%;
  animation: a4-spin 0.8s linear infinite;
}
@keyframes a4-spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════════════
   HR MODULE — light theme override (sidebar stays dark)
   ═══════════════════════════════════════════════════════════════════ */

body.hr-page .main-wrap,
body.hr-page .content-area {
  background: var(--hr-bg);
}

body.hr-page .topbar {
  background: var(--hr-card);
  border-bottom: 1px solid var(--hr-border);
}
body.hr-page .topbar-greeting h1 { color: var(--hr-text); }
body.hr-page .topbar-greeting p { color: var(--hr-muted); }
body.hr-page .topbar-search input { background: var(--hr-bg); color: var(--hr-text); border-color: var(--hr-border); }
body.hr-page .topbar-search input::placeholder { color: var(--hr-muted); }
body.hr-page .topbar-search input:focus { background: #fff; border-color: var(--portal-primary); }
body.hr-page .bell-btn { background: var(--hr-bg); border-color: var(--hr-border); color: var(--hr-muted); }
body.hr-page .bell-btn:hover { background: var(--hr-border); }
body.hr-page .bell-dot { border-color: var(--hr-card); }
body.hr-page .notif-panel { background: var(--hr-card); border-color: var(--hr-border); box-shadow: var(--portal-shadow); }
body.hr-page .notif-panel .notif-item { color: var(--hr-text); border-bottom-color: var(--hr-border); }
body.hr-page .notif-panel .notif-item.unread { background: #f0fdf4; }
body.hr-page .notif-panel .notif-item small { color: var(--hr-muted); }
body.hr-page .search-results { background: #fff; border-color: var(--hr-border); box-shadow: var(--portal-shadow); }
body.hr-page .search-results a.sr-item { color: var(--hr-text); }
body.hr-page .search-results a.sr-item:hover { background: #f3f4f6; }

body.hr-page .breadcrumb { color: var(--hr-muted); }
body.hr-page .breadcrumb .bc-sep { color: var(--hr-border); }

body.hr-page .hr-tabs { border-bottom-color: var(--hr-border); }
body.hr-page .hr-tab { color: var(--hr-muted); }
body.hr-page .hr-tab:hover { color: var(--portal-primary); }
body.hr-page .hr-tab.active { color: var(--portal-primary); border-bottom-color: var(--portal-primary); }

body.hr-page .stat-card { background: var(--hr-card); border-color: var(--hr-border); box-shadow: var(--portal-shadow); }
body.hr-page .stat-value { color: var(--hr-text); }
body.hr-page .stat-label { color: var(--hr-muted); }

/* Tinted HR stat boxes — yellow / blue / pink / green, matching the HR module mockups */
body.hr-page .stats-grid .stat-card:nth-child(1) { background: #FEF9C3; border-color: #FEF08A; }
body.hr-page .stats-grid .stat-card:nth-child(2) { background: #DBEAFE; border-color: #BFDBFE; }
body.hr-page .stats-grid .stat-card:nth-child(3) { background: #FCE7F3; border-color: #FBCFE8; }
body.hr-page .stats-grid .stat-card:nth-child(4) { background: #DCFCE7; border-color: #BBF7D0; }
body.hr-page .stats-grid .stat-card:nth-child(1) .stat-value,
body.hr-page .stats-grid .stat-card:nth-child(1) .stat-label,
body.hr-page .stats-grid .stat-card:nth-child(2) .stat-value,
body.hr-page .stats-grid .stat-card:nth-child(2) .stat-label,
body.hr-page .stats-grid .stat-card:nth-child(3) .stat-value,
body.hr-page .stats-grid .stat-card:nth-child(3) .stat-label,
body.hr-page .stats-grid .stat-card:nth-child(4) .stat-value,
body.hr-page .stats-grid .stat-card:nth-child(4) .stat-label {
  color: #1F2937;
}

body.hr-page .panel { background: var(--hr-card); border-color: var(--hr-border); box-shadow: var(--portal-shadow); }
body.hr-page .panel-header { border-bottom-color: var(--hr-border); }
body.hr-page .panel-header h3 { color: var(--hr-text); }
body.hr-page .list-row { border-bottom-color: var(--hr-border); }
body.hr-page .list-title { color: var(--hr-text); }
body.hr-page .list-sub { color: var(--hr-muted); }
body.hr-page .empty-state { color: var(--hr-muted); }

body.hr-page .quick-link-item,
body.hr-page .kanban-card,
body.hr-page .table-search input,
body.hr-page .inline-form input[type="text"],
body.hr-page .inline-form-tight select,
body.hr-page .inline-form-tight input,
body.hr-page .form-grid select,
body.hr-page .form-grid textarea,
body.hr-page .form-grid input,
body.hr-page .kanban-move {
  background: #fff;
  color: var(--hr-text);
  border-color: var(--hr-border);
}

body.hr-page .data-table th { background: #f9fafb; color: var(--hr-muted); border-bottom-color: var(--hr-border); }
body.hr-page .data-table td { color: var(--hr-text); border-bottom-color: var(--hr-border); }
body.hr-page .data-table code { background: #f3f4f6; color: var(--hr-text); }

body.hr-page .pagination a { color: var(--portal-primary); border-color: var(--hr-border); }
body.hr-page .progress-bar { background: #f3f4f6; }

body.hr-page .modal-overlay .login-card { background: #fff; color: var(--hr-text); }
body.hr-page .modal-overlay .form-group label { color: var(--hr-text); }

/* ── Mobile sidebar overlay ───────────────────────────────────────── */

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 90;
}

@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .panels-row { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .kanban-board { grid-template-columns: 1fr; }
  .topbar-search { display: none; }
  .hr-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

@media (max-width: 768px) {
  .hamburger-btn { display: block; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }

  .main-wrap { margin-left: 0; }

  .topbar { padding: 14px 16px; }
  .topbar-greeting h1 { font-size: 1.05rem; }
  .content-area { padding: 18px 14px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .form-grid { grid-template-columns: 1fr; }

  .stat-card { padding: 14px; }
  .stat-value { font-size: 1.3rem; }
  .notif-panel { right: 14px; width: calc(100vw - 28px); }
  .hr-quick-actions { flex-direction: column; align-items: stretch; }
  .leave-action-btns { flex-direction: column; }
}

@media (max-width: 480px) {
  .login-card { padding: 28px 24px; }
  .form-row { flex-direction: column; gap: 10px; align-items: flex-start; }
  .stats-grid { grid-template-columns: 1fr; }
  .panel-header { flex-direction: column; align-items: flex-start; }
}
