* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #f0f0f0; }
#app { max-width: 480px; margin: 0 auto; min-height: 100vh; background: #fff; display: flex; flex-direction: column; position: relative; }

/* Header */
.header { background: #1a1a2e; color: #fff; padding: 16px 16px 12px; flex-shrink: 0; }
.header-top { display: flex; justify-content: space-between; align-items: flex-start; }
.header-company { font-size: 12px; opacity: 0.7; }
.header-title { font-size: 17px; font-weight: 600; margin-top: 2px; }
.header-date { font-size: 12px; opacity: 0.65; margin-top: 4px; }
.header-right { display: flex; gap: 10px; align-items: center; }
.notif-btn { background: rgba(255,255,255,0.15); border: none; color: white; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 16px; position: relative; }
.notif-dot { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; background: #ef4444; border-radius: 50%; display: none; }
.grup-badge { background: rgba(255,255,255,0.2); border-radius: 12px; padding: 4px 12px; font-size: 12px; }
.header-avatar { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; background: rgba(255,255,255,0.25); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.header-avatar img { width: 100%; height: 100%; object-fit: cover; }
.header-avatar span { color: white; font-size: 13px; font-weight: 700; }

/* Content */
.content { flex: 1; overflow-y: auto; padding: 16px; padding-bottom: 72px; }
.panel { display: none; }
.panel.active { display: block; }

/* Clock card */
.clock-card { background: #f8f9fa; border-radius: 16px; padding: 20px; text-align: center; margin-bottom: 16px; }
.clock { font-size: 40px; font-weight: 300; letter-spacing: 2px; color: #1a1a2e; font-variant-numeric: tabular-nums; }
.clock-sub { font-size: 13px; color: #666; margin-top: 4px; }
.status-row { display: flex; gap: 10px; margin-top: 14px; }
.status-chip { flex: 1; padding: 8px 6px; border-radius: 10px; font-size: 12px; text-align: center; font-weight: 500; }
.chip-hadir { background: #dcfce7; color: #166534; }
.chip-pulang { background: #dbeafe; color: #1e40af; }
.chip-empty { background: #f1f5f9; color: #64748b; }

/* Buttons */
.btn { width: 100%; padding: 15px; border-radius: 12px; font-size: 15px; font-weight: 600; cursor: pointer; border: none; margin-bottom: 8px; transition: opacity 0.15s, transform 0.1s; }
.btn:active { opacity: 0.85; transform: scale(0.99); }
.btn-masuk { background: #1D9E75; color: white; }
.btn-pulang { background: #185FA5; color: white; }
.btn-secondary { background: #f1f5f9; color: #334155; border: 1px solid #e2e8f0; }
.btn-danger { background: #ef4444; color: white; }
.btn-sm { padding: 8px 16px; font-size: 13px; border-radius: 8px; width: auto; font-weight: 500; }
.btn-approve { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.btn-reject { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* Section title */
.section-title { font-size: 12px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 10px; }
.pt-group-title { font-size: 14px; font-weight: 700; color: #1A1A2E; background: #F4F4F8; padding: 10px 12px; border-radius: 8px; margin: 16px 0 10px; border-left: 4px solid #C0392B; }
.pt-group-title:first-child { margin-top: 0; }

/* Menu grid */
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.menu-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 16px 12px; cursor: pointer; transition: background 0.15s; }
.menu-card:active { background: #f8fafc; }
.menu-icon { font-size: 26px; margin-bottom: 8px; }
.menu-label { font-size: 14px; font-weight: 600; color: #1e293b; }
.menu-desc { font-size: 11px; color: #94a3b8; margin-top: 2px; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.stat-card { background: #f8f9fa; border-radius: 12px; padding: 14px; }
.stat-num { font-size: 26px; font-weight: 700; }
.stat-label { font-size: 12px; color: #64748b; margin-top: 2px; }
.stat-green .stat-num { color: #1D9E75; }
.stat-amber .stat-num { color: #f59e0b; }
.stat-red .stat-num { color: #ef4444; }
.stat-blue .stat-num { color: #185FA5; }

/* Cards */
.card { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 14px; margin-bottom: 10px; }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.card-name { font-size: 14px; font-weight: 600; color: #1e293b; }
.card-sub { font-size: 12px; color: #64748b; margin-top: 2px; }
.card-body { font-size: 13px; color: #475569; margin-bottom: 10px; line-height: 1.5; }
.card-actions { display: flex; gap: 8px; }

/* Badge */
.badge { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-menunggu { background: #fef3c7; color: #92400e; }
.badge-disetujui { background: #dcfce7; color: #166534; }
.badge-ditolak { background: #fee2e2; color: #991b1b; }
.badge-hadir { background: #dcfce7; color: #166534; }
.badge-sakit, .badge-izin { background: #fef3c7; color: #92400e; }
.badge-alpha { background: #fee2e2; color: #991b1b; }
.badge-cuti { background: #dbeafe; color: #1e40af; }

/* History item */
.history-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f1f5f9; }
.history-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-green { background: #22c55e; }
.dot-amber { background: #f59e0b; }
.dot-red { background: #ef4444; }
.dot-blue { background: #3b82f6; }
.history-info { flex: 1; }
.history-date { font-size: 13px; font-weight: 500; color: #1e293b; }
.history-detail { font-size: 12px; color: #64748b; margin-top: 2px; }

/* Form */
.form-group { margin-bottom: 14px; }
.form-label { font-size: 13px; font-weight: 500; color: #374151; margin-bottom: 6px; display: block; }
.form-control { width: 100%; padding: 11px 14px; border: 1px solid #d1d5db; border-radius: 10px; font-size: 14px; color: #1e293b; background: #fff; outline: none; }
.form-control:focus { border-color: #1a1a2e; box-shadow: 0 0 0 3px rgba(26,26,46,0.08); }
textarea.form-control { min-height: 80px; resize: none; }
.form-hint { font-size: 12px; color: #64748b; margin-top: 4px; }
.info-box { background: #eff6ff; border-radius: 10px; padding: 10px 12px; font-size: 13px; color: #1e40af; margin-bottom: 14px; }
.warning-box { background: #fef3c7; border-radius: 10px; padding: 10px 12px; font-size: 13px; color: #92400e; margin-bottom: 14px; }

/* Profile */
.profile-header { background: #f8f9fa; border-radius: 16px; padding: 20px; text-align: center; margin-bottom: 16px; }
.avatar { width: 70px; height: 70px; border-radius: 50%; background: #1a1a2e; color: white; font-size: 22px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.profile-name { font-size: 18px; font-weight: 700; color: #1e293b; }
.profile-role { font-size: 13px; color: #64748b; margin-top: 4px; }
.info-list { }
.info-row { display: flex; justify-content: space-between; align-items: center; padding: 13px 0; border-bottom: 1px solid #f1f5f9; }
.info-key { font-size: 13px; color: #64748b; }
.info-val { font-size: 13px; font-weight: 500; color: #1e293b; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 32px 24px; background: #1a1a2e; }
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo h1 { font-size: 24px; font-weight: 700; color: white; }
.login-logo p { font-size: 14px; color: rgba(255,255,255,0.6); margin-top: 4px; }
.login-card { background: white; border-radius: 20px; padding: 28px 24px; }
.login-title { font-size: 18px; font-weight: 700; color: #1e293b; margin-bottom: 20px; }
.login-btn { width: 100%; padding: 14px; background: #1a1a2e; color: white; border: none; border-radius: 12px; font-size: 15px; font-weight: 600; cursor: pointer; }
.login-error { background: #fee2e2; color: #991b1b; padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; display: none; }

/* Bottom nav */
.nav { display: flex; background: #fff; border-top: 1px solid #e2e8f0; padding: 6px 0 8px; position: sticky; bottom: 0; z-index: 10; }
.nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; cursor: pointer; border: none; background: none; }
.nav-icon { font-size: 22px; color: #94a3b8; }
.nav-label { font-size: 10px; color: #94a3b8; }
.nav-item.active .nav-icon, .nav-item.active .nav-label { color: #1a1a2e; }

/* Toast */
.toast { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); background: #1a1a2e; color: white; padding: 10px 20px; border-radius: 20px; font-size: 13px; z-index: 100; display: none; white-space: nowrap; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

/* Admin table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { background: #1a1a2e; color: white; padding: 10px 8px; text-align: left; font-weight: 600; }
td { padding: 10px 8px; border-bottom: 1px solid #f1f5f9; color: #374151; }
tr:hover td { background: #f8fafc; }

/* Spinner */
.spinner { text-align: center; padding: 40px; color: #94a3b8; font-size: 13px; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200; display: none; align-items: flex-end; justify-content: center; }
.modal-bg.open { display: flex; }
.absen-card-bg { position: fixed; inset: 0; background: rgba(26,26,46,0.7); z-index: 300; display: none; align-items: center; justify-content: center; padding: 24px; opacity: 0; transition: opacity 0.25s ease; }
.absen-card-bg.open { display: flex; opacity: 1; }
.absen-card { background: white; border-radius: 24px; padding: 36px 28px; width: 100%; max-width: 360px; text-align: center; transform: scale(0.7) translateY(20px); opacity: 0; transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.absen-card-bg.open .absen-card { transform: scale(1) translateY(0); opacity: 1; }
.absen-card-emoji { font-size: 56px; line-height: 1; margin-bottom: 8px; animation: absenBounce 0.6s ease 0.15s; }
.absen-card-jam { font-size: 32px; font-weight: 800; color: #1A1A2E; letter-spacing: 1px; }
.absen-card-judul { font-size: 13px; font-weight: 700; color: #C0392B; text-transform: uppercase; letter-spacing: 0.6px; margin-top: 6px; }
.absen-card-pesan { font-size: 15px; color: #475569; margin-top: 14px; line-height: 1.5; }
@keyframes absenBounce { 0% { transform: scale(0.5); } 50% { transform: scale(1.15); } 100% { transform: scale(1); } }
.modal { background: white; border-radius: 20px 20px 0 0; padding: 24px 20px; width: 100%; max-width: 480px; max-height: 85vh; overflow-y: auto; }
.modal-title { font-size: 16px; font-weight: 700; color: #1e293b; margin-bottom: 16px; }
.modal-close { float: right; background: none; border: none; font-size: 20px; cursor: pointer; color: #94a3b8; }
