/* Modal Window Wrapper Override */
.company-modal-window .modal-dialog {
  width: 900px;
  max-width: 95vw;
  margin: 30px auto;
}

.company-modal-window .modal-content {
  border: none;
  box-shadow: none;
  background: transparent;
}

.company-modal {
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.company-modal-header {
  padding: 18px 28px;
  background: linear-gradient(to right, #f8f9fa, #ffffff);
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.company-modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: #333;
  font-weight: 600;
}

.company-modal-body {
  padding: 0; /* Changed from 24px */
  overflow-y: hidden; /* Changed from auto */
  flex: 1;
  display: flex;
  flex-direction: column;
}

.company-modal-scrollable {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  max-height: calc(90vh - 140px); /* Aproximadamente header + footer */
}

.company-modal-footer {
  padding: 18px 28px;
  background-color: #f8f9fa;
  border-top: 1px solid #e9ecef;
  display: flex;
  justify-content: flex-end;
  gap: 15px;
}

/* Form Layout */
.company-form-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.company-field-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 25px;
  background-color: #fafbfc;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #f0f2f5;
}

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

.company-section-title {
  margin-top: 10px;
  margin-bottom: -10px;
  font-size: 1.05rem;
  color: #495057;
  padding-bottom: 5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.company-section-title i {
  margin-right: 10px;
  color: #007bff;
  font-size: 1.2rem;
}

/* Required field styling */
.required-label::after {
  content: " *";
  color: #dc3545;
  font-weight: bold;
}

.company-modal md-input-container.md-input-invalid label,
.company-modal md-input-container.md-input-invalid label i {
  color: #dc3545 !important;
}

.company-modal md-input-container.md-input-invalid input {
  border-bottom-color: #dc3545 !important;
}

/* Custom MD tweaks for modal */
.company-modal md-input-container {
  margin: 12px 0;
  width: 100%;
}

.company-modal md-input-container label {
  color: #666;
  display: flex !important;
  align-items: center !important;
  font-weight: 500;
  transition: all 0.2s ease;
}

.company-modal md-input-container.md-input-focused label {
  color: #007bff;
}

.company-modal md-input-container label.select-label {
  transform: translate3d(0, 6px, 0) scale(0.75);
  transform-origin: left top;
}

.company-modal md-input-container label i {
  margin-right: 8px;
  font-size: 18px;
  width: 20px;
  text-align: center;
  color: #888;
  transition: color 0.2s ease;
}

.company-modal md-input-container.md-input-focused label i {
  color: #007bff;
}

.company-modal input {
  padding-left: 2px;
}

/* ui-select tweaks */
.company-modal .ui-select-container {
  margin-top: 4px;
}

/* Checkbox styling */
.company-checkbox-container {
  margin: 10px 0;
  display: flex;
  align-items: center;
}

.company-checkbox-container md-checkbox {
  margin: 0;
  font-weight: 600;
  color: #495057;
}

.company-checkbox-container md-checkbox .md-label {
  display: flex;
  align-items: center;
}

.company-modal .modal-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #999;
  line-height: 1;
  transition: transform 0.2s ease, color 0.2s ease;
}

.company-modal .modal-close-btn:hover {
  color: #dc3545;
  transform: rotate(90deg);
}

.company-modal-header h3 i {
  margin-right: 10px;
  color: #007bff;
}

.company-section-title i {
  margin-right: 8px;
}

/* Buttons */
.btn-custom i {
  margin-right: 8px;
  font-size: 18px;
  vertical-align: middle;
}

.btn-custom {
  padding: 10px 22px;
  border-radius: 6px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  letter-spacing: 0.3px;
}

.btn-save {
  background: linear-gradient(135deg, #28a745 0%, #218838 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.btn-save:hover:not(:disabled) {
  background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
  transform: translateY(-1px);
}

.btn-save:disabled {
  background: #e9ecef;
  color: #adb5bd;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.8;
}

.btn-cancel {
  background-color: #ffffff;
  color: #6c757d;
  border: 1px solid #dee2e6;
}

.btn-cancel:hover {
  background-color: #f8f9fa;
  color: #495057;
  border-color: #adb5bd;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Responsiveness */
@media (max-height: 700px) {
  .company-form-grid {
    gap: 5px 20px;
  }
  .company-modal-body {
    padding: 15px 24px;
  }
}

@media (max-width: 600px) {
  .company-form-grid {
    grid-template-columns: 1fr;
  }
  .company-form-full, .company-section-title {
    grid-column: span 1;
  }
}

/* Alert styles */
.company-alert {
  padding: 15px 20px;
  margin-bottom: 25px;
  border-radius: 8px;
  border-left: 5px solid;
  animation: fadeIn 0.4s ease-out;
}

.company-alert-warning {
  background-color: #fff9db;
  border-color: #fcc419;
  color: #856404;
}

.company-alert-header {
  display: flex;
  align-items: center;
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 1rem;
}

.company-alert-header i {
  margin-right: 12px;
  font-size: 1.4rem;
}

.company-alert-list {
  margin: 0;
  padding-left: 32px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 5px 15px;
  list-style-type: disc;
}

.company-alert-list li {
  font-size: 0.9rem;
  line-height: 1.4;
}

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