/* --- GLOBAL THEME (БИРЮЗОВЫЙ ДАШБОРД) --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #eaf1f4; /* Светлый серо-бирюзовый фон как на фото */
    color: #334155;
    line-height: 1.5;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* --- HEADER --- */
.main-header {
    background-color: #0d4b68; /* Глубокий сине-бирюзовый цвет плашки */
    color: #ffffff;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo {
    font-size: 1.15rem;
    color: #fff;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 24px;
}

.nav-links a {
    color: #e2e8f0;
    font-size: 0.95rem;
    text-decoration: none;
    transition: color 0.15s;
}

.nav-links a:hover {
    color: #00a396;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    border-radius: 6px;
    padding: 8px 18px;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background-color: #00a396; /* Яркий бирюзовый */
    color: #fff;
}

.btn-primary:hover {
    background-color: #00877d;
}

/* --- MAIN DASHBOARD GRID --- */
.dashboard-grid {
    max-width: 1400px;
    margin: 24px auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1fr 380px; /* Две колонки как на картинке */
    gap: 24px;
}

/* Левая колонка */
.left-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Правая колонка */
.right-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* --- ВЕРХНИЕ КАРТОЧКИ СТАТИСТИКИ --- */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.stat-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    border: 1px solid #d1dfec;
    display: flex;
    flex-direction: column;
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.stat-num {
    font-size: 1.8rem;
    font-weight: 700;
    color: #0f172a;
}

.stat-card-icon {
    color: #00a396;
    font-size: 1.2rem;
}

.stat-title {
    font-size: 0.9rem;
    color: #475569;
    font-weight: 600;
    margin-bottom: 12px;
}

.stat-footer {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}

/* Графики внутри карточек */
.mini-chart-container {
    height: 35px;
    margin-bottom: 10px;
}

.cube-animation-placeholder {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 30px;
    margin-bottom: 10px;
}

.cube-layer {
    height: 8px;
    background-color: #00a396;
    border-radius: 2px;
    opacity: 0.7;
}
.cube-layer:nth-child(2) { opacity: 0.9; width: 85%; }
.cube-layer:nth-child(3) { opacity: 0.5; width: 70%; }

.gear-icon-placeholder {
    font-size: 2rem;
    color: #0d4b68;
    margin-bottom: 10px;
}

/* --- DEMO CONTAINER --- */
.demo-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 12px;
    border: 1px solid #d1dfec;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.demo-wrapper {
    position: relative;
    width: 100%;
    padding-top: 50%; /* Чуть компактнее по высоте */
    background-color: #0f172a;
    border-radius: 6px;
    overflow: hidden;
}

.demo-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* --- AUTOMATIC STYLES FOR CONTENT --- */
.content-container {
    background: #ffffff;
    border-radius: 10px;
    padding: 32px;
    border: 1px solid #d1dfec;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.content-container h1 { font-size: 1.6rem; font-weight: 700; color: #0f172a; margin-bottom: 16px; }
.content-container h2 { font-size: 1.3rem; font-weight: 700; color: #0f172a; margin-top: 26px; margin-bottom: 12px; }
.content-container h3 { font-size: 1.05rem; font-weight: 600; color: #0f172a; margin-bottom: 10px; }
.content-container p { font-size: 0.95rem; color: #475569; margin-bottom: 16px; line-height: 1.6; }

.features-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
}

.content-container ul {
    list-style: none;
}

.content-container li {
    font-size: 0.9rem;
    color: #475569;
    margin-bottom: 6px;
    position: relative;
    padding-left: 14px;
}

.content-container li::before {
    content: "•";
    color: #00a396;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.content-container table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.content-container th, .content-container td {
    padding: 10px 12px;
    font-size: 0.9rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.content-container th {
    font-weight: 600;
    color: #0f172a;
}

/* --- WIDGETS (RIGHT COLUMN) --- */
.widget-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 24px;
    border: 1px solid #d1dfec;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.widget-header h3 {
    font-size: 1rem;
    color: #0f172a;
    font-weight: 700;
}

.widget-select {
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    font-size: 0.85rem;
    color: #475569;
    background: #f8fafc;
}

/* Линейный график */
.line-chart-container {
    width: 100%;
}

.chart-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.75rem;
    color: #94a3b8;
}

/* Столбчатый график */
.bar-chart-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 120px;
    padding-top: 10px;
}

.bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 18%;
    height: 100%;
    justify-content: flex-end;
}

.bar-segment {
    width: 100%;
    border-radius: 3px 3px 0 0;
}

.tone-1 { background-color: #00a396; }
.tone-2 { background-color: #0d4b68; }
.tone-3 { background-color: #2dd4bf; }
.tone-4 { background-color: #38bdf8; }

.bar-lbl {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 6px;
}

/* FAQ внутри виджета */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.faq-item h4 {
    font-size: 0.9rem;
    color: #0f172a;
    margin-bottom: 4px;
}

.faq-item p {
    font-size: 0.85rem;
    color: #64748b;
}

/* --- AUTHOR SECTION --- */
.author-section {
    background: #ffffff;
    border-radius: 10px;
    padding: 24px;
    border: 1px solid #d1dfec;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.author-container {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.author-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #cbd5e1;
}

.author-label {
    font-size: 0.75rem;
    color: #94a3b8;
}

.author-name {
    font-size: 1rem;
    color: #0f172a;
    margin-bottom: 4px;
}

.author-bio {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.5;
}

/* --- FOOTER --- */
.main-footer {
    background-color: #ffffff;
    color: #64748b;
    border-top: 1px solid #e2e8f0;
    padding: 24px;
    font-size: 0.8rem;
    text-align: left;
    margin-top: 40px;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.footer-container p {
    margin-bottom: 4px;
}

/* --- RESPONSIVE MOBILE APP (Адаптация под WebApp) --- */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr; /* Колонки перестраиваются друг под друга как на мобильной версии вашего макета */
    }
}

@media (max-width: 640px) {
    .stats-row {
        grid-template-columns: 1fr; /* Карточки выстраиваются вертикально */
    }
    .features-split {
        grid-template-columns: 1fr;
    }
    .content-container {
        padding: 20px;
    }
    .nav-links {
        display: none; /* Прячем навигацию на мелких экранах ради экономии места в WebView */
    }
}