/* HRIS UMKM Frontend CSS */
:root {
  --primary: #4F46E5;
  --primary-light: #EEF2FF;
  --sb-w: 250px;
  --topbar-h: 56px;
  --bnav-h: 62px;
  --font: 'Plus Jakarta Sans', sans-serif;
}
* { box-sizing: border-box; }
body { font-family: var(--font); background: #F0F2FF; margin: 0; }

/* ---- SPLASH ---- */
#splash { position:fixed;inset:0;z-index:9999;background:linear-gradient(135deg,#4F46E5,#7C3AED);display:flex;align-items:center;justify-content:center; }

/* ---- LOGIN ---- */
.login-wrap { min-height:100vh;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#4F46E5 0%,#7C3AED 100%);padding:20px; }
.login-card { background:#fff;border-radius:20px;padding:36px 32px;width:100%;max-width:400px;box-shadow:0 20px 60px rgba(0,0,0,.2); }

/* ---- SIDEBAR ---- */
#sidebar { position:fixed;top:0;left:0;bottom:0;width:var(--sb-w);background:#1E1B4B;display:flex;flex-direction:column;z-index:1040;transform:translateX(-100%);transition:transform .25s ease; }
#sidebar.open { transform:translateX(0); }
@media(min-width:992px) { #sidebar { transform:translateX(0); } }

#sb-overlay { position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:1039; }

.sb-brand { display:flex;align-items:center;gap:8px;padding:18px 16px;border-bottom:1px solid rgba(255,255,255,.1); }
.sb-name { font-size:1.1rem;font-weight:800;color:#fff; }
.sb-name span { color:#a5b4fc; }

.sb-user { display:flex;align-items:center;gap:10px;padding:12px 16px;border-bottom:1px solid rgba(255,255,255,.08);margin-bottom:6px; }
.sb-avatar { width:36px;height:36px;border-radius:10px;background:#4F46E5;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:.9rem;flex-shrink:0; }
.sb-role { font-size:.68rem;background:rgba(165,180,252,.2);color:#a5b4fc;padding:2px 8px;border-radius:20px;display:inline-block;margin-top:2px; }

.sb-nav { flex:1;padding:6px 10px;overflow-y:auto; }
.sb-nav a { display:flex;align-items:center;gap:10px;color:rgba(255,255,255,.75) !important;padding:9px 12px;border-radius:10px;font-size:.875rem;font-weight:500;cursor:pointer;text-decoration:none !important;margin-bottom:2px;transition:all .15s; }
.sb-nav a:hover { background:rgba(255,255,255,.1);color:#fff !important; }
.sb-nav a.active { background:#4F46E5;color:#fff !important; }
.sb-nav a i { font-size:1rem;width:20px;text-align:center;color:inherit; }
.sb-section { font-size:.65rem;text-transform:uppercase;letter-spacing:.08em;color:rgba(255,255,255,.3);padding:10px 12px 4px;font-weight:700; }

.sb-footer { padding:14px 16px;border-top:1px solid rgba(255,255,255,.1); }

/* ---- MAIN ---- */
#main { display:flex;flex-direction:column;min-height:100vh; }
@media(min-width:992px) { #main { margin-left:var(--sb-w); } }

/* ---- TOPBAR ---- */
#topbar { height:var(--topbar-h);background:#fff;border-bottom:1px solid #e5e7eb;display:flex;align-items:center;padding:0 16px;gap:8px;position:sticky;top:0;z-index:100; }

/* ---- PAGE CONTENT ---- */
#page-content { flex:1;padding:20px 16px;padding-bottom:calc(var(--bnav-h) + 12px); }
@media(min-width:992px) { #page-content { padding:24px;padding-bottom:24px; } }

/* ---- BOTTOM NAV ---- */
#bottom-nav { position:fixed;bottom:0;left:0;right:0;height:var(--bnav-h);background:#fff;border-top:1px solid #e5e7eb;display:flex;z-index:1030; }
.bnav-item { flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;text-decoration:none;color:#9ca3af;font-size:.85rem;cursor:pointer;transition:color .15s; }
.bnav-item i { font-size:1.3rem; }
.bnav-item small { font-size:.62rem;font-weight:600; }
.bnav-item.active { color:var(--primary); }

/* ---- CARDS ---- */
.stat-card { border-radius:14px;border:none;box-shadow:0 2px 8px rgba(0,0,0,.06); }
.stat-icon { width:46px;height:46px;border-radius:12px;display:flex;align-items:center;justify-content:center;font-size:1.3rem; }

/* ---- SHIFT BADGES ---- */
.sh-Pagi   { background:#FEF9C3;color:#A16207; }
.sh-Siang  { background:#DBEAFE;color:#1D4ED8; }
.sh-Malam  { background:#EDE9FE;color:#6D28D9; }
.sh-Libur  { background:#F3F4F6;color:#6B7280; }
.sh-Cuti   { background:#D1FAE5;color:#065F46; }
.sh-Izin   { background:#FFE4E6;color:#BE123C; }
.shift-badge { display:inline-block;padding:2px 9px;border-radius:20px;font-size:.72rem;font-weight:600;white-space:nowrap; }

/* ---- TABLE ---- */
.jadwal-table th { background:var(--primary);color:#fff;font-size:.75rem;white-space:nowrap;vertical-align:middle; }
.jadwal-table td { font-size:.78rem;vertical-align:middle;cursor:pointer; }
.jadwal-table { min-width:700px; }
.jadwal-table td:first-child { cursor:default;position:sticky;left:0;background:#fff;z-index:1; }

/* ---- PAYROLL TOTAL ---- */
.payroll-total { background:linear-gradient(135deg,#4F46E5,#7C3AED);color:#fff;border-radius:14px;padding:18px 20px; }

/* ---- STATUS BADGES ---- */
.badge-pending   { background:#FEF9C3;color:#A16207; }
.badge-disetujui { background:#D1FAE5;color:#065F46; }
.badge-ditolak   { background:#FFE4E6;color:#BE123C; }

/* ---- ABSENSI ---- */
#camera-video { width:100%;border-radius:12px;background:#000; }

/* ---- FORMS ---- */
.form-control, .form-select { border-radius:10px;font-size:.875rem; }
.btn { border-radius:10px;font-weight:600;font-size:.875rem; }
.card { border-radius:14px; }

/* ---- EMPTY STATE ---- */
.empty-state { text-align:center;padding:48px 20px;color:#9ca3af; }
.empty-state i { font-size:2.5rem;display:block;margin-bottom:10px; }

/* ---- SLIP PREVIEW ---- */
#slip-render { background:#fff;border-radius:14px;overflow:hidden;box-shadow:0 4px 20px rgba(0,0,0,.1); }

/* ================================================
   EMPLOYEE UI - Mobile-First Modern (Talenta style)
   ================================================ */

/* Override background for employee role */
body.role-karyawan { background: #F5F6FA; }

/* ---- EMPLOYEE TOPBAR ---- */
body.role-karyawan #topbar {
  background: linear-gradient(135deg, #4F46E5, #7C3AED);
  border-bottom: none;
  color: #fff;
}
body.role-karyawan #topbar .btn { color: #fff; background: rgba(255,255,255,.15); border:none; }
body.role-karyawan #topbar #page-title { color: #fff; }
body.role-karyawan #topbar .badge { background: rgba(255,255,255,.2) !important; color: #fff !important; }

/* ---- EMPLOYEE BOTTOM NAV ---- */
body.role-karyawan #bottom-nav {
  background: #fff;
  border-top: none;
  box-shadow: 0 -4px 20px rgba(0,0,0,.08);
  border-radius: 20px 20px 0 0;
  padding: 4px 0;
}
body.role-karyawan .bnav-item { color: #C4C9D4; padding: 6px 0; }
body.role-karyawan .bnav-item.active { color: #4F46E5; }
body.role-karyawan .bnav-item.active i {
  background: #EEF2FF;
  border-radius: 12px;
  padding: 4px 14px;
  display: block;
}

/* ---- EMP HERO CARD ---- */
.emp-hero {
  background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
  border-radius: 0 0 28px 28px;
  padding: 20px 20px 32px;
  margin: -20px -16px 0;
  color: #fff;
}
@media(min-width:992px) { .emp-hero { margin: -24px -24px 0; padding: 24px 24px 36px; } }
.emp-hero-name { font-size: 1.25rem; font-weight: 800; }
.emp-hero-sub  { font-size: .8rem; opacity: .8; margin-top: 2px; }

/* ---- ATTENDANCE QUICK CARD ---- */
.att-quick {
  background: #fff;
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 4px 24px rgba(79,70,229,.12);
  margin-top: -20px;
  position: relative;
  z-index: 2;
}
.att-btn {
  border: none; border-radius: 16px; padding: 14px 20px;
  font-weight: 700; font-size: .9rem; cursor: pointer;
  transition: all .18s; display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
}
.att-btn-in  { background: linear-gradient(135deg,#10B981,#059669); color: #fff; }
.att-btn-out { background: linear-gradient(135deg,#4F46E5,#7C3AED); color: #fff; }
.att-btn-done { background: #F3F4F6; color: #9CA3AF; cursor: not-allowed; }
.att-btn:hover:not(.att-btn-done) { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,.15); }

.att-time-pill {
  background: #F5F6FA; border-radius: 12px; padding: 8px 14px;
  display: flex; align-items: center; gap: 8px; font-size: .82rem;
}
.att-time-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ---- EMP MENU GRID ---- */
.emp-menu-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.emp-menu-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: #fff; border-radius: 16px; padding: 14px 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05); cursor: pointer;
  border: none; transition: all .18s; text-decoration: none; color: inherit;
}
.emp-menu-item:hover { transform: translateY(-2px); box-shadow: 0 4px 18px rgba(0,0,0,.1); }
.emp-menu-icon {
  width: 44px; height: 44px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}
.emp-menu-label { font-size: .68rem; font-weight: 700; color: #374151; text-align: center; }

/* ---- EMP SECTION HEADER ---- */
.emp-section-hd { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.emp-section-hd h6 { font-weight: 800; font-size: .95rem; margin: 0; }
.emp-section-hd a { font-size: .78rem; color: #4F46E5; font-weight: 600; text-decoration: none; }

/* ---- EMP ACTIVITY ITEM ---- */
.emp-activity {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border-radius: 14px; padding: 12px 14px;
  margin-bottom: 8px; box-shadow: 0 1px 6px rgba(0,0,0,.05);
}
.emp-activity-icon {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.emp-activity-title { font-weight: 700; font-size: .85rem; }
.emp-activity-sub   { font-size: .72rem; color: #9CA3AF; margin-top: 1px; }

/* ---- EMP GAJI CARD ---- */
.emp-gaji-card {
  background: linear-gradient(135deg, #111827, #1F2937);
  border-radius: 20px; padding: 20px; color: #fff;
  position: relative; overflow: hidden;
}
.emp-gaji-card::before {
  content: ''; position: absolute; width: 160px; height: 160px;
  border-radius: 50%; background: rgba(255,255,255,.05);
  top: -40px; right: -40px;
}
.emp-gaji-label  { font-size: .75rem; opacity: .6; margin-bottom: 4px; }
.emp-gaji-amount { font-size: 1.6rem; font-weight: 800; letter-spacing: -.5px; }
.emp-gaji-period { font-size: .72rem; opacity: .5; margin-top: 2px; }

/* ---- EMP JADWAL LIST ---- */
.emp-jadwal-item {
  background: #fff; border-radius: 14px; padding: 12px 16px;
  margin-bottom: 8px; display: flex; align-items: center; gap: 12px;
  box-shadow: 0 1px 6px rgba(0,0,0,.05);
}
.emp-jadwal-date {
  min-width: 44px; text-align: center; background: #F5F6FA;
  border-radius: 10px; padding: 6px 4px;
}
.emp-jadwal-date .day-num { font-weight: 800; font-size: 1.1rem; color: #1F2937; }
.emp-jadwal-date .day-name { font-size: .6rem; color: #9CA3AF; font-weight: 600; text-transform: uppercase; }
.emp-jadwal-today .emp-jadwal-date { background: #4F46E5; }
.emp-jadwal-today .day-num,
.emp-jadwal-today .day-name { color: #fff; }

/* ---- EMP PENGAJUAN CARD ---- */
.emp-pengajuan-card {
  background: #fff; border-radius: 16px; padding: 16px;
  margin-bottom: 10px; box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.emp-pengajuan-type {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .75rem; font-weight: 700; padding: 4px 10px;
  border-radius: 20px; margin-bottom: 8px;
}

/* ---- EMP PROFILE ---- */
.emp-profile-header {
  background: linear-gradient(135deg, #4F46E5, #7C3AED);
  border-radius: 0 0 28px 28px; padding: 24px 20px 40px;
  margin: -20px -16px 0; color: #fff; text-align: center;
}
@media(min-width:992px) { .emp-profile-header { margin: -24px -24px 0; } }
.emp-avatar-lg {
  width: 72px; height: 72px; border-radius: 20px;
  background: rgba(255,255,255,.25); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 800; margin: 0 auto 10px;
}
.emp-info-row {
  background: #fff; border-radius: 14px; padding: 14px 16px;
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px; box-shadow: 0 1px 6px rgba(0,0,0,.05);
}
.emp-info-label { font-size: .75rem; color: #9CA3AF; margin-bottom: 2px; }
.emp-info-value { font-size: .875rem; font-weight: 600; color: #1F2937; }

/* Employee page-content: allow hero overflow */
body.role-karyawan #page-content { overflow-x: hidden; }
body.role-karyawan #main { background: #F5F6FA; }

/* Smooth page-content scroll */
#page-content { overflow-y: auto; }
