:root {
    --primary: #1f4e8c;
    --primary-dark: #163e6f;
    --background: #f4f6f9;
    --surface: #ffffff;
    --text: #1a1a1a;
    --muted: #6b7280;
    --border: #d9dde3;
    --success-bg: #edf7ed;
    --success-border: #b7dfb9;
    --success-text: #245c2a;
    --error-bg: #fff1f1;
    --error-border: #f1b5b5;
    --error-text: #9f2424;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
}

a {
    color: inherit;
}

.container {
    width: min(1480px, calc(100% - 32px));
    margin: 0 auto;
}

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 3px 15px rgba(0, 0, 0, .04);
}

.topbar-inner {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: inline-block;
    margin-right: 10px;
    color: var(--primary);
    font-size: 27px;
    font-weight: 800;
}

.portal-title {
    display: inline-block;
    color: #374151;
    font-size: 18px;
    font-weight: 600;
}

.user-area {
    display: flex;
    align-items: center;
    gap: 18px;
    color: var(--muted);
}

.logout-link {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.main-content {
    padding-top: 28px;
    padding-bottom: 40px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.summary-card {
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 7px 20px rgba(0, 0, 0, .035);
}

.summary-card strong {
    display: block;
    margin-top: 8px;
    color: var(--primary-dark);
    font-size: 25px;
}

.summary-card .summary-small {
    font-size: 17px;
}

.summary-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.filter-form {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-field {
    width: min(420px, 100%);
}

input,
select {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    color: var(--text);
    background: #fff;
    border: 1px solid #cbd2dc;
    border-radius: 8px;
    font: inherit;
    outline: none;
}

input:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(31, 78, 140, .12);
}

select {
    width: auto;
    min-width: 155px;
}

.button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 17px;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.button-primary {
    color: #fff;
    background: var(--primary);
}

.button-primary:hover {
    background: var(--primary-dark);
}

.button-secondary {
    color: #fff;
    background: #374151;
}

.button-secondary:hover {
    background: #1f2937;
}

.button-light {
    color: #374151;
    background: #e9edf2;
}

.button-full {
    width: 100%;
}

.table-card {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .04);
}

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

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

.price-table th,
.price-table td {
    padding: 13px 15px;
    border-bottom: 1px solid #e5e8ed;
    text-align: left;
    vertical-align: middle;
}

.price-table th {
    position: sticky;
    top: 0;
    color: #374151;
    background: #f3f5f8;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.price-table tbody tr:hover {
    background: #f8fafc;
}

.price-column,
.price-cell {
    width: 145px;
    text-align: right !important;
}

.price-cell {
    color: #1f2937;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.sku-cell {
    width: 145px;
    color: var(--primary-dark);
    font-weight: 800;
}

.date-cell {
    width: 155px;
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}

.empty-cell {
    padding: 45px !important;
    color: var(--muted);
    text-align: center !important;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-top: 22px;
}

.pagination a {
    padding: 9px 14px;
    color: #fff;
    background: var(--primary);
    border-radius: 7px;
    font-weight: 700;
    text-decoration: none;
}

.pagination span {
    color: var(--muted);
}

.alert {
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid transparent;
    border-radius: 9px;
    line-height: 1.5;
}

.alert-success {
    color: var(--success-text);
    background: var(--success-bg);
    border-color: var(--success-border);
}

.alert-error {
    color: var(--error-text);
    background: var(--error-bg);
    border-color: var(--error-border);
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(
            circle at top left,
            rgba(31, 78, 140, .12),
            transparent 38%
        ),
        var(--background);
}

.login-card {
    width: min(430px, 100%);
    padding: 34px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 15px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, .09);
}

.login-card h1 {
    margin: 10px 0 8px;
    color: #1f2937;
    font-size: 25px;
}

.login-logo {
    color: var(--primary);
    font-size: 34px;
    font-weight: 900;
}

.login-subtitle {
    margin: 0 0 25px;
    color: var(--muted);
}

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

.form-group label {
    display: block;
    margin-bottom: 7px;
    color: #374151;
    font-weight: 700;
}

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

    .toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .filter-form {
        align-items: stretch;
        flex-direction: column;
    }

    .search-field,
    select {
        width: 100%;
    }

    .toolbar form:last-child .button {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .container {
        width: min(100% - 20px, 1480px);
    }

    .topbar-inner {
        min-height: 68px;
    }

    .portal-title {
        display: none;
    }

    .user-area span {
        display: none;
    }

    .main-content {
        padding-top: 16px;
    }

    .login-card {
        padding: 25px 20px;
    }
}