/* ROOT VARIABLES - NAVY BLUE THEME */
:root {
    --primary: #0f172a; --primary-light: #1e293b; --primary-dark: #020617;
    --accent: #3b82f6; --accent-light: #60a5fa; --accent-dark: #2563eb;
    --success: #10b981; --warning: #f59e0b; --danger: #ef4444;
    --white: #ffffff; --gray-100: #f1f5f9; --gray-300: #cbd5e1;
    --gray-500: #64748b; --gray-700: #334155;
    --radius: 12px; --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background: var(--primary); color: var(--gray-300); min-height: 100vh; display: flex; overflow-x: hidden; }

/* SIDEBAR */
.sidebar { width: 260px; height: 100vh; position: fixed; left: 0; top: 0; background: var(--primary-light); border-right: 1px solid rgba(255, 255, 255, 0.08); z-index: 100; transition: var(--transition); display: flex; flex-direction: column; }
.sidebar-header { padding: 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.05); display: flex; align-items: center; gap: 1rem; }
.sidebar-brand-icon { width: 40px; height: 40px; background: linear-gradient(135deg, var(--accent), var(--accent-dark)); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: white; font-weight: bold; }
.sidebar-brand-text h1 { color: white; font-size: 1.1rem; font-weight: 700; }
.sidebar-brand-text span { font-size: 0.7rem; color: var(--gray-500); }

.sidebar-nav { flex: 1; padding: 1rem 0; overflow-y: auto; }
.nav-section-title { padding: 1rem 1.5rem 0.5rem; font-size: 0.7rem; text-transform: uppercase; color: var(--gray-500); letter-spacing: 0.1em; }
.nav-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.85rem 1.5rem; color: var(--gray-500); text-decoration: none; border-left: 3px solid transparent; transition: var(--transition); font-size: 0.9rem; }
.nav-item i { width: 20px; text-align: center; }
.nav-item:hover, .nav-item.active { background: rgba(59, 130, 246, 0.1); color: var(--accent-light); border-left-color: var(--accent); }

.sidebar-user { padding: 1rem 1.5rem; background: var(--primary-dark); border-top: 1px solid rgba(255,255,255,0.05); }
.user-card { display: flex; align-items: center; gap: 0.75rem; }
.user-avatar { width: 36px; height: 36px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), var(--success)); display: flex; align-items: center; justify-content: center; color: white; font-weight: bold; font-size: 0.9rem; }
.user-info h4 { color: white; font-size: 0.85rem; margin: 0; }
.user-info span { font-size: 0.7rem; color: var(--gray-500); }

/* MAIN CONTENT */
.main-content { flex: 1; margin-left: 260px; min-height: 100vh; background: var(--primary); width: 100%; }
.top-header { background: var(--primary-light); padding: 1rem 2rem; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.05); position: sticky; top: 0; z-index: 50; height: 60px; }
.page-title { font-size: 1.25rem; font-weight: 700; color: white; margin: 0; }
.content-area { padding: 2rem; }

/* CARDS & COMPONENTS */
.card { background: var(--primary-light); border: 1px solid rgba(255,255,255,0.08); border-radius: var(--radius); overflow: hidden; margin-bottom: 1.5rem; box-shadow: var(--shadow); }
.card-header { padding: 1rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.05); background: rgba(0,0,0,0.1); display: flex; justify-content: space-between; align-items: center; }
.card-title { color: white; font-weight: 600; margin: 0; font-size: 1rem; }
.card-body { padding: 1.5rem; }

/* TABLE */
.table-container { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; min-width: 600px; }
.table th, .table td { padding: 0.85rem 1rem; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.05); white-space: nowrap; }
.table th { font-size: 0.75rem; text-transform: uppercase; color: var(--gray-500); background: rgba(0,0,0,0.2); letter-spacing: 0.5px; }
.table tr:hover { background: rgba(255,255,255,0.02); }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.6rem 1.2rem; border-radius: 8px; font-size: 0.85rem; font-weight: 600; border: none; cursor: pointer; transition: var(--transition); text-decoration: none; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: white; box-shadow: 0 4px 14px rgba(59, 130, 246, 0.25); }
.btn-danger { background: linear-gradient(135deg, var(--danger), #DC2626); color: white; }
.btn-warning { background: var(--warning); color: #1E293B; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }

/* BADGE */
.badge { padding: 0.3rem 0.8rem; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.badge-success { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: #fcd34d; }
.badge-primary { background: rgba(59, 130, 246, 0.15); color: var(--accent-light); }

/* FORMS */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; margin-bottom: 0.5rem; font-size: 0.85rem; color: var(--gray-300); }
.form-control { width: 100%; padding: 0.75rem 1rem; background: var(--primary); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; color: white; font-size: 0.9rem; }
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); }

/* MODAL */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 999; justify-content: center; align-items: center; padding: 1rem; }
.modal-content { background: var(--primary-light); border-radius: 16px; width: 100%; max-width: 500px; border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); animation: slideDown 0.3s ease; }
@keyframes slideDown { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.1); display: flex; justify-content: space-between; align-items: center; }
.modal-title { margin: 0; font-size: 1.1rem; color: white; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--gray-500); font-size: 1.5rem; cursor: pointer; transition: color 0.2s; }
.modal-close:hover { color: white; }
.modal-body { padding: 1.5rem; max-height: 70vh; overflow-y: auto; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid rgba(255,255,255,0.1); text-align: right; }

/* MOBILE RESPONSIVE */
.mobile-toggle { display: none; background: none; border: none; color: white; font-size: 1.5rem; cursor: pointer; }
.btn-back-mobile { display: none; background: none; border: none; color: var(--accent-light); font-size: 1.2rem; cursor: pointer; margin-right: 0.5rem; }

@media (max-width: 1023px) {
    .sidebar { transform: translateX(-100%); position: fixed; z-index: 1000; box-shadow: 5px 0 20px rgba(0,0,0,0.5); }
    .sidebar.active { transform: translateX(0); }
    .main-content { margin-left: 0; }
    
    /* Tampilkan tombol navigasi mobile */
    .mobile-toggle { display: block; }
    .btn-back-mobile { display: block; } /* Tombol Back muncul di mobile */

    body.sidebar-open::before { content: ''; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 999; }
    .content-area { padding: 1rem; } 
}

/* Karyawan Bottom Nav Styling */
.mobile-nav { display: none; }
@media (max-width: 1023px) {
    .mobile-nav {
        display: flex; position: fixed; bottom: 0; left: 0; width: 100%; 
        background: var(--primary-light); backdrop-filter: blur(10px); 
        border-top: 1px solid rgba(255,255,255,0.1); justify-content: space-around; 
        padding: 0.5rem 0; z-index: 1000;
    }
    .mobile-nav .nav-item { display: flex; flex-direction: column; align-items: center; color: var(--gray-500); text-decoration: none; font-size: 0.7rem; padding: 0.5rem; border: none; }
    .mobile-nav .nav-item i { font-size: 1.2rem; margin-bottom: 4px; }
    .mobile-nav .nav-item.active { color: var(--accent); background: transparent; }
    .content-area.karyawan-mode { padding-bottom: 90px; }
}
html { -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; }
@media (max-width: 640px) {
  body { display:block; }
  .top-header { height:56px; padding:.75rem 1rem; }
  .page-title { font-size:1.05rem; }
  .content-area { padding:.75rem; }
  .card-body { padding:1rem; }
  .clock-time { font-size:2.6rem; }
  .selection-grid { grid-template-columns:1fr 1fr; gap:.6rem; }
  .selection-card { padding:.7rem .5rem; min-height:72px; }
  .btn-group-absen { grid-template-columns:1fr; gap:.7rem; }
  .btn-absen { min-height:88px; padding:1rem; }
  .modal-overlay { padding:0; align-items:flex-end; }
  .modal-content { max-width:none; border-radius:18px 18px 0 0; max-height:94vh; }
  .modal-body { max-height:none; }
  .video-wrapper { width:100%; aspect-ratio:3/4; max-height:62vh; overflow:hidden; }
  .video-wrapper video { width:100%; height:100%; object-fit:cover; }
  #btnCapture { width:100%; min-height:52px; border:0; border-radius:10px; background:var(--accent); color:#fff; font-weight:700; }
  .content-area.karyawan-mode { padding-bottom:82px; }
}
