@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

.dc-dashboard {
  /* Reset box sizing for plugin area */
  box-sizing: border-box;
  font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
  --dc-bg: #0b1220;
  --dc-panel: #ffffff;
  --dc-muted: #64748b;
  --dc-text: #0f172a;
  --dc-border: rgba(15, 23, 42, 0.12);
  --dc-shadow: 0 18px 50px rgba(2, 6, 23, 0.12);
  --dc-radius: 14px;
  --dc-radius-sm: 10px;
  --dc-primary: #0f172a;
  --dc-primary-2: #1e293b;
  --dc-success: #16a34a;
  --dc-danger: #e11d48;

  /* Full width mesmo dentro de containers (Elementor/tema) */
  width: 100%;
  max-width: 100%;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 0;
  overflow-x: hidden;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
}

/* Force link color to avoid theme red */
.dc-dashboard a {
  color: #fff;
  text-decoration: none;
}

.dc-dashboard a:hover {
  color: #fff;
}

/* evita duplicação visual: o modal de mídia já permite upload */
.dc-dashboard #dc_featured_image,
.dc-dashboard #dc_foto_professor {
  display: none !important;
}

.dc-dashboard input[type="file"] {
  display: none !important;
}

.dc-dashboard * {
  box-sizing: border-box;
}

.dc-app {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
  border-radius: var(--dc-radius);
  overflow: visible;
  box-shadow: var(--dc-shadow);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

@media (min-width: 980px) {
  .dc-app {
    grid-template-columns: 290px 1fr;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
  }
}

.dc-sidebar {
  background: #ffffff;
  color: var(--dc-text);
  padding: 18px;
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  display: flex !important;
  flex-direction: column !important;
  height: auto;
  overflow: visible;
}

@media (min-width: 980px) {
  .dc-sidebar {
    height: 100%;
    overflow: hidden;
  }
}

.dc-sidebar__section {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  scrollbar-width: thin;
  /* Firefox */
  scrollbar-color: #cbd5e1 transparent;
  padding-bottom: 10px;
}

.dc-sidebar__section::-webkit-scrollbar {
  width: 4px;
}

.dc-sidebar__section::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 4px;
}

.dc-user-footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.dc-user-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  color: var(--dc-text);
}

.dc-user-logout {
  color: #ef4444 !important;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #fef2f2;
  border-radius: 6px;
  transition: all 0.2s;
  text-decoration: none;
}

.dc-user-logout:hover {
  background: #fee2e2;
}

.dc-brand {
  padding: 18px 12px 10px;
  /* Adjusted padding */
}

.dc-brand__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.5px;
  /* Tighter letter spacing for logo feel */
  font-size: 22px;
  /* Much larger */
  color: #0f172a;
  line-height: 1;
}



/* evita hover do tema escurecer links dentro da sidebar */
.dc-sidebar a,
.dc-sidebar a:visited {
  color: rgba(15, 23, 42, 0.86);
}

.dc-sidebar a:hover,
.dc-sidebar a:focus {
  color: rgba(15, 23, 42, 0.92);
}

.dc-nav {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.dc-nav__item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  /* Aligned left for icon+text */
  gap: 12px;
  /* Space between icon and text */
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 400;
  border-radius: 12px;
  text-decoration: none;
  color: rgba(15, 23, 42, 0.86);
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  transition: background 120ms ease, border-color 120ms ease;
}

.dc-nav__item:hover {
  background: #f8fafc;
  border-color: rgba(37, 99, 235, 0.22);
}

.dc-nav__item.is-active {
  font-weight: 700;
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.22);
}

/* =========================================
   LISTA DE CURSOS (GRID LAYOUT)
   ========================================= */

/* Força container da lista a ser grid (evita conflito com alguns temas) */
.dc-dashboard .dc-list {
  display: grid !important;
  gap: 8px;
}

/* Classe utilitária para Header e Itens da lista */
.dc-list__grid {
  display: grid;
  grid-template-columns: 2fr 1.5fr 100px 80px;
  /* Name | Discipline | Status | Actions */
  gap: 50px;
  /* Increased gap for better separation */
  align-items: center;
}

/* Estilo do Card do Item */
.dc-list__item {
  /* Alinhamento é controlado por .dc-list__grid, mas mantemos propriedades visuais */
  font-size: 14px;
  font-weight: 500;
  padding: 12px 14px;
  border-radius: 14px;
  text-decoration: none;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #ffffff;
  box-shadow: 0 4px 6px rgba(15, 23, 42, 0.03);
  /* Sombra suave original */
  transition: all 0.2s ease;
  color: var(--dc-text);
  /* Garante cor do texto */
}


/* Estados do Card */
/* Estados do Card */
.dc-list__item:hover {
  /* transform: translateY(-2px); */
  /* border-color: rgba(37, 99, 235, 0.35); */
  /* box-shadow: 0 10px 20px rgba(37, 99, 235, 0.08); */
  /* Maintaining flat style as per request */
  background: #f8fafc;
  /* Slight gray on hover */
}

/* Estilo do Header da Lista */
.dc-list__header {
  /* Alinhamento é controlado por .dc-list__grid */
  font-weight: 700;
  color: var(--dc-text);
  font-size: 13px;
  opacity: 0.7;
  padding: 0 14px 6px 14px;
  margin-top: 24px;
  /* Aumentado espaçamento do contador */
  /* Padding lateral deve casar com o item */
}

.dc-sidebar__section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.dc-sidebar__section-title {
  font-size: 12px;
  font-weight: 700;
  color: rgba(15, 23, 42, 0.60);
  margin-bottom: 10px;
}

.dc-side-list {
  display: grid;
  gap: 6px;
  max-height: 250px;
  overflow: auto;
  /* padding-right removed for alignment */
}

.dc-side-list__item {
  display: block;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 400;
  border-radius: 12px;
  text-decoration: none;
  color: rgba(15, 23, 42, 0.86);
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  transition: background 120ms ease, border-color 120ms ease;
}

.dc-side-list__item:hover {
  background: #f8fafc;
  border-color: rgba(37, 99, 235, 0.22);
}

.dc-side-list__item.is-active {
  font-weight: 700;
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.22);
}

.dc-side-form {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  /* padding-right removed for alignment */
}

.dc-side-form__input {
  width: 100%;
  padding: 0 12px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #ffffff;
  color: rgba(15, 23, 42, 0.92);
  outline: none;
  font-size: 14px;
}

.dc-side-form .dc-button {
  height: 42px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  /* Make it full width if it's stacked, or auto if grid allows. Grid is 1fr currently. */
}

.dc-side-form__input::placeholder {
  color: rgba(15, 23, 42, 0.45);
}

.dc-main {
  background: #f6f7fb;
  padding: 18px;
}

.dc-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--dc-radius);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(8px);
  margin-bottom: 14px;
}

.dc-topbar__title {
  font-size: 16px;
  font-weight: 800;
  color: var(--dc-text);
}

.dc-topbar__actions {
  display: flex;
}

.dc-panel {
  background: var(--dc-panel);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--dc-radius);
  padding: 14px;
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.06);
}

.dc-panel__title {
  font-size: 14px;
  font-weight: 800;
  color: var(--dc-text);
}

.dc-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.dc-search {
  width: min(360px, 100%);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  outline: none;
}

.dc-notice {
  padding: 10px 14px;
  border-radius: var(--dc-radius-sm);
  margin-bottom: 14px;
  border: 1px solid transparent;
}

.dc-notice--success {
  font-size: 12px;
  background: rgba(34, 197, 94, 0.10);
  border-color: rgba(34, 197, 94, 0.25);
  color: #166534;
}

.dc-notice--error {
  font-size: 12px;
  background: rgba(244, 63, 94, 0.10);
  border-color: rgba(244, 63, 94, 0.25);
  color: #9f1239;
}

.dc-empty {
  font-size: 12px;
  font-weight: 400;
  color: var(--dc-text);
  transition: all 0.2s;
}

/* =========================================
   BADGES & UTILITIES
   ========================================= */

.dc-badge {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  color: var(--dc-text);
  background: rgba(15, 23, 42, 0.04);
  text-align: center;
  /* Garante texto centralizado na bolinha */
}

.dc-badge--publish {
  border-color: rgba(34, 197, 94, 0.25);
  background: rgba(34, 197, 94, 0.10);
  color: #166534;
}

.dc-badge--draft,
.dc-badge--pending {
  border-color: rgba(234, 179, 8, 0.25);
  background: rgba(234, 179, 8, 0.10);
  color: #854d0e;
}

.dc-badge--private {
  border-color: rgba(148, 163, 184, 0.30);
  background: rgba(148, 163, 184, 0.12);
  color: #334155;
}

.dc-link {
  color: var(--dc-primary);
  text-decoration: none;
}

.dc-link:hover {
  text-decoration: underline;
}

.dc-divider {
  height: 1px;
  background: rgba(15, 23, 42, 0.08);
  margin: 14px 0;
}

.dc-term-list {
  display: grid;
  gap: 8px;
}

.dc-term-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  box-shadow: 0 4px 6px rgba(15, 23, 42, 0.03);
  /* Sombra suave original */
  transition: all 0.2s ease;
  color: var(--dc-text);
  /* Garante cor do texto */
}

.dc-term-list__item:hover {
  background: #f8fafc;
}

.dc-term-actions {
  display: flex;
  gap: 8px;
}

.dc-term-list__name {
  font-size: 14px;
  font-weight: 800;
  color: var(--dc-text);
}

.dc-form {
  display: grid;
  gap: 12px;
}

.dc-field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--dc-text);
}

.dc-field input[type="text"],
.dc-field input[type="number"],
.dc-field input[type="url"],
.dc-field textarea,
.dc-field select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  box-sizing: border-box;
  font-size: 14px;
  background: #fff;
  outline: none;
}

.dc-field textarea {
  resize: vertical;
}

.dc-help {
  font-size: 12px;
  color: var(--dc-muted);
}

.dc-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 720px) {
  .dc-columns {
    grid-template-columns: 1fr 1fr;
  }
}

.dc-image-preview {
  margin-top: 10px;
}

.dc-upload-preview {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.dc-upload-preview img {
  width: 92px;
  height: 92px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid rgba(15, 23, 42, 0.10);
}

.dc-submit {
  margin-top: 8px;
}

.dc-button {
  display: inline-flex;
  height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  background-color: var(--dc-primary);
  color: #ffffff !important;
  /* Force white text */
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 150ms ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}


/* Strict Reset for buttons to avoid theme bleeding */
.dc-dashboard .dc-button {
  border-radius: 8px;
  font-weight: 600;
  line-height: 1.2;
  text-transform: none;
  background-color: var(--dc-primary) !important;
  background-image: none !important;
  color: #ffffff !important;
  border: none !important;
  outline: none !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  text-decoration: none !important;
}

.dc-dashboard .dc-button:hover {
  background-color: var(--dc-primary-2) !important;
  transform: translateY(-1px);
  color: #ffffff !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.dc-dashboard .dc-button--secondary {
  background-color: transparent !important;
  color: var(--dc-text) !important;
  border: 1px solid rgba(15, 23, 42, 0.2) !important;
  box-shadow: none !important;
}

.dc-dashboard .dc-button--secondary:hover {
  background-color: rgba(15, 23, 42, 0.05) !important;
  color: var(--dc-text) !important;
  border-color: rgba(15, 23, 42, 0.4) !important;
}

.dc-media-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

/* Image Wrapper for Overlay Icon */
.dc-image-wrapper {
  position: relative;
  display: inline-block;
  margin-top: 10px;
  border-radius: 12px;
  overflow: hidden;
  line-height: 0;
}

.dc-image-wrapper img {
  border-radius: 12px;
  display: block;
  max-width: 150px;
  height: auto;
  border: 1px solid rgba(15, 23, 42, 0.1);
}

.dc-remove-icon {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  flex-shrink: 0 !important;
  padding: 0 !important;
  border-radius: 50% !important;
  background: #ffffff !important;
  /* Force white */
  color: #64748b;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.dc-remove-icon:hover,
.dc-remove-icon:active,
.dc-remove-icon:focus {
  background: #ffffff !important;
  color: #ef4444 !important;
  transform: scale(1.1);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
  opacity: 1 !important;
}

.dc-remove-icon svg {
  display: block;
  width: 16px;
  height: 16px;
  pointer-events: none;
  /* Prevent click stealing */
}

/* Placeholder for Missing Image */
.dc-no-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 150px;
  height: 150px;
  background: #f8fafc;
  border: 1px dashed rgba(15, 23, 42, 0.2);
  border-radius: 12px;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  padding: 10px;
}

.dc-inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}



.dc-inline-form__input {
  width: 100%;
  padding: 0 12px;
  /* vertical padding removed in favor of height */
  height: 42px;
  /* Explicit height */
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  outline: none;
  display: flex;
  align-items: center;
}

/* Force button in inline form to match input height */
.dc-inline-form .dc-button {
  height: 42px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
}

.dc-icon-button {
  appearance: none;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 700;
}

.dc-modal[hidden] {
  display: none;
}

.dc-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.dc-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.65);
}

.dc-modal__dialog {
  position: relative;
  width: min(980px, calc(100% - 24px));
  margin: 24px auto;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  /* Garante que cabe na tela */
}

.dc-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #fff;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  flex-shrink: 0;
}

.dc-modal__title {
  font-weight: 900;
  color: var(--dc-text);
}

.dc-modal__body {
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  overflow-y: auto;
  /* Scroll apenas no corpo */
}

@media (min-width: 920px) {
  .dc-modal__body {
    grid-template-columns: 1fr 220px;
    align-items: start;
  }
}

.dc-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  flex-shrink: 0;
  background: #fff;
}



/* =========================================
   PAGINATION (Item 3)
   ========================================= */
.dc-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.dc-page-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--dc-text);
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dc-page-btn:hover:not(:disabled) {
  border-color: rgba(37, 99, 235, 0.4);
  color: var(--dc-primary);
  background: rgba(37, 99, 235, 0.04);
}

.dc-page-btn--active {
  background: var(--dc-primary);
  border-color: var(--dc-primary);
  color: #ffffff;
}

.dc-page-btn--active:hover {
  background: var(--dc-primary-hover);
  color: #ffffff;
}


.dc-page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f8fafc;
}

.dc-field label span {
  margin-left: 2px;
  font-weight: bold;
}

/* =========================================
   DISCIPLINE ACTIONS (Item 5)
   ========================================= */
.dc-term-list__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dc-term-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dc-icon-button--danger {
  color: #ef4444;
}

.dc-icon-button--danger:hover {
  background: rgba(239, 68, 68, 0.1) !important;
  color: #dc2626 !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
}

/* =========================================
   UI POLISH (Item 5 Follow-up)
   ========================================= */

/* Add spacing between title and form */
.dc-panel__title {
  margin-bottom: 24px;
}

/* Make inputs (Discipline & Search) smoother and consistent */
.dc-inline-form__input,
.dc-search {
  border: 1px solid #cbd5e1 !important;
  /* Smooth grey */
  border-radius: 6px !important;
  /* Consistent rounding */
  padding: 10px 14px !important;
  font-size: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 0.2s;
}

.dc-inline-form__input:focus,
.dc-search:focus {
  border-color: var(--dc-primary) !important;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.dc-term-count {
  color: #94a3b8;
  font-size: 0.9em;
  margin-left: 4px;
}

/* -------------------------------------
   WYSIWYG Editor Theme Overrides
   ------------------------------------- */

/* Wrapper Spacing & Radius */
#wp-dc_post_content-wrap {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Force label tight against editor with negative margin if needed, 
   but standard 0 should work if we kill the wrapper margin */
.dc-field label[for="dc_post_content"] {
  margin-top: 25px !important;
  margin-bottom: -25px !important;
  padding-bottom: 0 !important;
  display: block;
  position: relative;
  z-index: 0;
  /* Ensure it stays above if overlap occurs */
}

/* The Border Box */
.wp-editor-container {
  border: 1px solid #cbd5e1 !important;
  border-radius: 0 0 12px 12px !important;
  /* Bottom radius only */
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Tabs (Visual / Text) Overrides */
.wp-editor-tabs {
  margin-bottom: 0 !important;
}

.wp-switch-editor {
  border-radius: 8px 8px 0 0 !important;
  /* Rounded tabs */
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  border-bottom: none !important;
  color: #64748b !important;
  margin-top: 5px !important;
  box-shadow: none !important;
  outline: none !important;
  transition: all 0.2s;
}

.wp-switch-editor:hover {
  background: #e2e8f0 !important;
  color: #1e293b !important;
}

.wp-switch-editor.html-active,
.wp-switch-editor.tmce-active {
  background: #f8fafc !important;
  /* Match toolbar */
  color: #0f172a !important;
  border-bottom: 1px solid #f8fafc !important;
  /* Merge with toolbar */
}

/* Toolbar Background */
div.mce-toolbar-grp {
  background-color: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
  border-radius: 0 !important;
}

/* Ensure the header area (containing tabs) is also styled */
.wp-editor-tools {
  background-color: transparent !important;
  padding-top: 0 !important;
  margin-bottom: 0 !important;
}

/* Fix: If there is a "Quicktags" toolbar (Text mode), style it too */
.quicktags-toolbar {
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
  padding: 5px !important;
}

/* Fix Button Red Hover Bleed */
/* We must reset the aggressive global button styles for TinyMCE buttons */
.dc-dashboard .mce-btn button,
.dc-dashboard .mce-btn {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  transform: none !important;
  color: #475569 !important;
  padding: 2px !important;
}

.dc-dashboard .mce-btn:hover,
.dc-dashboard .mce-btn:hover button {
  background-color: #e2e8f0 !important;
  /* Neutral gray hover */
  color: #1e293b !important;
  border: 1px solid #cbd5e1 !important;
  transform: none !important;
  box-shadow: none !important;
}

/* Active Button State (Bold, Italic when active) */
.dc-dashboard .mce-btn.mce-active,
.dc-dashboard .mce-btn.mce-active button {
  background-color: #cbd5e1 !important;
  color: #0f172a !important;
}

/* Status Bar (bottom) */
.wp-editor-container .mce-statusbar {
  border-top: 1px solid #e2e8f0 !important;
  background: #f8fafc !important;
}

/* -------------------------------------
   FINAL STANDARDIZATION (Buttons & Inputs)
   ------------------------------------- */

/* Force all Primary Action Buttons to 42px height */
.dc-topbar__actions .dc-button,
.dc-topbar__actions .dc-button--secondary,
.dc-side-form .dc-button,
.dc-inline-form .dc-button {
  height: 42px !important;
  min-height: 42px !important;
  max-height: 42px !important;
  padding: 0 20px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  font-size: 14px !important;
  line-height: normal !important;
  border-radius: 12px !important;
}

/* Force all Sidebar Inputs to 42px height */
.dc-side-form__input {
  height: 42px !important;
  min-height: 42px !important;
  padding: 0 9px !important;
  /* User preferred 9px */
  border-radius: 6px !important;
  box-sizing: border-box !important;
  line-height: normal !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  background: #ffffff !important;
  color: rgba(15, 23, 42, 0.92) !important;
  width: 100% !important;
  transition: all 0.2s ease !important;
}

.dc-side-form__input:focus {
  border-color: rgba(37, 99, 235, 0.5) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
  outline: none !important;
}

/* Custom Modal Styles (Previously Missing) */
.dc-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: dcFadeIn 0.2s ease;
}

.dc-modal {
  position: relative;
  background: #ffffff;
  border-radius: 16px;
  padding: 24px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  animation: dcScaleIn 0.2s ease;
  border: 1px solid rgba(15, 23, 42, 0.08);
  display: block;
}

/* Removed .dc-dashboard .dc-modal override to fix hidden modals */

.dc-modal__title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 12px;
}

.dc-modal__content {
  font-size: 14px;
  color: #475569;
  margin-bottom: 24px;
  line-height: 1.5;
}

.dc-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Fix visibility of Cancel button in modal */
.dc-modal__actions .dc-button--secondary {
  color: #475569 !important;
  background: transparent !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
}

.dc-modal__actions .dc-button--secondary:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

.dc-button--danger {
  background-color: #ef4444 !important;
  color: #ffffff !important;
}

.dc-button--danger:hover {
  background-color: #dc2626 !important;
}

@keyframes dcFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes dcScaleIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* End keyframes */

/* Fix Inline Form Layout (Edit Mode) - Flexbox */
.dc-inline-form {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
}

.dc-inline-form__input {
  flex: 1 1 auto !important;
  /* Grow and shrink */
  min-width: 0 !important;
  /* Allow shrinking below content size */
  width: auto !important;
  /* Override fixed widths */
}

/* Ensure buttons take only natural width */
.dc-inline-form .dc-button,
.dc-inline-form .dc-button--secondary {
  flex: 0 0 auto !important;
  width: auto !important;
  white-space: nowrap !important;
}

/* Icon Button Definitions */
.dc-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--dc-muted) !important;
  background: #ffffff;
  /* White background for border visibility */
  border: 1px solid rgba(15, 23, 42, 0.12);
  /* RESTORED BORDER */
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  text-decoration: none !important;
}

.dc-icon-button:hover {
  background: #f8fafc;
  color: var(--dc-primary) !important;
  border-color: rgba(15, 23, 42, 0.2);
}

.dc-icon-button--danger {
  color: #ef4444 !important;
  border-color: rgba(239, 68, 68, 0.2);
  /* Red border tint */
}

.dc-icon-button--danger:hover {
  background: rgba(239, 68, 68, 0.1) !important;
  color: #dc2626 !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
}

.dc-icon-button--danger:focus,
.dc-icon-button--danger:active {
  background: transparent !important;
  color: #ef4444 !important;
  border-color: rgba(239, 68, 68, 0.2) !important;
  box-shadow: none !important;
}

/* Toolbar & Counter Refinement */
.dc-toolbar {
  margin-bottom: 0px;
  /* Remove spacing to pull divider up */
}

.dc-counter {
  font-size: 12px !important;
  font-weight: 400 !important;
  color: #64748b !important;
  margin-top: 6px;
  margin-left: 2px;
}

/* Adjust Divider Position relative to Toolbar */
.dc-toolbar+.dc-divider {
  margin-top: 8px !important;
  margin-bottom: 24px !important;
  opacity: 0.6;
}

/* Fix Modal Confirm Button Radius */
.dc-dashboard .dc-button--danger {
  background-color: var(--dc-danger) !important;
  color: #ffffff !important;
  border: 1px solid transparent !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
  border-radius: 8px !important;
  /* Force consistency */
}

.dc-dashboard .dc-button--danger:hover {
  background-color: #be123c !important;
  /* darker red */
  border-color: transparent !important;
  transform: translateY(-1px);
}

/* ----------------------------------------------------------------
   TINYMCE / EDITOR FIXES
   Prevents jitter/shaking on hover by overriding generic button styles
   and stabilizing the TinyMCE (tox) toolbar.
   ---------------------------------------------------------------- */
.dc-dashboard .mce-btn,
.dc-dashboard .mce-btn button,
.dc-dashboard .tox .tox-tbtn,
.dc-dashboard .tox .tox-mbtn {
  transform: none !important;
  box-shadow: none !important;
  transition: none !important;
  border: 1px solid transparent !important;
  /* Force transparent border to prevent layout shift */
  margin: 0 !important;
}

.dc-dashboard .mce-btn:hover,
.dc-dashboard .mce-btn button:hover,
.dc-dashboard .tox .tox-tbtn:hover,
.dc-dashboard .tox .tox-mbtn:hover {
  transform: none !important;
  background: rgba(0, 0, 0, 0.05) !important;
  /* Standard hover bg */
  color: inherit !important;
  box-shadow: none !important;
  border-color: transparent !important;
}

/* Stabilize SVGs inside editor buttons */
.dc-dashboard .tox .tox-tbtn svg,
.dc-dashboard .tox .tox-mbtn svg {
  transform: none !important;
  transition: none !important;
}

/* Prevent tooltip jitter if any */
.dc-dashboard .tox .tox-pop {
  transform: none !important;
}

/* ----------------------------------------------------------------
   CHECKBOX GRID (DISCIPLINES UI)
   Replaces the ugly select multiple with a friendly grid
   ---------------------------------------------------------------- */
.dc-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  /* Space for focus rings */
}

.dc-checkbox-card {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  flex-wrap: nowrap !important;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--dc-text);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  line-height: normal !important;
  box-sizing: border-box !important;
  height: auto !important;
}

.dc-checkbox-card:hover {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.25);
}

/* Checked state styling */
.dc-checkbox-card:has(input:checked) {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.4);
  color: #1d4ed8;
  font-weight: 600;
}

.dc-checkbox-card input[type="checkbox"] {
  accent-color: #2563eb;
  min-width: 16px !important;
  width: 16px !important;
  height: 16px !important;
  margin: 0 !important;
  padding: 0 !important;
  cursor: pointer;
  display: inline-block !important;
  /* Revert display block which might have caused stacking */
  border: 1px solid #cbd5e1 !important;
  appearance: auto !important;
  /* Ensure generic appearance */
  position: static !important;
  float: none !important;
  flex-shrink: 0 !important;
}

/* ----------------------------------------------------------------
   LOGIN STATE
   ---------------------------------------------------------------- */
.dc-login-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  background: transparent;
}

.dc-login-card {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  padding: 40px;
  max-width: 400px;
  width: 100%;
  text-align: center;
}

.dc-login-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 20px;
  color: var(--dc-primary, #3b82f6);
  opacity: 0.9;
}

.dc-login-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--dc-text, #0f172a);
  margin-bottom: 8px;
}

.dc-login-text {
  font-size: 14px;
  color: var(--dc-muted, #64748b);
  margin-bottom: 24px;
  line-height: 1.5;
}

.dc-login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  background: var(--dc-primary, #3b82f6);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.dc-login-btn:hover {
  background: var(--dc-primary-dark, #1d4ed8);
  color: #fff;
  transform: translateY(-1px);
}

/* Scroll independente */
.dc-main {
  overflow-y: auto !important;
  height: 100% !important;
  min-height: 0 !important;
  scrollbar-width: thin;
}

/* Off-Canvas Mobile Menu Toggle */
.dc-mobile-toggle {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  padding: 0 !important;
  margin-right: 12px !important;
  border-radius: 8px;
  border: 1px solid transparent !important;
  background: transparent;
  color: var(--dc-text) !important;
  cursor: pointer;
  transform: translateY(-1px);
}

.dc-mobile-toggle:hover {
  background: rgba(15, 23, 42, 0.05) !important;
  color: #2563eb !important;
}

@media (min-width: 980px) {
  .dc-mobile-toggle {
    display: none !important;
  }
}

.dc-sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.dc-sidebar-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

/* ----------------------------------------------------------------
   IMAGE UPLOAD POLISH (Symmetry & Natural Height)
   ---------------------------------------------------------------- */
.dc-media-controls {
  width: 100%;
  margin-bottom: 8px;
}

.dc-media-controls .dc-button {
  width: 100%;
  justify-content: center;
}

.dc-image-wrapper {
  width: 100% !important;
  height: auto !important;
  min-height: 150px !important;
  aspect-ratio: auto !important;
  position: relative;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dc-image-wrapper img {
  width: 100% !important;
  height: auto !important;
  object-fit: contain !important;
}

.dc-no-image-placeholder {
  font-size: 13px;
  color: #94a3b8;
  font-weight: 500;
}

/* ================================================================
   MOBILE RESPONSIVENESS (max-width: 980px)
   ================================================================ */
@media (max-width: 980px) {

  /* 1. OFF-CANVAS SIDEBAR (Stable Viewport) */
  .dc-sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    height: 100svh !important;
    /* Stable Viewport Height */
    left: -300px;
    width: 280px;
    z-index: 9999;
    background: #fff !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    border-right: 1px solid rgba(15, 23, 42, 0.08);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 10px 0 25px -5px rgba(0, 0, 0, 0.1);
    padding-bottom: 0 !important;
    border-left: none !important;
  }

  .dc-sidebar.is-open {
    left: 0 !important;
  }

  .dc-sidebar-overlay {
    height: 100svh !important;
  }

  .dc-sidebar__section {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    min-height: 0 !important;
    height: auto !important;
  }

  /* 2. SIDEBAR FOOTER (Sticky Bottom) */
  .dc-user-footer {
    position: relative !important;
    flex-shrink: 0 !important;
    bottom: auto !important;
    width: auto !important;
    z-index: auto !important;
    border-top: 1px solid rgba(15, 23, 42, 0.08) !important;
    padding-bottom: 20px !important;
  }

  .dc-user-info {
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin: 0 !important;
  }

  /* 3. MAIN CONTENT & OVERFLOW FIX */
  .dc-main {
    width: 100%;
    height: auto !important;
    overflow: visible !important;
    min-height: auto !important;
  }

  /* 4. LIST CARDS LAYOUT */
  .dc-list__header {
    display: none !important;
  }

  .dc-list__item.dc-list__grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    padding: 16px !important;
    padding-bottom: 8px !important;
    align-items: flex-start !important;
    height: auto !important;
  }

  .dc-col-name {
    grid-column: 1 / -1;
    width: 100%;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 4px;
    text-align: left;
  }

  .dc-col-disc {
    grid-column: 1 / -1;
    margin-bottom: 8px;
    font-size: 13px;
    color: #64748b;
  }

  .dc-col-status {
    grid-column: 1;
    border-top: 1px solid #f1f5f9;
    padding-top: 12px;
    margin-top: 4px;
    display: flex;
    align-items: center;
  }

  .dc-col-actions {
    grid-column: 2;
    border-top: 1px solid #f1f5f9;
    padding-top: 12px;
    margin-top: 4px;
    width: 100%;
    justify-content: flex-end !important;
  }

  /* 5. PAGINATION FIXES */
  .dc-pagination {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    margin-top: 24px !important;
    width: 100% !important;
    padding-bottom: 20px;
  }

  /* Force hidden items to stay hidden (JS Pagination) */
  html body .dc-list__item[style*='display: none'] {
    display: none !important;
  }

  /* 6. TOPBAR COMPACT TITLE */
  .dc-topbar__title {
    display: flex !important;
    align-items: center !important;
    font-size: 16px !important;
    line-height: 1.1 !important;
  }

  /* Utility */
  .dc-hide-mobile {
    display: none !important;
  }

  .dc-topbar__title h1 {
    font-size: 16px !important;
    line-height: 1.1 !important;
    margin: 0 !important;
  }
}

/* PRIORITY MOBILE FIX: 50/50 BUTTON GRID */
@media (max-width: 1024px) {
  html body .dc-inline-form {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
    width: 100% !important;
    align-items: stretch !important;
  }

  /* Input spans full width = 2 columns */
  html body .dc-inline-form .dc-inline-form__input {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    height: 48px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }

  /* Buttons take 1 column each. Auto flow = row 2 */
  html body .dc-inline-form .dc-button {
    width: 100% !important;
    height: 48px !important;
    margin: 0 !important;
    justify-content: center !important;
    display: flex !important;
    align-items: center !important;
  }

  /* Create Mode Fix: Single button spans full */
  html body .dc-inline-form.dc-mode-create .dc-button {
    grid-column: 1 / -1 !important;
  }

  /* Course Form Submit Button: 100% Width */
  html body .dc-submit .dc-button {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
  }

  /* Mobile Checkbox Grid Uniform 2-Col */
  html body .dc-checkbox-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    /* Ensure uniform gap */
    row-gap: 8px !important;
    column-gap: 8px !important;
  }

  /* Force checkbox cards to be clean blocks */
  html body .dc-checkbox-card {
    margin: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
}