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

:root {
    --bg-dark: #0f0f13;
    --card-bg: rgba(22, 22, 30, 0.85);
    --border: rgba(255, 255, 255, 0.08);
    --text: #e8e8ed;
    --text-muted: #9a9aab;
    --accent: #3b82f6;
    --green: #22c55e;
    --red: #ef4444;
    --radius: 16px;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    overflow-x: hidden;
}

/* Динамический фон */
.bg-layer {
    position: fixed;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(40px) brightness(0.35);
    transform: scale(1.15);
    transition: background-image 1.2s ease, opacity 1.2s ease;
    z-index: 0;
}

.bg-layer::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15,15,19,0.3) 0%, rgba(15,15,19,0.7) 100%);
}

.container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Карусель */
.carousel-section {
    flex: 1;
    min-height: 380px;
    display: flex;
}

.carousel {
    position: relative;
    width: 100%;
    border-radius: var(--radius);
    overflow: hidden;
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--border);
    box-shadow: 0 20px 50px rgba(0,0,0,0.4);
    user-select: none;
    cursor: grab;
}

.carousel:active {
    cursor: grabbing;
}

.carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.55s cubic-bezier(0.25, 0.8, 0.25, 1);
    will-change: transform;
}

.carousel-track.no-transition {
    transition: none;
}

.slide {
    min-width: 100%;
    height: 100%;
    position: relative;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.slide-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 24px 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    font-size: 14px;
    color: rgba(255,255,255,0.9);
    opacity: 0;
    transition: opacity 0.4s;
}

.carousel:hover .slide-caption {
    opacity: 1;
}

/* Навигация */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.45);
    color: white;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    backdrop-filter: blur(8px);
    z-index: 10;
}

.nav-btn:hover {
    background: rgba(0,0,0,0.7);
    transform: translateY(-50%) scale(1.08);
}

.nav-btn.prev { left: 16px; }
.nav-btn.next { right: 16px; }

/* Индикаторы */
.indicators {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    padding: 0;
}

.dot.active {
    background: white;
    width: 22px;
    border-radius: 4px;
}

/* Нижние блоки */
.bottom-blocks {
    display: grid;
    grid-template-columns: 1fr 1fr 1.2fr;
    gap: 16px;
}

.info-block {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    min-height: 180px;
}

.info-block h3 {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* Клиентская информация */
.client-info .info-content {
    font-size: 13px;
    line-height: 1.55;
    flex: 1;
    overflow-y: auto;
}

.info-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

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

.info-label {
    color: var(--text-muted);
    flex-shrink: 0;
}

.info-value {
    text-align: right;
    word-break: break-all;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
}

.loading {
    color: var(--text-muted);
    font-style: italic;
}

/* Время */
.time-block {
    align-items: center;
    justify-content: center;
    text-align: center;
}

.time-display {
    font-size: 42px;
    font-weight: 300;
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    margin: 8px 0 4px;
}

.date-display {
    font-size: 14px;
    color: var(--text-muted);
}

/* График */
.chart-block {
    padding-bottom: 12px;
}

.price-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 8px;
}

.price {
    font-size: 26px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.change {
    font-size: 14px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 6px;
}

.change.up {
    color: var(--green);
    background: rgba(34, 197, 94, 0.12);
}

.change.down {
    color: var(--red);
    background: rgba(239, 68, 68, 0.12);
}

.chart-wrapper {
    flex: 1;
    position: relative;
    min-height: 110px;
}

.chart-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Адаптив */
@media (max-width: 900px) {
    .bottom-blocks {
        grid-template-columns: 1fr;
    }

    .carousel-section {
        min-height: 280px;
    }

    .time-display {
        font-size: 36px;
    }

    .container {
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .nav-btn {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .info-block {
        min-height: 160px;
        padding: 14px 16px;
    }
}
