/* ================================================================
   SMFM ATTENDANCE — MOBILE-FIRST DESIGN SYSTEM
   ================================================================ */

/* ---- Google Font (fallback jika offline) ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ---- CSS Variables ---- */
:root {
  --primary:   #0b5ed7;
  --primary2:  #00a6c8;
  --primary-dk:#083fa3;
  --sidebar:   #071c33;
  --bg:        #f4f8fc;
  --card:      #fff;
  --text:      #0f172a;
  --muted:     #64748b;
  --border:    #e2e8f0;
  --green:     #16a34a;
  --red:       #dc3545;
  --shadow:    0 4px 24px rgba(15,23,42,.07);
  --shadow-lg: 0 16px 40px rgba(15,23,42,.12);
  --radius:    18px;
  --radius-sm: 12px;
  --bnav-h:    72px;       /* bottom nav height */
  --safe-b:    env(safe-area-inset-bottom, 0px);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fd 100%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
a { text-decoration: none; color: inherit; }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; }

/* ================================================================
   LOGIN PAGE
   ================================================================ */
.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background: linear-gradient(160deg, #041c35 0%, #0b3d6e 50%, #0b5ed7 100%);
}
.login-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 28px;
  box-shadow: 0 32px 80px rgba(0,0,0,.25);
  padding: 36px 32px;
  animation: slideUp .4s ease;
}
@keyframes slideUp {
  from { opacity:0; transform:translateY(24px); }
  to   { opacity:1; transform:translateY(0); }
}
.brand { display:flex; align-items:center; gap:12px; color:#0b2c56; }
.brand b { display:block; font-size:22px; line-height:1; }
.brand small { display:block; color:var(--primary); font-weight:800; font-size:12px; }
.brand-mark {
  width:44px; height:44px; border-radius:14px;
  background: linear-gradient(135deg,var(--primary),var(--primary2));
  color:#fff; display:grid; place-items:center;
  font-weight:900; font-size:18px;
  flex-shrink:0;
}
.login-brand { justify-content:center; margin-bottom:24px; }
.login-card h2 { text-align:center; margin:0 0 6px; font-size:22px; }
.login-card > p { text-align:center; color:var(--muted); margin:0 0 24px; font-size:14px; }
.login-illustration {
  height:100px; margin:28px -32px -10px;
  background:linear-gradient(180deg,#f0f8ff,#dbeafe);
  display:grid; place-items:center; font-size:52px;
  border-radius:0 0 28px 28px;
}
.copyright { display:block; text-align:center; color:var(--muted); margin-top:14px; font-size:12px; }

/* ================================================================
   FORM ELEMENTS
   ================================================================ */
label { display:block; font-weight:700; font-size:13px; margin:14px 0 6px; color:var(--text); }
input, select, textarea {
  width:100%; border:1.5px solid var(--border); border-radius:var(--radius-sm);
  background:#fff; padding:13px 14px; outline:none;
  transition:.2s; font-size:15px; color:var(--text);
  -webkit-appearance:none;
}
textarea { min-height:110px; resize:vertical; }
input:focus, select:focus, textarea:focus {
  border-color:var(--primary);
  box-shadow:0 0 0 4px rgba(11,94,215,.1);
}
.full { width:100%; margin-top:16px; }
.form-note { font-size:12px; color:var(--muted); text-align:right; margin-top:4px; }

/* Segmented control */
.segmented { display:flex; gap:10px; margin-top:8px; }
.segmented label { flex:1; margin:0; }
.segmented input { display:none; }
.segmented span {
  display:flex; justify-content:center; border:1.5px solid var(--border);
  border-radius:var(--radius-sm); padding:14px; font-weight:800;
  background:#fff; cursor:pointer; transition:.2s; font-size:15px;
}
.segmented input:checked + span.on  { background:#eafaf0; border-color:#9ae6b4; color:var(--green); }
.segmented input:checked + span.off { background:#fff1f2; border-color:#ffb3bd; color:var(--red); }

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  border:0; border-radius:var(--radius-sm); padding:13px 18px;
  font-weight:800; font-size:14px; cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  transition:.2s; min-height:46px; touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
}
.btn:active { transform:scale(.97); }
.btn-primary { background:var(--primary); color:#fff; }
.btn-primary:hover { background:var(--primary-dk); }
.btn-danger   { background:linear-gradient(135deg,#e7274b,#dc3545); color:#fff; }
.btn-success  { background:var(--green); color:#fff; }
.btn-outline  { background:#fff; border:1.5px solid var(--border); color:var(--text); }
.btn-small    { font-size:12px; padding:8px 12px; min-height:34px; border:1px solid #bcd7ff; color:var(--primary); background:#f0f7ff; border-radius:8px; }
.pulse        { box-shadow:0 8px 24px rgba(220,53,69,.3); }

/* ================================================================
   APP SHELL — DESKTOP SIDEBAR + MOBILE DRAWER
   ================================================================ */
.app-shell {
  display:grid;
  grid-template-columns: 270px 1fr;
  min-height:100vh;
  min-height:100dvh;
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display:none; position:fixed; inset:0;
  background:rgba(4,28,53,.55); z-index:200;
  backdrop-filter:blur(2px);
  -webkit-backdrop-filter:blur(2px);
  opacity:0; transition:opacity .25s;
}
.sidebar-overlay.show { display:block; opacity:1; }

/* ---- Sidebar ---- */
.sidebar {
  background: linear-gradient(180deg,#041c35 0%,#071c33 100%);
  color:#fff;
  display:flex; flex-direction:column;
  position:sticky; top:0; height:100vh;
  z-index:10; overflow:hidden;
  transition: transform .28s cubic-bezier(.4,0,.2,1);
}
.sidebar .brand {
  color: #fff;
}
.sidebar .brand small {
  color: #7ec3f5;
}
.sidebar .brand img {
  background: #fff;
  border-radius: 6px;
  padding: 3px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.sidebar-inner { display:flex; flex-direction:column; height:100%; padding:20px 16px calc(20px + var(--safe-b)); overflow-y:auto; }
.sidebar-top {
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom:20px;
}
.sidebar-close-btn {
  display:none; border:0; background:rgba(255,255,255,.12);
  color:#fff; border-radius:10px; padding:8px 11px;
  font-size:14px; cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
.sidebar-close-btn:active { background:rgba(255,255,255,.22); }

.sidebar-user {
  display:flex; align-items:center; gap:12px;
  background:rgba(255,255,255,.08); border-radius:14px;
  padding:12px 14px; margin-bottom:20px;
}
.sidebar-avatar { margin:0 !important; width:40px !important; height:40px !important; font-size:16px !important; flex-shrink:0; }
.sidebar-user-info b { display:block; font-size:14px; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:150px; }
.sidebar-user-info small { display:block; color:#7ec3f5; font-size:12px; }

.sidebar-nav { flex:1; }
.nav-item {
  display:flex; align-items:center; gap:12px;
  padding:13px 14px; border-radius:12px;
  color:#bfd2e8; margin-bottom:6px;
  font-weight:700; font-size:14px;
  transition:.18s; cursor:pointer;
  border:0; background:transparent; width:100%;
  text-align:left; -webkit-tap-highlight-color:transparent;
}
.nav-item:active, .nav-item.active, .nav-item:hover {
  background:var(--primary); color:#fff;
}
.nav-icon { font-size:18px; width:24px; text-align:center; flex-shrink:0; }
.nav-label { flex:1; }
.logout-form { margin-top:auto; padding-top:12px; border-top:1px solid rgba(255,255,255,.08); }
.logout { color:#f87171; }
.logout:hover, .logout:active { background:rgba(220,53,69,.15) !important; color:#f87171 !important; }

/* ================================================================
   MAIN CONTENT
   ================================================================ */
.main-wrapper { display:flex; flex-direction:column; min-width:0; width:100%; max-width:100%; overflow-x:hidden; }
.main-content { padding:20px 24px calc(var(--bnav-h) + var(--safe-b) + 12px); min-width:0; }

/* ---- Top bar ---- */
.topbar {
  display:flex; justify-content:space-between; align-items:center;
  margin-bottom:22px; gap:12px;
}
.topbar-left { display:flex; align-items:center; gap:14px; min-width:0; }
.topbar-title h1 { margin:0; font-size:22px; font-weight:900; line-height:1.2; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.topbar-title p  { margin:3px 0 0; color:var(--muted); font-size:13px; }

/* Hamburger button */
.hamburger-btn {
  display:none;
  flex-direction:column; justify-content:space-between;
  width:40px; height:40px; padding:10px 8px;
  background:rgba(11,94,215,.08); border:0;
  border-radius:10px; cursor:pointer; flex-shrink:0;
  -webkit-tap-highlight-color:transparent;
}
.hamburger-btn span {
  display:block; height:2.5px; background:var(--primary); border-radius:2px;
  transition:.25s;
}
.hamburger-btn:active { background:rgba(11,94,215,.18); }

.top-user {
  display:flex; align-items:center; gap:10px;
  background:#fff; padding:8px 14px;
  border:1px solid var(--border); border-radius:14px;
  box-shadow:var(--shadow); flex-shrink:0;
}
.topbar-avatar { margin:0 !important; }
.top-user-info b { display:block; font-size:13px; font-weight:800; white-space:nowrap; }
.top-user-info small { display:block; color:var(--muted); font-size:11px; }

/* ================================================================
   CARDS & SECTIONS
   ================================================================ */
.card {
  background:var(--card); border:1px solid var(--border);
  border-radius:var(--radius); box-shadow:var(--shadow);
  padding:20px; margin-bottom:18px;
}
.narrow-card { max-width:680px; }

/* ================================================================
   ALERTS
   ================================================================ */
.alert {
  padding:13px 16px; border-radius:var(--radius-sm);
  margin:0 0 16px; font-weight:700; font-size:14px;
  display:flex; align-items:center; gap:10px;
}
.alert-success { background:#dcfce7; color:#166534; border:1px solid #bbf7d0; }
.alert-error   { background:#ffe4e6; color:#991b1b; border:1px solid #fecdd3; }
.alert-info    { background:#dbeafe; color:#1d4ed8; border:1px solid #bfdbfe; }

/* ================================================================
   KPI / STAT CARDS
   ================================================================ */
.kpi-row { display:grid; gap:14px; }
.kpi-row.two   { grid-template-columns:repeat(2,minmax(0,1fr)); }
.admin-kpis    { grid-template-columns:repeat(3,minmax(0,1fr)); margin-bottom:18px; }
.kpi {
  border-radius:16px; padding:18px;
  background:#f8fbff; border:1px solid var(--border);
  position:relative; overflow:hidden;
}
.kpi::before {
  content:''; position:absolute; top:0; left:0; right:0;
  height:3px; border-radius:16px 16px 0 0;
  background:var(--border);
}
.kpi.green::before { background:linear-gradient(90deg,#16a34a,#4ade80); }
.kpi.red::before   { background:linear-gradient(90deg,#dc3545,#f87171); }
.kpi.blue::before  { background:linear-gradient(90deg,#0b5ed7,#00a6c8); }
.kpi span  { display:block; font-weight:800; font-size:13px; }
.kpi b     { display:block; font-size:30px; font-weight:900; margin:6px 0; letter-spacing:-1px; }
.kpi small { color:var(--muted); font-weight:700; font-size:12px; }
.kpi.green { background:#effaf3; color:var(--green); border-color:#c9f0d5; }
.kpi.red   { background:#fff1f2; color:var(--red);   border-color:#ffd3d9; }
.kpi.blue  { background:#eef6ff; color:var(--primary); border-color:#cfe4ff; }

/* ================================================================
   DASHBOARD GRIDS
   ================================================================ */
.dashboard-grid { display:grid; gap:18px; }
.employee-grid  { grid-template-columns:260px 1fr 220px; }
.employee-grid .summary-card { grid-column:1/span 3; }

.profile-card { text-align:center; }
.profile-card h2 { margin:12px 0 4px; font-size:18px; }
.profile-card p  { margin:0; color:var(--muted); font-weight:700; font-size:14px; }

.card-title-row { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
.card-title-row h2 { margin:0; font-size:17px; }

.big-status {
  font-size:64px; font-weight:950; letter-spacing:-2px;
  margin:16px 0; color:var(--red);
}
.status-on .big-status { color:var(--green); }
.status-card { text-align:center; }
.status-card p { color:var(--muted); font-size:14px; }
.info-card p {
  padding:10px 0; border-bottom:1px solid var(--border);
  color:var(--muted); font-size:14px; margin:0;
}
.info-card p:last-child { border-bottom:0; }

/* ================================================================
   AVATAR
   ================================================================ */
.avatar {
  width:44px; height:44px; border-radius:50%;
  background:linear-gradient(135deg,#1a75ff,#00a6c8);
  display:grid; place-items:center;
  color:#fff; font-weight:900; font-size:17px; flex-shrink:0;
}
.avatar.xl { width:80px; height:80px; font-size:30px; margin:auto; }

/* ================================================================
   TOOLBAR (filter row)
   ================================================================ */
.toolbar {
  display:flex; gap:8px; align-items:center;
  margin-bottom:16px; flex-wrap:wrap;
}
.toolbar input, .toolbar select { max-width:220px; padding:10px 12px; font-size:14px; }

/* ================================================================
   TABLES
   ================================================================ */
.responsive-table {
  overflow-x:auto; border:1px solid var(--border); border-radius:14px;
  -webkit-overflow-scrolling:touch;
}
table { width:100%; border-collapse:collapse; background:#fff; }
th, td {
  padding:12px 14px; border-bottom:1px solid var(--border);
  font-size:14px; text-align:left; white-space:nowrap;
}
th {
  font-size:11px; text-transform:uppercase; letter-spacing:.05em;
  color:#475569; background:#f8fafc; font-weight:800;
}
tr:last-child td { border-bottom:0; }
tr:hover td { background:#fafbff; }

/* Mobile card table — transforms table to cards on small screens */
@media(max-width:600px) {
  .responsive-table { border:0; background:transparent; }
  .responsive-table table { background:transparent; }
  .responsive-table thead { display:none; }
  .responsive-table tr {
    display:block; background:#fff; border:1px solid var(--border);
    border-radius:14px; margin-bottom:10px; padding:12px 14px;
    box-shadow:var(--shadow);
  }
  .responsive-table td {
    display:flex; justify-content:space-between; align-items:center;
    border-bottom:1px solid #f1f5f9; padding:8px 0;
    white-space:normal; font-size:14px;
  }
  .responsive-table td:last-child { border-bottom:0; padding-bottom:0; }
  .responsive-table td[data-label]::before {
    content:attr(data-label);
    font-size:11px; font-weight:800; color:var(--muted);
    text-transform:uppercase; letter-spacing:.04em; flex-shrink:0;
  }
  .row-actions { justify-content:flex-end; }
}

/* ================================================================
   BADGES & STATUS
   ================================================================ */
.status-badge {
  display:inline-flex; align-items:center; justify-content:center;
  border-radius:999px; padding:5px 13px; font-size:12px; font-weight:900;
  letter-spacing:.02em;
}
.badge-on  { background:#dcfce7; color:#15803d; }
.badge-off { background:#ffe4e6; color:#be123c; }

/* ================================================================
   ROW ACTIONS
   ================================================================ */
.row-actions { display:flex; gap:6px; align-items:center; }
.row-actions form { display:inline; }
.icon-btn {
  border:1px solid #dbeafe; background:#f0f7ff; color:var(--primary);
  border-radius:9px; padding:8px 10px; cursor:pointer; font-size:14px;
  min-width:36px; min-height:36px; display:inline-flex;
  align-items:center; justify-content:center;
  transition:.15s; -webkit-tap-highlight-color:transparent;
}
.icon-btn:active { transform:scale(.93); }
.icon-btn.danger { color:var(--red); border-color:#ffd3d9; background:#fff5f6; }

/* ================================================================
   FORMS
   ================================================================ */
.form-grid.single { display:grid; gap:10px; }
.actions { display:flex; justify-content:flex-end; gap:10px; }
.profile-header { display:flex; align-items:center; gap:14px; margin-bottom:18px; }
.profile-header .avatar { margin:0; }
.mini-summary {
  display:grid; grid-template-columns:1fr 1fr; gap:12px;
  padding:14px; background:#f8fafc; border-radius:12px; margin-bottom:16px;
}
.mini-summary small { display:block; color:var(--muted); font-weight:800; font-size:12px; margin-bottom:3px; }
.mini-summary b { font-size:15px; }

/* ================================================================
   REPORT / PROGRESS
   ================================================================ */
.report-layout { display:grid; grid-template-columns:1fr 260px; gap:18px; align-items:center; }
.progress-card {
  text-align:center; background:#fbfdff;
  border:1px solid var(--border); border-radius:16px; padding:18px;
}
.circle-progress {
  --pct:0; width:130px; height:130px; margin:0 auto;
  border-radius:50%; display:grid; place-items:center; position:relative;
  background:conic-gradient(var(--green) calc(var(--pct)*1%),#e5e7eb 0);
}
.circle-progress span {
  position:relative; background:#fff; border-radius:50%;
  width:88px; height:88px; display:grid; place-items:center;
  font-size:22px; font-weight:900;
}
.profile-list a {
  display:flex; align-items:center; gap:12px;
  padding:16px 10px; border-top:1px solid var(--border);
  font-weight:700; font-size:15px;
}
.profile-list a:first-child { border-top:0; }
.profile-list a:active { background:#f8fafc; }

/* ================================================================
   BOTTOM NAVIGATION (mobile)
   ================================================================ */
.bottom-nav {
  display:none;
  position:fixed; bottom:0; left:0; right:0; z-index:100;
  background:#fff; border-top:1px solid var(--border);
  padding:6px 0 calc(6px + var(--safe-b));
  box-shadow:0 -8px 30px rgba(15,23,42,.1);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
}
.bnav-item {
  display:flex; flex-direction:column; align-items:center;
  gap:2px; padding:6px 4px; border-radius:12px;
  color:#94a3b8; font-weight:700; flex:1;
  min-height:52px; justify-content:center;
  transition:.15s; -webkit-tap-highlight-color:transparent;
  cursor:pointer;
}
.bnav-item:active { background:#f0f7ff; transform:scale(.95); }
.bnav-item.active { color:var(--primary); }
.bnav-icon { font-size:20px; line-height:1; }
.bnav-lbl  { font-size:10px; font-weight:800; letter-spacing:.02em; }

/* Active indicator dot */
.bnav-item.active .bnav-icon {
  position:relative;
}
.bnav-item.active .bnav-icon::after {
  content:''; position:absolute; bottom:-3px; left:50%;
  transform:translateX(-50%);
  width:4px; height:4px; border-radius:50%;
  background:var(--primary);
}

/* ================================================================
   CALENDAR STYLES
   ================================================================ */
.cal-page { display:flex; flex-direction:column; gap:18px; }

/* Stats strip */
.cal-stats {
  display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px;
}
.cal-stat {
  background:#fff; border:1px solid var(--border); border-radius:16px;
  padding:16px 18px; box-shadow:var(--shadow);
  display:flex; flex-direction:column; gap:3px;
  position:relative; overflow:hidden;
}
.cal-stat::before {
  content:''; position:absolute; top:0; left:0; right:0;
  height:3px; border-radius:16px 16px 0 0;
}
.cal-stat.on::before    { background:linear-gradient(90deg,#16a34a,#4ade80); }
.cal-stat.off::before   { background:linear-gradient(90deg,#dc3545,#f87171); }
.cal-stat.pct::before   { background:linear-gradient(90deg,#0b5ed7,#00a6c8); }
.cal-stat.total::before { background:linear-gradient(90deg,#7c3aed,#a78bfa); }
.cal-stat-val { font-size:28px; font-weight:900; letter-spacing:-1px; line-height:1; }
.cal-stat.on    .cal-stat-val { color:var(--green); }
.cal-stat.off   .cal-stat-val { color:var(--red); }
.cal-stat.pct   .cal-stat-val { color:var(--primary); }
.cal-stat.total .cal-stat-val { color:#7c3aed; }
.cal-stat-lbl { font-size:11px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; }

/* Calendar card */
.cal-card {
  background:#fff; border:1px solid var(--border);
  border-radius:20px; box-shadow:var(--shadow); padding:20px;
  width:100%; max-width:100%;
}
.cal-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.cal-nav-btn {
  width:38px; height:38px; border-radius:10px;
  border:1px solid var(--border); background:#f8fafc;
  display:grid; place-items:center; font-size:16px;
  color:var(--text); transition:.18s; cursor:pointer;
  -webkit-tap-highlight-color:transparent; text-decoration:none;
}
.cal-nav-btn:active { background:var(--primary); color:#fff; border-color:var(--primary); }
.cal-month-title { text-align:center; }
.cal-month-title strong { display:block; font-size:20px; font-weight:900; }
.cal-month-title span   { font-size:13px; color:var(--muted); font-weight:700; }

.cal-grid-head { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); margin-bottom:4px; }
.cal-dow { text-align:center; font-size:10px; font-weight:800; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; padding:5px 0; }

.cal-grid-body { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:3px; }

/* Employee calendar cells */
.cal-cell {
  aspect-ratio:1; border-radius:10px;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:1px; position:relative; border:2px solid transparent; transition:.12s;
}
.cal-cell.empty   { background:transparent; }
.cal-cell.future  { background:#f8fafc; opacity:.5; }
.cal-cell.on   { background:linear-gradient(135deg,#dcfce7,#bbf7d0); border-color:#86efac; }
.cal-cell.off  { background:linear-gradient(135deg,#ffe4e6,#fecdd3); border-color:#fda4af; }
.cal-cell.today { border-color:var(--primary) !important; box-shadow:0 0 0 3px rgba(11,94,215,.15); }
.cal-cell.sun .cal-day-num { color:var(--red); }
.cal-day-num { font-size:13px; font-weight:800; line-height:1; }
.cal-dot { font-size:10px; font-weight:900; line-height:1; }
.on-dot  { color:#15803d; }
.off-dot { color:#be123c; }

/* Admin calendar cells (clickable) */
.admin-cal .admin-day {
  aspect-ratio:unset; min-height:64px; padding:7px 5px 5px;
  align-items:flex-start; justify-content:flex-start; flex-direction:column;
  border-radius:10px; border:1.5px solid var(--border); background:#f8fafc;
  text-decoration:none; color:var(--text); transition:.16s; cursor:pointer; display:flex;
  -webkit-tap-highlight-color:transparent;
}
.admin-day:active { background:#eef6ff; border-color:var(--primary); }
.admin-day.today    { border-color:var(--primary); background:#eef6ff; }
.admin-day.selected { border-color:var(--primary); background:linear-gradient(135deg,#dbeafe,#e0f2fe); box-shadow:0 0 0 3px rgba(11,94,215,.18); }
.admin-day.future   { opacity:.4; pointer-events:none; }
.admin-day.sun .cal-day-num { color:var(--red); }
.admin-day .cal-day-num { font-size:12px; font-weight:800; margin-bottom:3px; }
.admin-day-bar { width:100%; height:4px; background:#e5e7eb; border-radius:99px; overflow:hidden; margin:2px 0; }
.admin-day-fill { display:block; height:100%; background:linear-gradient(90deg,#16a34a,#4ade80); border-radius:99px; }
.admin-day-count { display:flex; gap:3px; font-size:9px; font-weight:800; flex-wrap:wrap; }
.on-txt  { color:#15803d; }
.off-txt { color:#be123c; }

/* Admin layout */
.cal-admin-layout { display:grid; grid-template-columns:400px 1fr; gap:18px; align-items:start; }

/* Detail panel */
.cal-detail-panel {
  background:#fff; border:1px solid var(--border); border-radius:20px;
  box-shadow:var(--shadow); padding:20px; min-height:360px;
  width:100%; max-width:100%;
}
.cal-detail-header {
  display:flex; justify-content:space-between; align-items:flex-start;
  margin-bottom:14px; padding-bottom:12px; border-bottom:1px solid var(--border);
}
.cal-detail-header h3  { margin:0 0 4px; font-size:17px; }
.cal-detail-header small { color:var(--muted); font-weight:700; font-size:13px; }
.detail-list { display:flex; flex-direction:column; gap:7px; }
.detail-row {
  display:flex; align-items:center; gap:10px;
  padding:10px 12px; border-radius:12px; border:1px solid var(--border);
  background:#fafbfc; transition:.13s; -webkit-tap-highlight-color:transparent;
}
.detail-row:active { background:#f0f7ff; }
.detail-row.on-row  { border-left:3px solid #16a34a; }
.detail-row.off-row { border-left:3px solid #dc3545; }
.detail-avatar {
  width:36px; height:36px; border-radius:50%;
  background:linear-gradient(135deg,#1a75ff,#00a6c8);
  color:#fff; display:grid; place-items:center;
  font-weight:900; font-size:14px; flex-shrink:0;
}
.detail-row.off-row .detail-avatar { background:linear-gradient(135deg,#ef4444,#f87171); }
.detail-info { flex:1; min-width:0; }
.detail-info b     { display:block; font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.detail-info small { color:var(--muted); font-size:12px; font-weight:600; }

.cal-empty-detail {
  display:flex; flex-direction:column; align-items:center;
  justify-content:center; min-height:280px;
  text-align:center; color:var(--muted);
}
.cal-empty-icon { font-size:52px; margin-bottom:14px; opacity:.6; }
.cal-empty-detail h3 { margin:0 0 8px; font-size:17px; color:var(--text); }
.cal-empty-detail p  { font-size:14px; max-width:220px; line-height:1.6; }

.cal-legend {
  display:flex; gap:14px; justify-content:center; flex-wrap:wrap;
  margin-top:12px; font-size:12px; font-weight:700; color:var(--muted);
}
.leg-dot { display:inline-block; width:9px; height:9px; border-radius:3px; margin-right:4px; vertical-align:middle; }
.on-leg    { background:#16a34a; }
.off-leg   { background:#dc3545; }
.today-leg { background:var(--primary); border-radius:50%; }

/* ================================================================
   PER-EMPLOYEE CALENDAR
   ================================================================ */
.emp-cal-breadcrumb {
  display:flex; align-items:center; gap:8px;
  font-size:13px; color:var(--muted); font-weight:700; flex-wrap:wrap;
}
.emp-cal-breadcrumb a { color:var(--primary); }
.emp-cal-hero {
  background:#fff; border:1px solid var(--border); border-radius:18px;
  box-shadow:var(--shadow); padding:18px 20px;
  display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap;
}
.emp-cal-identity { display:flex; align-items:center; gap:14px; }
.emp-cal-identity h2 { margin:0 0 3px; font-size:18px; }
.emp-cal-identity p  { margin:0; color:var(--muted); font-size:13px; }
.emp-cal-ava { margin:0 !important; width:54px !important; height:54px !important; font-size:20px !important; }
.emp-cal-nav-emp { display:flex; gap:8px; flex-wrap:wrap; }
.emp-nav-btn { font-size:13px; padding:9px 13px; min-height:40px; }
.emp-cal-body { display:grid; grid-template-columns:420px 1fr; gap:18px; align-items:start; }
.emp-cal-side { display:flex; flex-direction:column; gap:14px; }

.emp-admin-cell {
  aspect-ratio:1; border-radius:10px; border:2px solid transparent;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:1px; position:relative; cursor:pointer; transition:.12s;
  -webkit-tap-highlight-color:transparent;
}
.emp-admin-cell:not(.empty):not(.future):active { transform:scale(.93); box-shadow:0 3px 12px rgba(11,94,215,.15); z-index:2; }
.emp-admin-cell.on     { background:linear-gradient(135deg,#dcfce7,#bbf7d0); border-color:#86efac; }
.emp-admin-cell.off    { background:linear-gradient(135deg,#ffe4e6,#fecdd3); border-color:#fda4af; }
.emp-admin-cell.future { background:#f8fafc; opacity:.45; pointer-events:none; }
.emp-admin-cell.today  { border-color:var(--primary) !important; box-shadow:0 0 0 3px rgba(11,94,215,.15); }
.emp-admin-cell.selected { border-color:var(--primary) !important; box-shadow:0 0 0 4px rgba(11,94,215,.18); }
.emp-admin-cell.sun .cal-day-num { color:var(--red); }
.cell-edit-link {
  position:absolute; top:2px; right:2px; font-size:10px;
  background:rgba(255,255,255,.88); border-radius:5px; padding:1px 3px;
  color:var(--primary); opacity:0; transition:.13s; line-height:1.4;
}
.emp-admin-cell:hover .cell-edit-link { opacity:1; }

.emp-day-detail {
  background:#fff; border:1px solid var(--border); border-radius:20px;
  box-shadow:var(--shadow); padding:20px; min-height:160px;
  display:flex; flex-direction:column; justify-content:center;
  width:100%; max-width:100%;
}
.day-detail-top {
  display:flex; justify-content:space-between; align-items:flex-start;
  margin-bottom:12px; padding-bottom:10px; border-bottom:1px solid var(--border);
}
.day-detail-top h3 { margin:0 0 5px; font-size:16px; }
.day-detail-rows { display:flex; flex-direction:column; gap:6px; }
.day-detail-row {
  display:flex; justify-content:space-between; font-size:13px;
  padding:6px 0; border-bottom:1px solid var(--border); gap:10px;
}
.day-detail-row:last-child { border-bottom:0; }
.day-detail-row span { color:var(--muted); font-weight:700; flex-shrink:0; }
.day-detail-row b    { text-align:right; }

/* ================================================================
   RESPONSIVE — TABLET (≤ 1100px)
   ================================================================ */
@media(max-width:1100px) {
  .cal-admin-layout { grid-template-columns:1fr; }
  .emp-cal-body     { grid-template-columns:1fr; }
  .emp-cal-body .emp-cal-main { order:2; }
  .emp-cal-body .emp-cal-side { order:1; }
}

/* ================================================================
   RESPONSIVE — MOBILE (≤ 960px) — MAIN BREAKPOINT
   ================================================================ */
@media(max-width:960px) {
  /* App shell: single column */
  .app-shell { grid-template-columns:1fr; }

  /* Sidebar becomes off-canvas drawer */
  .sidebar {
    position:fixed; top:0; left:0; bottom:0;
    height:100%;
    height:100dvh;
    width:min(300px,85vw); z-index:210;
    transform:translateX(-100%);
    border-right:1px solid rgba(255,255,255,.08);
    box-shadow:8px 0 40px rgba(0,0,0,.3);
  }
  .sidebar.open { transform:translateX(0); }
  .sidebar-close-btn { display:flex; }

  /* Show hamburger */
  .hamburger-btn { display:flex; }

  /* Hide user info in topbar on small screens (shown in sidebar) */
  .top-user-info { display:none; }

  /* Main content */
  .main-content { padding:16px 16px calc(var(--bnav-h) + var(--safe-b) + 8px); }

  /* Show bottom nav */
  .bottom-nav { display:flex; }

  /* Dashboard grids go single column */
  .employee-grid, .admin-kpis, .report-layout { grid-template-columns:1fr; }
  .employee-grid .summary-card { grid-column:auto; }

  .kpi-row.two { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .admin-kpis  { grid-template-columns:repeat(2,minmax(0,1fr)); }

  .big-status { font-size:52px; }
  .topbar-title h1 { font-size:18px; }

  /* Toolbar */
  .toolbar { gap:8px; }
  .toolbar input, .toolbar select { max-width:none; }

  /* Forms */
  .mini-summary { grid-template-columns:1fr; }
  .actions { flex-direction:column; }
  .actions .btn { width:100%; }

  /* Calendar admin layout */
  .cal-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .admin-cal .admin-day { min-height:52px; }
  .admin-day-count { display:none; }

  /* Employee cal hero */
  .emp-cal-hero { flex-direction:column; align-items:flex-start; }
  .emp-cal-nav-emp { width:100%; }
  .emp-nav-btn { flex:1; justify-content:center; text-align:center; }
}

/* ================================================================
   RESPONSIVE — SMALL MOBILE (≤ 600px)
   ================================================================ */
@media(max-width:600px) {
  .main-content { padding:12px 12px calc(var(--bnav-h) + var(--safe-b) + 8px); }
  .topbar { flex-wrap:wrap; gap:10px; }
  .topbar-left { flex:1; }
  .top-user { padding:8px 10px; }

  .kpi-row.two { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .admin-kpis  { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .cal-stats   { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .cal-stat-val { font-size:22px; }

  .cal-card, .cal-detail-panel, .emp-day-detail { padding:12px; border-radius:14px; }
  .cal-detail-header, .day-detail-top { flex-wrap:wrap; gap:8px; align-items:center; }
  .cal-detail-header > div, .day-detail-top > div { flex:1; min-width:150px; }

  .cal-grid-body { gap:2px; }
  .cal-cell, .emp-admin-cell { border-radius:8px; }
  .cal-day-num { font-size:11px; }
  .admin-cal .admin-day { min-height:44px; padding:4px 3px; }
  .admin-day-bar { display:none; }

  .reports-export-btns { display:flex; flex-direction:column; width:100%; }
  .reports-export-btns .btn { width:100%; margin:0 !important; }

  .login-card { padding:28px 20px; }
  .login-illustration { margin-left:-20px; margin-right:-20px; }

  .card { padding:16px; border-radius:14px; }
  .narrow-card { max-width:none; }

  /* Toolbar stack */
  .toolbar { display:grid; }
  .toolbar input, .toolbar select, .toolbar .btn { max-width:none; width:100%; }

  .report-layout { grid-template-columns:1fr; }
  .profile-header { flex-direction:column; text-align:center; }
  .profile-header .avatar { margin:auto; }
  .mini-summary { grid-template-columns:1fr; }

  /* Employee cal hero compact */
  .emp-cal-identity { gap:10px; }
  .emp-cal-ava { width:44px !important; height:44px !important; font-size:16px !important; }
  .emp-cal-identity h2 { font-size:16px; }
}


/* ================================================================
   VERY SMALL (≤ 380px)
   ================================================================ */
@media(max-width:380px) {
  .main-content { padding:12px 12px calc(var(--bnav-h) + var(--safe-b) + 6px); }
  .topbar-title h1 { font-size:16px; }
  .cal-day-num { font-size:10px; }
  .bnav-lbl { font-size:9px; }
  .cal-stat-val { font-size:18px; }
  .kpi b { font-size:24px; }
}

/* ================================================================
   UTILITY CLASSES
   ================================================================ */
.muted { color: var(--muted); }
.text-center { text-align: center; }
.text-green { color: var(--green); }
.text-red   { color: var(--red); }
.fw-700 { font-weight: 700; }
.fw-900 { font-weight: 900; }

/* Edit panel spacing */
.edit-panel .profile-header { border-bottom:1px solid var(--border); padding-bottom:16px; margin-bottom:16px; }

/* ================================================================
   LOCATION FIELD — ATTENDANCE CHECK-IN
   ================================================================ */
.location-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  text-align: left;
}
.location-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 4px;
}
.location-icon { font-size: 15px; }
.required-star { color: var(--red); font-size: 14px; }
.location-field input[type="text"] {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: var(--bg);
  color: var(--text);
  text-transform: uppercase;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.location-field input[type="text"]::placeholder {
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
  opacity: .7;
  text-transform: uppercase;
}
.location-field input[type="text"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11,94,215,.12);
  background: #fff;
}
.location-hint {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}
/* Display lokasi setelah sudah absen */
.attendance-location-display {
  font-size: 14px;
  color: var(--muted);
  margin: 6px 0 12px;
  font-weight: 500;
}
.attendance-location-display strong {
  color: var(--text);
  font-weight: 700;
}
