:root {
  --bg: #0b1220;
  --panel: rgba(15, 23, 42, 0.65);
  --card: rgba(17, 24, 39, 0.72);
  --hover: rgba(30, 41, 59, 0.85);
  --primary: #38BDF8;
  --success: #22C55E;
  --warn: #F59E0B;
  --danger: #EF4444;
  --text: #E5E7EB;
  --muted: #94A3B8;
  --border: rgba(148, 163, 184, 0.15);
  --shadow: 0 20px 50px rgba(0,0,0,0.45);
}

body[data-theme="light"] {
  --bg: #f5f7fb;
  --panel: rgba(255, 255, 255, 0.8);
  --card: rgba(255, 255, 255, 0.9);
  --hover: rgba(226, 232, 240, 0.9);
  --text: #0f172a;
  --muted: #475569;
  --border: rgba(15, 23, 42, 0.12);
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

* { box-sizing: border-box; font-family: var(--font-family, Inter, Roboto, sans-serif); }
html { font-size: clamp(14px, 0.25vw + 12px, 16px); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--text);
  background: var(--page-bg, var(--bg));
  overflow-x: hidden;
}

@keyframes fadeUp { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; transform: translateY(0);} }
@keyframes shimmer { 0% { background-position: -200px 0; } 100% { background-position: 200px 0; } }
@keyframes pulse { 0%,100%{ transform: scale(1);} 50%{ transform: scale(1.03);} }

.app { display: flex; min-height: 100vh; overflow-x: hidden; }
.sidebar {
  width: 260px;
  background: var(--panel);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  padding: 20px;
  position: fixed;
  left: 0;
  top: 0; bottom: 0;
  z-index: 30;
  border-right: 1px solid var(--border);
  overflow-y: auto;
}
.sidebar-toggle {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}
.sidebar-toggle .btn-ghost {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 800;
}
.toggle-icon {
  width: 18px;
  height: 18px;
  color: var(--text);
}
.sidebar .logo {
  font-weight: 800;
  margin-bottom: 20px;
  letter-spacing: 0.4px;
  padding: 4px 6px;
  border-radius: 12px;
  background: transparent;
  border: none;
  box-shadow: none;
  display: grid;
  justify-items: center;
  gap: 6px;
}
.app-logo-img {
  max-width: 160px;
  max-height: 56px;
  width: 100%;
  object-fit: contain;
  display: block;
  filter: none;
}
.app-name {
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: 0.2px;
  color: var(--text);
}
.collapsed-logo-dock {
  margin-top: auto;
  display: none;
  justify-content: center;
  align-items: center;
  padding-top: 10px;
}
.collapsed-logo-img {
  width: 52px;
  max-height: 34px;
  height: auto;
  border-radius: 0;
  object-fit: contain;
  border: 0;
  background: transparent;
  padding: 0;
}
body[data-theme="dark"] .app-logo-img {
  filter: none;
}
body[data-theme="light"] .sidebar .logo {
  background: transparent;
  border: none;
  box-shadow: none;
}
body[data-theme="light"] .app-logo-img {
  filter: none;
}
body[data-theme="light"] .sidebar nav a {
  color: #1f2937;
}
body[data-theme="light"] .sidebar nav a:hover {
  background: rgba(15, 23, 42, 0.08);
}
body[data-theme="light"] .sidebar .collapse {
  color: #64748b;
}
body[data-theme="light"] .page-title {
  color: #0f172a;
}
body[data-theme="light"] .page-desc {
  color: #334155;
}
body[data-theme="light"] .btn-ghost,
body[data-theme="light"] a.btn-ghost,
body[data-theme="light"] button.btn-ghost {
  background: var(--btn-ghost-bg, #0f172a);
  border-color: var(--btn-ghost-border, #475569);
  color: var(--btn-ghost-text, #E5E7EB);
}
body[data-theme="light"] .btn-ghost:hover,
body[data-theme="light"] a.btn-ghost:hover,
body[data-theme="light"] button.btn-ghost:hover {
  filter: brightness(1.06);
}
body[data-theme="light"] .muted {
  color: #334155;
}
body[data-theme="light"] .tag {
  color: #475569;
  background: #e2e8f0;
}
.sidebar .nav-group { margin-top: 12px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none;
  padding: 10px 12px; border-radius: 10px; transition: 0.2s;
}
.sidebar nav a:hover { background: var(--hover); }
.sidebar nav a .icon { width: 18px; text-align: center; opacity: 0.9; }
.sidebar .collapse { margin-top: 12px; color: var(--muted); font-size: 0.85rem; }
.sidebar nav a[data-tooltip] {
  position: relative;
}
body.sidebar-collapsed .sidebar nav a[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 58px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--card);
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 10px;
  color: var(--text);
  white-space: nowrap;
  box-shadow: var(--shadow);
  z-index: 1000;
}
body.sidebar-collapsed .sidebar nav a[data-tooltip]:hover::before {
  content: '';
  position: absolute;
  left: 48px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: transparent var(--card) transparent transparent;
}

.main {
  margin-left: 260px;
  width: calc(100% - 260px);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-x: hidden;
}
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px;
  padding: 0 24px 16px;
  background: var(--panel);
  backdrop-filter: blur(18px);
  position: sticky; top: 0; z-index: 1200;
  overflow: visible;
  border-bottom: 1px solid var(--border);
}
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); padding: 8px 12px;
  border-radius: 10px; color: var(--muted); min-width: clamp(180px, 30vw, 320px);
  flex: 1 1 240px;
  border: 1px solid var(--border);
}
.search input { background: transparent; border: none; outline: none; color: var(--text); width: 100%; }
.top-home-btn {
  white-space: nowrap;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
}
.top-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
.sidebar-indicator {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  font-size: 0.85rem;
}
body.sidebar-collapsed .sidebar-indicator {
  display: inline-flex;
}
.badge { background: var(--primary); padding: 4px 8px; border-radius: 999px; color: #001; font-weight: 700; animation: fadeUp 0.5s ease; }
.top-notification-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  text-decoration: none;
}
.top-notification-link .badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  line-height: 1;
}
.user { display: flex; gap: 10px; align-items: center; background: var(--card); padding: 6px 10px; border-radius: 10px; border: 1px solid var(--border); min-width: 0; max-width: 100%; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--hover); display: grid; place-items: center; font-weight: 700; }
.role-switch {
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 0.8rem;
  min-width: 130px;
}
.user-meta { display: grid; gap: 4px; min-width: 0; max-width: 290px; }
.user-meta > div {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.role-menu {
  position: relative;
}
.role-menu summary {
  list-style: none;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--muted);
}
.role-menu summary::-webkit-details-marker {
  display: none;
}
.role-menu summary::after {
  content: " ?";
}
.role-menu[open] summary::after {
  content: " ?";
}
.role-menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 190px;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
  z-index: 1001;
  display: grid;
  gap: 6px;
}
.role-menu-list form {
  margin: 0;
}
.role-menu-item {
  width: 100%;
  text-align: left;
  background: rgba(15, 23, 42, 0.35);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
}
.role-menu-item.active {
  border-color: rgba(56,189,248,0.5);
  background: rgba(56,189,248,0.12);
}
.theme-switch { display: flex; align-items: center; }
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(15,23,42,0.65), rgba(30,41,59,0.65));
  color: var(--text);
  cursor: pointer;
  transition: 0.2s;
  font-weight: 700;
}
.theme-toggle:hover { background: var(--hover); transform: translateY(-1px); }
.theme-dot {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #fff, rgba(56,189,248,0.4));
  border: 1px solid rgba(56,189,248,0.6);
  box-shadow: inset 0 0 6px rgba(255,255,255,0.35), 0 6px 14px rgba(0,0,0,0.25);
}
body[data-theme="light"] .theme-toggle {
  background: linear-gradient(135deg, rgba(226,232,240,0.9), rgba(255,255,255,0.9));
  color: #0f172a;
}
body[data-theme="light"] .theme-dot {
  background: radial-gradient(circle at 30% 30%, #ffd166, #f59e0b);
  border-color: rgba(245,158,11,0.6);
}

.content {
  padding: clamp(12px, 2vw, 24px);
  animation: fadeUp 0.4s ease;
  flex: 1 0 auto;
  min-width: 0;
  overflow-x: hidden;
}
.omega-social-footer {
  --social-footer-thickness: 72px;
  --social-scale: 1;
  margin-top: 10px;
  background: #1f6f82;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  width: 100%;
  min-height: var(--social-footer-thickness);
}
.omega-social-footer-inner {
  max-width: none;
  width: 100%;
  margin: 0;
  min-height: var(--social-footer-thickness);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2px, calc(var(--social-footer-thickness) * 0.08), 10px) 20px clamp(3px, calc(var(--social-footer-thickness) * 0.10), 12px);
}
.omega-social-footer-inner.social-align-left {
  text-align: left;
}
.omega-social-footer-inner.social-align-center {
  text-align: center;
}
.omega-social-footer-inner.social-align-right {
  text-align: right;
}
.omega-social-title {
  color: #f5fbff;
  font-weight: 800;
  font-size: calc(1.05rem * var(--social-scale));
  line-height: 1.1;
  margin-bottom: calc(8px * var(--social-scale));
}
.omega-social-links {
  display: flex;
  flex-wrap: wrap;
  gap: calc(8px * var(--social-scale));
}
.omega-social-footer-inner.social-align-left .omega-social-links {
  justify-content: flex-start;
}
.omega-social-footer-inner.social-align-center .omega-social-links {
  justify-content: center;
}
.omega-social-footer-inner.social-align-right .omega-social-links {
  justify-content: flex-end;
}
.omega-social-links a {
  width: calc(38px * var(--social-scale));
  height: calc(38px * var(--social-scale));
  border-radius: 999px;
  border: clamp(1px, calc(2px * var(--social-scale)), 2px) solid rgba(208, 241, 248, 0.55);
  background: rgba(105, 190, 207, 0.3);
  color: #f5fbff;
  text-decoration: none;
  display: grid;
  place-items: center;
}
.omega-social-links a svg {
  width: calc(18px * var(--social-scale));
  height: calc(18px * var(--social-scale));
  fill: currentColor;
}
.omega-social-links a:hover {
  transform: translateY(-1px);
  background: rgba(155, 224, 237, 0.38);
}
.page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.page-title { font-size: 1.4rem; font-weight: 800; }
.page-desc { color: var(--muted); margin-top: 6px; }
.course-title-text { color: var(--course-title-color, var(--text)); }
.course-title-text a { color: inherit; }
.course-title-text a:hover { opacity: 0.92; }
.course-page-title { color: var(--course-page-title-color, var(--text)); }
.course-page-desc { color: var(--course-page-desc-color, var(--muted)); }
.actions-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.page-header.sticky-actions {
  position: sticky;
  top: 8px;
  z-index: 20;
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
}
.filter-bar { display: flex; gap: 8px; margin: 16px 0; flex-wrap: wrap; }

.section-title { margin: 18px 0 10px; font-weight: 800; color: var(--text); }
.form-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.form-stack { display: grid; gap: 10px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-field { display: grid; gap: 6px; }
.form-field label { font-size: 0.85rem; color: var(--muted); }
.form-actions { display: flex; gap: 10px; align-items: center; }
.form-stack > *, .form-row > * { min-width: 0; }
.form-stack input, .form-stack select, .form-stack textarea { width: 100%; }
.form-row input, .form-row select, .form-row textarea { width: 100%; }
.form-stack input[type="checkbox"] {
  width: auto;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  accent-color: #38bdf8;
}

input, textarea, select {
  background: rgba(8, 15, 30, 0.75);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 12px;
  outline: none;
  transition: 0.2s;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}
input:focus, textarea:focus, select:focus {
  border-color: rgba(56,189,248,0.5);
  box-shadow: 0 0 0 3px rgba(56,189,248,0.12);
}
input::placeholder, textarea::placeholder { color: var(--muted); }

input[type="file"] {
  padding: 10px;
  border-style: dashed;
  background: rgba(8, 15, 30, 0.6);
}
input[type="file"]::file-selector-button {
  background: var(--primary);
  color: #001;
  border: none;
  padding: 8px 12px;
  border-radius: 10px;
  margin-right: 12px;
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover {
  filter: brightness(0.95);
}
input[type="file"]::-webkit-file-upload-button {
  background: var(--primary);
  color: #001;
  border: none;
  padding: 8px 12px;
  border-radius: 10px;
  margin-right: 12px;
  cursor: pointer;
}
input[type="file"]::-webkit-file-upload-button:hover {
  filter: brightness(0.95);
}

body[data-theme="light"] input,
body[data-theme="light"] textarea,
body[data-theme="light"] select {
  background: #fff;
}

button {
  background: var(--btn-primary-bg, var(--primary));
  color: var(--btn-primary-text, #00131f);
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
}
button, .btn-primary, .btn-ghost, .btn-success, .btn-danger, .btn-warning {
  font-weight: 700;
  letter-spacing: 0.2px;
  transition: 0.2s;
}
.btn-primary,
a.btn-primary,
button.btn-primary {
  background: var(--btn-primary-bg, var(--primary));
  color: var(--btn-primary-text, #00131f);
  border: 1px solid var(--btn-primary-bg, var(--primary));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}
.btn-primary:hover { filter: brightness(1.03); transform: translateY(-1px); }
.btn-ghost,
a.btn-ghost,
button.btn-ghost {
  background: var(--btn-ghost-bg, #0f172a);
  border: 1px solid var(--btn-ghost-border, #475569);
  color: var(--btn-ghost-text, #E5E7EB);
}
.btn-ghost:hover { filter: brightness(1.06); }
.btn-success {
  background: rgba(34,197,94,0.2);
  color: var(--success);
  border: 1px solid rgba(34,197,94,0.4);
}
.btn-danger {
  background: rgba(239,68,68,0.2);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,0.4);
}
.btn-warning,
a.btn-warning,
button.btn-warning {
  background: rgba(245, 158, 11, 0.22);
  color: #7c4700;
  border: 1px solid rgba(245, 158, 11, 0.6);
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
}
a.btn-danger,
button.btn-danger {
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
}
a.btn-primary, a.btn-ghost, a.btn-warning, a.btn-danger { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.draggable-grid .draggable { cursor: grab; }
.draggable-grid .draggable:active { cursor: grabbing; }
.free-layout-zone {
  position: relative;
  display: block;
  min-height: 360px;
}
.free-layout-zone .free-layout-item {
  position: absolute;
  margin: 0;
  z-index: 1;
  touch-action: none;
  min-width: 90px;
  min-height: 56px;
}
.free-layout-zone .free-layout-item.dragging {
  z-index: 8;
  cursor: grabbing;
}
.free-layout-zone .free-layout-item.resizing {
  z-index: 9;
}
.free-layout-zone .free-layout-item .resize-handle {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 14px;
  height: 14px;
  border-right: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  border-radius: 2px;
  cursor: se-resize;
  opacity: 0.8;
}
.users-grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }
.admin-table-grid { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); align-items: start; }
.branding-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: stretch;
  gap: 12px;
}
.branding-grid > .branding-card {
  grid-column: span 3;
  min-height: 430px;
  display: flex;
  flex-direction: column;
}
.branding-grid > .branding-card .card-title {
  min-height: 22px;
}
.branding-grid > .branding-card form {
  flex: 1 1 auto;
}
.branding-grid > .branding-card-wide {
  grid-column: span 6;
}
.branding-grid > .branding-card-scroll {
  max-height: 640px;
  overflow: auto;
  overscroll-behavior: contain;
}
@media (max-width: 1500px) {
  .branding-grid > .branding-card {
    grid-column: span 4;
  }
  .branding-grid > .branding-card-wide {
    grid-column: span 6;
  }
}
@media (max-width: 1100px) {
  .branding-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .branding-grid > .branding-card,
  .branding-grid > .branding-card-wide {
    grid-column: auto;
    min-height: auto;
    max-height: none;
    overflow: visible;
  }
}
@media (max-width: 720px) {
  .branding-grid {
    grid-template-columns: 1fr;
  }
}
.certs-grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }
.checkbox-row { display: flex; gap: 10px; align-items: center; }
.checkbox-row span { color: var(--text); font-weight: 600; }
.notification-preferences-form { max-width: 420px; }
.btn-block { width: 100%; justify-content: center; }

.cert-card {
  display: grid;
  gap: 8px;
}
.cert-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  word-break: break-all;
}
.cert-main {
  display: grid;
  gap: 4px;
}
.cert-person {
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.2;
  color: var(--text);
}
.cert-course {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.2;
}
.cert-meta {
  font-size: 0.9rem;
}
.cert-badges {
  margin-top: 4px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.cert-actions {
  margin-top: 6px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.cert-actions form {
  margin: 0;
}

.card {
  background: var(--card);
  padding: 16px; border-radius: 14px;
  box-shadow: var(--shadow);
  transition: 0.2s;
  border: 1px solid var(--border);
  color: var(--text); text-decoration: none;
  backdrop-filter: blur(12px);
  overflow: visible;
}
.card-link-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
}
.stat-card {
  position: relative;
}
.stat-card > *:not(.card-link-overlay) {
  position: relative;
  z-index: 3;
}
.card:hover { background: var(--hover); transform: translateY(-2px); }
.quick-link { display: block; text-decoration: none; }
.quick-link .tag { background: rgba(56,189,248,0.18); color: var(--primary); border: 1px solid rgba(56,189,248,0.35); }
.quick-link:hover .tag { filter: brightness(1.1); }
.quick-link-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.quick-link-actions .btn-ghost {
  min-height: 34px;
  padding: 7px 12px;
}
[data-draggable-grid$="-links"] .quick-link {
  padding: 12px;
}
[data-draggable-grid$="-links"] .quick-link .card-title {
  margin-bottom: 6px;
}
.admin-dashboard-page [data-draggable-grid$="-links"] .quick-link .menu-link-title .icon {
  display: none;
}
.admin-dashboard-page .page-header .actions-bar .btn-primary,
.admin-dashboard-page .page-header .actions-bar .btn-ghost {
  min-height: 36px;
  padding: 8px 12px;
}
.admin-dashboard-page .admin-filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 10px;
  margin: 12px 0 16px;
}
.admin-dashboard-page .admin-filter-bar .dashboard-filter-row {
  margin: 0;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  align-items: stretch;
}
.admin-dashboard-page .admin-filter-bar .dashboard-filter-row input,
.admin-dashboard-page .admin-filter-bar .dashboard-filter-row select,
.admin-dashboard-page .admin-filter-bar .dashboard-filter-row .btn-ghost {
  min-height: 38px;
}
.admin-dashboard-page .admin-filter-bar .dashboard-filter-row .btn-ghost {
  min-width: 108px;
  justify-content: center;
}
.admin-dashboard-page .admin-filter-bar .dashboard-filter-row .dropdown,
.admin-dashboard-page .admin-filter-bar .dashboard-filter-row input {
  width: 100%;
}
.admin-dashboard-page .draggable-grid {
  gap: 10px;
}
.admin-dashboard-page .admin-grid-top,
.admin-dashboard-page .admin-grid-main,
.admin-dashboard-page [data-draggable-grid="admin-extra"] {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.admin-dashboard-page [data-draggable-grid="admin-links"] {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}
.admin-dashboard-page .admin-grid-top .stat-card {
  min-height: 90px;
}
[data-draggable-grid="admin-links"] {
  margin-top: 12px;
}
[data-draggable-grid$="-links"] .card {
  padding: 10px;
}
[data-draggable-grid$="-links"] .card-title {
  font-size: 0.95rem;
  margin-bottom: 4px;
}
[data-draggable-grid$="-links"] .btn-ghost {
  padding: 4px 8px;
  font-size: 0.8rem;
}
.menu-link-title { display: inline-flex; align-items: center; gap: 10px; }
.menu-link-title .icon { width: 18px; text-align: center; opacity: 0.9; }
.card-title { font-weight: 700; margin-bottom: 8px; }
.muted { color: var(--muted); font-size: 0.9rem; }
.tag {
  margin-top: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  height: 26px;
  min-width: 52px;
  padding: 0 10px;
  background: rgba(148,163,184,0.12);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8rem;
  line-height: 26px;
  font-weight: 700;
  box-sizing: border-box;
}
.home-banner-rotator {
  position: relative;
  overflow: hidden;
  height: 400px;
  background-size: cover;
  background-position: center;
  transition: background-image 0.35s ease-in-out;
}
.home-banner-overlay {
  position: absolute;
  inset: 0;
  background: #000;
  pointer-events: none;
}
.home-banner-content {
  position: relative;
  z-index: 1;
}
.home-banner-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.45);
  background: rgba(15, 23, 42, 0.46);
  color: #f8fafc;
  font-size: 1.8rem;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.home-banner-prev { left: 12px; }
.home-banner-next { right: 12px; }
.home-banner-nav:hover {
  background: rgba(15, 23, 42, 0.72);
}
.home-brand-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.home-brand-title img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}
.home-brand-title span {
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--text);
}

.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.gallery-item { display: block; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; cursor: pointer; }
.gallery-item img { width: 100%; height: 64px; object-fit: cover; display: block; }
.cover-preview { width: 100%; height: 140px; object-fit: cover; border-radius: 12px; border: 1px solid var(--border); }

.lesson-item { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 10px; border-radius: 10px; border: 1px solid var(--border); margin-top: 8px; background: transparent; }
.lesson-item.active { background: var(--hover); }
.lesson-link { color: var(--text); text-decoration: none; }
.lesson-actions { display: flex; align-items: center; }

.stat-card { display: flex; justify-content: space-between; align-items: center; }
.stat-value { font-size: 1.4rem; font-weight: 800; }
.stat-label { color: var(--muted); font-size: 0.85rem; }
.student-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.gamification-badges-grid {
  gap: 12px;
}
.gamification-badge-card {
  display: grid;
  gap: 6px;
  align-content: start;
}
.gamification-badge-card .card-title {
  margin-bottom: 2px;
  line-height: 1.25;
}
.gamification-badge-card .muted {
  line-height: 1.35;
}
.gamification-badge-card .tag {
  margin-top: 8px;
}
.gamification-ui-config-card .form-row {
  align-items: stretch;
}
.gamification-ui-config-card input {
  width: 100%;
}
.gamification-stats-wrap {
  padding: 10px;
}
.gamification-stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}
.gamification-stats-grid .stat-card {
  min-height: 88px;
}
.student-kpi-card {
  min-height: 128px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.student-kpi-title {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  z-index: 2;
}
.student-kpi-value {
  color: var(--text);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  z-index: 2;
}
.student-kpi-icon {
  position: absolute;
  right: -8px;
  bottom: -10px;
  width: 92px;
  height: 92px;
  object-fit: contain;
  opacity: 0.2;
  pointer-events: none;
}
.home-communication-head {
  margin-bottom: 8px;
}
.home-communication-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  align-items: stretch;
}
.home-communication-grid .card {
  min-height: 180px;
}
.home-feed-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  align-items: start;
}
.home-feed-date {
  font-weight: 800;
  color: var(--primary);
}
.home-feed-title {
  font-weight: 700;
  color: var(--text);
}
.home-feed-card-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.home-feed-card-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  color: color-mix(in srgb, var(--primary) 82%, var(--text));
}
.home-feed-card-svg {
  width: 14px;
  height: 14px;
  display: block;
}
.home-feed-links {
  display: grid;
  gap: 8px;
}
.home-feed-contacts {
  display: grid;
  gap: 8px;
}
.home-feed-contact-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  background: color-mix(in srgb, var(--card) 86%, transparent);
}
.home-feed-contact-item summary {
  cursor: pointer;
  font-weight: 700;
}
.home-feed-contact-item[open] {
  background: color-mix(in srgb, var(--card) 95%, transparent);
}
.home-poll-form {
  margin-top: 10px;
}
.home-poll-question {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: color-mix(in srgb, var(--card) 92%, transparent);
}
.home-poll-question-title {
  font-weight: 700;
  margin-bottom: 6px;
}
.home-poll-options {
  display: grid;
  gap: 4px;
}
.home-poll-modal {
  width: min(760px, calc(100vw - 24px));
  max-height: 86vh;
  overflow: auto;
}
.feed-editor-row {
  cursor: grab;
}
.feed-editor-row.dragging {
  opacity: 0.65;
  cursor: grabbing;
}
.feed-editor-row.drag-over {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 30%, transparent);
}

.progress-linear { height: 8px; background: rgba(15, 23, 42, 0.8); border-radius: 99px; overflow: hidden; }
.progress-linear > span { display: block; height: 100%; background: var(--primary); width: 0; animation: grow 1.2s forwards; }
@keyframes grow { to { width: var(--value, 60%); } }
.trilhas-hero {
  margin: 8px 0 14px;
  padding: 16px 18px;
  border-radius: 12px;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #e8fbff;
  background:
    linear-gradient(135deg, rgba(8, 75, 101, 0.88), rgba(5, 54, 71, 0.88)),
    radial-gradient(600px 240px at 20% 20%, rgba(56,189,248,0.18), transparent);
  border: 1px solid rgba(56,189,248,0.28);
}
.path-student-list {
  display: grid;
  gap: 12px;
}
.trilha-student-card {
  padding: 14px;
}
.trilha-student-head {
  display: flex;
  gap: 12px;
  align-items: center;
}
.trilha-avatar {
  width: 54px;
  height: 54px;
  border-radius: 999px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--border);
  padding: 6px;
}
.trilha-progress {
  margin-top: 10px;
}
.trilha-progress > span {
  background: var(--path-progress-color, var(--primary));
}
.trilha-progress-label {
  margin-top: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
}
.trilha-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.trilha-detail-hero {
  padding: 22px 18px;
  border-radius: 12px;
  margin-bottom: 10px;
  background:
    linear-gradient(135deg, rgba(8, 75, 101, 0.9), rgba(5, 54, 71, 0.88)),
    radial-gradient(700px 250px at 18% 22%, rgba(56,189,248,0.2), transparent);
  border: 1px solid rgba(56,189,248,0.28);
}
.trilha-detail-title {
  font-size: 2rem;
  font-weight: 800;
  color: #e8fbff;
  text-align: center;
}
.trilha-detail-sub {
  margin-top: 6px;
  color: #cdeef7;
  text-align: center;
}
.trilha-detail-meta {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.trilha-detail-module {
  font-weight: 700;
  color: var(--text);
}
.trilha-detail-count {
  font-weight: 700;
  color: var(--muted);
}
.trilha-course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.trilha-course-card {
  display: grid;
  gap: 8px;
}
.trilha-course-cover {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.progress-circle {
  --size: 70px;
  width: var(--size);
  height: var(--size);
  min-width: var(--size);
  min-height: var(--size);
  max-width: var(--size);
  max-height: var(--size);
  flex: 0 0 var(--size);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  background: conic-gradient(
    var(--primary) 0 var(--value, 60%),
    rgba(15,23,42,0.8) var(--value, 60%) 100%
  );
  display: grid;
  place-items: center;
  font-weight: 800;
  line-height: 1;
}

.badge-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  height: 26px;
  min-width: 52px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  line-height: 26px;
  font-weight: 700;
  box-sizing: border-box;
}
.badge-success { background: rgba(34,197,94,0.15); color: var(--success); }
.badge-warn { background: rgba(245,158,11,0.15); color: var(--warn); }
.badge-danger { background: rgba(239,68,68,0.15); color: var(--danger); }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.table tr:hover { background: var(--hover); }
.table-form { display: flex; gap: 8px; flex-wrap: wrap; }
.table-actions { display: inline-flex; gap: 8px; }
.table-actions form { margin: 0; }
.table-wrap { width: 100%; overflow-x: auto; }
.table { min-width: 640px; table-layout: fixed; }
.table td { vertical-align: top; }
.table-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); align-items: center; gap: 8px; }
.table-form input, .table-form select, .table-form textarea { width: 100%; min-width: 0; }
.users-table-wrap { overflow-x: auto; }
.users-table { min-width: 1480px; table-layout: auto; }
.users-table th, .users-table td { padding: 14px 12px; }
.users-table th:nth-child(1), .users-table td:nth-child(1) { min-width: 170px; }
.users-table th:nth-child(2), .users-table td:nth-child(2) { min-width: 250px; }
.users-table th:nth-child(3), .users-table td:nth-child(3) { min-width: 110px; }
.users-table th:nth-child(4), .users-table td:nth-child(4) { min-width: 130px; }
.users-table th:nth-child(5), .users-table td:nth-child(5) { min-width: 110px; }
.users-table th:nth-child(6), .users-table td:nth-child(6) { min-width: 180px; max-width: 260px; white-space: normal; }
.users-table th:nth-child(7), .users-table td:nth-child(7) { min-width: 130px; white-space: nowrap; }
.users-table td:last-child { min-width: 170px; }
.users-table .table-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  width: 100%;
}
.users-actions-panel summary {
  list-style: none;
  display: inline-flex;
  cursor: pointer;
}
.users-actions-panel summary::-webkit-details-marker { display: none; }
.users-actions-panel .table-actions {
  margin-top: 8px;
}

@media (max-width: 900px) {
  .page-header.sticky-actions { top: 4px; padding: 8px 10px; }
  .free-layout-zone {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 0 !important;
    gap: 12px;
  }
  .free-layout-zone .free-layout-item {
    position: static !important;
    left: auto !important;
    top: auto !important;
    width: auto !important;
    height: auto !important;
  }
  .free-layout-zone .free-layout-item .resize-handle { display: none; }
}
.users-table .table-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: stretch;
}
.users-table .table-form .checkbox-row {
  justify-content: flex-start;
  gap: 8px;
}
.users-table .table-form button {
  width: 100%;
  white-space: normal;
}
.role-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 6px;
}
.role-option {
  margin: 0;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.25);
}
.role-option input {
  margin: 0;
}
.users-table .role-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.logo-upload-hint {
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.28);
  color: var(--text);
  font-size: 0.85rem;
  line-height: 1.35;
}

.report-title-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.report-icon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--primary);
  flex: 0 0 24px;
}
.report-icon svg {
  width: 14px;
  height: 14px;
  display: block;
}
.progress-report-table th[data-col] {
  cursor: grab;
  user-select: none;
}
.progress-report-table th[data-col]:active {
  cursor: grabbing;
}
.progress-report-table th.drag-over {
  background: rgba(56, 189, 248, 0.12);
  outline: 1px dashed rgba(56, 189, 248, 0.8);
}

.dropdown { background: var(--card); border: 1px solid var(--border); padding: 8px 10px; border-radius: 10px; color: var(--text); }

.toast { position: fixed; right: 24px; bottom: 24px; background: var(--card); padding: 12px 14px; border-radius: 12px; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; }
.badge-pop {
  position: fixed;
  right: 24px;
  top: 24px;
  display: none;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
  z-index: 999;
  animation: pop 0.5s ease;
}
.badge-pop.show { display: flex; gap: 12px; align-items: center; }
.badge-pop img { width: 64px; height: 64px; }
@keyframes pop { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
.modal { background: var(--card); border-radius: 14px; width: min(520px, calc(100vw - 24px)); padding: 20px; box-shadow: var(--shadow); }

.timeline { border-left: 2px solid var(--border); padding-left: 16px; }
.timeline-item { display: block; margin-bottom: 12px; }

.quiz-form {
  gap: 16px;
}
.quiz-question-block {
  margin-top: 4px;
}
.quiz-question-index {
  margin: 0 0 10px;
  font-size: 1.95rem;
  line-height: 1.1;
  font-weight: 800;
  color: var(--text);
}
.quiz-question-card {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  padding: 18px 16px;
}
.quiz-question-text {
  font-size: 1.1rem;
  line-height: 1.4;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.quiz-question-help {
  color: var(--muted);
  margin-bottom: 10px;
}
.quiz-options {
  display: grid;
  gap: 8px;
}
.quiz-option {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
.quiz-option input[type="radio"] {
  width: 15px;
  height: 15px;
  margin: 0;
}
.quiz-option-label {
  line-height: 1.35;
}

.online-users-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.online-users-list {
  display: grid;
  gap: 8px;
  max-height: 178px;
  overflow-y: auto;
  padding-right: 4px;
}
.online-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.22);
  padding: 8px;
}
.online-user-main {
  min-width: 0;
}
.online-user-name {
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.online-user-time {
  font-size: 0.82rem;
  color: var(--muted);
}
.btn-xs {
  padding: 5px 8px;
  font-size: 0.78rem;
  border-radius: 8px;
  line-height: 1;
}
body[data-theme="light"] .online-user-row {
  background: #eef2f7;
}

.dashboard-activity-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.dashboard-activity-feed {
  max-height: 230px;
  overflow-y: auto;
  padding-right: 8px;
}
.dashboard-activity-feed .timeline-item {
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.24);
  line-height: 1.35;
}
.dashboard-activity-feed .timeline-item .muted {
  display: inline-block;
  margin-left: 4px;
}
body[data-theme="light"] .dashboard-activity-feed .timeline-item {
  background: #eef2f7;
  border-color: rgba(15, 23, 42, 0.14);
  color: #0f172a;
}
body[data-theme="light"] .dashboard-activity-feed .timeline-item .muted {
  color: #334155;
}

.skeleton { height: 14px; border-radius: 6px; background: linear-gradient(90deg, rgba(30,41,59,0.6), rgba(51,65,85,0.8), rgba(30,41,59,0.6)); background-size: 200px 100%; animation: shimmer 1.2s infinite; }

.heatmap { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.heat-cell {
  height: 22px;
  border-radius: 6px;
  background: rgba(56,189,248, calc(0.15 + (var(--heat, 0) * 0.75)));
  border: 1px solid rgba(56,189,248,0.2);
}

.cert-editor { position: relative; }
.cert-canvas {
  position: relative;
  width: 100%;
  max-width: 1100px;
  aspect-ratio: 1.414;
  height: auto;
  min-height: 520px;
  background: #f7f7f7;
  border-radius: 12px;
  border: 1px dashed var(--border);
  overflow: hidden;
}
.cert-canvas.grid-on {
  background-image: linear-gradient(rgba(15,23,42,0.06) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(15,23,42,0.06) 1px, transparent 1px);
  background-size: 20px 20px;
}
.login-editor-shell.grid-on {
  background-image: linear-gradient(rgba(15,23,42,0.06) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(15,23,42,0.06) 1px, transparent 1px);
  background-size: 20px 20px;
}
.cert-guides {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.cert-guide {
  position: absolute;
  background: rgba(56,189,248,0.6);
  opacity: 0;
}
.cert-guide.v { width: 1px; top: 0; bottom: 0; left: 50%; }
.cert-guide.h { height: 1px; left: 0; right: 0; top: 50%; }
.cert-zoom {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
}
.cert-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cert-item {
  position: absolute;
  padding: 6px 8px;
  border: 1px dashed rgba(56,189,248,0.5);
  background: rgba(255,255,255,0.75);
  color: #0f172a;
  border-radius: 8px;
  cursor: move;
  user-select: none;
  max-width: 70%;
}
.cert-item.selected { outline: 2px solid rgba(56,189,248,0.8); }
.cert-logo { width: 140px; height: 60px; object-fit: contain; background: rgba(255,255,255,0.8); }
body.auth-split .cert-item {
  border: none;
  background: transparent;
  cursor: default;
}

.editor-grid { grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr); align-items: start; }
.editor-live-note { margin-bottom: 10px; }
.editor-canvas-wrap {
  width: 100%;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 12px;
  background:
    radial-gradient(600px 180px at 10% 0%, rgba(56,189,248,0.14), transparent),
    linear-gradient(180deg, rgba(15,23,42,0.38), rgba(15,23,42,0.18));
}
.login-editor-canvas-wrap { min-height: 520px; }
.home-editor-canvas-wrap { min-height: 520px; }
.login-props-compact .form-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.login-props-compact input:disabled,
.login-props-compact select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.login-tools-card {
  padding-top: 14px;
}
.login-tools-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 10px;
}
.login-tools-grid .tool-block {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: color-mix(in srgb, var(--card) 85%, transparent);
  display: grid;
  gap: 8px;
}
.login-action-form {
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.login-action-form.login-action-form-3 {
  grid-template-columns: 0.7fr 0.8fr 1fr auto;
}
.login-action-form .btn-primary,
.login-action-form .btn-ghost {
  min-height: 36px;
  padding: 8px 12px;
}
.login-tool-list {
  max-height: 120px;
  overflow: auto;
  border-top: 1px dashed var(--border);
  padding-top: 6px;
}

.login-editor-shell {
  display: grid;
  grid-template-columns: 1.05fr 1.2fr;
  min-height: min(520px, 72vh);
  border-radius: 14px;
  overflow: hidden;
  border: 1px dashed rgba(56,189,248,0.35);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}
.login-panel {
  position: relative;
  min-height: min(520px, 72vh);
  background: #f7f3f1;
}
.login-panel.right {
  background-size: cover;
  background-position: center;
}
.login-panel-overlay {
  position: absolute;
  inset: 0;
  background: rgba(9,32,40,0.62);
}
.login-panel-inner {
  position: relative;
  height: 100%;
  width: 100%;
}
.login-item {
  position: absolute;
}
.login-editor .login-item,
.home-editor .cert-item {
  border: 1px solid rgba(56,189,248,0.45);
  background: rgba(255,255,255,0.92);
  color: #0f172a;
  box-shadow: 0 6px 18px rgba(15,23,42,0.22);
}
.login-editor .login-item.selected,
.home-editor .cert-item.selected {
  outline: 2px solid rgba(56,189,248,0.9);
  outline-offset: 1px;
}
.home-editor .cert-item {
  min-width: 120px;
  min-height: 34px;
}
.home-editor .cert-item[data-key="title"] { font-size: 1.4rem; font-weight: 800; }
.home-editor .cert-item[data-key="subtitle"] { font-size: 1rem; font-weight: 700; }
.login-form-mock {
  display: grid;
  gap: 10px;
  background: #fff;
  padding: 18px;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.15);
  min-width: 260px;
}
.login-form-mock input {
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #0f172a;
}
.login-editor-shell.preview-only .cert-item {
  border-style: solid;
  background: rgba(255,255,255,0.35);
  opacity: 0.35;
}
.cert-canvas.preview-only .cert-item {
  border-color: transparent;
  background: rgba(255,255,255,0.25);
  opacity: 0.35;
}

.thread { display: grid; gap: 10px; max-height: 380px; overflow: auto; padding-right: 6px; }
.message { display: grid; gap: 4px; }
.message .bubble {
  background: var(--card);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  max-width: 70%;
}
.message.me .bubble { background: rgba(56,189,248,0.15); border-color: rgba(56,189,248,0.4); margin-left: auto; }

.auth-body { display: flex; justify-content: center; align-items: center; height: 100vh; }
.auth-card { background: var(--card); padding: 32px; border-radius: 16px; box-shadow: var(--shadow); width: 360px; border: 1px solid var(--border); }
.auth-card input { width: 100%; margin-bottom: 12px; padding: 10px; border-radius: 8px; border: none; }

.auth-split { display: grid; grid-template-columns: var(--login-left-width, 25%) 1fr; min-height: 100vh; background: var(--page-bg, #f6f6f6); color: #0b1220; }
body.auth-split .omega-social-footer {
  grid-column: 1 / -1;
  margin-top: 0;
}
.login-left { padding: clamp(20px, 4vw, 42px) clamp(16px, 6vw, 64px); background: #f7f3f1; display: flex; flex-direction: column; justify-content: center; gap: 22px; position: relative; }
.login-top { position: absolute; top: 16px; left: 18px; font-size: 0.85rem; color: #7a7f86; }
.login-top .lang { display: inline-flex; align-items: center; gap: 6px; }
.login-right { background-size: cover; background-position: center; position: relative; }
.login-right-overlay { position: absolute; inset: 0; background: rgba(9,32,40,0.72); display: flex; flex-direction: column; justify-content: center; align-items: center; color: #c9f2ff; text-align: center; padding: 24px; }
.login-hero-title { font-size: 3.2rem; font-weight: 800; letter-spacing: 3px; color: #7ad9f5; }
.login-hero-sub { margin-top: 10px; font-size: 1.1rem; color: #e9f8ff; }
.login-hero-tag { margin-top: 6px; font-size: 1.2rem; font-weight: 700; color: #ffffff; }
.login-hero-note { margin-top: 22px; font-size: 1rem; color: #cfefff; max-width: 420px; }
.login-card { background: #fff; padding: 28px; border-radius: 14px; box-shadow: 0 12px 30px rgba(0,0,0,0.12); }
.login-card input { width: 100%; padding: 12px; border-radius: 8px; border: 1px solid #ddd; background: var(--login-input-bg, #495060); color: var(--login-input-text, #d9e2f2); }
.login-card input::placeholder { color: var(--login-input-placeholder, #9fb0c7); }
.auth-split .cert-item input { background: var(--login-input-bg, #495060); color: var(--login-input-text, #d9e2f2); }
.auth-split .cert-item input::placeholder { color: var(--login-input-placeholder, #9fb0c7); }
.login-links { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 14px 0; flex-wrap: wrap; }
.login-links .link { margin-top: 0; }
.login-links .muted { line-height: 1; }
.login-links-start { justify-content: flex-start; }
.login-left .logo { font-weight: 800; letter-spacing: 1px; }
.login-kicker { margin-top: 8px; letter-spacing: 1.4px; font-size: 0.9rem; color: #7c8a94; }
.input-row { margin-bottom: 10px; }
.btn-login { width: 100%; padding: 12px 16px; border-radius: 8px; background: var(--btn-primary-bg, var(--login-btn-start, #38BDF8)); color: var(--btn-primary-text, #00131f); border: 1px solid var(--btn-primary-bg, #38BDF8); }
.login-footer { font-size: 0.75rem; color: #8b9198; margin-top: 28px; }
.forgot-help { margin-top: 12px; line-height: 1.4; }
.support-link {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(56,189,248,0.45);
  background: rgba(56,189,248,0.1);
}
.support-link-inline {
  margin-top: 0;
  display: inline;
}
.social-footer-preview {
  margin-top: 6px;
  padding: 10px;
}
.social-footer-preview .omega-social-footer {
  margin-top: 0;
  border-radius: 10px;
  overflow: hidden;
}
.social-footer-preview .omega-social-links a {
  font-weight: 700;
  font-size: 0.68rem;
  text-transform: uppercase;
}

.btn-primary { background: var(--primary); border: none; padding: 10px 16px; border-radius: 10px; cursor: pointer; color: #001; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); padding: 10px 16px; border-radius: 10px; cursor: pointer; }
.link { display: inline-block; margin-top: 12px; color: var(--primary); text-decoration: none; }

.alerts { margin-bottom: 16px; }
.alert { padding: 10px; border-radius: 8px; margin-bottom: 6px; }
.alert.success { background: rgba(34,197,94,0.15); }
.alert.error { background: rgba(239,68,68,0.15); }

.empty { text-align: center; padding: 32px; color: var(--muted); border: 1px dashed var(--border); border-radius: 14px; }

.course-hero { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; margin-bottom: 16px; }
.course-cover { background: linear-gradient(135deg, rgba(11,18,32,0.85), rgba(17,24,39,0.85)); border: 1px solid var(--border); padding: 20px; border-radius: 16px; box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.cover-title { font-size: 1.2rem; font-weight: 800; margin-bottom: 6px; }
.course-meta { display: grid; gap: 12px; }
.course-layout { display: grid; grid-template-columns: 1.8fr 1fr; gap: 16px; }
.player { background: var(--card); border: 1px solid var(--border); padding: 16px; border-radius: 16px; box-shadow: var(--shadow); }
.player-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.player-screen { border-radius: 12px; overflow: hidden; background: rgba(15,23,42,0.8); padding: 10px; }
.player-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.course-lessons .lesson-item { display: flex; justify-content: space-between; align-items: center; padding: 10px; border-radius: 10px; border: 1px solid var(--border); margin-top: 8px; text-decoration: none; color: var(--text); }
.course-lessons .lesson-item.active { background: var(--hover); }
.lesson-title { font-weight: 700; color: var(--course-title-color, var(--text)); }

.pdf-preview { width: 100%; height: 240px; border: 0; margin-top: 8px; border-radius: 10px; background: rgba(15,23,42,0.6); }
.course-cover-clean {
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  padding: 12px 14px;
  border: 1px solid var(--border);
}

@media (max-width: 900px) {
  .sidebar { position: static; width: 100%; height: auto; }
  .main { margin-left: 0; width: 100%; }
  .search { min-width: 0; width: 100%; }
  .course-hero, .course-layout { grid-template-columns: 1fr; }
  .auth-split { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; gap: 10px; }
  .top-actions { width: 100%; justify-content: space-between; }
  .editor-grid { grid-template-columns: 1fr; }
  .cert-canvas { min-height: 380px; }
  .login-editor-shell { grid-template-columns: 1fr; min-height: auto; }
  .editor-canvas-wrap { padding: 8px; }
  .login-panel { min-height: 360px; }
  .login-right { min-height: 260px; }
  .users-table { min-width: 980px; }
  .users-table td:last-child { min-width: 420px; }
  .users-table .table-actions { grid-template-columns: 1fr; }
  .home-banner-rotator { height: 240px; }
  .omega-social-title { font-size: 1rem; }
  .omega-social-footer-inner { padding: 8px 12px 10px; }
  .omega-social-links a { width: 36px; height: 36px; font-size: 0.8rem; }
  .student-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .student-kpi-grid { grid-template-columns: 1fr; }
}

body.sidebar-collapsed .sidebar {
  width: 76px;
  padding: 16px 10px;
}
body.sidebar-collapsed .sidebar .logo img {
  max-width: 36px;
  max-height: 36px;
  width: 36px;
  height: 36px;
  margin: 0 auto;
}
body.sidebar-collapsed .sidebar .logo {
  display: none;
}
body.sidebar-collapsed .sidebar nav a {
  justify-content: center;
  gap: 0;
}
body.sidebar-collapsed .sidebar nav a .label {
  display: none;
}
body.sidebar-collapsed .sidebar .collapse {
  display: none;
}
body.sidebar-collapsed .collapsed-logo-dock {
  display: flex;
}
body.sidebar-collapsed .sidebar-toggle {
  justify-content: center;
}
body.sidebar-collapsed #sidebar-toggle .toggle-icon {
  transform: rotate(180deg);
}
body.sidebar-collapsed .main {
  margin-left: 76px;
  width: calc(100% - 76px);
}

@media (max-width: 900px) {
  body.sidebar-collapsed .sidebar { width: 100%; }
  body.sidebar-collapsed .main { margin-left: 0; width: 100%; }
}

.lesson-item.locked { opacity: .55; filter: grayscale(.2); }
.lesson-item.locked .lesson-link { pointer-events: none; }
