:root{
  --bg:#f5f7fb;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#6b7280;
  --border:#e5e7eb;
  --primary:#2563eb;
  --primary-2:#1d4ed8;
  --danger:#dc2626;
  --danger-2:#b91c1c;
  --secondary:#334155;
  --secondary-2:#1f2937;
  --shadow:0 10px 30px rgba(15,23,42,.08);
  --radius:14px;
  --ring:0 0 0 4px rgba(37,99,235,.18);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color:var(--text);
  background:var(--bg);
  line-height:1.45;
}

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

.container{
  width:min(1100px, calc(100% - 32px));
  margin:20px auto 60px;
}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:18px;
}

h1,h2,h3{margin:0 0 12px}
h2{font-size:22px}
h3{font-size:16px;color:#111827}
hr{border:none;border-top:1px solid var(--border); margin:14px 0}

label{
  display:block;
  font-size:13px;
  color:#111827;
  margin:10px 0 6px;
  font-weight:600;
}

input, select, textarea{
  width:100%;
  border:1px solid var(--border);
  border-radius:10px;
  padding:10px 12px;
  font-size:14px;
  background:#fff;
  color:var(--text);
  outline:none;
}
input:focus, select:focus, textarea:focus{
  border-color:rgba(37,99,235,.6);
  box-shadow:var(--ring);
}

.row{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:12px;
}
@media (max-width: 900px){
  .row{grid-template-columns: 1fr}
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border:1px solid transparent;
  border-radius:12px;
  padding:10px 14px;
  font-weight:700;
  cursor:pointer;
  user-select:none;
  font-size:14px;
}
.btn:disabled{opacity:.55; cursor:not-allowed}

.btn-primary{background:var(--primary); color:#fff}
.btn-primary:hover{background:var(--primary-2)}

.btn-danger{background:var(--danger); color:#fff}
.btn-danger:hover{background:var(--danger-2)}

.btn-secondary{
  background:transparent;
  border-color:var(--border);
  color:var(--secondary);
}
.btn-secondary:hover{
  background:#f1f5f9;
  color:var(--secondary-2);
}

.muted{color:var(--muted)}

code{
  background:#0b1220;
  color:#e5e7eb;
  padding:2px 6px;
  border-radius:8px;
  font-size:12px;
}

/* Header */
.header{
  position:sticky;
  top:0;
  z-index:10;
  background:rgba(255,255,255,.85);
  backdrop-filter:saturate(180%) blur(10px);
  border-bottom:1px solid var(--border);
}
.header-inner{
  width:min(1100px, calc(100% - 32px));
  margin:0 auto;
  padding:14px 0;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}
.brand{display:flex; align-items:center; gap:12px}
.logo{
  width:36px; height:36px;
  border-radius:10px;
  background:linear-gradient(135deg, var(--primary), #22c55e);
}
.brand-title .product{font-weight:800; letter-spacing:.2px}
.brand-title .sub{font-size:12px; color:var(--muted); margin-top:2px}

/* Footer */
.footer{
  width:min(1100px, calc(100% - 32px));
  margin:24px auto 40px;
  color:var(--muted);
  font-size:12px;
}

/* ===== Tables ===== */
table{
  width:100%;
  border-collapse:collapse;
  font-size:14px;
}
thead th{
  background:#f8fafc;
  text-align:left;
  padding:10px 12px;
  font-weight:700;
  font-size:13px;
  color:#374151;
  border-bottom:2px solid var(--border);
  white-space:nowrap;
}
tbody td{
  padding:10px 12px;
  border-bottom:1px solid var(--border);
  vertical-align:middle;
}
tbody tr:hover{background:#f9fafb}
tfoot th, tfoot td{
  padding:10px 12px;
  border-top:2px solid var(--border);
  font-weight:700;
}
.table-responsive{
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  margin:8px 0;
}

/* ===== Badges ===== */
.badge{
  display:inline-flex;
  align-items:center;
  padding:3px 10px;
  border-radius:20px;
  font-size:12px;
  font-weight:700;
  letter-spacing:.3px;
  white-space:nowrap;
}
.badge-pass{background:#dcfce7; color:#166534}
.badge-fail{background:#fee2e2; color:#991b1b}
.badge-pending{background:#fef9c3; color:#854d0e}
.badge-submitted{background:#dbeafe; color:#1e40af}

/* ===== Status Chips ===== */
.status-chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 12px;
  border-radius:20px;
  font-size:13px;
  font-weight:600;
}
.status-chip.setup{background:#e0e7ff; color:#3730a3}
.status-chip.open{background:#dcfce7; color:#166534}
.status-chip.closed{background:#f3f4f6; color:#374151}

/* ===== Nav Cards (admin setup) ===== */
.nav-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(240px, 1fr));
  gap:12px;
  margin:14px 0;
}
.nav-card{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 16px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
  text-decoration:none !important;
  color:var(--text);
  transition:box-shadow .15s, border-color .15s;
}
.nav-card:hover{
  border-color:var(--primary);
  box-shadow:0 4px 16px rgba(37,99,235,.1);
}
.nav-card .nav-icon{
  width:40px;
  height:40px;
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:18px;
  flex-shrink:0;
}
.nav-card .nav-icon.blue{background:#dbeafe; color:#2563eb}
.nav-card .nav-icon.green{background:#dcfce7; color:#16a34a}
.nav-card .nav-icon.amber{background:#fef3c7; color:#d97706}
.nav-card .nav-icon.red{background:#fee2e2; color:#dc2626}
.nav-card .nav-icon.purple{background:#ede9fe; color:#7c3aed}
.nav-card .nav-label{font-weight:600; font-size:14px}
.nav-card .nav-desc{font-size:12px; color:var(--muted); margin-top:2px}

/* ===== Stat Cards ===== */
.stat-row{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(160px, 1fr));
  gap:12px;
  margin:14px 0;
}
.stat-card{
  background:#fff;
  border:1px solid var(--border);
  border-radius:12px;
  padding:14px 16px;
  text-align:center;
}
.stat-card .stat-value{
  font-size:28px;
  font-weight:800;
  color:var(--primary);
  line-height:1.1;
}
.stat-card .stat-label{
  font-size:12px;
  color:var(--muted);
  margin-top:4px;
  font-weight:600;
}

/* ===== Progress Bar ===== */
.progress-bar{
  width:100%;
  height:8px;
  background:#e5e7eb;
  border-radius:4px;
  overflow:hidden;
  margin:8px 0;
}
.progress-bar .fill{
  height:100%;
  background:var(--primary);
  border-radius:4px;
  transition:width .3s ease;
}

/* ===== Section Heading ===== */
.section-title{
  font-size:16px;
  font-weight:700;
  color:#111827;
  margin:20px 0 8px;
  display:flex;
  align-items:center;
  gap:8px;
}

/* ===== Responsive ===== */
@media (max-width: 768px){
  .container{margin:12px auto 40px}
  .card{padding:14px}
  .header-inner{padding:10px 0}
  .stat-row{grid-template-columns:repeat(2, 1fr)}
  .nav-grid{grid-template-columns:1fr}
  table{font-size:13px}
  thead th, tbody td{padding:8px}
}
@media (max-width: 480px){
  .stat-row{grid-template-columns:1fr}
  .row{grid-template-columns:1fr}
}

/* Progress bar (outer/inner style for monitor page) */
.progress-bar-outer{height:8px;background:#e2e8f0;border-radius:6px;overflow:hidden;width:100%;}
.progress-bar-inner{height:100%;background:var(--primary);border-radius:6px;transition:width .3s;}
