/* Approved warm admin palette. Kept separate so the theme can be reverted
   by removing its link from base_site.html. Layout and status colors stay intact. */
:root {
  --cc-primary: #A65F58;
  --cc-primary-dark: #854A45;
  --cc-accent: #A65F58;
  --cc-accent-dark: #94524C;
  --cc-accent-soft: #FCF4F1;
  --cc-title: #9D5750;
  --cc-text: #3A302D;
  --cc-text-soft: #74635D;
  --cc-border: #EDE6E2;
  --cc-bg: #FFFFFF;
  --cc-surface: #FFFFFF;
  --cc-surface-soft: #FDFCFB;
  --primary: #A65F58;
  --secondary: #854A45;
  --accent: #FCF4F1;
  --body-fg: #3A302D;
  --body-bg: #FFFFFF;
  --body-quiet-color: #74635D;
  --body-loud-color: #3A302D;
  --link-fg: #9D5750;
  --link-hover-color: #854A45;
  --link-selected-fg: #854A45;
  --border-color: #EDE6E2;
  --hairline-color: #F1ECE8;
  --darkened-bg: #FDFCFB;
  --selected-bg: #FCF4F1;
  --selected-row: #FCF4F1;
}

html, html body, html body #container, html body.login {
  background: #FFFFFF !important;
}
html body #header {
  background: #FFFFFF !important;
  border-bottom-color: var(--cc-border) !important;
  box-shadow: 0 6px 18px rgba(58,36,24,.025);
}
html body #site-name img,
html body .cc-dd__menu,
html body .cc-portal-menu {
  border-color: var(--cc-border);
}
html body .cc-welcome,
html body .cc-user-welcome {
  color: #79546F !important;
}
html body .cc-welcome-quote {
  color: var(--cc-title) !important;
}
html body .cc-welcome-author { color: var(--cc-primary-dark); }

html body #content,
html body .module,
html body .inline-group,
html body .fieldset,
html body .form-row,
html body .cc-welcome-card {
  border-color: var(--cc-border) !important;
}
html body.change-list #content,
html body.change-form #content,
html body.delete-confirmation #content,
html body.history #content,
html body .module,
html body .inline-group,
html body .fieldset,
html body .form-row {
  background: #FFFFFF !important;
}
html body .module caption,
html body .module h2,
html body thead th,
html body #toolbar,
html body .submit-row {
  background: var(--cc-surface-soft) !important;
  border-color: var(--cc-border) !important;
}
html body thead th { color: var(--cc-title) !important; }
html body tbody tr { background: #FFFFFF !important; }
html body tbody tr:hover { background: #FDF9F7 !important; }
html body table { border-color: var(--cc-border) !important; }
html body #changelist-filter h3,
html body #changelist-filter details > summary { color: var(--cc-title); }

html body input:not([type=submit]):not([type=button]):not([type=reset]),
html body select,
html body textarea,
html body .select2-container--admin-autocomplete .select2-selection {
  background: var(--cc-surface-soft) !important;
  border-color: var(--cc-border) !important;
  color: var(--cc-text) !important;
  accent-color: var(--cc-primary);
}
html body input:focus,
html body select:focus,
html body textarea:focus,
html body .select2-container--focus .select2-selection {
  border-color: var(--cc-title) !important;
}

/* Navigation: dark sections, with a light selected module. */
html body .cc-topnav .cc-dd__btn,
html body .cc-user-btn,
html body .cc-toolbar-tab {
  background: rgba(166, 95, 88, .90) !important;
  border: 1px solid rgba(148, 82, 76, .90) !important;
  color: #FFFDF8 !important;
}
html body .cc-topnav .cc-dd__btn:hover,
html body .cc-user-btn:hover,
html body .cc-toolbar-tab:hover {
  background: rgba(148, 82, 76, .94) !important;
}
html body .cc-topnav .cc-dd__btn.is-active,
html body .cc-toolbar-tab.is-active {
  background: #FCF4F1 !important;
  border: 1px solid #D8B3A6 !important;
  color: var(--cc-title) !important;
}
html body .cc-topnav .cc-dd__btn.is-active:hover,
html body .cc-toolbar-tab.is-active:hover {
  background: #F8EAE4 !important;
}

/* Shared button states. Component variables also keep hover/focus consistent. */
html body .button,
html body input[type=submit],
html body input[type=button],
html body input[type=reset],
html body .submit-row input,
html body .submit-row a,
html body .object-tools a,
html body .object-tools button,
html body .filter-toggle-btn,
html body #changelist .actions button,
html body #toolbar input[type=submit],
html body.change-form .cc-form-actions .button,
html body.change-form .cc-form-actions input[type=submit],
html body.change-form .object-tools a,
html body .cancel-link,
html body .deletelink {
  --cc-button-bg: #F3E8D5;
  --cc-button-border: #B79867;
  --cc-button-text: #705531;
  --cc-button-hover: #EBDDC5;
  background: var(--cc-button-bg) !important;
  border: 1px solid var(--cc-button-border) !important;
  color: var(--cc-button-text) !important;
  box-shadow: none !important;
  text-decoration: none !important;
  text-transform: none !important;
}

html body .filter-toggle-btn {
  --cc-button-bg: #ECE2D2;
  --cc-button-hover: #E3D5BF;
}

html body input[type=submit],
html body .submit-row input,
html body.change-form .cc-form-actions input[type=submit],
html body #changelist .actions button,
html body #toolbar input[type=submit] {
  --cc-button-bg: #F3DDD5;
  --cc-button-border: #C69483;
  --cc-button-text: #8E4943;
  --cc-button-hover: #ECCDC2;
}

html body .cancel-link,
html body .submit-row .cancel-link,
html body.change-form .cc-form-actions .cancel-link {
  --cc-button-bg: #EAD9D1;
  --cc-button-border: #A67A69;
  --cc-button-text: #704235;
  --cc-button-hover: #DFC7BC;
}

html body .deletelink,
html body .submit-row .deletelink,
html body.change-form .cc-form-actions .cc-delete-link,
html body.delete-confirmation form input[type=submit] {
  --cc-button-bg: #E6D8E2;
  --cc-button-border: #A4879D;
  --cc-button-text: #68435F;
  --cc-button-hover: #DAC5D4;
}

html body .button:hover,
html body input[type=submit]:hover,
html body input[type=button]:hover,
html body input[type=reset]:hover,
html body .submit-row input:hover,
html body .submit-row a:hover,
html body .object-tools a:hover,
html body .object-tools button:hover,
html body .filter-toggle-btn:hover,
html body #changelist .actions button:hover,
html body #toolbar input[type=submit]:hover,
html body.change-form .cc-form-actions .button:hover,
html body.change-form .cc-form-actions input[type=submit]:hover,
html body.change-form .object-tools a:hover,
html body .cancel-link:hover,
html body .deletelink:hover {
  background: var(--cc-button-hover) !important;
  border-color: var(--cc-button-border) !important;
  color: var(--cc-button-text) !important;
}

html body input:focus-visible,
html body select:focus-visible,
html body textarea:focus-visible,
html body button:focus-visible,
html body a:focus-visible,
html body.change-form .cc-form-actions .button:focus-visible,
html body.change-form .object-tools a:focus-visible {
  outline: 2px solid var(--cc-primary) !important;
  outline-offset: 3px !important;
}
html body input:disabled,
html body button:disabled,
html body .button[aria-disabled=true] {
  opacity: .55;
}

/* History is not part of the editing controls. Keep other object tools. */
html body.change-form .object-tools li:has(> a.historylink),
html body.change-form .cc-form-actions .historylink {
  display: none !important;
}
html body.change-form .object-tools:not(:has(li:not(:has(> a.historylink)))) {
  display: none !important;
}

/* Equipo: keep the student link and its count on one line. */
body.app-equipo.model-miembroequipo.change-list #result_list .column-alumnos_asignados_link,
body.app-equipo.model-miembroequipo.change-list #result_list .field-alumnos_asignados_link {
  min-width: 11rem;
  white-space: nowrap;
}
body.app-equipo.model-miembroequipo.change-list #result_list .field-alumnos_asignados_link .button {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  white-space: nowrap;
}


/* Shared collapsible sections: retain the module border and terracotta text. */
html body fieldset.module.collapse > details > summary {
  background: transparent !important;
  border: 0 !important;
  color: var(--cc-primary-dark) !important;
}
html body fieldset.module.collapse > details > summary > .fieldset-heading,
html body fieldset.module.collapse > details > summary > .inline-heading {
  background: transparent !important;
  border: 0 !important;
  color: inherit !important;
}
html body fieldset.module.collapse > details > summary:focus-visible {
  outline: 2px solid var(--cc-primary-dark);
  outline-offset: 2px;
}
