/* Asegura visibilidad de pestañas personalizadas */
.tab-content .tab-pane {
    display: none;
}

.tab-content .tab-pane.active {
    display: block;
}

/* Add this at the top of your CSS file */
html {
    font-size: 80%;
}

body {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    font-family: 'Poppins', sans-serif !important;
}

/* Forzar estilo oscuro consistente del modal y evitar superposición */
.modal-backdrop.show {
    opacity: 0.6 !important;
}

.modal {
    z-index: 2000 !important;
}

.modal-dialog {
    z-index: 2001 !important;
}

.modal-content {
    background-color: var(--bg-secondary) !important;
    /* fuerza fondo oscuro */
    color: var(--text-primary) !important;
    border: 1px solid rgba(128, 255, 0, 0.2) !important;
    border-radius: 12px !important;
}

.modal-header,
.modal-footer {
    background-color: var(--bg-secondary) !important;
    border-color: rgba(128, 255, 0, 0.1) !important;
}

.btn-close {
    filter: invert(1);
}

.alert.alert-contrast {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(22, 27, 38, 0.94);
    color: #f8fafc !important;
    font-weight: 600;
    letter-spacing: 0.02em;
    box-shadow: 0 18px 35px rgba(10, 12, 30, 0.45);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.alert.alert-contrast.alert-danger {
    border-color: rgba(248, 113, 113, 0.65);
    background: rgba(127, 29, 29, 0.95);
}

.alert.alert-contrast.alert-info {
    border-color: rgba(96, 165, 250, 0.65);
    background: rgba(15, 48, 85, 0.95);
}

.alert.alert-contrast.alert-warning {
    border-color: rgba(251, 191, 36, 0.65);
    background: rgba(92, 58, 8, 0.95);
    color: #fef3c7 !important;
}

.alert.alert-contrast.alert-success {
    border-color: rgba(74, 222, 128, 0.55);
    background: rgba(20, 83, 45, 0.95);
    color: #ecfdf5 !important;
}

/* Alertas en pantallas auth / plataforma: legibles sobre fondo oscuro */
.login-card .alert,
.login-container .card .alert,
.platform-admin .alert,
.legal-card .alert {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #f8fafc !important;
    font-weight: 600;
    letter-spacing: 0.02em;
    box-shadow: 0 12px 28px rgba(10, 12, 30, 0.35);
}

.login-card .alert-danger,
.login-container .card .alert-danger,
.platform-admin .alert-danger,
.legal-card .alert-danger {
    border-color: rgba(248, 113, 113, 0.65) !important;
    background: rgba(127, 29, 29, 0.95) !important;
    color: #fecaca !important;
}

.login-card .alert-info,
.login-container .card .alert-info,
.platform-admin .alert-info,
.legal-card .alert-info {
    border-color: rgba(96, 165, 250, 0.65) !important;
    background: rgba(15, 48, 85, 0.95) !important;
    color: #dbeafe !important;
}

.login-card .alert-warning,
.login-container .card .alert-warning,
.platform-admin .alert-warning,
.legal-card .alert-warning {
    border-color: rgba(251, 191, 36, 0.65) !important;
    background: rgba(92, 58, 8, 0.95) !important;
    color: #fef3c7 !important;
}

.login-card .alert-success,
.login-container .card .alert-success,
.platform-admin .alert-success,
.legal-card .alert-success {
    border-color: rgba(74, 222, 128, 0.55) !important;
    background: rgba(20, 83, 45, 0.95) !important;
    color: #ecfdf5 !important;
}

.login-card .alert-secondary,
.login-container .card .alert-secondary,
.legal-card .alert-secondary {
    border-color: rgba(148, 163, 184, 0.45) !important;
    background: rgba(30, 41, 59, 0.95) !important;
    color: #e2e8f0 !important;
}

.modal .form-control,
.modal .form-select {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
}

.modal label,
.modal .form-label {
    color: var(--text-primary) !important;
}

.modal ::placeholder {
    color: rgba(255, 255, 255, 0.55) !important;
}

/* Fix CSS var scope */
:root {
    /* Fondos coti.bot: negro cálido con superficies elevadas */
    --bg-primary: #10100f;
    /* Fondo principal (negro cálido) */
    --bg-secondary: #1a1a1a;
    /* Cards / superficies elevadas */
    --bg-dark: #141413;
    /* Fondo de tablas/inputs */
    --bg-light: #2a2a2a;
    /* Inputs/selects elevados */
    --bg-darker: #0a0a0a;
    /* Fondo más oscuro */

    /* Marca / primario: verde lima flúor (coti.bot) */
    --accent-primary: #80ff00;
    --accent-hover: #70ee00;
    --accent: var(--accent-primary);
    --accent-light: rgba(128, 255, 0, 0.12);
    --accent-dark: #66cc00;
    --accent-soft: rgba(128, 255, 0, 0.30);

    /* Acentos: cian aqua + azul info */
    --accent-cyan: #00e5ff;
    --accent-cyan-soft: rgba(0, 229, 255, 0.30);
    --accent-blue: #38bdf8;
    --accent-blue-soft: rgba(0, 229, 255, 0.30);

    /* Texto que va sobre superficies de marca (verde/cian) */
    --on-accent: #0a0f02;

    /* Indicadores */
    --success: #80ff00;
    /* Verde lima para valores positivos (ganancias/ingresos) */
    --danger: #ff5c7a;
    /* Rosa/rojo para valores negativos (pérdidas/deudas) */
    --warning: #f5b74e;

    /* Texto */
    --text-primary: #ffffff;
    /* Texto principal */
    --text-secondary: #b3b3b3;
    /* Texto secundario */
    --text-color: var(--text-primary);
    --border-color: rgba(128, 255, 0, 0.14);

    /* Radios */
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
    --radius-pill: 999px;

    /* Sombras + glows neón coti */
    --shadow-sm: 0 4px 12px -6px rgba(0, 0, 0, .6);
    --shadow: 0 12px 28px -12px rgba(0, 0, 0, .6);
    --shadow-lg: 0 24px 48px -18px rgba(0, 0, 0, .7);
    --glow-green: 0 0 18px -2px rgba(128, 255, 0, .5);
    --glow-green-strong: 0 0 30px rgba(128, 255, 0, .35);
    --glow-cyan: 0 0 18px -2px rgba(0, 229, 255, .5);

    /* Gradiente de marca sutil (verde, sin cian protagonista) */
    --grad-brand: linear-gradient(120deg, #80ff00, #66cc00);
    --grad-brand-strong: linear-gradient(120deg, #80ff00, #66cc00);

    /* Movimiento */
    --transition: .2s ease;
    --transition-slow: .35s cubic-bezier(.22, 1, .36, 1);
}

/* Navigation */
.nav-tabs {
    border-bottom: 1px solid var(--border-color) !important;
}

.nav-tabs .nav-link {
    color: var(--text-secondary) !important;
    border: none !important;
    background-color: transparent !important;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0 !important;
    transition: color var(--transition), background-color var(--transition) !important;
}

.nav-tabs .nav-link:hover {
    color: var(--text-primary) !important;
    background-color: var(--accent-light) !important;
}

.nav-tabs .nav-link.active {
    background-color: var(--accent-light) !important;
    color: var(--accent-primary) !important;
    border: none !important;
    border-bottom: 2px solid var(--accent-primary) !important;
}

/* Navbar */
.navbar.navbar-expand-lg.navbar-dark.bg-primary {
    background-color: var(--bg-secondary) !important;
}

.navbar-brand,
.nav-link {
    color: var(--text-primary) !important;
}

.nav-link:hover {
    color: #ffffff !important;
}

/* Cards */
.card {
    background-color: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem !important;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.card:hover {
    border-color: var(--accent-soft) !important;
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.card-body {
    background-color: transparent !important;
}

.card-header {
    background-color: transparent !important;
    border-bottom: 1px solid var(--border-color) !important;
}

/* Forms */
.form-control,
.form-select {
    background-color: var(--bg-dark) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-sm) !important;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus,
.form-select:focus {
    background-color: var(--bg-dark) !important;
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 0 3px var(--accent-light) !important;
    color: var(--text-primary) !important;
}

.form-label {
    color: #ffffff !important;
    font-weight: 500 !important;
}

/* Select dropdown */
.form-select option {
    background-color: var(--bg-dark) !important;
    color: var(--text-primary) !important;
}


/* Buttons */
.btn {
    border-radius: var(--radius-sm) !important;
    transition: transform var(--transition), background-color var(--transition), box-shadow var(--transition), border-color var(--transition) !important;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background-image: none !important;
    background-color: var(--accent-primary) !important;
    border-color: transparent !important;
    color: var(--on-accent) !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 12px -6px rgba(128, 255, 0, .35) !important;
    transition: transform var(--transition), box-shadow var(--transition), background-color var(--transition) !important;
}

.btn-primary:hover {
    background-color: var(--accent-hover) !important;
    border-color: transparent !important;
    box-shadow: 0 6px 16px -8px rgba(128, 255, 0, .45), var(--glow-green) !important;
}

.quick-duration {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.quick-duration span {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.quick-duration .quick-btn {
    padding: 0.25rem 0.85rem;
    border-radius: 999px;
}

.pending-form .row {
    align-items: center;
}

.manual-subscription-form {
    background-color: var(--bg-dark);
    border: 1px solid rgba(128, 255, 0, 0.4);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 18px 35px rgba(10, 12, 30, 0.35);
}

.manual-subscription-form .form-label {
    color: var(--text-primary) !important;
}

.manual-subscription-form .form-select,
.manual-subscription-form .form-control {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border: 1px solid rgba(128, 255, 0, 0.4) !important;
}

.manual-subscription-form .quick-duration {
    justify-content: flex-end;
}

/* Tables */
.table {
    color: var(--text-primary) !important;
}

.table thead th {
    background-color: #2a2a2a !important;
    background-image: none !important;
    color: #e8ffd6 !important;
    font-weight: 700 !important;
    letter-spacing: .02em;
    text-transform: uppercase;
    font-size: .82em;
    border-bottom: 2px solid var(--accent-primary) !important;
}

.table tbody td {
    background-color: var(--bg-dark) !important;
    color: var(--text-primary) !important;
    border-color: rgba(128, 255, 0, 0.2) !important;
}


.tab-pane {
    color: var(--text-primary) !important;
}

/* Text colors */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: #ffffff !important;
}

.h5,
h5 {
    font-size: 1.1rem;
    margin-top: 15px;
}

p,
span,
div {
    color: var(--text-primary) !important;
}


/* Inputs placeholder */
::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* Table striped rows */
.table-striped tbody tr:nth-of-type(odd) {
    background-color: var(--bg-darker) !important;
}

.table-striped tbody tr:nth-of-type(even) {
    background-color: var(--bg-dark) !important;
}

/* Button variants */
.btn-danger {
    background-color: var(--danger) !important;
    border-color: var(--danger) !important;
    color: #ffffff !important;
}

.btn-warning {
    background-color: var(--warning) !important;
    border-color: var(--warning) !important;
    color: var(--bg-darker) !important;
}

/* Login specific */
.login-container {
    margin-top: 100px !important;
}

.login-card {
    max-width: 400px !important;
    margin: 0 auto !important;
}

.password-recovery-wrapper {
    display: none;
}

.password-recovery-wrapper.show {
    display: block;
    animation: fadeIn 0.25s ease-in-out;
}

.recovery-card {
    border: 1px solid rgba(128, 255, 0, 0.35) !important;
    background-color: var(--bg-primary) !important;
}

.password-recovery-form .form-control {
    border-color: rgba(255, 255, 255, 0.25) !important;
}

.password-recovery-form .form-label {
    font-size: 0.9rem;
    color: var(--text-primary) !important;
}

.recovery-instructions {
    font-size: 0.9rem;
    color: var(--text-secondary) !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chart containers */
canvas {
    background-color: var(--bg-dark) !important;
    border: 1px solid rgba(128, 255, 0, 0.25) !important;
    border-radius: 10px !important;
    padding: 10px !important;
}

/* Force all text to be white by default */
* {
    color: var(--text-primary) !important;
}

/* Tables - specific overrides for visibility */
.table {
    background-color: var(--bg-dark) !important;
}

.table tbody tr {
    background-color: var(--bg-light) !important;
}

.table tbody td {
    color: white !important;
}

/* Table striping */
.table-striped>tbody>tr:nth-of-type(odd) {
    background-color: var(--bg-dark) !important;
}

.table-striped>tbody>tr:nth-of-type(even) {
    background-color: var(--bg-light) !important;
}

/* Cards */
.card {
    background-color: var(--bg-secondary) !important;
    border: 1px solid rgba(128, 255, 0, 0.22) !important;
}

.card-header {
    background-color: rgba(128, 255, 0, 0.045) !important;
    background-image: none !important;
    color: var(--text-primary) !important;
    font-weight: 700 !important;
    padding-top: 15px;
    border-bottom: 1px solid rgba(128, 255, 0, 0.30) !important;
}

/* Título de la cabecera con leve énfasis verde (acento fino) */
.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5,
.card-header h6 {
    color: var(--accent-primary) !important;
}

.card-body {
    background-color: transparent !important;
}

/* Navigation */
.navbar {
    background-color: rgba(26, 26, 26, 0.85) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(128, 255, 0, 0.14) !important;
}

.nav-link {
    color: white !important;
}

/* Test border to verify CSS is loading */
.test-border {
    border: 5px solid var(--accent) !important;
}

/* Client search results styling */
.hover-bg-accent:hover {
    background-color: var(--accent) !important;
    cursor: pointer;
}

#clientSearchResults {
    background-color: #1a1a1a !important;
    border: 1px solid var(--accent-primary);
    border-radius: 0.5rem;
    padding: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    position: absolute;
    z-index: 9999;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
}

/* Ocultar el dropdown de búsqueda cuando hay un modal abierto */
.modal-open #clientSearchResults {
    display: none !important;
}

.modal-open #operationClientName {
    z-index: 0 !important;
}

.modal-open .position-relative {
    z-index: 0 !important;
}

#clientSearchResults>div {
    padding: 0.75rem 1rem;
    cursor: pointer;
    color: white !important;
    background-color: #1a1a1a !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 2px;
    font-weight: 500;
    display: block;
    width: 100%;
}

#clientSearchResults>div:hover {
    background-color: var(--accent-primary) !important;
    color: white !important;
}

/* Asegurar que el contenedor de resultados esté por encima de otros elementos */
.position-relative {
    position: relative;
    z-index: auto !important;
    /* Evita que elementos comunes queden por encima del modal */
}

#operationClientName {
    background-color: var(--bg-primary) !important;
    color: white !important;
    border: 1px solid var(--accent-primary) !important;
    position: relative;
    z-index: auto !important;
}

#operationClientName:focus {
    border-color: var(--accent-hover) !important;
    box-shadow: 0 0 0 0.2rem rgba(128, 255, 0, 0.25) !important;
}

/* Modificar el contenedor principal para usar flexbox */
.dashboard-container {
    display: flex;
    min-height: calc(100vh - 56px);
    font-size: 0.9rem;
}

/* Estilos para la navegación vertical */
.nav-tabs.vertical-tabs {
    flex: 0 0 250px;
    /* Un poco más ancho para acomodar el contenido */
    display: flex;
    flex-direction: column;
    height: 100vh;
    /* Altura completa */
    background-color: var(--bg-secondary);
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    position: fixed;
    /* Mantiene el sidebar fijo */
    left: 0;
    top: 0;
}

/* Estilos para el header del sidebar */
.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(128, 255, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header .brand {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
}

.user-section {
    padding: 0.9rem 1.2rem;
    border-bottom: 1px solid rgba(128, 255, 0, 0.1);
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* Ajustar el contenido principal */
.main-content {
    margin-left: 250px;
    width: calc(100% - 250px);
    min-height: 100vh;
    background-color: var(--bg-primary);
    padding: 1.5rem;
    font-size: 0.9rem;
}

.movements-table-wrapper {
    max-height: 360px;
    overflow-y: auto;
    overflow-x: hidden;
}

.movements-table {
    font-size: 0.85rem;
}

.movements-table th,
.movements-table td {
    white-space: nowrap;
}

.movements-table td:nth-child(6) {
    white-space: normal;
}

.operator-balance-table-wrapper {
    flex: 1;
    max-height: 360px;
    overflow-y: auto;
    overflow-x: hidden;
}

.operator-balance-table {
    font-size: 0.85rem;
}

.history-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 30px;
    padding: 0 0.6rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    color: #000000 !important;
    background: rgba(255, 255, 255, 0.2);
}

.history-badge-pending {
    background: #ffe066;
    box-shadow: 0 4px 12px rgba(255, 224, 102, 0.3);
}

.history-badge-finalized {
    background: #7eff7e;
    box-shadow: 0 4px 12px rgba(126, 255, 126, 0.3);
}

.notification-container {
    position: fixed;
    top: 80px;
    right: 24px;
    width: min(320px, 90vw);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.app-notification {
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    padding: 1rem 1.25rem;
    background: rgba(20, 25, 38, 0.95);
    border-left: 4px solid var(--accent-primary);
    color: var(--text-primary);
    animation: slideInRight 0.3s ease-out;
}

.app-notification.success {
    border-color: #2ecc71;
}

.app-notification.error {
    border-color: #e74c3c;
}

.app-notification.warning {
    border-color: #f1c40f;
}

.app-notification .title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.app-notification .message {
    font-size: 0.85rem;
    line-height: 1.4;
}

.app-notification .close-btn {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.7;
    font-size: 1rem;
    position: absolute;
    top: 6px;
    right: 12px;
    cursor: pointer;
}

.app-notification .close-btn:hover {
    opacity: 1;
}

@keyframes slideInRight {
    from {
        transform: translateX(40px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Estilos para los items del menú */
.nav-tabs.vertical-tabs .nav-item {
    margin: 0.2rem 0.8rem;
}

.nav-tabs.vertical-tabs .nav-link {
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

/* Hover state (sutil, sin saturar) */
.nav-tabs.vertical-tabs .nav-link:hover {
    background-color: rgba(128, 255, 0, 0.07);
    color: var(--text-primary) !important;
}

/* Active state — premium: superficie oscura elevada + barra verde fina + texto claro */
.nav-tabs.vertical-tabs .nav-link.active,
.nav-tabs.vertical-tabs .nav-item .nav-link.active {
    background-color: #222 !important;
    color: #eafff1 !important;
    border: none !important;
    box-shadow: inset 3px 0 0 0 var(--accent-primary),
        0 2px 8px -4px rgba(0, 0, 0, 0.5);
    font-weight: 600;
}

/* El ícono del item activo usa el verde de acento como detalle mínimo */
.nav-tabs.vertical-tabs .nav-link.active i {
    color: var(--accent-primary) !important;
}

/* Iconos en el menú */
.nav-tabs.vertical-tabs .nav-link i {
    font-size: 0.9rem;
    width: 20px;
    text-align: center;
    color: inherit;
}

/* Logout button en la parte inferior del sidebar */
.sidebar-footer {
    margin-top: auto;
    padding: 1.5rem;
    border-top: 1px solid rgba(128, 255, 0, 0.1);
}

.logout-btn {
    width: 100%;
    padding: 0.75rem;
    border-radius: 8px;
    background-color: rgba(255, 92, 122, 0.1);
    color: var(--danger);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background-color: var(--danger);
    color: white;
}

/* Cards mejorados */
.card {
    background-color: var(--bg-secondary);
    border: none !important;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: var(--bg-secondary) !important;
    border-bottom: 1px solid rgba(128, 255, 0, 0.1);
    padding: 1rem 1.25rem;
    border-radius: 12px 12px 0 0 !important;
}

.card-body {
    background-color: var(--bg-secondary) !important;
    padding: 1.25rem;
}

.card-body h5 {
    font-weight: 600;
    color: var(--text-primary);
}

.card-body form .form-label {
    font-size: 0.85rem;
}

/* Formularios mejorados */
.form-control,
.form-select {
    background-color: var(--bg-primary) !important;
    border: 1px solid rgba(128, 255, 0, 0.2) !important;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 0 3px rgba(128, 255, 0, 0.15) !important;
}

/* Botones mejorados */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--accent-primary);
    border: none;
    box-shadow: 0 4px 12px rgba(128, 255, 0, 0.3);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(128, 255, 0, 0.4);
}

.btn-danger {
    background-color: var(--danger);
    border: none;
    box-shadow: 0 4px 12px rgba(255, 92, 122, 0.3);
}

/* Tablas mejoradas */
.table {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(128, 255, 0, 0.1);
}

.table thead th {
    background-color: var(--bg-secondary) !important;
    border-bottom: 2px solid rgba(128, 255, 0, 0.1);
    padding: 0.55rem 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.table tbody td {
    padding: 0.5rem 0.7rem;
    vertical-align: middle;
}

.table.table-sm thead th,
.table.table-sm tbody td {
    padding: 0.4rem 0.6rem;
}

/* Números/montos alineados a la derecha para lectura financiera */
td.num,
th.num,
td.text-end,
th.text-end {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Navbar mejorada */
.navbar {
    background-color: var(--bg-secondary) !important;
    padding: 1rem 2rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Búsqueda de clientes mejorada */
#clientSearchResults {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    margin-top: 5px;
}

#clientSearchResults div {
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

#clientSearchResults div:hover {
    background-color: rgba(128, 255, 0, 0.1);
}

/* Espaciado y alineación */
.row {
    margin: 0 -0.75rem;
}

.col,
[class*="col-"] {
    padding: 0 0.75rem;
}

/* Scrollbars personalizados */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

/* Estilos para el campo de fecha/hora */
input[type="datetime-local"] {
    background-color: var(--bg-primary) !important;
    border: 1px solid rgba(128, 255, 0, 0.2) !important;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-primary) !important;
    transition: all 0.2s ease;
}

input[type="datetime-local"]:focus {
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 0 3px rgba(128, 255, 0, 0.15) !important;
}

/* Estilos para los estados */
#operationStatus option[value="Nuevo"] {
    color: var(--accent-primary);
}

#operationStatus option[value="Pendiente"] {
    color: #FFA500;
    /* Naranja para pendiente */
}

#operationStatus option[value="Finalizado"] {
    color: var(--success);
}

#operationStatus option[value="Cancelado"] {
    color: var(--danger);
}

#cashCloseNotice {
    background-color: rgba(26, 26, 26, 0.95) !important;
    border: 1px solid rgba(128, 255, 0, 0.28) !important;
    color: var(--text-primary) !important;
    font-weight: 500;
}

/* Línea de ayuda sutil del cierre (reemplaza el alert-info grande) */
.cc-help-line {
    font-size: 0.78rem;
    line-height: 1.3;
    color: var(--text-muted, #9aa0a6);
    opacity: 0.85;
    margin: 0 0 0.5rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cc-help-line i {
    color: #80ff00;
    opacity: 0.7;
    font-size: 0.72rem;
}

/* Aviso compacto de divisas sin cotización (reemplaza el alert-warning grande) */
.cc-missing-line {
    font-size: 0.78rem;
    line-height: 1.3;
    color: #ffc107;
    margin: 0 0 0.6rem;
    padding: 4px 8px;
    border-left: 2px solid rgba(255, 193, 7, 0.6);
    background-color: rgba(255, 193, 7, 0.08);
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cc-missing-line i {
    font-size: 0.72rem;
}

/* Chip de tasa recomendada (prellenada) del Panel mayorista en el cierre manual */
.cc-ref-wrapper .cc-rec-hint {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    font-size: 0.72rem;
    line-height: 1.2;
    color: #80ff00;
    opacity: 0.9;
}

.cc-ref-wrapper .cc-rec-hint.cc-rec-missing {
    color: #ffc107;
}

.cc-ref.cc-ref-recommended {
    border-color: rgba(128, 255, 0, 0.45);
}

/* Agregar al final del archivo */
.info-box {
    background-color: var(--bg-primary);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid var(--accent-primary);
}

.info-box h5 {
    color: var(--text-secondary) !important;
    margin-bottom: 1rem;
}

.info-box h3 {
    font-size: 1.6rem;
    margin: 0;
}

#variacionValue.positive {
    color: var(--success) !important;
}

#variacionValue.negative {
    color: var(--danger) !important;
}

.info-box small {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary) !important;
}

.text-muted {
    color: var(--text-secondary) !important;
}

/* Estilos para las tarjetas de precios */
.price-card {
    background-color: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.price-header {
    background-color: var(--bg-secondary);
    padding: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.price-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary) !important;
}

.price-body {
    padding: 0.9rem;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.price-row:last-child {
    border-bottom: none;
}

.price-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.price-value {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}

.price-detail {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Estilos para la variación */
#blueVariacionValue.positive {
    color: var(--success);
}

#blueVariacionValue.negative {
    color: var(--danger);
}

/* Estilos para la sección de actualización */
.update-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    margin-top: 1rem;
}

.update-time {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.btn-refresh {
    background-color: var(--accent-primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-refresh:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-refresh i {
    font-size: 0.9rem;
}

/* Animación para el icono de actualización */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.btn-refresh.loading i {
    animation: spin 1s linear infinite;
}

/* Estilos para la tabla de cotizaciones */
.cotizaciones-table {
    margin: 0;
}

.cotizaciones-table thead th {
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    font-weight: 500;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cotizaciones-table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cotizaciones-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Estilos para los valores */
.cotizaciones-table td:not(:first-child) {
    font-family: 'Roboto Mono', monospace;
    font-size: 1.1rem;
}

/* Estilos para la variación */
#blueVariacionValue.positive {
    color: var(--success);
}

#blueVariacionValue.negative {
    color: var(--danger);
}

/* Estilos para el dropdown de búsqueda de clientes */
#clientSearchResults {
    background-color: #1a1a1a !important;
    border: 1px solid var(--accent-primary);
    border-radius: 0.5rem;
    padding: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    position: absolute;
    z-index: 1000;
    /* Debajo del modal (1050) */
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
}

/* Cada item en el dropdown */
#clientSearchResults>div {
    padding: 0.75rem 1rem;
    cursor: pointer;
    color: white !important;
    background-color: #1a1a1a !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 2px;
    font-weight: 500;
    display: block;
    width: 100%;
}

/* Hover para los items */
#clientSearchResults>div:hover {
    background-color: var(--accent-primary) !important;
    color: white !important;
}

/* Contenedor del input */
.position-relative {
    position: relative;
    z-index: 9999;
}

/* Asegurar que el dropdown esté visible */
.d-none {
    display: none !important;
}

#clientSearchResults:not(.d-none) {
    display: block !important;
}

/* Estilos específicos para el dropdown de búsqueda de clientes */
#clientSearchResults.position-absolute {
    background-color: #1a1a1a !important;
    border: 1px solid var(--accent-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 9999;
}

#clientSearchResults div {
    padding: 0.75rem 1rem;
    background-color: #1a1a1a !important;
    color: white !important;
    transition: all 0.2s ease;
}

#clientSearchResults div:last-child {
    background: #1a1a1a !important;
    color: white !important;
    border-bottom: none;
}

#clientSearchResults div:hover {
    background-color: var(--accent-primary) !important;
    color: white !important;
}

/* Asegurar que el contenedor esté por encima */
.position-absolute.w-100.mt-1 {
    background-color: #1a1a1a !important;
    z-index: 9999;
}

/* Asegurar que el texto sea visible */
#clientSearchResults div * {
    color: white !important;
}

/* Estilos para estados de operaciones en el historial */
.operacion-pendiente {
    background-color: rgba(255, 193, 7, 0.15) !important;
}

.operacion-finalizada {
    background-color: rgba(40, 167, 69, 0.15) !important;
}

/* Badges para estados */
.badge-estado {
    padding: 0.4em 0.8em;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 500;
    display: inline-block;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
}

.badge-pendiente {
    background-color: #ffc107;
    color: #000000;
    border: 1px solid #e0a800;
}

.badge-finalizado {
    background-color: #28a745;
    color: #ffffff;
    border: 1px solid #218838;
}

/* Hover effects */
tr.operacion-pendiente:hover {
    background-color: rgba(255, 193, 7, 0.25) !important;
}

tr.operacion-finalizada:hover {
    background-color: rgba(40, 167, 69, 0.25) !important;
}

/* ==========================================================================
   SHELL MULTI-TENANT: marca, tarjeta de oficina, badges de rol, footer, topbar
   ========================================================================== */
.sidebar-header .brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.sidebar-header .brand .brand-icon {
    color: var(--accent-primary);
    font-size: 1.35rem;
}

/* Tarjeta de contexto de oficina */
.office-card {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin: 0.9rem 1rem 0.4rem;
    padding: 0.7rem 0.85rem;
    background: linear-gradient(135deg, rgba(128, 255, 0, 0.12), rgba(128, 255, 0, 0.03));
    border: 1px solid rgba(128, 255, 0, 0.22);
    border-radius: 12px;
}

.office-card-icon {
    color: var(--accent-primary);
    font-size: 1.05rem;
    flex: 0 0 auto;
}

.office-card-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.office-card-name {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

/* Badge de rol */
.role-badge {
    display: inline-block;
    padding: 0.12rem 0.6rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: none;
    width: fit-content;
}

.role-badge.role-owner {
    background: rgba(128, 255, 0, 0.18);
    color: #6cb6ff;
    border: 1px solid rgba(128, 255, 0, 0.5);
}

.role-badge.role-admin {
    background: rgba(42, 199, 105, 0.16);
    color: #4ad991;
    border: 1px solid rgba(42, 199, 105, 0.45);
}

.role-badge.role-operador {
    background: rgba(132, 142, 156, 0.16);
    color: #b4bcc7;
    border: 1px solid rgba(132, 142, 156, 0.4);
}

/* Indicador de presencia (Sesiones del equipo) */
.session-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: 0.4rem;
    vertical-align: middle;
}

.session-dot-online {
    background: #2ac769;
    box-shadow: 0 0 0 3px rgba(42, 199, 105, 0.22);
}

.session-dot-offline {
    background: #6b7280;
    box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.18);
}

/* Footer del sidebar: usuario + logout */
.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
    flex: 1 1 auto;
}

.sidebar-user-avatar,
.topbar-user-avatar {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-primary);
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
}

.sidebar-user-name {
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-btn {
    width: auto;
    flex: 0 0 auto;
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    line-height: 1;
}

/* Topbar: rol + avatar del usuario a la derecha */
.dashboard-topbar .topbar-user {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* Cotizaciones del header un poco más grandes y legibles.
   Especificidad extra (.dashboard-topbar) para ganarle a los chips inline. */
.dashboard-container .dashboard-topbar .topbar-market .topbar-label {
    font-size: 0.72rem;
}

.dashboard-container .dashboard-topbar .topbar-market .topbar-prices {
    font-size: 1rem;
    gap: 0.55rem;
    flex-wrap: wrap;
    align-items: center;
}

/* Variación con flecha ▲/▼ + delta nominal + porcentaje */
.dashboard-topbar .topbar-var {
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
    line-height: 1;
}

/* ==========================================================================
   PANTALLA EQUIPO
   ========================================================================== */
.team-table-wrapper {
    border-radius: 10px;
}

.team-table {
    color: var(--text-primary);
}

.team-table thead th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
}

.team-table tbody td {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
    vertical-align: middle;
}

.team-table tbody tr:hover {
    background: rgba(128, 255, 0, 0.06);
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.35rem;
    vertical-align: middle;
}

.status-dot.status-active {
    background: var(--success);
    box-shadow: 0 0 6px rgba(42, 199, 105, 0.6);
}

.status-dot.status-inactive {
    background: var(--danger);
    box-shadow: 0 0 6px rgba(255, 92, 122, 0.6);
}

/* Logos de divisas (badge circular) */
.cur-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    line-height: 1;
    flex: 0 0 auto;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18), 0 2px 6px -2px rgba(0, 0, 0, .5);
    vertical-align: middle;
    letter-spacing: -.01em;
}

.cur-ico-img {
    object-fit: cover;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18), 0 2px 6px -2px rgba(0, 0, 0, .5);
}

.currency-select-icon {
    display: none;
    align-items: center;
}

.client-wa-btn {
    line-height: 1.2;
    border-radius: var(--radius-pill) !important;
}

/* Tarjetas de métricas (cierre / perfil de oficina) */
.metric-card {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: .85rem 1rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: .2rem;
    transition: border-color var(--transition), transform var(--transition);
}

.metric-card:hover {
    border-color: var(--accent-soft);
    transform: translateY(-2px);
}

.metric-card small {
    color: var(--text-secondary);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.metric-card h4 {
    color: var(--text-primary);
    font-weight: 700;
    margin: 0;
    font-size: 1.25rem;
}

.metric-card .metric-sub {
    color: var(--text-secondary);
    font-size: .72rem;
}

.metric-card.metric-highlight {
    background: linear-gradient(160deg, rgba(128, 255, 0, .16), rgba(128, 255, 0, .04));
    border-color: var(--accent-soft);
}

.metric-pos {
    color: var(--success) !important;
}

.metric-neg {
    color: var(--danger) !important;
}

/* Grilla de objetivos de distribución */
.targets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: .5rem;
}

.target-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: .35rem .5rem;
}

.target-cur {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .82rem;
    color: var(--text-primary);
}

.target-input {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
}

.target-input input {
    width: 56px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    padding: .15rem .35rem;
    text-align: right;
    font-size: .82rem;
}

.target-input span {
    color: var(--text-secondary);
    font-size: .8rem;
}

/* Celda de par/divisa con ícono */
.pair-cell {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    white-space: nowrap;
}

.pair-cell .cur-ico {
    flex: 0 0 auto;
}

/* Preview de ganancia de intermediación */
.int-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .7rem 1rem;
    border-radius: var(--radius);
    background: linear-gradient(160deg, rgba(128, 255, 0, .16), rgba(128, 255, 0, .04));
    border: 1px solid var(--accent-soft);
}

.int-preview span {
    color: var(--text-secondary);
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.int-preview strong {
    color: var(--success);
    font-size: 1.3rem;
}

.int-preview.int-preview-neg {
    background: linear-gradient(160deg, rgba(255, 92, 122, .16), rgba(255, 92, 122, .04));
    border-color: rgba(255, 92, 122, .4);
}

.int-preview.int-preview-neg strong {
    color: var(--danger);
}

/* Sugerencia de spread */
.spread-tip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

.spread-tip .badge {
    flex: 0 0 auto;
}

.spread-tip-text {
    font-size: .78rem;
    color: var(--text-secondary);
    line-height: 1.25;
}

/* ===== Movimiento y detalles (design system coti.bot) ===== */
.tab-pane.active.show {
    animation: tabIn var(--transition-slow);
}

@keyframes tabIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.table tbody tr {
    transition: background-color var(--transition);
}

.badge {
    border-radius: var(--radius-pill) !important;
}

a,
.btn,
.nav-link,
.card,
.form-control,
.form-select {
    transition-property: color, background-color, border-color, box-shadow, transform;
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

/* Autocompletado (partes de arbitraje) */
.autocomplete-results {
    z-index: 1050;
    max-height: 240px;
    overflow-y: auto;
    background: var(--bg-secondary, #14181f);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.45);
}

.autocomplete-results .hover-bg-accent:hover {
    background: rgba(128, 255, 0, 0.18);
}

.autocomplete-results .cursor-pointer {
    cursor: pointer;
}

/* Cierre automático */
.auto-cierre-config {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Perfil de oficina: logo */
.office-logo-preview {
    width: 96px;
    height: 96px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--text-secondary, #9aa);
    font-size: 2rem;
}

.office-logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Notificaciones de Arbolito */
.arbolito-notifs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 8px 0;
    max-height: 210px;
    overflow-y: auto;
}

.arb-notif {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid #37d67a;
    font-size: 0.82rem;
}

.arb-notif i {
    margin-top: 2px;
    color: #37d67a;
}

.arb-notif-body {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.arb-notif-body span {
    opacity: 0.8;
}

.arb-notif-warning {
    border-left-color: #f0b429;
}

.arb-notif-warning i {
    color: #f0b429;
}

.arb-notif-danger {
    border-left-color: #ef5350;
}

.arb-notif-danger i {
    color: #ef5350;
}

.arb-notif-empty {
    font-size: 0.82rem;
    opacity: 0.7;
    padding: 4px 2px;
}

.arb-notif-empty i {
    color: #37d67a;
    margin-right: 4px;
}

/* ===== Stock de Divisas — tarjetas ===== */
.stock-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: .85rem;
}

.stock-card {
    position: relative;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: .9rem 1rem 1rem;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
    overflow: hidden;
}

.stock-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--accent-primary);
    opacity: .85;
}

.stock-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-soft);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
}

.stock-card-head {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin-bottom: .7rem;
}

.stock-card-icon {
    display: inline-flex;
    align-items: center;
}

.stock-card-code {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
    letter-spacing: .3px;
}

.stock-card-metrics {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: .35rem;
}

.stock-metric {
    display: flex;
    flex-direction: column;
    gap: .05rem;
}

.stock-metric-label {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-secondary);
}

.stock-metric.neto .stock-metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
    line-height: 1.15;
    word-break: break-word;
}

.stock-metric.neto .stock-metric-value.neg {
    color: var(--danger);
}

.stock-bruto-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .5rem;
    padding-top: .4rem;
    border-top: 1px solid var(--border-color);
}

.stock-bruto-row .stock-bruto-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.stock-card-diff {
    margin-top: .6rem;
    padding-top: .55rem;
    border-top: 1px dashed var(--border-color);
    font-size: .72rem;
    display: flex;
    align-items: center;
    gap: .35rem;
}

.stock-card-diff.up {
    color: var(--success);
}

.stock-card-diff.down {
    color: var(--danger);
}

.stock-legend {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .2rem;
}

.stock-legend-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: 3px;
    vertical-align: middle;
}

.stock-legend-dot.neto {
    background: var(--accent-primary);
}

.stock-legend-dot.bruto {
    background: var(--text-secondary);
}

/* Ayuda inline en las tarjetas de stock (físico vs patrimonio) */
.stock-metric-help {
    font-size: .62rem;
    opacity: .55;
    cursor: help;
    margin-left: .15rem;
}

.stock-card-hint {
    margin-top: .6rem;
    padding-top: .5rem;
    border-top: 1px dashed var(--border-color);
    font-size: .66rem;
    line-height: 1.35;
    color: var(--text-secondary);
    opacity: .85;
}

/* Badges de saldo negativo en cuentas de arbitraje */
.arb-neg-badges {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.arb-neg-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .7rem;
    font-weight: 600;
    padding: .12rem .5rem;
    border-radius: var(--radius-pill);
    white-space: nowrap;
    border: 1px solid transparent;
}

/* La contraparte nos debe (crédito a favor): ámbar sutil */
.arb-neg-badge.te-debe {
    background: rgba(245, 158, 11, .14);
    color: #f59e0b;
    border-color: rgba(245, 158, 11, .35);
}

/* Le debemos (deuda): rojo sutil */
.arb-neg-badge.le-debes {
    background: rgba(239, 68, 68, .13);
    color: #ef4444;
    border-color: rgba(239, 68, 68, .35);
}

/* Chip para los espejos automáticos de arbitraje en Créditos/Deudas */
.cd-arb-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .72rem;
    font-weight: 600;
    padding: .12rem .55rem;
    border-radius: var(--radius-pill);
    background: rgba(99, 102, 241, .14);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, .35);
    white-space: nowrap;
}

.cd-arb-mirror-row {
    background: rgba(99, 102, 241, .05);
}

/* Badge de frecuencia de operaciones en tabla de ponderados */
.ops-badge {
    display: inline-block;
    font-size: .68rem;
    font-weight: 600;
    padding: .05rem .4rem;
    border-radius: var(--radius-pill);
    background: var(--accent-light);
    color: var(--accent-primary);
    margin-left: .35rem;
    white-space: nowrap;
}

/* Arbitraje cripto */
.arbc-detail-head {
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    padding-bottom: .5rem;
}
.arbc-detail-saldo {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
}
#arbcCuentasTable tbody tr:hover {
    background: rgba(255, 255, 255, .06);
}
.arbc-estado-badge {
    transition: transform .12s ease, filter .12s ease;
}
.arbc-estado-badge:hover {
    transform: scale(1.06);
    filter: brightness(1.1);
}
#arbcSub-perfil .metric-card h4 {
    font-size: 1.4rem;
    font-weight: 700;
}
#arbcGirosTable td,
#arbcDepositosTable td {
    vertical-align: middle;
}
/* Encabezados fijos al hacer scroll dentro del contenedor de la tabla.
   La regla global `.table { overflow: hidden }` convierte a la tabla en el
   contenedor de referencia del sticky; hay que devolverla a `visible` para
   que el thead se pegue al div que realmente scrollea. */
#arbcGirosTable,
#arbcDepositosTable {
    overflow: visible;
}
#arbcGirosTable thead th,
#arbcDepositosTable thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--bg-secondary);
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .14);
}
/* Distribución de columnas: montos a la derecha, texto libre absorbe el sobrante.
   Se aplica sólo en desktop; el modo tarjeta (<=640px) usa su propia alineación. */
@media (min-width: 641px) {
    /* Giros: Monto (5), TC (6), USDT (7) */
    #arbcGirosTable td:nth-child(5),
    #arbcGirosTable td:nth-child(6),
    #arbcGirosTable td:nth-child(7),
    #arbcGirosTable th:nth-child(5),
    #arbcGirosTable th:nth-child(6),
    #arbcGirosTable th:nth-child(7),
    /* Depósitos: Monto convertido (4), TC (5), Monto obtenido (7) */
    #arbcDepositosTable td:nth-child(4),
    #arbcDepositosTable td:nth-child(5),
    #arbcDepositosTable td:nth-child(7),
    #arbcDepositosTable th:nth-child(4),
    #arbcDepositosTable th:nth-child(5),
    #arbcDepositosTable th:nth-child(7),
    /* Cierre de Caja: Físico (2), Créditos (3), Deudas (4), Ajustado (5) */
    #cashCloseTable td:nth-child(2),
    #cashCloseTable td:nth-child(3),
    #cashCloseTable td:nth-child(4),
    #cashCloseTable td:nth-child(5),
    #cashCloseTable th:nth-child(2),
    #cashCloseTable th:nth-child(3),
    #cashCloseTable th:nth-child(4),
    #cashCloseTable th:nth-child(5) {
        text-align: right;
        font-variant-numeric: tabular-nums;
    }
}

/* En desktop: nombres largos que envuelvan, resto en una sola línea */
@media (min-width: 641px) {
    #arbcGirosTable td,
    #arbcDepositosTable td {
        white-space: nowrap;
    }
    #arbcGirosTable td[data-label="Beneficiario"] {
        white-space: normal;
    }
    #arbcGirosTable td[data-label="Alias/CVU"],
    #arbcGirosTable td[data-label="CBU"] {
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}
#arbcBulkText {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .85rem;
}

/* --- Tablas de Arbitraje: modo tarjeta apilada en teléfono --- */
@media (max-width: 640px) {
    #arbcGirosTable thead,
    #arbcDepositosTable thead {
        display: none;
    }
    #arbcGirosTable tbody tr,
    #arbcDepositosTable tbody tr {
        display: block;
        margin-bottom: .6rem;
        padding: .4rem .6rem;
        border: 1px solid rgba(255, 255, 255, .09);
        border-radius: 12px;
        background: rgba(255, 255, 255, .03);
    }
    #arbcGirosTable tbody td,
    #arbcDepositosTable tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
        padding: .22rem 0;
        border: none !important;
        text-align: right;
        white-space: normal;
        word-break: break-word;
    }
    #arbcGirosTable tbody td::before,
    #arbcDepositosTable tbody td::before {
        content: attr(data-label);
        margin-right: auto;
        text-align: left;
        font-weight: 600;
        font-size: .72rem;
        text-transform: uppercase;
        letter-spacing: .3px;
        color: var(--text-muted, #9aa4b2);
    }
    /* Celdas sin etiqueta (acciones) y fila "sin datos" centradas */
    #arbcGirosTable tbody td[data-label=""]::before,
    #arbcDepositosTable tbody td[data-label=""]::before,
    #arbcGirosTable tbody td[colspan]::before,
    #arbcDepositosTable tbody td[colspan]::before {
        content: "";
    }
    #arbcGirosTable tbody td[data-label=""],
    #arbcDepositosTable tbody td[data-label=""] {
        justify-content: flex-end;
    }
    #arbcGirosTable tbody td[colspan],
    #arbcDepositosTable tbody td[colspan] {
        justify-content: center;
        text-align: center;
    }
}

/* Páginas legales (Términos / Privacidad) */
.legal-card {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border: 1px solid rgba(128, 255, 0, 0.15) !important;
    border-radius: 14px !important;
    box-shadow: 0 18px 35px rgba(10, 12, 30, 0.35);
}

.legal-card h1,
.legal-card h2 {
    color: var(--text-primary) !important;
}

.legal-card p,
.legal-card li {
    line-height: 1.6;
}

.legal-card a {
    color: var(--accent-primary, #3b82f6);
}

.legal-card .alert-secondary {
    background: rgba(22, 27, 38, 0.9);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Pie legal dentro de la app */
.app-legal-footer {
    margin: 2.5rem auto 1.5rem;
    max-width: 900px;
    padding: 1rem 1.25rem;
    text-align: center;
    font-size: 0.72rem;
    line-height: 1.5;
    color: var(--text-secondary, #94a3b8);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    opacity: 0.85;
}

.app-legal-footer .app-legal-links {
    display: block;
    margin-top: 0.35rem;
}

.app-legal-footer a {
    color: var(--accent-primary, #3b82f6);
    text-decoration: none;
}

.app-legal-footer a:hover {
    text-decoration: underline;
}

/* Banner de consentimiento legal (una sola vez) */
.legal-consent-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3000;
    background: rgba(15, 18, 28, 0.98);
    border-top: 1px solid rgba(128, 255, 0, 0.35);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35);
    padding: 0.85rem 1rem;
}

.legal-consent-inner {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.legal-consent-text {
    font-size: 0.8rem;
    color: #e2e8f0;
    line-height: 1.5;
    flex: 1 1 320px;
}

.legal-consent-text a {
    color: var(--accent-primary, #3b82f6);
}

.legal-consent-banner .btn {
    white-space: nowrap;
}

/* ============================================================
   coti.bot — color, movimiento y glows neón (retema Arbolito)
   Verde lima (#80ff00) + cian (#00e5ff) sobre negro cálido.
   Animaciones sobrias; respetan prefers-reduced-motion.
   ============================================================ */

/* Cards: hover con lift + glow verde neón */
.card {
    transition: transform var(--transition), box-shadow var(--transition-slow),
        border-color var(--transition) !important;
}

.card:hover {
    border-color: rgba(128, 255, 0, 0.28) !important;
    box-shadow: var(--shadow), 0 0 16px -8px rgba(128, 255, 0, 0.18) !important;
    transform: translateY(-2px);
}

/* Métricas y tarjetas de stock: leve realce al hover */
.metric-card:hover,
.stock-card:hover {
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4), 0 0 14px -10px rgba(128, 255, 0, 0.25) !important;
}

.stock-card::before {
    background: var(--accent-primary) !important;
    opacity: 0.9 !important;
    box-shadow: 0 0 8px rgba(128, 255, 0, 0.35);
}

/* Botones: brillo/lift vivo */
.btn {
    position: relative;
}

.btn-outline-primary {
    color: var(--accent-primary) !important;
    border-color: rgba(128, 255, 0, 0.55) !important;
}

.btn-outline-primary:hover {
    background-color: var(--accent-primary) !important;
    color: var(--on-accent) !important;
    box-shadow: var(--glow-green) !important;
}

/* Foco accesible verde neón */
:focus-visible {
    outline: 2px solid rgba(128, 255, 0, 0.65);
    outline-offset: 2px;
}

/* Sidebar / nav: item activo con acento verde y glow sutil */
.nav-tabs .nav-link.active {
    box-shadow: inset 0 -2px 0 0 var(--accent-primary);
}

/* Título con gradiente de marca animado (aplicar clase .brand-gradient-text) */
.brand-gradient-text {
    color: var(--accent-primary) !important;
}

/* Punto "en vivo" pulsante (coti) */
.arb-live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-primary);
    animation: arb-pulse-dot 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Badges de marca */
.badge.bg-primary {
    background: var(--grad-brand) !important;
    color: var(--on-accent) !important;
}

.badge.bg-success {
    background-color: var(--success) !important;
    color: var(--on-accent) !important;
}

/* Entrada suave de cards al cargar la vista activa */
.tab-pane.active .card {
    animation: arb-card-enter 0.5s ease-out both;
}

@keyframes arb-gradient-x {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes arb-pulse-dot {
    0% { box-shadow: 0 0 0 0 rgba(128, 255, 0, 0.55); }
    70% { box-shadow: 0 0 0 7px rgba(128, 255, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(128, 255, 0, 0); }
}

@keyframes arb-card-enter {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Respeto por usuarios con movimiento reducido */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* Botón de sonido (topbar) — combina con el verde acento coti.bot */
.sound-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary, #b3b3b3);
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
    padding: 0;
}

.sound-toggle-btn:hover {
    color: var(--text-primary, #fff);
    border-color: var(--accent-soft, rgba(128, 255, 0, 0.30));
    background: rgba(255, 255, 255, 0.07);
}

.sound-toggle-btn.sound-on {
    color: var(--accent-primary, #80ff00);
    border-color: var(--accent-soft, rgba(128, 255, 0, 0.30));
    background: var(--accent-light, rgba(128, 255, 0, 0.12));
    box-shadow: 0 0 0 2px rgba(128, 255, 0, 0.12);
}

.sound-toggle-btn i {
    font-size: 0.95rem;
    line-height: 1;
}

/* Switch de sonido en Configuraciones: check verde acento */
.sound-settings-wrapper .form-check-input:checked {
    background-color: var(--accent-primary, #80ff00);
    border-color: var(--accent-primary, #80ff00);
}

.sound-settings-wrapper .form-check-input:focus {
    border-color: var(--accent-soft, rgba(128, 255, 0, 0.30));
    box-shadow: 0 0 0 0.2rem rgba(128, 255, 0, 0.18);
}

/* ===== Desplegable de divisa con ícono dentro de cada opción ===== */
.cur-select {
    position: relative;
}

.cur-select-trigger {
    display: flex !important;
    align-items: center;
    gap: 8px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    min-height: 38px;
}

.cur-select-trigger:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.cur-select-trigger .cur-ico,
.cur-select-option .cur-ico {
    flex: 0 0 auto;
}

.cur-select-code {
    font-weight: 600;
    color: var(--text-primary, #fff);
    letter-spacing: .2px;
}

.cur-select-ph {
    color: var(--text-secondary, #9aa4b2);
}

.cur-select-menu {
    display: none;
    position: absolute;
    z-index: 1090;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-secondary, #1a1f2b);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
    border-radius: var(--radius, 10px);
    box-shadow: var(--shadow-lg, 0 12px 32px rgba(0, 0, 0, 0.45));
    padding: 6px;
    max-height: 300px;
    overflow: auto;
}

.cur-select.open .cur-select-menu {
    display: block;
}

.cur-select-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm, 8px);
    cursor: pointer;
    color: var(--text-primary, #fff);
    transition: background-color .15s ease;
}

.cur-select-option:hover {
    background: var(--bg-light, rgba(255, 255, 255, 0.06));
}

.cur-select-option.active {
    background: var(--accent-light, rgba(128, 255, 0, 0.14));
    box-shadow: inset 0 0 0 1px var(--accent-soft, rgba(128, 255, 0, 0.30));
}

/* ================== Layout personalizable (Fase 1) ================== */
/* Handle de arrastre en el encabezado de cada tarjeta reordenable */
.card-drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
    cursor: grab;
    opacity: 0.5;
    color: var(--text-secondary, rgba(255, 255, 255, 0.6));
    font-size: 0.9rem;
    flex: 0 0 auto;
    transition: opacity 0.15s ease;
    /* que no rompa el layout d-flex justify-content-between del header */
    line-height: 1;
}

.card-drag-handle:hover {
    opacity: 1;
}

.card-drag-handle:active {
    cursor: grabbing;
}

/* El header suele ser flex (d-flex justify-content-between); el handle va a la izquierda */
.card-header.d-flex .card-drag-handle {
    align-self: center;
}

/* Pestañas: mientras se arrastran */
.nav-tabs.vertical-tabs .nav-item[data-reorderable] .nav-link {
    cursor: pointer;
}

.nav-tabs.vertical-tabs .sortable-drag .nav-link,
.nav-tabs.vertical-tabs .nav-item.sortable-drag {
    cursor: grabbing !important;
}

/* Estado fantasma / arrastre sutil (pestañas y tarjetas) */
.sortable-ghost {
    opacity: 0.5;
    outline: 2px dashed var(--accent, rgba(128, 255, 0, 0.5));
    outline-offset: -2px;
    border-radius: 8px;
}

.sortable-drag {
    opacity: 0.9;
}

/* ============================================================
   PANEL DE COTIZACIONES: dos niveles (Mayorista/Minorista),
   conjuntos (chips) y selector de nivel para compartir.
   ============================================================ */

/* --- Bloque de dos niveles dentro de la tarjeta --- */
.quote-tier-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.quote-tier-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary, #93a0b4);
    margin-bottom: 0.25rem;
    font-weight: 700;
}

.quote-tier-divider {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.15rem 0;
    color: var(--text-secondary, #7f8b9c);
}

.quote-tier-divider::before,
.quote-tier-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.09);
}

.quote-tier-mini {
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    opacity: 0.85;
}

.quote-auto-btn {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary, #93a0b4);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-radius: 6px;
    padding: 0.1rem 0.4rem;
    cursor: pointer;
    line-height: 1.4;
}

.quote-auto-btn:hover {
    color: var(--text-primary, #fff);
    border-color: var(--accent-primary, #2fbf71);
}

/* --- Control de margen minorista en la cabecera --- */
.quote-margin-ctl {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.quote-margin-ctl label {
    margin: 0;
    font-size: 0.7rem;
    color: var(--text-secondary, #93a0b4);
    white-space: nowrap;
}

.quote-margin-ctl input {
    width: 58px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 7px;
    color: var(--text-primary, #fff);
    padding: 0.2rem 0.4rem;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
}

/* --- Selector de nivel en la barra de compartir ad-hoc --- */
.quote-tier-select {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
}

.quote-tier-select > span {
    font-size: 0.75rem;
    color: var(--text-secondary, #93a0b4);
}

.quote-tier-select select {
    width: auto;
    min-width: 118px;
}

/* --- Barra de conjuntos --- */
.quote-sets-bar {
    background: var(--bg-dark, #111821);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: 12px;
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.9rem;
}

.quote-sets-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.quote-sets-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary, #fff);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.quote-sets-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.quote-sets-empty {
    font-size: 0.78rem;
    color: var(--text-secondary, #7f8b9c);
}

.quote-set-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.4rem 0.3rem 0.7rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
}

.quote-set-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary, #fff);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quote-set-count {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-secondary, #93a0b4);
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    padding: 0.05rem 0.4rem;
    min-width: 18px;
    text-align: center;
}

.quote-set-btn {
    border: none;
    background: transparent;
    color: var(--text-secondary, #93a0b4);
    cursor: pointer;
    padding: 0.2rem 0.35rem;
    border-radius: 7px;
    font-size: 0.8rem;
    line-height: 1;
}

.quote-set-btn:hover {
    color: var(--text-primary, #fff);
    background: rgba(255, 255, 255, 0.08);
}

.quote-set-btn.danger:hover {
    color: #ff7b6b;
}

/* --- Dropdown de nivel (copiar / WhatsApp por tier) --- */
.quote-tier-dd {
    position: relative;
    display: inline-flex;
}

.quote-tier-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 30;
    min-width: 180px;
    background: var(--bg-secondary, #131a26);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    padding: 0.35rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.quote-tier-dd.open .quote-tier-menu {
    display: block;
}

.quote-tier-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.3rem;
}

.quote-tier-row > span {
    flex: 1;
    font-size: 0.78rem;
    color: var(--text-primary, #fff);
}

.quote-tier-row button {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary, #cbd5e1);
    border-radius: 7px;
    padding: 0.2rem 0.45rem;
    cursor: pointer;
    font-size: 0.78rem;
    line-height: 1;
}

.quote-tier-row button:hover {
    color: var(--text-primary, #fff);
    border-color: var(--accent-primary, #2fbf71);
}

/* --- Modal de conjunto: selección de pares --- */
.quote-set-pairs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    max-height: 280px;
    overflow-y: auto;
    padding: 0.25rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

.quote-set-pair {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    padding: 0.3rem 0.4rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--text-primary, #fff);
}

.quote-set-pair:hover {
    background: rgba(255, 255, 255, 0.05);
}

.quote-set-pair input {
    accent-color: var(--accent-primary, #2fbf71);
}

/* --- Sub-títulos de nivel en el modal de cotización --- */
.quote-modal-tier {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-primary, #fff);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 0.5rem;
}

.quote-modal-tier.muted {
    color: var(--text-secondary, #93a0b4);
}

.quote-modal-tier span {
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    opacity: 0.8;
}

@media (max-width: 520px) {
    .quote-set-pairs {
        grid-template-columns: 1fr;
    }
}