/* public/static/style.css - MPS Lesen Kritikal Styles */

/* ===================== ROOT VARIABLES ===================== */
:root {
  --mps-primary: #1d4ed8;
  --mps-primary-dark: #1e40af;
  --mps-sidebar-bg: #1e3a8a;
  --mps-sidebar-width: 260px;
  --mps-topbar-height: 60px;
  --mps-text: #1f2937;
  --mps-border: #e5e7eb;
  --mps-radius: 10px;
}

/* ===================== RESET & BASE ===================== */
*, *::before, *::after { box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; color: var(--mps-text); margin: 0; background: #f3f4f6; }

/* ===================== LAYOUT ===================== */
.app-wrapper { display: flex; min-height: 100vh; }
.main-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.page-content { flex: 1; padding: 24px; overflow-x: hidden; }

/* ===================== SIDEBAR ===================== */
.sidebar {
  width: var(--mps-sidebar-width);
  background: var(--mps-sidebar-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 50;
  transition: transform 0.3s ease;
}
.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-logo { display: flex; align-items: center; gap: 10px; }
.sidebar-nav { list-style: none; padding: 12px 0; margin: 0; flex: 1; }
.sidebar-nav li { margin: 2px 8px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s;
  position: relative;
}
.nav-item:hover { background: rgba(255,255,255,0.12); color: #fff; }
.nav-item.active { background: rgba(255,255,255,0.18); color: #fff; font-weight: 600; }
.nav-item i { width: 18px; text-align: center; font-size: 14px; flex-shrink: 0; }
.nav-item span:first-of-type { flex: 1; }
.badge {
  background: #ef4444;
  color: white;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
  display: none;
}
.nav-divider { height: 1px; background: rgba(255,255,255,0.1); margin: 8px 0 !important; }
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 40;
}
.sidebar-overlay.show { display: block; }

/* ===================== TOPBAR ===================== */
.topbar {
  height: var(--mps-topbar-height);
  background: #fff;
  border-bottom: 1px solid var(--mps-border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 30;
}
.sidebar-toggle {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #6b7280;
  padding: 6px;
  border-radius: 6px;
  display: none;
}
.topbar-title { font-size: 16px; font-weight: 600; color: var(--mps-text); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-user { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.logout-btn {
  display: flex;
  align-items: center;
  color: #6b7280;
  text-decoration: none;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 0.2s;
}
.logout-btn:hover { background: #f3f4f6; color: #ef4444; }

/* ===================== PUBLIC HEADER ===================== */
.public-header {
  background: white;
  border-bottom: 1px solid var(--mps-border);
  position: sticky;
  top: 0;
  z-index: 30;
}

/* ===================== CARDS ===================== */
.card {
  background: white;
  border: 1px solid var(--mps-border);
  border-radius: var(--mps-radius);
  overflow: hidden;
}
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--mps-border); }
.card-title { font-size: 15px; font-weight: 600; color: var(--mps-text); margin: 0; display: flex; align-items: center; }
.card-section-title { font-size: 14px; font-weight: 600; color: #374151; margin-bottom: 12px; display: flex; align-items: center; }

/* ===================== BUTTONS ===================== */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--mps-primary); color: white;
  padding: 9px 18px; border-radius: 8px; font-size: 14px; font-weight: 500;
  border: none; cursor: pointer; text-decoration: none;
  transition: background 0.2s, transform 0.1s;
}
.btn-primary:hover { background: var(--mps-primary-dark); }
.btn-primary:active { transform: scale(0.98); }
.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  background: white; color: #374151;
  padding: 9px 18px; border-radius: 8px; font-size: 14px; font-weight: 500;
  border: 1px solid var(--mps-border); cursor: pointer; text-decoration: none;
  transition: background 0.2s;
}
.btn-secondary:hover { background: #f9fafb; }
.btn-outline {
  display: inline-flex; align-items: center; justify-content: center;
  background: white; color: var(--mps-primary);
  padding: 9px 18px; border-radius: 8px; font-size: 14px; font-weight: 500;
  border: 1px solid var(--mps-primary); cursor: pointer; text-decoration: none;
  transition: all 0.2s;
}
.btn-outline:hover { background: #eff6ff; }
.btn-success {
  display: inline-flex; align-items: center; justify-content: center;
  background: #16a34a; color: white;
  padding: 9px 18px; border-radius: 8px; font-size: 14px; font-weight: 500;
  border: none; cursor: pointer; text-decoration: none;
  transition: background 0.2s;
}
.btn-success:hover { background: #15803d; }
.btn-danger {
  display: inline-flex; align-items: center; justify-content: center;
  background: #dc2626; color: white;
  padding: 9px 18px; border-radius: 8px; font-size: 14px; font-weight: 500;
  border: none; cursor: pointer; text-decoration: none;
  transition: background 0.2s;
}
.btn-danger:hover { background: #b91c1c; }
.btn-sm {
  display: inline-flex; align-items: center;
  background: #f3f4f6; color: #374151;
  padding: 5px 10px; border-radius: 6px; font-size: 12px;
  border: 1px solid #e5e7eb; cursor: pointer; text-decoration: none;
  transition: background 0.2s;
}
.btn-sm:hover { background: #e5e7eb; }
.btn-outline-sm {
  display: inline-flex; align-items: center;
  background: white; color: #1d4ed8;
  padding: 6px 12px; border-radius: 7px; font-size: 13px;
  border: 1px solid #1d4ed8; cursor: pointer; text-decoration: none;
}
.btn-outline-sm:hover { background: #eff6ff; }
.btn-primary-sm {
  display: inline-flex; align-items: center;
  background: #1d4ed8; color: white;
  padding: 6px 12px; border-radius: 7px; font-size: 13px;
  border: none; cursor: pointer; text-decoration: none;
}
.btn-primary-sm:hover { background: #1e40af; }
.btn-success-sm { display: inline-flex; align-items: center; background: #16a34a; color: white; padding: 5px 10px; border-radius: 6px; font-size: 12px; border: none; cursor: pointer; }
.btn-danger-sm { display: inline-flex; align-items: center; background: #dc2626; color: white; padding: 5px 10px; border-radius: 6px; font-size: 12px; border: none; cursor: pointer; }
.btn-hero-primary {
  display: inline-flex; align-items: center; justify-content: center;
  background: #1d4ed8; color: white;
  padding: 14px 28px; border-radius: 10px; font-size: 16px; font-weight: 600;
  text-decoration: none; transition: background 0.2s, transform 0.1s;
}
.btn-hero-primary:hover { background: #1e40af; transform: translateY(-1px); }
.btn-hero-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  background: white; color: #1d4ed8;
  padding: 14px 28px; border-radius: 10px; font-size: 16px; font-weight: 600;
  border: 2px solid #1d4ed8; text-decoration: none; transition: all 0.2s;
}
.btn-hero-secondary:hover { background: #eff6ff; }

/* ===================== FORMS ===================== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: #374151; margin-bottom: 6px; }
.form-label.required::after { content: ' *'; color: #ef4444; }
.form-input {
  width: 100%; padding: 9px 12px;
  border: 1px solid #d1d5db; border-radius: 8px;
  font-size: 14px; color: var(--mps-text);
  background: white; transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
}
.form-input:focus { outline: none; border-color: var(--mps-primary); box-shadow: 0 0 0 3px rgba(29,78,216,0.1); }
.form-input::placeholder { color: #9ca3af; }
select.form-input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7280'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; padding-right: 36px; }
.input-group { position: relative; }
.input-prefix { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 14px; color: #6b7280; font-weight: 500; pointer-events: none; z-index: 1; }
.input-group .form-input { padding-left: 48px; }
.form-actions { display: flex; gap: 10px; padding-top: 8px; }

/* ===================== ALERTS ===================== */
.alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; padding: 12px 16px; border-radius: 8px; font-size: 14px; }
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; padding: 12px 16px; border-radius: 8px; font-size: 14px; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; padding: 12px 16px; border-radius: 8px; font-size: 14px; }

/* ===================== BADGES ===================== */
.badge-status {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500;
  white-space: nowrap;
}
.badge-status-lg {
  display: inline-flex; align-items: center;
  padding: 5px 14px; border-radius: 20px; font-size: 13px; font-weight: 600;
  white-space: nowrap;
}
.role-badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600;
}
.role-officer { background: #dbeafe; color: #1d4ed8; }
.role-agency { background: #dcfce7; color: #15803d; }
.role-admin { background: #fce7f3; color: #be185d; }
.activity-badge {
  display: inline-flex; align-items: center;
  background: #f0f9ff; color: #0369a1;
  padding: 3px 10px; border-radius: 6px; font-size: 13px; font-weight: 500;
}

/* ===================== TABLES ===================== */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
  background: #f9fafb; padding: 10px 14px;
  font-size: 12px; font-weight: 600; color: #6b7280;
  text-transform: uppercase; letter-spacing: 0.05em;
  text-align: left; border-bottom: 1px solid var(--mps-border);
  white-space: nowrap;
}
.data-table td { padding: 12px 14px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f9fafb; }

/* ===================== DASHBOARD STATS ===================== */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.stat-card {
  background: white; border: 1px solid var(--mps-border);
  border-radius: var(--mps-radius); padding: 16px;
  display: flex; align-items: center; gap: 14px;
  text-decoration: none; transition: box-shadow 0.2s, border-color 0.2s;
}
.stat-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.stat-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.stat-number { font-size: 24px; font-weight: 700; line-height: 1; }
.stat-label { font-size: 12px; color: #6b7280; margin-top: 3px; }

/* ===================== MAPS ===================== */
.map-container { height: 300px; border-radius: 8px; border: 1px solid var(--mps-border); overflow: hidden; }
.map-container-sm { height: 220px; border-radius: 8px; border: 1px solid var(--mps-border); overflow: hidden; }

/* ===================== PROGRESS STEPS ===================== */
.progress-steps { display: flex; align-items: center; justify-content: center; gap: 0; overflow-x: auto; padding: 8px 0; }
.step { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 60px; }
.step span { width: 32px; height: 32px; border-radius: 50%; background: #e5e7eb; color: #9ca3af; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; transition: all 0.3s; }
.step p { font-size: 11px; color: #9ca3af; white-space: nowrap; }
.step.active span { background: var(--mps-primary); color: white; }
.step.active p { color: var(--mps-primary); font-weight: 600; }
.step.done span { background: #16a34a; color: white; }
.step-line { flex: 1; height: 2px; background: #e5e7eb; min-width: 20px; max-width: 60px; }

/* ===================== MULTI-STEP FORM ===================== */
.form-step { display: none; }
.form-step.active { display: block; }
.step-title { font-size: 17px; font-weight: 700; color: var(--mps-text); margin-bottom: 16px; display: flex; align-items: center; }

/* ===================== MYKAD UPLOAD ===================== */
.mykad-upload-area {
  border: 2px dashed #d1d5db; border-radius: 10px;
  padding: 40px 20px; text-align: center;
  cursor: pointer; transition: border-color 0.2s, background 0.2s;
}
.mykad-upload-area:hover, .mykad-upload-area.dragover { border-color: var(--mps-primary); background: #eff6ff; }
.upload-drop-zone {
  border: 2px dashed #d1d5db; border-radius: 10px;
  padding: 32px 20px; text-align: center;
  transition: border-color 0.2s, background 0.2s;
}
.upload-drop-zone:hover { border-color: var(--mps-primary); background: #eff6ff; }

/* ===================== ACTIVITY CARDS ===================== */
.activity-card {
  border: 2px solid #e5e7eb; border-radius: 10px;
  padding: 16px; cursor: pointer; display: flex; align-items: center; gap: 14px;
  transition: all 0.2s;
}
.activity-card:hover { border-color: var(--mps-primary); background: #f0f9ff; }
.activity-card.selected { border-color: var(--mps-primary); background: #eff6ff; }
.activity-card.selected .activity-icon { box-shadow: 0 0 0 3px rgba(29,78,216,0.2); }
.activity-icon { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ===================== TABS ===================== */
.tab-bar { display: flex; gap: 4px; background: #f3f4f6; padding: 4px; border-radius: 8px; width: fit-content; }
.tab-btn {
  padding: 7px 16px; border-radius: 6px; font-size: 13px; font-weight: 500;
  border: none; cursor: pointer; background: transparent; color: #6b7280;
  transition: all 0.2s;
}
.tab-btn.active { background: white; color: var(--mps-primary); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.tab-filter { display: flex; gap: 4px; flex-wrap: wrap; }
.tab-filter-btn {
  padding: 6px 14px; border-radius: 20px; font-size: 13px;
  border: 1px solid #e5e7eb; cursor: pointer; background: white; color: #6b7280;
  text-decoration: none; transition: all 0.2s;
}
.tab-filter-btn:hover { border-color: var(--mps-primary); color: var(--mps-primary); }
.tab-filter-btn.active { background: var(--mps-primary); color: white; border-color: var(--mps-primary); }

/* ===================== INFO GRID ===================== */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.info-item {}
.info-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: #9ca3af; font-weight: 600; margin-bottom: 3px; }
.info-value { font-size: 14px; color: #1f2937; }

/* ===================== FILE COMPONENTS ===================== */
.file-row {
  display: flex; align-items: center; padding: 10px 12px;
  background: #f9fafb; border: 1px solid #f3f4f6; border-radius: 8px;
  gap: 8px;
}
.file-chip {
  display: inline-flex; align-items: center;
  background: #f3f4f6; color: #374151;
  padding: 4px 10px; border-radius: 6px; font-size: 12px;
  text-decoration: none; border: 1px solid #e5e7eb;
  transition: background 0.2s;
}
.file-chip:hover { background: #e5e7eb; }

/* ===================== AGENCY RESPONSE ===================== */
.agency-response-card {
  background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px; padding: 14px;
}
.agency-status-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500;
}
.status-MENUNGGU { background: #fef9c3; color: #854d0e; }
.status-SOKONG { background: #dcfce7; color: #166534; }
.status-TIDAK_SOKONG { background: #fee2e2; color: #991b1b; }
.status-DISIFATKAN_SOKONG { background: #f1f5f9; color: #475569; }

/* ===================== DECISION RADIO ===================== */
.decision-radio { cursor: pointer; }
.decision-radio input[type="radio"] { display: none; }
.decision-label {
  display: inline-flex; align-items: center;
  padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 600;
  border: 2px solid #e5e7eb; cursor: pointer; transition: all 0.2s;
}
.decision-radio input:checked + .sokong { background: #dcfce7; border-color: #16a34a; color: #166534; }
.decision-radio input:checked + .tidak-sokong { background: #fee2e2; border-color: #dc2626; color: #991b1b; }
.decision-label:hover { border-color: #9ca3af; }

/* ===================== MODAL ===================== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 16px;
}
.modal-overlay.hidden { display: none; }
.modal-box { background: white; border-radius: 12px; width: 100%; max-width: 600px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid #e5e7eb; }
.modal-title { font-size: 16px; font-weight: 700; color: #1f2937; margin: 0; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: #9ca3af; line-height: 1; padding: 4px; }
.modal-close:hover { color: #374151; }
.modal-body { padding: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid #e5e7eb; }

/* ===================== PAGINATION ===================== */
.pagination { display: flex; justify-content: center; gap: 4px; padding: 16px; }
.pagination-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px; font-size: 14px;
  border: 1px solid #e5e7eb; background: white; color: #374151;
  text-decoration: none; transition: all 0.2s; cursor: pointer;
}
.pagination-btn:hover { background: #f3f4f6; }
.pagination-btn.active { background: var(--mps-primary); color: white; border-color: var(--mps-primary); }

/* ===================== PAGE HEADERS ===================== */
.page-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.page-title { font-size: 20px; font-weight: 700; color: #1f2937; margin: 0; }

/* ===================== ADDRESS SUGGESTIONS ===================== */
.suggestions-dropdown {
  position: absolute; top: 100%; left: 0; right: 0;
  background: white; border: 1px solid #d1d5db; border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1); z-index: 50;
  max-height: 240px; overflow-y: auto; margin-top: 4px;
}
.suggestion-item { padding: 10px 14px; font-size: 13px; cursor: pointer; border-bottom: 1px solid #f3f4f6; }
.suggestion-item:hover { background: #f0f9ff; }
.suggestion-item:last-child { border-bottom: none; }
.form-group { position: relative; }

/* ===================== HERO ===================== */
.hero-section { background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%); border-radius: 16px; padding: 60px 20px; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    transform: translateX(-100%);
    z-index: 50;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: block; }
  .page-content { padding: 16px; }
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .info-grid { grid-template-columns: 1fr; }
  .progress-steps { gap: 0; }
  .step-line { min-width: 10px; }
  .tab-bar { width: 100%; }
}
@media (min-width: 769px) {
  .sidebar-overlay { display: none !important; }
}
@media (max-width: 480px) {
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .btn-hero-primary, .btn-hero-secondary { padding: 12px 20px; font-size: 14px; }
}
