:root {
    --bg-primary: #1a1d29;
    --bg-secondary: #151821;
    --bg-elevated: #1e222f;
    --shadow-light: rgba(255, 255, 255, 0.05);
    --shadow-dark: rgba(0, 0, 0, 0.4);
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --live: #10b981;
    --idle: #f59e0b;
    --dead: #6b7280;
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}



* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    background: var(--bg-primary);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Space Mono', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}





.app {
    max-width: 430px;
    margin: 0 auto;
    padding: 16px;
    padding-top: 102px;
}

.app-header {
    margin-bottom: 24px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

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

.logo-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    box-shadow: 4px 4px 8px rgba(0,0,0,0.4), -4px -4px 8px rgba(255,255,255,0.05);
    color: var(--success);
    font-size: 18px;
    background-image: url("LOGo.png");
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

.btn-icon {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    box-shadow: 4px 4px 8px rgba(0,0,0,0.4), -4px -4px 8px rgba(255,255,255,0.05);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:active {
    box-shadow: inset 3px 3px 6px rgba(0,0,0,0.4), inset -3px -3px 6px rgba(255,255,255,0.05);
    transform: scale(0.95);
}

.date-picker {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    box-shadow: inset 3px 3px 6px rgba(0,0,0,0.4), inset -3px -3px 6px rgba(255,255,255,0.05);
}

.btn-date-nav {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-elevated);
    border-radius: 50%;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.4), -2px -2px 4px rgba(255,255,255,0.05);
    color: var(--text-secondary);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-date-nav:active {
    box-shadow: inset 2px 2px 4px rgba(0,0,0,0.4), inset -2px -2px 4px rgba(255,255,255,0.05);
}

.date-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    cursor: pointer;
    padding: 4px 16px;
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.date-display:active {
    background: rgba(255,255,255,0.05);
}

.date-day {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    color: var(--text-primary);
}

.date-month {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.hero-section {
    text-align: center;
    padding: 32px 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    box-shadow: 4px 4px 8px rgba(0,0,0,0.4), -4px -4px 8px rgba(255,255,255,0.05);
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--danger), var(--success));
    opacity: 0.3;
}

.pnl-container {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    margin-bottom: 8px;
    font-family: 'Space Mono', Monaco, monospace;
}

.pnl-container.positive { color: var(--success); }
.pnl-container.negative { color: var(--danger); }

.pnl-currency {
    font-size: 24px;
    font-weight: 600;
    opacity: 0.8;
}

.pnl-value {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: -2px;
    line-height: 1;
}

.pnl-sign {
    font-size: 32px;
    font-weight: 600;
    opacity: 0.6;
}

.pnl-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.sparkline-container {
    height: 40px;
    opacity: 0.6;
}

.sparkline {
    width: 100%;
    height: 100%;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 16px 8px;
    text-align: center;
    box-shadow: 4px 4px 8px rgba(0,0,0,0.4), -4px -4px 8px rgba(255,255,255,0.05);
    transition: transform 0.2s;
}

.stat-card:active {
    transform: scale(0.95);
    box-shadow: inset 3px 3px 6px rgba(0,0,0,0.4), inset -3px -3px 6px rgba(255,255,255,0.05);
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    font-family: 'Space Mono', monospace;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.stat-value.win { color: var(--success); }
.stat-value.loss { color: var(--danger); }

.stat-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.trades-section {
    margin-bottom: 24px;
}

.section-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    padding-left: 4px;
}

.trades-list {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: 4px 4px 8px rgba(0,0,0,0.4), -4px -4px 8px rgba(255,255,255,0.05);
    overflow: hidden;
}

.trade-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    transition: background 0.2s;
}

.trade-item:last-child {
    border-bottom: none;
}

.trade-item.win .trade-amount { color: var(--success); }
.trade-item.loss .trade-amount { color: var(--danger); }

.trade-time {
    font-size: 13px;
    color: var(--text-muted);
    font-family: 'Space Mono', monospace;
}

.trade-amount {
    font-size: 15px;
    font-weight: 600;
    font-family: 'Space Mono', monospace;
}

.btn-show-more {
    width: 100%;
    margin-top: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: 4px 4px 8px rgba(0,0,0,0.4), -4px -4px 8px rgba(255,255,255,0.05);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-show-more:active {
    box-shadow: inset 3px 3px 6px rgba(0,0,0,0.4), inset -3px -3px 6px rgba(255,255,255,0.05);
}

.drawer-spacer {
    height: 100px;
}

.control-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
    z-index: 100;
    max-width: 430px;
    margin: 0 auto;
    transform: translateY(calc(100% - 60px));
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.control-drawer.open {
    transform: translateY(0);
}

.drawer-handle {
    width: 100%;
    padding: 16px 20px;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    position: relative;
}

.handle-bar {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    background: var(--text-muted);
    border-radius: 2px;
    opacity: 0.3;
}

.handle-text {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 8px;
    box-shadow: 0 0 8px currentColor;
}

.status-indicator.live {
    background: var(--live);
    color: var(--live);
    animation: pulse 2s infinite;
}

.status-indicator.idle {
    background: var(--idle);
    color: var(--idle);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.drawer-content {
    padding: 0 20px 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.accounts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.account-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: inset 3px 3px 6px rgba(0,0,0,0.4), inset -3px -3px 6px rgba(255,255,255,0.05);
}

.account-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.acc-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
    flex-shrink: 0;
}

.acc-dot.live {
    background: var(--live);
    color: var(--live);
    animation: pulse 2s infinite;
}

.acc-dot.idle {
    background: var(--idle);
    color: var(--idle);
}

.acc-dot.dead {
    background: var(--dead);
    color: var(--dead);
}

.acc-dot.warn {
    background: var(--warning);
    color: var(--warning);
    animation: pulse 2s infinite;
}

.acc-details {
    display: flex;
    flex-direction: column;
}

.acc-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.acc-status {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-close-acc {
    width: 68px;
    height: 34px;
    border: none;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    box-shadow: 4px 4px 8px rgba(0,0,0,0.4), -4px -4px 8px rgba(255,255,255,0.05);
    color: var(--danger);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-close-acc:active {
    box-shadow: inset 3px 3px 6px rgba(0,0,0,0.4), inset -3px -3px 6px rgba(255,255,255,0.05);
    transform: scale(0.95);
}

.close-all-form {
    margin-top: 8px;
}

.btn-close-all {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-lg);
    color: var(--danger);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 4px 4px 8px rgba(0,0,0,0.4), -4px -4px 8px rgba(255,255,255,0.05);
    transition: all 0.2s;
}

.btn-close-all:active {
    box-shadow: inset 3px 3px 6px rgba(0,0,0,0.4), inset -3px -3px 6px rgba(255,255,255,0.05);
    transform: scale(0.98);
}

.warning-icon {
    font-size: 16px;
}

.login-section {
    padding: 40px 20px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.input-neu {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: inset 3px 3px 6px rgba(0,0,0,0.4), inset -3px -3px 6px rgba(255,255,255,0.05);
    padding: 4px;
}

.input-neu input {
    width: 100%;
    padding: 16px 20px;
    background: var(--bg-elevated);
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 16px;
    text-align: center;
    outline: none;
}

.input-neu input::placeholder {
    color: var(--text-muted);
}

.btn-login {
    padding: 18px;
    background: var(--bg-secondary);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: 4px 4px 8px rgba(0,0,0,0.4), -4px -4px 8px rgba(255,255,255,0.05);
    color: var(--success);
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-login:active {
    box-shadow: inset 3px 3px 6px rgba(0,0,0,0.4), inset -3px -3px 6px rgba(255,255,255,0.05);
    transform: scale(0.98);
}

.error-toast {
    margin-top: 16px;
    padding: 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
    color: var(--danger);
    text-align: center;
    font-size: 14px;
}

.results-float {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 200;
    pointer-events: none;
}

.result-badge {
    padding: 10px 20px;
    border-radius: var(--radius-xl);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: slideDown 0.3s ease;
    box-shadow: 4px 4px 8px rgba(0,0,0,0.4), -4px -4px 8px rgba(255,255,255,0.05);
}

.result-badge.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.result-badge.error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 12px 24px;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    box-shadow: 4px 4px 8px rgba(0,0,0,0.4), -4px -4px 8px rgba(255,255,255,0.05), 0 10px 40px rgba(0,0,0,0.3);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    text-align: center;
    min-width: 200px;
}

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

.toast.success { border: 1px solid var(--success); color: var(--success); }
.toast.error { border: 1px solid var(--danger); color: var(--danger); }

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    z-index: 400;
    align-items: flex-end;
    justify-content: center;
}

.modal-sheet {
    width: 100%;
    max-width: 430px;
    max-height: 80vh;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 20px;
    animation: slideUp 0.3s ease;
    overflow-y: auto;
}

.modal-handle {
    width: 36px;
    height: 4px;
    background: var(--text-muted);
    border-radius: 2px;
    margin: 0 auto 20px;
    opacity: 0.3;
}

.modal-sheet h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    text-align: center;
    color: var(--text-primary);
}

.modal-trades-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

::-webkit-scrollbar {
    width: 0;
    height: 0;
}



/* Toggle ON/OFF per account (neumorph) */
.btn-toggle-acc{
  min-width: 64px;
  height: 36px;
  border: none;
  border-radius: 999px;
  padding: 0 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: var(--shadow-inset, inset 6px 6px 12px rgba(0,0,0,.35), inset -6px -6px 12px rgba(255,255,255,.06));
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.85);
}
/* Buttons row: ON/OFF + Close side-by-side */
.acc-form{
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin-left: auto;      /* împinge butoanele în dreapta */
  flex-wrap: nowrap;      /* nu le lasă să sară pe rând nou */
}

.btn-toggle-acc.on{
  background: rgba(0, 255, 120, 0.12);
  color: rgba(0, 255, 120, 0.95);
  box-shadow: var(--shadow-out, 6px 6px 12px rgba(0,0,0,.35), -6px -6px 12px rgba(255,255,255,.06));
}

.btn-toggle-acc.off{
  background: rgba(255, 0, 0, 0.10);
  color: rgba(255, 80, 80, 0.95);
  box-shadow: var(--shadow-out, 6px 6px 12px rgba(0,0,0,.35), -6px -6px 12px rgba(255,255,255,.06));
  
}

/* Buttons row: ON/OFF + Close side-by-side */
.acc-form{
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin-left: auto;      /* împinge butoanele în dreapta */
  flex-wrap: nowrap;      /* nu le lasă să sară pe rând nou */
}


/* Disabled account visual */
.acc-dot.disabled{
  background: linear-gradient(145deg, #3a0f14, #2a0a0e);
  color: #ff4d4d;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
      inset 4px 4px 8px rgba(0,0,0,.6),
      inset -4px -4px 8px rgba(255,0,0,.05);
}

.acc-status{
  font-size: 12px;
  opacity: 0.85;
}

.acc-status:contains("Account Disabled"){
  color: #ff4d4d;
}


/* Card tint when account disabled */
.account-row.is-disabled{
  position: relative;
}

.account-row.is-disabled::before{
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255, 0, 0, 0.06);
  pointer-events: none;
}

/* opțional: ușor border/glow roșu, subtil */
.account-row.is-disabled{
  box-shadow:
    0 0 0 1px rgba(255, 0, 0, 0.10),
    6px 6px 12px rgba(0,0,0,.35),
    -6px -6px 12px rgba(255,255,255,.06);
}

.account-row.is-disabled .btn-close-acc{
  display: none !important;
}

.monthly-pnl{
  margin-top: 12px;
  display:flex;
  justify-content:space-between;
  align-items:center;
}

.monthly-label{
  font-size:10px;
  letter-spacing:1px;
  text-transform:uppercase;
  opacity:.7;
}

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

.monthly-pnl.positive .monthly-value{
  color:#10b981;
}

.monthly-pnl.negative .monthly-value{
  color:#ef4444;
}




