* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
  min-height: 100vh;
}

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 300px;
  background: #1e2a3a;
  color: #e8ecf1;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 20px 18px;
  border-bottom: 1px solid #2d3f54;
}

.sidebar-header h2 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8fa3b8;
  font-weight: 600;
}

.sidebar-user {
  padding: 14px 18px;
  border-top: 1px solid #2d3f54;
  font-size: 0.82rem;
  color: #8fa3b8;
}

.sidebar-user strong {
  display: block;
  color: #e8ecf1;
  margin-bottom: 4px;
}

.sidebar-user .role {
  font-size: 0.75rem;
  color: #6a8aab;
}

.sidebar-user a {
  display: inline-block;
  margin-top: 8px;
  color: #4a9eff;
  text-decoration: none;
  font-size: 0.8rem;
}

.sidebar-user a:hover {
  text-decoration: underline;
}

.sidebar-user .logout-form {
  margin: 8px 0 0;
  padding: 0;
}

.sidebar-user .link-button {
  background: none;
  border: none;
  padding: 0;
  color: #4a9eff;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: none;
}

.sidebar-user .link-button:hover {
  text-decoration: underline;
}

.sidebar-version {
  display: block;
  margin-top: 10px;
  font-size: 0.72rem;
  color: #8a9bb0;
}

.tree {
  padding: 8px 0;
  flex: 1;
  overflow-y: auto;
}

.tree-group {
  margin-bottom: 2px;
}

.tree-parent {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 10px 16px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 0.95rem;
  user-select: none;
}

.tree-parent:hover {
  background: #263545;
}

.tree-parent.active {
  background: #2a4060;
  color: #fff;
}

.tree-parent .arrow {
  width: 16px;
  font-size: 0.65rem;
  color: #8fa3b8;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.tree-group.open .tree-parent .arrow {
  transform: rotate(90deg);
}

.tree-parent .icon {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.tree-children {
  display: none;
  padding: 2px 0 6px 0;
}

.tree-group.open .tree-children {
  display: block;
}

.tree-subitem {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 52px;
  cursor: pointer;
  font-size: 0.88rem;
  color: #b0bec9;
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
}

.tree-subitem::before {
  content: "•";
  font-size: 0.7rem;
  color: #5a7a9a;
}

.tree-subitem:hover {
  background: #263545;
  color: #e8ecf1;
}

.tree-subitem.active {
  background: #243a55;
  color: #fff;
  border-left-color: #4a9eff;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: #fff;
  padding: 18px 32px;
  border-bottom: 1px solid #dde1e6;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #1e2a3a;
}

.topbar-notaria {
  font-size: 1rem;
  font-weight: 500;
  color: #5a6d82;
}

.topbar-actions a {
  color: #4a9eff;
  text-decoration: none;
  font-size: 0.88rem;
}

.topbar-actions a:hover {
  text-decoration: underline;
}

.content {
  padding: 32px;
  flex: 1;
}

.content-card {
  background: #fff;
  border-radius: 10px;
  padding: 28px 32px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  max-width: 720px;
}

.content-card.content-card-ancho {
  max-width: none;
  width: 100%;
  box-sizing: border-box;
}

.breadcrumb {
  font-size: 0.82rem;
  color: #8a9bb0;
  margin-bottom: 8px;
}

.breadcrumb span {
  color: #4a9eff;
}

.content-card h2 {
  font-size: 1.25rem;
  margin-bottom: 10px;
  color: #1e2a3a;
}

.content-card p {
  color: #5a6a7e;
  line-height: 1.6;
}

.badge {
  display: inline-block;
  margin-top: 16px;
  padding: 4px 12px;
  background: #e8f0fe;
  color: #2b5ea7;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.messages {
  padding: 16px 32px 0;
}

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.alert-info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

.alert-warning {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
}

#content-dynamic {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #e8ecf1;
}

.upload-panel h3 {
  font-size: 1rem;
  color: #1e2a3a;
  margin-bottom: 16px;
}

.upload-form {
  display: grid;
  gap: 16px;
}

.form-row label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #3a4a5c;
  margin-bottom: 6px;
}

.form-row label .opcional {
  font-weight: 400;
  color: #8a9bb0;
  font-size: 0.78rem;
}

.form-row input[type="text"] {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #dde1e6;
  border-radius: 8px;
  font-size: 0.95rem;
}

.form-row input[type="text"]:focus {
  outline: none;
  border-color: #4a9eff;
  box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.15);
}

.form-row textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #dde1e6;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
}

.form-row textarea.campo-texto-auto {
  resize: none;
  overflow: hidden;
  min-height: 44px;
  line-height: 1.45;
}

.documento-autosave-indicador {
  min-height: 1.25rem;
  margin: 8px 0 12px;
}

.documento-autosave-ok {
  color: #2e7d32;
}

.documento-autosave-pendiente,
.documento-autosave-guardando {
  color: #5c6773;
}

.documento-autosave-error {
  color: #c0392b;
}

.documento-autosave-offline {
  color: #b86e00;
}

.form-row textarea:focus {
  outline: none;
  border-color: #4a9eff;
  box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.15);
}

.form-row label .requerido {
  color: #c0392b;
  font-weight: 600;
}

.form-row select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #dde1e6;
  border-radius: 8px;
  font-size: 0.95rem;
  background: #fff;
}

.select-acceso {
  min-height: 140px;
  max-width: 480px;
}

.form-row-acceso .panel-desc {
  margin-top: 6px;
  font-size: 0.85rem;
  color: #5c6773;
}

.config-acceso-panel {
  margin-bottom: 24px;
  padding: 16px 20px;
  background: #f8fafc;
  border: 1px solid #e8ecf1;
  border-radius: 8px;
}

.config-acceso-panel h4 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.config-actualizar-panel {
  margin-bottom: 24px;
  padding: 16px 20px;
  background: #fff8f0;
  border: 1px solid #f0dcc8;
  border-radius: 8px;
}

.config-actualizar-panel h4 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.results-table .acciones-celda {
  white-space: nowrap;
}

.results-table .acciones-celda .btn {
  margin-right: 6px;
  margin-bottom: 4px;
}

.results-table .col-acceso {
  max-width: 220px;
  font-size: 0.85rem;
  line-height: 1.35;
}

.form-row input[type="date"] {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #dde1e6;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
}

.form-row input[type="date"]:focus {
  outline: none;
  border-color: #4a9eff;
  box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.15);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.form-grid > [class*="col-"] {
  min-width: 0;
}

.col-1 { grid-column: span 1; }
.col-2 { grid-column: span 2; }
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-9 { grid-column: span 9; }
.col-10 { grid-column: span 10; }
.col-11 { grid-column: span 11; }
.col-12 { grid-column: span 12; }

@media (max-width: 768px) {
  .form-grid > [class*="col-"] {
    grid-column: span 12;
  }
}

.wizard-step h3 {
  font-size: 1rem;
  color: #1e2a3a;
  margin-bottom: 14px;
}

.wizard-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

code {
  background: #f0f2f5;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85rem;
  color: #c0392b;
}

.text-muted {
  color: #8a9bb0;
  font-size: 0.88rem;
}

.file-input-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.file-input-wrapper input[type="file"] {
  font-size: 0.88rem;
}

.file-nombre {
  font-size: 0.82rem;
  color: #5a6a7e;
}

.form-error {
  color: #c0392b;
  font-size: 0.82rem;
  margin-top: 4px;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary {
  background: #2a4060;
  color: #fff;
}

.btn-primary:hover {
  background: #1e2a3a;
}

.btn-secondary {
  background: #e8ecf1;
  color: #3a4a5c;
}

.btn-secondary:hover {
  background: #dde1e6;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 0.8rem;
}

.inline-input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #dde1e6;
  border-radius: 6px;
  font-size: 0.85rem;
  box-sizing: border-box;
}

.inline-input:focus {
  outline: none;
  border-color: #4a9eff;
}

.config-campos-ayuda {
  background: #f7f9fb;
  border: 1px solid #e8ecf1;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 0.85rem;
  color: #5a6a7e;
  line-height: 1.5;
}

.config-campos-ayuda p {
  margin: 0 0 6px;
  color: inherit;
}

.config-campos-ayuda p:last-child {
  margin-bottom: 0;
}

.config-campos-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  margin-bottom: 8px;
}

.config-campos-table {
  min-width: 880px;
}

.config-campos-table th:nth-child(1),
.config-campos-table td:nth-child(1) {
  width: 52px;
  white-space: nowrap;
}

.config-campos-table th:nth-child(2),
.config-campos-table td:nth-child(2) {
  min-width: 140px;
}

.config-campos-table td:nth-child(3) .inline-input {
  min-width: 160px;
}

.config-campos-table td:nth-child(5) .inline-input {
  min-width: 110px;
}

.config-campos-table th:nth-child(7),
.config-campos-table td:nth-child(7) {
  width: 72px;
  text-align: center;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.hidden {
  display: none;
}

.modal-box {
  background: #fff;
  border-radius: 12px;
  padding: 28px 32px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.modal-box h3 {
  font-size: 1.1rem;
  color: #1e2a3a;
  margin-bottom: 10px;
}

.modal-box p {
  color: #5a6a7e;
  font-size: 0.9rem;
  line-height: 1.5;
}

.modal-lista {
  margin: 12px 0;
  padding-left: 20px;
  color: #c0392b;
  font-size: 0.9rem;
}

.modal-nota {
  font-size: 0.82rem !important;
  color: #8a9bb0 !important;
  margin-top: 8px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  justify-content: flex-end;
}

.modal-box-wide {
  max-width: min(960px, 95vw);
  width: 100%;
  padding: 20px 24px 24px;
}

.modal-pdf-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.modal-pdf-header h3 {
  margin-bottom: 4px;
}

.pdf-preview-frame-wrap {
  border: 1px solid #dde1e6;
  border-radius: 8px;
  overflow: hidden;
  background: #f4f6f8;
  min-height: 70vh;
  position: relative;
}

.pdf-preview-frame-wrap.pdf-preview-loading::after {
  content: "Generando vista previa PDF…";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(244, 246, 248, 0.92);
  color: #3a4a5c;
  font-size: 0.95rem;
}

#modal-pdf-error {
  color: #c0392b !important;
  margin-top: 12px;
  white-space: pre-wrap;
}

.pdf-preview-frame {
  display: block;
  width: 100%;
  height: 70vh;
  border: 0;
  background: #fff;
}

.results-table td .btn-sm + .btn-sm,
.results-table td .btn-sm + a.btn-sm {
  margin-left: 6px;
}

.hidden {
  display: none !important;
}

.upload-panel {
  margin-bottom: 28px;
}

.recientes-subidas-panel {
  border-bottom: none;
  padding-bottom: 0;
}

.recientes-paginacion {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.recientes-paginacion .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.search-panel {
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid #e8ecf1;
}

.search-panel h3,
.upload-panel h3 {
  font-size: 1rem;
  color: #1e2a3a;
  margin-bottom: 16px;
}

.search-form {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

@media (max-width: 768px) {
  .search-form {
    grid-template-columns: 1fr;
  }
}

.search-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.search-results {
  margin-top: 20px;
}

.search-results-header {
  font-size: 0.88rem;
  color: #5a6a7e;
  margin-top: 16px;
  margin-bottom: 10px;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.results-table th,
.results-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #e8ecf1;
}

.results-table th {
  background: #f7f9fb;
  color: #3a4a5c;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.results-table tr:hover td {
  background: #f7f9fb;
}

.results-table a {
  color: #4a9eff;
  text-decoration: none;
  font-weight: 600;
}

.results-table a:hover {
  text-decoration: underline;
}

.search-empty,
.search-error,
.no-permission-msg {
  padding: 14px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-top: 12px;
}

.search-empty {
  background: #f7f9fb;
  color: #5a6a7e;
  border: 1px solid #e8ecf1;
}

.search-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.no-permission-msg {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
}

.revision-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.revision-stat-card {
  background: #f7f9fb;
  border: 1px solid #e8ecf1;
  border-radius: 10px;
  padding: 16px;
}

.revision-stat-card.revision-stat-total {
  background: #e8f4fd;
  border-color: #b8daf5;
}

.revision-stat-label {
  display: block;
  font-size: 0.78rem;
  color: #5a6a7e;
  margin-bottom: 6px;
}

.revision-stat-value {
  font-size: 1.6rem;
  color: #1e2a3a;
}

.revision-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.revision-subpanel h3 {
  font-size: 1rem;
  margin-bottom: 12px;
}

.results-table-compact td,
.results-table-compact th {
  padding: 8px 10px;
  font-size: 0.85rem;
}

.badge-estado {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge-estado-borrador {
  background: #e8ecf1;
  color: #4a5568;
}

.badge-estado-correccion {
  background: #fff3cd;
  color: #856404;
}

.badge-estado-aprobado {
  background: #d4edda;
  color: #155724;
}

.revision-estado-banner {
  margin-bottom: 16px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  border: 1px solid #e8ecf1;
  background: #f7f9fb;
}

.revision-estado-banner.estado-borrador {
  border-color: #cbd5e0;
}

.revision-estado-banner.estado-correccion {
  background: #fff8e6;
  border-color: #ffeeba;
  color: #856404;
}

.revision-estado-banner.estado-aprobado {
  background: #e8f5e9;
  border-color: #c3e6cb;
  color: #155724;
}

.revision-panel {
  margin-bottom: 20px;
  padding: 16px;
  border: 1px solid #dbe4ef;
  border-radius: 10px;
  background: #f9fbfd;
}

.revision-panel textarea {
  width: 100%;
  min-height: 80px;
  margin: 10px 0 12px;
}

.revision-panel-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.categoria-panel {
  border: 1px solid #dbe4ef;
  border-radius: 10px;
  background: #f9fbfd;
  padding: 14px;
  margin-bottom: 16px;
}

.categoria-panel h4 {
  font-size: 0.95rem;
  margin-bottom: 10px;
  color: #1e2a3a;
}

.categoria-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.85rem;
}

.categoria-breadcrumb button {
  background: none;
  border: none;
  color: #2a5298;
  cursor: pointer;
  padding: 0;
  font: inherit;
}

.categoria-breadcrumb button:hover {
  text-decoration: underline;
}

.categoria-breadcrumb .sep {
  color: #8fa3b8;
}

.categoria-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.categoria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.categoria-folder {
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  background: #fff;
  padding: 12px 10px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.categoria-folder:hover {
  border-color: #2a5298;
  box-shadow: 0 2px 8px rgba(42, 82, 152, 0.12);
}

.categoria-folder.selected {
  border-color: #2a5298;
  background: #eef3fb;
}

.categoria-folder-icon {
  font-size: 1.4rem;
  display: block;
  margin-bottom: 6px;
}

.categoria-folder-name {
  font-size: 0.82rem;
  line-height: 1.3;
  word-break: break-word;
}

.categoria-plantillas-list {
  border-top: 1px solid #e3e9f0;
  padding-top: 12px;
}

.categoria-plantilla-item {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e3e9f0;
  border-radius: 8px;
  background: #fff;
  margin-bottom: 8px;
  cursor: pointer;
}

.plantilla-pick-check {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 2px solid #c5d0de;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: transparent;
  line-height: 1;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.plantilla-pick-check.is-checked {
  border-color: #2a5298;
  background: #2a5298;
  color: #fff;
}

.categoria-plantilla-item-body {
  flex: 1;
  min-width: 0;
}

.categoria-plantilla-meta {
  flex-shrink: 0;
  font-size: 0.9rem;
  color: #5a6a7a;
}

.categoria-plantilla-item:hover {
  border-color: #2a5298;
}

.categoria-plantilla-item.selected {
  border-color: #2a5298;
  background: #eef3fb;
  box-shadow: 0 0 0 1px #2a5298;
}

.plantilla-seleccion-resumen {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #e8f0fa;
  border: 1px solid #2a5298;
  color: #1a3a6e;
  font-size: 0.95rem;
}

.plantilla-seleccion-resumen.hidden {
  display: none;
}

.categoria-layout-dos-columnas {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(280px, 1.2fr);
  gap: 20px;
  align-items: start;
}

@media (max-width: 900px) {
  .categoria-layout-dos-columnas {
    grid-template-columns: 1fr;
  }
}

.pagina-tamanio-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 12px 0;
}

.pagina-tamanio-row .select-tamanio-pagina {
  min-width: 4.5rem;
}

.control-checkbox-date {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
}

.control-checkbox-date-fecha {
  font-weight: normal;
  margin: 0;
}

.control-checkbox-date-fecha input[type="date"] {
  margin-left: 6px;
}

.control-si-no-date {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
}

.control-si-no-date-fecha {
  font-weight: normal;
  margin: 0;
}

.control-si-no-date-fecha input[type="date"] {
  margin-left: 6px;
}

.control-date-text,
.control-radicado-datetime {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}

.control-group-label {
  font-weight: 600;
  width: 100%;
  margin-bottom: 2px;
}

.control-date-text-fecha input[type="date"],
.control-radicado-datetime-fecha input[type="datetime-local"] {
  max-width: 14rem;
  margin-left: 6px;
}

.control-date-text-texto input[type="text"] {
  min-width: 14rem;
  margin-left: 6px;
}

.control-radicado-datetime label input[type="text"] {
  min-width: 10rem;
  margin-left: 6px;
}

.tabla-control-scroll {
  width: 100%;
  overflow-x: auto;
  margin-top: 8px;
}

.results-table-control {
  min-width: 1200px;
  font-size: 0.85rem;
}

.results-table-control th,
.results-table-control td {
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.results-table-control td.celda-acciones-doc {
  white-space: normal;
}

.results-table-control-inline {
  min-width: 2400px;
  table-layout: fixed;
}

.results-table-control-inline th.th-control-wrap {
  white-space: normal;
  max-width: 7.5rem;
  min-width: 6.5rem;
  width: 7rem;
  line-height: 1.2;
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
  vertical-align: bottom;
  padding: 8px 4px;
  overflow: visible;
  text-overflow: unset;
  hyphens: auto;
  word-wrap: break-word;
}

.results-table-control-inline th.th-control-wrap.th-radicado,
.results-table-control-inline td.celda-inline-radicado {
  min-width: 9.5rem;
  width: 9.5rem;
  max-width: 9.5rem;
}

.results-table-control-inline th.th-control-wrap .th-sub {
  font-weight: 500;
  font-size: 0.68rem;
}

.results-table-control-inline th.th-acciones,
.results-table-control-inline td.celda-acciones-inline {
  min-width: 5.5rem;
  width: 5.5rem;
  max-width: 5.5rem;
  white-space: normal;
  text-align: center;
  vertical-align: middle;
}

.results-table-control td.celda-inline-editable {
  white-space: normal;
  max-width: 7rem;
  width: 7rem;
  overflow: visible;
  text-overflow: unset;
  vertical-align: top;
  padding: 6px 4px;
}

.celda-inline-compuesta,
.celda-inline-celda-simple {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.celda-inline-compuesta {
  min-width: 8.5rem;
}

.celda-inline-si-no .ctrl-inline-check-label {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  font-size: 0.85rem;
  margin: 0;
}

.celda-inline-si-no .ctrl-inline-check-text {
  min-width: 1.4rem;
  text-align: left;
}

.control-si-no-date label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ctrl-orip-badge--na {
  background: #f1f5f9;
  color: #64748b;
}

.ctrl-inline-input {
  width: 100%;
  min-width: 0;
  font: inherit;
  font-size: 0.85rem;
  padding: 4px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  box-sizing: border-box;
}

.ctrl-inline-datetime {
  min-width: 0;
}

.ctrl-inline-input:focus {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
}

.ctrl-inline-estado {
  display: block;
  font-size: 0.7rem;
  min-height: 1em;
  color: #64748b;
}

.ctrl-inline-estado.is-ok {
  color: #15803d;
}

.ctrl-inline-estado.is-error {
  color: #b91c1c;
}

.ctrl-inline-estado.is-pending {
  color: #64748b;
}

.ctrl-estado-firma {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
}

.ctrl-estado-firma--vigente {
  background: #fef9c3;
  color: #854d0e;
}

.ctrl-estado-firma--vencida {
  background: #fecaca;
  color: #991b1b;
}

.orip-resumen-panel {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 6px;
  background: #fff7ed;
  border: 1px solid #fdba74;
  font-size: 0.92rem;
}

.orip-resumen-critico {
  color: #b91c1c;
  font-weight: 600;
}

.ctrl-orip-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: normal;
  line-height: 1.35;
}

.ctrl-orip-limite {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  font-weight: 500;
  color: #64748b;
}

.ctrl-orip-badge--radicado {
  background: #dcfce7;
  color: #166534;
}

.ctrl-orip-parcial {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  color: #b45309;
}

.ctrl-orip-badge--30 {
  background: #fef9c3;
  color: #854d0e;
}

.ctrl-orip-badge--60 {
  background: #fde68a;
  color: #92400e;
}

.ctrl-orip-badge--80 {
  background: #fed7aa;
  color: #9a3412;
}

.ctrl-orip-badge--vencido {
  background: #fecaca;
  color: #991b1b;
}

.results-table-control tbody tr.ctrl-fila-orip--30 {
  background: #fffbeb;
}

.results-table-control tbody tr.ctrl-fila-orip--60 {
  background: #fef3c7;
}

.results-table-control tbody tr.ctrl-fila-orip--80 {
  background: #ffedd5;
}

.results-table-control tbody tr.ctrl-fila-orip--vencido {
  background: #fee2e2;
}

.results-table-control-inline th.th-orip,
.results-table-control-inline td:has(.ctrl-orip-badge) {
  min-width: 6.5rem;
  width: 6.5rem;
  max-width: 6.5rem;
}
