/* ============================================================
   HRMS Pro â€” Main Stylesheet
   Design: Refined Enterprise Dark with Amber Accents
   ============================================================ */

:root {
  --sidebar-width: 260px;
  --topbar-height: 64px;

  /* Color Palette */
  --bg-base:       #0d0f14;
  --bg-surface:    #13161e;
  --bg-card:       #181c26;
  --bg-elevated:   #1e2333;
  --bg-hover:      #232840;

  --accent:        #f59e0b;
  --accent-light:  #fbbf24;
  --accent-dim:    rgba(245,158,11,0.12);
  --accent-border: rgba(245,158,11,0.25);

  --blue:          #3b82f6;
  --blue-dim:      rgba(59,130,246,0.12);
  --green:         #10b981;
  --green-dim:     rgba(16,185,129,0.12);
  --red:           #ef4444;
  --red-dim:       rgba(239,68,68,0.12);
  --purple:        #8b5cf6;
  --purple-dim:    rgba(139,92,246,0.12);
  --cyan:          #06b6d4;
  --cyan-dim:      rgba(6,182,212,0.12);
  --orange:        #f97316;
  --orange-dim:    rgba(249,115,22,0.12);

  --text-primary:  #f1f5f9;
  --text-secondary:#94a3b8;
  --text-muted:    #475569;
  --border:        rgba(255,255,255,0.06);
  --border-strong: rgba(255,255,255,0.10);

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --font-body:    'Plus Jakarta Sans', sans-serif;
  --font-display: 'Space Grotesk', sans-serif;

  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body.hrms-body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 14px;
  line-height: 1.6;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.hrms-sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000;
  transition: transform var(--transition), width var(--transition);
}

/* Brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.brand-icon {
  width: 40px; height: 40px;
  background: var(--accent);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #000;
  font-size: 18px;
  flex-shrink: 0;
}
.brand-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
  line-height: 1.1;
}
.brand-tagline {
  font-size: 10px;
  font-weight: 500;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  display: block;
}

/* Sidebar User */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-user .user-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 2px solid var(--accent-border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  color: var(--accent);
  font-size: 14px;
  overflow: hidden;
  flex-shrink: 0;
}
.sidebar-user .user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 2px;
}
.badge-role-admin    { background: var(--red-dim);    color: var(--red);    }
.badge-role-hr_manager { background: var(--purple-dim); color: var(--purple); }
.badge-role-employee { background: var(--blue-dim);   color: var(--blue);   }

/* Sidebar Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-elevated) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 4px; }

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  padding: 16px 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 2px;
  position: relative;
}
.nav-item i { font-size: 16px; flex-shrink: 0; width: 18px; }
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.logout-item { color: var(--red) !important; }
.logout-item:hover { background: var(--red-dim) !important; }

/* Sidebar Footer */
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.hrms-main {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--transition);
}

/* ---- Topbar ---- */
.hrms-topbar {
  height: var(--topbar-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 999;
  flex-shrink: 0;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.sidebar-toggle {
  background: none; border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  display: none;
}
.sidebar-toggle:hover { background: var(--bg-elevated); color: var(--text-primary); }

.page-breadcrumb {}
.breadcrumb-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
  line-height: 1.2;
}
.breadcrumb-date {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
}

.topbar-search {
  align-items: center;
  gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 40px;
  padding: 6px 14px;
  color: var(--text-muted);
}
.topbar-search i { font-size: 14px; }
.topbar-search input {
  background: none; border: none; outline: none;
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-body);
  width: 180px;
}
.topbar-search input::placeholder { color: var(--text-muted); }

.topbar-icon-btn {
  background: none; border: none;
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  font-size: 17px;
  cursor: pointer;
  position: relative;
  transition: all var(--transition);
}
.topbar-icon-btn:hover { background: var(--bg-elevated); color: var(--text-primary); }
.notif-badge {
  position: absolute;
  top: 2px; right: 2px;
  width: 18px; height: 18px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-surface);
}

.topbar-user-btn {
  display: flex; align-items: center; gap: 8px;
  background: none; border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 40px;
  transition: all var(--transition);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-body);
}
.topbar-user-btn:hover { background: var(--bg-elevated); }
.user-avatar-sm {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 2px solid var(--accent-border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  color: var(--accent);
  font-size: 12px;
  overflow: hidden;
}
.user-avatar-sm img { width: 100%; height: 100%; object-fit: cover; }

/* Notification Panel */
.notif-panel {
  width: 340px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 0;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.notif-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 13px;
}
.mark-all-read { color: var(--accent); font-size: 12px; text-decoration: none; }
.mark-all-read:hover { text-decoration: underline; }
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-empty {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
}
.notif-empty i { font-size: 28px; display: block; margin-bottom: 8px; }
.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  cursor: pointer;
}
.notif-item:hover { background: var(--bg-elevated); }
.notif-item:last-child { border-bottom: none; }
.notif-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.notif-leave .notif-icon    { background: var(--green-dim);  color: var(--green);  }
.notif-task .notif-icon     { background: var(--blue-dim);   color: var(--blue);   }
.notif-announcement .notif-icon { background: var(--accent-dim); color: var(--accent); }
.notif-payroll .notif-icon  { background: var(--purple-dim); color: var(--purple); }
.notif-general .notif-icon  { background: var(--bg-elevated); color: var(--text-secondary); }
.notif-title { font-size: 12.5px; font-weight: 500; color: var(--text-primary); margin: 0 0 2px; }
.notif-time  { font-size: 11px; color: var(--text-muted); margin: 0; }

/* ---- Page Content ---- */
.hrms-content {
  flex: 1;
  padding: 28px;
  overflow-y: auto;
}

/* ============================================================
   CARDS
   ============================================================ */
.hrms-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color var(--transition);
}
.hrms-card:hover { border-color: var(--border-strong); }

.card-header-hrms {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.card-title-hrms {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.card-subtitle-hrms { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Stat Cards */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 100px; height: 100px;
  border-radius: 50%;
  opacity: 0.05;
  transform: translate(30%, -30%);
}
.stat-card.stat-blue::before   { background: var(--blue); }
.stat-card.stat-green::before  { background: var(--green); }
.stat-card.stat-amber::before  { background: var(--accent); }
.stat-card.stat-red::before    { background: var(--red); }
.stat-card.stat-purple::before { background: var(--purple); }
.stat-card.stat-cyan::before   { background: var(--cyan); }

.stat-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-blue   .stat-icon { background: var(--blue-dim);   color: var(--blue);   }
.stat-green  .stat-icon { background: var(--green-dim);  color: var(--green);  }
.stat-amber  .stat-icon { background: var(--accent-dim); color: var(--accent); }
.stat-red    .stat-icon { background: var(--red-dim);    color: var(--red);    }
.stat-purple .stat-icon { background: var(--purple-dim); color: var(--purple); }
.stat-cyan   .stat-icon { background: var(--cyan-dim);   color: var(--cyan);   }

.stat-info { flex: 1; }
.stat-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }
.stat-change {
  font-size: 11px;
  font-weight: 600;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 20px;
}
.stat-change.up   { background: var(--green-dim);  color: var(--green); }
.stat-change.down { background: var(--red-dim);    color: var(--red);   }

/* ============================================================
   TABLES
   ============================================================ */
.hrms-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.hrms-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.hrms-table thead th {
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.hrms-table tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}
.hrms-table tbody tr:last-child td { border-bottom: none; }
.hrms-table tbody tr:hover td { background: var(--bg-elevated); }
.hrms-table .emp-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 700;
  font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-right: 10px;
  flex-shrink: 0;
}
.hrms-table .emp-info { display: flex; align-items: center; }
.hrms-table .emp-name { font-weight: 600; color: var(--text-primary); display: block; }
.hrms-table .emp-id   { font-size: 11px; color: var(--text-muted); }

/* ============================================================
   BADGES & STATUS
   ============================================================ */
.badge-hrms {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}
.badge-active, .badge-present, .badge-approved, .badge-completed, .badge-paid {
  background: var(--green-dim); color: var(--green);
}
.badge-inactive, .badge-absent, .badge-rejected, .badge-cancelled, .badge-terminated {
  background: var(--red-dim); color: var(--red);
}
.badge-pending, .badge-in_progress, .badge-draft {
  background: var(--accent-dim); color: var(--accent);
}
.badge-late, .badge-half_day {
  background: var(--orange-dim); color: var(--orange);
}
.badge-on_leave {
  background: var(--blue-dim); color: var(--blue);
}
.badge-low      { background: var(--green-dim);  color: var(--green);  }
.badge-medium   { background: var(--accent-dim); color: var(--accent); }
.badge-high     { background: var(--orange-dim); color: var(--orange); }
.badge-critical { background: var(--red-dim);    color: var(--red);    }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-hrms {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.btn-hrms-primary {
  background: var(--accent);
  color: #000;
}
.btn-hrms-primary:hover { background: var(--accent-light); color: #000; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(245,158,11,0.35); }
.btn-hrms-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}
.btn-hrms-secondary:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-hrms-danger {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.2);
}
.btn-hrms-danger:hover { background: var(--red); color: #fff; }
.btn-hrms-success {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(16,185,129,0.2);
}
.btn-hrms-success:hover { background: var(--green); color: #fff; }

.btn-icon {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; border: none;
  font-size: 15px;
  transition: all var(--transition);
  background: var(--bg-elevated);
  color: var(--text-secondary);
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-icon-edit:hover   { background: var(--blue-dim); color: var(--blue); }
.btn-icon-delete:hover { background: var(--red-dim);  color: var(--red);  }
.btn-icon-view:hover   { background: var(--accent-dim); color: var(--accent); }

/* ============================================================
   FORMS
   ============================================================ */
.form-group-hrms { margin-bottom: 18px; }
.form-label-hrms {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 7px;
}
.form-control-hrms {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 13.5px;
  font-family: var(--font-body);
  transition: all var(--transition);
  outline: none;
}
.form-control-hrms:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  background: var(--bg-card);
}
.form-control-hrms::placeholder { color: var(--text-muted); }
select.form-control-hrms { cursor: pointer; }
textarea.form-control-hrms { resize: vertical; min-height: 90px; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-hrms .modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  color: var(--text-primary);
}
.modal-hrms .modal-header {
  border-bottom: 1px solid var(--border);
  padding: 20px 24px;
}
.modal-hrms .modal-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
}
.modal-hrms .modal-body { padding: 24px; }
.modal-hrms .modal-footer {
  border-top: 1px solid var(--border);
  padding: 16px 24px;
}
.modal-hrms .btn-close { filter: invert(1) brightness(0.7); }

/* ============================================================
   PUNCH IN/OUT WIDGET
   ============================================================ */
.punch-widget {
  background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-card) 100%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 28px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.punch-widget::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at center, var(--accent-dim) 0%, transparent 60%);
  pointer-events: none;
}
.punch-time {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -2px;
  line-height: 1;
}
.punch-date { font-size: 13px; color: var(--text-muted); margin: 6px 0 24px; }
.punch-btn {
  width: 100px; height: 100px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-body);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 0 auto 20px;
}
.punch-btn i { font-size: 26px; }
.punch-btn-in  { background: var(--green);  color: #fff; box-shadow: 0 0 0 0 rgba(16,185,129,0.4); }
.punch-btn-out { background: var(--red);    color: #fff; box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
.punch-btn-in:hover  { transform: scale(1.05); box-shadow: 0 0 30px rgba(16,185,129,0.4); }
.punch-btn-out:hover { transform: scale(1.05); box-shadow: 0 0 30px rgba(239,68,68,0.4); }
.punch-btn.pulse { animation: pulseBtn 1.5s infinite; }
@keyframes pulseBtn {
  0%   { box-shadow: 0 0 0 0 rgba(16,185,129,0.4); }
  70%  { box-shadow: 0 0 0 12px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}
.punch-status { font-size: 12px; color: var(--text-muted); }
.punch-status strong { color: var(--text-primary); }

/* ============================================================
   ATTENDANCE CALENDAR
   ============================================================ */
.att-calendar { width: 100%; }
.att-cal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.att-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.att-cal-day-header {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 0;
}
.att-cal-day {
  aspect-ratio: 1;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.att-cal-day .day-num { line-height: 1; }
.att-cal-day.empty { cursor: default; }
.att-cal-day.today { background: var(--accent-dim); border: 1px solid var(--accent-border); color: var(--accent); font-weight: 700; }
.att-cal-day.present { background: var(--green-dim); color: var(--green); }
.att-cal-day.absent  { background: var(--red-dim);   color: var(--red);   }
.att-cal-day.half_day { background: var(--orange-dim); color: var(--orange); }
.att-cal-day.late    { background: var(--blue-dim);  color: var(--blue);  }
.att-cal-day.on_leave { background: var(--purple-dim); color: var(--purple); }
.att-cal-day.holiday { background: var(--cyan-dim); color: var(--cyan); }
.att-cal-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: currentColor;
  margin-top: 2px;
}

/* ============================================================
   PROGRESS BARS
   ============================================================ */
.progress-hrms {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar-hrms {
  height: 100%;
  border-radius: 3px;
  transition: width 1s ease;
}
.progress-blue   { background: var(--blue); }
.progress-green  { background: var(--green); }
.progress-amber  { background: var(--accent); }
.progress-red    { background: var(--red); }
.progress-purple { background: var(--purple); }

/* ============================================================
   LEAVE BALANCE CARDS
   ============================================================ */
.leave-balance-card {
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}
.leave-balance-num {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
}
.leave-balance-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.leave-balance-used  { font-size: 11px; color: var(--text-muted); margin-top: 8px; }

/* ============================================================
   ANNOUNCEMENT CARDS
   ============================================================ */
.announcement-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.announcement-item:last-child { border-bottom: none; padding-bottom: 0; }
.ann-priority-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.ann-priority-high   { background: var(--red); }
.ann-priority-medium { background: var(--accent); }
.ann-priority-low    { background: var(--green); }
.ann-title { font-weight: 600; font-size: 13.5px; color: var(--text-primary); margin-bottom: 3px; }
.ann-excerpt { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.ann-meta { font-size: 11px; color: var(--text-muted); margin-top: 5px; }

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px;
}
.page-header-left h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.page-header-left p { font-size: 13px; color: var(--text-muted); margin: 3px 0 0; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
  position: relative;
  overflow: hidden;
}
.login-bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.4;
}
.login-bg-glow {
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245,158,11,0.08) 0%, transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 44px;
  width: 100%;
  max-width: 440px;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: loginFadeIn 0.5s ease;
}
@keyframes loginFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.login-logo {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 32px;
}
.login-logo .icon {
  width: 48px; height: 48px;
  background: var(--accent);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #000;
  font-size: 22px;
}
.login-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}
.login-subtitle { font-size: 13px; color: var(--text-muted); }

/* Demo Credentials */
.demo-creds {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 20px;
}
.demo-creds-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); margin-bottom: 10px; }
.demo-cred-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.demo-cred-row:last-child { border-bottom: none; }
.demo-role { color: var(--text-muted); font-weight: 600; }
.demo-id   { color: var(--accent); font-family: monospace; }

/* ============================================================
   TOASTS
   ============================================================ */
.hrms-toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  color: var(--text-primary);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
.hrms-toast.toast-success { border-left: 3px solid var(--green); }
.hrms-toast.toast-error   { border-left: 3px solid var(--red); }
.hrms-toast.toast-info    { border-left: 3px solid var(--blue); }

/* ============================================================
   TABS
   ============================================================ */
.hrms-tabs {
  display: flex; gap: 4px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 20px;
  width: fit-content;
}
.hrms-tab {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition);
}
.hrms-tab.active {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}
.hrms-tab:hover:not(.active) { color: var(--text-primary); }

/* ============================================================
   PAYSLIP
   ============================================================ */
.payslip-container {
  background: #fff;
  color: #1a1a2e;
  border-radius: var(--radius-lg);
  max-width: 720px;
  margin: 0 auto;
  font-family: var(--font-body);
}
.payslip-header {
  background: #1a1a2e;
  color: #fff;
  padding: 24px 32px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: flex; justify-content: space-between; align-items: center;
}
.payslip-body { padding: 28px 32px; }
.payslip-section { margin-bottom: 20px; }
.payslip-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: #666; border-bottom: 1px solid #e5e7eb;
  padding-bottom: 6px; margin-bottom: 12px;
}
.payslip-row {
  display: flex; justify-content: space-between;
  padding: 5px 0; font-size: 13px; border-bottom: 1px dotted #f0f0f0;
}
.payslip-total {
  background: #1a1a2e; color: #fff;
  padding: 16px 32px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 700; font-size: 16px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 992px) {
  .hrms-sidebar {
    transform: translateX(-100%);
  }
  .hrms-sidebar.open {
    transform: translateX(0);
  }
  .hrms-main {
    margin-left: 0;
  }
  .sidebar-toggle {
    display: flex;
  }
  .sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 999;
  }
  .sidebar-overlay.show { display: block; }
}
@media (max-width: 768px) {
  .hrms-content { padding: 16px; }
  .hrms-topbar { padding: 0 16px; }
  .stat-value { font-size: 22px; }
  .punch-time { font-size: 36px; }
  .login-card { padding: 28px 20px; margin: 16px; }
}

/* ============================================================
   DATATABLES OVERRIDE
   ============================================================ */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 6px 10px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
  color: var(--text-secondary) !important;
  border-radius: 6px !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--accent-dim) !important;
  border-color: var(--accent-border) !important;
  color: var(--accent) !important;
}
.dataTables_wrapper .dataTables_info { color: var(--text-muted); font-size: 12px; }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--bg-hover); }

/* ============================================================
   RESPONSIVE OVERHAUL â€” Mobile / Tablet / Desktop
   Breakpoints: xs<480, sm<576, md<768, lg<992, xl<1200
   ============================================================ */

/* ---- Topbar: prevent overflow on small screens ---- */
.hrms-topbar {
  flex-wrap: nowrap;
  min-width: 0;
}
.topbar-left {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.page-breadcrumb {
  min-width: 0;
}
.breadcrumb-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}
.topbar-right {
  flex-shrink: 0;
}

/* ---- Cards: enforce min-width 0 inside grid cols ---- */
.hrms-card {
  min-width: 0;
}

/* ---- Tables: column hiding on small screens ---- */
@media (max-width: 768px) {
  .hrms-table thead th:nth-child(n+5),
  .hrms-table tbody td:nth-child(n+5) {
    display: none;
  }
  .hrms-table thead th,
  .hrms-table tbody td {
    padding: 10px 10px;
    font-size: 12px;
  }
  .hrms-table .emp-avatar {
    width: 28px;
    height: 28px;
    font-size: 10px;
    margin-right: 6px;
  }
  .hrms-table .emp-name { font-size: 12px; }
  .hrms-table .emp-id   { font-size: 10px; }
  /* Show a hint that table scrolls */
  .hrms-table-wrapper {
    position: relative;
  }
  .hrms-table-wrapper::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 30px; height: 100%;
    background: linear-gradient(to right, transparent, var(--bg-card));
    pointer-events: none;
    opacity: 0.7;
  }
}

/* ---- Stat cards: 2-col on xs, 3-col on sm ---- */
@media (max-width: 480px) {
  .stat-card {
    padding: 14px;
    gap: 10px;
  }
  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 17px;
  }
  .stat-value { font-size: 20px !important; }
  .stat-label { font-size: 11px; }
}

/* ---- Page header: stack on mobile ---- */
@media (max-width: 576px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .page-header .btn-hrms,
  .page-header .d-flex {
    width: 100%;
  }
  .page-header .btn-hrms {
    justify-content: center;
  }
}

/* ---- Punch widget: full width on mobile ---- */
@media (max-width: 576px) {
  .punch-widget {
    padding: 20px 16px;
  }
  .punch-time { font-size: 40px; }
  .punch-btn  { width: 88px; height: 88px; }
  .punch-btn i { font-size: 22px; }
}

/* ---- Attendance calendar: smaller cells on mobile ---- */
@media (max-width: 480px) {
  .att-cal-day {
    font-size: 10px;
    border-radius: 5px;
  }
  .att-cal-day-header {
    font-size: 9px;
    padding: 4px 0;
  }
  .att-cal-dot {
    width: 3px;
    height: 3px;
  }
}

/* ---- Modals: full-width on mobile ---- */
@media (max-width: 576px) {
  .modal-hrms .modal-dialog {
    margin: 8px;
    max-width: calc(100% - 16px);
  }
  .modal-hrms .modal-body {
    padding: 16px;
  }
  .modal-hrms .modal-header,
  .modal-hrms .modal-footer {
    padding: 12px 16px;
  }
}

/* ---- Leave balance cards: 2-col on mobile ---- */
@media (max-width: 480px) {
  .leave-balance-card {
    padding: 12px 10px;
  }
  .leave-balance-num { font-size: 26px; }
}

/* ---- Topbar notifications panel: full-width on mobile ---- */
@media (max-width: 480px) {
  .notif-panel {
    width: calc(100vw - 24px) !important;
    right: -60px !important;
    left: auto !important;
  }
}

/* ---- Profile tabs: horizontal scroll on mobile ---- */
.hrms-tabs {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex-wrap: nowrap;
  max-width: 100%;
}
.hrms-tabs::-webkit-scrollbar { display: none; }
.hrms-tab {
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---- Payslip: stack 2-col layouts on mobile ---- */
@media (max-width: 600px) {
  .payslip-body .row .col-6 {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }
  .payslip-header {
    flex-direction: column;
    gap: 8px;
    text-align: center;
    padding: 18px;
  }
  .payslip-header > div:last-child {
    text-align: center;
  }
  .payslip-total {
    flex-direction: column;
    gap: 4px;
    text-align: center;
    padding: 16px;
  }
}

/* ---- Sidebar mini-mode on tablet (992â€“1200) ---- */
@media (min-width: 993px) and (max-width: 1200px) {
  :root { --sidebar-width: 220px; }
  .brand-name    { font-size: 16px; }
  .nav-item span { font-size: 12.5px; }
}

/* ---- DataTables controls: stack on mobile ---- */
@media (max-width: 576px) {
  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_filter {
    float: none !important;
    text-align: left !important;
    margin-bottom: 8px;
  }
  .dataTables_wrapper .dataTables_filter input {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
  }
  .dataTables_wrapper .dataTables_paginate {
    float: none !important;
    text-align: center !important;
    margin-top: 10px;
  }
  .dataTables_wrapper .dataTables_info {
    float: none !important;
    text-align: center !important;
    margin-bottom: 4px;
  }
}

/* ---- Form rows: single column on mobile ---- */
@media (max-width: 576px) {
  .row.g-3 > [class*="col-md-"],
  .row.g-3 > [class*="col-lg-"] {
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
  }
  /* Keep 2-col for col-6 pairs intentionally side-by-side */
  .row.g-3 > .col-6 {
    width: 50%;
    flex: 0 0 50%;
    max-width: 50%;
  }
}

/* ---- Filters row: stack on mobile ---- */
@media (max-width: 576px) {
  .hrms-card form.row {
    gap: 8px;
  }
}

/* ---- Button groups: wrap on mobile ---- */
@media (max-width: 480px) {
  .d-flex.gap-2.flex-wrap {
    gap: 6px !important;
  }
  .btn-hrms {
    font-size: 12px;
    padding: 7px 12px;
  }
}

/* ---- Tasks card grid: single col on mobile ---- */
@media (max-width: 576px) {
  .col-md-6.col-xl-4 {
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* ---- Department/shift cards: single col on xs ---- */
@media (max-width: 480px) {
  .col-md-4,
  .col-md-3 {
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* ---- KPI cards: full width on mobile ---- */
@media (max-width: 576px) {
  .col-md-6 { 
    /* Keep Bootstrap col-md-6 responsive as intended */
  }
}

/* ---- Login: tighter on very small screens ---- */
@media (max-width: 380px) {
  .login-card { padding: 22px 14px; }
  .login-title { font-size: 20px; }
  .demo-cred-row { font-size: 11px; }
}

/* ---- Employee dashboard: punch widget + stats stack ---- */
@media (max-width: 768px) {
  .col-lg-4,
  .col-lg-8 {
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* ---- Topbar breadcrumb date: hide on very small ---- */
@media (max-width: 380px) {
  .breadcrumb-date { display: none; }
  .breadcrumb-title { font-size: 14px; max-width: 140px; }
}

/* ---- Announcement item: prevent overflow ---- */
.ann-title, .ann-excerpt {
  word-break: break-word;
  overflow-wrap: break-word;
}

/* ---- Table action buttons: shrink on mobile ---- */
@media (max-width: 768px) {
  .btn-icon {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }
}

/* ---- Payroll table: hide less critical cols on tablet ---- */
@media (max-width: 992px) {
  /* Keep: Employee, Net Salary, Status, Actions */
  .admin-payroll-table th:nth-child(3),
  .admin-payroll-table td:nth-child(3),
  .admin-payroll-table th:nth-child(4),
  .admin-payroll-table td:nth-child(4),
  .admin-payroll-table th:nth-child(6),
  .admin-payroll-table td:nth-child(6) {
    display: none;
  }
}

/* ---- Touch targets: minimum 44Ã—44px ---- */
@media (hover: none) and (pointer: coarse) {
  .nav-item {
    padding: 12px 14px;
    min-height: 44px;
  }
  .btn-icon {
    width: 42px;
    height: 42px;
  }
  .hrms-tab {
    padding: 10px 16px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .topbar-icon-btn {
    width: 44px;
    height: 44px;
  }
  .form-control-hrms {
    padding: 12px 14px;
    font-size: 16px; /* Prevents iOS auto-zoom */
  }
  select.form-control-hrms {
    font-size: 16px; /* Prevents iOS auto-zoom */
  }
}

/* ---- iOS font zoom prevention ---- */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="number"],
textarea,
select {
  font-size: max(16px, 1em);
}
@media (min-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="date"],
  input[type="time"],
  input[type="number"],
  textarea,
  select {
    font-size: 13.5px;
  }
}

/* ---- Sidebar: swipe-friendly open transition ---- */
.hrms-sidebar {
  will-change: transform;
}

/* ---- Page content: safe area insets (iPhone notch) ---- */
@supports (padding: env(safe-area-inset-bottom)) {
  .hrms-content {
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
  }
  .hrms-topbar {
    padding-left: max(24px, env(safe-area-inset-left));
    padding-right: max(24px, env(safe-area-inset-right));
  }
}

/* ============================================================
   CARD-STACK TABLE MODE â€” xs screens (<480px)
   Tables transform into stacked cards per row
   ============================================================ */
@media (max-width: 480px) {
  .hrms-table thead {
    display: none; /* hide column headers */
  }
  .hrms-table,
  .hrms-table tbody,
  .hrms-table tr,
  .hrms-table td {
    display: block;
    width: 100%;
  }
  .hrms-table tr {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    padding: 4px 0;
  }
  .hrms-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 12.5px;
    min-height: 38px;
  }
  .hrms-table td:last-child {
    border-bottom: none;
  }
  .hrms-table td::before {
    content: attr(data-label);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-right: 12px;
    min-width: 80px;
  }
  /* Override the fade-edge gradient on card mode */
  .hrms-table-wrapper::after {
    display: none;
  }
  /* Stat cards: force 2 per row on xs */
  .col-xl-2, .col-md-4 {
    width: 50%;
    flex: 0 0 50%;
    max-width: 50%;
  }
}

/* ============================================================
   TABLET TWEAKS (576â€“992px)
   ============================================================ */
@media (min-width: 577px) and (max-width: 992px) {
  .hrms-content { padding: 20px; }

  /* Hide lower-priority table columns on tablet */
  .hrms-table thead th:nth-child(n+6),
  .hrms-table tbody td:nth-child(n+6) {
    display: none;
  }

  /* 2-col stat cards on tablet */
  .col-xl-2 {
    width: 33.333%;
    flex: 0 0 33.333%;
    max-width: 33.333%;
  }

  /* Page header stays row on tablet */
  .page-header {
    flex-direction: row;
    align-items: center;
  }
}

/* ============================================================
   LARGE DESKTOP (>1400px) â€” wider sidebar, more content
   ============================================================ */
@media (min-width: 1400px) {
  :root { --sidebar-width: 280px; }
  .hrms-content { padding: 32px 36px; }
  .stat-value { font-size: 32px; }
}

/* ============================================================
   PRINT STYLES â€” Clean payslip printing
   ============================================================ */
@media print {
  .hrms-sidebar,
  .hrms-topbar,
  .page-header .btn-hrms,
  .page-header .d-flex,
  .hrms-tabs,
  #toastContainer { display: none !important; }

  .hrms-main { margin-left: 0 !important; }
  .hrms-content { padding: 0 !important; }
  body { background: #fff !important; }

  .payslip-container {
    box-shadow: none !important;
    border-radius: 0 !important;
    max-width: 100% !important;
  }
  .payslip-header { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .payslip-total  { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ============================================================
   SKELETON LOADING SCREENS
   ============================================================ */
@keyframes shimmer {
  0%   { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-hover) 50%, var(--bg-elevated) 75%);
  background-size: 1000px 100%;
  animation: shimmer 1.6s infinite;
  border-radius: 6px;
  display: block;
}
.skeleton-text  { height: 14px; margin-bottom: 8px; }
.skeleton-title { height: 20px; width: 60%; margin-bottom: 12px; }
.skeleton-avatar{ width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }
.skeleton-card  { height: 90px; border-radius: var(--radius-lg); }
.skeleton-table-row {
  display: flex; gap: 16px; padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
/* Show skeleton while DataTables loads */
.dataTables_processing {
  background: var(--bg-elevated) !important;
  color: var(--text-muted) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  padding: 12px 24px !important;
  font-size: 13px !important;
  font-family: var(--font-body) !important;
  box-shadow: var(--shadow-md) !important;
}

/* ============================================================
   UPLOAD PROGRESS BAR
   ============================================================ */
.upload-progress-wrap {
  display: none;
  margin-top: 12px;
}
.upload-progress-wrap.show { display: block; }
.upload-progress-bar-outer {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
}
.upload-progress-bar-inner {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s ease;
}
.upload-progress-text {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

/* ============================================================
   LIGHT THEME (data-theme="light")
   ============================================================ */
[data-theme="light"] {
  --bg-base:       #f1f5f9;
  --bg-surface:    #ffffff;
  --bg-card:       #ffffff;
  --bg-elevated:   #f8fafc;
  --bg-hover:      #f1f5f9;
  --text-primary:  #0f172a;
  --text-secondary:#334155;
  --text-muted:    #64748b;
  --border:        rgba(0,0,0,0.08);
  --border-strong: rgba(0,0,0,0.12);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --accent-dim:    rgba(245,158,11,0.12);
  --accent-border: rgba(245,158,11,0.3);
  --bg-input:      #ffffff;
  color-scheme: light;
}

/* Light theme - body & main layout */
[data-theme="light"] body,
[data-theme="light"] .hrms-body {
  background: #f1f5f9;
  color: #0f172a;
}
[data-theme="light"] .hrms-main {
  background: #f1f5f9;
}
[data-theme="light"] .hrms-content {
  background: #f1f5f9;
}

/* Cards & surfaces */
[data-theme="light"] .hrms-card {
  background: #ffffff;
  border-color: rgba(0,0,0,0.07);
  color: #0f172a;
}
[data-theme="light"] .stat-card {
  background: #ffffff;
  border-color: rgba(0,0,0,0.07);
}
[data-theme="light"] .stat-value { color: #0f172a; }
[data-theme="light"] .stat-label { color: #64748b; }
[data-theme="light"] .card-title-hrms { color: #0f172a; }

/* Page header */
[data-theme="light"] .page-header {
  border-color: rgba(0,0,0,0.08);
}
[data-theme="light"] .page-header h1 { color: #0f172a; }
[data-theme="light"] .page-header p  { color: #64748b; }

/* Profile specific */
[data-theme="light"] .hrms-tab {
  color: #64748b;
  border-bottom-color: transparent;
}
[data-theme="light"] .hrms-tab.active {
  color: #b45309;
  border-bottom-color: #f59e0b;
}
[data-theme="light"] .hrms-tab:hover {
  background: #f1f5f9;
  color: #0f172a;
}

/* Sidebar */
[data-theme="light"] .nav-section-label { color: #94a3b8; }
[data-theme="light"] .nav-item { color: #475569; }
[data-theme="light"] .nav-item:hover { background: #f1f5f9; color: #0f172a; }
[data-theme="light"] .sidebar-logo-text { color: #0f172a; }
[data-theme="light"] .sidebar-logo-sub  { color: #64748b; }
[data-theme="light"] .sidebar-user .user-name  { color: #0f172a; }
[data-theme="light"] .sidebar-user .user-role  { color: #64748b; }

/* Topbar */
[data-theme="light"] .topbar-search { background:#f1f5f9; border-color:rgba(0,0,0,0.1); }
[data-theme="light"] .topbar-search input { color:#0f172a; }
[data-theme="light"] .topbar-icon-btn { color: #475569; }
[data-theme="light"] .topbar-icon-btn:hover { background:#f1f5f9; color:#0f172a; }
[data-theme="light"] .user-name { color: #0f172a; }

/* Tables */
[data-theme="light"] .hrms-table { color: #0f172a; }
[data-theme="light"] .hrms-table thead th {
  background: #f8fafc;
  color: #64748b;
  border-color: rgba(0,0,0,0.08);
}
[data-theme="light"] .hrms-table tbody td {
  border-color: rgba(0,0,0,0.05);
  color: #334155;
}
[data-theme="light"] .hrms-table tbody tr:hover td { background: #f8fafc; }

/* Inputs */
[data-theme="light"] .form-label-hrms { color: #475569; }
[data-theme="light"] select.form-control-hrms { background: #ffffff; color: #0f172a; }

/* Buttons */
[data-theme="light"] .btn-hrms-secondary {
  background: #f1f5f9;
  color: #475569;
  border-color: rgba(0,0,0,0.1);
}
[data-theme="light"] .btn-hrms-secondary:hover {
  background: #e2e8f0;
  color: #0f172a;
}
[data-theme="light"] .btn-icon { color: #475569; }
[data-theme="light"] .btn-icon:hover { background: #f1f5f9; }

/* Notifications panel */
[data-theme="light"] .notif-item { border-color: rgba(0,0,0,0.06); }
[data-theme="light"] .notif-title { color: #0f172a; }
[data-theme="light"] .notif-time  { color: #94a3b8; }

/* Attendance & status badges */
[data-theme="light"] .leave-balance-card { background:#f8fafc; border-color:rgba(0,0,0,0.07); }

/* Modal */
[data-theme="light"] .modal-content {
  background: #ffffff;
  color: #0f172a;
}
[data-theme="light"] .modal-header {
  border-color: rgba(0,0,0,0.08);
}
[data-theme="light"] .modal-footer {
  border-color: rgba(0,0,0,0.08);
}

/* Dropdown & search results */
[data-theme="light"] #searchResults {
  background: #ffffff;
  border-color: rgba(0,0,0,0.1);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
[data-theme="light"] #searchResults a { color: #0f172a; }

/* DataTable pagination */
[data-theme="light"] .dataTables_wrapper { color: #334155; }
[data-theme="light"] .dataTables_paginate .paginate_button { color: #475569 !important; }
[data-theme="light"] .dataTables_paginate .paginate_button.current { 
  background: #f59e0b !important; 
  color: #ffffff !important;
  border-color: #f59e0b !important;
}

/* Breadcrumb */
[data-theme="light"] .breadcrumb-title { color: #0f172a; }

/* Profile badge */
[data-theme="light"] .badge-hrms { color: #0f172a; }
[data-theme="light"] .hrms-sidebar,
[data-theme="light"] .hrms-topbar {
  background: #ffffff;
  border-color: rgba(0,0,0,0.08);
}
[data-theme="light"] .nav-item.active {
  background: var(--accent-dim);
  color: #b45309;
  border-color: rgba(245,158,11,0.3);
}
[data-theme="light"] .sidebar-user .user-avatar {
  background: #fef3c7;
  border-color: rgba(245,158,11,0.3);
}
[data-theme="light"] .hrms-table tbody tr:hover td {
  background: #f8fafc;
}
[data-theme="light"] .modal-hrms .modal-content {
  background: #ffffff;
  border-color: rgba(0,0,0,0.12);
}
[data-theme="light"] .form-control-hrms {
  background: #f8fafc;
  border-color: rgba(0,0,0,0.12);
  color: #0f172a;
}
[data-theme="light"] .form-control-hrms:focus {
  background: #ffffff;
}
[data-theme="light"] .punch-widget {
  background: linear-gradient(135deg,#f8fafc,#ffffff);
  border-color: rgba(0,0,0,0.1);
}
[data-theme="light"] .notif-panel {
  background: #ffffff;
}
[data-theme="light"] .leave-balance-card {
  background: #f8fafc;
}
[data-theme="light"] .hrms-toast {
  background: #ffffff;
  border-color: rgba(0,0,0,0.1);
  color: #0f172a;
}

/* ============================================================
   SEARCH RESULTS DROPDOWN ANIMATION
   ============================================================ */
#searchResults {
  animation: fadeSlideDown 0.15s ease;
}
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
#searchResults a:last-child {
  border-bottom: none !important;
}

/* ============================================================
   TOPBAR SEARCH FOCUS EXPAND
   ============================================================ */
.topbar-search:focus-within {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.topbar-search:focus-within input {
  width: 240px;
}
.topbar-search input {
  transition: width 0.3s ease;
}

/* ============================================================
   HR MANAGER BADGE IN SIDEBAR
   ============================================================ */
.badge-role-hr_manager {
  background: var(--purple-dim);
  color: var(--purple);
}

/* ============================================================
   NOTIFICATION ICON COLORS BY TYPE
   ============================================================ */
.notif-payroll .notif-icon {
  background: var(--green-dim);
  color: var(--green);
}

/* ============================================================
   HOLIDAY BANNER ANIMATION  
   ============================================================ */
.holiday-banner {
  animation: slideDown 0.4s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   PASSWORD STRENGTH INDICATOR
   ============================================================ */
#pwStrength {
  transition: color 0.3s ease;
  font-weight: 500;
}

/* ============================================================
   SETTINGS PAGE â€” Working day checkboxes
   ============================================================ */
.working-day-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
  background: var(--bg-elevated);
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  transition: all var(--transition);
  user-select: none;
}
.working-day-label:has(input:checked) {
  background: var(--accent-dim);
  border-color: var(--accent-border);
  color: var(--accent);
  font-weight: 600;
}

/* ============================================================
   EMPTY STATE ILLUSTRATIONS
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--text-muted);
}
.empty-state-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 16px;
  opacity: 0.5;
}
.empty-state h4 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.empty-state p {
  font-size: 13px;
  line-height: 1.6;
  max-width: 320px;
  margin: 0 auto 20px;
}

/* ============================================================
   STAT CARD â€” orange variant (for corrections)
   ============================================================ */
.stat-orange .stat-icon {
  background: var(--orange-dim);
  color: var(--orange);
}
.stat-orange::before {
  background: var(--orange);
}

/* ============================================================
   RESPONSIVE REFINEMENT â€” Professional Tablet & Mobile UX
   ============================================================ */

body.hrms-body {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.hrms-content,
.page-header,
.hrms-card,
.stat-card,
.hrms-table-wrapper,
.modal-hrms .modal-content,
.topbar-search,
.btn-hrms,
.form-control-hrms {
  min-width: 0;
}

@media (max-width: 1199px) {
  .hrms-content {
    padding: 22px;
  }

  .hrms-topbar {
    padding: 0 18px;
  }

  .topbar-search input {
    width: 140px;
  }

  .page-header {
    gap: 16px;
    flex-wrap: wrap;
  }

  .page-header .d-flex,
  .page-header form {
    flex-wrap: wrap;
  }
}

@media (max-width: 992px) {
  :root {
    --sidebar-width: min(320px, 84vw);
    --topbar-height: 68px;
  }

  .hrms-sidebar {
    width: var(--sidebar-width);
    box-shadow: 22px 0 44px rgba(0,0,0,0.45);
  }

  .sidebar-brand,
  .sidebar-user {
    padding-left: 18px;
    padding-right: 18px;
  }

  .sidebar-nav {
    padding-left: 10px;
    padding-right: 10px;
  }

  .hrms-topbar {
    gap: 12px;
  }

  .topbar-left {
    flex: 1 1 auto;
    gap: 10px;
  }

  .topbar-right {
    gap: 6px;
  }

  .breadcrumb-title {
    max-width: 38vw;
    font-size: 16px;
  }

  .breadcrumb-date {
    font-size: 10px;
  }

  .topbar-search {
    padding: 5px 12px;
  }

  .topbar-search input {
    width: 120px;
  }

  .topbar-user-btn {
    padding: 4px;
  }

  .topbar-user-btn span {
    display: none;
  }

  .notif-panel {
    width: min(420px, calc(100vw - 24px));
  }

  .hrms-content {
    padding: 18px;
  }

  .hrms-card,
  .stat-card {
    padding: 18px;
  }

  .page-header-left h1 {
    font-size: 20px;
  }
}

@media (max-width: 768px) {
  .hrms-topbar {
    padding: 0 14px;
  }

  .topbar-right {
    margin-left: auto;
  }

  .topbar-search {
    display: none !important;
  }

  .topbar-icon-btn,
  .user-avatar-sm {
    width: 36px;
    height: 36px;
  }

  .hrms-content {
    padding: 14px;
  }

  .page-header {
    margin-bottom: 18px;
  }

  .page-header-left h1 {
    font-size: 18px;
  }

  .page-header-left p {
    font-size: 12px;
  }

  .hrms-card {
    padding: 16px;
    border-radius: 14px;
  }

  .stat-card {
    padding: 16px;
    border-radius: 14px;
    gap: 12px;
  }

  .stat-value {
    font-size: 21px !important;
  }

  .btn-hrms {
    min-height: 42px;
    padding: 10px 14px;
    font-size: 12.5px;
  }

  .btn-icon {
    width: 36px;
    height: 36px;
  }

  .form-control-hrms {
    min-height: 42px;
    padding: 10px 12px;
    font-size: 14px;
  }

  textarea.form-control-hrms {
    min-height: 110px;
  }

  .card-header-hrms {
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
  }

  .card-title-hrms {
    font-size: 14px;
  }

  .hrms-tabs {
    width: 100%;
    padding: 5px;
  }

  .hrms-tab {
    min-height: 40px;
    padding: 8px 14px;
  }

  .dataTables_wrapper .row {
    row-gap: 10px;
  }

  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_filter,
  .dataTables_wrapper .dataTables_info,
  .dataTables_wrapper .dataTables_paginate {
    text-align: left !important;
    width: 100%;
  }

  .dataTables_wrapper .dataTables_length select,
  .dataTables_wrapper .dataTables_filter input {
    width: 100%;
    min-height: 40px;
  }

  .hrms-table-wrapper {
    overflow: visible;
    border: none;
    background: transparent;
  }

  .hrms-table,
  .hrms-table tbody,
  .hrms-table tr,
  .hrms-table td {
    display: block;
    width: 100%;
  }

  .hrms-table thead {
    display: none;
  }

  .hrms-table tbody tr {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    margin-bottom: 12px;
    padding: 8px 0;
    box-shadow: var(--shadow-sm);
  }

  .hrms-table tbody tr:hover td {
    background: transparent;
  }

  .hrms-table tbody td {
    border: none;
    padding: 10px 14px;
    white-space: normal !important;
  }

  .hrms-table tbody td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: var(--text-muted);
  }

  .hrms-table tbody td:first-child::before {
    margin-bottom: 6px;
  }

  .hrms-table .emp-info {
    align-items: flex-start;
  }

  .hrms-table .emp-avatar {
    width: 32px;
    height: 32px;
    margin-right: 8px;
  }

  .hrms-table tbody td form,
  .hrms-table tbody td .d-flex,
  .hrms-table tbody td .gap-1,
  .hrms-table tbody td .gap-2 {
    flex-wrap: wrap;
  }

  .modal-hrms .modal-dialog {
    margin: 10px;
    max-width: calc(100% - 20px);
  }

  .modal-hrms .modal-content {
    border-radius: 18px;
  }

  .modal-hrms .modal-header,
  .modal-hrms .modal-body,
  .modal-hrms .modal-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .modal-hrms .modal-footer {
    gap: 10px;
  }

  .modal-hrms .modal-footer .btn-hrms {
    flex: 1 1 0;
    justify-content: center;
  }
}

@media (max-width: 576px) {
  .hrms-topbar {
    padding: 0 12px;
  }

  .topbar-left {
    gap: 8px;
  }

  .breadcrumb-title {
    max-width: 46vw;
    font-size: 15px;
  }

  .sidebar-toggle {
    width: 36px;
    height: 36px;
    justify-content: center;
  }

  .hrms-content {
    padding: 12px;
  }

  .page-header {
    gap: 10px;
    margin-bottom: 16px;
  }

  .page-header .btn-hrms,
  .page-header form,
  .page-header .d-flex {
    width: 100%;
  }

  .page-header form .form-control-hrms,
  .page-header form select,
  .page-header form input,
  .page-header form button {
    width: 100% !important;
  }

  .page-header .d-flex,
  .page-header form {
    gap: 8px !important;
  }

  .hrms-card,
  .stat-card {
    padding: 14px;
  }

  .stat-card {
    align-items: center;
  }

  .stat-icon {
    width: 42px;
    height: 42px;
    font-size: 18px;
  }

  .punch-widget {
    padding: 18px 14px;
  }

  .punch-time {
    font-size: 34px;
    letter-spacing: -1px;
  }

  .punch-btn {
    width: 84px;
    height: 84px;
  }

  .hrms-table tbody td {
    padding: 9px 12px;
  }

  .notif-panel {
    width: calc(100vw - 16px) !important;
    margin: 0 8px;
  }

  .login-card {
    margin: 12px;
    padding: 24px 18px;
  }
}

@media (max-width: 420px) {
  .brand-name {
    font-size: 17px;
  }

  .sidebar-user {
    gap: 10px;
  }

  .nav-item {
    padding: 11px 12px;
  }

  .topbar-icon-btn,
  .sidebar-toggle,
  .user-avatar-sm {
    width: 34px;
    height: 34px;
  }

  .breadcrumb-title {
    max-width: 42vw;
    font-size: 14px;
  }

  .form-label-hrms {
    font-size: 11px;
  }

  .badge-hrms {
    font-size: 10px;
    padding: 4px 8px;
  }
}

/* ============================================================
   RESPONSIVE UTILITIES â€” Common Page Patterns
   ============================================================ */

.page-header .d-flex,
.page-header form,
.hrms-card .d-flex,
.card-header-hrms .d-flex {
  min-width: 0;
}

.hrms-table tbody td .btn-hrms,
.hrms-table tbody td .btn-icon,
.hrms-table tbody td select,
.hrms-table tbody td form {
  max-width: 100%;
}

.dataTables_wrapper .dataTables_paginate {
  padding-top: 10px;
}

.dataTables_wrapper .paginate_button {
  min-width: 36px;
  min-height: 36px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

@media (max-width: 992px) {
  .row.g-3 > [class*='col-'],
  .row.g-4 > [class*='col-'] {
    min-width: 0;
  }

  .page-header .btn-hrms,
  .page-header a.btn-hrms {
    white-space: nowrap;
  }

  .hrms-card .d-flex.gap-2,
  .hrms-card .d-flex.gap-1 {
    row-gap: 8px;
  }

  .notif-header {
    padding: 12px 14px;
  }

  .notif-item {
    padding: 11px 14px;
  }

  .stat-label,
  .card-subtitle-hrms,
  .emp-id {
    overflow-wrap: anywhere;
  }

  .topbar-user-btn {
    border-radius: 12px;
  }
}

@media (max-width: 768px) {
  .page-header .d-flex.gap-2,
  .page-header .d-flex.gap-1,
  .page-header form.d-flex {
    flex-direction: column;
    align-items: stretch !important;
  }

  .page-header .d-flex.gap-2 > *,
  .page-header .d-flex.gap-1 > *,
  .page-header form.d-flex > * {
    width: 100%;
    max-width: 100%;
  }

  .hrms-table tbody td .d-flex {
    align-items: stretch !important;
  }

  .hrms-table tbody td form.d-flex,
  .hrms-table tbody td .d-flex.gap-2,
  .hrms-table tbody td .d-flex.gap-1 {
    flex-direction: column;
    width: 100%;
  }

  .hrms-table tbody td .btn-hrms {
    width: 100%;
    justify-content: center;
  }

  .hrms-table tbody td .btn-icon {
    flex-shrink: 0;
  }

  .hrms-table .emp-info {
    width: 100%;
  }

  .hrms-table .emp-info > div:last-child {
    min-width: 0;
    flex: 1;
  }

  .dataTables_wrapper .dataTables_filter label,
  .dataTables_wrapper .dataTables_length label {
    width: 100%;
    display: block;
  }

  .dataTables_wrapper .dataTables_paginate {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .dataTables_wrapper .dataTables_paginate .paginate_button {
    margin: 0 !important;
  }

  .hrms-tabs .hrms-tab {
    scroll-snap-align: start;
  }

  .hrms-tabs {
    scroll-snap-type: x proximity;
  }

  .modal-hrms .row.g-3 > [class*='col-'],
  .modal-hrms .row.g-4 > [class*='col-'] {
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
  }

  .card-header-hrms > * {
    width: 100%;
  }
}

@media (max-width: 576px) {
  .sidebar-nav {
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0));
  }

  .sidebar-footer {
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0));
  }

  .topbar-right {
    gap: 4px;
  }

  .page-header-left {
    width: 100%;
  }

  .page-header-left h1,
  .card-title-hrms,
  .stat-value,
  .breadcrumb-title {
    word-break: break-word;
  }

  .hrms-card .btn-hrms,
  .hrms-card a.btn-hrms {
    max-width: 100%;
  }

  .hrms-table tbody tr {
    margin-bottom: 10px;
  }

  .hrms-table tbody td .badge-hrms {
    max-width: 100%;
    white-space: normal;
  }

  .modal-hrms .modal-title {
    font-size: 15px;
    line-height: 1.3;
  }

  .modal-hrms .btn-close {
    margin-left: 8px;
  }
}

/* ============================================================
   PAYROLL PAGE REFINEMENT
   ============================================================ */
.payroll-settings-card .card-subtitle-hrms {
  max-width: 900px;
}

.payroll-settings-grid > [class*='col-'] {
  display: flex;
}

.payroll-settings-grid .form-group-hrms {
  width: 100%;
  margin-bottom: 0;
}

.payroll-summary-row > [class*='col-'] {
  display: flex;
}

.payroll-summary-card {
  width: 100%;
  min-height: 136px;
  align-items: center;
}

.payroll-summary-card .stat-info {
  min-width: 0;
  flex: 1;
}

.payroll-summary-card .stat-value {
  font-size: clamp(1.5rem, 2vw, 2.7rem);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.payroll-summary-card .stat-label {
  line-height: 1.35;
}

@media (max-width: 1199px) {
  .payroll-summary-card .stat-value {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 768px) {
  .payroll-settings-grid .form-group-hrms {
    margin-bottom: 0;
  }

  .payroll-summary-card {
    min-height: auto;
  }

  .payroll-summary-card .stat-value {
    font-size: 1.9rem;
  }
}

/* ============================================================
   DASHBOARD ALIGNMENT REFINEMENT
   ============================================================ */
.dashboard-page-header {
  align-items: flex-start;
}

.dashboard-page-header > div:last-child {
  display: flex;
  align-items: flex-start;
}

.dashboard-stats-row > [class*='col-'],
.dashboard-overview-row > [class*='col-'],
.dashboard-bottom-row > [class*='col-'] {
  display: flex;
}

.dashboard-stat-card,
.dashboard-panel-card {
  width: 100%;
}

.dashboard-stat-card {
  min-height: 168px;
  align-items: center;
  gap: 18px;
}

.dashboard-stat-card .stat-icon {
  width: 58px;
  height: 58px;
}

.dashboard-stat-card .stat-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.dashboard-stat-card .stat-label {
  min-height: 40px;
  display: flex;
  align-items: flex-start;
  line-height: 1.45;
}

.dashboard-card-header {
  align-items: flex-start;
}

.dashboard-card-header .btn-icon,
.dashboard-card-header .btn-hrms {
  flex-shrink: 0;
}

.dashboard-progress-item:last-child {
  margin-bottom: 0 !important;
}

.dashboard-progress-label,
.dashboard-progress-value {
  font-size: 12px;
}

.dashboard-progress-label {
  color: var(--text-secondary);
}

.dashboard-progress-value {
  font-weight: 600;
  text-align: right;
}

.dashboard-empty-copy,
.dashboard-empty-state {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 20px 0;
}

.dashboard-announcement-item:last-child,
.dashboard-leave-item:last-child {
  border-bottom: none;
}

.dashboard-leave-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.dashboard-leave-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}

.dashboard-leave-meta {
  flex: 1;
  min-width: 0;
}

.dashboard-leave-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.dashboard-leave-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

.dashboard-leave-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.dashboard-leave-action {
  width: 30px;
  height: 30px;
  font-size: 13px;
}

.dashboard-leave-action-approve {
  background: var(--green-dim);
  color: var(--green);
}

.dashboard-leave-action-reject {
  background: var(--red-dim);
  color: var(--red);
}

/* ============================================================
   PWA INSTALL EXPERIENCE
   ============================================================ */
.pwa-install-btn {
  min-height: 38px;
  padding: 8px 14px;
  white-space: nowrap;
}

.pwa-install-btn i {
  font-size: 14px;
}

.pwa-install-steps {
  margin: 0;
  padding-left: 18px;
  color: var(--text-secondary);
}

.pwa-install-steps li + li {
  margin-top: 8px;
}

@media (max-width: 768px) {
  .pwa-install-btn span {
    display: none;
  }

  .pwa-install-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }
}

@media (max-width: 1199px) {
  .dashboard-stat-card {
    min-height: 154px;
  }
}

@media (max-width: 768px) {
  .dashboard-page-header {
    align-items: stretch;
  }

  .dashboard-page-header > div:last-child {
    width: 100%;
  }

  .dashboard-page-header > div:last-child .btn-hrms {
    width: 100%;
    justify-content: center;
  }

  .dashboard-stat-card {
    min-height: auto;
    align-items: flex-start;
  }

  .dashboard-stat-card .stat-label {
    min-height: 0;
  }

  .dashboard-leave-item {
    align-items: flex-start;
  }
}

@media (max-width: 576px) {
  .dashboard-card-header {
    gap: 12px;
  }

  .dashboard-card-header .btn-icon,
  .dashboard-card-header .btn-hrms {
    width: 100%;
    justify-content: center;
  }

  .dashboard-leave-actions {
    width: 100%;
    justify-content: flex-start;
  }
}