* {
    box-sizing: border-box;
}

select {
    width: 100%;
    margin-top: 4px;
    padding: 10px;
    border: 1px solid #bfc8d5;
    border-radius: 8px;
    background: #fff;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f6f8fb;
    color: #1b2430;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px;
}

.container.narrow {
    max-width: 560px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.card {
    background: #ffffff;
    border: 1px solid #dbe1ea;
    border-radius: 10px;
    padding: 16px;
    margin-top: 16px;
}

label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
}

input {
    width: 100%;
    margin-top: 4px;
    padding: 10px;
    border: 1px solid #bfc8d5;
    border-radius: 8px;
}

button,
.button-link {
    display: inline-block;
    border: none;
    background: #1d4ed8;
    color: #fff;
    border-radius: 8px;
    padding: 10px 14px;
    text-decoration: none;
    cursor: pointer;
}

button.secondary,
.button-link.secondary {
    background: #64748b;
}

button.secondary.analytics-period-btn.is-active {
    background: #1d4ed8;
    box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.25);
}

.actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 10px 12px;
}

.warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 10px 12px;
}

.muted {
    color: #475569;
}

.hidden {
    display: none;
}

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

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

th,
td {
    text-align: left;
    padding: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.inline-form {
    display: flex;
    gap: 8px;
}

.inline-form input {
    margin-top: 0;
}

.inline-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 28px;
}

.inline-check input {
    margin: 0;
}

.import-progress {
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    background: #eff6ff;
}

.import-progress__row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #1e40af;
}

.import-progress__spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #93c5fd;
    border-top-color: #1d4ed8;
    border-radius: 50%;
    animation: import-spin 0.8s linear infinite;
    flex-shrink: 0;
}

.import-progress__hint,
.import-progress__elapsed {
    margin: 6px 0 0 28px;
    font-size: 0.88rem;
}

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

button:disabled {
    opacity: 0.65;
    cursor: wait;
}

.grid-form {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.cart-total {
    margin: 14px 0;
    font-size: 1.1rem;
}

.qty-controls {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.qty-btn {
    padding: 4px 8px;
    min-width: 30px;
}

.search-choices {
    margin-top: 10px;
    border: 1px solid #dbe1ea;
    border-radius: 8px;
    background: #f8fafc;
    padding: 8px;
}

.choice-btn {
    width: 100%;
    text-align: left;
    margin-bottom: 6px;
}

.sale-details {
    border: 1px solid #dbe1ea;
    border-radius: 8px;
    margin-bottom: 8px;
    padding: 8px;
    background: #fff;
}

.sale-details summary {
    cursor: pointer;
    font-weight: 600;
}

.sale-items {
    margin-top: 8px;
}

.sale-item-row {
    padding: 4px 0;
    border-bottom: 1px dashed #e5e7eb;
}

.analytics-chart-wrap {
    border: 1px solid #dbe1ea;
    border-radius: 10px;
    padding: 10px;
    background: #f8fafc;
    margin-bottom: 10px;
}

.analytics-chart {
    width: 100%;
    height: 260px;
    display: block;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 8px;
}

.analytics-chart-legend {
    margin-top: 8px;
    display: flex;
    gap: 16px;
    color: #475569;
    font-size: 0.9rem;
}

.analytics-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}

.analytics-dot--revenue {
    background: #1d4ed8;
}

.analytics-dot--qty {
    background: #16a34a;
}
