/* Caminho: yarkan-demo/public/css/style.css */

/* ============================================================
   YARKAN DEMO — Design System (CSS puro, sem frameworks)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg:        #0a0a0a;
    --surface:   #111111;
    --surface-2: #181818;
    --border:    #222222;
    --text:      #ffffff;
    --muted:     #888888;
    --green:     #00e5a0;
    --green-dark:#00b87f;
    --red:       #e53935;
    --red-dark:  #c62828;
    --radius:    8px;
    --font:      'Inter', system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

/* ============================================================
   Banner de aviso — conta demo
   ============================================================ */

.demo-banner {
    background: linear-gradient(90deg, var(--green-dark), var(--green));
    color: #06150f;
    text-align: center;
    font-weight: 600;
    font-size: 12.5px;
    padding: 7px 12px;
    letter-spacing: 0.2px;
}

/* ============================================================
   Layout geral (app do usuário)
   ============================================================ */

.app-shell {
    display: flex;
    height: calc(100vh - 68px);
}

.sidebar {
    width: 102px;
    background: var(--bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    gap: 6px;
    flex-shrink: 0;
}

.sidebar-icon {
    width: 78px;
    min-height: 68px;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--muted);
    font-size: 22px;
    gap: 5px;
    padding: 7px 2px;
    transition: background 0.15s, color 0.15s;
}

.sidebar-icon .icon {
    font-size: 22px;
    line-height: 1;
}

.sidebar-icon .icon-svg {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
}

.sidebar-icon .icon-svg svg {
    width: 22px;
    height: 22px;
}

.sidebar-icon.active .icon-svg {
    color: var(--green);
}

.sidebar-icon:hover .icon-svg {
    color: var(--text);
}

.sidebar-icon .label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
    text-transform: uppercase;
    line-height: 1.1;
    text-align: center;
}

.sidebar-icon:hover,
.sidebar-icon.active {
    background: var(--surface-2);
    color: var(--text);
}

.sidebar-icon.active {
    color: var(--green);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.topbar {
    height: 68px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    flex-shrink: 0;
}

.topbar .balance {
    font-weight: 700;
    font-size: 16px;
    color: var(--green);
}

.topbar .balance-label {
    color: var(--muted);
    font-size: 12px;
    margin-right: 6px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.balance-block {
    display: flex;
    align-items: center;
    gap: 4px;
}

.balance-block .balance-text {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
}

.balance-block .balance-label {
    margin-right: 0;
    font-size: 11px;
}

.balance-caret {
    color: var(--muted);
    font-size: 11px;
    margin-left: 2px;
}

.btn-deposit {
    background: var(--green);
    color: #06150f;
    font-weight: 700;
    font-size: 13px;
    border: none;
    border-radius: 999px;
    padding: 9px 20px;
    cursor: pointer;
    transition: filter 0.15s;
}

.btn-deposit:hover {
    filter: brightness(1.08);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.hamburger-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    flex-shrink: 0;
}

.hamburger-btn:hover {
    background: var(--surface-2);
}

.hamburger-btn span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
    border-radius: 1px;
}

.asset-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 14px 6px 6px;
    cursor: pointer;
}

.asset-card-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.asset-card-symbol {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
}

.asset-card-type {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.2;
}

.app-shell.sidebar-collapsed .sidebar {
    display: none;
}

.view {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.view::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

/* ============================================================
   Sidebar Admin (130px, ícones + labels)
   ============================================================ */

.admin-shell .sidebar {
    width: 200px;
    align-items: stretch;
    padding: 16px 12px;
}

.admin-shell .sidebar-icon {
    width: 100%;
    justify-content: flex-start;
    gap: 10px;
    padding: 0 10px;
}

/* ============================================================
   Cards / Painéis
   ============================================================ */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
}

.card-subtitle {
    color: var(--muted);
    font-size: 12.5px;
}

.grid {
    display: grid;
    gap: 14px;
}

.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 720px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ============================================================
   Formulários
   ============================================================ */

.form-group {
    margin-bottom: 14px;
}

.form-label {
    display: block;
    font-size: 12.5px;
    color: var(--muted);
    margin-bottom: 6px;
}

.input,
select.input {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    color: var(--text);
    outline: none;
    transition: border-color 0.15s;
}

.input:focus {
    border-color: var(--green);
}

.input::placeholder {
    color: #555;
}

/* ============================================================
   Botões
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    border-radius: var(--radius);
    padding: 10px 16px;
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    transition: filter 0.15s, transform 0.05s;
    width: 100%;
}

.btn:active {
    transform: scale(0.98);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-green {
    background: var(--green);
    color: #06150f;
}

.btn-green:hover:not(:disabled) {
    filter: brightness(1.08);
}

.btn-red {
    background: var(--red);
    color: #ffffff;
}

.btn-red:hover:not(:disabled) {
    filter: brightness(1.08);
}

.btn-ghost {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-ghost:hover:not(:disabled) {
    background: #1d1d1d;
}

.btn-sm {
    padding: 6px 10px;
    font-size: 12px;
    width: auto;
}

/* ============================================================
   Tabelas
   ============================================================ */

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    color: var(--muted);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.table tr:last-child td {
    border-bottom: none;
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.badge-win  { background: rgba(0, 229, 160, 0.15); color: var(--green); }
.badge-loss { background: rgba(229, 57, 53, 0.15); color: var(--red); }
.badge-draw { background: rgba(136, 136, 136, 0.2); color: var(--muted); }
.badge-open { background: rgba(255, 193, 7, 0.15); color: #ffc107; }

/* ============================================================
   Tela de Login / Registro
   ============================================================ */

.auth-screen {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, #111 0%, #050505 70%);
}

.auth-box {
    width: 100%;
    max-width: 360px;
    padding: 28px;
}

.auth-logo {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--green);
    margin-bottom: 4px;
}

.auth-subtitle {
    text-align: center;
    color: var(--muted);
    font-size: 12.5px;
    margin-bottom: 24px;
}

.auth-switch {
    text-align: center;
    margin-top: 16px;
    font-size: 12.5px;
    color: var(--muted);
}

.auth-switch a {
    color: var(--green);
    font-weight: 600;
    cursor: pointer;
}

.auth-error {
    background: rgba(229, 57, 53, 0.12);
    border: 1px solid rgba(229, 57, 53, 0.3);
    color: var(--red);
    border-radius: var(--radius);
    padding: 10px 12px;
    font-size: 12.5px;
    margin-bottom: 14px;
}

/* ============================================================
   Tela de Trade
   ============================================================ */

.trade-layout {
    display: flex;
    height: 100%;
    gap: 16px;
}

.chart-panel {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
}

.chart-panel canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.trade-countdown {
    position: absolute;
    top: 12px;
    right: 16px;
    background: rgba(20, 20, 20, 0.85);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px 14px;
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.3px;
    pointer-events: none;
    z-index: 5;
}

.trade-side {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.asset-select {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.asset-chip {
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 12px;
    cursor: pointer;
    color: var(--muted);
}

.asset-chip.active {
    background: var(--green);
    color: #06150f;
    border-color: var(--green);
    font-weight: 600;
}

.direction-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.direction-buttons .btn {
    flex-direction: column;
    padding: 14px;
    font-size: 13px;
}

.payout-info {
    text-align: center;
    color: var(--muted);
    font-size: 12px;
}

.payout-info strong {
    color: var(--green);
}

/* ============================================================
   Resultado de operação (popup)
   ============================================================ */

.result-toast {
    position: fixed;
    top: 70px;
    right: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--green);
    border-radius: var(--radius);
    padding: 14px 18px;
    min-width: 220px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    animation: slideIn 0.2s ease-out;
    z-index: 999;
}

.result-toast.loss {
    border-left-color: var(--red);
}

@keyframes slideIn {
    from { transform: translateX(20px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

/* ============================================================
   Submenu de Ativos (dropdown ancorado ao card da moeda)
   ============================================================ */

.asset-card-wrapper {
    position: relative;
}

.assets-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 320px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
    z-index: 60;
    animation: history-slide-in 0.12s ease-out;
}

.assets-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.assets-dropdown-title {
    font-size: 14px;
    font-weight: 700;
}

.assets-dropdown-close {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--muted);
    font-size: 12px;
}

.assets-dropdown-close:hover {
    color: var(--text);
}

.assets-dropdown-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.asset-mini-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    cursor: pointer;
    transition: border-color 0.15s;
}

.asset-mini-card:hover {
    border-color: var(--green);
}

.asset-mini-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.asset-flag {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    overflow: visible;
}

.asset-flag .flag-main-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.asset-flag .badge-flag {
    position: absolute;
    right: -6px;
    bottom: -6px;
    width: 20px;
    height: 20px;
    font-size: 11px;
    background: var(--surface);
    border-radius: 50%;
    object-fit: cover;
    line-height: 1;
    padding: 0;
    border: 2px solid var(--surface);
}

/* Versão pequena do círculo duplo de bandeiras (topbar e card "Valor da operação") */
#topbar-asset-flag.asset-flag,
#trade-asset-flag.asset-flag {
    width: 28px;
    height: 28px;
}

#topbar-asset-flag.asset-flag .badge-flag,
#trade-asset-flag.asset-flag .badge-flag {
    width: 14px;
    height: 14px;
    right: -4px;
    bottom: -4px;
    border-width: 1px;
}

.trade-asset-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}


    color: var(--muted);
    font-size: 15px;
}

.asset-mini-name {
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.badge-tag {
    background: var(--border);
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    border-radius: 4px;
    padding: 2px 6px;
}

.asset-mini-change {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 10px;
}

.asset-mini-change.positive { color: var(--green); }
.asset-mini-change.negative { color: var(--red); }

.asset-mini-label {
    font-size: 10px;
    color: var(--muted);
    letter-spacing: 0.4px;
    margin-bottom: 2px;
}

.asset-mini-price {
    font-size: 13px;
    font-weight: 600;
}

/* ============================================================
   Painel de Histórico (overlay flutuante sobre o gráfico)
   ============================================================ */

.history-panel {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 300px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 30;
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.4);
    animation: history-slide-in 0.15s ease-out;
}

@keyframes history-slide-in {
    from { transform: translateX(-12px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

.history-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.history-panel-header .title {
    font-size: 14px;
    font-weight: 700;
}

.history-panel-close {
    cursor: pointer;
    color: var(--muted);
    font-size: 16px;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-panel-close:hover {
    background: var(--surface-2);
    color: var(--text);
}

.history-panel-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.history-panel-tab {
    background: var(--surface-2);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.history-panel-tab .count {
    background: var(--green);
    color: #06150f;
    border-radius: 999px;
    padding: 1px 7px;
    font-size: 11px;
}

.history-panel-list {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.history-panel-list::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.history-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
}

.history-row-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-row-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.history-row-icon.asset-flag.asset-flag-sm {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.history-row-icon.asset-flag.asset-flag-sm .badge-flag {
    width: 14px;
    height: 14px;
    right: -4px;
    bottom: -4px;
    border-width: 1px;
}

.history-row-info .symbol {
    font-size: 13px;
    font-weight: 600;
}

.history-row-info .meta {
    font-size: 11px;
    color: var(--muted);
}

.history-row-right {
    text-align: right;
}

.history-row-right .amount {
    font-size: 13px;
    font-weight: 700;
}

.history-row-right .result {
    font-size: 11px;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.history-row-right .result-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

/* ============================================================
   Utilitários
   ============================================================ */

.text-muted   { color: var(--muted); }
.text-green   { color: var(--green); }
.text-red     { color: var(--red); }
.text-center  { text-align: center; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }

.empty-state {
    text-align: center;
    color: var(--muted);
    padding: 40px 20px;
    font-size: 13px;
}

.spinner {
    border: 2px solid var(--border);
    border-top-color: var(--green);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
/* ============================================================
   Auth Buttons no Topbar
   ============================================================ */

.topbar-auth-btns {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-auth {
    padding: 7px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity .15s, background .15s;
    display: inline-flex;
    align-items: center;
}

.btn-auth-login {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text);
}

.btn-auth-login:hover {
    border-color: var(--green);
    color: var(--green);
}

.btn-auth-register {
    background: var(--green);
    color: #fff;
}

.btn-auth-register:hover {
    opacity: .85;
}

/* ============================================================
   Modal de Auth (Login / Registro)
   ============================================================ */

.auth-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    backdrop-filter: blur(2px);
}

.auth-modal {
    position: relative;
    width: 100%;
    max-width: 380px;
    padding: 32px 28px 28px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.auth-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
}

.auth-modal-close:hover {
    color: var(--text);
}

/* ============================================================
   Botões de trade bloqueados (deslogado)
   ============================================================ */

.btn-locked {
    opacity: .45 !important;
    cursor: not-allowed !important;
    filter: brightness(.7);
}

/* ============================================================
   BASE — garante height chain para o canvas funcionar
   ============================================================ */

html, body {
    height: 100%;
    overflow: hidden;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.app-shell {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

#view-container {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 16px;
    box-sizing: border-box;
}

.trade-layout {
    display: flex;
    height: 100%;
    gap: 16px;
    min-height: 0;
}

.chart-panel {
    flex: 1;
    min-height: 0;
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
}

.chart-panel canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* ============================================================
   Elementos mobile — escondidos no desktop
   ============================================================ */

.mobile-bottom-nav,
.mobile-payout-bar,
.mobile-trade-controls,
.mobile-dir-btns,
.mobile-sidebar-overlay {
    display: none;
}

/* ============================================================
   MOBILE — Layout completo (≤ 768px)
   ============================================================ */

@media (max-width: 768px) {

    /* Topbar */
    .topbar {
        height: 52px;
        padding: 0 10px;
        gap: 6px;
        flex-shrink: 0;
    }

    .topbar-left {
        gap: 6px;
        flex: 1;
        min-width: 0;
    }

    .topbar-left > strong {
        font-size: 12px;
        white-space: nowrap;
    }

    .hamburger-btn {
        flex-shrink: 0;
    }

    .asset-card-wrapper {
        flex: 1;
        min-width: 0;
    }

    .asset-card {
        padding: 4px 10px 4px 5px;
    }

    .asset-card-symbol { font-size: 11px; }
    .asset-card-type   { font-size: 10px; }

    /* Esconde saldo e depósito no topbar */
    .balance-block,
    #btn-deposit { display: none !important; }

    /* Auth buttons */
    .topbar-auth-btns { gap: 5px; }
    .btn-auth { padding: 5px 11px; font-size: 11px; }

    /* App shell sem sidebar lateral — descontando topbar (52px) e bottom nav (58px) */
    .app-shell {
        flex-direction: column;
        height: calc(100% - 52px - 58px);
    }

    /* Sidebar lateral some; drawer overlay vem pelo JS */
    .sidebar { display: none !important; }

    /* view-container sem padding lateral no mobile */
    #view-container {
        padding: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    /* Barra de retorno esperado */
    .mobile-payout-bar {
        display: flex !important;
        align-items: center;
        gap: 6px;
        padding: 5px 12px;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        font-size: 11px;
        color: var(--muted);
        flex-shrink: 0;
        white-space: nowrap;
    }

    .mobile-payout-bar .payout-asset {
        display: flex;
        align-items: center;
        gap: 6px;
        font-weight: 600;
        color: var(--text);
        font-size: 12px;
    }

    .mobile-payout-bar .payout-val {
        color: var(--green);
        font-weight: 700;
    }

    /* Trade layout: coluna, altura total */
    .trade-layout {
        flex-direction: column;
        gap: 0;
        flex: 1;
        min-height: 0;
    }

    /* Gráfico ocupa todo o espaço restante */
    .chart-panel {
        flex: 1;
        min-height: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-top: none;
        border-bottom: none;
    }

    /* Painel lateral vira painel inferior fixo */
    .trade-side {
        width: 100%;
        flex-shrink: 0;
        display: flex;
        flex-direction: column;
        background: var(--surface);
        border-top: 1px solid var(--border);
    }

    /* Esconde cards desktop dentro do painel */
    .trade-side > .card { display: none; }

    /* Botões Comprar/Vender mobile */
    .mobile-dir-btns {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 0;
    }

    .mobile-dir-btns .btn {
        border-radius: 0;
        padding: 13px 8px;
        font-size: 15px;
        font-weight: 700;
        flex-direction: row;
        gap: 8px;
        justify-content: center;
        align-items: center;
    }

    /* Controles de tempo e valor */
    .mobile-trade-controls {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        padding: 8px 12px;
        border-top: 1px solid var(--border);
        gap: 10px;
        background: var(--surface);
    }

    .mobile-control-block {
        display: flex;
        flex-direction: column;
        gap: 3px;
        flex: 1;
    }

    .mobile-control-label {
        font-size: 10px;
        color: var(--muted);
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 0.3px;
    }

    .mobile-stepper {
        display: flex;
        align-items: center;
        gap: 6px;
        background: var(--surface-2);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 5px 8px;
    }

    .mobile-stepper-btn {
        background: none;
        border: none;
        color: var(--text);
        font-size: 18px;
        cursor: pointer;
        padding: 0 2px;
        line-height: 1;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-stepper-btn:active { opacity: .5; }

    .mobile-stepper-val {
        font-size: 12px;
        font-weight: 600;
        min-width: 48px;
        text-align: center;
    }

    /* Bottom navigation */
    .mobile-bottom-nav {
        display: flex !important;
        height: 58px;
        background: var(--surface);
        border-top: 1px solid var(--border);
        align-items: stretch;
        flex-shrink: 0;
    }

    .mobile-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        cursor: pointer;
        color: var(--muted);
        font-size: 9px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        transition: color .15s;
        -webkit-tap-highlight-color: transparent;
        padding: 6px 0;
    }

    .mobile-nav-item svg { width: 20px; height: 20px; }

    .mobile-nav-item.active { color: var(--green); }

    /* Sidebar drawer overlay */
    .mobile-sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 500;
        display: flex !important;
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s;
    }

    .mobile-sidebar-overlay.open {
        opacity: 1;
        pointer-events: all;
    }

    .mobile-sidebar-backdrop {
        position: absolute;
        inset: 0;
        background: rgba(0,0,0,.6);
    }

    .mobile-sidebar-drawer {
        position: relative;
        width: 220px;
        background: var(--bg);
        border-right: 1px solid var(--border);
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 20px 0;
        gap: 6px;
        transform: translateX(-100%);
        transition: transform .2s;
        overflow-y: auto;
    }

    .mobile-sidebar-overlay.open .mobile-sidebar-drawer {
        transform: translateX(0);
    }

    .mobile-sidebar-drawer .sidebar-icon {
        width: 180px;
        min-height: 56px;
        display: flex !important;
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
        padding: 10px 16px;
    }

    .mobile-sidebar-drawer .sidebar-icon .label {
        font-size: 13px;
        text-transform: none;
        letter-spacing: 0;
    }
}