* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --orange: #F2984A;
  --orange-deep: #D9700F;
  --amber: #F7C560;
  --ink: #2E2013;
  --ink-soft: #6B5A46;
  --glass: rgba(255,255,255,0.55);
  --glass-strong: rgba(255,255,255,0.75);
  --glass-border: rgba(255,255,255,0.6);
}

html, body { min-height: 100%; }

body {
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(247,197,96,0.5), transparent 42%),
    radial-gradient(circle at 88% 14%, rgba(242,152,74,0.4), transparent 45%),
    radial-gradient(circle at 30% 96%, rgba(217,112,15,0.22), transparent 50%),
    linear-gradient(180deg, #FDF7EE, #F7ECDC);
  background-attachment: fixed;
}

a { color: var(--orange-deep); }

/* ---------- Top bar: admin/it/bos (desktop-style with text nav) ---------- */
.navbar {
  background: rgba(46, 32, 19, 0.92);
  backdrop-filter: blur(14px);
  color: #fff;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.navbar .brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; }
.navbar .brand img { height: 26px; width: auto; }
.navbar nav { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.navbar nav a { color: #EAD9C4; text-decoration: none; font-size: 14px; }
.navbar nav a:hover { color: #fff; }

/* ---------- Top bar: karyawan (minimal, app-style) ---------- */
.app-topbar {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 18px;
  position: sticky; top: 0; z-index: 20;
  background: var(--glass-strong);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
}
.app-topbar img { height: 24px; }
.app-topbar span { font-weight: 700; font-size: 15px; }

.link-btn, .navbar button.link-btn {
  background: none; border: none; font-size: 14px; cursor: pointer; padding: 0;
  text-decoration: underline; color: var(--orange-deep);
}
.navbar button.link-btn { color: #EAD9C4; text-decoration: none; }

.bg-blob {
  position: fixed; border-radius: 50%; filter: blur(60px);
  z-index: 0; pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) { .bg-blob { animation: drift 16s ease-in-out infinite; } }
@keyframes drift { 0%,100% { transform: translate(0,0); } 50% { transform: translate(12px,-16px); } }

.container { max-width: 560px; margin: 0 auto; padding: 22px 16px 90px; position: relative; z-index: 1; }
.container.no-bottom-pad { padding-bottom: 22px; }

.card {
  background: var(--glass);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: 0 10px 30px -14px rgba(120,70,20,0.25);
}

.hero {
  background: linear-gradient(135deg, rgba(247,197,96,0.92), rgba(242,152,74,0.88));
  color: #4A2A0C;
  border-radius: 18px;
  padding: 18px 20px 40px;
  margin-bottom: -22px;
  position: relative; z-index: 0;
}
.hero-top { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255,255,255,0.55);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; border: 1px solid rgba(255,255,255,0.7);
}
.hero-top .greet { font-size: 12px; opacity: .85; }
.hero-top .name { font-size: 15px; font-weight: 700; }
.hero-top .role { font-size: 11.5px; opacity: .8; }
.card.floating { position: relative; z-index: 1; }

h1 { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
h2 { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
p.muted { color: var(--ink-soft); font-size: 14px; margin-bottom: 16px; }

label { display: block; font-size: 14px; font-weight: 600; margin: 14px 0 6px; color: var(--ink); }

input[type=text], input[type=password], input[type=month], select, textarea {
  width: 100%; padding: 11px 13px;
  border: 1px solid rgba(217,112,15,0.18);
  background: rgba(255,255,255,0.65);
  border-radius: 11px; font-size: 15px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange); background: rgba(255,255,255,0.9); }
textarea { resize: vertical; min-height: 60px; }

.radio-group { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.radio-option {
  border: 1px solid rgba(217,112,15,0.18);
  background: rgba(255,255,255,0.4);
  border-radius: 11px; padding: 10px 14px; cursor: pointer;
  font-size: 13.5px; font-weight: 600; color: var(--ink-soft);
  flex: 1; min-width: 100px; text-align: center; transition: all .2s ease;
}
.radio-option input { display: none; }
.radio-option:has(input:checked) {
  background: linear-gradient(135deg, var(--orange), var(--amber));
  color: #fff; border-color: transparent;
  box-shadow: 0 8px 16px -8px rgba(217,112,15,0.55);
}

button, .btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--orange), var(--orange-deep));
  color: #fff; border: none; border-radius: 11px;
  padding: 12px 18px; font-size: 15px; font-weight: 700;
  cursor: pointer; text-decoration: none; margin-top: 18px;
  box-shadow: 0 10px 20px -10px rgba(217,112,15,0.55);
}
button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
button.secondary, .btn.secondary {
  background: rgba(255,255,255,0.55); color: var(--ink);
  border: 1px solid rgba(217,112,15,0.18); box-shadow: none;
}

.alert { padding: 11px 14px; border-radius: 11px; font-size: 14px; margin-bottom: 16px; }
.alert.success { background: rgba(120,190,140,0.25); color: #27500A; }
.alert.error { background: rgba(224,120,120,0.25); color: #791F1F; }

.status-line { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 10px 12px; border-radius: 11px; background: rgba(255,255,255,0.4); margin-top: 10px; }
.status-line.ok { background: rgba(120,190,140,0.25); color: #27500A; }
.status-line .dot { width: 8px; height: 8px; border-radius: 50%; background: #C99A46; flex-shrink: 0; }
.status-line.ok .dot { background: #3F8A17; }

#selfiePreview { width: 100%; max-width: 220px; border-radius: 12px; margin-top: 10px; display: none; border: 1px solid var(--glass-border); }
.selfie-box {
  height: 110px; border-radius: 14px; margin-top: 6px;
  background: rgba(255,255,255,0.35);
  border: 1.5px dashed rgba(217,112,15,0.4);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--orange-deep); font-size: 12px; font-weight: 600; gap: 6px;
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid rgba(217,112,15,0.12); }
th { color: var(--ink-soft); font-weight: 600; font-size: 12.5px; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.badge.hadir { background: rgba(120,190,140,0.3); color: #27500A; }
.badge.izin { background: rgba(247,197,96,0.4); color: #7A4E06; }
.badge.sakit { background: rgba(224,120,120,0.3); color: #791F1F; }
.badge.cuti { background: rgba(120,160,220,0.3); color: #0C447C; }
.badge.luar_kota { background: rgba(242,152,74,0.3); color: #B85A18; }
.badge.kantor { background: rgba(150,140,120,0.25); color: #57493A; }
.badge.aktif { background: rgba(120,190,140,0.3); color: #27500A; }
.badge.nonaktif { background: rgba(150,140,120,0.25); color: #6B5A46; }

.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 16px; }
.filter-bar > div { flex: 1; min-width: 140px; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.table-wrap { overflow-x: auto; }
.thumb { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; border: 1px solid var(--glass-border); }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.stat-tile { padding: 14px 6px; text-align: center; }
.stat-tile .num { font-size: 19px; font-weight: 800; }
.stat-tile .lbl { font-size: 10.5px; color: var(--ink-soft); margin-top: 2px; }

.riwayat-row { display: flex; align-items: center; gap: 12px; }
.riwayat-date { width: 42px; text-align: center; flex-shrink: 0; }
.riwayat-date .d { font-size: 17px; font-weight: 800; color: var(--orange-deep); line-height: 1; }
.riwayat-date .m { font-size: 10px; color: var(--ink-soft); text-transform: uppercase; }
.riwayat-info { flex: 1; }
.riwayat-info .loc { font-size: 13px; font-weight: 700; }
.riwayat-info .desc { font-size: 11px; color: var(--ink-soft); }

.profil-head { text-align: center; padding: 10px 4px 4px; }
.profil-avatar {
  width: 68px; height: 68px; border-radius: 50%; margin: 0 auto 10px;
  background: linear-gradient(135deg, var(--orange), var(--amber));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 22px;
  box-shadow: 0 12px 24px -10px rgba(217,112,15,0.5);
}
.menu-item { display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.menu-item.logout-item { color: #A33636; justify-content: center; font-weight: 700; }

/* ---------- Bottom nav (karyawan pages) ---------- */
.bottom-nav-wrap { position: fixed; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; z-index: 30; padding: 0 16px; }
.bottom-nav {
  display: flex; gap: 4px; width: 100%; max-width: 420px;
  padding: 8px; border-radius: 18px;
  background: var(--glass-strong);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 14px 30px -14px rgba(120,70,20,0.35);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 0; border-radius: 12px; text-decoration: none; color: var(--ink-soft);
}
.nav-item svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.nav-item span { font-size: 10px; font-weight: 700; }
.nav-item.active { color: #fff; background: linear-gradient(135deg, var(--orange), var(--orange-deep)); }

.spinner-overlay {
  position: fixed; inset: 0; background: rgba(253,247,238,.92);
  display: none; align-items: center; justify-content: center; flex-direction: column; gap: 12px;
  z-index: 999;
}
.spinner-overlay.show { display: flex; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(217,112,15,0.15); border-top-color: var(--orange-deep); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner-overlay span { font-size: 13px; color: var(--ink-soft); }

@media (max-width: 480px) { .navbar { flex-direction: column; align-items: flex-start; } }
