html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* =============================================
   Modal genérico (Crear/Editar/Confirmar) y toast — compartidos entre módulos
   ============================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-card {
    background: #fff;
    width: 750px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.modal-pequeno {
    width: 450px;
}

.modal-header {
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f2937;
}

.modal-body {
    padding: 1.5rem;
    flex: 1;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.footer-derecha {
    display: flex;
    gap: 0.5rem;
}

.seccion {
    border: 1px dashed #d1d5db;
    border-radius: 0.5rem;
    padding: 1.1rem;
    margin: 0 0 1.25rem;
}

.seccion:last-of-type {
    margin-bottom: 0;
}

.seccion legend {
    float: none;
    width: auto;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
    font-weight: 600;
    padding: 0 0.4rem;
}

.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 640px) {
    .grid-2col {
        grid-template-columns: 1fr;
    }
}

.campo {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.campo label {
    font-size: 0.85rem;
    color: #374151;
    font-weight: 500;
}

.campo input[type="text"],
.campo input[type="number"],
.campo input[type="password"],
.campo select {
    padding: 0.45rem 0.6rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.9rem;
    color: #1f2937;
}

.campo input[readonly] {
    background-color: #f3f4f6;
    color: #6b7280;
}

.error-inline {
    display: none;
    color: #dc2626;
    font-size: 0.78rem;
}

.advertencia-inline {
    display: none;
    color: #d97706;
    font-size: 0.78rem;
}

.mensaje-error-general {
    display: none;
    background-color: #fef2f2;
    color: #991b1b;
    padding: 0.6rem 0.85rem;
    border-radius: 0.4rem;
    font-size: 0.85rem;
    margin-top: 0.75rem;
}

.borde-ambar {
    border: 2px solid #d97706 !important;
}

.nota-campo {
    font-size: 0.72rem;
    color: #6b7280;
}

.btn-primario {
    background-color: #2563eb;
    color: #fff;
    border: none;
    padding: 0.5rem 1.1rem;
    border-radius: 0.375rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.btn-primario:hover:not(:disabled) {
    background-color: #1d4ed8;
}

.btn-primario:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secundario {
    background-color: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 0.5rem 1.1rem;
    border-radius: 0.375rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.btn-secundario:hover {
    background-color: #f3f4f6;
}

.btn-eliminar {
    background: transparent;
    color: #dc2626;
    border: 1px solid #fca5a5;
    padding: 0.5rem 1.1rem;
    border-radius: 0.375rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.btn-eliminar:hover {
    background-color: #fef2f2;
}

.btn-primario-rojo {
    background-color: #dc2626;
    color: #fff;
    border: none;
    padding: 0.5rem 1.1rem;
    border-radius: 0.375rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.btn-primario-rojo:hover:not(:disabled) {
    background-color: #b91c1c;
}

.btn-primario-rojo:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Toast */
.app-toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1080;
    min-width: 260px;
    max-width: 360px;
    padding: 0.75rem 1rem;
    border-radius: 0.4rem;
    color: #fff;
    font-size: 0.9rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.app-toast.exito {
    background-color: #10b981;
}

.app-toast.error {
    background-color: #dc2626;
}

.app-toast.info {
    background-color: #2563eb;
}