:root {
  --bg-canvas: #09090b;
  --bg-surface: #0c0c0f;
  --bg-elevated: #121216;
  --bg-hover: #18181b;
  --bg-muted: #1f1f23;
  --panel: #141c2b;
  --panel-hover: #1e293b;
  --border: #27272a;
  --border-subtle: #1e1e22;
  --text: #f8fafc;
  --text-primary: #fafafa;
  --text-secondary: #94a3b8;
  --muted: #94a3b8;
  --text-muted: #71717a;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --emerald: #10b981;
  --success: #10b981;
  --blue: #3b82f6;
  --amber: #f59e0b;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}

.hidden {
  display: none !important;
}

.mt-auto { margin-top: auto; }
.mt-16 { margin-top: 16px; }
.p-16 { padding: 16px; }
.text-right { text-align: right !important; }
.text-emerald { color: var(--emerald) !important; }
.text-amber { color: var(--amber) !important; }
.text-blue { color: var(--blue) !important; }
.text-danger { color: #f87171 !important; }

/* ========================================================================= */
/* 1. MINIMAL SHADCN / VERCEL AUTH SCREEN                                    */
/* ========================================================================= */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, #18181b 0%, #09090b 75%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.auth-box {
  width: 100%;
  max-width: 380px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 26px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.65);
}

.auth-header {
  text-align: center;
  margin-bottom: 22px;
}

.auth-brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--text-primary);
  color: var(--bg-canvas);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.auth-header h1 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.auth-header p {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.auth-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  margin-bottom: 12px;
}

.auth-meta {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ========================================================================= */
/* 2. APP SHELL (LEFT SIDEBAR + RIGHT WORKSPACE)                             */
/* ========================================================================= */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 236px;
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 14px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 16px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 14px;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--text-primary);
  color: var(--bg-canvas);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.sidebar-group-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0 8px;
  margin-bottom: 6px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.12s;
}

.nav-item-left {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--bg-muted);
  border-color: var(--border);
  color: var(--text-primary);
}

.nav-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  background: var(--bg-canvas);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 1px 6px;
  border-radius: 99px;
}

.sidebar-telemetry {
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 12px;
}

.telemetry-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
}

.telemetry-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
}

.telemetry-val {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 11px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.dot-emerald { background: var(--emerald); }
.dot-blue { background: var(--blue); }
.dot-amber { background: var(--amber); }
.dot-red { background: var(--danger); }

.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 9px;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
}

.user-name {
  font-size: 12.5px;
  font-weight: 600;
}

.user-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* ========================================================================= */
/* 3. WORKSPACE & TOPBAR                                                     */
/* ========================================================================= */
.workspace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 54px;
  background: rgba(9, 9, 11, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.page-title {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.topbar-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.stat-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}

.content-area {
  padding: 16px 20px 48px;
  width: 100%;
}

.view-pane {
  display: none;
}
.view-pane.active {
  display: block;
}

/* ========================================================================= */
/* 4. FILTER BAR & 5-COLUMN PROFILE GRID (GIỐNG 100% LMS-WORKER)             */
/* ========================================================================= */
.filter-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  pointer-events: none;
  opacity: 0.7;
}

.search-box input {
  width: 100%;
  background: #0b0f17;
  border: 1px solid #2a3649;
  border-radius: 6px;
  padding: 6px 28px 6px 30px;
  font-size: 12.5px;
  color: var(--text);
  outline: none;
}
.search-box input:focus { border-color: var(--primary); }

.search-clear-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
}
.search-clear-btn:hover { color: #f87171; }

.filter-select-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-select-wrap label {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.filter-select-wrap select {
  background: #0b0f17;
  border: 1px solid #2a3649;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text);
  outline: none;
  cursor: pointer;
}

.filter-count {
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
  white-space: nowrap;
}

/* Profile Grid (5 Cột mặc định trên mọi màn hình Laptop/PC) */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 1180px) {
  .profile-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .profile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .profile-grid { grid-template-columns: 1fr; }
}

/* Profile Card Compact & Viền Sắc Nét */
.profile-card {
  background: #141c2b;
  border: 1.5px solid rgba(148, 163, 184, 0.28);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  cursor: pointer;
}
.profile-card:hover {
  border-color: rgba(96, 165, 250, 0.6);
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  transform: translateY(-1px);
}
/* Đang chạy: Viền màu xanh dương (Blue) nổi bật */
.profile-card.is-running {
  border: 2.5px solid #3b82f6;
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.28), inset 0 0 10px rgba(59, 130, 246, 0.05);
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.08) 0%, #141c2b 100%);
}
/* Đủ giờ hôm nay: Viền màu vàng nổi bật */
.profile-card.is-waiting-reset {
  border: 2.5px solid #f59e0b;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.28), inset 0 0 10px rgba(245, 158, 11, 0.06);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.08) 0%, #141c2b 100%);
}
/* Đã hoàn thành (Done): Viền màu xanh lá to hơn */
.profile-card.is-done {
  border: 3.5px solid #10b981;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.32), inset 0 0 10px rgba(16, 185, 129, 0.06);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.08) 0%, #141c2b 100%);
}
.profile-card.card-focused {
  box-shadow: 0 0 0 2px #3b82f6, 0 8px 24px rgba(59,130,246,0.35);
  border-color: #60a5fa;
}
.btn-focus-active {
  background: rgba(59,130,246,0.18) !important;
  color: #60a5fa !important;
  border-color: rgba(59,130,246,0.5) !important;
}
.btn-focus-active:hover {
  background: rgba(59,130,246,0.35) !important;
  color: #93c5fd !important;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
}
.prof-title {
  font-size: 11.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.prof-name-text {
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prof-cmd-badge {
  font-size: 11px;
  color: #60a5fa;
  background: rgba(59,130,246,0.12);
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.prof-tags {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.sub-tag {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  line-height: 1.1;
  padding: 2.5px 6px;
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
}
.sub-tag.tag-win {
  background: rgba(148, 163, 184, 0.14);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.3);
}
.sub-tag.tag-platform-ecotek {
  background: rgba(168, 85, 247, 0.14);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.32);
}
.sub-tag.tag-platform-huelms {
  background: rgba(20, 184, 166, 0.14);
  color: #2dd4bf;
  border: 1px solid rgba(20, 184, 166, 0.32);
}
.sub-tag.tag-cam-off {
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.2);
}
.sub-tag.tag-cam-virtual {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.28);
}
.sub-tag.tag-speed {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.25);
}
.sub-tag.tag-timer {
  background: rgba(192, 132, 252, 0.12);
  color: #c084fc;
  border: 1px solid rgba(192, 132, 252, 0.28);
}
.sub-tag.tag-warn {
  background: rgba(239, 68, 68, 0.14);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-box {
  background: #0b0f17;
  border: 1px solid #2a3649;
  border-radius: 6px;
  padding: 7px 9px;
  font-size: 11.5px;
}
.status-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
  color: var(--muted);
  gap: 6px;
}
.status-line span { white-space: nowrap; flex-shrink: 0; }
.status-line strong {
  color: var(--text);
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.quiz-status {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed #2a3649;
  color: #60a5fa;
  font-weight: 500;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: 6px 8px;
  margin: -2px -8px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.progress-wrap:hover {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.25);
}
.progress-bar {
  height: 7px;
  background: #0b0f17;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #2a3649;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  transition: width 0.3s;
}
.progress-fill.is-all-passed,
.profile-card.is-done .progress-fill {
  background: #10b981 !important;
}

.card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid #2a3649;
}

/* ========================================================================= */
/* 5. SURFACE CARDS & SHADCN DATA TABLES (CHO TAB QUEUES, AI, CLUSTER)       */
/* ========================================================================= */
.surface-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.table-toolbar {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.card-heading {
  font-size: 13.5px;
  font-weight: 600;
}

.card-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.shadcn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.shadcn-table th {
  text-align: left;
  padding: 9px 14px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
  background: #0e0e12;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.shadcn-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.shadcn-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.cell-primary {
  font-weight: 600;
  color: var(--text-primary);
}

.cell-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}

.avatar-stack {
  display: flex;
  align-items: center;
  gap: 4px;
}

.avatar-mini {
  width: 30px;
  height: 30px;
  border-radius: 5px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--bg-canvas);
}

/* ========================================================================= */
/* 6. BUTTONS & BADGES                                                       */
/* ========================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  color: #fff;
  white-space: nowrap;
}

.btn-sm {
  padding: 4px 8px;
  font-size: 11.5px;
  border-radius: 6px;
}

.btn-xs {
  padding: 3px 7px;
  font-size: 11.5px;
}

.btn-full {
  width: 100%;
}

.btn-primary { background: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: var(--success); }
.btn-danger { background: var(--danger); }

.btn-outline {
  background: transparent;
  border-color: #2a3649;
  color: var(--text);
}
.btn-outline:hover { background: var(--panel-hover); }

.btn-white {
  background: var(--text-primary);
  color: var(--bg-canvas);
  font-weight: 600;
}
.btn-white:hover {
  background: #e4e4e7;
}

.btn-secondary {
  background: var(--bg-elevated);
  border-color: var(--border);
  color: var(--text-primary);
}
.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: #3f3f46;
}

.btn-icon {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.btn-icon:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.action-group {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge-running { background: rgba(16, 185, 129, 0.15); border-color: rgba(16, 185, 129, 0.35); color: #34d399; }
.badge-queued { background: rgba(245, 158, 11, 0.15); border-color: rgba(245, 158, 11, 0.35); color: #fbbf24; }
.badge-stopped { background: rgba(148, 163, 184, 0.12); border-color: rgba(148, 163, 184, 0.25); color: #94a3b8; }
.badge-done { background: rgba(16, 185, 129, 0.22); border-color: rgba(16, 185, 129, 0.45); color: #34d399; }
.badge-neutral { background: var(--bg-elevated); border-color: var(--border); color: var(--text-secondary); }

/* ========================================================================= */
/* 7. SEGMENTED SWITCHER & SPLIT GRIDS                                       */
/* ========================================================================= */
.segmented-bar {
  display: inline-flex;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 14px;
}

.seg-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.seg-btn.active {
  background: var(--bg-muted);
  color: var(--text-primary);
}

.sub-pane {
  display: none;
}
.sub-pane.active {
  display: block;
}

.split-2col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 1100px) {
  .split-2col {
    grid-template-columns: 1fr;
  }
}

.terminal-log {
  background: #060608;
  padding: 12px 14px;
  max-height: 220px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: var(--text-secondary);
}

/* ========================================================================= */
/* 8. MODALS, TOGGLE SWITCHES & RUBRIC TABLE (GIỐNG 100% LMS-WORKER)         */
/* ========================================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1500;
  padding: 20px;
}
.modal-backdrop.open { display: flex; }

.modal {
  background: #171f2c;
  border: 1px solid #2a3649;
  border-radius: 14px;
  width: 100%;
  max-width: 780px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 22px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #2a3649;
}

.modal-section-title {
  font-weight: 700;
  font-size: 13px;
  color: #60a5fa;
  margin: 14px 0 8px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px dashed rgba(255,255,255,0.08);
  padding-bottom: 4px;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin-bottom: 14px; }
@media (max-width: 720px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; gap: 10px; }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field label {
  font-size: 11.5px;
  font-weight: 600;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 5px;
}
.field input[type="text"],
.field input[type="password"],
.field input[type="number"],
.field input[type="time"],
.field select {
  width: 100%;
  background: #090d14;
  border: 1px solid #334155;
  border-radius: 7px;
  padding: 8px 12px;
  font-size: 13px;
  color: #f1f5f9;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus,
.field select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}
.field input[type="file"] {
  width: 100%;
  background: #090d14;
  border: 1px dashed #334155;
  border-radius: 7px;
  padding: 8px 12px;
  font-size: 12px;
  color: #94a3b8;
  cursor: pointer;
}

/* Toggle switch cards */
.toggle-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}
.toggle-card {
  background: #0b0f17;
  border: 1px solid #2a3649;
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
  user-select: none;
}
.toggle-card:hover {
  border-color: #3b82f6;
  background: #0f1624;
}
.toggle-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.toggle-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}
.toggle-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
}
.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 22px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #243042;
  transition: .22s ease;
  border-radius: 22px;
  border: 1px solid #2a3649;
}
.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: #cbd5e1;
  transition: .22s ease;
  border-radius: 50%;
}
.switch input:checked + .slider {
  background-color: #10b981;
  border-color: #10b981;
}
.switch input:checked + .slider:before {
  transform: translateX(20px);
  background-color: #ffffff;
}

/* Rubric modal summary & table */
.rubric-summary-card {
  background: #0b0f17;
  border: 1px solid #2a3649;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 16px;
}
.rubric-summary-stats {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.rubric-stat-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.rubric-stat-val {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-top: 2px;
}
.rubric-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 12px;
}
.rubric-table th, .rubric-table td {
  border: 1px solid #2a3649;
  padding: 6px 10px;
  text-align: left;
}
.rubric-table th { background: #0b0f17; color: var(--muted); }
.rubric-badge-code {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 11px;
}

.log-box {
  background: #090d14;
  border: 1px solid #2a3649;
  border-radius: 8px;
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  max-height: 200px;
  overflow-y: auto;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.log-line {
  padding: 4px 6px;
  border-radius: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  word-break: break-word;
  line-height: 1.4;
}
.log-line.log-latest {
  background: rgba(59, 130, 246, 0.12);
  border-left: 3px solid #3b82f6;
  color: #93c5fd;
  font-weight: 600;
}
.log-badge-new {
  display: inline-block;
  background: #3b82f6;
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  margin-right: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.toast-container {
  position: fixed;
  bottom: 18px;
  right: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 3000;
}
.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--text-primary);
  color: var(--text-primary);
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}
