@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg: #030712;
  --bg-gradient: radial-gradient(circle at 80% 0%, #111827 0%, #030712 100%);
  --accent: #f5a623;
  --accent2: #ff7f3f;
  --accent-gradient: linear-gradient(135deg, #f5a623 0%, #ff7f3f 100%);
  --accent-glow: rgba(245, 166, 35, 0.2);
  
  /* Glassmorphism Configuration */
  --glass-bg: rgba(17, 24, 39, 0.45);
  --glass-bg-hover: rgba(24, 37, 61, 0.6);
  --glass-bg-active: rgba(245, 166, 35, 0.08);
  --glass-border: rgba(255, 255, 255, 0.05);
  --glass-border-hover: rgba(255, 255, 255, 0.12);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
  --glass-blur: 16px;
  
  --ink: #f3f4f6;
  --muted: #9ca3af;
  --line: rgba(255, 255, 255, 0.06);
  
  /* Status Color System */
  --ok: #10b981;
  --ok-bg: rgba(16, 185, 129, 0.08);
  --ok-border: rgba(16, 185, 129, 0.25);
  
  --info: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.08);
  --info-border: rgba(59, 130, 246, 0.25);
  
  --warn: #f59e0b;
  --warn-bg: rgba(245, 158, 11, 0.08);
  --warn-border: rgba(245, 158, 11, 0.25);
  
  --err: #ef4444;
  --err-bg: rgba(239, 68, 68, 0.08);
  --err-border: rgba(239, 68, 68, 0.25);
  
  --wa: #22c55e;
  --wa-bg: rgba(34, 197, 94, 0.08);
  --wa-border: rgba(34, 197, 94, 0.25);
  --wa-solid: #25d366;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

* { 
  box-sizing: border-box; 
  outline: none;
}

body {
  margin: 0;
  background: var(--bg);
  background-image: var(--bg-gradient);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  letter-spacing: -0.012em;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Background Ambient Glows */
.ambient-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(245, 166, 35, 0.06) 0%, rgba(255, 127, 63, 0) 70%);
  top: -150px;
  right: 10%;
  z-index: -1;
  pointer-events: none;
  filter: blur(50px);
}
.ambient-glow-2 {
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.05) 0%, rgba(168, 85, 247, 0) 70%);
  bottom: 5%;
  left: 5%;
  z-index: -1;
  pointer-events: none;
  filter: blur(40px);
}

/* App Grid Container */
.app-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Sidebar Layout */
.sidebar {
  background: rgba(8, 12, 24, 0.7);
  border-right: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 100;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 36px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.sidebar .brand .logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-gradient);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 18px;
  color: #030712;
  box-shadow: 0 4px 20px rgba(245, 166, 35, 0.35);
  transition: transform 0.3s ease;
}

.sidebar .brand:hover .logo {
  transform: rotate(6deg) scale(1.05);
}

.sidebar .brand-text h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.sidebar .brand-text span {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* Navigation Menu */
.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  text-decoration: none;
}

.nav-item:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  background: var(--accent-gradient);
  color: #030712;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(245, 166, 35, 0.25);
}

/* Sidebar Footer */
.sidebar-footer {
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-footer .user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-footer .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: grid;
  place-items: center;
  font-size: 14px;
  border: 1px solid var(--glass-border);
}

.sidebar-footer .username {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.sidebar-footer .logout-btn {
  color: var(--muted);
  text-decoration: none;
  font-size: 16px;
  padding: 6px;
  border-radius: 8px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-footer .logout-btn:hover {
  color: var(--err);
  background: rgba(239, 68, 68, 0.1);
}

/* Main Content Workspace */
.main-content {
  padding: 36px 40px;
  overflow-y: auto;
  height: 100vh;
}

/* Responsive Grid layouts */
@media (max-width: 1024px) {
  .app-container {
    grid-template-columns: 1fr;
  }
  .sidebar {
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--glass-border);
    padding: 20px;
  }
  .sidebar .brand {
    margin-bottom: 20px;
    padding-bottom: 14px;
  }
  .nav-menu {
    flex-direction: row;
    flex-wrap: wrap;
    margin-bottom: 14px;
  }
  .nav-item {
    width: auto;
  }
  .main-content {
    height: auto;
    overflow-y: visible;
    padding: 24px 16px;
  }
}

/* Login Wrapper Centered */
.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login.card {
  width: 100%;
  max-width: 400px;
  margin: 0;
}

/* Premium Glass Container Panels */
.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 26px;
  margin-bottom: 24px;
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

.card-hd {
  display: flex; 
  align-items: center; 
  justify-content: space-between;
  gap: 16px; 
  flex-wrap: wrap; 
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.card-hd h2 { 
  margin: 0; 
  font-size: 20px; 
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.card-hd .courses { 
  color: var(--muted); 
  font-size: 13.5px; 
  margin-top: 4px;
}

/* Banner Alert Panels */
.banner {
  padding: 14px 20px; 
  border-radius: 14px; 
  margin-bottom: 20px;
  background: rgba(239, 68, 68, 0.1); 
  border: 1px solid rgba(239, 68, 68, 0.25); 
  color: #fecdd3;
  font-size: 14px;
  line-height: 1.45;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Custom Tabs Panel Animation */
.panel { 
  display: none; 
  animation: slideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.panel.active { 
  display: block; 
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Connected Sheets Selector Section */
.sheet-grid {
  display: flex;
  overflow-x: auto;
  gap: 12px;
  padding-bottom: 8px;
  margin-bottom: 16px;
  scrollbar-width: thin;
}

.sheet-card {
  flex: 0 0 240px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.sheet-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: transparent;
  transition: background 0.2s ease;
}

.sheet-card:hover { 
  border-color: var(--glass-border-hover); 
  transform: translateY(-2px);
  background: var(--glass-bg-hover);
  box-shadow: 0 6px 16px 0 rgba(0, 0, 0, 0.45);
}

.sheet-card.active {
  border-color: var(--accent);
  background: var(--glass-bg-active);
  box-shadow: 0 0 15px rgba(245, 166, 35, 0.1), var(--glass-shadow);
}

.sheet-card.active::before {
  background: var(--accent-gradient);
}

.sheet-card h3 { 
  margin: 0; 
  font-size: 14.5px; 
  font-weight: 600;
  color: #fff;
}

.sheet-card .meta { 
  color: var(--muted); 
  font-size: 11.5px; 
  margin-bottom: 6px;
  line-height: 1.3;
}

.sheet-card .chips { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 4px;
}

.sheet-card.paused { 
  opacity: 0.55;
  filter: grayscale(30%);
}

/* Stat row cards */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px; 
  margin-bottom: 16px;
}

.stat-pill {
  background: rgba(0, 0, 0, 0.2); 
  border: 1px solid var(--glass-border);
  border-radius: 12px; 
  padding: 10px 12px; 
  cursor: pointer; 
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.stat-pill::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0; height: 3px;
  background: transparent;
  transition: background 0.2s;
}

.stat-pill:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.15);
}

.stat-pill.active { 
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
}

.stat-pill.active[data-tone="ok"]::after { background: var(--ok); }
.stat-pill.active[data-tone="info"]::after { background: var(--info); }
.stat-pill.active[data-tone="err"]::after { background: var(--err); }
.stat-pill.active[data-tone="warn"]::after { background: var(--warn); }
.stat-pill.active:not([data-tone])::after { background: var(--accent); }

.stat-pill .n { 
  font-size: 22px; 
  font-weight: 700; 
  line-height: 1.1; 
  color: #fff;
  letter-spacing: -0.02em;
}

.stat-pill .l { 
  font-size: 10px; 
  color: var(--muted); 
  text-transform: uppercase; 
  letter-spacing: 0.05em; 
  margin-top: 3px; 
  font-weight: 600;
}

.stat-pill[data-tone="ok"] .n { color: var(--ok); }
.stat-pill[data-tone="info"] .n { color: var(--info); }
.stat-pill[data-tone="err"] .n { color: var(--err); }
.stat-pill[data-tone="warn"] .n { color: var(--warn); }

/* Control Toolbars */
.toolbar {
  display: flex; 
  flex-wrap: wrap; 
  gap: 10px; 
  align-items: center; 
  margin-bottom: 18px;
}

.toolbar input[type="search"],
.toolbar select {
  background: rgba(0, 0, 0, 0.3); 
  border: 1px solid var(--glass-border); 
  border-radius: 10px;
  color: var(--ink); 
  padding: 10px 14px; 
  font-family: inherit;
  font-size: 14px;
  transition: all 0.2s ease;
}

.toolbar input[type="search"] { 
  min-width: 260px; 
  flex: 1; 
  max-width: 340px; 
}

.toolbar input[type="search"]:focus,
.toolbar select:focus {
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.45);
  box-shadow: 0 0 12px rgba(245, 166, 35, 0.12);
}

.toolbar select { 
  min-width: 180px; 
  cursor: pointer;
}

/* Beautiful Action Buttons */
.btn {
  border: 1px solid var(--glass-border); 
  background: rgba(255, 255, 255, 0.04); 
  color: var(--ink);
  padding: 10px 18px; 
  border-radius: 10px; 
  font-weight: 600; 
  font-family: inherit;
  font-size: 13.5px;
  cursor: pointer;
  text-decoration: none; 
  display: inline-flex; 
  align-items: center; 
  gap: 8px; 
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover:not(:disabled) { 
  border-color: rgba(255, 255, 255, 0.18); 
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}
.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled { 
  opacity: 0.3; 
  cursor: not-allowed; 
}

.btn.primary { 
  background: var(--accent-gradient); 
  color: #030712; 
  border: 0;
  box-shadow: 0 4px 15px rgba(245, 166, 35, 0.2);
}
.btn.primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #ffb33f 0%, #ff955f 100%);
  box-shadow: 0 6px 20px rgba(245, 166, 35, 0.3);
}

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

.btn.wa { 
  background: var(--wa-solid); 
  color: #fff; 
  border: 0; 
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.25);
}
.btn.wa:hover:not(:disabled) {
  background: #20ba5a;
  box-shadow: 0 6px 16px rgba(34, 197, 94, 0.35);
}

.btn.danger { 
  color: var(--err); 
  border-color: rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.03);
}
.btn.danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.45);
}

/* Glassmorphic Table Wrap */
.tbl-wrap {
  overflow: auto;
  max-height: calc(100vh - 270px);
  min-height: 320px;
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.15);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.25);
}

table.data { 
  width: 100%; 
  border-collapse: separate; 
  border-spacing: 0;
}

table.data th, table.data td {
  padding: 10px 12px; 
  border-bottom: 1px solid var(--line);
  text-align: left; 
  vertical-align: middle;
}

table.data th {
  font-size: 11px; 
  font-weight: 700;
  text-transform: uppercase; 
  letter-spacing: 0.08em;
  color: var(--muted); 
  background: #090e1a; 
  position: sticky; 
  top: 0; 
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

table.data tr:last-child td {
  border-bottom: none;
}

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

table.data td strong {
  color: #fff;
  font-weight: 500;
}

.mono { 
  font-family: 'JetBrains Mono', Consolas, monospace; 
  font-size: 12px; 
}

/* Badges */
.badge {
  display: inline-flex; 
  align-items: center; 
  gap: 6px;
  padding: 5px 12px; 
  border-radius: 999px; 
  font-size: 12px; 
  font-weight: 600;
  border: 1px solid var(--line); 
  white-space: nowrap;
}
.badge.success { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-border); }
.badge.info { color: var(--info); background: var(--info-bg); border-color: var(--info-border); }
.badge.danger { color: var(--err); background: var(--err-bg); border-color: var(--err-border); }
.badge.warning { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-border); }
.badge.muted { color: var(--muted); background: rgba(255, 255, 255, 0.04); }

/* Logs folding toggles */
.log-preview { 
  color: var(--muted); 
  font-size: 12px; 
  max-width: 260px; 
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.log-preview.err { 
  color: #fca5a5; 
}

details.log-fold {
  margin-top: 4px;
}

details.log-fold summary { 
  cursor: pointer; 
  color: var(--info); 
  font-size: 12.5px; 
  font-weight: 500;
  user-select: none;
}
details.log-fold summary:hover {
  text-decoration: underline;
}

details.log-fold pre {
  margin: 8px 0 0; 
  padding: 12px; 
  background: rgba(0, 0, 0, 0.4); 
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  font-size: 11px; 
  white-space: pre-wrap; 
  max-width: 450px; 
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.3);
}

.empty { 
  text-align: center; 
  padding: 60px 24px; 
  color: var(--muted); 
}
.empty strong { 
  display: block; 
  color: #fff; 
  margin-bottom: 8px; 
  font-size: 16px;
}

.empty-state {
  text-align: center;
  padding: 48px 24px 56px;
  color: var(--muted);
  border: 1px dashed var(--glass-border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
}
.empty-state-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.85;
}
.empty-state h2 {
  margin: 0 0 10px;
  font-size: 20px;
  color: #fff;
  font-weight: 600;
}
.empty-state .btn {
  margin-top: 20px;
}

.debug-banner {
  background: rgba(245, 166, 35, 0.1) !important;
  border: 1px solid rgba(245, 166, 35, 0.35) !important;
  margin-bottom: 16px;
  font-size: 13px;
}
.debug-banner kbd {
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.35);
  font-size: 11px;
}

/* Link Moodle modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(3, 7, 18, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay[hidden] {
  display: none !important;
}
.modal-card {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: auto;
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.98) 0%, rgba(10, 15, 28, 0.98) 100%);
  border: 1px solid var(--glass-border-hover);
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}
.modal-hd {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}
.modal-hd h2 {
  margin: 0;
  font-size: 18px;
}
.modal-ft {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--glass-border);
}
.link-results {
  margin-top: 12px;
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.link-user-row {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.link-user-row:hover,
.link-user-row.selected {
  border-color: rgba(245, 166, 35, 0.45);
  background: rgba(245, 166, 35, 0.08);
}

.link-moodle-modal {
  max-width: 520px;
  max-height: 92vh;
  overflow-y: auto;
}

.link-sheet-chip {
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.link-sheet-chip strong { font-size: 15px; color: #fff; }
.link-chip-label { font-size: 11px; color: var(--info); text-transform: uppercase; letter-spacing: 0.04em; }

.link-verify-title {
  margin: 0 0 8px;
  font-size: 16px;
  color: #fff;
}
.link-verify-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
@media (max-width: 520px) {
  .link-verify-grid { grid-template-columns: 1fr; }
}
.link-verify-col {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.22);
}
.link-verify-col h4 {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted);
}
.link-verify-sheet { border-color: rgba(59, 130, 246, 0.3); }
.link-verify-moodle { border-color: rgba(245, 166, 35, 0.3); }
.link-verify-dl {
  margin: 0;
  font-size: 13px;
}
.link-verify-dl dt {
  color: var(--muted);
  font-size: 11px;
  margin-top: 8px;
}
.link-verify-dl dt:first-child { margin-top: 0; }
.link-verify-dl dd {
  margin: 2px 0 0;
  color: #fff;
  word-break: break-word;
}
.link-verify-dl dd.link-diff {
  color: #fde68a;
  background: rgba(245, 166, 35, 0.1);
  padding: 4px 6px;
  border-radius: 6px;
}
.link-update-email-lbl {
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  margin-top: 8px !important;
}
.link-update-email-lbl input { margin-top: 3px; width: 18px; height: 18px; }

.debug-panel {
  margin: 16px 0 0;
  padding: 12px 14px;
  max-height: 180px;
  overflow: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  line-height: 1.45;
  color: #a5f3fc;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(245, 166, 35, 0.25);
  border-radius: 10px;
  white-space: pre-wrap;
}

/* Settings View Grids */
.settings-grid { 
  display: grid; 
  grid-template-columns: 320px 1fr; 
  gap: 24px; 
}
@media (max-width: 950px) { 
  .settings-grid { grid-template-columns: 1fr; } 
}

.conn-list { 
  list-style: none; 
  margin: 0; 
  padding: 0; 
}
.conn-list li {
  padding: 12px 16px; 
  border-bottom: 1px solid var(--line); 
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  border-radius: 8px;
  margin-bottom: 4px;
  color: var(--muted);
}
.conn-list li:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
}
.conn-list li.active { 
  background: var(--glass-bg-active); 
  border-left: 4px solid var(--accent); 
  padding-left: 12px; 
  color: var(--accent);
  font-weight: 600;
}

label.fld {
  display: block; 
  color: var(--muted); 
  font-size: 11px; 
  text-transform: uppercase;
  font-weight: 700; 
  margin: 14px 0 6px;
  letter-spacing: 0.08em;
}
label.fld:first-of-type {
  margin-top: 0;
}

input.fld, select.fld, textarea.fld {
  width: 100%; 
  background: rgba(0, 0, 0, 0.25); 
  border: 1px solid var(--glass-border);
  border-radius: 10px; 
  color: var(--ink); 
  padding: 11px 14px; 
  font: inherit; 
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

input.fld:focus, select.fld:focus, textarea.fld:focus {
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 12px rgba(245, 166, 35, 0.15);
}

.map-grid { 
  display: grid; 
  grid-template-columns: 1fr 1fr; 
  gap: 12px; 
}

.mode { 
  display: flex; 
  gap: 18px; 
  margin-bottom: 14px; 
}
.mode label { 
  text-transform: none; 
  font-size: 14px; 
  display: flex; 
  align-items: center; 
  gap: 8px; 
  cursor: pointer; 
  color: var(--ink); 
  font-weight: 500;
}

.course-box { 
  display: none; 
  padding: 16px; 
  background: rgba(0, 0, 0, 0.2); 
  border: 1px solid var(--glass-border);
  border-radius: 12px; 
  margin-bottom: 14px; 
  animation: fadeIn 0.25s ease;
}
.course-box.show { 
  display: block; 
}

.course-pick-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 8px;
}
.course-pick-toolbar .fld {
  flex: 1;
  min-width: 200px;
  margin: 0;
}

.guide-details {
  margin: 14px 0;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
}
.guide-details summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: var(--info);
  list-style: none;
}
.guide-details summary::-webkit-details-marker { display: none; }
.guide-details[open] summary { margin-bottom: 10px; }
.automation-guide .guide-h4 { margin: 12px 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.automation-guide .guide-p { margin: 0 0 8px; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.automation-guide .guide-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 10px; }
.automation-guide .guide-table th,
.automation-guide .guide-table td {
  border: 1px solid var(--line);
  padding: 7px 9px;
  text-align: left;
  vertical-align: top;
}
.automation-guide .guide-table th { background: rgba(0, 0, 0, 0.25); color: var(--soft); }
.automation-guide .guide-table td { color: var(--ink); }

.conn-wizard-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.wiz-tab {
  flex: 1;
  min-width: 72px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.wiz-tab:hover { color: var(--ink); border-color: var(--info); }
.wiz-tab.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--info);
  color: var(--info);
}
.wiz-tab.done:not(.active) {
  border-color: rgba(52, 211, 153, 0.4);
  color: var(--ok);
}
.wizard-pane { display: none; animation: fadeIn 0.2s ease; }
.wizard-pane.active { display: block; }
.wiz-h3 { margin: 0 0 10px; font-size: 15px; color: var(--ink); }
.wiz-checklist {
  margin: 0 0 14px;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}
.wiz-checklist li { margin-bottom: 6px; }
.wizard-alert {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fecdd3;
  font-size: 13px;
  line-height: 1.45;
}
.wizard-alert[hidden] { display: none !important; }
.wizard-footer {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.dedupe-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  color: var(--ink);
}
.dedupe-row label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.course-pick-toolbar select.fld option {
  padding: 4px 0;
}

.hint { 
  color: var(--muted); 
  font-size: 12.5px; 
  line-height: 1.45;
  margin-top: 4px;
}

/* Toast Alerts styling */
.toast {
  position: fixed; 
  right: 24px; 
  bottom: 24px; 
  padding: 14px 20px;
  background: rgba(17, 24, 39, 0.92); 
  border: 1px solid var(--glass-border-hover); 
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0; 
  transform: translateY(12px) scale(0.98); 
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
  z-index: 1000; 
  max-width: 400px;
  color: #fff;
  font-weight: 500;
  pointer-events: none;
}
.toast.show { 
  opacity: 1; 
  transform: translateY(0) scale(1); 
}

.actions-cell { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 8px; 
  align-items: center; 
}

/* Custom Checkbox Design */
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1.5px solid var(--glass-border-hover);
  background: rgba(0, 0, 0, 0.3);
  cursor: pointer;
  vertical-align: middle;
  position: relative;
  -webkit-appearance: none;
  appearance: none;
  transition: all 0.2s ease;
}
input[type="checkbox"]:checked {
  background: var(--accent-gradient);
  border-color: transparent;
}
input[type="checkbox"]:checked::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #030712;
  font-size: 11px;
  font-weight: 800;
}

/* Setup Wizard styles */
.progress {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  background: rgba(0,0,0,0.15);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
}
.progress .dot {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--glass-border);
  color: var(--muted);
}
.progress .dot.done {
  color: var(--ok);
  border-color: var(--ok-border);
  background: var(--ok-bg);
}

.step {
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 24px;
}
.step:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.step-hd {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}
.step.done .step-num {
  background: var(--ok-bg);
  border-color: var(--ok-border);
  color: var(--ok);
}
.step h3 {
  margin: 4px 0 0;
  font-size: 17px;
  color: #fff;
  font-weight: 600;
}
.step .body {
  color: var(--muted);
  margin-left: 46px;
}
.step .body pre {
  padding: 12px;
  overflow: auto;
  font-size: 12px;
  color: var(--ink);
  margin: 12px 0;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
}
.step .body code {
  padding: 2px 6px;
  font-size: 12.5px;
  color: var(--accent);
  background: rgba(0,0,0,0.25);
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
}

.test-box {
  margin-left: 46px;
  margin-top: 14px;
  padding: 18px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  border: 1px solid var(--glass-border);
}

.test-result {
  margin-top: 10px;
  font-size: 13.5px;
  min-height: 20px;
  white-space: pre-wrap;
}
.test-result.ok { color: var(--ok); }
.test-result.err { color: var(--err); }

.ready-banner {
  padding: 16px 20px;
  border-radius: 14px;
  background: var(--ok-bg);
  border: 1px solid var(--ok-border);
  margin-bottom: 24px;
  color: #fff;
}
.ready-banner a {
  color: var(--ok);
  font-weight: 700;
}

.install-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 700px) {
  .install-grid { grid-template-columns: 1fr; }
}
.install-grid .full { grid-column: 1/-1; }

.danger-zone {
  margin-left: 46px;
  margin-top: 20px;
  padding: 16px;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.05);
}
.danger-zone h4 {
  margin: 0 0 10px;
  color: #fecdd3;
  font-size: 15px;
  font-weight: 600;
}

/* Premium Student Management Visual Badges & Micro Pills */
.row-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 26px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.mono-pass-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: rgba(245, 166, 35, 0.05);
  border: 1px solid rgba(245, 166, 35, 0.25);
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: var(--accent);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}
.mono-pass-badge:hover {
  background: rgba(245, 166, 35, 0.12);
  border-color: rgba(245, 166, 35, 0.45);
  transform: translateY(-1px);
}

.username-pill {
  display: inline-flex;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  border: 1px solid var(--glass-border);
  color: #fff;
  letter-spacing: -0.01em;
}

.course-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: var(--info);
  margin: 2px;
  transition: all 0.2s;
}
.course-pill:hover {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.35);
  transform: translateY(-1px);
}

/* Stat Pill Gradient Background Colors for Active states */
.stat-pill.active[data-tone="ok"] {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.02) 100%) !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
}
.stat-pill.active[data-tone="info"] {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.02) 100%) !important;
  border-color: rgba(59, 130, 246, 0.3) !important;
}
.stat-pill.active[data-tone="err"] {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.02) 100%) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}
.stat-pill.active[data-tone="warn"] {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.02) 100%) !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
}
