/* Sales Analysis */

.sa-container {
    padding: 1.5rem;
    height: 100%;
    overflow-y: auto;
}

.sa-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.sa-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.sa-date-filters {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.sa-date-filters label {
    font-size: 0.75rem;
    color: #6b7280;
}

.sa-date-filters input[type="date"] {
    padding: 0.3rem 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.8rem;
}

/* Stats row */
.sa-stats-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.sa-stat-card {
    flex: 1;
    min-width: 120px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.sa-stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1f2937;
}

.sa-stat-label {
    font-size: 0.7rem;
    color: #6b7280;
    margin-top: 0.25rem;
    text-transform: uppercase;
}

/* Widgets */
.sa-widget {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.sa-widget-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f3f4f6;
}

.sa-widget-header h4 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
}

.sa-widget-body {
    padding: 1rem;
}

/* Two-column layout */
.sa-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 0rem;
}

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

/* Tables */
.sa-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.sa-table th {
    text-align: left;
    padding: 0.4rem 0.6rem;
    border-bottom: 2px solid #e5e7eb;
    font-weight: 600;
    color: #6b7280;
    font-size: 0.7rem;
    text-transform: uppercase;
}

.sa-table td {
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid #f3f4f6;
}

.sa-table tbody tr:hover {
    background: #f9fafb;
}

.sa-table .empty-state {
    text-align: center;
    color: #9ca3af;
    padding: 2rem;
}

.sa-brand-badge {
    background: #ede9fe;
    color: #6d28d9;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
}

.sa-mono {
    font-family: monospace;
    font-size: 0.75rem;
    color: #6b7280;
}

/* Color swatch */
.sa-color-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: middle;
    border: 1px solid rgba(0,0,0,0.1);
}

/* Product controls */
.sa-product-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.sa-input {
    padding: 0.35rem 0.6rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.8rem;
}

.sa-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99,102,241,0.1);
}

#sa-product-search {
    flex: 1;
    min-width: 180px;
}

/* Scrollable table body for brands/colors */
.sa-widget-body .sa-table {
    max-height: 350px;
}

.sa-widget-body {
    max-height: 400px;
    overflow-y: auto;
}

.sa-trends-widget .sa-widget-body {
    max-height: none;
    overflow: visible;
}
