:root {
    color-scheme: light;
    font-family: "Segoe UI", Tahoma, sans-serif;
    background: #f5f6f8;
    color: #1f2933;
}

body {
    margin: 0;
    font-size: 16px;
}

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

.page-header,
.page-footer {
    background: #1f2933;
    color: #fff;
    padding: 18px 0;
}

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

.page-header a {
    color: inherit;
    text-decoration: none;
}

.page-footer {
    font-size: 14px;
    text-align: center;
}

main {
    margin-top: 30px;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin-bottom: 18px;
}

.toolbar .search {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

input[type="text"],
input[type="number"],
textarea,
select {
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #cbd2d9;
    font-size: 15px;
    background: #fff;
    min-width: 220px;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 6px;
    border: none;
    font-weight: 600;
    font-size: 15px;
    background: #e4e7eb;
    color: #1f2933;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn:hover {
    background: #d2d8e1;
}

.btn.primary {
    background: #2563eb;
    color: #fff;
}

.btn.primary:hover {
    background: #1e4fd7;
}

.btn.secondary {
    background: #f1f3f5;
}

.btn.small {
    padding: 4px 10px;
    font-size: 13px;
}

.notice {
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}

.notice.success {
    background: #ecfdf3;
    border-color: #34d399;
    color: #065f46;
}

.notice.error {
    background: #fef2f2;
    border-color: #f87171;
    color: #b91c1c;
}

.notice.warning {
    background: #fef7e5;
    border-color: #f6ad55;
    color: #9a3412;
}

.notice.info {
    background: #e0f2fe;
    border-color: #60a5fa;
    color: #1d4ed8;
}

.meta {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
}

.stats-section {
    margin-bottom: 24px;
}

.stats-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.stats-header h2 {
    margin: 0;
    font-size: 20px;
    color: #111827;
}

.stats-header p {
    margin: 0;
    color: #52606d;
    font-size: 14px;
}

.stats-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 18px 20px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-card h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2933;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
}

.stat-sub {
    margin: 0;
    font-size: 13px;
    color: #52606d;
}

.stat-card.positive {
    border-left: 4px solid #22c55e;
}

.stat-card.negative {
    border-left: 4px solid #ef4444;
}

.stat-card.neutral {
    border-left: 4px solid #fbbf24;
}

.stat-card.total {
    border-left: 4px solid #6366f1;
}

.table-wrapper {
    overflow-x: auto;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

th,
td {
    padding: 12px 14px;
    border-bottom: 1px solid #e5e9f2;
    text-align: left;
    vertical-align: top;
}

th {
    background: #f8fafc;
    font-weight: 600;
    font-size: 14px;
    color: #52606d;
}

tbody tr:hover {
    background: rgba(37, 99, 235, 0.04);
}

.group-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.product-group {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.group-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid #e5e9f2;
}

.group-header h3 {
    margin: 0 0 6px;
    font-size: 18px;
    color: #1f2933;
}

.group-meta {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: #52606d;
}

.group-body {
    padding: 0;
    overflow-x: auto;
}

.product-group.collapsed .group-body {
    display: none;
}

.product-group.collapsed .group-toggle {
    background: #e4e7eb;
}

form.product-form {
    background: #fff;
    padding: 24px;
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
    display: grid;
    gap: 18px;
}

.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.form-field {
    flex: 1;
    min-width: 240px;
}

.form-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
}

.gallery-thumbs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.gallery-thumbs img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
