* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  background-color: #f4f4f4;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

h1 {
  text-align: center;
  color: #333;
  margin-bottom: 30px;
}

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

label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

input, select, textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

button {
  background-color: #4CAF50;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

button:hover {
  background-color: #45a049;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

th, td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

th {
  background-color: #4CAF50;
  color: white;
}

tr:hover {
  background-color: #f5f5f5;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.4);
}

.modal-content {
  background-color: #fefefe;
  margin: 5% 0 0 2%;  
  padding: 20px;
  border: 1px solid #888;
  width: 25%;  
  max-width: none;  
  border-radius: 4px;
  max-height: 85vh; 
  overflow-y: auto; 
  position: fixed;
  left: 0;
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover {
  color: black;
}

.estado-aprobado {
  color: green;
  font-weight: bold;
}

.estado-desaprobado {
  color: red;
  font-weight: bold;
}

.estado-pendiente {
  color: orange;
  font-weight: bold;
}

.tabs {
  display: flex;
  margin-bottom: 20px;
  border-bottom: 2px solid #4CAF50;
}

.tab-btn {
  padding: 10px 20px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 16px;
  color: #666;
}

.tab-btn.active {
  color: #4CAF50;
  border-bottom: 2px solid #4CAF50;
  margin-bottom: -2px;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
}

.sustento-section {
  margin: 20px 0;
  padding: 15px;
  background: #f9f9f9;
  border-radius: 4px;
}

.toggle-btn {
  background: none;
  border: none;
  color: #4CAF50;
  cursor: pointer;
  font-size: 16px;
  padding: 0;
}

.hidden {
  display: none;
}

.filtros-section {
  margin: 20px 0;
  padding: 15px;
  background: #f9f9f9;
  border-radius: 4px;
}

.filtros-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.primary-btn {
  background-color: #4CAF50;
}

.secondary-btn {
  background-color: #666;
}

.error {
  color: #ff0000;
  font-size: 0.9em;
  margin-top: 5px;
}

.status-badge {
  padding: 5px 10px;
  border-radius: 15px;
  font-size: 0.9em;
  font-weight: bold;
  text-align: center;
}

.status-pendiente {
  background-color: #ffd700;
  color: #000;
}

.status-aprobado {
  background-color: #90EE90;
  color: #006400;
}

.status-rechazado {
  background-color: #ffcccb;
  color: #8b0000;
}

.status-eliminado {
  background-color: #808080;
  color: #fff;
}

#sistemasRegistrosTable {
  font-size: 0.9em;
}

#sistemasRegistrosTable th[colspan] {
  background-color: #2c3e50;
  color: white;
}

#sistemasRegistrosTable th {
  background-color: #34495e;
  color: white;
  white-space: nowrap;
  padding: 8px;
}

#sistemasRegistrosTable td {
  white-space: nowrap;
  padding: 6px;
}

.registros-container {
  overflow-x: auto;
}

.detalles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.detalles-grid .sustento-section {
  background: #f5f5f5;
  padding: 15px;
  border-radius: 4px;
  margin: 10px 0;
}

.detalles-grid .sustento-section h4 {
  margin: 0 0 10px 0;
  color: #333;
}

.detalles-grid p {
  margin: 5px 0;
}

.detalles-grid strong {
  color: #444;
}

.file-preview {
  margin: 15px 0;
  padding: 15px;
  background: #f5f5f5;
  border-radius: 4px;
}

.file-preview-container {
  width: 100%;
  min-height: 400px;
  border: 1px solid #ddd;
  margin: 10px 0;
}

.preview-frame {
  width: 100%;
  height: 400px;
  border: none;
}

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

.preview-tab {
  padding: 8px 16px;
  background: #e0e0e0;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.preview-tab.active {
  background: #4CAF50;
  color: white;
}

.preview-modal {
  display: none;
  position: fixed;
  z-index: 2; 
  right: 0;  
  top: 0;
  width: 75%;  
  height: 100%;
  background-color: rgba(0,0,0,0.7);
}

.preview-modal-content {
  background-color: #fefefe;
  margin: 5% 2% 0 0;  
  padding: 20px;
  border: 1px solid #888;
  width: 95%;
  height: 85vh;
  position: relative;
  display: flex;
  flex-direction: column;
}

.preview-container {
  flex: 1;
  overflow: auto;
  margin: 20px 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.preview-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.preview-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.preview-btn {
  background-color: #4CAF50;
  color: white;
  padding: 5px 10px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin: 5px 0;
}

.preview-btn:hover {
  background-color: #45a049;
}

.file-preview-section {
  margin-top: 10px;
  padding: 10px;
  background-color: #f5f5f5;
  border-radius: 4px;
}

.validation-section {
  padding: 20px;
  background: #f5f5f5;
  border-radius: 4px;
  margin-top: 20px;
}