:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111927;
    --bg-card: #1a2332;
    --bg-input: #0f1624;
    --text-primary: #e8edf5;
    --text-secondary: #8899bb;
    --border-color: #2a3a55;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-green: #22c55e;
    --accent-red: #ef4444;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --radius: 12px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    direction: rtl;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
    width: 240px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-blue);
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.logo i {
    font-size: 28px;
}

.sidebar nav ul {
    list-style: none;
    flex: 1;
}

.sidebar nav ul li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.sidebar nav ul li:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.sidebar nav ul li.active {
    background: var(--bg-card);
    color: var(--accent-blue);
    border-right: 3px solid var(--accent-blue);
}

.sidebar nav ul li i {
    width: 20px;
    text-align: center;
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.theme-toggle i {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--border-color);
    transition: var(--transition);
    border-radius: 34px;
}

.slider:before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: var(--transition);
    border-radius: 50%;
}

input:checked + .slider {
    background: var(--accent-blue);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

/* ===== Main Content ===== */
.main-content {
    margin-right: 240px;
    flex: 1;
    padding: 32px;
    min-height: 100vh;
}

/* Token Section */
.token-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.token-input-wrapper {
    background: var(--bg-secondary);
    padding: 48px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    max-width: 500px;
    width: 100%;
    text-align: center;
}

.token-input-wrapper h2 {
    margin-bottom: 8px;
    color: var(--text-primary);
}

.token-input-wrapper h2 i {
    color: var(--accent-blue);
}

.token-input-wrapper p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.input-group {
    display: flex;
    gap: 12px;
}

.input-group input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-success {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.btn-primary {
    background: var(--accent-blue);
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-success {
    background: var(--accent-green);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #16a34a;
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.3);
}

.btn-success:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== Dashboard ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-secondary);
    padding: 20px 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-card);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--accent-blue);
}

.stat-info h3 {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 4px;
}

.stat-info p {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-change {
    font-size: 12px;
    font-weight: 600;
}

.stat-change.positive {
    color: var(--accent-green);
}

.stat-change.negative {
    color: var(--accent-red);
}

/* Charts */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 32px;
}

.chart-card {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.chart-card h3 {
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--text-secondary);
    font-weight: 400;
}

.chart-card h3 i {
    margin-left: 8px;
    color: var(--accent-blue);
}

.chart-card canvas {
    max-height: 250px;
}

/* Zones */
.zones-section h3 {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 16px;
}

.zones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.zone-item {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    text-align: center;
    transition: var(--transition);
}

.zone-item:hover {
    border-color: var(--accent-blue);
}

.zone-item .zone-name {
    font-weight: 600;
    font-size: 14px;
}

.zone-item .zone-status {
    font-size: 12px;
    color: var(--accent-green);
    margin-top: 4px;
}

/* ===== Upload ===== */
.upload-area {
    background: var(--bg-secondary);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 48px;
    text-align: center;
    transition: var(--transition);
    margin: 20px 0;
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--accent-blue);
    background: var(--bg-card);
}

.upload-area i {
    font-size: 48px;
    color: var(--accent-blue);
    margin-bottom: 16px;
}

.upload-area p {
    color: var(--text-secondary);
}

.upload-area .upload-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.upload-area.dragover {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.05);
}

.file-list {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 16px;
    max-height: 200px;
    overflow-y: auto;
    margin: 16px 0;
    border: 1px solid var(--border-color);
}

.file-list .file-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

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

/* ===== Settings ===== */
.settings-group {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    margin: 20px 0;
}

.setting-item {
    margin-bottom: 16px;
}

.setting-item label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 14px;
}

.setting-item input,
.setting-item select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
}

.setting-item input:focus,
.setting-item select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* ===== Status Messages ===== */
.status-message {
    margin-top: 16px;
    padding: 12px;
    border-radius: var(--radius);
    font-size: 14px;
}

.status-message.success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--accent-green);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.status-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-message.info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
        padding: 16px 8px;
    }
    
    .sidebar .logo span,
    .sidebar nav ul li span,
    .sidebar .theme-toggle i {
        display: none;
    }
    
    .sidebar nav ul li {
        justify-content: center;
        padding: 12px;
    }
    
    .main-content {
        margin-right: 60px;
        padding: 16px;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .token-input-wrapper {
        padding: 24px;
    }
    
    .input-group {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}