/* ============================================================
   TRACKING LINK MODAL — Painel do Gerente
   ============================================================ */

/* Botão padrão (pode customizar para combinar com seu tema) */
.btn-track-share {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #25d366;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}
.btn-track-share:hover {
    background: #1ebe57;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(37,211,102,.4);
}
.btn-track-share:active { transform: translateY(0); }

/* ════════════════════════════════════════════
   OVERLAY + MODAL
   ════════════════════════════════════════════ */
.tlm-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity .2s;
}
.tlm-overlay.tlm-open {
    display: flex;
    opacity: 1;
    animation: tlmFadeIn .2s;
}
@keyframes tlmFadeIn { from { opacity: 0; } to { opacity: 1; } }

.tlm-content {
    background: #fff;
    border-radius: 16px;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,.25);
    animation: tlmSlideUp .25s;
}
@keyframes tlmSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* HEADER */
.tlm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid #e5e7eb;
}
.tlm-header h2 {
    margin: 0;
    font-size: 18px;
    color: #111827;
}
.tlm-close {
    background: none; border: none;
    font-size: 28px;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    width: 32px; height: 32px;
    border-radius: 8px;
    transition: all .15s;
}
.tlm-close:hover { background: #f3f4f6; color: #111827; }

/* BODY */
.tlm-body { padding: 20px; }

.tlm-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
}
.tlm-info-row:last-of-type { border-bottom: none; }
.tlm-info-label { color: #6b7280; }
.tlm-info-value { color: #111827; font-weight: 500; }

/* LINK BOX */
.tlm-link-box { margin-top: 16px; }
.tlm-link-box label,
.tlm-preview label {
    display: block;
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 6px;
}

.tlm-link-input-wrap {
    display: flex;
    gap: 6px;
}
.tlm-link-input-wrap input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    font-family: ui-monospace, monospace;
    color: #2563eb;
    background: #f9fafb;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tlm-link-input-wrap input:focus { outline: 2px solid #2563eb; border-color: #2563eb; }

.tlm-copy-btn {
    padding: 0 14px;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all .15s;
}
.tlm-copy-btn:hover { background: #f3f4f6; border-color: #d1d5db; }
.tlm-copy-btn.tlm-copied { background: #d1fae5; border-color: #10b981; color: #065f46; }

/* PREVIEW */
.tlm-preview { margin-top: 16px; }
.tlm-preview-bubble {
    background: #dcf8c6;
    color: #303030;
    padding: 12px 14px;
    border-radius: 12px 12px 12px 2px;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid #c5e6a8;
    word-break: break-word;
    white-space: normal;
}

/* ACTIONS */
.tlm-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.tlm-btn {
    flex: 1;
    min-width: 140px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}
.tlm-btn-whatsapp {
    background: #25d366;
    color: #fff;
}
.tlm-btn-whatsapp:hover {
    background: #1ebe57;
    box-shadow: 0 4px 12px rgba(37,211,102,.35);
    transform: translateY(-1px);
}
.tlm-btn-secondary {
    background: #f3f4f6;
    color: #374151;
}
.tlm-btn-secondary:hover { background: #e5e7eb; }
.tlm-btn-icon { font-size: 16px; }

/* STATS */
.tlm-stats {
    margin-top: 16px;
    padding: 10px 12px;
    background: #eff6ff;
    color: #1e40af;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
}

/* LOADING / ERROR */
.tlm-loading {
    padding: 40px 20px;
    text-align: center;
}
.tlm-spinner {
    width: 40px; height: 40px;
    margin: 0 auto 12px;
    border: 4px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: tlmSpin .8s linear infinite;
}
@keyframes tlmSpin { to { transform: rotate(360deg); } }
.tlm-loading p { color: #6b7280; font-size: 14px; margin: 0; }

.tlm-error {
    padding: 30px 20px;
    text-align: center;
}
.tlm-error-icon { font-size: 48px; margin-bottom: 12px; }
.tlm-error h3 { margin: 0 0 8px; color: #991b1b; }
.tlm-error p { color: #6b7280; margin: 0 0 16px; }

/* MOBILE */
@media (max-width: 480px) {
    .tlm-actions { flex-direction: column; }
    .tlm-btn { width: 100%; }
}
