/** Clear all default styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  a {
    text-decoration: none;
    color: inherit;
  }
  
  button {
    cursor: pointer;
  }
  input {
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    font-style: inherit;
    color: inherit;
    background-color: white;
    border: 1px solid #ccc;
    padding: 0.3rem;
    border-radius: 4px;
  }
  input:focus-visible {
    outline: none;
    outline-offset: none;
    box-shadow: none;
  }
  
  /* Base font size rem */
  html {
    font-size: 14px;
  }
  
  /** Set the font family for the entire document */
  body {
    font-family: "Quicksand", sans-serif;
    font-optical-sizing: auto;
    font-size: 1rem;
    font-weight: 400;
    font-style: normal;
    padding: 0;
    margin: 0;
  }
  
  /** Set the background color and text color for the entire document */
  body {
    background-color: white;
    color: #333;
  }

/* Site footer */
.site-footer {
    margin-top: 32px;
    padding: 18px 16px;
    background: #0083c4;
    color: white;
}

.site-footer__inner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    font-weight: 600;
}
  
  header {
      display: flex;
      flex-direction: column;
      width: 100%;
      position: relative;
      background: white;
      height: 100px;
  }
  
  .header-logo {
      position: absolute;
      top: 0;
      left: 0;
      background: white;
      width: 200px;
      height: 100px;
      padding-right: 20px;
      border-right: 4px solid #0083c4;
      border-bottom: 4px solid #0083c4;
      border-bottom-right-radius: 20px;
  }
  
  .header-logo img {
    width: 100%;
    height: auto;
  }
  
  .header-content {
    width: 100%;
    text-align: center;
  }
  
  .header-menu {
    width: calc(100% - 200px);
    margin-left: 200px;
    height: 100%;
        position: relative;
  }
  
  .header-menu ul {
      display: flex;
      flex-wrap: wrap;
      align-content: center;
      justify-content: flex-start;
      width: 100%;
      height: 100%;
      gap: 1rem;
      list-style: none;
      padding-left: 1rem;
      background: #0083c4;
      color: white;
  }

  .header-menu ul a {
      color: white;
      text-decoration: none;
  }

  .header-menu ul a:hover {
      text-decoration: underline;
  }

  .header-menu ul .menu-item-config {
      margin-left: auto;
      display: flex;
      align-items: center;
      padding-right: 1rem;
  }

  .header-menu ul .menu-item-config .header-session {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      margin-right: 0.75rem;
  }

  .header-menu ul .menu-item-config .header-session-user {
      white-space: nowrap;
      font-weight: 600;
  }

  .header-menu ul .menu-item-config .header-session-logout {
      margin: 0;
  }

  .header-menu ul .menu-item-config .header-session-logout button {
      background: transparent;
      color: inherit;
      border: 1px solid rgba(255, 255, 255, 0.85);
      padding: 0.25rem 0.6rem;
      border-radius: 4px;
      font: inherit;
  }

  /* Auth (login) */
  .auth-login-page {
      display: flex;
      justify-content: center;
      padding: 48px 16px;
  }

  .auth-login-card {
      width: 100%;
      max-width: 480px;
      border: 1px solid #ccc;
      border-radius: 4px;
      padding: 24px;
      background: white;
  }

  .auth-login-card h2 {
      text-align: center;
      margin-bottom: 20px;
      font-size: 1.8rem;
  }

  .auth-login-field {
      margin-bottom: 12px;
  }

  .auth-login-field label {
      display: block;
      margin-bottom: 6px;
      font-weight: 600;
  }

  .auth-login-field input {
      width: 100%;
      padding: 0.5rem;
  }

  .auth-login-actions {
      display: flex;
      justify-content: flex-start;
      margin-top: 16px;
  }

  .header-menu ul .menu-config-trigger {
      align-items: center;
      justify-content: center;
      width: 2.25rem;
      height: 2.25rem;
  }

  .header-menu-toggle {
      display: none;
      align-items: center;
      justify-content: center;
      width: 2.5rem;
      height: 2.5rem;
      background: transparent;
      border: 1px solid rgba(255, 255, 255, 0.85);
      color: white;
      border-radius: 6px;
      margin: 0.75rem 1rem 0.75rem auto;
  }

  /* Header responsive: menú hamburguesa */
  @media (max-width: 700px) {
      header {
          height: auto;
          display: grid;
          grid-template-columns: auto 1fr;
          grid-template-rows: auto auto;
          align-items: center;
      }

      .header-content {
          display: contents;
      }

      .header-logo {
          position: static;
          width: auto;
          height: auto;
          padding: 10px 12px;
          border-right: 0;
          border-bottom-right-radius: 0;
          display: flex;
          align-items: center;
          justify-content: flex-start;
          grid-column: 1;
          grid-row: 1;
      }

      .header-logo img {
          max-width: 220px;
          width: 100%;
      }

      .header-menu {
          width: 100%;
          margin-left: 0;
          background: #0083c4;
          grid-column: 2;
          grid-row: 1;
          display: flex;
          justify-content: flex-end;
          align-items: center;
      }

      .header-menu-toggle {
          display: inline-flex;
          margin: 12px 16px 12px auto;
          position: relative;
          z-index: 60;
      }

      .header-menu ul {
          display: none;
          flex-direction: column;
          align-items: stretch;
          gap: 10px;
          padding: 12px 16px 16px;
          position: absolute;
          top: 100%;
          left: 0;
          right: 0;
          z-index: 55;
      }

      .header-menu.is-open ul {
          display: flex;
      }

      .header-menu ul .menu-item-config {
          margin-left: 0;
          align-items: flex-start;
          padding-right: 0;
          gap: 10px;
      }

      .header-menu ul .menu-item-config .header-session {
          flex-direction: column;
          align-items: flex-start;
          gap: 8px;
          width: 100%;
      }

      .header-menu ul .menu-item-config .header-session-user {
          white-space: normal;
      }

      .header-title {
          width: 100%;
          padding: 10px 16px 16px;
          font-size: 1.2rem;
          grid-column: 1 / span 2;
          grid-row: 2;
      }

      .auth-role-owner .action-content[title="Volver a empleados"] {
            display: none;
        }

        div#employee-docs-root table {
            display: flex;
        }

        div#employee-docs-root table thead {
            display: none;
        }

        div#employee-docs-root table tr {
            display: flex;
            flex-direction: column;
            padding-bottom: 24px;
        }

        div#employee-docs-root table tbody {
            width: 100%;
        }

        div#employee-docs-root table td {
            padding-bottom: 0 !important;
        }
  }
  
 .header-title {
    display: flex;
    align-content: center;
    justify-content: center;
    height: 100%;
    flex-wrap: wrap;
    font-size: 1.8rem;
    align-items: center;
    gap: 4px;
}
  
  form.filter-form {
      display: flex;
      width: calc(100% - 2rem);
      margin-top: 28px;
      margin-left: 1rem;
      margin-right: 1rem;
      border: 1px solid #ddd;
      border-radius: 4px;
      justify-content: space-between;
      background: #ddd;
  }
  .filter-form button {
      background: #0083c4;
      border: 0;
      color: white;
      padding: .7rem 1.5rem;
      font-size: 1.1rem;
      letter-spacing: .5px;
  }
  
  .filter-form input {
      border: 0 !important;
      border-bottom: 1px solid #ccc!important;
      border-radius: 4px;
      /* margin: 0 1rem; */
  }
  
  .filter {
      display: flex;
      height: 100%;
      align-items: center;
  }
  
  .filter label {
      font-size: .9rem;
      background: #ddd;
      height: 100%;
      display: flex;
      align-items: center;
      padding: 4px 0px 2px;
      width: 100%;
      /* height: 16px; */
  }
  
  .filters {
      height: 100%;
      display: flex;
      background: #ddd;
      padding-left: 12px;
      gap: 16px;
      justify-content: space-evenly;
  }
  
  table.listing-table {
      width: calc(100% - 2rem);
      margin: 1rem;
      border: 1px solid #ccc;
      border-radius: 4px;
      margin-top: 1.5rem;
      border-collapse: collapse;
  }
  
  table.listing-table thead {
      background: #0083c4;
      color: white;
  }
  
  table.listing-table thead th {
      text-align: center;
      padding: .5rem;
      font-weight: 400;
      font-size: .9rem;
  }
  
  .listing-pagination {
      width: max-content;
      margin: auto;
      display: flex;
      /* gap: 1rem; */
      border: 1px solid #ccc;
      text-align: center;
      border-radius: 4px;
  }
  
  .listing-pagination > * {
      width: 2rem;
      padding: .5rem;
  }
  
  .listing-pagination .active {
      background: #0083c4;
      color: white;
  }
  
  table.listing-table tbody td {
      padding: .5rem;
  }
  
  div.section {
      width: calc(100% - 2rem);
      margin: 1rem;
      border: 1px solid #ccc;
      border-radius: 4px;
      margin-top: 1.5rem;
      border-collapse: collapse;
  }
  
  .section-field {
      display: flex;
      padding: 1rem;
      gap: .8rem;
  }
  
  /* Layout min: ancho mínimo según contenido */
  .section-field-layout-min {
      flex: 0 0 auto;
      min-width: fit-content;
  }
  
  /* Layout auto: ancho automático basado en contenido o grid */
  .section-field-layout-auto {
      flex: 0 1 auto;
  }
  
  /* Layout fullwidth: ocupa todo el ancho disponible */
  .section-field-layout-fullwidth {
      flex: 1 0 100%;
      width: 100%;
  }
  
  .section-fields {
      display: flex;
      flex-wrap: wrap;
  }
  
  .section-field label {
      font-size: .9rem;
      background: #ccc;
      height: 100%;
      min-width: 140px;
      max-width: 140px;
      text-align: right;
      display: flex;
      align-items: center;
      padding: 0 .5rem 0 2rem;
      justify-content: flex-end;
      min-height: 2rem;
  }
  
  .section  h2 {
      padding: 1rem 1rem;
  }
  
  .section-field-value {
      display: flex;
      align-items: center;
      width: 100%;
  }
  
  .action-content > span:nth-child(2) {
      margin-left: .5rem;
  }
  
  .action-content:has(>i):has(>span) {
      border: 1px solid #CCC;
      padding: .2rem .5rem;
      border-radius: 4px;
  }
  
  .action-content:has(>i):has(>span):hover {
      background: #0083c4;
      color: white;
  }
  
  .section.header .section-field:has(.actions) {
      margin-left: auto;
  }
  .overlay {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 20;
      background: rgba(0,0,0,.5);
      display: flex;
      justify-content: center;
      align-items: center;
  }
  
  .popup {
      padding: 1rem 2rem;
      background: white;
      border-radius: 4px;
  }
  
  .popup-header {
      display: flex;
      justify-content: space-between;
      margin-bottom: 1rem;
  }
  
  button.popup-close {
      background: none;
      border: none;
      font-size: 1.2rem;
  }
  
  .popup-form-group {
      margin-bottom: .5rem;
  }
  
  button.popup-submit {
      background: #0083c4;
      border: none;
      padding: .5rem 1rem;
      color: white;
      border-radius: 4px;
      margin-top: 1rem;
  }
  
  .popup-form-group > label {
      margin-bottom: 0.2rem;
      display: block;
  }
  
  /* .section.section-list {
      border: 0;
  } */
  
  .section.section-list .section-field {
      padding: 0;
  }
  
  .section.section-list table.listing-table {
      padding: 0;
      margin: 0;
      border: 0;
      width: 100%;
  }
  
  .section.section-list table.listing-table thead {
      background: #CCC;
      color: #000;
      text-align: center;
  }
  
  .section.listing-field {
      padding: 0;
      margin: 0;
      border: 0;
  }
  
  .section.listing-field .section-field > label {
      display: none;
  }
  
  table.listing-table th.first:not(:first-child) {
      border-left: 1px solid #bbb;
  }
  
  table.listing-table th.last:not(:last-child) {
      border-right: 1px solid #bbb;
  }
  
  table.listing-table td.first:not(:first-child) {
      border-left: 1px solid #ccc;
  }
  
  table.listing-table td.last:not(:last-child) {
      border-right: 1px solid #ccc;
      border-left: 1px solid #ccc;
  }
  
  table.listing-table tfoot td.first:not(:first-child) {
      border-left: 1px solid #bbb;
  }
  
  table.listing-table tfoot td.last:not(:last-child) {
      border-right: 1px solid #bbb;
  }
  
  
  tr.listing-group th[colspan] {
      border: 1px solid #bbb;
      border-top: 0;
      border-bottom-color: #bbb;
  }
  
  tr.listing-group th[colspan]:last-child {
      border-right: 0;
  }
  
  tr.listing-group th[colspan]:first-child {
      border-left: 0;
  }
  
  .section > .section-content {
      overflow: auto;
  }
  
  .section.header > .section-content {
      overflow: visible;
  }
  
  .section .section > .section-content {
      overflow: visible;
  }
  
  .input-append .defirencial {
      list-style: none;
      position: absolute;
      background: white;
      padding: .5rem 1rem;
      border: 1px solid #bbb;
      border-radius: 4px;
      font-size: .85rem;
      z-index: 999;
      top: 475px;
      left: 300px;
      box-shadow: -2px 2px 5px rgba(0,0,0,.3);
      display: none;
  }
  
  .input-append .defirencial li {
      margin-bottom: .3rem;
      display: flex;
      justify-content: space-between;
      gap: 1rem;
  }
  
  .input-append .defirencial li:last-child {
      margin-bottom: 0;
  }
  
  .input:has(input:focus) .defirencial {
      display: block;
  }
  
  table.listing-table tfoot {
      background: #ccc;
      border-top: 1px solid #bbb;
  }
  table.listing-table tfoot td {
      padding: .5rem
  }
  
  .section.header {
      position: absolute;
      top: 33px;
      border: 0;
  }
  
  .section.stats .section-content {
      overflow: visible;
      min-height: 415px;
  }
  
  tbody tr td.colum-odd {
      background: #fffcee;
  }
  
  tbody tr td.colum-even {
      background: #f7ddd8;
  }
  
  
  .filter select:focus,
  .filter select:focus-visible,
  .filter select:focus-within,
  .filter select:active,
  .filter select:target,
  .filter select {
      border: 0;
      background: transparent;
      display: block;
      /* padding-left: 20px; */
      /* padding-bottom: 6px; */
      padding: 4px;
      border-bottom: 1px solid #cccccc;
      margin-bottom: 8px;
      /* margin-left: 12px; */
      /* margin-right: 12px; */
      transform: translateY(7px);
      outline: none !important;
      background: white;
      border-radius: 4px;
  }
  
  /* Multiselect Filter Styles */
  .multiselect-container {
      border-radius: 4px;
      /* padding: 8px; */
      background: white;
      max-width: 300px;
  }
  
  .multiselect-negate {
      padding: 8px;
      border-bottom: 1px solid #ddd;
      margin-bottom: 8px;
      background: #f9f9f9;
      border-radius: 4px;
  }
  
  .multiselect-negate label {
      display: flex;
      align-items: center;
      font-weight: bold;
      color: #d9534f;
      cursor: pointer;
      font-size: 0.9rem;
  }
  
  .multiselect-negate input[type="checkbox"] {
      margin-right: 8px;
  }
  
  .multiselect-options {
      max-height: 250px;
      overflow-y: auto;
  }
  
  .multiselect-option {
      padding: 4px 0;
  }
  
  .multiselect-option label {
      display: flex;
      align-items: center;
      cursor: pointer;
      font-size: 0.9rem;
      padding: 4px;
      border-radius: 2px;
      transition: background-color 0.2s;
  }
  
  .multiselect-option label:hover {
      background-color: #f5f5f5;
  }
  
  .multiselect-option input[type="checkbox"] {
      margin-right: 8px;
  }
  
  .multiselect-option input[type="checkbox"]:checked + span {
      font-weight: 500;
      color: #0083c4;
  }
  
  /* Mejoras para filtros */
  .filter {
      display: flex;
      height: 100%;
      align-items: center;
      position: relative;
      flex-direction: column;
      border-right: 1px solid #ddd;
      justify-content: flex-end;
      padding-bottom: 6px;
  }
  
  .filter .multiselect-container {
      /* margin-left: 8px; */
      flex-wrap: wrap;
      display: flex;
      background: #ddd;
  }
  
  .multiselect-dropdown {
      position: absolute;
      top: 100%;
      left: 0;
      z-index: 1000;
      display: none;
      width: 100%;
      max-height: 300px;
      overflow-y: auto;
      background-color: white;
      border: 1px solid #ccc;
      border-radius: 4px;
  }
  
  .multiselect-dropdown.open {
      display: block;
  }
  
  span.multiselect-tag {
      display: flex;
      font-size: 10px;
      border: 1px solid #ccc;
      margin: 6px;
      justify-content: space-between;
      padding: 0 0 0 4px;
  }
  
  .multiselect-tags {
      background: white;
      width: 100%;
      max-height: 55px;
      overflow-y: auto;
  }
  
  .multiselect-tag button {
      padding: 0;
  }
  
  .multiselect-option {
      padding: 4px;
      font-size: 12px;
  }
  
  .multiselect-option[data-selected="true"] {
      background: #0083c4;
      color: white;
  }
  
  .multiselect-negate-label {
      background: white !important;
      /* margin-top: 4px !important; */
  }

  .multiselect-filter {
    width: 50%;
    min-width: 112px;
    margin: 0 !important;
}

.multiselect-negate-label {
    width: 30%;
    min-width: 60px;
    padding: 0 !important;
    background: #ddd !important;
}

.multiselect-negate-label input {
    margin: 0 4px !important;

}

.multiselect-option.highlight {
    background: #CCC;
}

.multiselect-input-container {
    display: flex;
    width: min-content;
}

.filter-form button.clear_btn {
    background: #79bee0;
    margin-left: 0;
}


.filter-form button.clear_btn {
    margin-left: auto;
    padding: 8px;
}

td:last-child {
    text-align: center;
}

.filter-form button:last-child {
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

/* Estilos para ordenación en listados */
.listing-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background-color 0.2s ease;
}


.listing-table th.sorted {
    background-color: #e8f4fd;
    font-weight: 600;
}

.listing-table th.sorted-asc,
.listing-table th.sorted-desc {
    background-color: white;
    color: #444;
    border: 2px solid #888 !important;
    border-right: 2px solid #888 !important;
    border-left: 2px solid #888 !important;
}

table.listing-table thead th span {position: absolute;top: 1px;right: 5px;}

table.listing-table thead th {
    position: relative;
}

.sort-indicator {
    font-size: 0.8em;
    margin-left: 5px;
    opacity: 0.7;
}

.listing-table th.sortable .sort-indicator {
    opacity: 0.4;
}

.listing-table th.sorted .sort-indicator {
    opacity: 1;
    font-weight: bold;
}

/* ============================================================================
   DASHBOARD STYLES
   ============================================================================ */

.dashboard-container {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
    width: 100%;
}

.dashboard-header {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: white;
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
}

.dashboard-title {
    margin: 0;
    font-size: 1.4em;
    font-weight: 600;
}

.dashboard-description {
    margin: 5px 0 0 0;
    opacity: 0.9;
    font-size: 0.9em;
}

.dashboard-content {
    position: relative;
    min-height: 400px;
    padding: 20px;
}

.dashboard-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 350px;
    color: #666;
}

.dashboard-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.dashboard-loading span {
    font-size: 1.1em;
    color: #666;
}

.dashboard-chart {
    width: 100%;
    height: 400px;
}

.dashboard-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 350px;
    color: #e74c3c;
    font-size: 1.1em;
}

.dashboard-error .error-message {
    background: #ffeaea;
    border: 1px solid #e74c3c;
    border-radius: 4px;
    padding: 15px 20px;
    border-left: 4px solid #e74c3c;
}

/* Dashboard grid layout for multiple dashboards */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.dashboard-grid .dashboard-container {
    margin: 0;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-container {
        margin: 10px 0;
    }
    
    .dashboard-content {
        padding: 15px;
        min-height: 300px;
    }
    
    .dashboard-chart {
        height: 300px;
    }
    
    .dashboard-loading {
        height: 250px;
    }
    
    .dashboard-error {
        height: 250px;
    }
}
.section-dashboard-main .section-fields {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
}

/* Estilos para componente de firma */
.signature-input-container {
    margin: 10px 0;
}

.signature-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.signature-tab {
    padding: 8px 16px;
    border: 1px solid #ccc;
    background-color: #f5f5f5;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.signature-tab:hover {
    background-color: #e0e0e0;
}

.signature-tab.active {
    background-color: #2782c0;
    color: white;
    border-color: #2782c0;
}

.signature-panel {
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fafafa;
}

.signature-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.btn-signature-clear,
.btn-signature-save,
.btn-signature-upload {
    padding: 8px 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-signature-clear {
    background-color: #f44336;
    color: white;
    border-color: #f44336;
}

.btn-signature-clear:hover {
    background-color: #d32f2f;
}

.btn-signature-save,
.btn-signature-upload {
    background-color: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.btn-signature-save:hover,
.btn-signature-upload:hover {
    background-color: #45a049;
}

.signature-preview {
    padding: 10px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.signature-preview img {
    display: block;
    margin-top: 10px;
}

/* Estilos para formularios de modelos */
.model-form {
    max-width: 800px;
    margin: 0 auto;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding: 15px 0;
    border-top: 1px solid #ddd;
}

.form-actions .btn {
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.form-actions .btn-primary {
    background-color: #2782c0;
    color: white;
    border: 1px solid #2782c0;
}

.form-actions .btn-primary:hover {
    background-color: #1e6ba0;
}

.form-actions .btn-primary:disabled {
    background-color: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
}

.form-actions .btn-secondary {
    background-color: #6c757d;
    color: white;
    border: 1px solid #6c757d;
}

.form-actions .btn-secondary:hover {
    background-color: #5a6268;
}

.form-errors {
    padding: 15px;
    margin: 15px 0;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
}

.form-errors ul {
    margin: 5px 0;
    padding-left: 20px;
}

.form-errors strong {
    font-weight: 600;
}

/* Estilos para validación de campos */
.input-error {
    border-color: #f44336 !important;
    background-color: #ffebee !important;
}

.input-error:focus {
    outline: 2px solid #f44336;
    outline-offset: 2px;
}

/* Estilos para el formulario de empleados */
.employee-form .section {
    margin-bottom: 20px;
}

.employee-form .section h2 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #333;
    border-bottom: 2px solid #2782c0;
    padding-bottom: 5px;
}

/* ============================================
   Estilos para el módulo de Nóminas
   ============================================ */

/* Botón de acción con icono */
.btn-primary.upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Badge de estado de firma */
.badge-signed {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.badge-signed.yes {
    background-color: #28a745;
    color: white;
}

.badge-signed.no {
    background-color: #dc3545;
    color: white;
}

/* Acciones en tabla de nóminas */
.payslip-actions {
    display: flex;
    gap: 5px;
}

.payslip-actions .btn {
    padding: 4px 8px;
    font-size: 12px;
}

/* Modal mejorado */
.modal-content {
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Área de upload mejorada */
.upload-area {
    transition: all 0.3s ease;
}

.upload-area.processing {
    pointer-events: none;
    opacity: 0.6;
}

/* Resultado del upload */
.upload-result {
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

.upload-result.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
}

.upload-result.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
}

a.btn.btn-secondary ~ a.btn.btn-secondary {
    margin-left: 28px;
}

.section-card {margin: 24px;background: #DDD;}

.section-card-header {
    background: #0083c4;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
}

.section-card-header input {
    width: 100%;
    margin: 0 10px;
}

.section-card-body .field-row {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px;
}

.section-card-body .empty-fields {
    width: 220px;
    text-align: center;
    margin: 20px auto;
}

.section-card-body .empty-fields {
    width: 220px;
    text-align: center;
    margin: 20px auto;
}

button.btn-add {
    background: #0083c4;
    border-radius: 4px;
    padding: 8px;
    color: white;
    margin: 18px auto;
    width: fit-content;
    display: block;
    border: 0;
}

.section-card-body {
    padding: 1px;
}

select {
    padding: 4px;
    border: 1px solid #ccc;
    background: white;
    border-radius: 4px;
}

.field-options-row {
    margin-left: 40px;
}

.field-options-row .options-label {
    margin-bottom: 4px;
}

/* Dropdown menu para actions */
.action-dropdown {
    position: relative;
    display: inline-block;
}

.action-dropdown .dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 200px;
    z-index: 1000;
    margin-top: 0.25rem;
    padding: 0.5rem 0;
}

.action-dropdown .dropdown-header {
    padding: 0.5rem 1rem;
    font-weight: 600;
    color: #0083c4;
    border-bottom: 1px solid #eee;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.action-dropdown .dropdown-header i {
    margin-right: 0.5rem;
}

.action-dropdown .dropdown-item {
    display: flex;
    padding: 0.5rem 1rem;
    color: #333;
    text-decoration: none;
    transition: background 0.2s;
}

.action-dropdown .dropdown-item:hover {
    background: #f0f8ff;
    color: #0083c4;
}

.action-dropdown .dropdown-item i {
    margin-right: 0.5rem;
    color: #0083c4;
}

.actions {
    display: flex;
    gap: 10px;
}

/* Estilos para botones de acción */
.action-button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.action-button i {
    font-size: 1rem;
}

.action-button.btn-primary {
    background-color: #0083c4;
    color: white;
}

.action-button.btn-primary:hover {
    background-color: #006ba1;
}

.action-button.btn-primary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.action-button.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.action-button.btn-secondary:hover {
    background-color: #5a6268;
}

.action-button.btn-default {
    background-color: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
}

.action-button.btn-default:hover {
    background-color: #e9ecef;
}

.action-button-submit .action-content {
    border: 0;
}

.action-button-submit {
    margin-left: 14px;
}

.section-field-layout-fullwidth .input, .section-field-layout-fullwidth input {
    width: 100%;
}

.section-field.section-field-layout-auto {
    flex: auto;
}

.section-field.section-field-layout-auto .input, .section-field.section-field-layout-auto input {
    width: 100%;
}

.btn-secondary,
.btn-danger {
    padding: 4px;
    border: 1px solid #CCC;
    border-radius: 4px;
}

.btn-primary {
    background: #0083c4;
    padding: 4px;
    border: 1px solid #CCC;
    border-radius: 4px;
    color: white;
}

span.actions-btns a {
    margin-right: 10px;
}

.card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow: hidden;
}

.card-body {
    padding: 1rem;
}

.card-body .row {
    display: flex;
}

.model-route-tabs a.btn.btn-secondary ~ a.btn.btn-secondary {
    margin-left: 0;
}

.model-route-tabs {
    margin-left: 14px !important;
    margin-top: 24px !important;
}

div#rolesMsg {
    border: 1px solid #CCC;
    margin: 0 20px;
}

div#rolesMsg .alert-success {
    background: #63c367;
    padding: 4px 24px;
}

.absence-btn {
    padding: 12px 24px;
    font-size: 14px;
}

.actions-btns button {
    background: transparent;
    border: 0;
    margin-right: 12px;
}

.actions-btns {
    float: right;
}

/* ============================================
   MonthTimelineWidget (genérico)
   - Timeline mensual por filas (recursos) y rangos (eventos)
   ============================================ */

.month-timeline-page {
    margin: 24px 12px;
}

.month-timeline-card {
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    background: #fff;
    padding: 12px;
}

.month-timeline-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.month-timeline-toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.month-timeline-toolbar-title {
    font-weight: 700;
}

.month-timeline-toolbar-meta {
    font-size: 12px;
    opacity: 0.7;
}

.month-timeline-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.month-timeline-toolbar-label {
    font-size: 12px;
    font-weight: 600;
    opacity: 0.85;
    margin-right: 4px;
}

.month-timeline-host {
    overflow: auto;
}

.month-timeline-loading {
    padding: 12px;
    font-size: 13px;
    opacity: 0.8;
}

.month-timeline {
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.month-timeline-header {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 5;
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.month-timeline-body {
    display: flex;
    flex-direction: column;
}

.month-timeline-row {
    display: flex;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.month-timeline-left {
    position: sticky;
    left: 0;
    z-index: 4;
    background: #fff;
    border-right: 1px solid rgba(0,0,0,0.08);
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 200px;
}

.month-timeline-left--header {
    z-index: 6;
}

.month-timeline-title {
    font-weight: 700;
}

.month-timeline-emp {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.month-timeline-emp-sub {
    font-size: 12px;
    opacity: 0.75;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.month-timeline-days {
    display: grid;
    grid-template-columns: repeat(var(--days), var(--dayw));
}

.month-timeline-day {
    text-align: center;
    padding: 6px 0;
    border-right: 1px solid rgba(0,0,0,0.06);
}

.month-timeline-daynum {
    font-weight: 700;
    font-size: 12px;
    line-height: 1.1;
}

.month-timeline-daywd {
    font-size: 11px;
    opacity: 0.7;
    line-height: 1.1;
}

.month-timeline-track {
    position: relative;
    flex: 1 1 auto;
    background-image: linear-gradient(to right, rgba(0,0,0,0.08) 1px, transparent 1px);
    background-size: var(--dayw) 100%;
}

.month-timeline-bar {
    position: absolute;
    top: var(--top);
    height: 18px;
    border-radius: 6px;
    padding: 0 8px;
    display: flex;
    align-items: center;
    background: var(--color);
    border: 1px solid rgba(0,0,0,0.12);
    left: calc((var(--start) - 1) * var(--dayw));
    width: calc(var(--len) * var(--dayw));
    overflow: hidden;
}

.month-timeline-bar-label {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 900px) {
    .month-timeline-left {
        min-width: 180px;
    }
    .month-timeline-toolbar-right {
        width: 100%;
    }
    .month-timeline-toolbar-right input {
        flex: 1 1 auto;
        min-width: 180px;
    }
}

tr.clk-day-row {
    border-bottom: 1px solid #CCC;
    margin-bottom: 24px;
    height: 64px;
}

tr.clk-day-row td {
    margin-bottom: 44px;
}

.section:has([data-dynamic-add-item=contratos]) {
    border: 0;
}

/* ============================================
   Cronómetro (Empleado)
   - Reutiliza card/action-button existentes
   - Responsive mobile-first
   ============================================ */

.chrono {
    width: calc(100% - 2rem);
    margin: 1rem;
}

.chrono-top {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chrono-project {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chrono-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
}

.chrono-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: white;
}

.chrono-timer-card {
    border-radius: 8px;
}

.chrono-timer-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chrono-timer-box {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 6px;
    padding: 10px;
    border-radius: 8px;
    background: #f0f8ff;
    border: 1px solid #ddd;
}

.chrono-timer-icon {
    font-size: 1.2rem;
    color: #0083c4;
}

.chrono-time {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.chrono-sub {
    font-size: 0.9rem;
    opacity: 0.75;
}

.chrono-action {
    width: 100%;
    justify-content: center;
}

.action-button.btn-danger {
    background-color: #dc3545;
    color: white;
}

.action-button.btn-danger:hover {
    background-color: #b02a37;
}

.chrono-hint {
    font-size: 0.85rem;
    opacity: 0.8;
    text-align: center;
}

.chrono-segments {
    margin-top: 10px;
    border-top: 1px solid #ddd;
    padding-top: 10px;
}

.chrono-segments-title {
    font-weight: 600;
    margin-bottom: 8px;
}

.chrono-seg {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px 10px;
    background: white;
    margin-bottom: 8px;
}

.chrono-seg--open {
    border-color: #0083c4;
}

.chrono-seg-main {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: baseline;
}

.chrono-seg-range {
    font-weight: 700;
}

.chrono-seg-duration {
    font-family: monospace;
    opacity: 0.85;
}

.chrono-seg-proj {
    margin-top: 4px;
    font-size: 0.85rem;
    opacity: 0.8;
}

.chrono-grid-wrap {
    margin-top: 16px;
}

.chrono-grid-title {
    font-weight: 600;
    margin: 0 0 10px 0;
}

.chrono-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.chrono-day {
    border: 2px solid #ddd;
    border-radius: 10px;
    background: white;
    padding: 10px;
    min-height: 86px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.chrono-day-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}

.chrono-day-date {
    font-weight: 700;
}

.chrono-day-dow {
    font-weight: 600;
    opacity: 0.8;
}

.chrono-day-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.85rem;
}

.chrono-day-line {
    padding: 4px 6px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: white;
    text-align: center;
}

.chrono-day-line--expected {
    border-color: #ccc;
}

.chrono-day-line--actual {
    border-color: #0083c4;
}

.chrono-day-note {
    font-size: 0.8rem;
    opacity: 0.8;
    line-height: 1.15;
}

.chrono-day--disabled {
    opacity: 0.75;
}

.chrono-day--done {
    border-color: #0083c4;
}

.chrono-day--pending {
    border-color: #ccc;
    background: #fffcee;
}

.chrono-day--striped {
    background: repeating-linear-gradient(
        135deg,
        rgba(0,131,196,0.18),
        rgba(0,131,196,0.18) 6px,
        white 6px,
        white 12px
    );
}

@media (min-width: 700px) {
    .chrono-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 1000px) {
    .chrono-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

.section-title {
    margin: 46px 24px;
    font-size: 24px;
    margin-bottom: 0 !important;
}

.section-title button {
    padding: 6px;
    border: 1px solid #CCC;
    border-radius: 4px;
}

body.auth-model-employee.auth-role-owner .model-route-tabs {
    display: none !important;
}

body > .section:has(.section-content-include) {
    margin: 0;
    border: 0;
}

.card-body .col-md-5 {
    height: max-content;
}

table.table.table-striped {
    border-spacing: 12px 8px;
}

.align-items-end {
    margin-left: 15px;
}

.col-md-5 label {
    margin-bottom: 8px;
}

.section-field .col-md-5 label {
    max-width: none;
    height: 38px;
    margin-bottom: 0;
}

.card-header h5 {
    margin-left: 14px;
    margin-top: 14px;
}

.row.mt-3 button {
    margin-top: 14px;
    padding: 8px 14px;
    background: #0083c4;
    color: white;
    border: none;
    border-radius: 4px;
}

.section-field .card.mt-3  label {
    text-align: left;
    justify-content: flex-start;
    padding: 6px;
    margin-top: 7px;
}

div#emp-clockings-root {
    margin-top: 24px;
}

.content-main {
    min-height: calc(100vh - 207px);
}

table.listing-table td {
    padding-bottom: 20px !important;
}

table.listing-table.employee-listing th:last-child {
    width: 250px;
}

.emp-abs-card:has(#emp-abs-year-calendar) {
    background: none;
    border: 0;
}

/* .ycw-day.ycw-no-schedule {
    background: rgba(0,0,0,0.04);
    border-style: dashed;
    opacity: 0.4;
} */

/* .ycw-day.ycw-holiday {
    background: rgba(0,0,0,0.04) !important;
    border-color: #DDD !important;
    opacity: 0.4;
} */

body.popup-mode footer {
    display: none;
}

.section-field-value small {
    margin-left: 12px;
}

.section-field textarea {
    width: 100%;
    border: 1px solid #CCC;
    border-radius: 4px;
}

body:has(.auth-login-actions) footer {
    display: none;
}

.auth-login-actions button {
    width: 100%;
    padding: 14px;
    margin-top: 12px;
    font-size: 14px;
}

.is-open > ul {
    display: flex;
    flex-flow: column;
    height: max-content;
    align-items: center;
}
.is-open > ul .header-session-logout {
    margin: auto !important;
    margin-top: 12px !important;
}

@media (max-width: 768px) {
    .emp-abs-layout {
        flex-direction: column;
    }
    .emp-abs-left{ 
        width: 100% !important;
    }
    .ycw-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    }
}

.col-md-3, .col-md-5, .col-md-4 {
    display: flex;
    flex-direction: column;
}

.employee-terminate-card {
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.employee-terminate-card .model-form {
    width: 100%;
    margin-top: 22px;
    max-width: none;
}

.employee-terminate-card .model-form #terminated_at {
    margin-left: 10px;
}

div#employee-docs-root > div:first-child {
    margin-left: 14px !important;
    margin-right: 14px !important;
    margin-top: 24px !important;
}

div#employee-docs-root > div:nth-child(2) {
    margin-left: 14px !important;
    margin-right: 14px !important;
    margin-top: 24px !important;
}

#employee-docs-root .btn-info, #employee-docs-root .btn-danger, #employee-docs-root .btn-primary {
    padding: 4px;
    border: 1px solid #CCC;
    border-radius: 4px;
    margin-left: 8px;
}

table.listing-table tbody tr:nth-child(odd) {
    background: white;
    border-bottom: 1px solid #CCC;
}

table.listing-table tbody tr:nth-child(2n) {
    background: #F0F0F0;
    border-bottom: 1px solid #CCC;
}

.docs .section-field-value {
    display: block;
}

div >[data-action="nav-root"] {
    margin-left: 14px !important;
    margin-right: 14px !important;
    margin-top: 24px !important;
}

div:has(>[data-action="nav-root"]) {
    margin-top: 34px !important;
    padding-left: 14px;
    padding-right: 14px;
}

#employee-docs-root button.btn-danger {
    padding-top: 6px;
}

#employee-doc-list .employee-item:nth-child(2n) {
    background: #DFDFDF;
    padding: 4px;
}

#employee-doc-list .employee-item {
    padding: 4px;
}

input#employee-doc-search {
    margin-left: 8px;
}

select#employee-doc-dir {
    margin-left: 8px;
}

input#employee-doc-file {
    margin: 8px;
}

#employee-doc-list .employee-item.selected {
    background: #2196F3;
    color: white;
}

div#payslip-delete-signature-modal {position: fixed;top: 0;bottom: 0;left: 0;right: 0;background: rgba(0,0,0,0.5);}

#payslip-delete-signature-modal .modal-content {
    position: absolute;
    background: white;
    padding: 20px;
    top: calc(50% - 85px);
    left: calc(50% - 270px);
    border-radius: 4px;
}

#payslip-delete-signature-modal .modal-header {
    display: flex;
    justify-content: space-between;
}

#payslip-delete-signature-modal button.modal-close {
    border: 0;
    background: none;
    font-size: 25px;
}

button#payslip-delete-confirm {
    padding: 4px;
    border-radius: 4px;
    text-decoration: none;
    border: 1px solid #CCC;
}

.actions-btns .btn-secondary, .actions-btns .btn-danger {
    border: 0px;
}

.auth-role-owner .action-content[title="Volver a empleados"] {
    display: none;
}

.header-menu.is-open ul a {
    display: flex;
    justify-content: center;
}

@media (max-width: 700px) {   
    span.badge-signed.no {
        display: flex;
        align-items: center;
    }
}

.ycw-day.ycw-holiday:after,
.ycw-day.ycw-company-vacation:after,
.ycw-day.ycw-no-schedule:after {
    content: "";
    display: block;
    width: 10px;
    height: 10px;
    background: #675f5f;
    border-radius: 10px;
    /* position: absolute; */
}

.ycw-day.ycw-company-vacation:after {
    background: #3ac70a;
}

span.vacation-dev {
    display: none !important;
}

.ycw-day.current-day {
    background: #30c9ff;
    color: white;
}

div#emp-abs-chips {
    opacity: 0;
}

button#clk-today, #clk-print {
    border: 1px solid #CCC;
    padding: .2rem .5rem;
    border-radius: 4px;
}

@media print {
    button,
    .model-route-tabs,
    .action-link,
    .header-menu {
        display: none !important;
    }  

    .header-title {
        font-size: 18px;
        /* float: right;
        margin-top: 80px;
        margin-right: 14px; */
        position: absolute;
        top: 20px;
        right: 14px;
    }
    strong#clk-month {
        position: absolute;
        top: 80px;
        right: 14px;
    }
    div#emp-clockings-root > div > div:first-child {
        display: none;
    }
    div#emp-clockings-root td:nth-child(5),
    div#emp-clockings-root th:nth-child(5) {
        display: none;  
    }
    tr.clk-day-row[style] {
        display: none !important;
    }
    div#emp-clockings-root tbody tr {
        display: none;
    }
    div#emp-clockings-root tbody tr.clk-day-row {
        display: table-row;
    }
    #emp-clockings-root > div > div:nth-child(2) > div > div:nth-child(2) {
        display: none;
    }
    .header-logo {
        width: 200px;
        height: auto;
        border: 0 !important;
        position: absolute;
        top: 20px;
        left: 14px;
    }
}