/* ─────────────────────────────────────────────────────────────────
   Tesla Billing Portal — scoped styles
   ───────────────────────────────────────────────────────────────── */

.tesla-page { font-family: 'Outfit', sans-serif; }

/* ── PAGE HEADER ─────────────────────────────────────────────── */
.tesla-ph {
    background: #eaeae8;
    padding: 11px 28px;
    border-bottom: 1px solid #d6d6d4;
    text-align: center;
}
.tesla-ph h2 {
    color: #c41230;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0;
}

/* ── STAT CARDS ──────────────────────────────────────────────── */
.tesla-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 11px;
    padding: 14px 14px 0;
    flex-shrink: 0;
}
.tesla-stat {
    background: #fff;
    border: 1px solid #e4e4e2;
    border-radius: 10px;
    padding: 13px 16px;
}
.tesla-stat-lbl {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .06em;
    color: #9a9a98;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.tesla-stat-val {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
}
.tsv-def { color: #1a1a18; }
.tsv-pur { color: #5a4b9e; }
.tsv-grn { color: #16a34a; }
.tsv-red { color: #c41230; }

/* ── FILE BAR ────────────────────────────────────────────────── */
.tesla-file-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: #f8f8f6;
    border-bottom: 1px solid #e4e4e2;
    font-size: 12.5px;
    color: #6a6a68;
    flex-shrink: 0;
}
.tesla-file-bar b { color: #1a1a18; font-weight: 600; }

/* ── SEARCH CARD ─────────────────────────────────────────────── */
.tesla-search-card {
    background: #fff;
    border: 1px solid #e4e4e2;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.tesla-v-div {
    width: 1px;
    height: 24px;
    background: #e4e4e2;
    flex-shrink: 0;
}

/* ── EMPTY STATE ─────────────────────────────────────────────── */
.tesla-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e4e4e2;
    border-radius: 10px;
    padding: 60px 20px;
    min-height: 220px;
    color: #9a9a98;
    flex-grow: 1;
}
.tesla-empty-lbl  { font-size: 14px; font-weight: 600; color: #6a6a68; margin-top: 12px; margin-bottom: 4px; }
.tesla-empty-hint { font-size: 13px; }

/* ── UPLOAD DROP ZONE (main page empty state) ────────────────── */
.tesla-dz-wrap {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 44px 20px;
    flex-grow: 1;
}
.tesla-dz {
    width: 520px;
    max-width: 100%;
    background: #fff;
    border: 2px dashed #ccccc9;
    border-radius: 14px;
    padding: 52px 40px 44px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
}
.tesla-dz:hover { border-color: #5a4b9e; background: #f9f7ff; }
.tesla-dz-icon {
    width: 60px;
    height: 60px;
    background: #ede9fe;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}
.tesla-dz-title { font-size: 17px; font-weight: 600; color: #1a1a18; margin-bottom: 6px; }
.tesla-dz-sub   { font-size: 13.5px; color: #6a6a68; margin-bottom: 22px; }
.tesla-dz-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #5a4b9e;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 22px;
    font-size: 14px;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    pointer-events: none;
}
.tesla-dz-fmt { font-size: 12px; color: #9a9a98; margin-top: 14px; }

/* ── CUSTOM MODAL OVERLAY ────────────────────────────────────── */
.tesla-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}
.tesla-modal-box {
    background: #fff;
    border-radius: 14px;
    width: 460px;
    max-width: 90vw;
    box-shadow: 0 24px 80px rgba(0,0,0,.18);
    overflow: hidden;
}
.tesla-modal-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px 14px;
    border-bottom: 1px solid #f0f0ee;
}
.tesla-modal-hdr h5 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: #1a1a18;
}
.tesla-modal-close {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    color: #9a9a98;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background .15s, color .15s;
}
.tesla-modal-close:hover { background: #f0f0ee; color: #1a1a18; }
.tesla-modal-body  { padding: 18px 22px; }
.tesla-modal-ftr   {
    padding: 12px 22px 18px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    border-top: 1px solid #f0f0ee;
}

/* ── MODAL DROP ZONE ─────────────────────────────────────────── */
.tesla-modal-dz {
    border: 2px dashed #ccccc9;
    border-radius: 12px;
    padding: 36px 30px;
    text-align: center;
    cursor: pointer;
    background: #fff;
    transition: border-color .2s, background .2s;
    margin-bottom: 4px;
}
.tesla-modal-dz:hover { border-color: #5a4b9e; background: #f9f7ff; }
.tesla-modal-dz-icon {
    width: 50px;
    height: 50px;
    background: #ede9fe;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

/* ── MODAL BUTTONS ───────────────────────────────────────────── */
.tesla-btn-cancel {
    padding: 8px 16px;
    border: 1px solid #e0e0de;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    font-family: 'Outfit', sans-serif;
    color: #1a1a18;
    transition: background .15s;
}
.tesla-btn-cancel:hover { background: #f3f3f1; }
.tesla-btn-primary {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: #5a4b9e;
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background .15s;
}
.tesla-btn-primary:hover { background: #4a3c8e; }
.tesla-btn-danger {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: #c41230;
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background .15s;
}
.tesla-btn-danger:hover { background: #a60f28; }

/* ── BUTTON COLOR OVERRIDES (SfButton inside tesla-page) ─────── */
.tesla-page .e-btn.e-primary {
    background: #5a4b9e !important;
    border-color: #5a4b9e !important;
    color: #fff !important;
}
.tesla-page .e-btn.e-primary:hover {
    background: #4a3c8e !important;
    border-color: #4a3c8e !important;
}
.tesla-page .e-btn.e-danger {
    background: #c41230 !important;
    border-color: #c41230 !important;
    color: #fff !important;
}
.tesla-page .e-btn.e-danger:hover {
    background: #a60f28 !important;
    border-color: #a60f28 !important;
}

/* ── SYNCFUSION TAB ACTIVE INDICATOR ─────────────────────────── */
.tesla-page .e-tab .e-tab-header .e-indicator {
    background: #5a4b9e !important;
}
.tesla-page .e-tab .e-tab-header .e-toolbar-item.e-active .e-tab-text {
    color: #5a4b9e !important;
}

/* ── ESTADO PILLS ─────────────────────────────────────────────── */
.tesla-status-ok {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    background: #e8f5ee;
    color: #16a34a;
    font-weight: 600;
    font-size: 12px;
}
.tesla-status-error {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    background: #fde8ec;
    color: #c41230;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    user-select: none;
}
.tesla-status-error:hover { background: #fbd5dc; }

/* ── BOTONES DE ÍCONO EN CELDA ────────────────────────────────── */
.tesla-icon-btn {
    width: 26px;
    height: 26px;
    border: 1px solid #e4e4e2;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    padding: 0;
    margin: 0 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, border-color .15s;
}
.tesla-icon-btn:hover { background: #f9f7ff; border-color: #5a4b9e; }

/* ── MODAL GRANDE PARA JSON ───────────────────────────────────── */
.tesla-modal-json-box {
    width: 720px;
    max-width: 92vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}
.tesla-modal-json-box .tesla-modal-body {
    overflow: auto;
    max-height: 65vh;
    padding: 0;
}

/* ── VISOR JSON (syntax highlight) ───────────────────────────── */
.tesla-json-viewer {
    background: #fafafa;
    color: #1a1a18;
    border: none;
    border-radius: 0;
    padding: 16px 20px;
    margin: 0;
    font-family: 'Cascadia Code', 'Consolas', 'Menlo', monospace;
    font-size: 12.5px;
    line-height: 1.55;
    white-space: pre;
    overflow: auto;
    min-height: 120px;
}
.tesla-json-key    { color: #5a4b9e; font-weight: 600; }
.tesla-json-string { color: #16a34a; }
.tesla-json-number { color: #c41230; }
.tesla-json-bool   { color: #b8860b; font-weight: 600; }
.tesla-json-null   { color: #9a9a98; font-style: italic; }
.tesla-json-punct  { color: #6a6a68; }

/* ── MODAL DE ERRORES ─────────────────────────────────────────── */
.tesla-err-shipment {
    border: 1px solid #f0f0ee;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
    background: #fff;
}
.tesla-err-shipment-hdr {
    font-size: 13px;
    font-weight: 700;
    color: #1a1a18;
    margin-bottom: 8px;
}
.tesla-err-charge-hdr {
    font-size: 11.5px;
    font-weight: 600;
    color: #6a6a68;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin: 8px 0 4px;
}
.tesla-err-item {
    display: flex;
    gap: 8px;
    padding: 6px 8px;
    background: #fdf6f7;
    border-left: 3px solid #c41230;
    border-radius: 4px;
    margin-bottom: 4px;
    font-size: 12.5px;
    color: #1a1a18;
    align-items: flex-start;
}
.tesla-err-code {
    background: #c41230;
    color: #fff;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
    align-self: flex-start;
    white-space: nowrap;
}
