*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f5f7fa; --surface: #ffffff; --surface-hover: #f0f4ff;
  --border: #e2e8f0; --text: #1a202c; --text-secondary: #64748b;
  --primary: #3b82f6; --primary-dark: #2563eb; --primary-light: #dbeafe;
  --success: #10b981; --success-light: #d1fae5;
  --warning: #f59e0b; --warning-light: #fef3c7;
  --danger: #ef4444; --danger-light: #fee2e2;
  --radius: 8px; --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
}
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; display: flex; min-height: 100vh; }
body > div { flex: 1; }

/* Sidebar */
.sidebar { width: 220px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 60; }
.sidebar-brand { padding: 20px 16px; border-bottom: 1px solid var(--border); }
.sidebar-brand h1 { font-size: 1rem; font-weight: 700; line-height: 1.3; }
.sidebar-brand span { font-size: .7rem; color: var(--text-secondary); }
.sidebar-nav { flex: 1; padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 6px; cursor: pointer; font-size: .875rem; font-weight: 500; color: var(--text-secondary); transition: all .15s; border: none; background: none; width: 100%; text-align: left; text-decoration: none; }
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }
.nav-item svg { flex-shrink: 0; width: 18px; height: 18px; }
.auth-user-panel {
  margin: 4px 8px 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}
.auth-user-panel__label {
  display: block;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.auth-user-panel__name {
  display: block;
  margin-top: 2px;
  font-size: .84rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.auth-user-panel__meta-label {
  display: block;
  margin-top: 10px;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.auth-user-panel__role {
  display: block;
  margin-top: 2px;
  font-size: .8rem;
  color: var(--text);
  line-height: 1.4;
}

.main-content { flex: 1; margin-left: 220px; }
.container { max-width: 1200px; margin: 0 auto; padding: 24px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-header h2 { font-size: 1rem; font-weight: 600; }
.card-body { padding: 20px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border: none; border-radius: 6px; font-size: .875rem; font-weight: 500; cursor: pointer; transition: all .15s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn-sm { padding: 4px 10px; font-size: .8rem; }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }

/* Form */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: .8rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px; }
.form-input, .form-textarea, .form-select { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: .875rem; transition: border-color .15s; font-family: inherit; }
.form-input:focus, .form-textarea:focus, .form-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.form-textarea { resize: vertical; min-height: 80px; }

/* Question list */
.q-list { display: flex; flex-direction: column; }
.q-item { display: flex; align-items: flex-start; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .15s; }
.q-item:last-child { border-bottom: none; }
.q-item:hover { background: var(--surface-hover); }
.q-item.active { background: var(--primary-light); }
.q-sn { flex-shrink: 0; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 2px 10px; font-size: .75rem; font-weight: 600; color: var(--text-secondary); min-width: 90px; text-align: center; margin-top: 2px; }
.q-sn.accept { background: var(--success-light); color: #065f46; border-color: #a7f3d0; }
.q-sn.review { background: var(--warning-light); color: #92400e; border-color: #fde68a; }
.q-text { flex: 1; font-size: .75rem; line-height: 1.5; }
.q-actions { flex-shrink: 0; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.q-item:hover .q-actions { opacity: 1; }

/* Result list */
.result-item { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .15s; }
.result-item:last-child { border-bottom: none; }
.result-item:hover { background: var(--surface-hover); }
.result-badge { flex-shrink: 0; width: 10px; height: 10px; border-radius: 50%; }
.result-badge.pass { background: var(--success); }
.result-badge.fail { background: var(--danger); }
.result-badge.warn { background: var(--warning); }
.result-badge.pending { background: var(--border); }
.result-sn { flex-shrink: 0; font-size: .75rem; font-weight: 600; color: var(--text-secondary); min-width: 90px; }
.result-summary { flex: 1; font-size: .75rem; }
.result-status { flex-shrink: 0; font-size: .75rem; font-weight: 600; padding: 2px 10px; border-radius: 12px; }
.status-pass { background: var(--success-light); color: #065f46; }
.status-fail { background: var(--danger-light); color: #991b1b; }
.status-warn { background: var(--warning-light); color: #92400e; }
.status-pending { background: var(--bg); color: var(--text-secondary); }

/* Detail section */
.detail-section { margin-bottom: 20px; }
.detail-section h4 { font-size: .75rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.detail-section p, .detail-section pre { font-size: .75rem; line-height: 1.7; }

/* Table column header */
.table-header { display:flex; align-items:center; gap:12px; padding:8px 20px; border-bottom:2px solid var(--border); font-size:.75rem; font-weight:600; color:var(--text-secondary); text-transform:uppercase; letter-spacing:.5px; background:var(--bg); }
.table-header--plain { border-bottom-width:1px; letter-spacing:.4px; background:transparent; }

/* Table body cell */
.table-cell { font-size:.75rem; }

/* Search */
.search-box { position: relative; }
.search-box input { padding-left: 36px; }
.search-box svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-secondary); }

/* Category filter */
.filter-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-pill { padding: 4px 12px; border-radius: 16px; font-size: .75rem; font-weight: 500; border: 1px solid var(--border); background: var(--surface); cursor: pointer; transition: all .15s; }
.filter-pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.filter-pill:hover:not(.active) { border-color: var(--primary); color: var(--primary); }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg); width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: 1rem; font-weight: 600; }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* Toast */
.toast { position: fixed; bottom: 24px; right: 24px; background: #1e293b; color: #fff; padding: 12px 20px; border-radius: 8px; font-size: .875rem; z-index: 200; box-shadow: var(--shadow-lg); }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { width: 56px; }
  .sidebar-brand h1, .sidebar-brand span, .nav-item span { display: none; }
  .nav-item { justify-content: center; padding: 12px; }
  .auth-user-panel { display: none; }
  .main-content { margin-left: 56px; }
  .container { padding: 12px; }
}
