/* ============================================
   DERIVTRON — warm, modern dashboard UI
   Sidebar navigation + soft light dashboard cards
   ============================================ */

/* =============== ROOT VARIABLES =============== */
:root {
    --primary: var(--accent);
    --primary-light: var(--accent-light);
    --primary-dark: var(--accent-dark);
    --dark-lighter: var(--bg-alt);
    --card-bg: var(--surface);
    --sidebar-width: 280px;
    --transition: all 0.2s ease;
}

/* even/odd + over/under semantic colors, distinct from the brand accent */
:root {
    --up-color: #16a34a;
    --up-bg: #dcfce7;
    --up-border: rgba(22, 163, 74, 0.25);
    --down-color: #db2777;
    --down-bg: #fce7f3;
    --down-border: rgba(219, 39, 119, 0.25);
}

/* =============== RESET & BASE =============== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    display: flex;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
    opacity: 0.6;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
    opacity: 1;
}

/* =============== SIDEBAR =============== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px 20px;
    gap: 32px;
    z-index: 1000;
    overflow-y: auto;
    transition: var(--transition);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.sidebar-logo-svg {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
}

.sidebar-title {
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--accent);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    border-left: 2px solid transparent;
    cursor: pointer;
}

.nav-link:hover {
    color: var(--accent-dark);
    background: var(--accent-tint);
}

.nav-link.active {
    background: var(--accent-tint);
    color: var(--accent-dark);
    border-left-color: var(--accent);
    font-weight: 700;
}

.nav-link i {
    width: 16px;
    text-align: center;
    font-size: 13px;
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.user-info-sidebar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    flex-shrink: 0;
}

.user-details-sidebar {
    flex: 1;
    min-width: 0;
}

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

.user-status-sidebar {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--up-color);
    animation: pulse 2s infinite;
}

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

.logout-btn-sidebar {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.logout-btn-sidebar:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.sidebar-status {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.status-value {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-dark);
}

/* =============== MAIN CONTENT =============== */
.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: var(--transition);
}

/* =============== TOP BAR =============== */
.top-bar {
    padding: 18px 32px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.topbar-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.topbar-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.topbar-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* =============== CONTENT WRAPPER =============== */
.content-wrapper {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* =============== CONTROL PANEL =============== */
.control-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.control-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.control-select {
    padding: 11px 12px;
    background: var(--surface);
    border: 1.5px solid var(--border-strong);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.control-select:hover {
    border-color: var(--accent);
}

.control-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-tint);
}

/* =============== STATS GRID =============== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 460px));
    gap: 16px;
}

/* =============== DASHBOARD CARDS =============== */
.glass-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: box-shadow var(--transition), border-color var(--transition);
}

.glass-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-title i {
    color: var(--accent);
    font-size: 12px;
}

.card-badge {
    font-size: 11px;
    padding: 4px 12px;
    color: var(--accent-dark);
    border-radius: var(--radius-pill);
    background: var(--accent-tint);
    font-weight: 700;
    white-space: nowrap;
}

.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
}

/* Prediction Container */
.prediction-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    min-height: 80px;
}

.no-predictions {
    padding: 20px 12px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    margin: 0 auto;
    max-width: 400px;
    width: 100%;
}

.prediction-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-alt);
    padding: 16px;
    position: relative;
    min-width: 220px;
    max-width: 340px;
    margin: 0 auto;
    width: 100%;
}
.prediction-digit {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-dark);
    letter-spacing: 2px;
}
.prediction-countdown {
    font-size: 0.85rem;
    color: #fff;
    background: var(--accent);
    border-radius: var(--radius-pill);
    padding: 3px 12px;
    font-weight: 700;
}
.prediction-markets {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 2px;
    text-align: center;
}
.prediction-market-tag {
    display: inline-block;
    color: var(--accent-dark);
    background: var(--accent-tint);
    border-radius: var(--radius-pill);
    padding: 2px 10px;
    margin: 2px 3px;
    font-size: 0.85em;
    font-weight: 600;
    border: 1px solid var(--accent-tint-strong);
}

/* =============== EVEN/ODD PREDICTIONS =============== */
.even-odd-section {
    margin-top: 0;
}

.glass-card.full-width {
    grid-column: 1 / -1;
}

.eo-legend {
    display: flex;
    gap: 20px;
    padding-bottom: 12px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.eo-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.eo-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.eo-legend-dot.even {
    background: var(--up-color);
}

.eo-legend-dot.odd {
    background: var(--down-color);
}

.even-odd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.even-odd-card {
    border: 1px solid var(--border);
    border-left: 3px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-alt);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: var(--transition);
}

.even-odd-card.even,
.even-odd-card.over {
    border-left-color: var(--up-color);
}

.even-odd-card.odd,
.even-odd-card.under {
    border-left-color: var(--down-color);
}

.even-odd-card.neutral {
    border-left-color: var(--text-muted);
}

.even-odd-card:hover {
    box-shadow: var(--shadow-sm);
}

.eo-market {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.eo-market-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.eo-prediction {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.eo-badge {
    font-size: 13px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.eo-badge.even,
.eo-badge.over {
    background: var(--up-bg);
    color: var(--up-color);
    border: 1px solid var(--up-border);
}

.eo-badge.odd,
.eo-badge.under {
    background: var(--down-bg);
    color: var(--down-color);
    border: 1px solid var(--down-border);
}

.eo-badge.neutral {
    background: var(--bg-alt);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.eo-signal {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.eo-signal.strength-medium {
    color: var(--warning);
}

.eo-signal.strength-strong {
    color: var(--up-color);
}

/* =============== FOOTER =============== */
.footer {
    padding: 16px 0;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: auto;
}

.footer i {
    margin-right: 4px;
}

/* =============== MODALS =============== */
.auth-modal,
.payment-modal,
.welcome-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(32, 26, 23, 0.5);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Show states for all modals */
.auth-modal.show,
.auth-modal[style*="display: flex"],
.payment-modal.show,
.payment-modal[style*="display: flex"],
.welcome-modal.show,
.welcome-modal[style*="display: flex"] {
    display: flex !important;
    opacity: 1;
    visibility: visible;
}

.auth-modal-content,
.payment-modal-content,
.welcome-modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideInUp 0.3s ease-out;
    position: relative;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-header,
.welcome-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo,
.welcome-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    display: block;
}

.welcome-icon {
    color: var(--accent);
    font-size: 48px;
}

.auth-header h2,
.welcome-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.auth-header p,
.welcome-header p {
    font-size: 13px;
    color: var(--text-secondary);
}

.deriv-info {
    margin-bottom: 30px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 13px;
}

.info-item i {
    color: var(--accent);
    width: 20px;
    text-align: center;
}

.deriv-auth-btn,
.deriv-signup-btn,
.btn {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
    font-family: var(--font-heading);
}

.deriv-auth-btn,
.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: var(--shadow-accent);
}

.deriv-auth-btn:hover,
.btn-primary:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(255, 107, 71, 0.34);
}

.deriv-auth-btn:active,
.btn-primary:active {
    transform: translateY(0);
}

.deriv-signup-btn,
.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1.5px solid var(--border-strong);
}

.deriv-signup-btn:hover,
.btn-secondary:hover {
    background: var(--accent-tint);
    border-color: var(--accent);
    color: var(--accent-dark);
}

.btn-whatsapp {
    background: #25d366;
    color: #fff;
    border: none;
}

.btn-whatsapp:hover {
    background: #20ba5a;
}

.btn-full {
    width: 100%;
}

/* API Token Authentication */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0 20px 0;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.api-token-form {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
}

.token-info {
    margin-bottom: 16px;
}

.token-auth-btn {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0;
    font-family: var(--font-heading);
    background: var(--accent-tint);
    color: var(--accent-dark);
    border: 2px solid var(--accent);
}

.token-auth-btn:hover {
    background: var(--accent-tint-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

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

.token-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
    display: block;
    line-height: 1.4;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-input {
    width: 100%;
    padding: 11px 12px;
    background: var(--surface);
    border: 1.5px solid var(--border-strong);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font-body);
    transition: var(--transition);
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-tint);
}

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

.modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    background: var(--bg-alt);
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    color: var(--accent-dark);
    background: var(--accent-tint);
}

.device-conflict-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(32, 26, 23, 0.5);
    backdrop-filter: blur(6px);
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.device-conflict-modal.show {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.device-conflict-modal-content {
    width: min(520px, 100%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-lg);
    position: relative;
    color: var(--text-primary);
    text-align: center;
}

.device-conflict-modal-content h3 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 22px;
    color: var(--text-primary);
}

.device-conflict-modal-content p {
    margin-bottom: 18px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.device-conflict-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--warning-light);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.25);
    font-size: 26px;
}

.device-conflict-icon i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.payment-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.payment-modal-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

 .payment-modal-content .package-summary {
    padding: 18px 16px;
    background: var(--accent-tint);
    border: 1px solid var(--accent-tint-strong);
    border-radius: var(--radius-md);
    margin-bottom: 18px;
}

.payment-modal-content .package-summary h4 {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.payment-modal-content .package-summary .package-price {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-dark);
}

.payment-modal-content .package-summary .package-note {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
}

.package-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    justify-content: space-between;
}

.package-card {
    flex: 1;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-md);
    padding: 12px;
    background: var(--surface);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.package-card h4 {
    margin: 0 0 8px;
    color: var(--text-primary);
    font-size: 14px;
}

.package-card p {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-dark);
}

.package-card.active,
.package-card:hover {
    border-color: var(--accent);
    background: var(--accent-tint);
    box-shadow: var(--shadow-sm);
}

.selected-package-info {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.selected-package-info strong {
    color: var(--text-primary);
}

.address-section,
.warning-box {
    padding: 16px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.address-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    font-weight: 700;
}

.address-block {
    display: flex;
    gap: 8px;
    flex-direction: column;
}

.address-input {
    width: 100%;
    padding: 12px;
    background: var(--surface);
    border: 1.5px solid var(--border-strong);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    box-sizing: border-box;
    word-break: break-all;
}

.address-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-tint);
}

.warning-box {
    background: var(--warning-light);
    border-color: rgba(245, 158, 11, 0.3);
}

.warning-box p {
    font-size: 12px;
    color: #92640a;
    margin: 0;
    line-height: 1.4;
}

.form-group {
    margin-bottom: 16px;
}

.advanced-options-toggle {
    margin: 16px 0;
    display: flex;
    justify-content: center;
}

.toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: transparent;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-pill);
    color: var(--accent-dark);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.toggle-btn:hover {
    background: var(--accent-tint);
    border-color: var(--accent);
}

.toggle-btn i {
    display: flex;
    align-items: center;
    transition: transform var(--transition);
    font-size: 12px;
}

.toggle-btn.active i {
    transform: rotate(180deg);
}

.api-token-form {
    display: none;
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    animation: slideDown 0.3s ease-out;
}

.api-token-form.show {
    display: block;
}

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

.token-info .info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
}

.token-info .info-item i {
    color: var(--accent);
    font-size: 14px;
    flex-shrink: 0;
}

.form-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.4;
}

.form-hint a {
    color: var(--accent-dark);
    text-decoration: none;
    transition: var(--transition);
}

.form-hint a:hover {
    text-decoration: underline;
}

.payment-step {
    margin: 0;
}

.divider-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.divider-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0 0 12px 0;
    text-align: center;
}

.whatsapp-fallback {
    margin-top: 12px;
}

.whatsapp-fallback p {
    font-size: 11px;
    color: var(--text-secondary);
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.payment-footer {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 16px;
}

.verification-message {
    margin-top: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    display: block;
    background: var(--up-bg);
    border: 1px solid var(--up-border);
    color: var(--up-color);
    text-align: center;
}

.verification-message:empty {
    display: none;
}

.verification-message.show {
    display: block;
}

.verification-message .error {
    background: var(--danger-light);
    border-color: rgba(220, 38, 38, 0.3);
    color: var(--danger);
}

.verification-message .success {
    background: var(--up-bg);
    border-color: var(--up-border);
    color: var(--up-color);
}

.verification-message .loading {
    background: #dbeafe;
    border-color: rgba(59, 130, 246, 0.3);
    color: #2563eb;
}

.auth-footer {
    margin-top: 25px;
}

.terms-text {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
    text-align: center;
}

.terms-link {
    color: var(--accent-dark);
    text-decoration: none;
    transition: var(--transition);
}

.terms-link:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* =============== WELCOME MODAL SPECIFIC =============== */
.welcome-modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.welcome-icon i {
    font-size: 60px;
    color: var(--up-color);
    margin-bottom: 20px;
    display: block;
}

.welcome-header h2 {
    color: var(--text-primary);
}

.welcome-details {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    margin: 20px 0;
    text-align: left;
}

.welcome-user-info {
    display: grid;
    gap: 12px;
}

.welcome-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

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

.welcome-info-label {
    color: var(--accent-dark);
    font-weight: 700;
    font-size: 13px;
}

.welcome-info-value {
    color: var(--text-primary);
    font-size: 13px;
}

.welcome-footer {
    margin-top: 20px;
    text-align: center;
}

.welcome-footer .btn-full {
    max-width: 320px;
    margin: 0 auto;
}

.welcome-footer .btn-primary {
    background: var(--up-color);
    padding: 16px 24px;
    border-radius: var(--radius-pill);
    font-size: 15px;
}

.welcome-footer .btn-primary:hover {
    background: #15803d;
}

/* =============== RESPONSIVE DESIGN =============== */

/* Tablet (768px and below) */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 280px;
    }

    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: flex;
    }

    .topbar-toggle {
        display: flex;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .content-wrapper {
        padding: 20px;
    }

    .top-bar {
        padding: 16px 20px;
    }

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

    .control-panel {
        grid-template-columns: 1fr;
    }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    .content-wrapper {
        padding: 12px;
        gap: 12px;
    }

    .top-bar {
        padding: 10px 12px;
    }

    .glass-card {
        padding: 16px;
        border-radius: var(--radius-md);
    }

    .card-title {
        font-size: 14px;
    }

    .auth-modal-content,
    .payment-modal-content,
    .welcome-modal-content {
        padding: 24px;
        border-radius: var(--radius-md);
        max-width: 95%;
    }

    .control-panel {
        padding: 16px;
    }
}

/* Small Mobile (360px and below) */
@media (max-width: 360px) {
    .topbar-title {
        font-size: 13px;
    }
}

/* =============== UTILITY CLASSES =============== */
.hidden {
    display: none !important;
}

/* =============== TOAST NOTIFICATIONS =============== */
#toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 20000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 340px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 14px 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--text-secondary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
    animation: toastIn 0.25s ease-out;
}

.toast.toast-out {
    animation: toastOut 0.3s ease-in forwards;
}

.toast > i {
    font-size: 16px;
    min-width: 16px;
    color: var(--text-secondary);
}

.toast-message {
    flex: 1;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

.toast-close:hover {
    color: var(--text-primary);
}

.toast-success {
    border-left-color: var(--up-color);
}
.toast-success > i {
    color: var(--up-color);
}

.toast-error {
    border-left-color: var(--danger);
}
.toast-error > i {
    color: var(--danger);
}

.toast-warning {
    border-left-color: var(--warning);
}
.toast-warning > i {
    color: var(--warning);
}

.toast-info {
    border-left-color: var(--accent);
}
.toast-info > i {
    color: var(--accent);
}

@media (max-width: 600px) {
    #toast-container {
        right: 12px;
        left: 12px;
        top: 12px;
        max-width: unset;
    }
    .toast-message {
        font-size: 12px;
    }
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(24px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(24px);
    }
}

.no-scroll {
    overflow: hidden;
}

/* PWA Install Button - Floating */
.pwa-install-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    animation: slideInUp 0.4s ease-out;
    box-shadow: var(--shadow-accent);
}

.pwa-install-btn:hover {
    background: var(--accent-dark);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(255, 107, 71, 0.4);
}

.pwa-install-btn:active {
    transform: translateY(-2px);
}

.pwa-install-btn i {
    font-size: 16px;
}

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

.pwa-install-btn.fade-out {
    animation: fadeOut 0.4s ease-out forwards;
}
