/* TrackingModule — Modal de comentario al cambiar estado (admin) */

/* ─── OVERLAY ─── */
.tracking-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    transition: background 0.2s ease;
    pointer-events: none;
    /* Asegurar que no se recorte por padres con overflow */
    isolation: isolate;
}

.tracking-modal-overlay--visible {
    background: rgba(0, 0, 0, 0.35);
    pointer-events: all;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ─── MODAL ─── */
.tracking-modal {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
    transform: translateY(12px);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.15s ease;
}

.tracking-modal-overlay--visible .tracking-modal {
    transform: translateY(0);
    opacity: 1;
}

/* ─── HEADER ─── */
.tracking-modal__header {
    padding: 24px 24px 0;
}

.tracking-modal__header h3 {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
    color: #111;
    margin: 0;
    letter-spacing: -0.01em;
}

.tracking-modal__subtitle {
    font-size: 13px;
    color: #888;
    margin: 6px 0 0;
    font-weight: 400;
}

.tracking-modal__hint {
    font-size: 12px;
    color: #d97706;
    margin: 8px 0 0;
    font-weight: 500;
    line-height: 1.4;
}

/* ─── BODY ─── */
.tracking-modal__body {
    padding: 16px 24px 0;
}

.tracking-modal__textarea {
    width: 100%;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
    resize: none;
    min-height: 64px;
    max-height: 160px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    background: #fafafa;
    color: #222;
    box-sizing: border-box;
}

.tracking-modal__textarea:focus {
    outline: none;
    border-color: #999;
    box-shadow: none;
    background: #fff;
}

.tracking-modal__textarea--highlight {
    border-color: #e5a00d;
    background: #fffbf0;
}

.tracking-modal__textarea--highlight:focus {
    border-color: #d97706;
}

.tracking-modal__counter {
    text-align: right;
    font-size: 11px;
    color: #bbb;
    margin-top: 4px;
}

/* ─── FOOTER ─── */
.tracking-modal__footer {
    display: flex;
    gap: 8px;
    padding: 16px 24px 20px;
    justify-content: flex-end;
}

.tracking-modal__btn {
    padding: 7px 18px;
    border-radius: 8px;
    border: none;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease;
    font-family: inherit;
    letter-spacing: -0.01em;
}

.tracking-modal__btn:active {
    opacity: 0.8;
}

.tracking-modal__btn--skip {
    background: transparent;
    color: #888;
}

.tracking-modal__btn--skip:hover {
    background: #f5f5f5;
}

.tracking-modal__btn--save {
    background: #111;
    color: #fff;
}

.tracking-modal__btn--save:hover {
    background: #333;
}

/* ─── QR EN IMPRESION ─── */
.tracking-qr-print {
    display: flex;
    align-items: center;
    justify-content: center;
}

.tracking-qr-print canvas,
.tracking-qr-print img {
    width: 100% !important;
    height: 100% !important;
}

/* ─── DARK THEME ─── */
[data-theme="dark"] .tracking-modal,
.dark-theme .tracking-modal {
    background: #1c1c1e;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .tracking-modal__header h3,
.dark-theme .tracking-modal__header h3 {
    color: #f0f0f0;
}

[data-theme="dark"] .tracking-modal__subtitle,
.dark-theme .tracking-modal__subtitle {
    color: #777;
}

[data-theme="dark"] .tracking-modal__textarea,
.dark-theme .tracking-modal__textarea {
    background: #2c2c2e;
    border-color: #3a3a3c;
    color: #f0f0f0;
}

[data-theme="dark"] .tracking-modal__textarea:focus,
.dark-theme .tracking-modal__textarea:focus {
    background: #333;
    border-color: #555;
}

[data-theme="dark"] .tracking-modal__btn--skip,
.dark-theme .tracking-modal__btn--skip {
    color: #777;
}

[data-theme="dark"] .tracking-modal__btn--skip:hover,
.dark-theme .tracking-modal__btn--skip:hover {
    background: #2c2c2e;
}

[data-theme="dark"] .tracking-modal__btn--save,
.dark-theme .tracking-modal__btn--save {
    background: #f0f0f0;
    color: #111;
}
