/* =============================================
   DAPUR SANTRI — Global Stylesheet
   ============================================= */

:root {
  --primary: #16a34a;
  --primary-light: #22c55e;
  --primary-dark: #15803d;
  --secondary: #0ea5e9;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --white: #ffffff;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--gray-50);
  color: var(--gray-700);
  font-size: 14px;
  line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* =============================================
   NAVBAR
   ============================================= */
.navbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  color: var(--primary);
}
.navbar-brand .brand-icon { font-size: 22px; }
.navbar-nav { display: flex; align-items: center; gap: 4px; }
.navbar-nav a {
  padding: 8px 14px;
  border-radius: var(--radius);
  color: var(--gray-700);
  font-weight: 500;
  font-size: 13px;
  transition: all 0.2s;
}
.navbar-nav a:hover, .navbar-nav a.active {
  background: var(--gray-100);
  color: var(--primary);
}
.navbar-right { display: flex; align-items: center; gap: 12px; }
.user-info { font-size: 13px; color: var(--gray-500); }
.user-info strong { color: var(--gray-900); }

/* =============================================
   CONTAINER & LAYOUT
   ============================================= */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}
.page-header {
  margin-bottom: 24px;
}
.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-900);
}
.page-header p {
  color: var(--gray-500);
  margin-top: 4px;
  font-size: 13px;
}

/* =============================================
   CARDS
   ============================================= */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h2, .card-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-900);
}
.card-body { padding: 20px; }

/* =============================================
   STAT CARDS
   ============================================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--gray-200);
  transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card.green { border-left-color: var(--primary); }
.stat-card.blue  { border-left-color: var(--secondary); }
.stat-card.yellow{ border-left-color: var(--warning); }
.stat-card.red   { border-left-color: var(--danger); }
.stat-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1;
}
.stat-card .stat-label {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 4px;
}
.stat-card .stat-sub {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 6px;
}

/* =============================================
   BADGES
   ============================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}
.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef9c3; color: #a16207; }
.badge-danger  { background: #fee2e2; color: #b91c1c; }
.badge-info    { background: #dbeafe; color: #1d4ed8; }
.badge-gray    { background: var(--gray-100); color: var(--gray-500); }
.badge-pending { background: #fef3c7; color: #92400e; }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-primary {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(22,163,74,0.3);
}
.btn-primary:hover { background: var(--primary-dark); color: var(--white); }
.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
}
.btn-secondary:hover { background: var(--gray-200); color: var(--gray-700); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #dc2626; color: var(--white); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* =============================================
   TABLES
   ============================================= */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-500);
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}
tbody td {
  padding: 12px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
tbody tr:hover { background: var(--gray-50); }
tbody tr:last-child td { border-bottom: none; }

/* =============================================
   FORMS
   ============================================= */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--gray-900);
  background: var(--white);
  transition: border-color 0.2s;
  outline: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(22,163,74,0.1); }
.form-control::placeholder { color: var(--gray-300); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* =============================================
   ALERTS
   ============================================= */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.alert-warning { background: #fef9c3; color: #a16207; border: 1px solid #fef08a; }
.alert-danger  { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-info    { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }
.alert-offline { background: #fef9c3; color: #a16207; border: 1px solid #fef08a;
                 position: fixed; top: 60px; left: 0; right: 0; z-index: 200;
                 border-radius: 0; text-align: center; display: none; }
.alert-offline.show { display: flex; justify-content: center; }

/* =============================================
   PROGRESS BAR
   ============================================= */
.progress { background: var(--gray-100); border-radius: 99px; height: 8px; overflow: hidden; }
.progress-bar {
  height: 100%;
  border-radius: 99px;
  transition: width 0.5s ease;
  background: var(--primary);
}
.progress-bar.warning { background: var(--warning); }
.progress-bar.danger  { background: var(--danger); }

/* =============================================
   GRID HELPERS
   ============================================= */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .navbar-nav { display: none; }
  .container { padding: 16px; }
}
@media (max-width: 600px) {
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* =============================================
   DROPDOWN MENU
   ============================================= */
.dropdown { position: relative; }
.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  min-width: 240px;
  z-index: 1000;
  overflow: hidden;
  border: 1px solid var(--gray-200);
}
.dropdown-content.show { display: block; }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  font-size: 13px;
  color: var(--gray-700);
  transition: background 0.15s;
}
.dropdown-item:hover { background: var(--gray-50); color: var(--primary); }
.dropdown-divider { border-top: 1px solid var(--gray-100); }

/* =============================================
   MODAL
   ============================================= */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 500;
  align-items: center;
  justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--white);
  border-radius: 14px;
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
}
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close {
  background: none; border: none;
  font-size: 18px; cursor: pointer;
  color: var(--gray-500); padding: 4px;
}
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* =============================================
   WIZARD STEPS
   ============================================= */
.wizard-steps {
  display: flex;
  align-items: center;
  margin-bottom: 28px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.wizard-step {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.step-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  background: var(--gray-200);
  color: var(--gray-500);
  transition: all 0.3s;
}
.wizard-step.active .step-circle { background: var(--primary); color: var(--white); }
.wizard-step.done .step-circle   { background: var(--primary-light); color: var(--white); }
.step-label { font-size: 12px; color: var(--gray-500); font-weight: 500; }
.wizard-step.active .step-label  { color: var(--primary); font-weight: 600; }
.step-connector {
  flex: 1;
  height: 2px;
  background: var(--gray-200);
  margin: 0 8px;
  min-width: 20px;
}
.step-connector.done { background: var(--primary); }
.wizard-panel { display: none; }
.wizard-panel.active { display: block; }

/* =============================================
   COUNTER INPUT (tenaga kerja)
   ============================================= */
.counter-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.counter-item {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
}
.counter-item label { font-size: 11px; color: var(--gray-500); display: block; margin-bottom: 8px; }
.counter-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.counter-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid var(--gray-300);
  background: var(--white);
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.counter-btn:hover { background: var(--primary); color: var(--white); border-color: var(--primary); }
.counter-value {
  width: 40px; text-align: center;
  font-size: 16px; font-weight: 700;
  border: none; background: transparent;
  outline: none;
}

/* =============================================
   LOGIN PAGE
   ============================================= */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #dcfce7 0%, #f0fdf4 50%, #dbeafe 100%);
}
.login-card {
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 40px;
  width: 100%;
  max-width: 400px;
}
.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo .logo-icon { font-size: 48px; }
.login-logo h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin-top: 8px;
}
.login-logo p { font-size: 13px; color: var(--gray-500); }

/* =============================================
   EMPTY STATE
   ============================================= */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--gray-500);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
.empty-state p  { font-size: 13px; }

/* =============================================
   UTILITY
   ============================================= */
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-muted   { color: var(--gray-500); }
.text-success { color: var(--primary); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.fw-bold   { font-weight: 700; }
.fw-medium { font-weight: 500; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.gap-2 { gap: 8px; }
.flex  { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.d-none { display: none; }
