/* PT. Jaya Sakti Selawase - Sistem Absensi
   Palet dari logo: indigo + emas bintang, dasar putih */
:root {
  --indigo-950: #15174d;
  --indigo-900: #1f2166;
  --indigo-800: #292c7e;
  --indigo-700: #2f3290;
  --indigo-600: #3d41a6;
  --indigo-500: #5659bd;
  --indigo-400: #7a7dc8;
  --indigo-200: #c9cbec;
  --indigo-100: #e8e9f7;
  --indigo-50: #f4f5fc;
  --gold: #f2a900;
  --gold-600: #d99700;
  --gold-soft: #fff4d6;
  --ink: #1b1d3a;
  --ink-2: #44476a;
  --muted: #6f7392;
  --line: #e6e7f2;
  --bg: #f6f7fc;
  --card: #ffffff;
  --ok: #138a45; --ok-bg: #e5f6ec;
  --warn: #a8570a; --warn-bg: #fff1d0;
  --bad: #c22626; --bad-bg: #fdeaea;
  --r: 14px;
  --r-sm: 10px;
  --sh-1: 0 1px 2px rgba(21, 23, 77, .05);
  --sh-2: 0 1px 2px rgba(21, 23, 77, .04), 0 10px 30px rgba(21, 23, 77, .07);
  --side: 264px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-gutter: stable; } /* ruang scrollbar tetap: header tidak 'bergeser' antar halaman */
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 14.5px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--indigo-700); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; color: var(--indigo-950); letter-spacing: -.01em; }
h1 { font-size: 1.55rem; font-weight: 800; }
h2 { font-size: 1.05rem; font-weight: 700; }
h3 { font-size: .95rem; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.right { text-align: right; }
.ic { width: 18px; height: 18px; flex: none; }
.ic.lg { width: 22px; height: 22px; }
:focus-visible { outline: 2px solid var(--indigo-500); outline-offset: 2px; }

/* ================= Shell admin ================= */
.shell { display: flex; min-height: 100vh; }
.side { position: fixed; inset: 0 auto 0 0; width: var(--side); background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 40; transition: transform .25s ease; }
.side-brand { padding: 1.25rem 1.25rem 1rem; display: flex; align-items: center; gap: .75rem; }
.side-brand img { width: 62px; height: auto; }
.side-brand b { display: block; color: var(--indigo-900); font-size: .95rem; line-height: 1.2; }
.side-brand small { color: var(--muted); font-size: .7rem; letter-spacing: .1em; font-weight: 600; }
.side-nav { padding: .5rem .85rem; flex: 1; overflow-y: auto; }
.nav-label { padding: 1rem .75rem .4rem; font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.nav-item { display: flex; align-items: center; gap: .75rem; padding: .65rem .8rem; margin-bottom: 2px; border-radius: 10px; color: var(--ink-2); font-weight: 600; position: relative; }
.nav-item:hover { background: var(--indigo-50); text-decoration: none; color: var(--indigo-800); }
.nav-item.active { background: var(--indigo-100); color: var(--indigo-800); }
.nav-item.active::before { content: ""; position: absolute; left: -.85rem; top: 22%; bottom: 22%; width: 4px; border-radius: 0 4px 4px 0; background: var(--gold); }
.side-foot { padding: .9rem; border-top: 1px solid var(--line); display: flex; align-items: center; gap: .7rem; }
.side-foot .who { min-width: 0; flex: 1; }
.side-foot .who b { display: block; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .who span { font-size: .75rem; color: var(--muted); }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--bad-bg); color: var(--bad); border-color: #f3c6c6; }
.main { margin-left: var(--side); flex: 1; min-width: 0; }
.mobilebar { display: none; position: sticky; top: 0; z-index: 30; background: #fff; border-bottom: 1px solid var(--line); padding: .6rem 1rem; align-items: center; gap: .75rem; }
.mobilebar img { height: 34px; }
.mobilebar .icon-btn:hover { background: var(--indigo-50); color: var(--indigo-800); border-color: var(--line); }
.scrim { display: none; position: fixed; inset: 0; background: rgba(21, 23, 77, .45); z-index: 35; }
.content { max-width: 1180px; margin: 0 auto; padding: 2rem 2rem 3rem; }
@media (max-width: 960px) {
  .side { transform: translateX(-100%); }
  .side.open { transform: none; box-shadow: var(--sh-2); }
  .side.open + .scrim { display: block; }
  .main { margin-left: 0; }
  .mobilebar { display: flex; }
  .content { padding: 1.25rem 1rem 3rem; }
}

/* ================= Shell karyawan ================= */
.ebar { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.ebar-in { max-width: 760px; margin: 0 auto; padding: .6rem 1rem; display: flex; align-items: center; gap: .75rem; }
.ebar img { height: 36px; }
.ebar .grow { flex: 1; min-width: 0; }
.ebar .grow b { display: block; font-size: .9rem; color: var(--indigo-900); line-height: 1.2; }
.ebar .grow span { font-size: .7rem; color: var(--muted); letter-spacing: .08em; font-weight: 600; }
.econtent { max-width: 760px; margin: 0 auto; padding: 1.25rem 1rem 6.5rem; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line); display: flex; justify-content: center; padding: .35rem .5rem calc(.35rem + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(21, 23, 77, .05); }
.tabbar-in { display: flex; width: 100%; max-width: 520px; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .45rem; border-radius: 12px; color: var(--muted); font-size: .72rem; font-weight: 700; }
.tab:hover { text-decoration: none; color: var(--indigo-700); }
.tab.active { color: var(--indigo-700); background: var(--indigo-50); }
.tab .ic { width: 22px; height: 22px; }

/* ================= Komponen umum ================= */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head .sub { color: var(--muted); margin-top: .25rem; }
.head-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1); padding: 1.4rem; }
.card + .card { margin-top: 1rem; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.grid { display: grid; gap: 1rem; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.cols-3-2 { display: grid; gap: 1rem; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
@media (max-width: 1000px) { .cols-3-2 { grid-template-columns: 1fr; } }

.stat { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.25rem; }
.stat .ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--indigo-100); color: var(--indigo-700); }
.stat.green .ico { background: var(--ok-bg); color: var(--ok); }
.stat.gold .ico { background: var(--gold-soft); color: var(--warn); }
.stat.red .ico { background: var(--bad-bg); color: var(--bad); }
.stat .ico .ic { width: 24px; height: 24px; }
.stat .n { font-size: 1.85rem; font-weight: 800; color: var(--indigo-950); line-height: 1.05; }
.stat .l { color: var(--muted); font-size: .8rem; font-weight: 600; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .62rem 1.15rem; border-radius: var(--r-sm); border: 1px solid transparent; font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; background: var(--indigo-700); color: #fff; transition: background .15s, box-shadow .15s, transform .05s; box-shadow: 0 1px 2px rgba(31, 33, 102, .25); }
.btn:hover { background: var(--indigo-900); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { background: #d3d4e6; color: #fff; cursor: not-allowed; box-shadow: none; }
.btn-ghost { background: #fff; color: var(--indigo-800); border-color: var(--line); box-shadow: var(--sh-1); }
.btn-ghost:hover { background: var(--indigo-50); }
.btn-gold { background: var(--gold); color: #3a2700; box-shadow: 0 1px 2px rgba(217, 151, 0, .4); }
.btn-gold:hover { background: var(--gold-600); }
.btn-danger { background: #fff; color: var(--bad); border-color: #f1c5c5; box-shadow: none; }
.btn-danger:hover { background: var(--bad-bg); }
.btn-sm { padding: .38rem .75rem; font-size: .82rem; }
.btn-block { width: 100%; }
.btn-xl { padding: 1.05rem; font-size: 1.05rem; border-radius: 14px; }
.btn .ic { width: 17px; height: 17px; }

.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .65rem; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--indigo-100); color: var(--indigo-700); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.plain::before { display: none; }

.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; background: linear-gradient(135deg, var(--indigo-600), var(--indigo-400)); color: #fff; font-weight: 700; font-size: .8rem; letter-spacing: .03em; }
.avatar.lg { width: 44px; height: 44px; font-size: .95rem; }
.person { display: flex; align-items: center; gap: .75rem; }
.person b { display: block; line-height: 1.25; }
.person > div > span { font-size: .78rem; color: var(--muted); }

.alert { display: flex; align-items: center; gap: .6rem; padding: .8rem 1rem; border-radius: var(--r-sm); margin-bottom: 1.25rem; font-weight: 600; }
.alert.success { background: var(--ok-bg); color: var(--ok); }
.alert.error { background: var(--bad-bg); color: var(--bad); }

/* ================= Form ================= */
label { display: block; font-weight: 600; margin-bottom: .35rem; font-size: .85rem; color: var(--ink-2); }
input[type=text], input[type=password], input[type=number], input[type=time], input[type=date], input[type=month], input[type=search], select, textarea {
  width: 100%; padding: .68rem .85rem; border: 1px solid #d5d7ea; border-radius: var(--r-sm); font: inherit; background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: #a6a9c4; }
input:hover, select:hover { border-color: var(--indigo-200); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--indigo-500); box-shadow: 0 0 0 3px rgba(86, 89, 189, .18); }
.field { margin-bottom: 1.1rem; }
.hint-t { font-size: .78rem; color: var(--muted); margin-top: .3rem; }
.err { color: var(--bad); font-size: .8rem; margin-top: .3rem; font-weight: 600; }
.form-grid { display: grid; gap: 0 1.25rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.span-2 { grid-column: 1 / -1; }
.fsec { display: grid; grid-template-columns: 240px 1fr; gap: 1.5rem; padding: 1.5rem 0; border-bottom: 1px solid var(--line); }
.fsec:first-child { padding-top: 0; }
.fsec:last-of-type { border-bottom: 0; }
.fsec h3 { margin-bottom: .25rem; }
.fsec p { color: var(--muted); font-size: .83rem; }
@media (max-width: 800px) { .fsec { grid-template-columns: 1fr; gap: .75rem; } }
.form-actions { display: flex; gap: .6rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.switch { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--indigo-50); cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--ink); margin: 0; }
.switch input { width: 1.1rem; height: 1.1rem; accent-color: var(--indigo-700); }
.switch small { display: block; font-weight: 500; color: var(--muted); }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.check input { width: 1.05rem; height: 1.05rem; accent-color: var(--indigo-700); }
.input-ic { position: relative; }
.input-ic .ic { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--muted); width: 17px; height: 17px; }
.input-ic input { padding-left: 2.4rem; }

.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; }
.filters { display: flex; gap: .85rem; flex-wrap: wrap; align-items: flex-end; }
.filters .field { margin: 0; min-width: 140px; flex: 1; }

/* ================= Tabel ================= */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: #fff; box-shadow: var(--sh-1); }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td { padding: .85rem 1.1rem; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
th { background: var(--indigo-50); color: var(--ink-2); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
tbody tr:hover { background: #fafaff; }
tr:last-child td { border-bottom: 0; }
td.actions { text-align: right; }
td.actions form { display: inline; }
td.actions .btn { margin-left: .25rem; }
.num { font-variant-numeric: tabular-nums; font-weight: 600; }
.empty { padding: 3rem 1rem !important; text-align: center; color: var(--muted); }
.empty .ic { width: 36px; height: 36px; color: var(--indigo-200); display: block; margin: 0 auto .5rem; }

ul.pagination { list-style: none; padding: 0; margin: 1.25rem 0 0; display: flex; gap: .3rem; justify-content: center; flex-wrap: wrap; }
.pagination .page-link, .pagination span.page-link { display: block; padding: .38rem .75rem; border: 1px solid var(--line); border-radius: 8px; font-size: .85rem; background: #fff; color: var(--ink-2); font-weight: 600; }
.pagination .active .page-link { background: var(--indigo-700); color: #fff; border-color: var(--indigo-700); }
.pagination .disabled .page-link { color: #b6b8d0; }
.pagination a.page-link:hover { background: var(--indigo-50); text-decoration: none; }

/* ================= Login ================= */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-brand { position: relative; overflow: hidden; background: linear-gradient(155deg, var(--indigo-950), var(--indigo-700) 70%, var(--indigo-500)); color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 3rem 3.5rem; }
.auth-brand::before, .auth-brand::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .12); }
.auth-brand::before { width: 520px; height: 520px; right: -180px; top: -160px; }
.auth-brand::after { width: 760px; height: 760px; left: -300px; bottom: -420px; background: radial-gradient(circle, rgba(242, 169, 0, .14), transparent 65%); border-color: rgba(255, 255, 255, .08); }
.auth-brand > * { position: relative; z-index: 1; }
.logo-chip { background: #fff; border-radius: 20px; padding: 1.1rem 1.5rem; display: inline-block; align-self: flex-start; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.logo-chip img { width: 190px; display: block; }
.auth-brand h2 { color: #fff; font-size: 2rem; font-weight: 800; margin-top: 2.5rem; max-width: 420px; line-height: 1.2; }
.auth-brand h2 em { font-style: normal; color: var(--gold); }
.auth-brand p { color: rgba(255, 255, 255, .78); margin-top: .9rem; max-width: 400px; font-size: 1rem; }
.auth-points { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: .7rem; }
.auth-points li { display: flex; align-items: center; gap: .7rem; color: rgba(255, 255, 255, .9); font-weight: 600; }
.auth-points .ic { color: var(--gold); }
.auth-form { display: grid; place-items: center; padding: 2rem 1.25rem; background: #fff; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card .m-logo { display: none; width: 150px; margin-bottom: 1.5rem; }
.auth-card h1 { font-size: 1.7rem; }
.auth-card .sub { color: var(--muted); margin: .4rem 0 1.75rem; }
.auth-foot { margin-top: 1.5rem; font-size: .8rem; color: var(--muted); text-align: center; }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-card .m-logo { display: block; }
  .auth-form { align-items: start; padding-top: 3rem; }
}

/* ================= Halaman absen karyawan ================= */
.hero-card { position: relative; overflow: hidden; border-radius: 20px; padding: 1.6rem 1.5rem 1.8rem; color: #fff; background: linear-gradient(150deg, var(--indigo-900), var(--indigo-600)); box-shadow: 0 14px 34px rgba(47, 50, 144, .28); }
.hero-card::after { content: ""; position: absolute; right: -70px; top: -70px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(242, 169, 0, .35), transparent 70%); }
.hero-card .hi { opacity: .85; font-weight: 600; font-size: .9rem; }
.hero-card .hi b { color: #fff; }
.clock { font-size: 3.2rem; font-weight: 800; letter-spacing: .01em; font-variant-numeric: tabular-nums; line-height: 1.1; margin-top: .6rem; }
.date-line { opacity: .85; font-weight: 500; margin-top: .25rem; }
.hero-chip { position: absolute; right: 1.25rem; top: 1.25rem; z-index: 1; }

.status-card { margin-top: 1rem; padding: 1.4rem; }
.geo { display: flex; align-items: flex-start; gap: .8rem; padding: .9rem 1rem; border-radius: 12px; font-weight: 600; background: var(--indigo-50); color: var(--indigo-800); }
.geo .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--indigo-400); flex: none; margin-top: .3rem; position: relative; }
.geo.ok { background: var(--ok-bg); color: var(--ok); } .geo.ok .dot { background: var(--ok); }
.geo.bad { background: var(--bad-bg); color: var(--bad); } .geo.bad .dot { background: var(--bad); }
.geo.wait .dot::after, .geo.ok .dot::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid currentColor; opacity: .5; animation: ring 1.6s infinite; }
@keyframes ring { 0% { transform: scale(.6); opacity: .6; } 100% { transform: scale(1.6); opacity: 0; } }
.actions-row { display: flex; gap: .75rem; margin-top: 1rem; }
.actions-row .btn { flex: 1; }
.actions-row .btn:only-child { grid-column: 1 / -1; }
.done-banner { display: flex; align-items: center; gap: .6rem; justify-content: center; padding: 1rem; margin-top: 1rem; border-radius: 12px; background: var(--ok-bg); color: var(--ok); font-weight: 700; }
.times { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-top: 1rem; }
.time-box { padding: 1rem; border: 1px solid var(--line); border-radius: 12px; }
.time-box .l { font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.time-box b { display: block; font-size: 1.7rem; color: var(--indigo-950); font-variant-numeric: tabular-nums; line-height: 1.2; }
.info-list { display: grid; gap: .9rem; margin-top: 1rem; }
.info-row { display: flex; gap: .85rem; align-items: center; }
.info-row .ico { width: 40px; height: 40px; border-radius: 12px; background: var(--indigo-100); color: var(--indigo-700); display: grid; place-items: center; flex: none; }
.info-row b { display: block; line-height: 1.25; }
.info-row span { color: var(--muted); font-size: .82rem; }
.hint { margin-top: 1rem; font-size: .8rem; color: var(--muted); text-align: center; }

.toast { position: fixed; left: 50%; bottom: 6rem; transform: translateX(-50%); padding: .85rem 1.25rem; border-radius: 12px; background: var(--indigo-950); color: #fff; font-weight: 600; box-shadow: var(--sh-2); z-index: 60; max-width: 92vw; text-align: center; }
.toast.bad { background: var(--bad); }

/* Riwayat */
.hist { display: grid; gap: .75rem; }
.hist-item { display: flex; align-items: center; gap: 1rem; padding: .9rem 1rem; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--sh-1); }
.hist-date { width: 54px; text-align: center; flex: none; border-radius: 12px; background: var(--indigo-50); padding: .4rem 0; }
.hist-date b { display: block; font-size: 1.3rem; color: var(--indigo-900); line-height: 1.1; }
.hist-date span { font-size: .68rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.hist-body { flex: 1; min-width: 0; }
.hist-body .t { font-weight: 700; }
.hist-body .s { font-size: .8rem; color: var(--muted); }
.hist-time { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }

/* Peta & rekap */
#map { height: 380px; border-radius: 12px; border: 1px solid var(--line); z-index: 1; }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--indigo-100); }
.seg a { padding: .42rem 1rem; border-radius: 9px; font-weight: 700; font-size: .85rem; color: var(--indigo-800); }
.seg a:hover { text-decoration: none; }
.seg a.on { background: #fff; box-shadow: var(--sh-1); }
.period-nav { display: flex; align-items: center; gap: .4rem; }
.period-nav .lbl { font-weight: 700; min-width: 150px; text-align: center; color: var(--indigo-900); }
.bar { height: 8px; border-radius: 99px; background: var(--indigo-100); overflow: hidden; min-width: 90px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--indigo-500), var(--indigo-400)); border-radius: 99px; }

/* ===== Tabel tanpa geser horizontal ===== */
table { min-width: 0; table-layout: auto; }
th, td { white-space: normal; }
td.actions { white-space: nowrap; }
.num, .badge { white-space: nowrap; }
@media (max-width: 720px) {
  th, td { padding: .7rem .6rem; }
  .person .avatar { display: none; }
  td.actions .btn:not(.btn-danger) { font-size: 0; gap: 0; padding: .4rem .55rem; }
  td.actions .btn .ic { margin: 0; }
  table.hide-c2 :is(th, td):nth-child(2),
  table.hide-c3 :is(th, td):nth-child(3),
  table.hide-c4 :is(th, td):nth-child(4),
  table.hide-c5 :is(th, td):nth-child(5),
  table.hide-c6 :is(th, td):nth-child(6) { display: none; }
}

/* Atribusi peta: kecil dan tidak mencolok */
.leaflet-control-attribution { background: transparent !important; font-size: 9px !important; color: rgba(60, 64, 90, .55) !important; padding: 0 4px !important; }
.leaflet-control-attribution a { color: inherit !important; }

/* ===== Perbaikan: kartu dalam grid tidak boleh bergeser ===== */
.grid > .card, .cols-3-2 > .card, .cols-3-2 > div > .card, .filters.card { margin-top: 0 !important; }

/* Kartu statistik: label di atas, angka besar, ikon di kanan */
.stat { display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: center; gap: .75rem; padding: 1.2rem 1.3rem; }
.stat > div:last-child { min-width: 0; }
.stat .l { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; color: var(--muted); order: -1; margin-bottom: .15rem; white-space: nowrap; }
.stat > div:last-child { display: flex; flex-direction: column; }
.stat .n { font-size: 2.1rem; }

/* Toolbar rekap */
.toolbar-card { display: flex; align-items: center; justify-content: space-between; gap: 1rem 1.5rem; flex-wrap: wrap; padding: .85rem 1.1rem; margin-bottom: 1rem; }
.toolbar-card .grow { flex: 1; display: flex; justify-content: center; }
.toolbar-card .input-ic { width: 190px; }
.toolbar-card input { padding-top: .52rem; padding-bottom: .52rem; }
@media (max-width: 760px) { .toolbar-card .grow { order: 3; flex-basis: 100%; } }

/* ===== Halaman error ===== */
.err-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem 1rem;
  background: radial-gradient(800px 380px at 100% 0, var(--indigo-100), transparent 60%), radial-gradient(640px 320px at 0 100%, var(--gold-soft), transparent 60%), #fff; }
.err-logo img { width: 170px; max-width: 55vw; height: auto; display: block; margin-bottom: 1.5rem; }
.err-card { width: 100%; max-width: 480px; text-align: center; padding: 2.25rem 1.75rem; box-shadow: var(--sh-2); }
.err-code { font-size: 5rem; font-weight: 800; line-height: 1; letter-spacing: -.03em; margin-bottom: .6rem;
  background: linear-gradient(135deg, var(--indigo-700), var(--indigo-400) 65%, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.err-card h1 { font-size: 1.35rem; margin-bottom: .5rem; }
.err-actions { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; margin-top: 1.5rem; }
.err-foot { margin-top: 1.5rem; font-size: .78rem; color: var(--muted); }

/* =====================================================================
   RAMAH HP (mobile friendly)
   ===================================================================== */

/* Layout form lokasi: form + peta (menumpuk di layar kecil) */
.cols-form { display: grid; gap: 1rem; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: start; }
@media (max-width: 1000px) { .cols-form { grid-template-columns: 1fr; } }

/* Kolom jam: otomatis 1-3 kolom sesuai lebar, tidak pernah terpotong */
.time-grid { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
input[type=time], input[type=date], input[type=month] { min-width: 0; font-variant-numeric: tabular-nums; }

/* Peta */
#map { height: 380px; width: 100%; background: var(--indigo-50); }

/* Pegangan sentuh: cegah zoom otomatis iOS (font >= 16px) */
@media (pointer: coarse), (max-width: 640px) {
  input, select, textarea { font-size: 16px; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 38px; }
  .nav-item { padding: .8rem .85rem; }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  .content { padding: 1rem .85rem 2.5rem; }
  h1 { font-size: 1.3rem; }

  .page-head { flex-direction: column; align-items: stretch; gap: .75rem; margin-bottom: 1rem; }
  .head-actions { width: 100%; flex-wrap: wrap; }
  .head-actions > .btn, .head-actions > a { flex: 1 1 auto; }
  .head-actions form { flex: 1 1 100%; width: 100% !important; }
  .page-head > .btn { width: 100%; }

  .card { padding: 1rem; border-radius: 12px; }
  .fsec { padding: 1.1rem 0; }
  .form-actions { position: sticky; bottom: 0; background: #fff; margin: 0 -1rem -1rem; padding: .75rem 1rem; border-radius: 0 0 12px 12px; z-index: 5; }
  .form-actions .btn { flex: 1; }

  /* Statistik 2 kolom, ringkas */
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
  .stat { padding: .85rem .9rem; gap: .5rem; }
  .stat .ico { width: 38px; height: 38px; border-radius: 11px; }
  .stat .ico .ic { width: 19px; height: 19px; }
  .stat .n { font-size: 1.6rem; }
  .stat .l { font-size: .66rem; letter-spacing: .04em; white-space: normal; }

  /* Filter & toolbar */
  .filters { gap: .65rem; }
  .filters .field { min-width: calc(50% - .4rem); }
  .filters > .btn, .filters form .btn { width: 100%; }
  .toolbar-card { gap: .75rem; }
  .toolbar-card .seg { width: 100%; }
  .toolbar-card .seg a { flex: 1; text-align: center; }
  .toolbar-card .grow { flex-basis: 100%; }
  .toolbar-card form, .toolbar-card .input-ic { width: 100%; }
  .period-nav { width: 100%; justify-content: space-between; }
  .period-nav .lbl { flex: 1; min-width: 0; }

  #map { height: 300px; }
  .card-h { flex-wrap: wrap; }

  /* ---------- Tabel menjadi kartu ---------- */
  .table-wrap { border: 0; background: transparent; box-shadow: none; overflow: visible; border-radius: 0; }
  table, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }
  tbody tr { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--sh-1); margin-bottom: .75rem; padding: .2rem .95rem; }
  tbody tr:hover { background: #fff; }
  td, td:last-child { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem 0; border-bottom: 1px dashed var(--line); text-align: right; white-space: normal; }
  td::before { content: attr(data-label); flex: none; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); text-align: left; }
  /* sel pertama (nama/orang) jadi judul kartu */
  td:first-child { display: block; text-align: left; padding: .8rem 0; border-bottom: 1px solid var(--line); }
  td:first-child::before { display: none; }
  td.actions { justify-content: flex-end; border-bottom: 0; padding-top: .8rem; gap: .5rem; }
  td.actions::before { display: none; }
  td.actions .btn { margin: 0; }
  td.actions .btn:not(.btn-danger) { font-size: .85rem; gap: .45rem; padding: .38rem .8rem; }
  tbody tr td:last-child { border-bottom: 0; }
  .cell { text-align: right; }
  td.empty { display: block; text-align: center; }
  td.empty::before { display: none; }
  tbody tr:has(td.empty) { box-shadow: none; }
  .person .avatar { display: inline-grid; }

  /* Tampilkan kembali semua kolom di mode kartu */
  table.hide-c2 :is(th, td):nth-child(2), table.hide-c3 :is(th, td):nth-child(3), table.hide-c4 :is(th, td):nth-child(4),
  table.hide-c5 :is(th, td):nth-child(5), table.hide-c6 :is(th, td):nth-child(6) { display: flex; }

  /* Halaman error & login */
  .err-code { font-size: 4rem; }
  .login-card, .auth-card { max-width: 100%; }

  /* Halaman karyawan */
  .econtent { padding: 1rem .85rem 6.5rem; }
  .clock { font-size: 2.7rem; }
  .hist-item { padding: .8rem; gap: .75rem; }
}

/* Layar sedang (tablet): kolom kurang penting disembunyikan, tabel tidak perlu digeser */
@media (min-width: 641px) and (max-width: 900px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
}

/* Peta: warna lebih kalem agar pin & lingkaran radius menonjol */
.leaflet-tile-pane { filter: saturate(.7) brightness(1.03); }

/* Tombol simpan di bawah seluruh form (di bawah peta pada HP) */
.save-bar { display: flex; gap: .6rem; margin-top: 1rem; }
.save-bar .btn { min-width: 150px; }
@media (max-width: 640px) {
  .save-bar { position: sticky; bottom: 0; z-index: 5; margin: 1rem -.85rem -2.5rem; padding: .75rem .85rem calc(.75rem + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -6px 18px rgba(21, 23, 77, .06); }
  .save-bar .btn { flex: 1; min-width: 0; }
}

/* ===== SweetAlert2 bertema brand ===== */
.jss-swal { font-family: var(--font); border-radius: 18px !important; padding: 1.6rem 1.4rem 1.4rem !important; }
.jss-swal-title { color: var(--indigo-950) !important; font-size: 1.3rem !important; font-weight: 800 !important; }
.jss-swal .swal2-html-container { color: var(--ink-2); font-size: .95rem; line-height: 1.55; }
.jss-btn { border-radius: 10px !important; font-weight: 700 !important; padding: .65rem 1.3rem !important; font-family: var(--font) !important; }
.jss-swal .swal2-actions { gap: .5rem; width: 100%; }
.jss-swal .swal2-confirm, .jss-swal .swal2-cancel { flex: 1; margin: 0 !important; }
.jss-errlist { text-align: left; margin: .25rem 0 0; padding-left: 1.2rem; color: var(--bad); font-weight: 600; font-size: .9rem; }
.jss-errlist li { margin: .25rem 0; }
.swal2-popup.swal2-toast { border-radius: 12px !important; }
@media (max-width: 480px) { .jss-swal { width: calc(100vw - 2rem) !important; } }

/* Nama perusahaan di login (hanya tampil di HP, karena panel brand disembunyikan) */
.m-brand { display: none; margin: -.5rem 0 1.5rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.m-brand b { display: block; color: var(--indigo-900); font-size: 1.05rem; font-weight: 800; letter-spacing: .02em; line-height: 1.25; }
.m-brand span { display: block; margin-top: .15rem; color: var(--gold-600); font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
@media (max-width: 860px) { .m-brand { display: block; } .auth-card .m-logo { margin-bottom: 1rem; } }

/* Login di HP: logo, nama PT, dan sapaan rata tengah */
@media (max-width: 860px) {
  .auth-card .m-logo { margin: 0 auto 1rem; width: 170px; }
  .m-brand { text-align: center; }
  .auth-card h1, .auth-card .sub { text-align: center; }
}

/* Tombol absen diredupkan (tapi tetap bisa ditekan) saat belum memenuhi syarat */
.btn.is-off { background: #d3d4e6; color: #fff; box-shadow: none; }
.btn.is-off:hover { background: #c6c8de; }
