:root {
    --bg: #f3f6f9;
    --bg-accent: #d8ecff;
    --surface: #ffffff;
    --surface-2: #f7fbff;
    --text: #112034;
    --muted: #607189;
    --line: #d9e2ec;
    --primary: #0a84ff;
    --primary-strong: #005fd6;
    --danger: #cf304a;
    --success: #0d9b67;
    --shadow: 0 14px 40px rgba(17, 32, 52, 0.08);
}

* {
    box-sizing: border-box;
}

img,
svg,
canvas {
    max-width: 100%;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text);
    background:
            radial-gradient(circle at 0% 10%, var(--bg-accent) 0, transparent 44%),
            radial-gradient(circle at 100% 0%, #ffe2ce 0, transparent 35%),
            var(--bg);
    min-height: 100vh;
}

.page-loader-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(243, 246, 249, 0.55);
    backdrop-filter: blur(1px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-loader-box {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    color: #20354e;
    font-weight: 600;
    box-shadow: var(--shadow);
}

.page-loader-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(32, 53, 78, 0.25);
    border-top-color: #20354e;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.app-wrap {
    width: min(1360px, 96vw);
    margin: 28px auto 48px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.auth-layout {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card {
    width: min(420px, 100%);
    padding: 30px;
}

.brand-title {
    margin: 0 0 8px;
    font-family: 'Trebuchet MS', 'Gill Sans', sans-serif;
    font-size: 30px;
    letter-spacing: 0.2px;
}

.brand-subtitle {
    margin: 0 0 24px;
    color: var(--muted);
}

.auth-password-label {
    margin-top: 12px;
}

.auth-submit-btn {
    margin-top: 16px;
}

.input, .select, .textarea, .btn {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--line);
    padding: 11px 12px;
    font: inherit;
}

.textarea {
    min-height: 100px;
    resize: vertical;
}

.input:focus, .select:focus, .textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.14);
}

.btn {
    border: none;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s ease, background 0.2s ease;
}

.btn:hover {
    background: var(--primary-strong);
    transform: translateY(-1px);
}

.btn:disabled,
.btn:disabled:hover {
    opacity: 0.75;
    cursor: not-allowed;
    transform: none;
}

.btn-loader {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 6px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-top-color: #fff;
    border-radius: 50%;
    vertical-align: -2px;
    animation: spin 0.8s linear infinite;
}

.btn.secondary .btn-loader,
.btn.ghost .btn-loader,
.btn.danger .btn-loader {
    border-color: rgba(32, 53, 78, 0.35);
    border-top-color: currentColor;
}

.btn.secondary {
    background: #e7f1ff;
    color: #0b4b99;
}

.btn.danger {
    background: #ffe6eb;
    color: var(--danger);
}

.btn.ghost {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--text);
}

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

.toolbar-nav {
    display: flex;
    align-items: center;
    position: relative;
    min-width: 0;
}

.toolbar-actions {
    display: flex;
    align-items: center;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.toolbar-right .btn {
    white-space: nowrap;
}

.burger-btn {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
}

.burger-btn span {
    display: block;
    width: 18px;
    height: 2px;
    background: #233952;
    border-radius: 2px;
}

.grid {
    display: grid;
    gap: 18px;
    align-content: start;
}

.dashboard-grid {
    /*grid-template-columns: 1.3fr 1fr;*/
    /*align-items: start;*/
}

.section {
    padding: 20px;
}

.section-compact {
    padding-top: 16px;
    padding-bottom: 16px;
}

.section-title {
    margin: 0 0 14px;
    font-family: 'Trebuchet MS', 'Gill Sans', sans-serif;
    font-size: 20px;
}

.section-title-tight {
    margin-bottom: 0;
}

.section-heading-row {
    justify-content: space-between;
    align-items: flex-start;
}

.section-subtitle {
    margin: 6px 0 0;
}

.row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.row + .row {
    margin-top: 10px;
}

.label {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 6px;
    display: block;
}

.form-grid {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 10px;
    align-items: end;
}

.track-form-grid .btn {
    width: auto;
    min-width: 86px;
}

.track-submit-btn,
.btn-inline-auto {
    width: auto;
}

.products-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.products-table th,
.products-table td {
    border-bottom: 1px solid var(--line);
    padding: 12px 8px;
    text-align: left;
    vertical-align: top;
}

.products-table th {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.products-table tbody tr {
    transition: background 0.2s ease;
}

.products-table tbody tr:hover {
    background: var(--surface-2);
}

.products-table tbody tr.active {
    background: #eaf4ff;
}

.table-wrap {
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow-x: auto;
    overflow-y: auto;
    max-height: 360px;
    margin-top: 10px;
}

.table-wrap .products-table-main {
    min-width: 760px;
}

.users-table-wrap {
    max-height: none;
}

.users-table-wrap-spaced {
    margin-top: 10px;
}

.users-table {
    min-width: 640px;
}

.table-wrap .products-table th,
.table-wrap .products-table td {
    padding-left: 12px;
    padding-right: 12px;
}

.table-wrap .products-table thead th {
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 2;
}

.products-table-main th:nth-child(2),
.products-table-main th:nth-child(3),
.products-table-main th:nth-child(4),
.products-table-main th:nth-child(5),
.products-table-main td:nth-child(2),
.products-table-main td:nth-child(3),
.products-table-main td:nth-child(4),
.products-table-main td:nth-child(5) {
    white-space: nowrap;
}

@media (min-width: 981px) {
    .products-table-main th:nth-child(1),
    .products-table-main td:nth-child(1) {
        width: 42%;
    }

    .products-table-main th:nth-child(5),
    .products-table-main td:nth-child(5) {
        width: 260px;
    }
}

.chart-panel {
    height: 320px;
    margin-top: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: linear-gradient(180deg, #f9fcff 0%, #ffffff 100%);
    padding: 8px;
}

.history-range-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.history-range-btn {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    padding: 8px 12px;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.history-range-btn.active {
    border-color: #b8d5ff;
    background: #e7f1ff;
    color: #0b4b99;
    font-weight: 600;
}

.price-up {
    color: var(--danger);
}

.price-down {
    color: var(--success);
}

.kpi-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.kpi {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
}

.kpi-title {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.kpi-value {
    margin: 6px 0 0;
    font-size: 22px;
    font-family: 'Trebuchet MS', 'Gill Sans', sans-serif;
}

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

.tabs {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 0;
    background: #fff;
}

.tabs button {
    border: none;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    padding: 8px 14px;
    font: inherit;
    color: var(--muted);
}

.tabs button.active {
    background: #e7f1ff;
    color: #0b4b99;
    font-weight: 600;
}

.notif-dropdown {
    position: relative;
}

.notif-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    color: #2a4260;
    cursor: pointer;
}

.notif-trigger svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.notif-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 2px solid #fff;
    background: #e63956;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 14px;
    text-align: center;
    padding: 0 4px;
}

.notif-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-height: 460px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(17, 32, 52, 0.16);
    z-index: 30;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.notif-menu-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid #edf2f7;
}

.notif-enable-btn {
    width: auto;
    margin: 10px 12px 0;
}

.notif-disabled {
    margin: 10px 12px 0;
    font-size: 13px;
}

.notif-status {
    margin: 10px 12px 0;
    font-size: 13px;
}

.notif-menu-list {
    max-height: 280px;
    overflow: auto;
    padding: 10px 12px;
    display: grid;
    gap: 10px;
}

.notif-menu-item {
    border: 1px solid var(--line);
    border-left: 4px solid var(--primary);
    border-radius: 10px;
    padding: 8px 10px;
    background: #fff;
}

.notif-item-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.notif-delete-btn {
    width: auto;
    padding: 4px 8px;
    font-size: 12px;
}

.notif-empty {
    margin: 2px 0;
    color: var(--muted);
}

.notif-menu-footer {
    border-top: 1px solid #edf2f7;
    padding: 10px 12px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

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

.notification-item {
    border: 1px solid var(--line);
    border-left: 4px solid var(--primary);
    border-radius: 12px;
    padding: 10px 12px;
    background: #fff;
}

.spacer {
    flex: 1;
}

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

.table-actions {
    flex-wrap: wrap;
}

.table-actions .btn {
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 14px;
}

.product-chart-toggle-wrap {
    margin-top: 8px;
}

.product-chart-toggle {
    min-width: 108px;
}

.small-input {
    max-width: 115px;
}

.error {
    color: var(--danger);
    margin-top: 10px;
    font-size: 14px;
}

.success {
    color: var(--success);
    margin-top: 10px;
    font-size: 14px;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: #e7f1ff;
    color: #0b4b99;
    font-size: 12px;
    padding: 4px 8px;
}

.badge-stale {
    background: #ffe6eb;
    color: var(--danger);
}

.health-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.health-kpi-value {
    font-size: 18px;
    line-height: 1.3;
}

.health-trend-wrap {
    margin-top: 14px;
}

.health-trend-list {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}

.health-trend-row {
    display: grid;
    grid-template-columns: 110px 1fr auto;
    gap: 10px;
    align-items: center;
}

.health-trend-day {
    font-size: 12px;
}

.health-trend-bar {
    height: 10px;
    border-radius: 999px;
    background: #edf2f7;
    overflow: hidden;
}

.health-trend-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #0a84ff 0%, #5aa9ff 100%);
}

.health-trend-count {
    min-width: 24px;
    text-align: right;
    font-size: 13px;
}

.notif-header {
    align-items: flex-start;
}

.notif-actions {
    justify-content: flex-end;
}

.perm-pill {
    display: inline-flex;
    align-items: center;
    border: 1px solid #cfd9e7;
    border-radius: 999px;
    background: #fff;
    color: #20354e;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.preferences-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.preferences-field {
    max-width: 680px;
}

.preferences-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.preference-card {
    align-items: flex-start;
    gap: 8px;
    min-height: 120px;
    padding: 16px;
}

.preference-card-title {
    font-weight: 600;
    color: var(--text);
}

.preference-card-copy {
    line-height: 1.45;
}

.settings-textarea-wrap {
    margin-top: 12px;
}

.settings-footer {
    margin-top: 14px;
}

.admin-users {
    margin-top: 24px;
    padding-top: 4px;
}

.admin-user-form {
    display: grid;
    grid-template-columns: 1.4fr 1.4fr 0.8fr auto;
    gap: 10px;
    align-items: end;
}

.admin-edit-form {
    margin-top: 14px;
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

.status-strip {
    display: grid;
    gap: 6px;
    margin-top: 14px;
    margin-bottom: 14px;
}

.no-margin {
    margin: 0;
}

.checkbox-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    color: var(--muted);
}

.checkbox-row input {
    margin: 0;
}

.dashboard-toolbar-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(180px, 0.8fr) minmax(220px, auto);
    gap: 12px;
    align-items: end;
}

.toggle-card {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
}

.toggle-card input {
    margin: 0;
}

.toggle-card-vertical {
    align-items: flex-start;
}

.toggle-card-inline {
    min-height: auto;
    padding: 8px 10px;
    background: #fff;
}

.product-cell {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.product-thumb {
    flex: 0 0 62px;
    width: 62px;
    height: 62px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
}

.product-cell-body {
    min-width: 0;
}

.product-cell-body strong {
    display: inline-block;
    margin-bottom: 4px;
}

.stock-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.stock-pill.in {
    background: #e6f8f1;
    color: #0d7a53;
}

.stock-pill.out {
    background: #ffe8ec;
    color: #b02942;
}

.badge-neutral {
    background: #eef3f8;
    color: #31465f;
}

.empty-state {
    margin-top: 14px;
    padding: 18px;
    border: 1px dashed #cbd7e6;
    border-radius: 14px;
    background: #fbfdff;
}

.failures-list {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

.failure-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.failure-card-main {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    min-width: 0;
}

.failure-thumb {
    width: 74px;
    height: 74px;
}

.product-detail-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.product-detail-topbar-left,
.product-detail-topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.product-detail-topbar-right {
    margin-left: auto;
}

.external-link-btn {
    text-decoration: none;
}

.product-detail-hero {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.product-detail-hero.no-media {
    grid-template-columns: minmax(0, 1fr);
}

.product-detail-media {
    width: 100%;
}

.product-detail-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: #fff;
}

.product-detail-copy .section-title {
    margin-bottom: 8px;
}

.product-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin: 16px 0;
}

.detail-meta-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.detail-meta-item {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfdff;
}

.detail-meta-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

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

.alert-form-grid {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.alert-form-actions {
    display: flex;
    align-items: flex-end;
}

.alerts-list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.alert-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.alert-card-main {
    display: grid;
    gap: 6px;
}

.alert-card-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.audit-log-list {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.audit-log-item {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.audit-log-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.audit-log-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
}

.fade-in {
    animation: fadeIn 420ms ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

    .dashboard-toolbar-grid,
    .stats-grid,
    .product-meta-grid,
    .alert-form-grid {
        grid-template-columns: 1fr;
    }

    .app-wrap {
        width: 96vw;
        margin-top: 14px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .preferences-options-grid {
        grid-template-columns: 1fr;
    }

    .admin-user-form {
        grid-template-columns: 1fr;
    }

    .toolbar {
        align-items: flex-start;
    }

    .burger-btn {
        display: inline-flex;
        flex: 0 0 auto;
    }

    .toolbar-nav {
        flex: 0 0 auto;
    }

    .toolbar-actions {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        height: 100dvh;
        width: min(340px, 86vw);
        padding: 74px 14px 18px;
        background: #fff;
        border-right: 1px solid var(--line);
        box-shadow: 16px 0 40px rgba(17, 32, 52, 0.2);
        z-index: 60;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        overflow-y: auto;
        transform: translateX(-105%);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: transform 220ms ease, opacity 220ms ease, visibility 220ms ease;
    }

    .toolbar-actions.open {
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .tabs {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .tabs button {
        width: 100%;
        text-align: left;
    }

    .burger-btn {
        position: relative;
        z-index: 70;
    }

    .toolbar-right {
        gap: 8px;
        margin-left: auto;
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
        min-width: 0;
    }

    .toolbar-right .btn {
        font-size: 13px;
        padding: 9px 10px;
    }

    .notif-actions {
        justify-content: flex-start;
    }

    .table-actions {
        flex-wrap: wrap;
    }

    .failure-card,
    .product-detail-hero,
    .alert-card,
    .audit-log-head {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .notif-menu {
        width: min(92vw, 360px);
        right: 0;
        max-height: 360px;
    }

    .notif-menu-footer {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .section {
        padding: 14px;
    }

    .section-title {
        font-size: 18px;
    }

    .section-heading-row {
        gap: 10px;
    }

    .chart-panel {
        height: 260px;
    }

    .small-input {
        max-width: 100%;
    }

    .product-detail-image {
        max-width: 220px;
    }

    .product-detail-topbar-right {
        margin-left: 0;
    }

    .product-table-wrap {
        border: none;
        max-height: none;
        overflow: visible;
        padding: 0;
    }

    .product-table-wrap .products-table-main {
        min-width: 0;
    }

    .products-table-main thead {
        display: none;
    }

    .products-table-main,
    .products-table-main tbody,
    .products-table-main tr,
    .products-table-main td {
        display: block;
        width: 100%;
    }

    .products-table-main tr {
        border: 1px solid var(--line);
        border-radius: 12px;
        background: #fff;
        padding: 10px 12px;
        margin-bottom: 10px;
    }

    .products-table-main tr.active {
        background: #eef6ff;
    }

    .products-table-main td {
        border-bottom: none;
        padding: 8px 0;
        white-space: normal !important;
        width: 100%;
    }

    .products-table-main td::before {
        content: attr(data-label);
        display: block;
        font-size: 11px;
        color: var(--muted);
        text-transform: uppercase;
        letter-spacing: 0.04em;
        margin-bottom: 3px;
    }

    .products-table-main td.no-label::before {
        display: none;
    }

    .products-table-main .table-actions {
        justify-content: flex-start;
    }

    .products-empty-row {
        margin-bottom: 0;
    }
}

@media (max-width: 780px) {
    .users-table-wrap {
        border: none;
        max-height: none;
        overflow: visible;
        padding: 0;
    }

    .users-table {
        min-width: 0;
    }

    .users-table thead {
        display: none;
    }

    .users-table,
    .users-table tbody,
    .users-table tr,
    .users-table td {
        display: block;
        width: 100%;
    }

    .users-table tr {
        border: 1px solid var(--line);
        border-radius: 12px;
        background: #fff;
        padding: 10px 12px;
        margin-bottom: 10px;
    }

    .users-table td {
        border-bottom: none;
        padding: 7px 0;
        white-space: normal !important;
    }

    .users-table td::before {
        content: attr(data-label);
        display: block;
        font-size: 11px;
        color: var(--muted);
        text-transform: uppercase;
        letter-spacing: 0.04em;
        margin-bottom: 3px;
    }

    .users-table td.no-label::before {
        display: none;
    }
}

@media (max-width: 560px) {
    .notif-dropdown {
        position: static;
    }
    .auth-layout {
        padding: 14px;
    }

    .auth-card {
        padding: 22px 16px;
    }

    .brand-title {
        font-size: 24px;
    }

    .page-loader-box {
        width: min(92vw, 320px);
        justify-content: center;
        text-align: center;
    }

    .toolbar {
        flex-wrap: nowrap;
        align-items: center;
        gap: 8px;
    }

    .toolbar-nav {
        flex: 0 0 auto;
    }

    .toolbar-right {
        width: auto;
        margin-left: auto;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        flex-wrap: nowrap;
        gap: 6px;
        min-width: 0;
    }

    .toolbar-right .btn {
        width: auto;
        min-width: 0;
        padding: 8px 9px;
        font-size: 12px;
        white-space: nowrap;
    }

    .history-range-tabs {
        justify-content: flex-start;
    }

    .toolbar-right .run-check-btn {
        max-width: 96px;
    }

    .toolbar-right .logout-btn {
        max-width: 78px;
    }

    .notif-menu {
        width: min(96vw, 360px);
        right: -2px;
    }

    .product-detail-topbar {
        justify-content: flex-start;
    }

    .detail-meta-list {
        grid-template-columns: 1fr;
    }

    .product-cell {
        gap: 10px;
    }

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

    .section {
        padding: 12px;
    }
}
