:root {
    --bg: #03070c;
    --panel: rgba(10, 19, 29, 0.94);
    --panel-soft: rgba(12, 24, 36, 0.88);
    --panel-hover: rgba(19, 37, 54, 0.95);

    --border: #1a344b;
    --border-bright: #245a7c;

    --text: #e7f0f6;
    --text-soft: #8ea5b5;
    --text-dim: #607789;

    --blue: #18a9e6;
    --blue-soft: rgba(24, 169, 230, 0.14);
    --green: #28c985;
    --yellow: #e7b94e;
    --red: #e75d67;

    --radius: 15px;
    --sidebar-width: 245px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
}

button,
input,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.app-background {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: #02060a;
}

.app-shell {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-height: 100vh;
    padding: 13px;
    gap: 13px;
}

.sidebar {
    min-height: calc(100vh - 26px);
    display: flex;
    flex-direction: column;
}

.sidebar-main {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
}

.nav-primary,
.sidebar-bottom {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.nav-item {
    width: 100%;
    min-height: 41px;
    display: flex;
    align-items: center;
    gap: 12px;

    border: 1px solid transparent;
    border-radius: 11px;
    padding: 0 14px;

    background: rgba(6, 15, 23, 0.88);
    color: var(--text-soft);

    text-decoration: none;
    cursor: pointer;

    transition:
        background 140ms ease,
        border-color 140ms ease,
        color 140ms ease,
        transform 140ms ease;
}

.nav-item:hover:not(.nav-disabled),
.nav-item.active {
    background: var(--blue-soft);
    border-color: var(--border-bright);
    color: #eaf8ff;
}

.nav-item.active {
    box-shadow: inset 3px 0 0 var(--blue);
}

.nav-item:active:not(.nav-disabled) {
    transform: translateY(1px);
}

.nav-icon {
    width: 24px;
    flex: 0 0 24px;
    text-align: center;
    color: var(--blue);
    font-size: 19px;
}

.nav-disabled {
    color: #536673;
    cursor: not-allowed;
    opacity: 0.55;
}

.nav-disabled .nav-label {
    text-decoration: line-through;
}

.nav-coming-soon {
    margin-left: auto;
    padding: 3px 6px;
    border: 1px solid #294151;
    border-radius: 6px;
    color: #718a9a;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: none;
    white-space: nowrap;
}

.sidebar-background-space {
    flex: 1;
    min-height: 180px;
}

.sidebar-bottom {
    padding-top: 10px;
}

.nav-secondary {
    background: rgba(5, 14, 22, 0.93);
    border-color: #122b3d;
}

.main-area {
    min-width: 0;
}

.topbar {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;

    margin-bottom: 14px;
    padding: 6px 5px 6px 8px;
}

.topbar h1 {
    margin: 0 0 5px;
    font-size: 27px;
    line-height: 1.1;
    font-weight: 700;
}

.topbar p {
    margin: 0;
    color: var(--text-soft);
    font-size: 14px;
}

.user-widget {
    display: flex;
    align-items: center;
    gap: 9px;

    min-width: 185px;
    padding: 9px 13px;

    border: 1px solid var(--border);
    border-radius: 13px;
    background: rgba(7, 17, 27, 0.86);
}

.user-avatar {
    width: 37px;
    height: 37px;
    display: grid;
    place-items: center;

    border-radius: 50%;
    background: var(--blue-soft);
    border: 1px solid var(--border-bright);

    color: #bcecff;
    font-weight: 700;
}

.user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.user-info strong {
    font-size: 14px;
}

.user-info span {
    color: var(--text-soft);
    font-size: 12px;
}

.page-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 13px;
}

.card,
.panel {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.18);
}

.card {
    min-height: 100px;
    padding: 15px;
}

.card-label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-soft);
    font-size: 13px;
}

.card-value {
    display: block;
    margin-bottom: 5px;
    font-size: 27px;
    font-weight: 700;
}

.card-detail {
    color: var(--text-dim);
    font-size: 12px;
}

.value-positive {
    color: var(--green);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(310px, 0.75fr);
    gap: 14px;
}

.panel {
    padding: 15px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.panel-title {
    margin: 0;
    font-size: 16px;
    font-weight: 650;
}

.panel-subtitle {
    margin: 4px 0 0;
    color: var(--text-soft);
    font-size: 12px;
}

.status-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    min-height: 40px;
    padding: 0 13px;

    border: 1px solid #142c3e;
    border-radius: 10px;
    background: rgba(7, 18, 28, 0.65);
}

.status-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 9px rgba(40, 201, 133, 0.45);
}

.status-label {
    color: var(--text-soft);
    font-size: 13px;
}

.status-value {
    font-size: 13px;
    font-weight: 600;
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.data-table th,
.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #142b3b;
    text-align: left;
    white-space: nowrap;
}

.data-table th {
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 600;
}

.data-table td {
    font-size: 13px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    min-height: 27px;
    padding: 0 9px;

    border: 1px solid var(--border);
    border-radius: 999px;
    background: #0b1a25;

    font-size: 11px;
    font-weight: 650;
}

.badge-green {
    color: #75e5b2;
    border-color: rgba(40, 201, 133, 0.35);
    background: rgba(40, 201, 133, 0.09);
}

.badge-yellow {
    color: #f0cd76;
    border-color: rgba(231, 185, 78, 0.35);
    background: rgba(231, 185, 78, 0.09);
}

.btn-small {
    min-height: 31px;
    padding: 0 11px;

    border: 1px solid var(--border-bright);
    border-radius: 8px;
    background: var(--blue-soft);
    color: #cceeff;

    cursor: pointer;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.activity-row {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 12px;
    padding: 9px 4px;
    border-bottom: 1px solid #122837;
}

.activity-time {
    color: var(--text-dim);
    font-size: 12px;
}

.activity-text {
    color: var(--text-soft);
    font-size: 13px;
}

.placeholder-page {
    min-height: 420px;
    display: grid;
    place-items: center;

    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
}

.placeholder-inner {
    max-width: 520px;
    padding: 40px;
    text-align: center;
}

.placeholder-inner h2 {
    margin: 0 0 12px;
}

.placeholder-inner p {
    color: var(--text-soft);
    line-height: 1.6;
}

.toast {
    position: fixed;
    z-index: 50;
    right: 28px;
    bottom: 28px;

    max-width: 360px;
    padding: 12px 16px;

    border: 1px solid var(--border-bright);
    border-radius: 10px;
    background: #091722;
    color: var(--text);

    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);

    transition:
        opacity 160ms ease,
        transform 160ms ease;
}

.toast.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 1100px) {
    :root {
        --sidebar-width: 205px;
    }

    .dashboard-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        min-height: auto;
    }

    .sidebar-background-space {
        display: none;
    }

    .dashboard-cards {
        grid-template-columns: 1fr;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Panel Principal: paneles de contenido a ancho completo */
.dashboard-grid-single {
    grid-template-columns: minmax(0, 1fr);
}

/* Estado general del sistema */
.system-status {
    display: flex;
    align-items: center;
    gap: 9px;
}

.system-status-dot {
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    border-radius: 50%;
}

.system-status-active {
    color: var(--green);
}

.system-status-active .system-status-dot {
    background: var(--green);
    box-shadow: 0 0 10px rgba(40, 201, 133, 0.55);
}

.system-status-warning {
    color: var(--yellow);
}

.system-status-warning .system-status-dot {
    background: var(--yellow);
    box-shadow: 0 0 10px rgba(231, 185, 78, 0.5);
}

/* =========================================================
   Panel Principal · tabla Bots activos
   ========================================================= */

.active-bots-table {
    width: 100%;
    min-width: 1080px;
    table-layout: fixed;
}

/* Más compacta vertical y horizontalmente */
.active-bots-table th,
.active-bots-table td {
    height: 44px;
    padding: 6px 6px;
    vertical-align: middle;
}

.active-bots-table th {
    font-size: 11px;
}

.active-bots-table td {
    font-size: 12px;
}

/* Tipo */
.active-bots-table .bot-type-column {
    width: 46px;
    padding-left: 2px;
    padding-right: 2px;
    text-align: center;
}

/* Bot */
.active-bots-table th:nth-child(2),
.active-bots-table td:nth-child(2) {
    width: 88px;
}

/* Par */
.active-bots-table th:nth-child(3),
.active-bots-table td:nth-child(3) {
    width: 96px;
}

/* Cuenta */
.active-bots-table th:nth-child(4),
.active-bots-table td:nth-child(4) {
    width: 88px;
}

/* Estado */
.active-bots-table th:nth-child(5),
.active-bots-table td:nth-child(5) {
    width: 142px;
}

/* Rango */
.active-bots-table th:nth-child(6),
.active-bots-table td:nth-child(6) {
    width: 132px;
}

/* Órdenes */
.active-bots-table th:nth-child(7),
.active-bots-table td:nth-child(7) {
    width: 54px;
    text-align: center;
}

/* Trades */
.active-bots-table th:nth-child(8),
.active-bots-table td:nth-child(8) {
    width: 58px;
    text-align: center;
}

/* Acciones rápidas */
.active-bots-table .quick-actions-column {
    width: 238px;
    text-align: center;
}

/* Ver bot */
.active-bots-table .view-column {
    width: 82px;
    text-align: right;
}

.bot-type-badge {
    width: 36px;
    height: 24px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid;
    border-radius: 6px;

    font-size: 10px;
    line-height: 1;
    font-weight: 750;
    letter-spacing: 0.15px;
}

/* Ascendente */
.bot-type-asc {
    color: #ff9299;
    border-color: rgba(231, 93, 103, 0.72);
    background: rgba(231, 93, 103, 0.16);
}

/* Descendente */
.bot-type-dsc {
    color: #6ee0aa;
    border-color: rgba(40, 201, 133, 0.72);
    background: rgba(40, 201, 133, 0.14);
}

/* Lateral */
.bot-type-ltr {
    color: #f0cd76;
    border-color: rgba(231, 185, 78, 0.72);
    background: rgba(231, 185, 78, 0.14);
}

/* Equilibrio */
.bot-type-eqb {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.78);
    background: rgba(255, 255, 255, 0.08);
}

/* DCA futuro */
.bot-type-dca {
    color: #ffffff;
    border-color: #4d5d68;
    background: #000000;
    text-transform: uppercase;
}

/* Futura columna de respuesta rápida */
.quick-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
}

.quick-btn {
    height: 26px;
    min-width: 66px;
    padding: 0 7px;

    border: 1px solid;
    border-radius: 6px;

    font-size: 10px;
    font-weight: 650;

    opacity: 1;
    cursor: default;
}

.quick-btn:disabled {
    opacity: 1;
}

.quick-stop {
    color: #ff969d;
    border-color: rgba(231, 93, 103, 0.72);
    background: rgba(231, 93, 103, 0.13);
}

.quick-pause {
    color: #70e2ad;
    border-color: rgba(40, 201, 133, 0.72);
    background: rgba(40, 201, 133, 0.12);
}

.quick-trim {
    color: #f1ce76;
    border-color: rgba(231, 185, 78, 0.72);
    background: rgba(231, 185, 78, 0.12);
}

/* Mantener Ver bot compacto */
.active-bots-table .btn-small {
    min-height: 27px;
    padding: 0 9px;
    font-size: 11px;
}

/* =========================================================
   Cuentas Binance
   ========================================================= */

.accounts-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.accounts-heading {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 700;
}

.accounts-description {
    margin: 0;
    color: var(--text-soft);
    font-size: 13px;
}

.accounts-add-btn {
    height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 7px;

    padding: 0 15px;

    border: 1px solid #187db0;
    border-radius: 8px;

    background: rgba(24, 169, 230, 0.16);
    color: #d8f4ff;

    font-weight: 650;
    cursor: pointer;
}

.accounts-add-btn span {
    color: var(--blue);
    font-size: 18px;
}

.accounts-panel {
    padding: 0;
    overflow: hidden;
}

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

.accounts-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
    table-layout: fixed;
}

.accounts-table th,
.accounts-table td {
    height: 56px;
    padding: 7px 15px;

    border-bottom: 1px solid #142b3b;

    text-align: left;
    vertical-align: middle;
}

.accounts-table th {
    height: 42px;

    color: var(--text-soft);
    background: rgba(7, 17, 27, 0.55);

    font-size: 11px;
    font-weight: 600;
}

.accounts-table td {
    font-size: 12px;
}

.accounts-table th:nth-child(1),
.accounts-table td:nth-child(1) {
    width: 29%;
}

.accounts-table th:nth-child(2),
.accounts-table td:nth-child(2) {
    width: 17%;
}

.accounts-table th:nth-child(3),
.accounts-table td:nth-child(3) {
    width: 17%;
}

.accounts-table th:nth-child(4),
.accounts-table td:nth-child(4) {
    width: 16%;
}

.accounts-table th:nth-child(5),
.accounts-table td:nth-child(5) {
    width: 10%;
    text-align: center;
}

.accounts-table th:nth-child(6),
.accounts-table td:nth-child(6) {
    width: 16%;
}

.account-row:last-child td {
    border-bottom: 0;
}

.account-main {
    background: rgba(24, 169, 230, 0.035);
}

.account-sub {
    background: rgba(3, 11, 17, 0.38);
}

.account-name-cell {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.account-expand {
    width: 20px;
    padding: 0;

    border: 0;
    background: transparent;

    color: var(--text-soft);
    font-size: 14px;

    opacity: 1;
}

.account-star {
    color: #f4c43d;
    font-size: 16px;
}

.account-name-block {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.account-name-line {
    display: flex;
    align-items: center;
    gap: 8px;
}

.account-name-block strong {
    color: var(--text);
    font-size: 12px;
    font-weight: 650;
}

.account-secondary {
    color: var(--text-dim);
    font-size: 10px;
}

.default-badge {
    display: inline-flex;
    align-items: center;

    height: 21px;
    padding: 0 7px;

    border: 1px solid rgba(24, 169, 230, 0.55);
    border-radius: 5px;

    color: #62cfff;
    background: rgba(24, 169, 230, 0.08);

    font-size: 9px;
    font-weight: 650;
}

.subaccount-guide {
    width: 31px;
    height: 28px;
    flex: 0 0 31px;

    margin-left: 5px;

    border-left: 1px solid #294254;
    border-bottom: 1px solid #294254;
    border-bottom-left-radius: 6px;
}

.independent-spacer {
    width: 28px;
    flex: 0 0 28px;
}

.account-type {
    color: var(--text-soft);
}

.connection-badge {
    min-width: 96px;
    height: 26px;

    display: inline-flex;
    align-items: center;
    gap: 7px;

    padding: 0 9px;

    border: 1px solid;
    border-radius: 7px;

    font-size: 10px;
    font-weight: 650;
}

.connection-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.connection-badge.connected {
    color: #67e3ad;
    border-color: rgba(40, 201, 133, 0.35);
    background: rgba(40, 201, 133, 0.08);
}

.connection-badge.connected .connection-dot {
    background: var(--green);
    box-shadow: 0 0 8px rgba(40, 201, 133, 0.48);
}

.connection-badge.disconnected {
    color: #f0cd76;
    border-color: rgba(231, 185, 78, 0.35);
    background: rgba(231, 185, 78, 0.08);
}

.connection-badge.disconnected .connection-dot {
    background: var(--yellow);
    box-shadow: 0 0 8px rgba(231, 185, 78, 0.4);
}

.account-balance {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.account-muted {
    color: var(--text-dim);
}

.account-bots {
    font-weight: 650;
}

.account-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.account-view-btn,
.account-reconnect-btn {
    height: 29px;
    min-width: 82px;

    padding: 0 10px;

    border-radius: 6px;

    font-size: 10px;
    font-weight: 650;

    cursor: pointer;
}

.account-view-btn {
    color: #d5f3ff;
    border: 1px solid #187db0;
    background: rgba(24, 169, 230, 0.14);
}

.account-reconnect-btn {
    color: #f0cd76;
    border: 1px solid rgba(231, 185, 78, 0.55);
    background: rgba(231, 185, 78, 0.08);
}

.account-menu-btn {
    width: 29px;
    height: 29px;

    padding: 0;

    border: 1px solid #203a4e;
    border-radius: 6px;

    background: #0b1924;
    color: var(--text-soft);

    cursor: pointer;
}

.accounts-section-row td {
    height: 34px;

    padding-top: 6px;
    padding-bottom: 6px;

    color: #6d8799;
    background: rgba(2, 8, 13, 0.75);

    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.65px;
}

.accounts-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 13px;
}

.account-summary-card {
    min-height: 74px;

    display: flex;
    flex-direction: column;
    justify-content: center;

    padding: 12px 15px;

    border: 1px solid var(--border);
    border-radius: 11px;

    background: var(--panel);
}

.account-summary-label {
    margin-bottom: 6px;

    color: var(--text-soft);
    font-size: 10px;
}

.account-summary-card strong {
    font-size: 18px;
    font-weight: 700;
}

@media (max-width: 900px) {
    .accounts-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* =========================================================
   Pantalla Bots
   ========================================================= */

.bots-screen {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.bots-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.bots-topbar-left,
.bots-topbar-right {
    display: flex;
    align-items: center;
}

.bots-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bots-tab {
    height: 40px;
    display: inline-flex;
    align-items: center;

    padding: 0 16px;

    border: 1px solid #1a344b;
    border-radius: 9px;

    background: rgba(8, 18, 27, 0.88);
    color: var(--text-soft);

    font-size: 12px;
    font-weight: 650;
}

.bots-tab.active {
    color: #d9f4ff;
    border-color: #207da8;
    background: rgba(24, 169, 230, 0.13);
}

.bots-tab-disabled {
    opacity: 0.48;
    text-decoration: line-through;
    cursor: not-allowed;
}

.create-bot-btn {
    min-width: 190px;
    height: 46px;
    padding: 0 22px;

    border: 1px solid #1c8fc0;
    border-radius: 10px;

    background: #1284b4;
    color: #ffffff;

    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.5px;

    box-shadow: 0 0 0 1px rgba(18, 132, 180, 0.15) inset;
    cursor: pointer;
}

.create-bot-btn:hover {
    filter: brightness(1.05);
}

.bots-main-panel {
    display: flex;
    flex-direction: column;
    min-height: 68vh;
    padding-bottom: 12px;
}

.bots-main-panel .panel-header {
    padding-bottom: 8px;
}

.bots-full-table-wrap {
    flex: 1;
    overflow: auto;
}

.bots-full-table {
    width: 100%;
    min-width: 1180px;
}

.bots-full-table th,
.bots-full-table td {
    height: 46px;
}

@media (max-width: 1100px) {
    .bots-topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .bots-topbar-right {
        justify-content: flex-start;
    }

    .create-bot-btn {
        width: 100%;
    }
}
/* Crear bot nuevo */
.create-bot-page {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.create-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
}

.create-step {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: var(--text-muted);
}

.create-step:not(:last-child)::after {
    content: "";
    width: 34px;
    height: 1px;
    margin-left: 4px;
    background: rgba(255,255,255,.12);
}

.create-step span {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.15);
    font-size: 11px;
}

.create-step.active {
    color: var(--text-primary);
}

.create-step.active span {
    border-color: #20c997;
    color: #20c997;
}

.create-bot-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 285px;
    gap: 14px;
    align-items: start;
}

.create-bot-form,
.create-summary {
    padding: 18px;
}

.create-section {
    padding: 17px 0;
    border-top: 1px solid rgba(255,255,255,.07);
}

.create-section:first-of-type {
    margin-top: 10px;
}

.create-section h3 {
    margin: 0 0 13px;
    font-size: 13px;
    font-weight: 650;
    color: var(--text-primary);
}

.create-grid {
    display: grid;
    gap: 12px;
}

.create-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.create-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.create-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.create-field > span,
.create-option label {
    font-size: 11px;
    color: var(--text-muted);
}

.create-field input,
.create-field select,
.create-option input {
    width: 100%;
    box-sizing: border-box;
    height: 38px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(0,0,0,.28);
    color: var(--text-primary);
    padding: 0 10px;
    outline: none;
}

.create-field input:focus,
.create-field select:focus,
.create-option input:focus {
    border-color: rgba(32,201,151,.58);
}

.create-readonly {
    min-height: 38px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.07);
    background: rgba(255,255,255,.025);
    color: var(--text-muted);
    font-size: 11px;
}

.bot-type-selector {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.strategy-card {
    min-height: 72px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 10px;
    padding: 11px;
    background: rgba(255,255,255,.025);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.strategy-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.strategy-card strong {
    font-size: 12px;
}

.strategy-card span {
    font-size: 10px;
    line-height: 1.35;
    color: var(--text-muted);
}

.strategy-card.selected {
    border-color: rgba(32,201,151,.62);
    box-shadow: inset 0 0 0 1px rgba(32,201,151,.12);
}

.strategy-card.disabled {
    opacity: .35;
    cursor: default;
    text-decoration: line-through;
}

.create-options-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.create-option {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.create-option label {
    min-height: 18px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.create-option label input {
    width: auto;
    height: auto;
}

.create-option small {
    color: var(--text-muted);
    font-size: 9px;
}

.create-option-disabled {
    opacity: .45;
}

.create-hint {
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 10px;
}

.create-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 4px;
}

.create-actions button {
    min-width: 130px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
}

.create-preview-btn {
    border: 0;
    background: #19b889;
    color: #04110d;
    font-weight: 750;
}

.btn-secondary {
    border: 1px solid rgba(255,255,255,.12);
    background: transparent;
    color: var(--text-primary);
}

.create-summary {
    position: sticky;
    top: 14px;
}

.create-summary-list {
    margin-top: 18px;
}

.create-summary-list > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,.06);
    font-size: 11px;
}

.create-summary-list span {
    color: var(--text-muted);
}

.create-summary-list strong {
    text-align: right;
    font-weight: 600;
}

.create-summary-note {
    margin-top: 18px;
    padding: 11px;
    border-radius: 8px;
    background: rgba(32,201,151,.055);
    border: 1px solid rgba(32,201,151,.12);
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.5;
}

@media (max-width: 1100px) {
    .create-bot-layout {
        grid-template-columns: 1fr;
    }

    .create-summary {
        position: static;
    }

    .create-grid-4,
    .create-options-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Selector principal de tipo de bot */

.bot-family-page {
    display: flex;
    justify-content: center;
}

.bot-family-panel {
    width: min(980px, 100%);
    padding: 26px;
}

.bot-family-header {
    margin-bottom: 24px;
}

.bot-family-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.bot-family-card {
    position: relative;
    min-height: 260px;
    padding: 28px 22px 20px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.09);
    background: rgba(255,255,255,.025);
    color: var(--text-primary);
    text-align: left;
}

button.bot-family-card {
    cursor: pointer;
    font: inherit;
}

.bot-family-card-active {
    border-color: rgba(32,201,151,.4);
    background:
        linear-gradient(
            180deg,
            rgba(32,201,151,.06),
            rgba(255,255,255,.02)
        );
    transition:
        border-color .16s ease,
        transform .16s ease,
        background .16s ease;
}

.bot-family-card-active:hover {
    transform: translateY(-2px);
    border-color: rgba(32,201,151,.75);
    background:
        linear-gradient(
            180deg,
            rgba(32,201,151,.10),
            rgba(255,255,255,.025)
        );
}

.bot-family-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    margin-bottom: 24px;
    border-radius: 12px;
    background: rgba(255,255,255,.045);
    font-size: 27px;
}

.bot-family-card-active .bot-family-icon {
    background: rgba(32,201,151,.10);
    color: #20c997;
}

.bot-family-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bot-family-content strong {
    font-size: 22px;
    letter-spacing: .035em;
}

.bot-family-content span {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.6;
}

.bot-family-action {
    position: absolute;
    left: 22px;
    right: 22px;
    bottom: 20px;
    height: 35px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(32,201,151,.12);
    color: #20c997;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .03em;
}

.bot-family-card-disabled {
    opacity: .62;
    cursor: default;
}

.bot-family-coming-soon {
    position: absolute;
    top: -10px;
    right: 18px;
    padding: 6px 10px;
    border-radius: 6px;
    background: #c93b45;
    color: white;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .08em;
    box-shadow: 0 4px 12px rgba(0,0,0,.24);
}

.bot-family-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
}

.bot-family-footer .btn-secondary {
    min-width: 130px;
    height: 39px;
    border-radius: 8px;
    cursor: pointer;
}

/* GRID tiene solamente Ascendente / Descendente / Lateral */

.create-bot-page .bot-type-selector {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 900px) {
    .bot-family-grid {
        grid-template-columns: 1fr;
    }

    .bot-family-card {
        min-height: 200px;
    }
}

/* GRID - versión compacta para escritorio wide */

.create-bot-page {
    gap: 9px;
}

.create-progress {
    padding: 8px 14px;
}

.create-step span {
    width: 19px;
    height: 19px;
}

.create-bot-layout {
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) 255px;
}

.create-bot-form,
.create-summary {
    padding: 13px 15px;
}

/*
   Distribución:
   1. Cuenta/Mercado       ancho completo
   2. Tipo de Grid         ancho completo
   3. Grilla inicial       columna izquierda
   4. Opciones estrategia  columna derecha
*/
.create-bot-form {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
    column-gap: 18px;
    align-items: start;
}

.create-bot-form > .panel-header,
.create-bot-form > .create-actions {
    grid-column: 1 / -1;
}

.create-bot-form > .create-section:nth-of-type(1),
.create-bot-form > .create-section:nth-of-type(2) {
    grid-column: 1 / -1;
}

.create-bot-form > .create-section:nth-of-type(3) {
    grid-column: 1;
}

.create-bot-form > .create-section:nth-of-type(4) {
    grid-column: 2;
}

.create-section {
    padding: 10px 0;
}

.create-section:first-of-type {
    margin-top: 4px;
}

.create-section h3 {
    margin-bottom: 8px;
}

.create-grid {
    gap: 8px;
}

.create-field {
    gap: 5px;
}

.create-field input,
.create-field select,
.create-option input,
.create-readonly {
    height: 34px;
}

.create-market-grid {
    grid-template-columns:
        minmax(150px, 1.15fr)
        minmax(120px, .9fr)
        minmax(120px, .8fr)
        minmax(160px, 1.2fr);
}

.bot-type-selector {
    gap: 8px;
}

.strategy-card {
    min-height: 54px;
    padding: 8px 10px;
    gap: 2px;
}

.strategy-card strong {
    font-size: 11px;
}

.strategy-card span {
    font-size: 9px;
}

.create-bot-form > .create-section:nth-of-type(3) .create-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.create-options-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
}

.create-option {
    gap: 5px;
}

.create-hint {
    margin-top: 7px;
}

.create-actions {
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,.07);
}

.create-actions button {
    height: 36px;
}

.create-summary-list {
    margin-top: 10px;
}

.create-summary-list > div {
    padding: 7px 0;
}

.create-summary-note {
    margin-top: 11px;
    padding: 9px;
}

@media (max-width: 1200px) {
    .create-bot-form {
        display: block;
    }

    .create-market-grid,
    .create-bot-form > .create-section:nth-of-type(3) .create-grid-4,
    .create-options-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Configuración avanzada GRID */

.advanced-config {
    width: 100%;
}

.advanced-config-toggle {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.advanced-config-label {
    min-height: 42px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    padding: 8px 11px 8px 38px;
    position: relative;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 9px;
    background: rgba(255,255,255,.025);
    cursor: pointer;
    user-select: none;
}

.advanced-config-label::before {
    content: "";
    position: absolute;
    left: 12px;
    width: 15px;
    height: 15px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,.25);
    background: rgba(0,0,0,.18);
}

.advanced-config-label > span {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.advanced-config-label strong {
    font-size: 11px;
    color: var(--text-primary);
}

.advanced-config-label small {
    font-size: 9px;
    color: var(--text-muted);
}

.advanced-config-toggle:checked + .advanced-config-label {
    border-color: rgba(32,201,151,.45);
    background: rgba(32,201,151,.045);
}

.advanced-config-toggle:checked + .advanced-config-label::before {
    content: "✓";
    display: grid;
    place-items: center;
    border-color: #20c997;
    background: #20c997;
    color: #07130f;
    font-size: 11px;
    font-weight: 900;
}

.advanced-config-body {
    display: none;
    margin-top: 10px;
}

.advanced-config-toggle:checked ~ .advanced-config-body {
    display: grid;
}

/* Grilla inicial: 2 x 2, campos amplios y alineados */

.create-bot-form > .create-section:nth-of-type(3) .create-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
}

.create-bot-form > .create-section:nth-of-type(3) .create-field {
    min-width: 0;
}

.create-bot-form > .create-section:nth-of-type(3) .create-field > span {
    min-height: 28px;
    display: flex;
    align-items: flex-end;
    line-height: 1.25;
    font-size: 11px;
}

.create-bot-form > .create-section:nth-of-type(3) .create-field input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    font-size: 16px;
    box-sizing: border-box;
}

.create-bot-form > .create-section:nth-of-type(3) .create-hint {
    margin-top: 12px;
    line-height: 1.45;
}

/* Grilla inicial: 2 x 2, campos amplios y alineados */

.create-bot-form > .create-section:nth-of-type(3) .create-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
}

.create-bot-form > .create-section:nth-of-type(3) .create-field {
    min-width: 0;
}

.create-bot-form > .create-section:nth-of-type(3) .create-field > span {
    min-height: 28px;
    display: flex;
    align-items: flex-end;
    line-height: 1.25;
    font-size: 11px;
}

.create-bot-form > .create-section:nth-of-type(3) .create-field input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    font-size: 16px;
    box-sizing: border-box;
}

.create-bot-form > .create-section:nth-of-type(3) .create-hint {
    margin-top: 12px;
    line-height: 1.45;
}

/* Grilla inicial - disposición definitiva 2 x 2 */

.grid-initial-section .create-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px 18px;
}

.grid-initial-section .create-field {
    min-width: 0;
    gap: 6px;
}

.grid-initial-section .create-field > span {
    min-height: 16px;
    display: block;
    line-height: 1.3;
}

.grid-initial-section .create-field input {
    width: 100%;
    height: 42px;
    box-sizing: border-box;
    padding: 0 12px;
    font-size: 15px;
}

.grid-initial-section .create-hint {
    margin-top: 12px;
    line-height: 1.45;
}

/*
 * GRID wide:
 * comportamiento y configuración avanzada comparten la columna izquierda;
 * la grilla ocupa la derecha.
 */

.grid-behavior-section {
    grid-column: 1 !important;
    grid-row: 3 !important;
    align-self: start;
}

.grid-initial-section {
    grid-column: 2 !important;
    grid-row: 3 !important;
    align-self: start;
}

.grid-advanced-section {
    grid-column: 1 !important;
    grid-row: 3 !important;
    align-self: start;
    margin-top: 108px;
    padding-top: 0;
    border-top: 0;
}

/* Al desplegarla sigue usando solamente el espacio necesario. */
.grid-advanced-section .advanced-config-body {
    margin-top: 8px;
}

/* Texto informativo más discreto. */
.grid-initial-section .create-hint {
    margin-top: 9px;
    font-size: 10px;
}

/* Acciones siempre debajo de las dos columnas. */
.create-bot-form > .create-actions {
    grid-column: 1 / -1 !important;
    grid-row: 4 !important;
}

/* GRID: secciones bloqueadas hasta elegir comportamiento */

.config-locked {
    opacity: .38;
    transition: opacity .15s ease;
}

.config-locked input,
.config-locked select,
.config-locked textarea,
.config-locked .advanced-config-label {
    cursor: not-allowed;
}

.grid-initial-section:not(.config-locked),
.grid-advanced-section:not(.config-locked) {
    opacity: 1;
}

/* Estado de revisión GRID */

.create-step.complete {
    color: var(--text-muted);
}

.create-step.complete span {
    border-color: rgba(32,201,151,.45);
    color: #20c997;
}

.create-step.complete span::after {
    content: "✓";
}

.create-step.complete span {
    font-size: 0;
}

.create-step.complete span::after {
    font-size: 10px;
}

.create-summary-note.review-ok {
    border-color: rgba(32,201,151,.28);
    background: rgba(32,201,151,.08);
    color: var(--text-primary);
}

.create-summary-note.review-warning {
    border-color: rgba(230,177,66,.32);
    background: rgba(230,177,66,.08);
    color: var(--text-primary);
}

.create-summary-note.review-blocked {
    border-color: rgba(220,75,85,.34);
    background: rgba(220,75,85,.08);
    color: var(--text-primary);
}

.review-message-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 7px;
}

.create-preview-btn:disabled {
    opacity: .55;
    cursor: wait;
}

/* INICIAR ocupa el antiguo espacio de Precio actual */

.create-start-slot {
    display: flex;
    align-items: flex-end;
    min-width: 0;
}

.start-grid-btn {
    width: 100%;
    height: 44px;
    border-radius: 8px;
    border: 1px solid rgba(130,165,190,.38);
    background: rgba(80,105,125,.24);
    color: rgba(190,210,225,.52);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .035em;
    cursor: not-allowed;
    transition:
        background .15s ease,
        border-color .15s ease,
        box-shadow .15s ease,
        color .15s ease;
}

.start-grid-icon {
    margin-right: 9px;
}

.start-grid-btn.ready {
    border-color: #17e2b1;
    background: #18cda0;
    color: #03100d;
    cursor: pointer;
    box-shadow: 0 0 18px rgba(24,205,160,.20);
}


/* Resultado de REVISAR: mucho más visible */

.create-summary-note.review-blocked,
.create-summary-note.review-ok,
.create-summary-note.review-warning {
    padding: 15px 14px;
    border-width: 2px;
    border-style: solid;
}

.create-summary-note.review-blocked {
    border-color: #ff303c;
    background:
        linear-gradient(
            180deg,
            rgba(150,10,22,.38),
            rgba(86,5,14,.28)
        );
    box-shadow:
        0 0 0 1px rgba(255,48,60,.14),
        0 0 22px rgba(255,30,45,.22);
}

.create-summary-note.review-ok {
    border-color: #20e676;
    background:
        linear-gradient(
            180deg,
            rgba(12,126,61,.38),
            rgba(4,83,38,.28)
        );
    box-shadow:
        0 0 0 1px rgba(32,230,118,.14),
        0 0 22px rgba(32,230,118,.22);
}

.create-summary-note.review-warning {
    border-color: #efb832;
    background:
        linear-gradient(
            180deg,
            rgba(135,93,10,.35),
            rgba(83,56,4,.24)
        );
    box-shadow:
        0 0 18px rgba(239,184,50,.16);
}

.review-status-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 11px;
}

.review-status-head strong {
    font-size: 13px;
    color: #fff;
}

.review-status-icon {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 18px;
    font-weight: 900;
    color: white;
}

.review-blocked .review-status-icon {
    background: #ff2735;
    box-shadow: 0 0 12px rgba(255,39,53,.34);
}

.review-ok .review-status-icon {
    background: #20df73;
    box-shadow: 0 0 12px rgba(32,223,115,.30);
}

.review-warning .review-status-icon {
    background: #e4a91c;
}

.review-message-list {
    gap: 7px;
    line-height: 1.45;
}

.review-ok-list {
    color: rgba(235,255,243,.94);
}

/* ===== Autenticación ===== */

.is-hidden {
    display: none !important;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px;
    position: relative;
    z-index: 2;
}

.auth-card {
    width: min(430px, 100%);
    padding: 34px;
    border-radius: 20px;
    background: rgba(12, 18, 28, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.09);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

.auth-brand {
    text-align: center;
    margin-bottom: 28px;
}

.auth-brand h1 {
    margin: 0;
    font-size: 30px;
}

.auth-brand p {
    margin: 7px 0 0;
    opacity: 0.65;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 24px;
}

.auth-tab,
.auth-submit,
.logout-btn {
    cursor: pointer;
    border: 0;
}

.auth-tab {
    padding: 11px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.05);
    color: inherit;
}

.auth-tab.active {
    background: rgba(255, 255, 255, 0.14);
}

.auth-form {
    display: grid;
    gap: 18px;
}

.auth-form label {
    display: grid;
    gap: 8px;
    font-weight: 600;
}

.auth-form input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 13px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    background: rgba(255, 255, 255, 0.06);
    color: inherit;
    font: inherit;
}

.auth-submit {
    margin-top: 4px;
    padding: 13px;
    border-radius: 9px;
    font-weight: 700;
}

.auth-message {
    min-height: 22px;
    margin: 18px 0 0;
    text-align: center;
    font-size: 14px;
    opacity: 0.8;
}

.logout-btn {
    margin-left: auto;
    padding: 6px 10px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
    font-size: 12px;
}

/* ===== Agregar cuenta Binance ===== */

.account-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.65);
}

.account-modal-card {
    width: min(520px, 100%);
    padding: 28px;
    border-radius: 16px;
    background: #111927;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.account-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.account-modal-header h3 {
    margin: 0;
}

.account-modal-close {
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 28px;
    cursor: pointer;
}

.account-form {
    display: grid;
    gap: 18px;
}

.account-form label {
    display: grid;
    gap: 8px;
    font-weight: 600;
}

.account-form input {
    box-sizing: border-box;
    width: 100%;
    padding: 12px 13px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    background: rgba(255, 255, 255, 0.06);
    color: inherit;
    font: inherit;
}

/* Usuario siempre visible en mayúsculas.
   Solo presentación: no modifica el valor enviado al backend. */
.auth-form input[name="username"],
.user-info strong {
    text-transform: uppercase;
}

/* Acciones rápidas realmente habilitadas */
.quick-btn:not(:disabled) {
    cursor: pointer;
}

.quick-btn:not(:disabled):hover {
    filter: brightness(1.18);
}

.quick-btn:disabled {
    cursor: default;
}

/* Panel Principal · edición del nombre del bot */
.dashboard-bot-name-edit {
    appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    margin-left: 6px;
    padding: 1px 3px;
    font: inherit;
    opacity: 0.55;
}

.dashboard-bot-name-edit:hover {
    opacity: 1;
}

.dashboard-bot-name-edit:disabled {
    cursor: default;
    opacity: 0.3;
}


/* Cuentas Binance · cuenta predeterminada */
.account-name-line {
    display: flex;
    align-items: center;
    gap: 7px;
}

.account-default-star,
.account-name-edit {
    appearance: none;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 2px;
    line-height: 1;
}

.account-default-star {
    color: #607789;
    font-size: 20px;
}

.account-default-star:hover {
    color: #e7b94e;
}

.account-default-star.active {
    color: #e7b94e;
}

.account-default-star:disabled {
    cursor: default;
    opacity: 0.35;
}

.account-name-edit {
    color: var(--text-soft);
    font-size: 15px;
    opacity: 0.55;
}

.account-name-edit:hover {
    opacity: 1;
}

.account-name-edit:disabled {
    cursor: default;
    opacity: 0.3;
}

.account-balance {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Ver cuenta Binance */
.view-account-screen {
    display: grid;
    gap: 14px;
}

.view-account-header {
    padding: 22px 24px;
}

.view-account-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.view-account-title-line {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.view-account-title-line h2 {
    margin: 0;
    font-size: 21px;
}

.view-account-star {
    color: #607789;
    font-size: 22px;
}

.view-account-star.active {
    color: #e7b94e;
}

.view-account-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.view-account-delete {
    border-color: rgba(231, 93, 103, 0.45);
    color: #ef8a92;
}

.view-account-balance-header {
    align-items: center;
}

.view-account-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-soft);
    font-size: 13px;
    cursor: pointer;
}

.view-account-filter input {
    width: 16px;
    height: 16px;
}

.account-balance-pair {
    display: grid;
    gap: 2px;
}

.account-balance-pair span {
    color: var(--text-soft);
    font-size: 12px;
}

@media (max-width: 900px) {
    .view-account-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .view-account-actions {
        justify-content: flex-start;
    }

    .view-account-balance-header {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* CREATE BOT SIMPLE REDESIGN 2026-09-20 */

.create-bot-redesign {
    width: 100%;
}

.create-bot-redesign .create-bot-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
    align-items: start;
}

.create-bot-redesign .create-bot-form {
    display: block;
    min-height: 0;
    padding: 0;
    overflow: visible;
}

.create-bot-redesign .create-section {
    display: block;
    width: auto;
    min-height: 0;
    padding: 22px 24px;
}

.create-bot-redesign .create-section + .create-section {
    border-top:
        1px solid rgba(130, 160, 190, 0.13);
}

.create-section-heading {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
}

.create-section-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 50%;
    color: #48d4ff;
    border:
        1px solid rgba(0, 190, 255, 0.40);
    background:
        rgba(0, 170, 230, 0.14);
    font-weight: 800;
}

.create-section-heading h2 {
    margin: 1px 0 3px;
    font-size: 18px;
}

.create-section-heading p {
    margin: 0;
    color: #8392a6;
    font-size: 13px;
}

.create-bot-redesign .create-basics-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr)
        minmax(0, 1fr);
    gap: 16px;
}

.create-bot-redesign .create-field {
    position: relative;
    min-width: 0;
}

.create-bot-redesign .create-field > span {
    display: block;
    margin-bottom: 7px;
}

.create-bot-redesign .create-field small {
    display: block;
    margin-top: 6px;
    color: #718197;
    font-size: 11px;
}

.create-bot-redesign .create-field input,
.create-bot-redesign .create-field select {
    width: 100%;
    box-sizing: border-box;
    min-height: 42px;
}

.create-basics-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
}

.create-next-btn {
    min-width: 132px;
    min-height: 42px;
    padding: 0 18px;
    border: 0;
    border-radius: 8px;
    background:
        linear-gradient(
            135deg,
            #058bd7,
            #12b8df
        );
    color: #ffffff;
    font-weight: 800;
    cursor: pointer;
}

#create-step-two[hidden] {
    display: none !important;
}

.create-subtitle {
    margin-bottom: 10px;
    color: #dfeaf5;
    font-size: 13px;
    font-weight: 700;
}

.create-bot-redesign .bot-type-selector {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
}

.create-bot-redesign .strategy-card {
    position: relative;
    display: block;
    min-height: 74px;
    padding:
        14px 38px
        14px 52px;
    border-radius: 9px;
}

.create-bot-redesign .strategy-card input {
    position: absolute;
    top: 50%;
    right: 13px;
    transform: translateY(-50%);
}

.create-bot-redesign .strategy-card strong {
    display: block;
    margin-bottom: 4px;
}

.create-bot-redesign .strategy-card span {
    display: block;
    margin: 0;
    line-height: 1.35;
    color: #8c9bae;
    font-size: 11px;
}

.strategy-card-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    color: #48d4ff;
    background:
        rgba(0, 177, 255, 0.11);
    font-size: 18px;
    font-weight: 800;
}

.create-bot-redesign .strategy-card.selected {
    border-color: #00bce8;
    background:
        linear-gradient(
            135deg,
            rgba(0, 160, 225, 0.14),
            rgba(0, 217, 190, 0.04)
        );
}

.mandatory-config-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 0.9fr)
        minmax(0, 1.1fr);
    gap: 28px;
}

.mandatory-block h3 {
    margin: 0 0 12px;
    color: #dfeaf5;
    font-size: 13px;
}

.price-range-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        24px
        minmax(0, 1fr);
    gap: 8px;
    align-items: end;
}

.range-separator {
    align-self: center;
    justify-self: center;
    padding-top: 18px;
    color: #718197;
}

.grid-count-spacing {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr);
    gap: 12px;
}

.order-size-block {
    width: min(340px, 100%);
    margin-top: 22px;
}

.create-bot-redesign .create-hint {
    margin-top: 8px;
}

.create-bot-redesign .grid-advanced-section {
    padding-top: 14px;
    padding-bottom: 14px;
}

.create-bot-redesign .advanced-config {
    width: 100%;
}

.create-bot-redesign .create-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 18px 24px 22px;
    border-top:
        1px solid rgba(130, 160, 190, 0.13);
}

.create-bot-redesign .create-actions button {
    min-width: 125px;
    min-height: 42px;
    border-radius: 8px;
    font-weight: 800;
}

.create-bot-redesign .start-grid-btn {
    border: 0;
    background:
        linear-gradient(
            135deg,
            #009d76,
            #00c99a
        );
    color: #ffffff;
}

.create-bot-redesign .start-grid-btn:disabled {
    opacity: 0.32;
    cursor: not-allowed;
}

.create-bot-redesign .create-summary {
    position: sticky;
    top: 18px;
    width: auto;
    min-width: 0;
    padding: 20px;
}

.pair-picker {
    z-index: 30;
}

.symbol-suggestions {
    position: absolute;
    z-index: 100;
    top: 68px;
    left: 0;
    right: 0;
    max-height: 290px;
    overflow-y: auto;
    border:
        1px solid rgba(48, 196, 255, 0.35);
    border-radius: 9px;
    background: #101b29;
    box-shadow:
        0 18px 45px rgba(0, 0, 0, 0.48);
}

.symbol-suggestion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 11px 13px;
    border: 0;
    border-bottom:
        1px solid rgba(130, 160, 190, 0.10);
    background: transparent;
    color: #e8f3ff;
    text-align: left;
    cursor: pointer;
}

.symbol-suggestion:last-child {
    border-bottom: 0;
}

.symbol-suggestion:hover {
    background:
        rgba(0, 180, 240, 0.12);
}

.symbol-suggestion strong {
    font-size: 13px;
}

.symbol-suggestion small {
    color: #78899e;
    font-size: 11px;
}

.symbol-no-results {
    padding: 13px;
    color: #8291a4;
    font-size: 12px;
}

@media (max-width: 1100px) {
    .create-bot-redesign .create-bot-layout {
        grid-template-columns: 1fr;
    }

    .create-bot-redesign .create-summary {
        position: static;
    }
}

@media (max-width: 760px) {
    .create-bot-redesign .create-basics-grid,
    .mandatory-config-grid,
    .create-bot-redesign .bot-type-selector,
    .grid-count-spacing {
        grid-template-columns: 1fr;
    }

    .price-range-grid {
        grid-template-columns: 1fr;
    }

    .range-separator {
        display: none;
    }

    .create-bot-redesign .create-actions {
        flex-wrap: wrap;
    }
}

/* ============================================================
   Crear / Ver bot: campos obligatorios más amplios
   ============================================================ */

.create-bot-redesign .mandatory-config-grid {
    grid-template-columns:
        minmax(440px, 1.25fr)
        minmax(340px, 0.9fr);
    gap: 36px;
    align-items: start;
}

.create-bot-redesign .price-range-grid {
    grid-template-columns:
        minmax(185px, 1fr)
        28px
        minmax(185px, 1fr);
    gap: 12px;
}

.create-bot-redesign .grid-count-spacing {
    grid-template-columns:
        minmax(155px, 1fr)
        minmax(155px, 1fr);
    gap: 16px;
}

.create-bot-redesign .mandatory-block .create-field input,
.create-bot-redesign .mandatory-block .create-field select {
    min-height: 46px;
    padding-left: 14px;
    padding-right: 38px;
    font-size: 16px;
}

.create-bot-redesign .order-size-block {
    width: min(420px, 100%);
}

.create-bot-redesign .order-size-block input {
    min-height: 46px;
    font-size: 16px;
}

/* En anchos intermedios evitamos comprimir los precios. */
@media (max-width: 1250px) {
    .create-bot-redesign .mandatory-config-grid {
        grid-template-columns: 1fr;
        gap: 26px;
    }

    .create-bot-redesign .price-range-grid {
        grid-template-columns:
            minmax(180px, 1fr)
            28px
            minmax(180px, 1fr);
    }

    .create-bot-redesign .grid-count-spacing {
        max-width: 520px;
    }
}


/* Global binary controls · switch */
.app-switch {
    appearance: none;
    -webkit-appearance: none;
    width: 42px;
    height: 22px;
    min-width: 42px;
    margin: 0;
    border: 1px solid #365166;
    border-radius: 999px;
    background: #263746;
    position: relative;
    cursor: pointer;
    vertical-align: middle;
    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        opacity 0.18s ease;
}

.app-switch::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 2px;
    left: 3px;
    border-radius: 50%;
    background: #a9b6c0;
    transition:
        left 0.18s ease,
        background 0.18s ease;
}

.app-switch:checked {
    background: #148fbd;
    border-color: #20a9df;
}

.app-switch:checked::before {
    left: 21px;
    background: #ffffff;
}

.app-switch:disabled {
    opacity: 0.38;
    cursor: not-allowed;
}


/* Binary option labels */
.binary-option-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.binary-option-label:has(.app-switch:disabled) {
    cursor: default;
}


/* Switch controls · definitive normalization */

/* Un solo switch real, sin pseudo-elementos heredados */
input.app-switch,
.create-option input.app-switch,
.view-account-filter input.app-switch {
    appearance: none !important;
    -webkit-appearance: none !important;

    display: inline-block !important;
    flex: 0 0 42px !important;

    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;

    height: 22px !important;
    min-height: 22px !important;
    max-height: 22px !important;

    padding: 0 !important;
    margin: 0 !important;

    border: 1px solid #365166 !important;
    border-radius: 999px !important;

    background:
        radial-gradient(
            circle at 11px 50%,
            #a9b6c0 0 7px,
            transparent 8px
        ),
        #263746 !important;

    position: relative !important;
    opacity: 1 !important;
    pointer-events: auto !important;

    cursor: pointer !important;
    box-shadow: none !important;
    vertical-align: middle !important;

    transition:
        background .18s ease,
        border-color .18s ease,
        opacity .18s ease !important;
}

input.app-switch::before,
input.app-switch::after {
    content: none !important;
    display: none !important;
}

input.app-switch:checked {
    border-color: #20a9df !important;

    background:
        radial-gradient(
            circle at 30px 50%,
            #ffffff 0 7px,
            transparent 8px
        ),
        #148fbd !important;
}

input.app-switch:disabled {
    opacity: .38 !important;
    cursor: not-allowed !important;
}

/* Etiqueta de cualquier opción binaria */
.create-option label:has(input.app-switch),
.binary-option-label,
.view-account-filter {
    display: flex !important;
    align-items: center !important;
    gap: 9px !important;
}

/* Configuración avanzada:
   quitar el checkbox ficticio antiguo y usar el switch real */
.advanced-config {
    position: relative;
}

.advanced-config > .advanced-config-toggle.app-switch {
    position: absolute !important;
    left: auto !important;
    right: 11px !important;
    top: 10px !important;
    z-index: 2 !important;
}

.advanced-config-label {
    padding-left: 11px !important;
    padding-right: 64px !important;
}

.advanced-config-label::before {
    content: none !important;
    display: none !important;
}

.advanced-config-toggle:checked + .advanced-config-label::before {
    content: none !important;
    display: none !important;
}
