:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --success: #10b981;
  --danger: #ef4444;
  --radius: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  display: flex;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
}

/* Sidebar Navbar */
.sidebar {
  width: 250px;
  background-color: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.2rem;
  color: var(--primary);
  margin-bottom: 32px;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.nav-btn:hover, .nav-btn.active {
  background-color: #eff6ff;
  color: var(--primary);
}

/* Main Content Area */
.main-content {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
}

.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.top-header h1 {
  font-size: 1.6rem;
  margin-bottom: 4px;
}

.top-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.header-actions {
  display: flex;
  gap: 12px;
}

/* Tombol-tombol */
.btn {
  padding: 10px 18px;
  border-radius: var(--radius);
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: 0.2s;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary { background: #e2e8f0; color: var(--text-main); }
.btn-secondary:hover { background: #cbd5e1; }

.btn-danger { background: #fee2e2; color: var(--danger); }
.btn-danger:hover { background: #fca5a5; }

.btn-sm { padding: 6px 12px; font-size: 0.85rem; }

/* Dashboard Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-card span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.stat-card h3 {
  font-size: 1.5rem;
}

/* Tab Management */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Grid Proyek */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.project-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
}

.project-card h3 {
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.p-finance {
  background: #f8fafc;
  padding: 12px;
  border-radius: 8px;
  margin: 16px 0;
  font-size: 0.88rem;
}

.p-finance div {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

/* Timeline Laporan Harian */
.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.timeline-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  display: flex;
  gap: 20px;
}

.timeline-item img {
  width: 140px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* Card Box & Tables */
.card-box {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.data-table th, .data-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.data-table th {
  background: #f8fafc;
  color: var(--text-muted);
}

/* Pop-up Modal */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(15, 23, 42, 0.5);
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.open { display: flex; }

.modal-content {
  background: var(--bg-card);
  width: 100%;
  max-width: 450px;
  border-radius: var(--radius);
  padding: 24px;
}

.modal-content h3 {
  margin-bottom: 16px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 6px;
  font-weight: 600;
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

/* Mode Kamera Buttons */
.camera-mode-buttons {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.btn-mode {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: 0.2s;
}

.mode-hp {
  background: #2563eb;
  color: white;
}

.mode-hp input[type="file"] {
  display: none;
}

.mode-webcam {
  background: #0f172a;
  color: white;
}