/* ═══════════════════════════════════════════════════════════
   UZUM TOOLS - СВЕТЛАЯ ТЕМА
   ═══════════════════════════════════════════════════════════ */

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

:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface2: #f1f5f9;
    --border: #e2e8f0;
    --border-light: rgba(0, 0, 0, 0.06);
    --accent: #7c3aed;
    --accent2: #7c3aed;
    --accent-light: rgba(124, 58, 237, 0.1);
    --green: #10b981;
    --green-dim: rgba(16, 185, 129, 0.1);
    --blue: #3b82f6;
    --blue-dim: rgba(59, 130, 246, 0.1);
    --red: #ef4444;
    --red-dim: rgba(239, 68, 68, 0.1);
    --yellow: #f59e0b;
    --text: #1e293b;
    --text-muted: #64748b;
    --text-dim: #94a3b8;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
    --transition: all 0.2s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: visible;
}

.top-menu-bar {
    position: sticky;
    top: 0;
    z-index: 999;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    padding: 0 20px;
}

.menu-bar-content {
    max-width: 1200px;
    margin: 0 auto;
}

.menu-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 0;
    overflow-x: auto;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
}

.menu-link:hover {
    background: var(--surface2);
    color: var(--text);
}

.menu-link.active {
    background: var(--accent-light);
    color: var(--accent);
}

.menu-link span:first-child {
    font-size: 18px;
}

.bg-glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 60% 40% at 15% 10%, rgba(124, 58, 237, 0.1) 0%, transparent 70%),
        radial-gradient(ellipse 50% 35% at 85% 85%, rgba(59, 130, 246, 0.08) 0%, transparent 70%);
}

.wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 0;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 0 32px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
    gap: 16px;
    flex-wrap: wrap;
}

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

.logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--accent), var(--blue));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
}

.logo-text h1 {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
}

.logo-text p {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

.badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 6px 14px;
}

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

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

.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

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

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

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

.card-title {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title-icon {
    font-size: 15px;
}

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

label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
}

input[type="number"],
select {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    padding: 10px 14px;
    outline: none;
    transition: var(--transition);
    appearance: none;
    -webkit-appearance: none;
}

input[type="number"]:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

input[type="number"]::placeholder {
    color: var(--text-dim);
}

select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M7.293 10.293a1 1 0 0 0 1.414 0L12 7l-1.414-1.414L8 8.172 5.414 5.586 4 7l3.293 3.293z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

select option {
    background: var(--surface);
}

select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.scheme-group {
    display: flex;
    gap: 8px;
}

.scheme-btn {
    flex: 1;
    padding: 9px 4px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

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

.scheme-btn.active {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 12px var(--accent-light);
}

.commission-preview {
    margin-top: 8px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-muted);
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.commission-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--yellow);
}

.size-group {
    display: flex;
    gap: 8px;
}

.size-btn {
    flex: 1;
    padding: 10px 6px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.size-btn:hover {
    border-color: var(--blue);
    color: var(--blue);
}

.size-btn.active {
    background: var(--blue-dim);
    border-color: var(--blue);
    color: var(--blue);
}

.size-price {
    display: block;
    font-size: 11px;
    font-weight: 400;
    margin-top: 2px;
    color: var(--text-dim);
}

.size-btn.active .size-price {
    color: var(--blue);
}

.results-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.kpi-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.kpi-card.green::before {
    background: linear-gradient(90deg, var(--green), #34d399);
}

.kpi-card.blue::before {
    background: linear-gradient(90deg, var(--blue), #60a5fa);
}

.kpi-card.red::before {
    background: linear-gradient(90deg, var(--red), #f87171);
}

.kpi-label {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.kpi-value {
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
    transition: color 0.3s;
}

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

.kpi-card.blue .kpi-value {
    color: var(--blue);
}

.kpi-card.red .kpi-value {
    color: var(--red);
}

.kpi-sub {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 6px;
}

.breakdown-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    box-shadow: var(--shadow);
}

.breakdown-title {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.breakdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
}

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

.breakdown-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
}

.breakdown-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.breakdown-amount {
    font-weight: 600;
    color: var(--text);
}

.breakdown-pct {
    font-size: 11px;
    color: var(--text-dim);
    margin-left: 8px;
}

.breakdown-item.profit .breakdown-amount {
    color: var(--green);
}

.breakdown-item.loss .breakdown-amount {
    color: var(--red);
}

.chart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    box-shadow: var(--shadow);
}

.chart-wrapper {
    position: relative;
    width: 100%;
    max-width: 240px;
    margin: 0 auto;
}

.status-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 20px;
}

.status-bar.loading {
    background: var(--blue-dim);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--blue);
}

.status-bar.success {
    background: var(--green-dim);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--green);
}

.status-bar.error {
    background: var(--red-dim);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--red);
}

.spinner {
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

footer {
    border-top: 1px solid var(--border);
    margin-top: 40px;
    padding-top: 20px;
    text-align: center;
    font-size: 12px;
    color: var(--text-dim);
}

footer a {
    color: var(--accent);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.analytics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stat-box {
    background: var(--surface2);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.stat-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
    display: block;
}

.stat-val {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

/* ═══════════════════════════════════════════════════════════
   СТИЛИ ДЛЯ РЕКЛАМНЫХ БЛОКОВ
   ═══════════════════════════════════════════════════════════ */

/* Верхний рекламный блок */
.top-ad-banner {
    width: calc(100% - 360px);
    height: 90px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--text-dim);
    margin-left: 180px;
}

/* Левый боковой рекламный блок */
.side-ad-left-block {
    position: fixed;
    left: 0;
    top: 0;
    width: 180px;
    height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 100px 10px 20px 0;
    z-index: 998;
}

/* Правый боковой рекламный блок */
.side-ad-right-block {
    position: fixed;
    right: 0;
    top: 0;
    width: 180px;
    height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 100px 0 20px 10px;
    z-index: 998;
}

/* Внутренний стиль боковых блоков */
.side-ad-inner {
    width: 160px;
    height: 600px;
    background: var(--surface2);
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: sticky;
    top: 100px;
}

.side-ad-icon {
    font-size: 32px;
}

.side-ad-text {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.side-ad-size {
    font-size: 10px;
    color: var(--text-dim);
    opacity: 0.7;
}

/* Основной контент */
.main-wrapper {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

/* Скрываем боковые блоки на маленьких экранах */
@media (max-width: 1520px) {
    .side-ad-left-block,
    .side-ad-right-block,
    .top-ad-banner {
        display: none !important;
    }
    .main-wrapper {
        max-width: 100%;
    }
}

@media(max-width:600px) {
    .kpi-row {
        grid-template-columns: 1fr;
    }
    .scheme-group {
        flex-wrap: wrap;
    }
}
