/* Fase 10.5 — CSS verbatim de los bloques de estilo de Pages/Exchange/Layout/CasaCambioLayout.razor. Igual que hoy, es global mientras el componente está en pantalla:
   se enlaza con <link> donde estaba el bloque. Cambios: @@ → @ y capas D-51. */
.cc-shell {
    --cc-esmeralda: #0F6B4C;
    --cc-esmeralda-deep: #0A4F38;
    --cc-esmeralda-light: #4CA37F;
    --cc-esmeralda-pale: #DFF3EA;
    --cc-esmeralda-subtle: #F2FAF6;
    --cc-ink: #1F2E27;
    --cc-muted: #5C6D64;
    --cc-border: #D7E6DE;
    min-height: 100vh;
    background: var(--cc-esmeralda-subtle);
    font-family: 'Segoe UI', system-ui, sans-serif;
    color: var(--cc-ink);
}

.cc-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .65rem 1.25rem;
    background: linear-gradient(120deg, var(--cc-esmeralda-deep), var(--cc-esmeralda));
    color: #fff;
    position: sticky;
    top: 0;
    z-index: calc(var(--z-desplegable) - 10) /* D-51 (era 1000): topbar fijo, bajo desplegables y modales */;
    box-shadow: 0 2px 10px rgba(10, 79, 56, .18);
}

.cc-topbar-brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    cursor: pointer;
}

.cc-topbar-mark {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: rgba(255,255,255,.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.cc-topbar-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

    .cc-topbar-text strong {
        font-size: .95rem;
        font-weight: 700;
    }

    .cc-topbar-text span {
        font-size: .72rem;
        opacity: .85;
    }

.cc-topbar-right {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.cc-topbar-user {
    font-size: .85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: .4rem;
    background: rgba(255,255,255,.12);
    padding: .35rem .75rem;
    border-radius: 999px;
}

.cc-topbar-back, .cc-topbar-logout {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: none;
    background: rgba(255,255,255,.15);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease;
}

    .cc-topbar-back:hover, .cc-topbar-logout:hover {
        background: rgba(255,255,255,.28);
    }

.cc-topbar-erp {
    width: auto;
    padding: 0 12px;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
}

.cc-topbar-lang {
    height: 34px;
    padding: 0 .7rem;
    border-radius: 8px;
    border: none;
    background: rgba(255,255,255,.15);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    font-size: .82rem;
    font-weight: 700;
    transition: background .15s ease;
}

    .cc-topbar-lang:hover {
        background: rgba(255,255,255,.28);
    }

    .cc-topbar-lang:disabled {
        opacity: .7;
        cursor: default;
    }

.cc-body {
    padding: 1rem 1.25rem 2rem;
}

@media (max-width: 700px) {
    .cc-topbar-text span {
        display: none;
    }

    .cc-topbar-user {
        display: none;
    }
}

/* ============================================================
       ESTILOS COMPARTIDOS DE MÓDULO — viven acá (y no en cada modal o
       página por separado) porque CasaCambioLayout es el ÚNICO
       componente garantizado de estar siempre presente en cualquier
       página del módulo. Un  dentro de un modal condicional
       (@if / else if) solo llega al DOM si ESE modal llega a
       renderizarse — si nunca se dispara en la sesión, sus clases
       jamás se cargan, aunque otro componente las use. Por eso todo lo
       reutilizable (modal, tabla, botones, filtros, tarjetas) va acá.
       ============================================================ */

.cc-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 46, 39, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal) /* D-51 (era 3000) */;
    padding: 1rem;
}

.cc-modal {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 50px rgba(10, 79, 56, .25);
    overflow: hidden;
}

.cc-modal-sm {
    max-width: 420px;
}

.cc-modal-lg {
    max-width: 620px;
}

.cc-modal-xl {
    max-width: 900px;
}

.cc-modal-header {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(120deg, #0A4F38, #0F6B4C);
    color: #fff;
}

    .cc-modal-header h3 {
        margin: 0;
        font-size: 1.02rem;
        font-weight: 700;
    }

.cc-modal-body {
    padding: 1.15rem 1.25rem;
    max-height: 70vh;
    overflow-y: auto;
}

.cc-modal-footer {
    padding: .9rem 1.25rem 1.15rem;
    display: flex;
    justify-content: flex-end;
    gap: .6rem;
}

.cc-field {
    margin-bottom: .9rem;
}

.cc-field-inline {
    max-width: 320px;
}

.cc-field label {
    display: block;
    font-size: .78rem;
    font-weight: 700;
    color: #5C6D64;
    text-transform: uppercase;
    letter-spacing: .03em;
    margin-bottom: .3rem;
}

.cc-select, .cc-input {
    width: 100%;
    padding: .55rem .7rem;
    border: 1px solid #D7E6DE;
    border-radius: 8px;
    font-size: .92rem;
    color: #1F2E27;
    background: #fff;
}

    .cc-select:focus, .cc-input:focus {
        outline: none;
        border-color: #4CA37F;
        box-shadow: 0 0 0 3px rgba(76,163,127,.18);
    }

.cc-readonly {
    padding: .55rem .7rem;
    border-radius: 8px;
    background: #F2FAF6;
    border: 1px dashed #D7E6DE;
    font-size: .92rem;
    font-weight: 600;
    color: #0A4F38;
}

.cc-modal-error {
    color: #b5533c;
    font-size: .82rem;
    font-weight: 600;
    margin: .5rem 0 0;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.cc-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    border: none;
    border-radius: 8px;
    padding: .6rem 1.3rem;
    font-weight: 700;
    font-size: .88rem;
    cursor: pointer;
    transition: filter .15s ease;
}

    .cc-btn:hover {
        filter: brightness(.95);
    }

    .cc-btn:disabled {
        opacity: .6;
        cursor: default;
    }

.cc-btn-primary {
    background: #0F6B4C;
    color: #fff;
}

.cc-btn-danger {
    background: #b5533c;
    color: #fff;
}

.cc-btn-outline {
    background: #fff;
    border: 1px solid #D7E6DE;
    color: #1F2E27;
}

    .cc-btn-outline:hover {
        border-color: #4CA37F;
        color: #0A4F38;
    }

.cc-btn-sm {
    padding: .4rem .8rem;
    font-size: .8rem;
}

.cc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}

    .cc-table th {
        text-align: left;
        color: #5C6D64;
        font-size: .74rem;
        text-transform: uppercase;
        letter-spacing: .03em;
        padding: .5rem .5rem;
        border-bottom: 2px solid #D7E6DE;
        white-space: nowrap;
    }

    .cc-table td {
        padding: .55rem .5rem;
        border-bottom: 1px solid #D7E6DE;
        vertical-align: middle;
        white-space: nowrap;
    }

    .cc-table tbody tr:hover {
        background: #F2FAF6;
    }

.cc-table-wrap {
    overflow-x: auto;
}

.cc-text-right {
    text-align: right;
}

.cc-num {
    font-variant-numeric: tabular-nums;
}

.cc-muted {
    color: #5C6D64;
}

.cc-moneda-code {
    display: inline-block;
    min-width: 38px;
    font-weight: 700;
    color: #0A4F38;
    background: #DFF3EA;
    border-radius: 6px;
    padding: .1rem .4rem;
    margin-right: .4rem;
    font-size: .78rem;
}

.cc-input-num {
    width: 130px;
    padding: .4rem .55rem;
    border: 1px solid #D7E6DE;
    border-radius: 7px;
    text-align: right;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

    .cc-input-num:focus {
        outline: none;
        border-color: #4CA37F;
        box-shadow: 0 0 0 3px rgba(76,163,127,.18);
    }

.cc-empty {
    text-align: center;
    color: #5C6D64;
    padding: 1.2rem 0;
}

.cc-pill {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .65rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
}

.cc-pill-open {
    background: #DFF3EA;
    color: #0A4F38;
}

.cc-pill-closed {
    background: #f5e2da;
    color: #b5533c;
}

.cc-pill-neutral {
    background: #F2FAF6;
    color: #5C6D64;
    border: 1px solid #D7E6DE;
}

.cc-card {
    background: #fff;
    border: 1px solid #D7E6DE;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(10,79,56,.06);
    overflow: hidden;
}

.cc-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    padding: .85rem 1.1rem;
    border-bottom: 1px solid #D7E6DE;
}

    .cc-card-head h2 {
        margin: 0;
        font-size: 1rem;
        font-weight: 700;
        color: #0A4F38;
    }

.cc-card-body {
    padding: 1.1rem;
}

.cc-filters {
    display: flex;
    gap: .7rem;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 1rem;
}

    .cc-filters .cc-field {
        margin-bottom: 0;
        min-width: 150px;
    }

        .cc-filters .cc-field.cc-grow {
            flex: 1;
            min-width: 200px;
        }

.cc-stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: .75rem;
    margin-bottom: 1rem;
}

.cc-stat-tile {
    background: #fff;
    border: 1px solid #D7E6DE;
    border-radius: 12px;
    padding: .85rem 1rem;
}

    .cc-stat-tile .cc-lbl {
        font-size: .72rem;
        color: #5C6D64;
        text-transform: uppercase;
        letter-spacing: .03em;
    }

    .cc-stat-tile .cc-val {
        font-size: 1.3rem;
        font-weight: 700;
        font-family: inherit;
        font-variant-numeric: tabular-nums;
        margin-top: .2rem;
    }

        .cc-stat-tile .cc-val.cc-buy {
            color: #0A4F38;
        }

        .cc-stat-tile .cc-val.cc-sell {
            color: #b5533c;
        }

.cc-screen-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

    .cc-screen-head h1 {
        font-size: 1.3rem;
        font-weight: 700;
        color: #0A4F38;
        margin: 0;
    }

    .cc-screen-head .cc-sub {
        font-size: .85rem;
        color: #5C6D64;
        margin-top: .15rem;
    }

.cc-inv-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .85rem;
}

.cc-inv-tile {
    background: #fff;
    border: 1px solid #D7E6DE;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

    .cc-inv-tile .cc-code {
        font-size: .74rem;
        color: #5C6D64;
        text-transform: uppercase;
        letter-spacing: .04em;
    }

    .cc-inv-tile .cc-amt {
        font-family: inherit;
        font-weight: 700;
        font-size: 1.25rem;
        margin-top: .3rem;
        font-variant-numeric: tabular-nums;
        color: #0A4F38;
    }

@media (max-width: 900px) {
    .cc-inv-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.cc-own-buy {
    color: #0A4F38;
    font-weight: 700;
}

.cc-own-sell {
    color: #b5533c;
    font-weight: 700;
}
/* [fix 2026-10-04] Banderas locales (DivisaBandera) — compartidas por todo el módulo */
.dv-flag { display: inline-block; vertical-align: middle; object-fit: cover; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.12); flex: none; }
.dv-flag-fallback { display: inline-block; text-align: center; color: #4CA37F; flex: none; }
