:root { --primary: #0A3D91; --secondary: #f8fafc; --text: #1e293b; --border: #e2e8f0; }
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Prompt', sans-serif; }
body { background-color: #f1f5f9; color: var(--text); line-height: 1.6; }

.navbar { background-color: var(--primary); padding: 15px 0; color: white; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); }
.nav-container { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; padding: 0 20px; }
.logo { font-size: 1.3rem; font-weight: 600; }

.nav-links button { background: none; border: none; color: #cbd5e1; font-size: 1rem; cursor: pointer; padding: 8px 15px; border-radius: 6px; transition: 0.3s; margin-left: 10px; }
.nav-links button.active, .nav-links button:hover { background-color: rgba(255,255,255,0.2); color: white; }

.container { max-width: 1200px; margin: 30px auto; padding: 0 20px; }
.hidden { display: none !important; }

.card { background: white; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); overflow: hidden; margin-bottom: 30px; }
.card-header { background: var(--secondary); padding: 20px 25px; border-bottom: 1px solid var(--border); }
.card-header h2 { font-size: 1.4rem; color: var(--primary); }
.card-body { padding: 25px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 15px; } 

.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; color: #475569; }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 10px 15px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 1rem; outline: none; transition: 0.3s; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(10,61,145,0.1); }

.img-preview { max-width: 100%; height: auto; max-height: 300px; border-radius: 8px; margin-top: 15px; border: 1px solid var(--border); }

.btn-primary { background-color: var(--primary); color: white; border: none; padding: 12px 25px; border-radius: 6px; cursor: pointer; font-size: 1.05rem; font-weight: 500; width: 100%; transition: 0.3s; }
.btn-primary:hover { background-color: #082d6b; }
.btn-primary:disabled { background-color: #94a3b8; cursor: not-allowed; }
.btn-success { background-color: #10b981; color: white; border: none; padding: 12px 25px; border-radius: 6px; cursor: pointer; font-size: 1.05rem; font-weight: 500; width: 100%; transition: 0.3s; }
.btn-success:hover { background-color: #059669; }

.flex-between { display: flex; justify-content: space-between; align-items: center; }
.btn-export { background-color: #10b981; color: white; border: none; padding: 8px 15px; border-radius: 6px; cursor: pointer; font-size: 0.95rem; font-family: 'Prompt'; }
.btn-export:hover { filter: brightness(0.9); }

.table-responsive { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 800px; }
.data-table th, .data-table td { padding: 12px 15px; border-bottom: 1px solid var(--border); text-align: left; }
.data-table th { background-color: #f8fafc; font-weight: 600; color: #475569; }
.data-table tr:hover { background-color: #f1f5f9; }

.risk-แดง { background: #fee2e2; color: #ef4444; padding: 4px 10px; border-radius: 20px; font-size: 0.85rem; font-weight: 600; }
.risk-เหลือง { background: #fef3c7; color: #d97706; padding: 4px 10px; border-radius: 20px; font-size: 0.85rem; font-weight: 600; }
.risk-เขียว { background: #d1fae5; color: #059669; padding: 4px 10px; border-radius: 20px; font-size: 0.85rem; font-weight: 600; }

.status-select { padding: 6px; border-radius: 4px; border: 1px solid #cbd5e1; font-family: 'Prompt'; font-size: 0.95rem; width: 100%; min-width: 160px; max-width: 200px; }
.chart-container { position: relative; height: 280px; width: 100%; }

.pagination { margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--border); }
.btn-page { background: white; border: 1px solid #cbd5e1; padding: 6px 15px; border-radius: 6px; cursor: pointer; font-family: 'Prompt'; color: #475569; }
.btn-page:hover:not(:disabled) { background: #f1f5f9; }
.btn-page:disabled { opacity: 0.5; cursor: not-allowed; }

.page-numbers { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; align-items: center; }
.btn-page-num { background: white; border: 1px solid #cbd5e1; padding: 5px 12px; border-radius: 6px; cursor: pointer; font-family: 'Prompt'; color: #475569; transition: 0.3s; min-width: 35px; }
.btn-page-num:hover { background: #f1f5f9; }
.btn-page-num.active { background: var(--primary); color: white; border-color: var(--primary); font-weight: 600; cursor: default; }
.page-ellipsis { color: #94a3b8; padding: 0 5px; font-weight: bold; }

.system-footer { text-align: center; padding: 20px; color: #64748b; font-size: 0.9rem; margin-top: 20px; }

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
  .flex-between { flex-direction: column; align-items: flex-start; gap: 15px; }
  .pagination { flex-direction: row; justify-content: space-between; align-items: center;}
}