:root {
  --green: #0e9f6e;
  --green-dark: #0a7a54;
  --green-deep: #075c40;
  --teal: #14b8a6;
  --mint: #e6f7f1;
  --bg: #eaf5f1;
  --bg-2: #e2f0ea;
  --ink: #12362c;
  --ink-soft: #4b6b62;
  --muted: #6d857e;
  --line: rgba(14, 90, 66, .14);
  /* ---- kaca (glassmorphism) ----
     Semua permukaan (kartu, tabel, isian, tab, kalender) memakai "kaca" yang sama:
     putih transparan lembut + blur latar + garis tepi tipis yang bercahaya. */
  --glass: rgba(255, 255, 255, .58);
  --glass-soft: rgba(255, 255, 255, .40);
  --glass-strong: rgba(255, 255, 255, .74);
  --glass-line: rgba(255, 255, 255, .78);
  --glass-blur: blur(18px) saturate(175%);
  --glass-glow: 0 0 0 1px rgba(20, 184, 166, .12), 0 0 24px rgba(20, 184, 166, .12);
  --card: var(--glass);
  --amber: #d97706;
  --amber-bg: #fef3c7;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --blue: #2563eb;
  --blue-bg: #dbeafe;
  --violet: #7c3aed;
  --violet-bg: #ede9fe;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 12px 32px rgba(8, 60, 45, .10), var(--glass-glow);
  --shadow-lg: 0 18px 48px rgba(8, 60, 45, .16), 0 0 34px rgba(20, 184, 166, .18);
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background-color: var(--bg);
  /* Latar "mesh" lembut: beberapa cahaya radial (hijau–teal–langit–violet) supaya
     efek kaca pada kartu punya sesuatu yang bisa diburamkan. Tetap terang agar
     teks gelap selalu terbaca. */
  background-image:
    radial-gradient(1100px 680px at 96% -14%, rgba(20, 184, 166, .26), transparent 62%),
    radial-gradient(900px 600px at -12% 2%, rgba(14, 159, 110, .22), transparent 62%),
    radial-gradient(820px 560px at 88% 92%, rgba(56, 189, 248, .18), transparent 66%),
    radial-gradient(720px 560px at -4% 102%, rgba(129, 140, 248, .16), transparent 64%),
    radial-gradient(680px 480px at 68% 8%, rgba(45, 212, 191, .14), transparent 66%),
    linear-gradient(165deg, #f8fdfb 0%, #eef8f4 48%, #eaf4fa 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .35em; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 .75em; }
small { font-size: .8rem; }
code { background: var(--mint); padding: 2px 6px; border-radius: 6px; font-size: .85em; }

/* ---------------- layout: karyawan (mobile first) ---------------- */
.wrap { max-width: 720px; margin: 0 auto; padding: 16px 16px 108px; }
.topbar {
  position: sticky; top: 0; z-index: 40;
  color: #fff; padding: 14px 16px; display: flex; align-items: center; gap: 12px;
  /* kaca hijau: gradien merek tetap, tetapi sedikit transparan + blur latar */
  background: linear-gradient(120deg, rgba(8, 104, 72, .93), rgba(14, 159, 110, .90) 55%, rgba(20, 184, 166, .90));
  -webkit-backdrop-filter: blur(16px) saturate(165%);
  backdrop-filter: blur(16px) saturate(165%);
  border-bottom: 1px solid rgba(255, 255, 255, .30);
  box-shadow: 0 6px 24px rgba(12, 74, 56, .20), 0 1px 0 rgba(255, 255, 255, .22) inset;
}
/* Nama apotek & nama karyawan di topbar harus muat SATU baris (permintaan pemilik).
   Tata letak ini dirancang agar penyesuaian huruf di app.js (`data-fit-line`) STABIL:
   - `.brand` memakai flex-basis 0 → lebarnya = sisa ruang, TIDAK bergantung panjang teksnya;
   - `.who` tidak menyusut (flex 0 0 auto) tetapi dibatasi `max-width`, jadi lebarnya
     tidak lagi mengecil saat huruf namanya dikecilkan (kalau menyusut, wadah dan teks
     mengecil bersamaan sehingga penyesuaian tidak pernah selesai).
   JANGAN pakai `white-space: nowrap` di sini — app.js perlu membatalkannya (inline)
   bila nama benar-benar terlalu panjang, agar teks membungkus, bukan terpotong. */
.topbar .brand { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; flex: 1 1 0; }
.topbar .brand b { font-size: .98rem; display: block; max-width: 100%; }
.topbar .brand span { font-size: .74rem; opacity: .82; }
.topbar .who {
  margin-left: auto; text-align: right; font-size: .78rem; opacity: .95;
  display: flex; flex-direction: column; align-items: stretch; min-width: 0;
  flex: 0 0 auto; max-width: 42%;
}
.topbar .who-name { display: block; max-width: 100%; }
.topbar .who-out { color: #fff; opacity: .9; font-size: .74rem; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, .22);
  display: grid; place-items: center; font-weight: 700; color: #fff; flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, .35); font-size: .9rem; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-img { background: rgba(230, 247, 241, .7); border-color: rgba(255, 255, 255, .8); }
.cell-user { display: flex; gap: 10px; align-items: center; }
.cell-user .avatar { border: 1px solid var(--line); }

/* pemilih foto (karyawan & konfigurasi apotek) */
.photo-field { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.photo-preview {
  width: 92px; height: 92px; border-radius: 22px; flex: 0 0 auto;
  background: rgba(230, 247, 241, .72); border: 1px solid rgba(255, 255, 255, .88); overflow: hidden;
  display: grid; place-items: center; font-weight: 700; color: var(--green-deep);
  font-size: 1.5rem; box-shadow: 0 0 0 1px rgba(20, 184, 166, .12), 0 8px 20px rgba(8, 60, 45, .10);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-actions { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.photo-field input[type=file] { display: none; }
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid rgba(255, 255, 255, .85);
  box-shadow: 0 -8px 28px rgba(8, 60, 45, .12), 0 0 24px rgba(20, 184, 166, .10);
  display: flex; justify-content: space-around;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.bottomnav a {
  flex: 1; text-align: center; padding: 7px 2px; font-size: .66rem; font-weight: 600;
  color: var(--muted); text-decoration: none; border-radius: 12px; line-height: 1.25;
}
.bottomnav a:hover { text-decoration: none; }
.bottomnav a.active { color: var(--green-dark); background: var(--mint); }
.bottomnav a .ic { display: block; font-size: 1.15rem; margin-bottom: 1px; }

.page-head { margin: 4px 0 18px; }
.page-head h1 { margin-bottom: 2px; }
.page-head p { color: var(--muted); margin: 0; font-size: .88rem; }

/* ---------------- layout: admin (desktop) ---------------- */
.admin { display: flex; min-height: 100vh; }
.side {
  width: 250px; flex: 0 0 250px;
  color: #eafaf3; padding: 18px 14px 40px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  /* kaca hijau tua: sisi kiri tetap gelap (kontras tinggi) namun tembus pandang lembut */
  background: linear-gradient(180deg, rgba(8, 86, 62, .94), rgba(11, 122, 87, .93) 60%, rgba(14, 141, 99, .92));
  -webkit-backdrop-filter: blur(20px) saturate(170%); backdrop-filter: blur(20px) saturate(170%);
  border-right: 1px solid rgba(255, 255, 255, .22);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, .08), 8px 0 34px rgba(8, 60, 45, .14);
}
.side .logo { display: flex; gap: 10px; align-items: center; margin-bottom: 20px; padding: 0 6px; }
.side .logo-txt { min-width: 0; flex: 1 1 auto; }        /* nama apotek boleh dipaksa satu baris oleh app.js */
.side .logo b { font-size: .98rem; display: block; color: #fff; max-width: 100%; }
.side .logo span { font-size: .7rem; opacity: .8; }
.side nav { display: flex; flex-direction: column; gap: 3px; }
.side nav .grp { font-size: .66rem; text-transform: uppercase; letter-spacing: .09em; opacity: .58; margin: 15px 0 5px; padding: 0 8px; }
.side nav a {
  color: #dff5eb; padding: 9px 11px; border-radius: 10px; font-size: .86rem; font-weight: 500;
  display: flex; gap: 9px; align-items: center; text-decoration: none;
}
.side nav a:hover { background: rgba(255, 255, 255, .1); text-decoration: none; }
.side nav a.active { background: rgba(255, 255, 255, .18); color: #fff; font-weight: 600; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.side nav a .ic { width: 18px; text-align: center; }
.main { flex: 1; min-width: 0; padding: 22px 26px 60px; }
.main > .head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.main > .head h1 { margin: 0; }
.main > .head .sub { color: var(--muted); font-size: .86rem; }
.main > .head .right { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.burger { display: none; }

/* ---------------- cards & grid (kaca: blur + transparansi + tepi bercahaya) ---------------- */
.card {
  /* kilau kaca: sedikit lebih pekat di kiri-atas, lebih bening di kanan-bawah */
  background: linear-gradient(155deg, rgba(255, 255, 255, .70), rgba(255, 255, 255, .46));
  border: 1px solid var(--glass-line);
  border-radius: 18px;
  padding: 20px; box-shadow: var(--shadow); margin-bottom: 20px;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}
.card > :last-child { margin-bottom: 0; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cards > .card { margin-bottom: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }

.stat {
  background: var(--glass); border: 1px solid var(--glass-line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
.stat .label { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.stat .value { font-size: 1.7rem; font-weight: 700; margin: 4px 0 0; letter-spacing: -.02em; }
.stat .hint { color: var(--muted); font-size: .78rem; }
.stat.green { background: linear-gradient(140deg, rgba(16, 185, 129, .18), var(--glass) 72%); }
.stat.amber { background: linear-gradient(140deg, rgba(245, 158, 11, .18), var(--glass) 72%); }
.stat.red { background: linear-gradient(140deg, rgba(239, 68, 68, .16), var(--glass) 72%); }
.stat.blue { background: linear-gradient(140deg, rgba(59, 130, 246, .16), var(--glass) 72%); }
.stat.violet { background: linear-gradient(140deg, rgba(139, 92, 246, .16), var(--glass) 72%); }

.hero {
  background: linear-gradient(135deg, var(--green-dark), var(--green) 60%, var(--teal));
  color: #fff; border-radius: var(--radius); padding: 20px; margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, .34);
  box-shadow: var(--shadow-lg);
}
.hero h2 { color: #fff; margin-bottom: 4px; }
.hero p { opacity: .9; margin: 0; font-size: .88rem; }
.hero .chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.chip {
  background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .3); color: #fff;
  padding: 6px 11px; border-radius: 999px; font-size: .78rem; font-weight: 600; backdrop-filter: blur(6px);
}
.chip.dark { background: var(--mint); color: var(--green-deep); border-color: #c9ece0; }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: linear-gradient(120deg, var(--green-dark), var(--green));
  color: #fff; border: 0; padding: 10px 16px; border-radius: 11px; font-weight: 600;
  font-size: .88rem; font-family: inherit; cursor: pointer; text-decoration: none;
  box-shadow: 0 4px 14px rgba(14, 159, 110, .24); transition: transform .06s, filter .15s;
  line-height: 1.2;
}
.btn:hover { filter: brightness(1.06); text-decoration: none; color: #fff; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn.ghost {
  background: rgba(255, 255, 255, .68); color: var(--green-dark);
  border: 1px solid rgba(255, 255, 255, .85);
  box-shadow: 0 0 0 1px rgba(20, 184, 166, .10), 0 4px 14px rgba(8, 60, 45, .08);
  -webkit-backdrop-filter: blur(10px) saturate(160%); backdrop-filter: blur(10px) saturate(160%);
}
.btn.ghost:hover { background: rgba(255, 255, 255, .92); color: var(--green-deep); }
.btn.danger { background: linear-gradient(120deg, #b91c1c, #ef4444); box-shadow: 0 4px 14px rgba(220, 38, 38, .22); }
.btn.warn { background: linear-gradient(120deg, #b45309, #f59e0b); box-shadow: none; }
.btn.dark { background: #12362c; box-shadow: none; }
.btn.sm { padding: 6px 11px; font-size: .8rem; border-radius: 9px; }
.btn.xl { padding: 18px 22px; font-size: 1.05rem; border-radius: 15px; width: 100%; }
.btn.block { width: 100%; }
.btn.pill { border-radius: 999px; }

/* ---------------- forms ---------------- */
label.field { display: block; margin-bottom: 14px; }
label.field > span.lab { display: block; font-size: .8rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 5px; }
input[type=text], input[type=password], input[type=number], input[type=email], input[type=date], input[type=time],
input[type=month], input[type=tel], input[type=search], input[type=file], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid rgba(255, 255, 255, .9); border-radius: 11px;
  font-family: inherit; font-size: .9rem; color: var(--ink); outline: none;
  background-color: rgba(255, 255, 255, .70);
  -webkit-backdrop-filter: blur(8px) saturate(150%); backdrop-filter: blur(8px) saturate(150%);
  box-shadow: 0 0 0 1px rgba(14, 90, 66, .10), inset 0 1px 0 rgba(255, 255, 255, .9);
}
input[type=file] { background-color: rgba(255, 255, 255, .55); }
input:focus, select:focus, textarea:focus {
  border-color: rgba(20, 184, 166, .75);
  box-shadow: 0 0 0 3px rgba(14, 159, 110, .16), 0 0 18px rgba(20, 184, 166, .22);
}
textarea { min-height: 90px; resize: vertical; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.form-grid { display: grid; gap: 0 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.hint { font-size: .78rem; color: var(--muted); margin-top: 4px; display: block; font-weight: 400; }

/* ---------------- tables ---------------- */
.table-wrap {
  overflow-x: auto; border: 1px solid rgba(255, 255, 255, .85); border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .46);
  -webkit-backdrop-filter: blur(12px) saturate(160%); backdrop-filter: blur(12px) saturate(160%);
  box-shadow: 0 8px 24px rgba(8, 60, 45, .08), 0 0 0 1px rgba(20, 184, 166, .08);
}
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
th { background: rgba(255, 255, 255, .62); font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); font-weight: 700; position: sticky; top: 0; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 255, 255, .58); }
td.wrap-cell { white-space: normal; min-width: 180px; }
.ta-r { text-align: right; }
.ta-c { text-align: center; }
td .actions { display: flex; gap: 6px; }

/* ---------------- badges ---------------- */
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: .74rem; font-weight: 700;
  background: var(--mint); color: var(--green-deep); white-space: nowrap;
}
.badge.gray { background: #eef2f1; color: #5b6b66; }
.badge.amber { background: var(--amber-bg); color: #92400e; }
.badge.red { background: var(--red-bg); color: #991b1b; }
.badge.blue { background: var(--blue-bg); color: #1e40af; }
.badge.violet { background: var(--violet-bg); color: #5b21b6; }
.badge.green { background: #d1fae5; color: #065f46; }

/* ---------------- alerts (kaca berwarna) ---------------- */
.alert {
  padding: 12px 15px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: .87rem;
  border: 1px solid rgba(255, 255, 255, .8);
  -webkit-backdrop-filter: blur(12px) saturate(160%); backdrop-filter: blur(12px) saturate(160%);
  box-shadow: 0 6px 20px rgba(8, 60, 45, .08);
}
.alert.ok { background: rgba(236, 253, 245, .84); color: #065f46; border-color: #a7f3d0; }
.alert.err { background: rgba(254, 242, 242, .86); color: #991b1b; border-color: #fecaca; }
.alert.warn { background: rgba(255, 251, 235, .86); color: #92400e; border-color: #fde68a; }
.alert.info { background: rgba(239, 246, 255, .86); color: #1e40af; border-color: #bfdbfe; }

/* ---------------- login ---------------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 22px; }
.login-card {
  width: 100%; max-width: 400px; padding: 30px 26px; border-radius: 24px;
  background: rgba(255, 255, 255, .58);
  -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .82);
  box-shadow: 0 22px 56px rgba(8, 60, 45, .16), 0 0 0 1px rgba(20, 184, 166, .14), 0 0 40px rgba(20, 184, 166, .18);
}
.login-card .mark { width: 60px; height: 60px; border-radius: 18px; background: linear-gradient(135deg, var(--green-dark), var(--teal)); display: grid; place-items: center; font-size: 1.7rem; margin: 0 auto 14px; box-shadow: var(--shadow); overflow: hidden; }
.login-card .mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.login-card h1 { text-align: center; font-size: 1.28rem; margin-bottom: 2px; }
.login-card .sub { text-align: center; color: var(--muted); font-size: .84rem; margin-bottom: 22px; }

/* ---------------- absen ---------------- */
.absen-clock { text-align: center; padding: 8px 0 4px; }
.absen-clock .t { font-size: 2.6rem; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.absen-clock .d { color: var(--muted); font-size: .86rem; }
.pill-status { display: inline-flex; gap: 8px; align-items: center; padding: 7px 14px; border-radius: 999px; font-size: .82rem; font-weight: 600; background: var(--mint); color: var(--green-deep); }
.pill-status.warn { background: var(--amber-bg); color: #92400e; }
.pill-status.bad { background: var(--red-bg); color: #991b1b; }
.cam-box { position: relative; width: 100%; aspect-ratio: 3 / 4; max-height: 340px; background: #0d1f19; border-radius: var(--radius-sm); overflow: hidden; display: grid; place-items: center; }
.cam-box video, .cam-box img, .cam-box canvas { width: 100%; height: 100%; object-fit: cover; }
.cam-box .placeholder { color: #9fbfb4; font-size: .82rem; text-align: center; padding: 20px; }
.selfie-thumb { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line); }
.selfie-big { width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--line); }

/* ---------------- misc ---------------- */
/* ---------------- HERO PROFIL APOTEK (dashboard admin) ---------------- */
.admin-hero {
  position: relative; overflow: hidden; border-radius: 22px;
  padding: 26px 28px; margin-bottom: 26px; color: #fff;
  background: linear-gradient(126deg, #04241a 0%, #06503a 40%, #0a7150 70%, #0b8058 100%);
  border: 1px solid rgba(255, 255, 255, .30);
  box-shadow: 0 20px 50px rgba(4, 32, 22, .38), 0 0 0 1px rgba(20, 184, 166, .28), 0 0 44px rgba(20, 184, 166, .26);
  isolation: isolate;
}
.admin-hero::before {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(620px 280px at 88% -20%, rgba(255, 255, 255, .16), transparent 70%),
    radial-gradient(520px 320px at -8% 118%, rgba(20, 184, 166, .22), transparent 72%),
    /* lapisan gelap dari kiri supaya teks putih selalu terbaca jelas */
    linear-gradient(100deg, rgba(2, 18, 12, .55) 0%, rgba(2, 18, 12, .30) 45%, rgba(2, 18, 12, 0) 78%);
}
.hero-art { position: absolute; inset: 0; z-index: 0; opacity: .22; pointer-events: none; }
.hero-art svg { width: 100%; height: 100%; display: block; }
.hero-inner { position: relative; z-index: 2; }
.hero-id { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.hero-logo {
  border: 3px solid rgba(255, 255, 255, .55); flex: 0 0 auto; overflow: hidden;
  box-shadow: 0 12px 30px rgba(2, 28, 19, .35); cursor: default;
}
.hero-text { min-width: 0; flex: 1 1 380px; }
.hero-cap {
  display: inline-flex; align-items: center; gap: 6px; font-size: .68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .16em; opacity: .92;
}
.hero-name {
  margin: 4px 0 8px; font-size: clamp(1.35rem, 2.6vw, 2rem); line-height: 1.08;
  font-weight: 800; letter-spacing: .015em; color: #fff; text-transform: uppercase;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .45), 0 1px 3px rgba(0, 0, 0, .35);
}
.hero-addr { margin: 0 0 12px; font-size: .9rem; line-height: 1.55; color: rgba(255,255,255,.96); max-width: 64ch; text-shadow: 0 1px 6px rgba(0,0,0,.4); }
.hero-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.hero-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hero-btn {
  background: rgba(255, 255, 255, .96); color: var(--green-deep) !important;
  box-shadow: 0 6px 18px rgba(2, 28, 19, .28);
}
.hero-btn:hover { background: #fff; color: var(--green-deep) !important; }
.hero-btn-ghost {
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .45);
  color: #fff !important; box-shadow: none;
}
.hero-btn-ghost:hover { background: rgba(255, 255, 255, .24); color: #fff !important; }
.hero-facts {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px;
  margin-top: 22px; position: relative;
}
.hfact {
  background: rgba(3, 26, 18, .34); border: 1px solid rgba(255, 255, 255, .26);
  border-radius: 15px; padding: 12px 14px; backdrop-filter: blur(9px) saturate(150%);
  min-width: 0; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10);
}
.hfact .k {
  display: flex; align-items: center; gap: 5px; font-size: .65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em; opacity: .93;
}
.hfact .v { display: block; font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; margin-top: 3px; line-height: 1.1; }
.hfact .s { display: block; font-size: .7rem; opacity: .86; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.hfact.ok .v { color: #b8f5d6; }
.hfact.warn .v { color: #ffe0a3; }
.hfact.bad .v { color: #ffbcbc; }
.hero-foot {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  margin-top: 16px; font-size: .76rem; color: rgba(255,255,255,.94);
  text-shadow: 0 1px 5px rgba(0,0,0,.4);
}
.hero-foot .dotsep { opacity: .5; }
.hero-foot svg { vertical-align: -2px; }

/* ---------------- judul bagian (section) ---------------- */
.section-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 30px 0 16px;
}
.section-head h2 { margin: 0; font-size: 1.06rem; display: flex; align-items: center; gap: 8px; }
.section-head .sub { color: var(--muted); font-size: .8rem; }
.section-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.main > .head { margin-bottom: 16px; }

/* ---------------- profil karyawan di beranda ---------------- */
.profile-hero {
  background: linear-gradient(140deg, #0a5f45, #0e9f6e 55%, #14b8a6);
  border-radius: 22px; padding: 22px 20px; color: #fff;
  border: 1px solid rgba(255, 255, 255, .34);
  box-shadow: 0 16px 40px rgba(10, 95, 69, .28), 0 0 0 1px rgba(20, 184, 166, .26), 0 0 38px rgba(20, 184, 166, .24);
  margin-bottom: 20px; position: relative; overflow: hidden;
}
.profile-hero::after {
  content: ''; position: absolute; right: -60px; top: -70px; width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 68%); pointer-events: none;
}
.profile-top { display: flex; gap: 18px; align-items: center; position: relative; }
.profile-hero .avatar-lg {
  border: 3px solid rgba(255, 255, 255, .6); flex: 0 0 auto;
  box-shadow: 0 10px 26px rgba(4, 40, 28, .3); background: rgba(255, 255, 255, .22);
  color: #fff; font-weight: 700; cursor: pointer; transition: transform .12s;
}
.profile-hero .avatar-lg:hover { transform: scale(1.02); }
.profile-hero .who { min-width: 0; flex: 1 1 auto; }   /* nama dapat seluruh ruang tersisa */
.profile-hero .who h2 { max-width: 100%; }
.profile-hero .small-cap {
  display: inline-flex; align-items: center; gap: 5px; font-size: .68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em; opacity: .92; margin-bottom: 5px;
}
.profile-hero .who h2 { color: #fff; margin: 0 0 3px; font-size: 1.72rem; line-height: 1.2; letter-spacing: -.01em; }
.profile-hero .who .sub { margin: 0 0 9px; font-size: .86rem; opacity: .93; }
.profile-hero .idline { display: flex; gap: 7px; flex-wrap: wrap; }
.chip.mini { padding: 4px 9px; font-size: .71rem; display: inline-flex; align-items: center; gap: 4px; }
.admin-hero .chip.mini {
  background: rgba(3, 26, 18, .40); border-color: rgba(255, 255, 255, .30); color: #fff;
  backdrop-filter: blur(6px);
}
.profile-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 20px; position: relative; }
.fact {
  background: rgba(255, 255, 255, .15); border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 14px; padding: 11px 13px; backdrop-filter: blur(6px); min-width: 0;
}
.fact .k { display: flex; align-items: center; gap: 5px; font-size: .67rem; text-transform: uppercase; letter-spacing: .05em; opacity: .9; font-weight: 700; }
.fact .v { display: block; font-size: 1.02rem; font-weight: 700; margin-top: 3px; }
.fact .s { display: block; font-size: .72rem; opacity: .85; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; }
/* Hari libur / tidak dijadwalkan (jadwal admin): keempat kartu fakta berlatar merah */
.fact.red {
  background: linear-gradient(140deg, rgba(190, 22, 40, .93), rgba(127, 29, 29, .95));
  border-color: rgba(255, 205, 205, .55);
}
.fact.red .k { opacity: 1; color: #ffe4e4; }
.fact.red .v { color: #fff; }
.fact.red .s { opacity: .95; color: #ffe9e9; }

.data-grid { display: grid; gap: 0 24px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.data-grid .kv { gap: 14px; }
.data-grid .kv b { text-align: right; }

/* ---------------- kartu profil apotek (dashboard admin) ---------------- */
.pharm-profile { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.pharm-profile .avatar { flex: 0 0 auto; }
.pharm-info { flex: 1 1 320px; min-width: 0; max-width: 640px; }
.pharm-info .pharm-name { margin: 0 0 4px; font-size: 1.14rem; }
.pharm-info .kv b { text-align: right; }
.pharm-info .kv { gap: 16px; }

/* ---------------- papan pengumuman di beranda karyawan ---------------- */
.ann-card { border-left: 4px solid var(--green); background: linear-gradient(150deg, rgba(242, 253, 248, .72), rgba(255, 255, 255, .54) 60%); }
.ann-card.urgent { border-left-color: var(--amber); background: linear-gradient(150deg, rgba(255, 250, 240, .76), rgba(255, 255, 255, .54) 60%); }
.anns { display: flex; flex-direction: column; gap: 10px; }
.ann {
  border: 1px solid rgba(255, 255, 255, .82); border-radius: 13px; overflow: hidden;
  background: rgba(255, 255, 255, .46);
  -webkit-backdrop-filter: blur(10px) saturate(150%); backdrop-filter: blur(10px) saturate(150%);
}
.ann.penting { border-color: rgba(252, 211, 77, .8); background: rgba(255, 253, 246, .72); }
.ann > summary {
  list-style: none; cursor: pointer; padding: 12px 14px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600;
}
.ann > summary::-webkit-details-marker { display: none; }
.ann > summary::after { content: '▾'; margin-left: auto; color: var(--muted); font-size: .8rem; transition: transform .15s; }
.ann[open] > summary::after { transform: rotate(180deg); }
.ann > summary:hover { background: rgba(255, 255, 255, .55); }
.ann .ann-ttl { font-size: .92rem; flex: 1 1 auto; min-width: 0; }
.ann .ann-date { font-size: .74rem; color: var(--muted); font-weight: 500; white-space: nowrap; }
.ann-body {
  padding: 0 14px 12px; font-size: .87rem; color: var(--ink-soft);
  white-space: pre-wrap; word-break: break-word; line-height: 1.6;
}
.ann-meta { padding: 0 14px 12px; font-size: .74rem; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 9px; }

/* foto diperbesar */
/* Peta lokasi absen (halaman admin "Absensi Hari Ini") */
/* Bukti pembayaran pada slip gaji karyawan (diunggah admin/HR) */
.bukti-gambar { width: 100%; max-width: 420px; border: 1px solid var(--line); border-radius: 14px; display: block; cursor: zoom-in; background: var(--bg-2); }
.bukti-aksi { margin-top: 12px; }

.map-frame {
  width: 100%; height: 180px; border: 1px solid rgba(255, 255, 255, .85); border-radius: 12px;
  display: block; background: rgba(255, 255, 255, .45);
  box-shadow: 0 8px 22px rgba(8, 60, 45, .08);
}
.map-empty {
  display: flex; align-items: center; gap: 8px; height: 96px; padding: 0 14px;
  border: 1px dashed rgba(14, 90, 66, .22); border-radius: 12px;
  background: rgba(255, 255, 255, .42); color: var(--muted); font-size: .82rem;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
/* Foto selfie di halaman pantauan absen dibuat LEBIH BESAR (kelas tersendiri supaya
   ukuran thumbnail 40px di tabel lain tidak ikut berubah) & jelas bisa diklik. */
.selfie-view { width: 88px; height: 88px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); cursor: zoom-in; background: var(--bg-2); }
.selfie-view:hover { filter: brightness(1.05); }

.photo-overlay {
  position: fixed; inset: 0; z-index: 200; background: rgba(6, 30, 22, .82);
  backdrop-filter: blur(6px); display: grid; place-items: center; padding: 22px; cursor: zoom-out;
}
.photo-overlay img { max-width: min(92vw, 460px); max-height: 82vh; border-radius: 20px; box-shadow: 0 24px 60px rgba(0, 0, 0, .5); }
.photo-overlay .cap { color: #fff; font-size: .84rem; margin-top: 12px; text-align: center; opacity: .9; }

.list { display: flex; flex-direction: column; gap: 12px; }
.item {
  display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px;
  border: 1px solid rgba(255, 255, 255, .82); border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .50);
  -webkit-backdrop-filter: blur(12px) saturate(160%); backdrop-filter: blur(12px) saturate(160%);
  box-shadow: 0 6px 20px rgba(8, 60, 45, .06), 0 0 0 1px rgba(20, 184, 166, .07);
}
.item .ic-sq { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--mint); color: var(--green-deep); font-size: 1.05rem; flex: 0 0 auto; }
.item .body { min-width: 0; flex: 1; }
.item .body b { display: block; font-size: .9rem; }
.item .body small { color: var(--muted); }
.item .meta { margin-left: auto; text-align: right; font-size: .78rem; color: var(--muted); white-space: nowrap; }
/* versi RINGKAS untuk kartu "Jadwal Karyawan Hari Ini" (permintaan pemilik:
   jangan terlalu besar) — SATU baris per karyawan: avatar kecil + nama + shift +
   penanda kehadiran. Divisi/jabatan dipindah ke tooltip supaya baris tetap pendek. */
.list.compact { gap: 0; }
.list.compact .item { padding: 7px 8px; gap: 9px; align-items: center; border: 0; border-bottom: 1px dashed var(--line); border-radius: 0; background: transparent; }
.list.compact .item:last-child { border-bottom: 0; }
/* Satu baris penuh per karyawan di layar lebar: nama tidak pernah dipotong lebih dulu,
   keterangan shift yang mengalah (dipotong dengan …) supaya tinggi kartu tetap seragam.
   Teks lengkapnya tetap ada di tooltip baris. */
.list.compact .item .body { display: flex; align-items: baseline; gap: 2px 8px; flex-wrap: nowrap; }
.list.compact .item .body b { font-size: .82rem; display: inline-block; flex: 0 0 auto; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list.compact .item .body small { font-size: .7rem; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list.compact .item .meta { font-size: .68rem; }
.list.compact .item .meta .badge { padding: 2px 8px; font-size: .64rem; }
.list.compact .item.off { opacity: .72; }
@media (max-width: 620px) {
  /* di HP: NAMA dapat satu baris penuh, keterangan shift & penanda kehadiran berbagi
     baris kedua — supaya nama tetap utuh terbaca tapi kartu tidak jadi tinggi.
     Avatar disembunyikan di HP (foto tetap terlihat di kartu lain). */
  .list.compact .item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 8px; padding: 5px 6px; }
  .list.compact .item > .avatar { display: none; }
  .list.compact .item .body { display: contents; }
  .list.compact .item .body b { grid-column: 1 / -1; grid-row: 1; line-height: 1.25; }
  .list.compact .item .body small { grid-column: 1; grid-row: 2; min-width: 0; }
  .list.compact .item .meta { grid-column: 2; grid-row: 2; margin-left: 0; text-align: right; }
  /* keterangan panjang disembunyikan di HP (tautan ke Jadwal & Shift sudah ada di kepala kartu) */
  .sched-note { display: none; }
}
.empty { text-align: center; padding: 34px 18px; color: var(--muted); font-size: .88rem; }
.empty .ic { font-size: 2rem; display: block; margin-bottom: 8px; opacity: .55; }
.progress { height: 9px; border-radius: 999px; background: var(--bg-2); overflow: hidden; margin: 8px 0; }
.progress > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--green), var(--teal)); }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: .88rem; border-bottom: 1px dashed var(--line); }
.kv:last-child { border-bottom: 0; }
.kv b { font-variant-numeric: tabular-nums; }
.kv.total { font-size: 1rem; border-top: 2px solid var(--green); border-bottom: 0; margin-top: 6px; padding-top: 10px; }
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.tiny { font-size: .76rem; }
.center { text-align: center; }
.mb0 { margin-bottom: 0 !important; }
.mt0 { margin-top: 0 !important; }
.hidden { display: none !important; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a {
  padding: 7px 13px; border-radius: 999px; font-size: .82rem; font-weight: 600; color: var(--ink-soft);
  background: rgba(255, 255, 255, .50); border: 1px solid rgba(255, 255, 255, .84);
  -webkit-backdrop-filter: blur(10px) saturate(150%); backdrop-filter: blur(10px) saturate(150%);
  box-shadow: 0 4px 14px rgba(8, 60, 45, .06);
}
.tabs a:hover { text-decoration: none; background: rgba(255, 255, 255, .82); }
.tabs a.active { background: linear-gradient(120deg, var(--green-dark), var(--green)); color: #fff; border-color: rgba(255, 255, 255, .5); box-shadow: 0 6px 18px rgba(14, 159, 110, .28); }

.cal-scroll { overflow-x: auto; padding-bottom: 4px; }
/* minmax: di desktop kolom mengisi penuh; di layar sempit kalender bisa digeser
   mendatar (bukan mengecil sampai nama karyawan tidak terbaca). */
.cal { display: grid; grid-template-columns: repeat(7, minmax(112px, 1fr)); gap: 6px; min-width: 800px; }
.cal .dow { text-align: center; font-size: .7rem; font-weight: 700; color: var(--muted); text-transform: uppercase; padding: 4px 0; }
.cal .day {
  border: 1px solid rgba(255, 255, 255, .84); border-radius: 10px; padding: 7px 6px;
  min-height: 66px; font-size: .74rem;
  background: rgba(255, 255, 255, .48);
  -webkit-backdrop-filter: blur(8px) saturate(150%); backdrop-filter: blur(8px) saturate(150%);
}
.cal .day.off { background: rgba(247, 250, 249, .55); color: var(--muted); }
.cal .day .n { font-weight: 700; font-size: .84rem; }
.cal .day.hd { border-color: rgba(252, 165, 165, .85); background: rgba(255, 241, 242, .68); }
/* SEMUA nama karyawan harus terbaca: tag boleh turun baris, tidak dipotong */
.cal .day .tag { display: block; margin-top: 4px; font-size: .66rem; font-weight: 700; line-height: 1.3; white-space: normal; overflow-wrap: anywhere; }

.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding: 8px 2px 0; }
.bar-chart .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 6px; }
.bar-chart .col .stackb { width: 100%; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; gap: 2px; }
.bar-chart .col .b { border-radius: 6px 6px 3px 3px; min-height: 2px; }
.bar-chart .col .b.hadir { background: linear-gradient(180deg, #10b981, #059669); }
.bar-chart .col .b.telat { background: linear-gradient(180deg, #fbbf24, #d97706); }
.bar-chart .col .b.alpa { background: linear-gradient(180deg, #f87171, #dc2626); }
.bar-chart .col .b.izin { background: linear-gradient(180deg, #60a5fa, #2563eb); }
.bar-chart .col span { font-size: .68rem; color: var(--muted); }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.dot.green { background: var(--green); }
.dot.amber { background: var(--amber); }
.dot.red { background: var(--red); }
.dot.gray { background: #b6c4c0; }

/* ---------------- slip gaji (karyawan & admin) ---------------- */
.slip {
  background: rgba(255, 255, 255, .74); border: 1px solid rgba(255, 255, 255, .86);
  border-radius: var(--radius); padding: 24px;
  -webkit-backdrop-filter: blur(16px) saturate(170%); backdrop-filter: blur(16px) saturate(170%);
  box-shadow: 0 14px 40px rgba(8, 60, 45, .10), 0 0 0 1px rgba(20, 184, 166, .10);
}
.slip .head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; border-bottom: 2px solid var(--green); padding-bottom: 14px; margin-bottom: 16px; }
.slip .brand { display: flex; gap: 12px; align-items: center; flex: 1 1 210px; min-width: 0; }
.slip .brand-txt { min-width: 0; }
.slip .brand-txt h2 { margin: 0; font-size: 1.1rem; line-height: 1.25; overflow-wrap: anywhere; }
.slip .brand-txt small { display: block; overflow-wrap: anywhere; }
.slip .slip-title { margin-left: auto; text-align: right; flex: 0 0 auto; }
.slip .slip-title b { display: block; letter-spacing: .06em; }
.slip .emp { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.slip .emp .emp-txt { min-width: 0; }
.slip .emp .emp-txt b { overflow-wrap: anywhere; }
/* label boleh turun baris, nominal uang tetap SATU baris supaya kolom rapi */
.slip .kv { align-items: baseline; }
.slip .kv > span { flex: 1 1 auto; min-width: 0; }
.slip .kv > b { flex: 0 0 auto; white-space: nowrap; }

/* slip di layar HP: satu kolom agar label & nominal tidak berdesakan */
@media (max-width: 620px) {
  .slip { padding: 16px 14px; border-radius: 14px; }
  .slip .head { gap: 10px; padding-bottom: 12px; margin-bottom: 14px; }
  .slip .slip-title { flex: 1 1 100%; margin-left: 0; text-align: left; border-top: 1px dashed var(--line); padding-top: 9px; }
  .slip .grid.cols-2 { grid-template-columns: 1fr; gap: 0; }
  .slip h3 { font-size: .95rem; margin: 12px 0 6px; }
  .slip .kv { font-size: .84rem; padding: 6px 0; }
  .slip .kv.total { font-size: .9rem; }
  .slip .kv.total > span { font-size: .76rem; letter-spacing: .02em; }
}

@media (max-width: 1100px) {
  .hero-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .admin { flex-direction: column; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; z-index: 90; transform: translateX(-102%); transition: transform .22s ease; height: 100vh; width: 258px; flex-basis: auto; }
  body.nav-open .side { transform: translateX(0); box-shadow: 0 0 0 100vmax rgba(6, 40, 30, .45); }
  .main { padding: 14px 14px 60px; }
  .burger {
    display: inline-flex; position: sticky; top: 10px; z-index: 60;
    background: rgba(255, 255, 255, .72); border: 1px solid rgba(255, 255, 255, .9);
    border-radius: 11px; padding: 8px 12px; font-weight: 700; color: var(--green-dark);
    box-shadow: 0 8px 22px rgba(8, 60, 45, .12), 0 0 0 1px rgba(20, 184, 166, .10);
    -webkit-backdrop-filter: blur(14px) saturate(170%); backdrop-filter: blur(14px) saturate(170%);
  }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .profile-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .data-grid { grid-template-columns: 1fr; }
  .admin-hero { padding: 20px 18px; border-radius: 20px; }
  .hero-id { gap: 14px; }
  .hero-actions { margin-left: 0; width: 100%; }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
  .hero-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .hfact .v { font-size: 1.3rem; }
  .hero-name { letter-spacing: .01em; }
  .section-head { margin: 22px 0 12px; }
  .section-head .sub { display: none; }
}
@media (max-width: 620px) {
  .grid.cols-4, .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .profile-hero { padding: 18px 15px; border-radius: 20px; }
  /* Di HP nama karyawan dibuat BARIS PENUH di atas kartu supaya bisa tampil besar dan
     tetap SATU baris (permintaan pemilik) — foto tetap besar 88px di kiri, keterangan
     (jabatan, ID, tanggal) di kanannya. Tata letak ini hanya berlaku di layar sempit. */
  .profile-top { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 3px 12px; }
  .profile-hero .who { display: contents; }
  .profile-hero .who h2 { grid-row: 1; grid-column: 1 / -1; margin: 0 0 6px; }
  /* foto 88px seperti rancangan awal di layar sempit → kolom keterangan tetap lega */
  .profile-hero .avatar-lg { grid-row: 2 / 5; grid-column: 1; align-self: center; width: 88px !important; height: 88px !important; border-radius: 24px !important; }
  .profile-hero .small-cap { grid-row: 2; grid-column: 2; margin-bottom: 0; }
  .profile-hero .who .sub { grid-row: 3; grid-column: 2; margin: 0; }
  .profile-hero .idline { grid-row: 4; grid-column: 2; }
  .profile-hero .who h2 { font-size: 1.5rem; }
  .profile-facts { gap: 10px; margin-top: 16px; }
  .fact { padding: 10px 11px; }
  .fact .v { font-size: .96rem; }
  .grid.cols-2 > .card { grid-column: span 2; }
  .card { padding: 16px; }
  h1 { font-size: 1.28rem; }
  .cal .day { min-height: 56px; padding: 5px; }
}

/* ---------------- tunjangan di Edit Payroll (dicentang & diisi per karyawan) ----------------
   Permintaan pemilik: daftar jenis tunjangan dibuat di Pengaturan, lalu tinggal dicentang
   & diisi per karyawan. Tiap baris = satu jenis tunjangan. */
.alw-box {
  border: 1px solid rgba(255, 255, 255, .86); border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .46); padding: 12px 13px; margin: 4px 0 14px;
  -webkit-backdrop-filter: blur(10px) saturate(150%); backdrop-filter: blur(10px) saturate(150%);
  box-shadow: 0 6px 18px rgba(8, 60, 45, .06);
}
.alw-box-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin-bottom: 8px; flex-wrap: wrap;
}
.alw-box-head b { font-size: .95rem; }
.alw-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0; border-bottom: 1px dashed var(--line);
}
.alw-row:last-of-type { border-bottom: 0; }
.alw-check { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; cursor: pointer; }
.alw-check input[type="checkbox"] { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--green); }
.alw-check span { overflow: hidden; text-overflow: ellipsis; }
.alw-row .alw-amount { flex: 0 0 140px; width: 140px; text-align: right; }
.alw-row .alw-name { flex: 1 1 auto; min-width: 0; }
@media (max-width: 620px) {
  .alw-row { flex-wrap: wrap; }
  .alw-row .alw-amount { flex: 1 1 100%; width: 100%; text-align: left; }
}
/* tabel daftar jenis tunjangan di halaman Pengaturan */
.alw-types td { vertical-align: middle; }
.alw-types input[type="text"], .alw-types input[type="number"], .alw-types select { margin: 0; }

/* ---------------- unduh berkas (tombol "Unduh PDF" slip gaji) ----------------
   Pesan status unduhan: menjelaskan hasilnya di layar (bukan alert), penting untuk
   HP/browser dalam aplikasi yang memblokir unduhan otomatis. */
.dl-msg:empty { display: none; }
.dl-msg { min-height: 1lh; line-height: 1.45; color: var(--muted); }
.dl-msg.good { color: var(--green-dark); font-weight: 600; }
.dl-msg.bad { color: var(--red); font-weight: 600; }
.btn[aria-busy="true"] { opacity: .55; pointer-events: none; }

/* Slip sebagai GAMBAR: jalur cadangan yang tidak bisa diblokir browser HP —
   gambar yang sudah tampil cukup ditekan-lama lalu "Simpan gambar". */
.slip-gambar > summary {
  cursor: pointer; font-weight: 600; font-size: .86rem; color: var(--green-dark);
  padding: 9px 12px; border: 1px solid rgba(255, 255, 255, .85); border-radius: 11px;
  background: rgba(255, 255, 255, .58);
  -webkit-backdrop-filter: blur(10px) saturate(150%); backdrop-filter: blur(10px) saturate(150%);
  list-style: none;
}
.slip-gambar > summary::-webkit-details-marker { display: none; }
.slip-gambar > summary::before { content: "▸ "; }
.slip-gambar[open] > summary::before { content: "▾ "; }
.slip-img {
  display: block; width: 100%; height: auto; margin-top: 4px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: default;
}

/* ---------------------------------------------------------------------------
   TRANSISI HALAMAN — fade + slide halus saat berpindah rute.
   Aplikasi ini server-rendered (tiap rute = dokumen baru), jadi animasi masuk
   dipasang pada wadah isi halaman. Durasinya pendek (≤ 380 ms) agar terasa
   halus, tidak memperlambat. Wadah yang dianimasikan HANYA .wrap/.main/.login-card
   (bukan body) supaya tidak mengganggu elemen position:fixed di dalamnya.
--------------------------------------------------------------------------- */
@keyframes tyaPageIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.wrap, .main { animation: tyaPageIn .34s cubic-bezier(.22, .61, .36, 1); }
.login-card { animation: tyaPageIn .38s cubic-bezier(.22, .61, .36, 1); }

/* ---------------------------------------------------------------------------
   LOADING SPLASH (full screen, logo apotek berdenyut)
   Ditampilkan HANYA pada pemuatan pertama dalam satu sesi (penanda
   sessionStorage di layout). pointer-events:none → tidak pernah menghalangi
   klik, dan ada animasi cadangan CSS yang menyembunyikannya sendiri bila
   JavaScript gagal berjalan.
--------------------------------------------------------------------------- */
.splash {
  position: fixed; inset: 0; z-index: 600; display: grid; place-items: center;
  overflow: hidden; pointer-events: none; opacity: 1;
  transition: opacity .40s ease, visibility .40s ease;
  background-image:
    radial-gradient(920px 620px at 82% -8%, rgba(20, 184, 166, .40), transparent 62%),
    radial-gradient(760px 560px at 6% 108%, rgba(14, 159, 110, .30), transparent 64%),
    radial-gradient(620px 480px at 100% 100%, rgba(56, 189, 248, .20), transparent 66%),
    linear-gradient(160deg, #f6fcf9 0%, #eaf5f1 50%, #e6f1f8 100%);
  animation: splashAutoHide .01s linear 2.6s forwards;
}
.splash::after {
  content: ''; position: absolute; inset: -18%;
  background: conic-gradient(from 200deg at 50% 50%, rgba(255, 255, 255, .65), transparent 52%, rgba(20, 184, 166, .20));
  filter: blur(70px); opacity: .9;
}
.splash-inner { position: relative; display: grid; justify-items: center; gap: 14px; padding: 26px; text-align: center; }
.splash-mark {
  width: 104px; height: 104px; border-radius: 30px; display: grid; place-items: center;
  font-size: 2.8rem; overflow: hidden;
  background: linear-gradient(140deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .52));
  border: 1px solid rgba(255, 255, 255, .92);
  animation: splashPulse 1.5s ease-in-out infinite;
}
.splash-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.splash-name {
  font-weight: 800; font-size: 1rem; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink); max-width: 78vw;
}
.splash-sub { font-size: .7rem; color: var(--muted); letter-spacing: .2em; text-transform: uppercase; }
.splash-bar { width: 136px; height: 4px; border-radius: 999px; background: rgba(14, 90, 66, .14); overflow: hidden; }
.splash-bar i {
  display: block; height: 100%; width: 42%; border-radius: 999px;
  background: linear-gradient(90deg, var(--green), var(--teal));
  animation: splashSlide 1.1s ease-in-out infinite;
}
/* penanda: jangan pernah tampilkan splash (sudah pernah dimuat / JS mati) */
.splash-skip .splash { display: none !important; }
.splash-hide { opacity: 0; visibility: hidden; }
@keyframes splashPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 16px 40px rgba(8, 60, 45, .18), 0 0 0 1px rgba(20, 184, 166, .20), 0 0 30px rgba(20, 184, 166, .30); }
  50% { transform: scale(1.08); box-shadow: 0 22px 54px rgba(8, 60, 45, .22), 0 0 0 1px rgba(20, 184, 166, .34), 0 0 54px rgba(20, 184, 166, .52); }
}
@keyframes splashSlide { 0% { transform: translateX(-110%); } 100% { transform: translateX(260%); } }
@keyframes splashAutoHide { to { opacity: 0; visibility: hidden; } }

@media (prefers-reduced-motion: reduce) {
  .wrap, .main, .login-card, .splash, .splash-mark, .splash-bar i { animation: none !important; }
  .splash { transition: none; }
}

/* ---------------------------------------------------------------------------
   CETAK (print) — ditempatkan PALING AKHIR berkas dengan sengaja.
   Media query TIDAK menambah specificity, jadi kalau blok ini ditulis lebih awal,
   aturan responsif seperti `@media (max-width:860px) { .main { padding:14px } }`
   ikut menang saat mencetak (lebar kertas A4 = 794px < 860px) → slip jadi menyempit
   dan hasil PDF-nya tidak penuh. Karena itu: di akhir berkas + !important.
--------------------------------------------------------------------------- */
@media print {
  @page { size: A4; margin: 12mm; }
  html, body { background: #fff !important; }
  body { margin: 0 !important; padding: 0 !important; font-size: 12px; }
  /* kaca & animasi tidak relevan di kertas: matikan blur, kembalikan latar putih */
  .splash { display: none !important; }
  .wrap, .main, .login-card { animation: none !important; }
  .card, .stat, .item, .slip, .table-wrap, .ann, .alw-box, .tabs a, th, td, input, select, textarea {
    -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  }
  .card, .stat, .item, .table-wrap, .ann, .alw-box, .slip { background: #fff !important; }
  .admin-hero { background: #fff !important; color: #12362c; box-shadow: none; border: 1px solid #ddd; }
  .admin-hero .hero-art, .admin-hero::before { display: none; }
  .admin-hero .hero-name, .admin-hero .hfact .v { color: #12362c !important; }
  .side, .bottomnav, .topbar, .burger, .no-print, .page-head, .alert, .main > .head .right { display: none !important; }
  .admin { display: block !important; padding: 0 !important; margin: 0 !important; }
  .main { display: block !important; padding: 0 !important; margin: 0 !important; }
  .wrap { padding: 0 !important; max-width: none !important; margin: 0 !important; }
  .main > .head { margin: 0 0 10px !important; }
  .card { box-shadow: none; border: 1px solid #ddd; }
  /* slip mengisi penuh lembar cetak, tanpa bingkai/tepian layar */
  .slip { box-shadow: none; border: 0; border-radius: 0; padding: 0 !important; max-width: none !important;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .slip .avatar, .slip .kv.total { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .slip .head { padding-bottom: 10px; margin-bottom: 12px; }
  .slip .kv { padding: 5px 0; }
  .slip .kv.total { border-top: 2px solid #000; }
  .slip .kv, .slip .emp, .slip h3 { break-inside: avoid; page-break-inside: avoid; }
  .divider { margin: 12px 0; }
  a { color: inherit; text-decoration: none; }
}
