* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f4f6fb;
    color: #111827;
}

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

.sidebar {
    width: 260px;
    background: #111827;
    color: white;
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 6px;
}

.project {
    color: #9ca3af;
    font-size: 14px;
    margin-bottom: 32px;
}

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

.sidebar nav a,
.logout {
    color: #d1d5db;
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 12px;
}



.sidebar nav a.active,
.sidebar nav a:hover,
.logout:hover {
    background: #2563eb;
    color: white;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    flex-shrink: 0;
}

.ozon-icon {
    background: #005BFF;
    color: white;
}

.market-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.logout {
    margin-top: auto;
}

.content {
    flex: 1;
    min-width: 0;
    padding: 32px;
}

.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    margin: 0;
    font-size: 32px;
}

.page-header p {
    color: #6b7280;
}

.cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(320px, 1fr));
    gap: 18px;
    width: 100%;
}

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

.card {
    background: white;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.card h3 {
    margin-top: 0;
}

.card p {
    color: #6b7280;
}

.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef2ff;
}

.login-card {
    width: 380px;
    background: white;
    border-radius: 22px;
    padding: 30px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
}

.login-card h1 {
    margin: 0 0 8px;
}

.login-card p {
    color: #6b7280;
    margin-bottom: 20px;
}

.login-card input {
    width: 100%;
    padding: 13px 14px;
    margin-bottom: 12px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    font-size: 15px;
}

.login-card button {
    width: 100%;
    border: 0;
    background: #2563eb;
    color: white;
    padding: 13px;
    border-radius: 12px;
    font-size: 16px;
    cursor: pointer;
}

.error {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 14px;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-top: 16px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    color: #6b7280;
    font-size: 13px;
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
}

td {
    padding: 14px 12px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
}

tbody tr:hover {
    background: #f8fafc;
}
tfoot td {
    padding: 16px 12px;
    border-top: 2px solid #e5e7eb;
    background: #f8fafc;
    font-size: 15px;
}

.reports-table {
    background: white;
    border-radius: 18px;
    overflow-x: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.reports-row {
    display: grid;
    grid-template-columns: 160px repeat(var(--report-days), 220px);
    min-width: max-content;
    border-bottom: 1px solid #e5e7eb;
}

.reports-header .market-cell {
    background: #f8fafc;
    z-index: 30;
}

.market-cell,
.date-cell {
    padding: 18px;
    font-weight: 800;
    border-right: 1px solid #e5e7eb;
}

.market-cell {
    font-size: 22px;
    display: flex;
    align-items: center;

    position: sticky;
    left: 0;

    background: white;
    z-index: 20;

    border-right: 1px solid #e5e7eb;
}
.disabled-row .market-cell {
    background: #f9fafb;
}

.market-cell {
    box-shadow: 8px 0 12px rgba(0,0,0,0.04);
}

.date-cell {
    text-align: center;
    font-size: 24px;
}

.report-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    min-height: 270px;
    border-right: 1px solid #e5e7eb;
    text-decoration: none;
    color: #111827;
    background: white;
    transition: 0.15s;
}

.report-card:hover {
    background: #f3f6ff;
    transform: translateY(-1px);
}

.report-title {
    font-weight: 800;
    margin-bottom: 12px;
}
.report-line {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
    font-size: 14px;
}

.danger strong {
    color: #dc2626;
}

.report-breakdown {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}

.disabled-row {
    opacity: 0.55;
}

.disabled-card {
    background: #f9fafb;
    cursor: default;
}

.disabled-card:hover {
    transform: none;
    background: #f9fafb;
}

.report-compare {
    min-height: 28px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.35;
}

.report-compare.plus {
    color: #16a34a;
}

.report-compare.minus {
    color: #dc2626;
}

.report-spp {
    font-size: 12px;
    color: #374151;
    line-height: 1.5;
}

.report-spp strong {
    color: #111827;
}

.report-section {
    padding-bottom: 10px;
    border-bottom: 1px dashed #e5e7eb;
}

.report-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.report-line span {
    color: #111827;
}

.report-line strong {
    white-space: nowrap;
}

.report-metric {
    margin-bottom: 6px;
}

.drr-blue {
    color: #0ea5e9 !important;
}

.drr-green {
    color: #16a34a !important;
}

.drr-red {
    color: #dc2626 !important;
}

.report-ads-total {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
}

.report-ads-total strong {
    color: #dc2626;
    white-space: nowrap;
}
/* Ozon dashboard */

.turnover-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
}

.turnover-main {
    flex: 1;
}

.turnover-value {
    font-size: 36px;
    font-weight: 800;
    margin-top: 18px;
}

.turnover-compare {
    font-weight: 700;
    margin-top: 10px;
    font-size: 16px;
}

.turnover-compare.plus {
    color: #16a34a;
}

.turnover-compare.minus {
    color: #dc2626;
}

.turnover-date {
    color: #6b7280;
    margin-top: 18px;
}

.turnover-ads {
    min-width: 230px;
    padding-left: 22px;
    border-left: 1px solid #e5e7eb;
}

.turnover-ads-title {
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 14px;
}

.turnover-ads-row {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 8px;
    font-size: 14px;
}

.turnover-ads-row strong {
    color: #dc2626;
    white-space: nowrap;
}

.turnover-ads-total {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
    font-size: 15px;
    font-weight: 800;
}

.turnover-ads-drr {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
}

.turnover-ads-drr strong {
    color: #111827;
}

.report-loading {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    border-left: 5px solid #2563eb;
}

.report-loading h3 {
    margin: 0 0 4px;
}

.report-loading p {
    margin: 0;
    color: #6b7280;
}

.loader {
    width: 28px;
    height: 28px;
    border: 4px solid #dbeafe;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.card {
    min-width: 0;
    overflow: hidden;
}

.turnover-card {
    min-width: 0;
}

.turnover-main {
    min-width: 0;
}

.turnover-value {
    word-break: normal;
    line-height: 1.15;
}

.table-wrapper {
    overflow-x: auto;
}

.table-wrapper table {
    min-width: 1000px;
}

td.product-name {
    max-width: 520px;
    line-height: 1.35;
}

@media (max-width: 900px) {
    .layout {
        display: block;
    }

    .sidebar {
        width: 100%;
    }

    .content {
        padding: 20px;
    }
}

.ai-panel {
    background: #ffffff;
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.ai-form {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.ai-form label {
    font-weight: 600;
    color: #111827;
}

.ai-form select {
    margin-left: 8px;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    background: white;
}

.ai-form button {
    border: none;
    background: #2563eb;
    color: white;
    padding: 11px 18px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
}

.ai-form button:hover {
    background: #1d4ed8;
}

.ai-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.ai-card pre {
    white-space: pre-wrap;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.65;
    color: #111827;
}

.ai-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 16px 18px;
    border-radius: 14px;
    margin-bottom: 20px;
    font-weight: 600;
}