:root {
    --bg: #f2f3f5;
    --surface: #fff;
    --surface-muted: #f7f8fa;
    --text: #171717;
    --muted: #6d7380;
    --line: #dde2e8;
    --line-strong: #c9d2dc;
    --accent: #5b9bd5;
    --accent-dark: #286fa8;
    --warn: #ffcc00;
    --danger: #be3a34;
    --shadow: 0 18px 40px rgba(20, 33, 51, 0.08);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 14px;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.admin-shell {
    height: 100vh;
    min-height: 0;
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr) 380px;
    overflow: hidden;
}

.sidebar {
    min-width: 0;
    min-height: 0;
    background: #151719;
    color: #eef3f8;
    border-right: 1px solid #2a3038;
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    background: var(--warn);
    color: #171717;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.05em;
}

.brand-title {
    font-size: 16px;
    font-weight: 800;
}

.brand-subtitle {
    margin-top: 2px;
    color: #9ca8b4;
    font-size: 12px;
}

.sidebar .brand {
    padding: 20px;
    border-bottom: 1px solid #282e35;
}

.sidebar-tools {
    padding: 16px 20px;
    border-bottom: 1px solid #282e35;
}

.sidebar-tools label,
.filter-row label {
    display: block;
    margin-bottom: 7px;
    color: #aab6c1;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.sidebar-tools select,
.toolbar input,
.toolbar select {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    color: #1f2933;
    padding: 8px 10px;
}

.sidebar-tools select {
    border-color: #3b4652;
    background: #20252b;
    color: #f1f5f9;
}

.sidebar-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px 9px;
    color: #9ca8b4;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

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

.sidebar-toggle-button {
    border: 1px solid #3b4652;
    border-radius: 999px;
    background: #20252b;
    color: #cfd8e2;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
}

.sidebar-toggle-button:hover {
    border-color: var(--accent);
    color: #fff;
}

.sidebar-heading strong {
    color: #fff;
}

.sidebar-empty {
    padding: 12px 20px;
    color: #9ca8b4;
}

.category-list {
    padding-bottom: 18px;
}

.category-item {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px 20px;
    border: 0;
    background: transparent;
    color: #cfd8e2;
    text-align: left;
}

.category-item:hover {
    background: #20262e;
    color: #fff;
}

.category-item.is-empty {
    color: #8391a1;
}

.category-item-all {
    position: sticky;
    top: 0;
    z-index: 3;
    border-bottom: 1px solid #303946;
    background: #151a20;
    color: #fff;
    font-weight: 900;
}

.category-item-all:hover {
    background: #20262e;
}

.category-item.active {
    background: #263746;
    color: #fff;
    box-shadow: inset 4px 0 0 var(--accent);
}

.category-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-count {
    min-width: 32px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #2d3540;
    color: #cfd8e2;
    text-align: center;
    font-size: 11px;
    font-weight: 800;
}

.workspace {
    min-width: 0;
    min-height: 0;
    padding: 22px;
    overflow: hidden;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.topbar-with-brand {
    align-items: center;
}

.topbar-title {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 22px;
}

.topbar-brand {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #17202a;
    text-decoration: none;
}

.topbar-brand .brand-subtitle {
    display: block;
}

.topbar h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.1;
}

.topbar p {
    margin: 7px 0 0;
    color: var(--muted);
}

.toolbar {
    width: min(1040px, 66vw);
    display: grid;
    grid-template-columns: minmax(220px, 1fr) repeat(8, auto);
    gap: 8px;
}

.users-toolbar {
    grid-template-columns: minmax(260px, 1fr) repeat(8, auto);
}

.updates-toolbar {
    width: auto;
    grid-template-columns: repeat(8, auto);
}

.suppliers-toolbar {
    grid-template-columns: minmax(260px, 1fr) repeat(8, auto);
}

.import-toolbar {
    width: auto;
    grid-template-columns: repeat(6, auto);
}

.toolbar button,
.primary-action,
.secondary-action,
.danger-action {
    min-height: 38px;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    background: #fff;
    color: #28313a;
    padding: 8px 12px;
    font-weight: 800;
    text-decoration: none;
    display: inline-grid;
    place-items: center;
}

.primary-action {
    border-color: var(--accent-dark);
    background: var(--accent);
    color: #fff;
}

.danger-action {
    border-color: #d8b7b4;
    color: var(--danger);
}

.toolbar button:hover,
.secondary-action:hover,
.danger-action:hover {
    background: #edf4fa;
}

.toolbar button.active {
    border-color: var(--accent-dark);
    background: #e8f4ff;
    color: #12324f;
}

.danger-action:hover {
    background: #fff0ef;
}

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

.summary-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    margin-bottom: 18px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--line);
}

.summary-strip div {
    min-width: 0;
    padding: 13px 15px;
    background: var(--surface);
}

.summary-strip span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.summary-strip strong {
    display: block;
    margin-top: 6px;
    font-size: 20px;
}

.table-panel {
    min-height: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table-status {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
}

.table-scroll {
    height: calc(100vh - 230px);
    overflow: auto;
}

.product-table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

.product-table th,
.product-table td {
    max-width: 260px;
    padding: 10px 12px;
    border-bottom: 1px solid #edf0f3;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.product-table td.numeric {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.product-table th.image-heading,
.product-table td.image-cell {
    width: 74px;
    min-width: 74px;
    max-width: 74px;
    text-align: center;
}

.product-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f7f9fb;
    color: #4d5966;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.sortable-table-heading {
    width: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font: inherit;
    letter-spacing: inherit;
    text-align: left;
    text-transform: inherit;
    cursor: pointer;
}

.sortable-table-heading:hover {
    color: #17212b;
}

.sort-indicator {
    min-width: 10px;
    color: var(--accent-dark);
}

.sortable-table-heading.sorted-asc .sort-indicator::after {
    content: "^";
}

.sortable-table-heading.sorted-desc .sort-indicator::after {
    content: "v";
}

.product-table tr {
    cursor: pointer;
}

.product-table tbody tr:hover,
.product-table tbody tr.active {
    background: #edf5fc;
}

.grid-thumb {
    display: inline-block;
    vertical-align: middle;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
}

.product-thumb {
    width: 50px;
    height: 50px;
}

.manufacturer-grid-cell {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
}

.manufacturer-grid-cell span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.manufacturer-logo-thumb {
    flex: 0 0 auto;
    width: 42px;
    height: 24px;
}

.grid-thumb-empty {
    background: #f0f2f4;
}

.detail-panel {
    min-width: 0;
    min-height: 0;
    background: var(--surface);
    border-left: 1px solid var(--line);
    overflow-y: auto;
}

#detailPanel.detail-panel {
    overflow: hidden;
}

.users-shell {
    height: 100vh;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 430px;
    overflow: hidden;
}

.updates-shell {
    grid-template-columns: minmax(0, 1fr);
}

.users-table-scroll {
    height: calc(100vh - 140px);
}

.updates-table-scroll {
    height: calc(100vh - 140px);
}

.detail-empty,
.detail-content {
    padding: 22px;
}

.product-detail-form {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.detail-header {
    flex: 0 0 auto;
    padding: 22px 22px 0;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.detail-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 18px 22px 22px;
}

.detail-empty h2,
.detail-content h2,
.detail-header h2 {
    margin: 0;
    font-size: 20px;
}

.detail-empty p,
.detail-meta,
.property-value {
    color: var(--muted);
}

.detail-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    background: #f6f7f8;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 18px;
}

.supplier-logo-preview {
    aspect-ratio: 2 / 1;
    min-height: 112px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    overflow: hidden;
}

.supplier-logo-preview img {
    max-width: 90%;
    max-height: 86px;
    object-fit: contain;
}

.logo-thumb {
    width: 64px;
    height: 36px;
    display: block;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
}

.logo-thumb-empty {
    background: #f0f2f4;
}

.table-thumb-logo {
    width: 74px;
    height: 42px;
    display: block;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
}

.package-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #edf1f5;
    color: #44515f;
    font-size: 12px;
    font-weight: 800;
}

.package-pill-1 {
    background: #edf7ef;
    color: #28643a;
}

.package-pill-2 {
    background: #fff4df;
    color: #8a5a00;
}

.package-pill-3 {
    background: #271f18;
    color: #ffcc00;
}

.supplier-detail-content {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.supplier-logo-form {
    margin-bottom: 22px;
}

.guide-package-panel {
    display: grid;
    gap: 18px;
    border-top: 1px solid var(--line);
    padding-top: 20px;
}

.package-editor-section {
    display: grid;
    gap: 10px;
}

.package-editor-section h3 {
    margin: 0;
    font-size: 16px;
}

.package-rule-summary {
    display: grid;
    gap: 4px;
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface-muted);
    color: var(--muted);
    font-size: 12px;
}

.highlight-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.highlight-row {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    text-align: left;
}

.highlight-row span {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.highlight-row strong,
.highlight-row small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.highlight-row small {
    color: var(--muted);
}

.highlight-row em {
    color: var(--muted);
    font-style: normal;
    font-weight: 800;
}

.highlight-list-empty,
.form-error {
    padding: 10px 12px;
    border-radius: 7px;
    background: var(--surface-muted);
    color: var(--muted);
    font-size: 12px;
}

.form-error {
    color: var(--danger);
}

.detail-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0 20px;
}

.detail-actions [hidden] {
    display: none;
}

.save-state {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.detail-form h3 {
    margin: 22px 0 10px;
    font-size: 15px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.field,
.property-editor {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.detail-form [hidden],
.field[hidden],
.checkbox-field[hidden] {
    display: none !important;
}

.field span,
.property-editor span {
    color: #3b4652;
    font-size: 12px;
    font-weight: 900;
}

.field input,
.field select,
.field textarea,
.property-editor input,
.property-editor select,
.property-editor textarea {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    background: #fff;
    color: #1f2933;
    padding: 8px 10px;
}

.product-detail-form.is-read-mode input:disabled,
.product-detail-form.is-read-mode select:disabled,
.product-detail-form.is-read-mode textarea:disabled {
    opacity: 1;
    background: var(--surface-muted);
    color: #1f2933;
    cursor: default;
}

.field select[multiple],
.property-editor select[multiple] {
    min-height: 150px;
}

.property-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    background: #fff;
}

.property-checkbox-grid label {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #1f2933;
    font-weight: 800;
}

.property-checkbox-grid input {
    width: 16px;
    min-height: 16px;
}

.user-manufacturer-grid {
    grid-template-columns: 1fr;
    max-height: 280px;
    overflow-y: auto;
}

.user-manufacturer-grid label {
    padding: 7px 9px;
    border: 1px solid transparent;
    border-radius: 6px;
}

.user-manufacturer-grid label.is-selected {
    border-color: rgba(255, 204, 0, 0.95);
    background: #fff7cc;
    color: #171717;
    font-weight: 900;
}

.field-help {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.retailer-manufacturer-grid {
    max-height: 340px;
    overflow-y: auto;
}

.field textarea,
.property-editor textarea {
    resize: vertical;
    line-height: 1.45;
}

.field input[type="file"],
.property-editor input[type="file"] {
    padding: 7px;
}

.edit-only {
    justify-self: start;
}

.product-detail-form.is-read-mode .edit-only,
.product-detail-form.is-read-mode input[type="file"] {
    display: none;
}

.new-product-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.42);
}

.new-product-dialog {
    width: min(440px, 100%);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.24);
    padding: 18px;
}

.new-product-dialog form {
    display: grid;
    gap: 14px;
}

.new-product-dialog h2 {
    margin: 0;
    font-size: 20px;
}

.new-product-note {
    margin: 0;
    border: 1px solid #f0d494;
    border-radius: 7px;
    background: #fff8e6;
    color: #765419;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 800;
}

.new-product-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.new-product-actions button {
    min-height: 38px;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    background: #fff;
    color: #28313a;
    padding: 8px 12px;
    font-weight: 800;
}

.new-product-actions .primary-action {
    border-color: var(--accent-dark);
    background: var(--accent);
    color: #fff;
}

.full-field {
    grid-column: 1 / -1;
}

.checkbox-field {
    display: grid;
    align-content: end;
    align-items: center;
    grid-template-columns: auto 1fr;
    gap: 8px;
}

.checkbox-field input {
    width: 18px;
    min-height: 18px;
}

.property-editor-list {
    display: grid;
    gap: 9px;
}

.property-editor span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.property-editor em {
    color: var(--muted);
    font-style: normal;
    font-weight: 700;
}

.property-editor input:disabled {
    background: #f0f2f4;
    color: var(--muted);
}

.empty-row {
    color: var(--muted);
    text-align: center;
}

.status-pill {
    display: inline-grid;
    place-items: center;
    min-height: 22px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #e7eef5;
    color: #2f607f;
    font-size: 11px;
    font-weight: 900;
}

.status-pill.warn {
    background: #fff1df;
    color: #945c00;
}

.status-pill.danger {
    background: #ffe8e7;
    color: var(--danger);
}

.status-pill.neutral {
    background: #e9edf1;
    color: #52606d;
}

.update-change-cell {
    font-weight: 800;
}

.import-shell {
    grid-template-columns: minmax(0, 1fr) 360px;
}

.import-upload-panel {
    margin-bottom: 18px;
}

.import-drop-zone {
    min-height: 210px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    margin: 16px;
    border: 2px dashed var(--line-strong);
    border-radius: 8px;
    background: var(--surface-muted);
    color: #24313f;
    text-align: center;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.import-drop-zone:hover,
.import-drop-zone.is-dragging {
    border-color: var(--accent);
    background: #eef6fc;
}

.import-drop-title {
    font-size: 22px;
    font-weight: 900;
}

.import-drop-meta {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.import-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    margin: 0 16px 16px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--line);
}

.import-summary div {
    min-width: 0;
    padding: 12px 14px;
    background: #fff;
}

.import-summary strong,
.import-summary span {
    display: block;
}

.import-summary strong {
    font-size: 20px;
}

.import-summary span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.import-summary .import-warning,
.import-summary .import-error {
    grid-column: 1 / -1;
}

.import-error {
    color: var(--danger);
}

.import-actions {
    display: flex;
    gap: 8px;
    margin: 0 16px 16px;
}

.table-inline-action {
    min-height: 30px;
    padding: 5px 9px;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    background: #fff;
    color: #25313d;
    font-weight: 900;
}

.table-inline-action.danger {
    border-color: #efc5c2;
    background: #fff0ef;
    color: var(--danger);
}

.import-table-scroll {
    height: calc(100vh - 448px);
    min-height: 230px;
}

.import-result-table td:last-child {
    max-width: 520px;
}

.import-column-list {
    display: grid;
    gap: 8px;
    margin: 18px 0;
}

.import-column-list strong {
    margin-top: 8px;
    color: #202a34;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.import-column-list span {
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface-muted);
    font-weight: 700;
}

.import-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 24px;
}

.import-history-header h2 {
    margin: 0;
}

.import-history-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.import-history-item {
    display: grid;
    gap: 4px;
    width: 100%;
    padding: 10px 11px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface-muted);
    color: #28313a;
    text-align: left;
}

.import-history-item strong,
.import-history-item span,
.import-history-item small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.import-history-item span,
.import-history-item small {
    color: var(--muted);
}

.import-history-item small {
    font-weight: 700;
}

.property-list {
    display: grid;
    gap: 8px;
}

.property-item {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface-muted);
}

.property-label {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: #2d3741;
    font-size: 12px;
    font-weight: 900;
}

.property-tags {
    display: flex;
    gap: 4px;
    flex: 0 0 auto;
}

.property-tag {
    padding: 1px 5px;
    border-radius: 999px;
    background: #e4edf6;
    color: #2d618d;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.property-value {
    margin-top: 5px;
    overflow-wrap: anywhere;
    line-height: 1.45;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: #151719;
}

.login-panel {
    width: min(420px, 100%);
    padding: 28px;
    border: 1px solid #2b333d;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
}

.login-brand {
    margin-bottom: 24px;
}

.login-panel h1 {
    margin: 0;
    font-size: 26px;
}

.login-panel p {
    color: var(--muted);
    line-height: 1.5;
}

.login-form {
    display: grid;
    gap: 9px;
}

.login-form label {
    font-size: 12px;
    font-weight: 900;
    color: #42505d;
}

.login-form input {
    min-height: 42px;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    padding: 9px 11px;
}

.login-form button {
    min-height: 42px;
    margin-top: 8px;
    border: 0;
    border-radius: 7px;
    background: var(--accent);
    color: #fff;
    font-weight: 900;
}

.login-error {
    padding: 9px 10px;
    border-radius: 7px;
    background: #fff0ef;
    color: var(--danger);
    font-size: 13px;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    gap: 12px;
    background: rgba(242, 243, 245, 0.72);
    z-index: 20;
}

.loading-overlay.hidden {
    display: none;
}

.admin-henrik-panel {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 15;
    width: min(460px, calc(100vw - 32px));
    max-height: min(640px, calc(100vh - 48px));
    display: grid;
    grid-template-rows: auto minmax(180px, 1fr) auto;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 24px 80px rgba(20, 33, 51, 0.24);
}

.admin-henrik-panel.hidden {
    display: none;
}

.admin-henrik-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 14px;
    border-bottom: 1px solid var(--line);
    background: #151719;
    color: #fff;
}

.admin-henrik-header strong,
.admin-henrik-header span {
    display: block;
}

.admin-henrik-header span {
    margin-top: 2px;
    color: #9ca8b4;
    font-size: 12px;
}

.admin-henrik-header button {
    width: 32px;
    height: 32px;
    border: 1px solid #3b4652;
    border-radius: 7px;
    background: #20252b;
    color: #fff;
    font-size: 20px;
    line-height: 1;
}

.admin-henrik-messages {
    display: grid;
    align-content: start;
    gap: 10px;
    min-height: 0;
    overflow-y: auto;
    padding: 14px;
    background: var(--surface-muted);
}

.admin-henrik-message {
    white-space: pre-line;
    overflow-wrap: anywhere;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: #28313a;
    line-height: 1.45;
}

.admin-henrik-message-user {
    margin-left: 38px;
    border-color: #b8d3eb;
    background: #eef6fc;
}

.admin-henrik-message-system {
    margin-right: 24px;
}

.admin-henrik-message-error {
    border-color: #f0bbb7;
    background: #fff0ef;
    color: var(--danger);
}

.admin-henrik-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--line);
}

.admin-henrik-form textarea {
    min-width: 0;
    min-height: 72px;
    resize: vertical;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    padding: 9px 10px;
    font: inherit;
}

.retailer-row {
    align-items: center;
    gap: 8px;
}

.retailer-row.is-selected {
    border-color: rgba(255, 204, 0, 0.9);
    background: #fff7cc;
}

.retailer-row > button:first-child {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-width: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.forum-detail-content {
    gap: 14px;
}

.forum-detail-image {
    background: #f7f9fb;
}

.forum-post-body {
    white-space: pre-line;
    overflow-wrap: anywhere;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: #28313a;
    line-height: 1.45;
}

.forum-comment-list {
    display: grid;
    gap: 10px;
}

.forum-comment-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.forum-comment-row div {
    min-width: 0;
}

.forum-comment-row strong,
.forum-comment-row small,
.forum-comment-row p {
    display: block;
}

.forum-comment-row small {
    margin-top: 2px;
    color: var(--muted);
}

.forum-comment-row p {
    margin: 8px 0 0;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.loading-spinner {
    width: 34px;
    height: 34px;
    border: 4px solid #c8d4df;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

@media (max-width: 1200px) {
    .admin-shell {
        grid-template-columns: 260px minmax(0, 1fr);
    }

    .users-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .detail-panel {
        display: none;
    }
}

@media (max-width: 820px) {
    .admin-shell {
        height: auto;
        min-height: 100vh;
        grid-template-columns: 1fr;
        overflow: visible;
    }

    .users-shell {
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    .sidebar {
        max-height: 42vh;
    }

    .workspace {
        overflow: visible;
    }

    .topbar,
    .toolbar {
        display: grid;
        width: 100%;
    }

    .summary-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Category property editor */
.sidebar-edit-columns {
    margin: 8px 0 4px;
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--border, #d8d8d8);
    border-radius: 6px;
    background: #fff;
    font-weight: 700;
    cursor: pointer;
}

.sidebar-edit-columns:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.column-editor {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
}

.column-editor-head {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.column-editor-head h2 {
    margin: 0;
    font-size: 17px;
}

.column-editor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.column-editor-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.column-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--border, #e2e2e2);
    border-radius: 7px;
    background: #fff;
}

.column-row.is-deleted {
    opacity: 0.5;
    text-decoration: line-through;
}

.column-drag {
    cursor: grab;
    color: #999;
    user-select: none;
}

.column-row .column-name {
    flex: 1 1 160px;
    min-width: 120px;
}

.column-row .column-type {
    flex: 0 0 110px;
}

.column-row .column-unit {
    flex: 0 0 90px;
}

.column-flag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    white-space: nowrap;
}

.column-delete {
    margin-left: auto;
    border: 0;
    background: none;
    cursor: pointer;
    font-size: 16px;
}

.supplier-danger-zone {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--border, #e2e2e2);
}

.danger-action {
    padding: 9px 14px;
    border: 1px solid #510012;
    border-radius: 6px;
    background: #510012;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.danger-action:hover {
    background: #6c0c1d;
    border-color: #6c0c1d;
}
