
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  line-height: 1.2em;
  color: #343a40;
  background-color: #f8f9fa;
}

/* Etiquetas de formularios de edición */
.etiqueta {
  text-align: right;
  font-family: arial;
  font-weight: bold;
  font-size: 11px;
  color: rgb(80, 80, 100);
  padding-right: 3px;
}

.etiqueta-l {
  text-align: left;
  font-family: arial;
  font-weight: bold;
  font-size: 11px;
  color: rgb(80, 80, 100);
}

/* Mensajes de error en formularios */
.field_with_errors {
  padding: 1px;
  background-color: red;
  display: table;
}

#error_explanation {
  position: relative;
  width: 500px;
  margin: auto;
  border: 1px solid red;
  margin-bottom: 1em;
  background-color: #f0f0f0;
}
#error_explanation h2 {
  text-align: left;
  font-weight: bold;
  padding: 5px 5px 5px 15px;
  font-size: 12px;
  margin: 0px;
  background-color: #c00;
  color: #fff;
}
#error_explanation ul li {
  font-size: 12px;
  list-style: square;
}

.pantalla_login {
  position: relative;
  width: 500px;
  margin: auto;
  margin-top: 100px;
  font-size: 1.2em;
}
.pantalla_login fieldset {
  margin-top: 5px;
  border: 0px;
}
.pantalla_login fieldset legend {
  color: #ddf;
  margin: auto;
  padding: 0.5em 1.5em;
  padding-top: 1em;
}
.pantalla_login label {
  width: 12em;
  float: left;
  text-align: right;
  padding-top: 0.3em;
  margin-right: 1em;
  display: block;
}
.pantalla_login div {
  margin: 0.5em 0;
}

.admin {
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
}
.admin h1 {
  font-size: 1.5em;
  color: #4c555d;
  margin-bottom: 25px;
  border-bottom: 1px solid #007bff;
  padding-bottom: 10px;
}

a {
  color: #324DE8;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.app-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#main-content {
  flex-grow: 1;
  padding: 20px;
  max-width: 1400px;
  margin: 20px auto;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.flash-message {
  padding: 15px 20px;
  margin: 10px auto;
  max-width: 1200px;
  border-radius: 4px;
  font-size: 0.95em;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.flash-message .message-content {
  display: flex;
  align-items: center;
  gap: 10px;
}
.flash-message .message-icon {
  font-size: 1.2em;
}
.flash-message.notice {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}
.flash-message.notice .message-icon {
  color: #28a745;
}
.flash-message.alert {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
}
.flash-message.alert .message-icon {
  color: #ffc107;
}
.flash-message.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}
.flash-message.error .message-icon {
  color: #dc3545;
}

/* --- Header (Cabecera) Styling --- */
.app-header {
  background-color: #324DE8;
  color: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.app-header .header-top-bar {
  background-color: rgb(64.5325443787, 72.174556213, 78.9674556213);
  height: 35px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  font-size: 0.85em;
}
.app-header .header-top-bar .header-top-bar-inner {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}
.app-header .header-top-bar .welcome-section {
  display: flex;
  align-items: center;
  gap: 15px;
}
.app-header .header-top-bar .welcome-section .welcome-message {
  white-space: nowrap;
}
.app-header .header-top-bar .welcome-section .welcome-message b {
  color: rgb(233.4210526316, 236.2631578947, 252.5789473684);
}
.app-header .header-top-bar .welcome-section .user-profile-actions {
  display: flex;
  gap: 10px;
}
.app-header .header-top-bar .welcome-section .user-profile-actions a {
  color: rgba(255, 255, 255, 0.8);
}
.app-header .header-top-bar .welcome-section .user-profile-actions a:hover {
  color: #fff;
  text-decoration: underline;
}
.app-header .logout-link {
  background: none;
  border: none;
  font-size: 0.9em;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  text-decoration: none;
}
.app-header .logout-link:hover {
  text-decoration: underline;
}
.app-header .header-main-nav-bar {
  background: linear-gradient(to right, white, rgb(229.5, 229.5, 229.5));
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 20px;
}
.app-header .header-main-nav-bar .header-main-nav-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}
.app-header .logo {
  display: flex;
  align-items: center;
}
.app-header .logo img {
  max-height: 40px;
  width: auto;
  filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.3));
}
.app-header .main-nav {
  flex-grow: 1;
  text-align: center;
}
.app-header .main-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
}
.app-header .main-nav ul li {
  margin: 0 15px;
}
.app-header .main-nav ul li a {
  color: #4c555d;
  font-weight: 500;
  padding: 5px 0;
  transition: all 0.2s ease-in-out;
  position: relative;
  text-decoration: none;
}
.app-header .main-nav ul li a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 0;
  height: 2px;
  background-color: #4c555d;
  transition: width 0.2s ease-in-out;
}
.app-header .main-nav ul li a:hover {
  color: #4c555d;
}
.app-header .main-nav ul li a:hover::after {
  width: 100%;
}
.app-header .main-nav ul li a.active {
  color: #4c555d;
  font-weight: 600;
}
.app-header .main-nav ul li a.active::after {
  width: 100%;
}
.app-header .user-controls { /* This block is now largely unused in new HTML, can be removed or repurposed if needed */
  display: none;
}
.app-header .menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #4c555d;
  font-size: 1.5em;
  cursor: pointer;
  padding: 5px;
}
.app-header .menu-toggle:hover {
  opacity: 0.8;
}
.app-header .mobile-nav {
  display: none;
  background-color: rgb(242.25, 242.25, 242.25);
  padding: 10px 0;
  width: 100%;
}
.app-header .mobile-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.app-header .mobile-nav ul li a {
  display: block;
  padding: 12px 20px;
  color: #4c555d;
}
.app-header .mobile-nav ul li a:hover {
  background-color: #cccccc;
}
.app-header .mobile-nav .mobile-user-links {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 10px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.app-header .mobile-nav .mobile-user-links .mobile-dropdown-item {
  color: rgba(255, 255, 255, 0.8);
  display: block;
  padding: 8px 20px;
}
.app-header .mobile-nav .mobile-user-links .mobile-dropdown-item:hover {
  background-color: rgb(23.3026315789, 50.6578947368, 207.6973684211);
  color: #fff;
}
.app-header .app-header.menu-open .mobile-nav {
  display: block;
}

/* --- Footer (Pie) Styling --- */
.app-footer {
  background-color: #343a40;
  color: #adb5bd;
  padding: 20px 0px;
  margin-top: auto;
  width: 100%;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
}
.app-footer .footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  text-align: center;
}
.app-footer .footer-logo {
  margin-bottom: 15px;
}
.app-footer .footer-logo img {
  height: 40px;
  width: auto;
  filter: brightness(0) invert(1);
}
.app-footer .footer-info p {
  margin: 5px 0;
  font-size: 0.85em;
}
.app-footer .footer-info a {
  color: #adb5bd;
}
.app-footer .footer-info a:hover {
  color: #fff;
}

/* --- Responsive Design (Media Queries) --- */
@media (max-width: 992px) {
  .app-header .header-top-bar .welcome-section {
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
  }
  .app-header .header-top-bar .welcome-message {
    flex-basis: 100%;
    text-align: center;
  }
  .app-header .header-top-bar .user-profile-actions {
    flex-basis: 100%;
    justify-content: center;
  }
  .app-header .main-nav {
    display: none;
  }
  .app-header .header-main-nav-bar-inner {
    justify-content: space-between;
  }
  .app-header .menu-toggle {
    display: block;
  }
  .app-header.menu-open .mobile-nav {
    display: block;
  }
}
@media (max-width: 768px) {
  #main-content {
    margin: 10px;
    padding: 15px;
  }
  .app-header .header-top-bar {
    height: auto;
    padding: 10px 15px;
  }
  .app-header .header-main-nav-bar {
    height: auto;
    padding: 10px 15px;
  }
  .app-header .header-main-nav-bar-inner {
    flex-wrap: wrap;
    justify-content: center;
  }
  .app-header .header-main-nav-bar-inner .logo {
    flex-basis: 100%;
    text-align: center;
    margin-bottom: 10px;
  }
  .app-header .app-footer .footer-inner {
    padding: 15px;
  }
}
@media (max-width: 576px) {
  .app-header .header-top-bar .welcome-section .welcome-message {
    font-size: 0.8em;
  }
  .app-header .header-top-bar .welcome-section .user-profile-actions a {
    font-size: 0.8em;
  }
  .app-header .header-main-nav-bar .logo img {
    max-height: 35px;
  }
  #main-content {
    padding: 10px;
    margin: 10px;
  }
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.instrucciones {
  background-color: #e9ecef;
  border-left: 5px solid #007bff;
  padding: 15px 20px;
  margin-bottom: 20px;
  border-radius: 5px;
  color: #495057;
  font-size: 0.95em;
}

.filters-container {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  /* --- AÑADE ESTAS DOS LÍNEAS PARA ARREGLAR EL DESPLEGABLE --- */
  position: relative;
  z-index: 2; /* Un z-index mayor que 1 crea un contexto de apilamiento seguro */
}

.form {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 15px;
  margin-bottom: 30px;
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
.form tr {
  vertical-align: top;
}
.form td {
  padding: 8px 15px;
}
.form td:first-child {
  font-weight: 600;
  color: #4c555d;
  width: 150px;
  text-align: right;
  padding-right: 20px;
}
.form td.display-value {
  font-weight: normal;
  color: #555;
}
.form td b {
  display: block;
  margin-top: 20px;
  margin-bottom: 10px;
  font-size: 1.1em;
  color: #333;
  border-bottom: 1px solid #f8f9fa;
  padding-bottom: 5px;
}
.form td[colspan="6"], .form td[colspan=all] {
  text-align: center;
  padding-top: 30px;
}

.form-label-inline {
  font-weight: 600;
  color: #4c555d;
  margin-left: 10px;
  margin-right: 5px;
}

@media (max-width: 768px) {
  .form {
    padding: 15px;
  }
  .form td {
    display: block;
    width: 100%;
    text-align: left !important;
    padding-left: 0;
    padding-right: 0;
  }
  .form td:first-child {
    padding-bottom: 5px;
    width: auto;
  }
  .form tr {
    margin-bottom: 20px;
    display: block;
    border-bottom: 1px dashed #f8f9fa;
  }
  .form tr:last-child {
    border-bottom: none;
  }
  .form td[colspan="6"], .form td[colspan=all] {
    padding-top: 15px;
  }
}
.button-as-link {
  background: none !important;
  border: none;
  padding: 0 !important;
  cursor: pointer;
  display: inline;
  margin: 0;
}

.form-div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 1000px;
  min-width: 900px;
  margin: 0 auto;
}
.form-div fieldset {
  margin: 25px;
  -webkit-border-radius: 10px;
  -moz-border-radius: 10px;
  border-radius: 10px;
  border: 0.7px solid #5C7FF7;
}
.form-div fieldset legend {
  color: #4c555d;
  padding: 0.5em 1.5em;
}

.form-div-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 10px;
}

.form-div-label,
.form-div-field {
  flex: 0 0 25%;
  max-width: 75%;
  box-sizing: border-box;
  padding-right: 8px;
}

.form-div-label {
  min-width: 100px;
  font-weight: 500;
  color: #4c555d;
  text-align: right;
  padding-top: 0;
}

.form-div-label-inline {
  font-weight: 600;
  color: #4c555d;
  margin-left: 10px;
  margin-right: 5px;
}

.form-div-field {
  min-width: 0;
  flex-grow: 3;
}

.form-div-field input,
.form-div-field select {
  width: 100%;
  box-sizing: border-box;
}

.form-actions {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 20px;
  padding: 0 10px;
  box-sizing: border-box;
}

@media (max-width: 900px) {
  .form-div {
    min-width: 0;
    max-width: 100%;
    padding: 0 10px;
  }
}
@media (max-width: 768px) {
  .form-div-row {
    flex-direction: column;
    align-items: stretch;
  }
  .form-div-label,
  .form-div-field {
    max-width: 100%;
    flex-basis: 100%;
    text-align: left;
    padding-right: 0;
  }
}
input[type=text], input[type=number],
input[type=date],
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #dee2e6;
  border-radius: 5px;
  font-size: 1em;
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  box-sizing: border-box;
}
input[type=text]:focus, input[type=number]:focus,
input[type=date]:focus,
select:focus {
  border-color: #007bff;
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

input[type=checkbox] {
  margin-right: 8px;
  transform: scale(1.2);
}

input[type=submit] {
  background-color: #007bff;
  color: #fff;
  padding: 12px 25px;
  border: none;
  border-radius: 5px;
  font-size: 1.1em;
  font-family: verdana, arial;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out, transform 0.1s ease-in-out;
}
input[type=submit]:hover {
  background-color: rgb(0, 98.4, 204);
  transform: translateY(-1px);
}
input[type=submit]:active {
  background-color: rgb(0, 86.1, 178.5);
  transform: translateY(0);
}

@media (max-width: 480px) {
  .instrucciones {
    padding: 10px 15px;
    font-size: 0.9em;
  }
  input[type=submit] {
    padding: 10px 20px;
    font-size: 1em;
  }
}
table.index {
  border-collapse: collapse;
  margin-top: 20px;
  margin: auto;
  background-color: #fff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  overflow: hidden;
}
table.index th,
table.index td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #dee2e6;
}
table.index th {
  background-color: #e9ecef;
  color: #4c555d;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.9em;
  letter-spacing: 0.5px;
  border-top: 1px solid #dee2e6;
  border-bottom: 2px solid #007bff;
}
table.index tr:nth-child(even) {
  background-color: rgb(249.9, 249.9, 249.9);
}
table.index tr:hover {
  background-color: rgb(244.8, 244.8, 244.8);
}
table.index td[colspan="2"] {
  background-color: #e9ecef;
  font-weight: 600;
  color: #4c555d;
  text-transform: uppercase;
  padding-top: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid #007bff;
  font-size: 1.1em;
  text-align: left;
}
table.index td.indent {
  padding-left: 30px;
  color: #555;
  font-size: 0.95em;
}
table.index td.centro {
  text-align: center;
}
table.index td.image_left img {
  display: block;
  margin-left: 0px;
  padding: 1px;
}
table.index td a {
  color: #007bff;
  text-decoration: none;
}
table.index td a:hover {
  text-decoration: underline;
}

.centrado {
  text-align: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #dee2e6;
}
.centrado a {
  display: inline-flex;
  align-items: center;
  color: #4c555d;
  text-decoration: none;
  margin: 0 10px;
}
.centrado a img {
  margin-right: 5px;
}
.centrado a:hover {
  color: rgb(41.5976331361, 46.5236686391, 50.9023668639);
  text-decoration: underline;
}

@media (max-width: 768px) {
  table.index {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  table.index th, table.index td {
    min-width: 150px;
    white-space: normal;
  }
  table.index td[colspan="2"] {
    white-space: normal;
  }
}
@media (max-width: 480px) {
  .admin {
    padding: 15px;
  }
  .admin h1 {
    font-size: 1.8em;
  }
  table.index th, table.index td {
    padding: 10px 12px;
    font-size: 0.9em;
  }
  table.index td.indent {
    padding-left: 20px;
  }
  table.index td[colspan="2"] {
    font-size: 1em;
    padding: 12px;
  }
  .centrado a {
    font-size: 0.9em;
    margin: 0 5px;
  }
  .centrado img {
    max-width: 20px;
    max-height: 20px;
  }
}
