:root {
  --sgc-primary: #173f6d;
  --sgc-primary-dark: #102f53;
  --sgc-primary-soft: #eef4fa;

  --sgc-background: #f3f6f9;
  --sgc-surface: #ffffff;

  --sgc-text: #1d2939;
  --sgc-text-soft: #667085;

  --sgc-border: #d9e0e7;

  --sgc-danger: #b42318;
  --sgc-danger-bg: #fef3f2;

  --sgc-success: #067647;
  --sgc-warning: #b54708;

  --sgc-radius: 14px;
  --sgc-shadow: 0 18px 50px rgba(16, 24, 40, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family:
    Inter,
    "Segoe UI",
    Arial,
    sans-serif;
  color: var(--sgc-text);
}

body {
  background: var(--sgc-background);
}

/* LOGIN */

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background:
    linear-gradient(
      135deg,
      #edf3f8 0%,
      #f8fafc 100%
    );
}

.login-shell {
  width: min(100%, 880px);
  min-height: 460px;

  display: grid;
  grid-template-columns: 42% 58%;

  background: var(--sgc-surface);

  border-radius: 34px;
  overflow: hidden;

  box-shadow: var(--sgc-shadow);
}

.login-brand {
  background:
    linear-gradient(
      160deg,
      #204f83 0%,
      #12375f 100%
    );

  color: white;

  padding: 42px;

  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.login-brand-logo {
  margin-bottom: 30px;
}

.ti-logo-box {
  width: 92px;
  height: 82px;

  border-radius: 18px;

  background: white;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 8px;
}

.ti-logo {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.login-brand-code {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.15em;
  opacity: 0.7;
  margin-bottom: 10px;
}

.login-brand h1 {
  margin: 0;
  font-size: 35px;
  line-height: 1.1;
  font-weight: 800;
}

.login-brand-description {
  margin-top: 18px;

  font-size: 15px;
  line-height: 1.6;

  color: rgba(255,255,255,0.86);
}

.login-brand-footer {
  margin-top: 50px;

  font-size: 12px;
  color: rgba(255,255,255,0.72);
}

.login-form-panel {
  padding: 52px 58px;

  display: flex;
  align-items: center;
}

.login-form-content {
  width: 100%;
}

.login-eyebrow {
  color: var(--sgc-primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.login-form-panel h2 {
  margin:
    8px 0 6px;

  font-size: 29px;
  font-weight: 800;
}

.login-subtitle {
  margin:
    0 0 34px;

  color: var(--sgc-text-soft);
  font-size: 14px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;

  margin-bottom: 7px;

  font-size: 13px;
  font-weight: 600;
}

.form-control {
  width: 100%;

  height: 50px;

  padding: 0 14px;

  border:
    1px solid var(--sgc-border);

  border-radius: 10px;

  background: white;

  font-size: 15px;

  outline: none;

  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.form-control:focus {
  border-color: var(--sgc-primary);

  box-shadow:
    0 0 0 3px rgba(23, 63, 109, 0.12);
}

.btn {
  border: 0;
  border-radius: 9px;

  min-height: 46px;

  padding:
    0 20px;

  cursor: pointer;

  font-weight: 700;
}

.btn-primary {
  background:
    linear-gradient(
      135deg,
      #234f82,
      #183f6d
    );

  color: white;

  box-shadow:
    0 6px 14px rgba(23, 63, 109, 0.20);
}

.btn-primary:hover {
  background: var(--sgc-primary-dark);
}

.btn-block {
  width: 100%;
}

.alert {
  margin-bottom: 20px;

  padding: 12px 14px;

  border-radius: 9px;

  font-size: 14px;
}

.alert-danger {
  background: var(--sgc-danger-bg);
  color: var(--sgc-danger);
  border: 1px solid #fecdca;
}

.login-divider {
  height: 1px;
  background: var(--sgc-border);

  margin:
    24px 0 18px;
}

.login-companies {
  min-height: 42px;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.company-logo {
  display: block;
  max-width: 125px;
  max-height: 38px;
  object-fit: contain;
}

.company-logo-frima {
  max-width: 105px;
}

.company-logo-mafrisur {
  max-width: 125px;
}

@media (max-width: 760px) {

  .login-body {
    padding: 16px;
  }

  .login-shell {
    display: block;
    border-radius: 22px;
  }

  .login-brand {
    padding: 30px;
  }

  .login-brand-footer {
    display: none;
  }

  .login-form-panel {
    padding: 34px 30px;
  }

}

/* =========================================================
   APP LAYOUT
   ========================================================= */

.app-body {
  min-height: 100vh;
  background: #f4f7fa;
}

.topbar {
  position: fixed;
  top: 0;
  left: 260px;
  right: 0;
  height: 68px;
  z-index: 1000;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0 28px;

  background: #ffffff;
  border-bottom: 1px solid #e3e8ef;

  transition: left 0.2s ease;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
}

.topbar-left {
  gap: 18px;
}

.topbar-right {
  gap: 22px;
}

.sidebar-toggle {
  width: 38px;
  height: 38px;

  border: 1px solid #d9e0e7;
  border-radius: 8px;

  background: #ffffff;
  color: var(--sgc-primary);

  font-size: 20px;
  cursor: pointer;
}

.topbar-brand {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.topbar-brand-code {
  font-size: 16px;
  font-weight: 800;
  color: var(--sgc-primary);
}

.topbar-brand-name {
  font-size: 14px;
  color: #667085;
}

.empresa-activa {
  display: flex;
  flex-direction: column;

  padding: 7px 12px;

  border-radius: 9px;

  background: var(--sgc-primary-soft);

  text-decoration: none;
  color: var(--sgc-primary);
}

.empresa-activa-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #667085;
}

.empresa-activa strong {
  font-size: 13px;
}

.topbar-user {
  display: flex;
  flex-direction: column;
  text-align: right;
}

.topbar-user-name {
  font-size: 13px;
  font-weight: 700;
}

.topbar-user-role {
  margin-top: 2px;
  font-size: 10px;
  color: #667085;
}

.btn-logout {
  min-height: 36px;
  padding: 0 14px;

  border: 1px solid #d9e0e7;
  border-radius: 8px;

  background: #ffffff;
  color: #344054;

  cursor: pointer;
  font-weight: 600;
}

.btn-logout:hover {
  background: #f8fafc;
}

/* SIDEBAR */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;

  width: 260px;
  z-index: 1100;

  display: flex;
  flex-direction: column;

  background:
    linear-gradient(
      180deg,
      #194875 0%,
      #12365a 100%
    );

  color: white;

  transition:
    width 0.2s ease,
    transform 0.2s ease;
}

.sidebar-logo {
  min-height: 90px;

  display: flex;
  align-items: center;
  gap: 12px;

  padding: 18px 20px;

  border-bottom:
    1px solid rgba(255,255,255,0.10);
}

.sidebar-logo img {
  width: 46px;
  height: 46px;
  object-fit: contain;

  padding: 4px;
  border-radius: 9px;

  background: white;
}

.sidebar-logo div {
  min-width: 0;
}

.sidebar-logo strong {
  display: block;

  font-size: 18px;
  letter-spacing: 0.08em;
}

.sidebar-logo span {
  display: block;

  margin-top: 3px;

  font-size: 11px;
  color: rgba(255,255,255,0.72);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;

  padding: 14px 12px 24px;
}

.sidebar-section-title {
  margin:
    18px 10px 7px;

  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;

  text-transform: uppercase;

  color: rgba(255,255,255,0.45);
}

.sidebar-link {
  min-height: 42px;

  display: flex;
  align-items: center;
  gap: 11px;

  margin-bottom: 3px;

  padding: 0 12px;

  border-radius: 8px;

  text-decoration: none;

  color: rgba(255,255,255,0.86);

  font-size: 13px;
  font-weight: 500;

  transition:
    background 0.15s ease,
    color 0.15s ease;
}

a.sidebar-link:hover {
  background: rgba(255,255,255,0.09);
  color: white;
}

.sidebar-link.active {
  background: rgba(255,255,255,0.15);
  color: white;
  font-weight: 700;
}

.sidebar-link.disabled {
  opacity: 0.42;
  cursor: default;
}

.sidebar-link-icon {
  width: 25px;
  height: 25px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  flex-shrink: 0;

  border-radius: 6px;

  background: rgba(255,255,255,0.10);

  font-size: 11px;
  font-weight: 800;
}

.sidebar-footer {
  padding: 16px 20px;

  border-top:
    1px solid rgba(255,255,255,0.10);

  font-size: 10px;
  color: rgba(255,255,255,0.55);
}

/* CONTENT */

.app-main {
  min-height: 100vh;

  margin-left: 260px;

  padding:
    96px 30px 76px;

  transition: margin-left 0.2s ease;
}

.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  margin: 0;

  font-size: 26px;
  font-weight: 800;
  color: #1d2939;
}

.page-header p {
  margin:
    7px 0 0;

  color: #667085;

  font-size: 14px;
}

.content-card {
  background: white;

  border:
    1px solid #e3e8ef;

  border-radius: 12px;

  box-shadow:
    0 2px 8px rgba(16, 24, 40, 0.04);
}

/* FOOTER */

.app-footer {
  position: fixed;

  left: 260px;
  right: 0;
  bottom: 0;

  min-height: 42px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0 30px;

  background: #ffffff;

  border-top:
    1px solid #e3e8ef;

  color: #98a2b3;

  font-size: 10px;

  transition: left 0.2s ease;
}

/* SIDEBAR COLLAPSED */

.sidebar-collapsed .sidebar {
  width: 78px;
}

.sidebar-collapsed .sidebar-logo div,
.sidebar-collapsed .sidebar-section-title,
.sidebar-collapsed .sidebar-link span:not(.sidebar-link-icon),
.sidebar-collapsed .sidebar-footer {
  display: none;
}

.sidebar-collapsed .sidebar-logo {
  justify-content: center;
  padding: 18px 10px;
}

.sidebar-collapsed .sidebar-link {
  justify-content: center;
  padding: 0;
}

.sidebar-collapsed .topbar {
  left: 78px;
}

.sidebar-collapsed .app-main {
  margin-left: 78px;
}

.sidebar-collapsed .app-footer {
  left: 78px;
}

/* RESPONSIVE */

@media (max-width: 900px) {

  .sidebar {
    transform: translateX(-100%);
  }

  .topbar {
    left: 0;
  }

  .app-main {
    margin-left: 0;
  }

  .app-footer {
    left: 0;
  }

  .sidebar-collapsed .sidebar {
    width: 260px;
    transform: translateX(0);
  }

  .sidebar-collapsed .sidebar-logo div,
  .sidebar-collapsed .sidebar-section-title,
  .sidebar-collapsed .sidebar-link span:not(.sidebar-link-icon),
  .sidebar-collapsed .sidebar-footer {
    display: block;
  }

  .sidebar-collapsed .sidebar-link {
    justify-content: flex-start;
    padding: 0 12px;
  }

  .sidebar-collapsed .topbar,
  .sidebar-collapsed .app-main,
  .sidebar-collapsed .app-footer {
    left: 0;
    margin-left: 0;
  }

  .topbar-brand-name {
    display: none;
  }

  .topbar-user {
    display: none;
  }

}

@media (max-width: 620px) {

  .topbar {
    padding: 0 14px;
  }

  .empresa-activa-label {
    display: none;
  }

  .app-main {
    padding:
      88px 16px 72px;
  }

  .app-footer {
    padding: 0 16px;
  }

  .app-footer span:last-child {
    display: none;
  }

}

/* =========================================================
   SELECTOR DE EMPRESA
   ========================================================= */

.empresa-selector-body {
  min-height: 100vh;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 30px;

  background:
    linear-gradient(
      135deg,
      #e8eef5 0%,
      #f6f8fb 100%
    );

  position: relative;
  overflow: hidden;
}

.empresa-selector-backdrop {
  position: fixed;
  inset: 0;

  background:
    radial-gradient(
      circle at 20% 20%,
      rgba(31, 78, 126, 0.10),
      transparent 38%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(16, 47, 83, 0.08),
      transparent 42%
    );
}

.empresa-selector-modal {
  position: relative;
  z-index: 2;

  width: min(100%, 760px);

  padding: 34px;

  background: #ffffff;

  border:
    1px solid rgba(217, 224, 231, 0.9);

  border-radius: 20px;

  box-shadow:
    0 24px 70px rgba(16, 24, 40, 0.18);
}

.empresa-selector-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  gap: 20px;

  padding-bottom: 22px;

  border-bottom:
    1px solid var(--sgc-border);
}

.empresa-selector-code {
  display: block;

  margin-bottom: 6px;

  color: var(--sgc-primary);

  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.empresa-selector-header h1 {
  margin: 0;

  font-size: 27px;
  line-height: 1.2;

  color: var(--sgc-text);
}

.empresa-selector-header p {
  margin:
    7px 0 0;

  color: var(--sgc-text-soft);

  font-size: 14px;
}

.empresa-selector-close {
  width: 38px;
  height: 38px;

  display: flex;
  align-items: center;
  justify-content: center;

  flex-shrink: 0;

  border: 0;
  border-radius: 9px;

  background: transparent;
  color: #667085;

  font-size: 27px;
  line-height: 1;

  cursor: pointer;
}

.empresa-selector-close:hover {
  background: #f2f4f7;
  color: var(--sgc-text);
}

.empresa-selector-user {
  margin-top: 18px;

  color: #667085;

  font-size: 13px;
}

.empresa-selector-user strong {
  color: var(--sgc-text);
}

.empresa-selector-grid {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 18px;

  margin-top: 26px;
}

.empresa-selector-form {
  margin: 0;
}

.empresa-card {
  width: 100%;
  min-height: 230px;

  padding: 28px 20px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  border:
    1px solid #d8e0e8;

  border-radius: 14px;

  background: #ffffff;

  cursor: pointer;

  font-family: inherit;

  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.empresa-card:hover {
  transform: translateY(-3px);

  border-color: var(--sgc-primary);

  background: #f8fbff;

  box-shadow:
    0 12px 28px rgba(23, 63, 109, 0.12);
}

.empresa-card:focus-visible {
  outline:
    3px solid rgba(23, 63, 109, 0.20);

  outline-offset: 3px;
}

.empresa-card-logo {
  height: 95px;

  display: flex;
  align-items: center;
  justify-content: center;

  margin-bottom: 22px;
}

.empresa-card-logo img {
  display: block;

  max-width: 210px;
  max-height: 90px;

  object-fit: contain;
}

.empresa-card-fallback {
  width: 82px;
  height: 82px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 18px;

  background: var(--sgc-primary-soft);
  color: var(--sgc-primary);

  font-size: 32px;
  font-weight: 800;
}

.empresa-card-info {
  display: flex;
  flex-direction: column;

  gap: 5px;

  text-align: center;
}

.empresa-card-info strong {
  color: var(--sgc-text);

  font-size: 18px;
}

.empresa-card-info span {
  color: #98a2b3;

  font-size: 12px;
}

.empresa-card:hover
.empresa-card-info span {
  color: var(--sgc-primary);
}

.empresa-selector-empty {
  margin-top: 24px;

  padding: 22px;

  border-radius: 10px;

  background: #f9fafb;
  color: #667085;

  text-align: center;
}

.empresa-selector-footer {
  margin-top: 28px;
  padding-top: 20px;

  border-top:
    1px solid var(--sgc-border);

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 20px;
}

.empresa-selector-ti {
  display: flex;
  align-items: center;

  gap: 10px;

  color: #98a2b3;

  font-size: 11px;
}

.empresa-selector-ti img {
  width: 34px;
  height: 34px;

  object-fit: contain;
}

.btn-selector-secondary {
  min-height: 38px;

  padding:
    0 16px;

  border:
    1px solid #d0d5dd;

  border-radius: 8px;

  background: #ffffff;
  color: #344054;

  font-weight: 600;

  cursor: pointer;
}

.btn-selector-secondary:hover {
  background: #f9fafb;
}

/* RESPONSIVE */

@media (max-width: 650px) {

  .empresa-selector-body {
    padding: 16px;
  }

  .empresa-selector-modal {
    padding: 24px;
  }

  .empresa-selector-grid {
    grid-template-columns: 1fr;
  }

  .empresa-card {
    min-height: 180px;
  }

  .empresa-selector-footer {
    align-items: flex-start;
    flex-direction: column;
  }

}

/* =========================================================
   CONTRATISTAS
   ========================================================= */

.page-header-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.btn-secondary {
  background: #ffffff;
  color: #344054;
  border: 1px solid #d0d5dd;
  text-decoration: none;
}

.btn-secondary:hover {
  background: #f9fafb;
}

.filters-card {
  margin-bottom: 20px;
  padding: 20px;
}

.filters-form {
  display: grid;
  grid-template-columns:
    minmax(280px, 1fr)
    180px
    180px
    auto;

  align-items: end;
  gap: 14px;
}

.filter-search,
.filter-field {
  min-width: 0;
}

.filter-search label,
.filter-field label {
  display: block;

  margin-bottom: 6px;

  font-size: 12px;
  font-weight: 600;

  color: #475467;
}

.filter-actions {
  display: flex;
  gap: 8px;
}

.table-card {
  overflow: hidden;
}

.table-header {
  min-height: 72px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 18px 22px;

  border-bottom: 1px solid #eaecf0;
}

.table-header h2 {
  margin: 0;

  font-size: 17px;
}

.table-header span {
  display: block;

  margin-top: 4px;

  color: #98a2b3;

  font-size: 11px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;

  border-collapse: collapse;

  font-size: 13px;
}

.data-table th {
  padding: 12px 16px;

  background: #f9fafb;

  border-bottom: 1px solid #eaecf0;

  color: #667085;

  text-align: left;

  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.data-table td {
  padding: 15px 16px;

  border-bottom: 1px solid #f0f2f5;

  vertical-align: middle;

  color: #344054;
}

.data-table tbody tr:hover {
  background: #fbfcfe;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.table-primary {
  font-weight: 600;
  color: #1d2939;
}

.table-secondary {
  margin-top: 3px;

  color: #98a2b3;

  font-size: 11px;
}

.text-muted {
  color: #98a2b3;
}

.text-nowrap {
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;

  min-height: 25px;

  padding: 0 9px;

  border-radius: 999px;

  font-size: 10px;
  font-weight: 700;
}

.badge-primary {
  background: #eef4fa;
  color: #184a78;
}

.badge-success {
  background: #ecfdf3;
  color: #067647;
}

.badge-danger {
  background: #fef3f2;
  color: #b42318;
}

.badge-neutral {
  background: #f2f4f7;
  color: #475467;
}

.table-actions-column {
  width: 110px;
  text-align: center !important;
}

.table-action-disabled {
  color: #98a2b3;
  font-size: 12px;
}

.empty-state {
  padding: 70px 25px;

  text-align: center;
}

.empty-state-icon {
  width: 52px;
  height: 52px;

  margin: 0 auto 16px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 12px;

  background: var(--sgc-primary-soft);
  color: var(--sgc-primary);

  font-size: 20px;
  font-weight: 800;
}

.empty-state h3 {
  margin: 0;

  font-size: 17px;
}

.empty-state p {
  margin:
    7px 0 20px;

  color: #667085;

  font-size: 13px;
}

/* FORMULARIOS */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;

  margin-bottom: 12px;

  font-size: 11px;

  color: #98a2b3;
}

.breadcrumb a {
  color: var(--sgc-primary);
  text-decoration: none;
}

.form-section {
  margin-bottom: 18px;

  padding: 24px;
}

.form-section-header {
  margin-bottom: 20px;
  padding-bottom: 15px;

  border-bottom: 1px solid #eaecf0;
}

.form-section-header h2 {
  margin: 0;

  font-size: 17px;
}

.form-section-header p {
  margin:
    5px 0 0;

  color: #667085;

  font-size: 12px;
}

.form-grid {
  display: grid;

  grid-template-columns:
    repeat(3, minmax(0, 1fr));

  gap: 18px;
}

.form-span-2 {
  grid-column: span 2;
}

.form-span-3 {
  grid-column: span 3;
}

.required {
  color: #b42318;
}

.form-textarea {
  min-height: 115px;
  height: auto;

  padding: 12px 14px;

  resize: vertical;

  font-family: inherit;
}

.form-footer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;

  gap: 10px;

  margin-top: 8px;
  margin-bottom: 20px;
}

.form-footer-actions .btn,
.page-header-actions .btn,
.filter-actions .btn,
.empty-state .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  text-decoration: none;
}

/* RESPONSIVE CONTRATISTAS */

@media (max-width: 1100px) {

  .filters-form {
    grid-template-columns:
      1fr 1fr;
  }

  .filter-search {
    grid-column: span 2;
  }

}

@media (max-width: 760px) {

  .page-header-actions {
    flex-direction: column;
  }

  .filters-form {
    grid-template-columns: 1fr;
  }

  .filter-search {
    grid-column: auto;
  }

  .filter-actions {
    flex-wrap: wrap;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-span-2,
  .form-span-3 {
    grid-column: auto;
  }

  .form-footer-actions {
    flex-direction: column-reverse;
  }

  .form-footer-actions .btn {
    width: 100%;
  }

}/* =========================================================
   FICHA CONTRATISTA
   ========================================================= */

.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.contractor-summary {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.contractor-main-card,
.contractor-side-card {
  padding: 24px;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;

  padding-bottom: 20px;
  margin-bottom: 22px;

  border-bottom: 1px solid #eaecf0;
}

.detail-header h2 {
  margin: 5px 0 0;
  font-size: 20px;
  color: #1d2939;
}

.detail-eyebrow {
  color: var(--sgc-primary);

  font-size: 10px;
  font-weight: 800;

  letter-spacing: 0.08em;
}

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

.detail-item span,
.detail-list span {
  display: block;

  margin-bottom: 5px;

  color: #98a2b3;

  font-size: 10px;
  font-weight: 700;

  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.detail-item strong,
.detail-list strong {
  display: block;

  color: #344054;

  font-size: 13px;
  font-weight: 600;

  overflow-wrap: anywhere;
}

.detail-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contractor-tabs-card {
  overflow: hidden;
}

.contractor-tabs {
  display: flex;
  align-items: center;

  min-height: 54px;

  padding: 0 22px;

  border-bottom: 1px solid #eaecf0;

  gap: 28px;
}

.contractor-tab {
  min-height: 54px;

  display: inline-flex;
  align-items: center;

  position: relative;

  color: #667085;

  font-size: 12px;
  font-weight: 600;

  text-decoration: none;
}

.contractor-tab.active {
  color: var(--sgc-primary);
}

.contractor-tab.active::after {
  content: '';

  position: absolute;

  left: 0;
  right: 0;
  bottom: -1px;

  height: 2px;

  background: var(--sgc-primary);
}

.contractor-tab.disabled {
  color: #b0b8c4;
  cursor: default;
}

.contractor-tab-content {
  min-height: 130px;
  padding: 24px;
}

.contractor-tab-content h2 {
  margin: 0 0 10px;
  font-size: 15px;
}

.contractor-tab-content p {
  margin: 0;

  color: #475467;

  font-size: 13px;
  line-height: 1.6;
}

.table-action-link {
  color: var(--sgc-primary);

  font-size: 12px;
  font-weight: 700;

  text-decoration: none;
}

.table-action-link:hover {
  text-decoration: underline;
}

@media (max-width: 1000px) {

  .contractor-summary {
    grid-template-columns: 1fr;
  }

  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 700px) {

  .page-actions {
    width: 100%;
  }

  .page-actions .btn {
    flex: 1;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .contractor-tabs {
    overflow-x: auto;
  }

  .contractor-tab {
    white-space: nowrap;
  }

}

/* =========================================================
   ESTADOS CONTRATISTA
   ========================================================= */

.inline-form {
  display: inline-flex;
  margin: 0;
}

.btn-warning {
  background: #f79009;
  color: #ffffff;

  text-decoration: none;
}

.btn-warning:hover {
  background: #dc6803;
}

.btn-success {
  background: #067647;
  color: #ffffff;

  text-decoration: none;
}

.btn-success:hover {
  background: #05603a;
}

.btn-danger-outline {
  background: #ffffff;
  color: #b42318;

  border: 1px solid #fda29b;

  text-decoration: none;
}

.btn-danger-outline:hover {
  background: #fef3f2;
}

.suspension-alert {
  margin-bottom: 18px;

  padding: 20px 22px;

  background: #fffaeb;

  border: 1px solid #fedf89;
  border-radius: 12px;
}

.suspension-alert-header {
  margin-bottom: 15px;

  color: #b54708;

  font-size: 14px;
  font-weight: 800;
}

.suspension-alert-grid {
  display: grid;
  grid-template-columns:
    minmax(0, 2fr)
    minmax(160px, 1fr)
    minmax(160px, 1fr);

  gap: 20px;
}

.suspension-alert-grid span {
  display: block;

  margin-bottom: 4px;

  color: #b54708;

  font-size: 10px;
  font-weight: 700;

  text-transform: uppercase;
}

.suspension-alert-grid strong {
  color: #7a2e0e;

  font-size: 12px;

  overflow-wrap: anywhere;
}

/* MODAL */

.modal-open {
  overflow: hidden;
}

.modal-backdrop-sgc {
  position: fixed;
  inset: 0;

  z-index: 3000;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 20px;

  background: rgba(16, 24, 40, 0.55);

  backdrop-filter: blur(2px);
}

.modal-backdrop-sgc[hidden] {
  display: none;
}

.modal-sgc {
  width: min(100%, 560px);

  padding: 26px;

  background: #ffffff;

  border-radius: 16px;

  box-shadow:
    0 24px 70px rgba(16, 24, 40, 0.28);
}

.modal-sgc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  gap: 20px;
}

.modal-sgc-header h2 {
  margin: 5px 0 0;

  font-size: 21px;
}

.modal-sgc-close {
  width: 36px;
  height: 36px;

  flex-shrink: 0;

  border: 0;
  border-radius: 8px;

  background: transparent;

  color: #667085;

  font-size: 26px;

  cursor: pointer;
}

.modal-sgc-close:hover {
  background: #f2f4f7;
}

.modal-sgc-description {
  margin: 18px 0 22px;

  color: #667085;

  font-size: 13px;
  line-height: 1.55;
}

.modal-sgc-actions {
  display: flex;
  justify-content: flex-end;

  gap: 10px;

  margin-top: 22px;
}

@media (max-width: 760px) {

  .suspension-alert-grid {
    grid-template-columns: 1fr;
  }

  .modal-sgc-actions {
    flex-direction: column-reverse;
  }

  .modal-sgc-actions .btn {
    width: 100%;
  }

}

/* =========================================================
   MATRIZ DOCUMENTAL
   ========================================================= */

.alert-success {
  background: #ecfdf3;
  color: #067647;
  border: 1px solid #abefc6;
}

.matrix-help {
  margin-bottom: 18px;
  padding: 18px 22px;

  background: #f8fbff;
  border-color: #d5e5f3;
}

.matrix-help strong {
  display: block;

  margin-bottom: 5px;

  color: var(--sgc-primary);

  font-size: 13px;
}

.matrix-help p {
  margin: 0;

  color: #667085;

  font-size: 12px;
  line-height: 1.5;
}

.matrix-section {
  margin-bottom: 18px;
  overflow: hidden;
}

.matrix-section-header {
  min-height: 76px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 20px;

  padding: 18px 22px;

  border-bottom: 1px solid #eaecf0;
}

.matrix-section-header h2 {
  margin: 0;

  font-size: 17px;
}

.matrix-section-header p {
  margin: 5px 0 0;

  color: #667085;

  font-size: 12px;
}

.matrix-table {
  min-width: 1100px;
}

.matrix-table td {
  vertical-align: middle;
}

.matrix-check-cell {
  text-align: center;
}

.matrix-check-cell input[type="checkbox"] {
  width: 17px;
  height: 17px;

  accent-color: var(--sgc-primary);

  cursor: pointer;
}

.matrix-days-input {
  width: 72px;
  height: 36px;

  padding: 0 8px;

  border: 1px solid #d0d5dd;
  border-radius: 7px;

  background: #ffffff;

  color: #344054;

  text-align: center;

  font-family: inherit;
  font-size: 12px;
}

.matrix-days-input:focus {
  outline: none;

  border-color: var(--sgc-primary);

  box-shadow:
    0 0 0 3px rgba(23, 63, 109, 0.10);
}

.matrix-save-btn {
  min-height: 34px;

  padding: 0 12px;

  font-size: 11px;
}

@media (max-width: 760px) {

  .matrix-section-header {
    align-items: flex-start;
    flex-direction: column;
  }

}

/* =========================================================
   CAMBIO DE CONTRASEÑA
   ========================================================= */

.password-rules {
  margin:
    4px 0 22px;

  padding: 14px 16px;

  border-radius: 9px;

  background: #f8fafc;

  border:
    1px solid #e4e7ec;

  color: #667085;

  font-size: 12px;
  line-height: 1.5;
}

.password-rules strong {
  display: block;

  margin-bottom: 6px;

  color: #344054;
}

.password-rules ul {
  margin:
    0 0 0 18px;

  padding: 0;
}

.password-rules li {
  margin-bottom: 2px;
}

/* =========================================================
   TRABAJADORES
   ========================================================= */

.workers-filters {
  grid-template-columns:
    minmax(280px, 1.4fr)
    minmax(240px, 1fr)
    180px
    auto;
}

.filter-worker-company label {
  display: block;

  margin-bottom: 6px;

  font-size: 12px;
  font-weight: 600;

  color: #475467;
}

.form-help {
  margin-top: 8px;

  font-size: 11px;
  line-height: 1.45;

  color: #667085;
}

.form-help.warning {
  padding: 10px 12px;

  border: 1px solid #fedf89;
  border-radius: 8px;

  background: #fffaeb;

  color: #b54708;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (max-width: 1200px) {

  .workers-filters {
    grid-template-columns: 1fr 1fr;
  }

  .workers-filters .filter-search {
    grid-column: span 2;
  }

}

@media (max-width: 760px) {

  .workers-filters {
    grid-template-columns: 1fr;
  }

  .workers-filters .filter-search {
    grid-column: auto;
  }

}

.fixed-contractor-field {
  min-height: 48px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 16px;

  padding: 0 16px;

  border: 1px solid #d0d5dd;
  border-radius: 8px;

  background: #f8fafc;
}

.fixed-contractor-field strong {
  color: #1d2939;
  font-size: 13px;
}

.fixed-contractor-field span {
  color: #667085;
  font-size: 12px;
}

/* =========================================================
   DOCUMENTOS CONTRATISTA
   ========================================================= */

.tab-content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 20px;
}

.document-summary {
  display: grid;

  grid-template-columns:
    repeat(3, minmax(0, 1fr));

  gap: 12px;

  margin-bottom: 22px;
}

.document-summary-item {
  padding: 16px 18px;

  border: 1px solid #eaecf0;
  border-radius: 10px;

  background: #f9fafb;
}

.document-summary-item span {
  display: block;

  margin-bottom: 4px;

  color: #667085;

  font-size: 11px;
  font-weight: 600;
}

.document-summary-item strong {
  color: #1d2939;

  font-size: 22px;
  font-weight: 800;
}

.document-requirements {
  display: flex;
  flex-direction: column;

  gap: 14px;
}

.document-requirement-card {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    auto;

  gap: 24px;

  padding: 20px;

  border: 1px solid #e4e7ec;
  border-radius: 12px;

  background: #ffffff;
}

.document-requirement-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  gap: 20px;
}

.document-requirement-title h3 {
  margin: 5px 0 0;

  color: #1d2939;

  font-size: 15px;
}

.document-badges {
  display: flex;
  align-items: center;
  justify-content: flex-end;

  flex-wrap: wrap;

  gap: 6px;
}

.document-description {
  margin: 9px 0 14px;

  color: #667085;

  font-size: 12px;
  line-height: 1.5;
}

.document-status-line {
  display: flex;
  align-items: center;

  gap: 8px;

  margin-top: 12px;
}

.document-status-dot {
  width: 9px;
  height: 9px;

  flex-shrink: 0;

  border-radius: 50%;
}

.document-status-dot.pending-upload {
  background: #f79009;
}

.document-status-pending {
  color: #b54708;

  font-size: 12px;
}

.document-current {
  margin-top: 14px;

  padding: 15px;

  border: 1px solid #eaecf0;
  border-radius: 10px;

  background: #f9fafb;
}

.document-current-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  gap: 20px;

  margin-bottom: 15px;
}

.document-current-header strong {
  display: block;

  color: #344054;

  font-size: 12px;

  overflow-wrap: anywhere;
}

.document-version {
  display: block;

  margin-bottom: 4px;

  color: #98a2b3;

  font-size: 10px;
  font-weight: 700;

  text-transform: uppercase;
}

.document-meta-grid {
  display: grid;

  grid-template-columns:
    repeat(4, minmax(0, 1fr));

  gap: 14px;
}

.document-meta-grid span {
  display: block;

  margin-bottom: 3px;

  color: #98a2b3;

  font-size: 9px;
  font-weight: 700;

  text-transform: uppercase;
}

.document-meta-grid strong {
  color: #475467;

  font-size: 11px;
  font-weight: 600;
}

.document-observation {
  margin-top: 14px;

  padding-top: 12px;

  border-top: 1px solid #e4e7ec;
}

.document-observation span {
  display: block;

  margin-bottom: 4px;

  color: #667085;

  font-size: 10px;
  font-weight: 700;

  text-transform: uppercase;
}

.document-observation p {
  margin: 0;

  color: #475467;

  font-size: 12px;
}

.document-observation.review {
  background: #f8fbff;

  margin:
    12px -8px -4px;

  padding: 12px 8px 4px;

  border-radius: 7px;
}

.document-requirement-actions {
  min-width: 165px;

  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.badge-warning-soft {
  background: #fffaeb;
  color: #b54708;
}

.badge-success-soft {
  background: #ecfdf3;
  color: #067647;
}

.modal-documento {
  width: min(100%, 650px);
}

.document-upload-grid {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 16px;
}

.document-upload-grid[hidden] {
  display: none;
}

#grupoFechaVencimiento[hidden] {
  display: none;
}

@media (max-width: 1000px) {

  .document-meta-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 760px) {

  .tab-content-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .document-summary {
    grid-template-columns: 1fr;
  }

  .document-requirement-card {
    grid-template-columns: 1fr;
  }

  .document-requirement-title {
    flex-direction: column;
  }

  .document-badges {
    justify-content: flex-start;
  }

  .document-requirement-actions {
    justify-content: flex-start;
  }

  .document-meta-grid {
    grid-template-columns: 1fr;
  }

  .document-upload-grid {
    grid-template-columns: 1fr;
  }

}

/* =========================================================
   REVISION DOCUMENTAL
   ========================================================= */

.review-list {
  display: flex;
  flex-direction: column;

  gap: 16px;

  padding: 20px;
}

.review-card {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    260px;

  gap: 24px;

  padding: 20px;

  border: 1px solid #e4e7ec;
  border-radius: 12px;

  background: #ffffff;
}

.review-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  gap: 16px;

  margin-bottom: 18px;
}

.review-card-header h3 {
  margin: 5px 0 0;

  font-size: 16px;

  color: #1d2939;
}

.review-owner {
  margin-bottom: 18px;

  padding: 12px 14px;

  border-radius: 9px;

  background: #f8fafc;
}

.review-owner span {
  display: block;

  margin-bottom: 3px;

  color: #98a2b3;

  font-size: 9px;
  font-weight: 700;

  text-transform: uppercase;
}

.review-owner strong {
  display: block;

  color: #344054;

  font-size: 13px;
}

.review-owner small {
  color: #667085;

  font-size: 11px;
}

.review-meta-grid {
  display: grid;

  grid-template-columns:
    repeat(3, minmax(0, 1fr));

  gap: 14px;
}

.review-meta-grid span {
  display: block;

  margin-bottom: 3px;

  color: #98a2b3;

  font-size: 9px;
  font-weight: 700;

  text-transform: uppercase;
}

.review-meta-grid strong {
  color: #475467;

  font-size: 11px;

  overflow-wrap: anywhere;
}

.review-card-actions {
  display: flex;
  flex-direction: column;

  gap: 12px;

  padding-left: 20px;

  border-left: 1px solid #eaecf0;
}

.review-card-actions .btn {
  width: 100%;
}

.review-approve-form {
  display: flex;
  flex-direction: column;

  gap: 8px;
}

.review-approve-form .form-group {
  margin: 0;
}

.review-approve-form label {
  font-size: 10px;
}

.review-approve-form textarea {
  min-height: 64px;
}

@media (max-width: 1000px) {

  .review-card {
    grid-template-columns: 1fr;
  }

  .review-card-actions {
    padding-left: 0;
    padding-top: 18px;

    border-left: 0;
    border-top: 1px solid #eaecf0;
  }

}

@media (max-width: 760px) {

  .review-meta-grid {
    grid-template-columns: 1fr;
  }

  .review-card-header {
    flex-direction: column;
  }

}

/* =========================================================
   HISTORIAL DOCUMENTAL
   ========================================================= */

.document-history-list {
  display: flex;
  flex-direction: column;

  gap: 14px;
}

.document-history-card {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    160px;

  gap: 22px;

  padding: 18px;

  border: 1px solid #e4e7ec;
  border-radius: 11px;

  background: #ffffff;
}

.document-history-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  gap: 20px;

  margin-bottom: 16px;
}

.document-history-header h3 {
  margin: 4px 0 0;

  color: #1d2939;

  font-size: 14px;
}

.document-history-grid {
  display: grid;

  grid-template-columns:
    repeat(4, minmax(0, 1fr));

  gap: 14px;

  padding: 14px;

  border-radius: 9px;

  background: #f9fafb;
}

.document-history-grid span {
  display: block;

  margin-bottom: 3px;

  color: #98a2b3;

  font-size: 9px;
  font-weight: 700;

  text-transform: uppercase;
}

.document-history-grid strong {
  color: #475467;

  font-size: 11px;
  font-weight: 600;

  overflow-wrap: anywhere;
}

.document-history-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;

  padding-left: 18px;

  border-left: 1px solid #eaecf0;
}

.document-history-actions .btn {
  width: 100%;
}

@media (max-width: 1000px) {

  .document-history-card {
    grid-template-columns: 1fr;
  }

  .document-history-actions {
    padding-left: 0;
    padding-top: 14px;

    border-left: 0;
    border-top: 1px solid #eaecf0;
  }

  .document-history-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 760px) {

  .document-history-header {
    flex-direction: column;
  }

  .document-history-grid {
    grid-template-columns: 1fr;
  }

}

/* ==========================================
   GESTIÓN DE CONTRATISTAS
   Fotografía e identificación del trabajador
   ========================================== */

.trabajador-identidad {
  display: flex;
  align-items: flex-start;
  gap: 22px;
  min-width: 0;
}

.trabajador-foto-contenedor {
  width: 130px;
  height: 150px;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid #dce3eb;
  border-radius: 12px;
  background: #f1f5f9;
}

.trabajador-foto {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.trabajador-foto-vacia {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.trabajador-identidad-datos {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.trabajador-identidad-datos h2 {
  margin: 0;
}

.trabajador-identidad-datos p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
}

.trabajador-identidad-datos p strong {
  color: #334155;
}

.trabajador-foto-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.trabajador-foto-form input[type="file"] {
  max-width: 250px;
  font-size: 12px;
}

.trabajador-foto-form .btn {
  white-space: nowrap;
}

.trabajador-foto-ayuda {
  color: #64748b;
  font-size: 12px;
}

@media (max-width: 640px) {
  .trabajador-identidad {
    flex-direction: column;
    gap: 14px;
  }

  .trabajador-foto-contenedor {
    width: 110px;
    height: 130px;
  }

  .trabajador-foto-form {
    flex-direction: column;
    align-items: flex-start;
  }

  .trabajador-foto-form input[type="file"] {
    max-width: 100%;
  }
}

