﻿/* ── TOKENS ──────────────────────────────────────────────── */
:root {
    --bg: #f7f8fa;
    --surface: #ffffff;
    --border: #e4e7ed;
    --text-primary: #1a1d23;
    --text-muted: #6b7280;
    --accent: #2563eb;
    --accent-light: #eff4ff;
    --success: #16a34a;
    --success-light: #f0fdf4;
    --warning: #d97706;
    --warning-light: #fffbeb;
    --radius: 10px;
    --shadow: 0 1px 4px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04);
    --gap: 16px;
}

body {
    background: var(--bg);
    font-family: 'DM Sans', sans-serif;
}


/* ── CARDS ───────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 24px;
    margin-bottom: var(--gap);
}

.card-title {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 14px;
}


/* ── SELECTOR BUTTONS ────────────────────────────────────── */
.sel-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sel-btn {
    display: inline-flex;
    align-items: center;
    padding: 7px 16px;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
    white-space: nowrap;
}

    .sel-btn:hover {
        border-color: var(--accent);
        color: var(--accent);
        background: var(--accent-light);
    }

    .sel-btn.active {
        background: var(--accent);
        border-color: var(--accent);
        color: #fff;
        box-shadow: 0 2px 8px rgba(37,99,235,.25);
    }


/* ── ACCORDION OVERRIDE ──────────────────────────────────── */
.rz-accordion-header {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    color: var(--text-primary) !important;
    padding: 14px 20px !important;
    box-shadow: var(--shadow) !important;
}

.rz-accordion-content {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    /* 🔥 permite que OpenSeadragon escape */
    overflow: visible !important;
}


/* ── SUMMARY BADGES ──────────────────────────────────────── */
.summary-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-region {
    background: #eff6ff;
    color: #1d4ed8;
}

.badge-client {
    background: #f0fdf4;
    color: #15803d;
}

.badge-equipo {
    background: #faf5ff;
    color: #7e22ce;
}

.badge-liner {
    background: #fff7ed;
    color: #c2410c;
}

.badge-row {
    background: #f0fdfa;
    color: #0f766e;
}


/* ── DATA GRID ───────────────────────────────────────────── */
.rz-datatable {
    border-radius: var(--radius);
    overflow: hidden;
}

.rz-datatable-thead .rz-column-title {
    font-size: 11px !important;
    font-weight: 600 !important;
    letter-spacing: .07em !important;
    text-transform: uppercase !important;
    color: var(--text-muted) !important;
}


/* ── ACTION BUTTON ───────────────────────────────────────── */
.btn-ver {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 14px;
    border-radius: 7px;
    background: var(--accent-light);
    border: 1px solid #bfdbfe;
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

    .btn-ver:hover {
        background: var(--accent);
        color: #fff;
    }


/* ── SEARCH BUTTON ───────────────────────────────────────── */
.btn-search {
    width: 100%;
    padding: 11px 0;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

    .btn-search:hover {
        background: #1d4ed8;
    }


/* ── SVG PANEL (FIXED FOR OPENSEADRAGON) ─────────────────── */
.svg-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 16px;
    position: relative;
    /* 🔥 antes era hidden */
    overflow: visible;
}


/* ── SVG VIEWPORT (FIXED) ────────────────────────────────── */
.svg-viewport {
    width: 100%;
    height: 420px;
    display: flex;
    justify-content: center;
    align-items: center;
    /* 🔥 antes era hidden */
    overflow: visible;
    background: #fafafa;
    position: relative;
}


/* ── SVG INNER (STACKING CONTEXT FIX) ────────────────────── */
.svg-inner {
    /* 🔥 elimina stacking context */
    transform: none !important;
    transform-origin: center center;
    display: inline-block;
    width: 100%;
}

    .svg-inner svg {
        max-width: 100%;
        max-height: 100%;
        display: block;
    }


/* ── ZOOM CONTROLS ───────────────────────────────────────── */
.zoom-controls {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 6px;
    z-index: 10;
}


/* ── LOADING OVERLAY ─────────────────────────────────────── */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}


/* ── OPENSEADRAGON FULLPAGE MODE (FINAL FIX) ─────────────── */
.openseadragon-container.fullpage {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 999999 !important;
    background: black !important;
}
