
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, sans-serif;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f1f5f9;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 20px;
}

.login-container {
    display: flex;
    flex: 1;
    min-height: 100vh;
}

.login-side-info {
    flex: 1.2;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 58, 138, 0.8) 100%),
                url('../../images/fondo.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 80px;
    color: #ffffff;
}

.login-side-info h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 24px;
}

.login-side-form {
    flex: 0.8;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px;
    position: relative;
}

.form-corner-logo {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 140px;
    height: auto;
    object-fit: contain;
    z-index: 10;
}

body.login-body {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    background-image:
        linear-gradient(rgba(15, 23, 42, 0.75), rgba(15, 23, 42, 0.75)),
        url('../../images/fondo.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: #1e293b;
    border-radius: 16px;
    padding: 40px 35px;
}

.login-card label {
    color: #94a3b8 !important;
    font-size: 0.875rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    margin-bottom: 4px;
}

.form-input-pro {
    width: 100%;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid #334155;
    background: #0f172a;
    color: #f1f5f9;
    outline: none;
    box-sizing: border-box;
}

.login-card .form-input-pro {
    margin-bottom: 0;
    padding: 12px 14px;
    border: 1px solid #334155;
    border-radius: 8px;
    background: #0f172a;
    color: #f1f5f9;
    font-size: 1rem;
}

.login-card .form-input-pro::placeholder { color: #64748b; }
.login-card .form-input-pro:focus { border-color: #2563eb; box-shadow: none; }

.btn-pro {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
}

.btn-pro:hover { background: #1d4ed8; }

header {
    background: #0f172a;
    padding: 12px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-bottom: 3px solid #2563eb;
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .logo {
    width: 120px;
    height: auto;
    filter: brightness(0) invert(1);
}

header h1 {
    font-size: 1.2rem;
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 20px;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.user-placeholder, .user-logo {
    width: 38px;
    height: 38px;
    border-radius: 6px;
    background: #1e293b;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.user-label { font-size: 0.65rem; color: #94a3b8; text-transform: uppercase; font-weight: 700; }
.user-email { font-size: 0.85rem; color: #ffffff; font-weight: 600; }

header button, .btn-logout {
    background: #ef4444;
    color: white;
    padding: 8px 16px;
    font-size: 0.75rem;
    font-weight: 700;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    transition: 0.2s;
}

header button:hover { background: #b91c1c; }


.lang-switch {
    background: #ffffff;
    padding: 15px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e2e8f0;
}

.back-btn { background: none; border: none; cursor: pointer; transition: 0.2s; }
.back-btn:hover { transform: translateX(-5px); }
.back-btn img { width: 30px; height: auto; }


.form-wrapper {
    max-width: 900px;
    width: 95%;
    margin: 20px auto;
    background: #ffffff;
    padding: 50px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
}

.form-wrapper2 {
    max-width: 1100px;
    width: 95%;
    margin: 20px auto;
    background: #ffffff;
    padding: 50px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
}

.form-section-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #0f172a;
    margin: 30px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #f1f5f9;
    text-transform: uppercase;
}

.form-section-title:first-child { margin-top: 0; }

label {
    display: block !important;
    font-size: 0.8rem;
    font-weight: 700;
    color: #1e293b !important;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    font-size: 1rem;
    color: #1e293b;
    background: #ffffff;
    transition: all 0.2s ease;
    margin-bottom: 20px;
}

input:focus, textarea:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.05);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Campo grande (selects e inputs de citas).
   Por defecto: tamaño de portal_citas / vigilante. */
.campo-grande {
    width: 100%;
    padding: 12px;
    font-size: 0.95rem;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    box-sizing: border-box;
}

:where(.form-wrapper) .campo-grande {
    padding: 14px;
    font-size: 1rem;
}

.bloque-radio-doble {
    display: flex;
    gap: 25px;
}

.bloque-radio-doble label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.required-mark {
    color: #ef4444;
    margin-left: 4px;
    font-weight: bold;
}

.optional-text {
    color: #94a3b8;
    font-size: 0.7rem;
    text-transform: none;
    font-weight: normal;
}

.warningPrecioMenor {
    display: none;
    margin-top: 10px;
    padding: 10px;
    border-radius: 10px;
    background: #ff0000;
    color: #000000;
    font-weight: bold;
}

.accordion-header {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    user-select: none;
    border-bottom: 1px solid #e5e7eb;
}

.accordion-header:hover { color: #2563eb; }

.accordion-content {
    padding-top: 20px;
    overflow: hidden;
    transition: all .25s ease;
}

.swal2-checkbox { display: none !important; }


button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: #2563eb;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

button:hover { background: #1d4ed8; }

.btn-primary, .login-box button {
    width: 100%;
    background: #0f172a;
    color: #ffffff;
    padding: 18px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: 0.2s;
}

.btn-primary:hover, .login-box button:hover { background: #1e293b; }

.btn-cancelar {
    width: 100%;
    background: #ff0000;
    color: #ffffff;
    padding: 18px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: 0.2s;
}

.btn-cancelar:hover { background: #be1a1a; }

/* Botón cuadrado con solo icono (editar / eliminar proveedor) */
.btn-icono-chico {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 0.85rem;
    color: #334155;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.btn-icono-chico:hover { background: #e2e8f0; }

.btn-icono-chico:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.actions-cell {
    min-width: 140px;
    vertical-align: middle;
}

.actions-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}

.actions-wrapper .btn-primary {
    width: 100%;
    margin: 0 !important;
    white-space: nowrap;
}

.image-container {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

.image-container a {
    background: #ffffff;
    width: 280px;
    padding: 40px 20px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.image-container a:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border-color: #2563eb;
}

.image-container img { width: 100px; height: auto; margin-bottom: 20px; }
.image-container span { color: #0f172a; font-weight: 700; font-size: 0.9rem; }

.table-wrapper {
    width: 95%;
    max-width: 1500px;
    margin: 20px auto;
    background: white;
    border-radius: 4px;
    overflow-x: auto !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

thead {
    background: #0f172a;
    color: white;
}

th {
    padding: 15px;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

td {
    padding: 15px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
    color: #475569;
}

tr:hover { background: #f8fafc; }

table thead tr:hover {
    background-color: transparent !important;
}

table thead th {
    background-color: #000000 !important;
    color: #ffffff !important;
}

.col-desc {
    max-width: 150px;
    word-wrap: break-word;
    white-space: normal;
}

.historial-table {
    min-width: 1200px;
}

.historial-table th, .historial-table td {
    white-space: nowrap;
}

.row-checked {
    background-color: #f0fdf4 !important;
    border-left: 5px solid #16a34a;
}

.filter-select-client {
    padding: 6px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    background-color: #ffffff;
}

.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-open, .badge-warning { background: #fef9c3; color: #854d0e; }
.badge-closed, .badge-success { background: #dcfce7; color: #166534; }
.badge-rejected { background: #F2C8BF; color: #7D1C09; }

.badge-in-progress, .badge-info {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.badge-return {
    background-color: #fce7f3;
    color: #AD109C;
    border: 1px solid #f9a8d4;
}

.img-preview-row {
    display: flex;
    flex-direction: row;
    gap: 6px;
    justify-content: center;
    align-items: center;
    min-width: 120px;
}

.img-thumb {
    width: 35px;
    height: 35px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer !important;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease-in-out;
    background-color: #f1f5f9;
    display: inline-block;
}

.img-thumb:hover {
    transform: scale(1.2) translateY(-2px);
    border-color: #2563eb;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.img-thumb-empty {
    width: 35px;
    height: 35px;
    background: #f8fafc;
    border-radius: 4px;
    border: 1px dashed #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    font-size: 0.7rem;
}

footer {
    background: #ffffff;
    color: #94a3b8;
    text-align: center;
    padding: 30px;
    font-size: 0.8rem;
    border-top: 1px solid #e2e8f0;
    margin-top: auto;
}

footer div { font-size: 0.7rem; }

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.modal.show { display: flex; }

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 8px;
    max-width: 400px;
    text-align: center;
}

.fap-modal-overlay,
.pnr-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.fap-modal-box,
.pnr-modal-box {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
    width: 100%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.fap-modal-box label,
.pnr-modal-box label {
    display: block;
    font-weight: 800;
    color: #1e293b;
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-bottom: 5px;
    margin-top: 15px;
}

.fap-modal-box input,
.fap-modal-box select,
.pnr-modal-box input,
.pnr-modal-box select {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border-radius: 6px;
    border: 2px solid #cbd5e1;
    background: #f8fafc;
    font-size: 0.9rem;
    color: #0f172a;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.fap-modal-box input:focus,
.fap-modal-box select:focus,
.pnr-modal-box input:focus,
.pnr-modal-box select:focus {
    border-color: #2563eb;
    background: #ffffff;
}

@media (max-height: 700px) {
    .fap-modal-box,
    .pnr-modal-box { max-height: 85vh; }
}

/* Visor para agrandar imagen */
#img-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

#img-modal img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Pantalla de carga */
#loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.95);
    z-index: 100000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-top: 5px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

#modalEditar .fap-modal-box label { margin-top: 1px; }
#modalEditar .form-section-title { font-size: 0.65rem; margin-top: 12px; margin-bottom: 5px; }
#modalEditar .bloque-radio-doble { gap: 10px; margin-bottom: 2px; }
#modalEditar .bloque-radio-doble label { font-size: 0.75rem; font-weight: 500; gap: 3px; }
#modalEditar .bloque-radio-doble input[type="radio"] { width: 13px; height: 13px; margin: 0; }
#modalEditar .form-grid label { font-size: 0.75rem; font-weight: 500; }
#modalEditar .form-grid { gap: 6px; }
#modalEditar .form-grid input[type="checkbox"] { width: 13px; height: 13px; margin: 0; }
#modalEditar .campo-grande { padding: 8px; font-size: 0.8rem; }

@keyframes spin  { 100% { transform: rotate(360deg); } }
@keyframes girar { to   { transform: rotate(360deg); } }

@media (max-width: 1000px) {
    .login-side-info { display: none; }
    .login-side-form { flex: 1; }
    header { flex-direction: column; gap: 15px; padding: 15px; text-align: center; }
}
