:root {
    /* Uniqom-inspired corporate palette (https://uniqom.ru/) */
    --nav-dark: #2c353e;
    --nav-dark-hover: #3a4550;
    --nav-accent: #b8c6d1;
    --nav-accent-hover: #c8d4dd;
    --nav-accent-text: #2c353e;

    --brand: #2c353e;
    --brand-hover: #1a2128;
    --brand-light: #eef2f5;
    --brand-muted: #b8c6d1;

    --ozon-blue: #3d5a73;
    --ozon-blue-hover: #2c4558;
    --ozon-orange: #e67e22;
    --ozon-orange-bg: #fef6ee;
    --ozon-green: #0d9f6e;
    --ozon-green-bg: #ecfdf5;

    --border: #e8ecef;
    --border-strong: #d1d9e0;
    --text: #2c353e;
    --text-muted: #6b7a86;
    --text-light: #94a3ae;
    --bg: #f4f6f8;
    --white: #ffffff;
    --utility-icon-bg: #f0f2f4;
    --shadow: 0 2px 12px rgba(44, 53, 62, 0.06);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-pill: 999px;
    --font: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--ozon-blue);
}

/* Legacy app wrapper */
.app {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px 24px;
}

/* Tabs base — overridden by ui.css on returns */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    overflow-x: auto;
}

.tab {
    padding: 10px 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
}

.tab:hover {
    color: var(--text);
}

.tab.active {
    color: var(--nav-dark);
    font-weight: 600;
}

.tab-count {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    background: var(--utility-icon-bg);
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.tab.active .tab-count {
    background: var(--nav-accent);
    color: var(--nav-dark);
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
}

.search-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
    min-width: 200px;
}

.search-input {
    flex: 1;
    min-width: 160px;
    padding: 11px 16px;
    border: none;
    border-radius: var(--radius-pill);
    background: var(--white);
    box-shadow: inset 0 0 0 1px var(--border);
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
}

.search-input:focus {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--nav-accent);
}

.schema-select {
    padding: 11px 16px;
    border: none;
    border-radius: var(--radius-pill);
    background: var(--white);
    box-shadow: inset 0 0 0 1px var(--border);
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
}

.filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.quick-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-chip {
    padding: 8px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--white);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

.filter-chip:hover {
    border-color: var(--nav-accent);
    color: var(--text);
}

.filter-chip.active {
    background: var(--nav-dark);
    border-color: var(--nav-dark);
    color: #fff;
}

.view-toggle {
    display: flex;
    border-radius: var(--radius-pill);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--white);
}

.view-btn {
    padding: 8px 14px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-muted);
    font-family: inherit;
}

.view-btn.active {
    background: var(--brand-light);
    color: var(--nav-dark);
    font-weight: 600;
}

.table-container {
    overflow-x: auto;
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.returns-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.returns-table th,
.returns-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.returns-table th {
    background: var(--brand-light);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.returns-table tbody tr:hover {
    background: #fafbfc;
}

.returns-table tbody tr:last-child td {
    border-bottom: none;
}

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
}

.loading-row td {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.pagination button {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--white);
    cursor: pointer;
    font-family: inherit;
}

.pagination button.active {
    background: var(--nav-dark);
    color: #fff;
    border-color: var(--nav-dark);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.return-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
}

.return-card h3 {
    font-size: 14px;
    margin-bottom: 8px;
}

.return-card p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.hidden {
    display: none !important;
}

@media (max-width: 768px) {
    .app {
        padding: 12px 14px 24px;
    }

    .toolbar {
        gap: 8px;
    }

    .search-group {
        min-width: 0;
        width: 100%;
    }

    .search-input {
        min-width: 0;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .table-container {
        margin-left: -14px;
        margin-right: -14px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .returns-table th,
    .returns-table td {
        padding: 8px 10px;
        font-size: 12px;
    }

    .tabs {
        margin-bottom: 12px;
    }

    .tab {
        padding: 8px 12px;
        font-size: 13px;
    }
}
