/* ================================================================
   LDP JPM v10.5 — UI/UX precision + realtime attendance camera
   Loaded last to normalize layouts without changing existing data.
   ================================================================ */

/* ---------- Login Google ---------- */
.auth-card .btn-google{
  min-height:50px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:.72rem;
  border:1px solid #d9deea;
  background:#fff;
  color:#202124;
  border-radius:12px;
  font-weight:700;
  text-decoration:none;
  box-shadow:0 1px 2px rgba(15,23,42,.05);
  transition:border-color .16s ease,box-shadow .16s ease,transform .16s ease,background .16s ease;
}
.auth-card .btn-google:hover{
  background:#f8faff;
  border-color:#c7cfdf;
  color:#202124;
  box-shadow:0 5px 16px rgba(15,23,42,.08);
  transform:translateY(-1px);
}
.auth-card .google-mark{width:20px;height:20px;flex:0 0 20px;display:block}
.auth-card .or-sep{display:flex;align-items:center;gap:.8rem;margin:1rem 0;color:#7a8294;font-size:.82rem;text-align:center}
.auth-card .or-sep::before,.auth-card .or-sep::after{content:"";height:1px;background:#e4e8f0;flex:1}
.auth-card .or-sep span{white-space:nowrap}

/* ---------- LMS attendance page ---------- */
.attendance-page .dash-head{
  align-items:flex-end!important;
  gap:1.25rem!important;
}
.attendance-page .attendance-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:1.25rem;
  align-items:start;
}
.attendance-page .attendance-card{height:100%;border:1px solid #e4e8f0;border-radius:18px;background:#fff;box-shadow:0 14px 30px -26px rgba(15,23,42,.45)}
.attendance-page .attendance-card .card-body{padding:1.25rem;gap:.8rem}
.attendance-page .attendance-card h3{font-size:1.05rem;line-height:1.4}
.attendance-page .attendance-card .attendance-card-actions{display:flex;gap:.55rem;flex-wrap:wrap;margin-top:.2rem}

/* ---------- Realtime attendance camera ---------- */
.attendance-camera{
  width:100%;
  display:grid;
  gap:.75rem;
  padding:.85rem;
  border:1px solid #e4e8f0;
  border-radius:14px;
  background:#f8faff;
}
.attendance-camera-stage{
  position:relative;
  width:100%;
  aspect-ratio:4/3;
  overflow:hidden;
  border-radius:12px;
  background:#111827;
  border:1px solid #dfe4ee;
  display:grid;
  place-items:center;
}
.attendance-camera-stage video,.attendance-camera-stage img{
  width:100%;height:100%;object-fit:cover;display:block;
}
.attendance-camera-stage video{transform:scaleX(-1)}
.attendance-camera-stage .attendance-camera-empty{
  display:grid;place-items:center;text-align:center;gap:.35rem;color:#cbd5e1;padding:1.2rem;
}
.attendance-camera-stage .attendance-camera-empty b{color:#fff;font-size:.95rem}
.attendance-camera-stage .attendance-camera-empty svg{width:34px;height:34px}
.attendance-camera-live-badge{
  position:absolute;top:.65rem;left:.65rem;z-index:2;
  display:none;align-items:center;gap:.4rem;padding:.35rem .55rem;
  border-radius:999px;background:rgba(17,24,39,.78);color:#fff;font-size:.7rem;font-weight:800;letter-spacing:.06em;
}
.attendance-camera.is-live .attendance-camera-live-badge{display:inline-flex}
.attendance-camera-live-badge::before{content:"";width:7px;height:7px;border-radius:50%;background:#ef4444;box-shadow:0 0 0 4px rgba(239,68,68,.18)}
.attendance-camera-actions{display:flex;flex-wrap:wrap;gap:.55rem}
.attendance-camera-actions .btn{flex:1 1 140px;justify-content:center}
.attendance-file-row{display:grid;gap:.35rem}
.attendance-file-row label{margin:0!important;font-size:.78rem!important;color:#596277!important}
.attendance-file-row input[type=file]{width:100%;margin:0!important;background:#fff}
.attendance-camera-status{min-height:1.2em;margin:0;font-size:.78rem;color:#687286;line-height:1.45}
.attendance-camera-status.is-error{color:#a5170f}
.attendance-camera-status.is-ok{color:#12633b}
.attendance-camera [hidden]{display:none!important}

/* ---------- Admin: consistent content geometry ---------- */
body.admin .adm-main{min-width:0}
body.admin .adm-content{
  width:min(calc(100% - 36px),1440px)!important;
  max-width:1440px!important;
  margin-inline:auto!important;
  padding:1.25rem 0 2.75rem!important;
  min-width:0!important;
}
body.admin .adm-content>.adm-panel,
body.admin .adm-content>.adm-tabs,
body.admin .adm-content>.adm-cards,
body.admin .adm-content>.dash-grid,
body.admin .adm-content>.alert,
body.admin .adm-content>form{
  width:100%;max-width:100%;min-width:0;
}
body.admin .adm-panel{
  padding:clamp(16px,1.7vw,24px)!important;
  border-radius:16px!important;
  overflow:hidden!important;
}
body.admin .adm-panel .panel-head{display:flex;flex-direction:column;align-items:flex-start!important;gap:.25rem;min-height:0!important;padding:0!important}
body.admin .adm-panel .panel-head h3{font-size:1rem!important;line-height:1.35!important}
body.admin .adm-panel .panel-head .panel-desc{max-width:100%;line-height:1.6!important}
body.admin .toolbar,body.admin .table-toolbar,body.admin .adm-filter{gap:.65rem!important;align-items:end!important}
body.admin .toolbar :is(input,select),body.admin .table-toolbar :is(input,select){min-height:42px}

/* Desktop tables: fit normal 5–7-column data to the panel first; scroll only when truly needed. */
body.admin .table-wrap{
  width:100%!important;max-width:100%!important;min-width:0!important;
  overflow-x:auto!important;overflow-y:hidden!important;
  border-radius:12px!important;
}
body.admin .table-wrap>table.data{width:100%!important;max-width:100%!important;margin:0!important}
body.admin .table-wrap>table.data th,body.admin .table-wrap>table.data td{
  overflow-wrap:anywhere!important;word-break:normal!important;vertical-align:middle!important;
}

/* Absensi admin: no clipped first column / oversized activity path. */
body.admin .attendance-live .table-wrap{overflow-x:hidden!important}
body.admin .presence-table{min-width:0!important;table-layout:fixed!important;font-size:.82rem!important}
body.admin .presence-table th:nth-child(1){width:8%}
body.admin .presence-table th:nth-child(2){width:21%}
body.admin .presence-table th:nth-child(3){width:22%}
body.admin .presence-table th:nth-child(4){width:27%}
body.admin .presence-table th:nth-child(5){width:10%}
body.admin .presence-table th:nth-child(6){width:12%}
body.admin .presence-table th,body.admin .presence-table td{padding:.72rem .7rem!important}
body.admin .presence-table code.presence-path{display:block;max-width:100%;white-space:normal!important;overflow-wrap:anywhere!important;line-height:1.35;color:#687286;background:transparent;padding:0}
body.admin .presence-user{display:flex;align-items:center;gap:.65rem;min-width:0}
body.admin .presence-user-copy{min-width:0}
body.admin .presence-user-copy strong,body.admin .presence-user-copy span{display:block;overflow-wrap:anywhere}
body.admin .presence-photo{
  width:48px;height:48px;flex:0 0 48px;border-radius:10px;overflow:hidden;border:1px solid #dce2ec;background:#f2f4f8;
}
body.admin .presence-photo img{width:100%;height:100%;object-fit:cover;display:block}
body.admin .presence-photo-empty{width:100%;height:100%;display:grid;place-items:center;color:#8b94a8;font-size:.7rem;font-weight:800}
body.admin .attendance-live-stats{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:.8rem!important}
body.admin .attendance-live-stats .stat-card{min-width:0!important}
body.admin .attendance-toggle-form{justify-content:flex-start!important}
body.admin .attendance-setting-table{min-width:0!important;table-layout:fixed!important}
body.admin .attendance-setting-table th:nth-child(1){width:27%}
body.admin .attendance-setting-table th:nth-child(2){width:28%}
body.admin .attendance-setting-table th:nth-child(3){width:12%}
body.admin .attendance-setting-table th:nth-child(4){width:12%}
body.admin .attendance-setting-table th:nth-child(5){width:21%}
body.admin .attendance-setting-table th:last-child,body.admin .attendance-setting-table td:last-child{text-align:left!important}
body.admin .attendance-recap-table{min-width:780px!important}
body.admin .attendance-recap-table th:last-child,body.admin .attendance-recap-table td:last-child{text-align:left!important}
body.admin .attendance-photo-link{display:inline-flex;align-items:center;gap:.4rem}
body.admin .attendance-photo-link img{width:42px;height:42px;object-fit:cover;border-radius:8px;border:1px solid #dce2ec}

@media (max-width:1100px){
  body.admin .presence-table{min-width:880px!important;table-layout:auto!important}
  body.admin .attendance-live .table-wrap{overflow-x:auto!important}
  body.admin .attendance-setting-table{min-width:760px!important;table-layout:auto!important}
}
@media (max-width:900px){
  .attendance-page .attendance-grid{grid-template-columns:1fr}
  body.admin .adm-content{width:calc(100% - 24px)!important;padding-top:1rem!important}
  body.admin .attendance-live-stats{grid-template-columns:1fr!important}
}
@media (max-width:640px){
  .auth-card .btn-google{min-height:48px}
  .attendance-page .dash-head{align-items:center!important;text-align:center!important}
  .attendance-page .dash-actions{width:100%;justify-content:center!important}
  .attendance-camera{padding:.7rem}
  .attendance-camera-actions{display:grid;grid-template-columns:1fr 1fr}
  .attendance-camera-actions .btn{width:100%}
  body.admin .adm-content{width:calc(100% - 20px)!important}
  body.admin .adm-panel{padding:13px!important}
}
