/* TEMPU-TRACE — Staff backend UI (Loket + Pengelola) */

.staff-shell { min-height: 100vh; display: flex; flex-direction: column; }

/* Top bar (brand accent) */
.staff-top {
  background: linear-gradient(135deg, var(--brand-coconut) 0%, var(--brand-coconut-soft) 100%);
  border-bottom: 2px solid var(--brand-gold);
  color: var(--brand-cream);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.staff-top__brand { font-weight: 700; font-size: 18px; }
.staff-top__brand small { font-weight: 400; opacity: 0.8; margin-left: 8px; font-size: 13px; }
.staff-top__user { font-size: 13px; display: flex; align-items: center; gap: 12px; }
.staff-top__user .btn-back { min-height: 32px; padding: 4px 10px; font-size: 13px; }

/* Status bar (hari pasar info) */
.staff-statusbar {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--bg-muted);
  padding: 8px 20px;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* Body grid: sidebar + main */
.staff-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  flex: 1;
  min-height: 0;
}
@media (max-width: 768px) {
  .staff-body { grid-template-columns: 1fr; }
  .staff-sidebar { display: none; }
}

.staff-sidebar {
  background: var(--bg-soft);
  border-right: 1px solid var(--bg-muted);
  padding: 12px 0;
  overflow-y: auto;
}
.staff-sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 14px;
  border-left: 3px solid transparent;
}
.staff-sidebar a:hover { background: var(--bg-muted); text-decoration: none; }
.staff-sidebar a.active {
  background: var(--bg-base);
  border-left-color: var(--accent);
  font-weight: 600;
}
.staff-sidebar .badge {
  margin-left: auto;
  font-size: 11px;
  background: var(--danger);
  color: white;
  padding: 2px 6px;
  border-radius: 10px;
}
.staff-sidebar__group {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 16px 20px 6px;
  letter-spacing: 0.5px;
}

.staff-main {
  padding: 20px;
  overflow-x: auto;
}
.staff-main h1 { font-size: 22px; margin: 0 0 16px; }
.staff-main h2 { font-size: 18px; margin: 24px 0 12px; }

/* Stat cards grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .15s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card__label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.stat-card__value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}
.stat-card__sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Table */
.tbl {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
}
.tbl th, .tbl td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.tbl th {
  background: var(--bg-subtle);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.tbl tbody tr { transition: background .12s ease; }
.tbl tbody tr:hover { background: var(--bg-soft); }
.tbl tfoot th { background: var(--bg-soft); color: var(--text-primary); text-transform: none; font-size: 13px; }
.tbl tr:last-child td { border-bottom: none; }
.tbl-actions { white-space: nowrap; }
.tbl-actions .btn { min-height: 28px; padding: 4px 10px; font-size: 12px; }

/* Toolbar */
.toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.toolbar input, .toolbar select {
  padding: 8px 10px;
  border: 1px solid var(--bg-muted);
  border-radius: var(--radius);
  font-size: 14px;
}
.toolbar .grow { flex: 1; min-width: 200px; }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  animation: modalFade .15s ease;
}
.modal {
  background: var(--bg-base);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalPop .18s cubic-bezier(0.2, 0.8, 0.3, 1);
}
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalPop { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal__head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--bg-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal__head h2 { margin: 0; font-size: 18px; }
.modal__body { padding: 16px 20px; }
.modal__foot {
  padding: 12px 20px;
  border-top: 1px solid var(--bg-muted);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
/* Tombol ✕ (close) di dalam modal: latar putih → perlu warna gelap agar jelas */
.modal__head .btn-back {
  background: var(--bg-soft);
  border: 1px solid var(--bg-muted);
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  min-width: 36px;
  min-height: 36px;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.modal__head .btn-back:hover { background: var(--bg-muted); color: var(--text-primary); }

/* Timeline (tempu_events) */
.timeline { margin: 0; padding: 0; list-style: none; position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--bg-muted);
}
.timeline li {
  position: relative;
  padding-left: 36px;
  padding-bottom: 16px;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: 6px; top: 6px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg-base);
}
.timeline__when { font-size: 12px; color: var(--text-secondary); }
.timeline__what { font-weight: 600; margin: 2px 0; }
.timeline__who { font-size: 13px; color: var(--text-secondary); }

/* Login centered card */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 40px 20px;
}
.login-card {
  width: 100%;
  max-width: 420px;
}

/* Loket grid */
.loket-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.loket-action-card {
  background: var(--bg-base);
  border: 1px solid var(--bg-muted);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: transform 120ms, box-shadow 120ms;
  text-decoration: none;
  color: inherit;
}
.loket-action-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
.loket-action-card__icon { font-size: 36px; margin-bottom: 8px; }
.loket-action-card__title { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.loket-action-card__desc { color: var(--text-secondary); font-size: 13px; }

/* Form layout */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
}

/* ----- Laporan: tampilan cetak ----- */
.report-head { margin-bottom: 16px; }
.report-head h1 { margin-bottom: 4px; }
.report-meta { color: var(--text-secondary); font-size: 13px; }
.report-total {
  display: inline-block;
  background: var(--bg-soft);
  border: 1px solid var(--bg-muted);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin: 4px 8px 4px 0;
  font-size: 14px;
}
.report-total strong { font-size: 18px; display: block; }
.print-only { display: none; }

@media print {
  .staff-top, .staff-sidebar, .staff-statusbar, .help-box, .toolbar, .no-print { display: none !important; }
  .staff-body { display: block !important; }
  .staff-main { padding: 0 !important; overflow: visible !important; }
  body { background: #fff; }
  .print-only { display: block; }
  .tbl { font-size: 10.5pt; }
  .report-total { border: 1px solid #999; }
  a[href]::after { content: ""; }
  @page { margin: 12mm; }
}

/* Inline select for tempus list */
.tempu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--bg-muted);
}
.tempu-row:last-child { border-bottom: none; }
.tempu-row__id { font-family: 'Consolas', 'Courier New', monospace; }
.tempu-row__remove { color: var(--danger); cursor: pointer; padding: 0 6px; }
