:root {
  --primary: #0d6efd;
  --primary-dark: #0b5ed7;
  --primary-light: #e7f1ff;
  --sidebar-width: 260px;
}

body {
  background-color: #f4f7fb;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: #212529;
}

/* ---------- MODERN LOGIN PAGE (EXACT USER DIAGRAM) ---------- */
.login-page-wrapper {
  min-height: 100vh;
  width: 100%;
  background: radial-gradient(circle at 10% 20%, #eef5ff 0%, #e0eaff 45%, #d8e4ff 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 30px 60px;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.login-page-wrapper::before {
  content: '';
  position: absolute;
  bottom: -20%;
  left: -10%;
  width: 120%;
  height: 60%;
  background: radial-gradient(ellipse at center, rgba(13, 110, 253, 0.22) 0%, rgba(99, 102, 241, 0.12) 50%, transparent 80%);
  filter: blur(60px);
  pointer-events: none;
}

/* Top-Left Logo */
.login-top-logo {
  z-index: 10;
}
.login-brand-logo-img {
  max-height: 56px;
  max-width: 220px;
  object-fit: contain;
}
.login-brand-default-icon {
  display: inline-flex;
  align-items: center;
  font-size: 1.3rem;
  color: var(--primary);
}

/* Main Body (Left Info vs Right Form Card) */
.login-main-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1140px;
  width: 100%;
  margin: 0 auto;
  z-index: 10;
  padding: 20px 0;
}

/* Left Section: Nama Aplikasi & Tagline */
.login-info-left {
  flex: 1;
  max-width: 540px;
  padding-right: 40px;
}
.login-app-title {
  font-size: 3.4rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.12;
  letter-spacing: -1.8px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #0f172a 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.login-app-tagline {
  font-size: 1.1rem;
  color: #475569;
  line-height: 1.6;
  font-weight: 400;
}

/* Right Section: Floating Form Card */
.login-form-card {
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 38px 36px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 20px 50px rgba(13, 110, 253, 0.08), 0 4px 14px rgba(0, 0, 0, 0.03);
}
.login-card-head-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}
.login-card-head-subtitle {
  color: #64748b;
  font-size: 0.88rem;
  margin-bottom: 24px;
  line-height: 1.4;
}

.login-input-group {
  margin-bottom: 18px;
}
.login-input-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
  display: block;
}
.login-input-wrap {
  position: relative;
}
.login-input-wrap .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}
.login-input-wrap .form-control {
  padding-left: 42px;
  padding-right: 42px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}
.login-input-wrap .form-control:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}
.login-input-wrap .form-control:focus ~ .input-icon {
  color: var(--primary);
}
.login-input-wrap .toggle-pw-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 8px;
}
.login-input-wrap .toggle-pw-btn:hover {
  color: #334155;
}

.login-btn-submit {
  height: 48px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: none;
  color: #fff;
  box-shadow: 0 8px 20px rgba(13, 110, 253, 0.25);
  transition: all 0.2s ease;
}
.login-btn-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(13, 110, 253, 0.35);
  color: #fff;
}

.login-footer-bar {
  z-index: 10;
  font-size: 0.82rem;
  color: #64748b;
  padding-top: 15px;
}

@media (max-width: 991.98px) {
  .login-page-wrapper {
    padding: 20px 16px;
  }
  .login-top-logo {
    text-align: center;
    margin-bottom: 10px;
  }
  .login-main-body {
    flex-direction: column;
    justify-content: center;
    gap: 20px;
    padding: 10px 0;
  }
  .login-info-left {
    max-width: 100%;
    padding-right: 0;
    text-align: center;
  }
  .login-app-title {
    font-size: 2.2rem;
  }
  .login-form-card {
    padding: 28px 20px;
    max-width: 100%;
  }
  .login-footer-bar {
    text-align: center;
  }
}

/* ---------- APP LAYOUT ---------- */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: #ffffff;
  border-right: 1px solid #e9ecef;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  overflow-y: auto;
  z-index: 1030;
  transition: transform 0.25s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
  border-bottom: 1px solid #eef1f5;
  min-height: 64px;
}
.sidebar-brand-img {
  max-height: 38px;
  max-width: 140px;
  object-fit: contain;
}
.sidebar-brand i { font-size: 1.4rem; }

.sidebar-nav { padding: 12px 10px; }
.sidebar-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #9aa5b1;
  padding: 12px 12px 6px;
  font-weight: 600;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #495057;
  text-decoration: none;
  font-size: 0.92rem;
  margin-bottom: 2px;
  transition: background .15s ease, color .15s ease;
  cursor: pointer;
}
.sidebar-link i { width: 18px; text-align: center; color: #8a94a6; }
.sidebar-link:hover { background: var(--primary-light); color: var(--primary); }
.sidebar-link:hover i { color: var(--primary); }
.sidebar-link.active { background: var(--primary); color: #fff; font-weight: 600; }
.sidebar-link.active i { color: #fff; }

/* Submenu dropdown */
.sidebar-submenu {
  padding-left: 28px;
  display: none;
}
.sidebar-group.open .sidebar-submenu {
  display: block;
}
.sidebar-group.open > .sidebar-link .chevron-icon {
  transform: rotate(90deg);
}
.chevron-icon {
  transition: transform .2s ease;
  margin-left: auto;
  font-size: 0.75rem;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 1025;
}

.app-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 64px;
  background: #fff;
  border-bottom: 1px solid #e9ecef;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.app-main { flex: 1; }

/* ---------- CARDS / WIDGETS ---------- */
.stat-card {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  border: 1px solid #eef1f5;
  box-shadow: 0 2px 10px rgba(13,110,253,0.04);
  height: 100%;
}
.stat-card .stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: var(--primary-light);
  color: var(--primary);
}
.stat-card .stat-value { font-size: 1.6rem; font-weight: 700; }
.stat-card .stat-label { color: #8a94a6; font-size: 0.85rem; }

.card { border-radius: 14px; border: 1px solid #eef1f5; }

.status-badge-clean { background: #d1f5df; color: #0f8a3c; }
.status-badge-dirty { background: #fde3e1; color: #d1332a; }

/* ---------- FORM CHECKLIST & CAMERA ---------- */
.item-check-group .btn-check:checked + .btn-outline-success { background: #198754; color: #fff; }
.item-check-group .btn-check:checked + .btn-outline-danger { background: #dc3545; color: #fff; }
.photo-upload-box {
  border: 2px dashed #d7dee8;
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  color: #8a94a6;
  font-size: .8rem;
  background: #fbfcfe;
  transition: border-color .15s, background .15s;
}
.photo-upload-box:hover { border-color: var(--primary); background: var(--primary-light); }

/* ---------- FOTO SQUARE CROP (1:1 CENTER) ---------- */
.img-square-crop {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

/* ---------- PRINT LAYOUT A4 (3x2 GRID = 6 FOTO PER HALAMAN) ---------- */
@media print {
  @page {
    size: A4 portrait;
    margin: 10mm;
  }
  .sidebar, .topbar, .no-print, .btn, nav { display: none !important; }
  .app-content { margin-left: 0 !important; }
  body { background: #fff !important; color: #000 !important; font-size: 10pt; line-height: 1.3; }
  .card { border: none !important; box-shadow: none !important; margin-bottom: 8px !important; }
  
  .print-page-break {
    page-break-after: always !important;
    break-after: page !important;
  }
  
  .print-photo-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 10px !important;
    margin-top: 10px !important;
  }
  
  .print-photo-card {
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    padding: 6px !important;
    background: #fff !important;
    box-sizing: border-box !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
  
  .print-photo-card img {
    width: 100% !important;
    height: 140px !important;
    max-height: 140px !important;
    object-fit: cover !important;
    object-position: center !important;
    border-radius: 4px !important;
  }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .app-content { margin-left: 0; }
  .sidebar-backdrop.show { display: block; }
}

