/* HRFlow Main CSS */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
  --accent: #6366f1;
  --accent2: #4f46e5;
  --navy: #0f172a;
  --navy2: #1e293b;
  --navy3: #334155;
  --green: #22c55e;
  --red: #ef4444;
  --amber: #f59e0b;
  --blue: #3b82f6;
  --sidebar-w: 240px;
}

.hrflow-portal {
  display: flex;
  height: 100vh;
  min-height: 600px;
  font-family: 'DM Sans', system-ui, sans-serif;
  overflow: hidden;
}

/* ── SIDEBAR ── */
.hrflow-sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}
.hrflow-sidebar-logo {
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.hrflow-logo-mark {
  background: var(--accent);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}
.hrflow-logo-text { font-size: 15px; font-weight: 600; color: #f1f5f9; }
.hrflow-logo-sub  { font-size: 10px; color: #94a3b8; }
.hrflow-nav { padding: 8px 0; flex: 1; }
.hrflow-nav-section {
  padding: 10px 16px 4px;
  font-size: 10px;
  color: #64748b;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.hrflow-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  cursor: pointer;
  border-radius: 6px;
  margin: 1px 8px;
  font-size: 13px;
  color: #94a3b8;
  transition: all .15s;
  text-decoration: none;
}
.hrflow-nav-item i { font-size: 16px; width: 18px; flex-shrink: 0; }
.hrflow-nav-item:hover { background: rgba(255,255,255,.07); color: #e2e8f0; }
.hrflow-nav-item.active { background: rgba(99,102,241,.25); color: #a5b4fc; }
.hrflow-nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 99px;
  font-weight: 700;
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.6} }
.hrflow-sidebar-footer { padding: 12px 8px; border-top: 1px solid rgba(255,255,255,.08); }
.hrflow-user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 4px;
}
.hrflow-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}
.hrflow-logout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  color: #f87171;
  font-size: 13px;
  cursor: pointer;
  border-radius: 6px;
  margin: 0 4px;
  text-decoration: none;
}
.hrflow-logout-btn:hover { background: rgba(248,113,113,.1); }

/* ── MAIN ── */
.hrflow-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.hrflow-topbar {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.hrflow-topbar-title { font-size: 16px; font-weight: 600; flex: 1; }
.hrflow-topbar-date  { font-size: 12px; color: #64748b; }
.hrflow-topbar-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  color: #1e293b;
  transition: all .15s;
  font-family: 'DM Sans', sans-serif;
}
.hrflow-topbar-btn:hover { background: #f8fafc; }
.hrflow-btn-primary { background: var(--accent) !important; color: #fff !important; border-color: var(--accent) !important; }
.hrflow-btn-primary:hover { background: var(--accent2) !important; }
.hrflow-content { flex: 1; overflow-y: auto; padding: 20px 24px; background: #f8fafc; }
.hrflow-page { display: none; }
.hrflow-page.active { display: block; }

/* ── STAT CARDS ── */
.hrflow-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 12px; margin-bottom: 16px; }
.hrflow-stat-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  position: relative;
}
.hrflow-stat-icon {
  float: right;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.hrflow-stat-label { font-size: 12px; color: #64748b; margin-bottom: 4px; }
.hrflow-stat-val   { font-size: 24px; font-weight: 700; line-height: 1.1; }
.hrflow-stat-sub   { font-size: 11px; color: #94a3b8; margin-top: 3px; }

/* ── CARD ── */
.hrflow-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; margin-bottom: 16px; overflow: hidden; }
.hrflow-card-head {
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.hrflow-card-title { font-size: 14px; font-weight: 500; }
.hrflow-card-body  { padding: 16px; }

/* ── TABLE ── */
.hrflow-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.hrflow-tbl th { text-align: left; padding: 10px 12px; color: #64748b; font-weight: 500; border-bottom: 1px solid #e2e8f0; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.hrflow-tbl td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.hrflow-tbl tr:last-child td { border-bottom: none; }
.hrflow-tbl tr:hover td { background: #f8fafc; }

/* ── BADGES ── */
.hrflow-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 500;
}
.hrflow-badge.green  { background: #dcfce7; color: #166534; }
.hrflow-badge.red    { background: #fee2e2; color: #991b1b; }
.hrflow-badge.amber  { background: #fef3c7; color: #92400e; }
.hrflow-badge.blue   { background: #dbeafe; color: #1e40af; }
.hrflow-badge.gray   { background: #f1f5f9; color: #64748b; }
.hrflow-badge.purple { background: #ede9fe; color: #5b21b6; }

/* ── AVATAR ── */
.hrflow-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; flex-shrink: 0;
}
.hrflow-big-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700;
}
.hrflow-emp-row { display: flex; align-items: center; gap: 10px; }

/* ── CLOCK WIDGET ── */
.hrflow-clock-widget {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border-radius: 16px;
  padding: 24px;
  color: #f1f5f9;
  text-align: center;
  margin-bottom: 16px;
}
.hrflow-live-clock { font-size: 48px; font-weight: 700; letter-spacing: -2px; font-variant-numeric: tabular-nums; }
.hrflow-live-date  { font-size: 13px; color: #94a3b8; margin-bottom: 8px; }
.hrflow-clock-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.hrflow-clock-btn {
  padding: 10px 22px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all .15s;
}
.hrflow-clock-btn.checkin  { background: #22c55e; color: #fff; }
.hrflow-clock-btn.break    { background: #f59e0b; color: #fff; }
.hrflow-clock-btn.checkout { background: #ef4444; color: #fff; }
.hrflow-clock-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── PROGRESS ── */
.hrflow-progress-bar  { height: 6px; border-radius: 3px; background: #f1f5f9; overflow: hidden; }
.hrflow-progress-fill { height: 100%; border-radius: 3px; background: var(--accent); transition: width .3s; }

/* ── TIMELINE ── */
.hrflow-timeline { padding: 4px 0; }
.hrflow-tl-item  { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; font-size: 13px; }
.hrflow-tl-dot   { width: 10px; height: 10px; border-radius: 50%; margin-top: 3px; flex-shrink: 0; }
.hrflow-tl-dot.green  { background: #22c55e; }
.hrflow-tl-dot.red    { background: #ef4444; }
.hrflow-tl-dot.amber  { background: #f59e0b; }
.hrflow-tl-time  { font-size: 11px; color: #94a3b8; }

/* ── FORMS ── */
.hrflow-form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hrflow-form-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.hrflow-form-label { font-size: 12px; font-weight: 500; color: #64748b; }
.hrflow-input, .hrflow-select {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #1e293b;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.hrflow-input:focus, .hrflow-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.hrflow-section-label {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 14px 0 10px;
}

/* ── SEARCH ── */
.hrflow-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  margin-bottom: 12px;
  font-size: 16px;
  color: #94a3b8;
}
.hrflow-search-bar input {
  border: none;
  outline: none;
  font-size: 13px;
  color: #1e293b;
  flex: 1;
  background: transparent;
  font-family: 'DM Sans', sans-serif;
}
.hrflow-filter-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.hrflow-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 99px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-size: 12px;
  color: #64748b;
  cursor: pointer;
  transition: all .15s;
}
.hrflow-chip:hover, .hrflow-chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── EMPLOYEE GRID ── */
.hrflow-emp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: 12px; margin-bottom: 16px; }
.hrflow-emp-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  transition: box-shadow .15s;
}
.hrflow-emp-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.hrflow-emp-name { font-size: 13px; font-weight: 600; }
.hrflow-emp-role { font-size: 11px; color: #64748b; }
.hrflow-action-btn {
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: transparent;
  color: #1e293b;
  font-size: 12px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: background .15s;
}
.hrflow-action-btn:hover { background: #f8fafc; }

/* ── MODAL ── */
.hrflow-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.hrflow-modal {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  width: 90%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
}
.hrflow-modal-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.hrflow-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  cursor: pointer;
  color: #64748b;
  font-size: 18px;
}

/* ── LOGIN PROMPT ── */
.hrflow-login-prompt {
  padding: 40px;
  text-align: center;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}
.hrflow-login-prompt a { color: var(--accent); font-weight: 600; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .hrflow-sidebar { width: 200px; }
  .hrflow-form-row { grid-template-columns: 1fr; }
  .hrflow-emp-grid { grid-template-columns: repeat(auto-fill, minmax(140px,1fr)); }
}
@media (max-width: 600px) {
  .hrflow-portal { flex-direction: column; }
  .hrflow-sidebar { width: 100%; height: auto; }
  .hrflow-nav { display: flex; overflow-x: auto; padding: 4px; }
  .hrflow-nav-section { display: none; }
}

/* ── PRINT PAYSLIP ── */
@media print {
  .hrflow-sidebar, .hrflow-topbar, .hrflow-nav { display: none !important; }
  .hrflow-content { padding: 0; }
  #psOutput { display: block !important; }
}
