.mp-card-skeleton {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    padding: 0;
    margin-bottom: 0;
    width: 100%;
    display: block;
    height: 108px;
}
.dash-log-skeleton {
    width: 100%;
    display: block;
}
/* Base Application Styles - Modern & Clean Design */

/* ========== CSS Variables ========== */
:root {
    /* Primary palette */
    --primary-color: #000000;
    --primary-hover: #00000087;
    --primary-light: #dbeeff;

    /* Semantic colors */
    --secondary-color: #52555b;
    --success-color: #008a21;
    --success-light: #dcf5e4;
    --warning-color: #dba400;
    --warning-light: #fef3c0;
    --danger-color: #d40924;
    --danger-light: #fde8ea;

    /* Layout */
    --dark-bg: #1e293b;
    --sidebar-width: 248px;
    --topbar-height: 64px;
    --logo-height: 40px;

    /* Typography */
    --text-primary: #090b0f;
    --text-secondary: #52555b;

    /* Surfaces */
    --border-color: #d4d8de;
    --bg-page: #f6f9fc;
    --bg-light: #f3f5f9;
    --card-bg: #ffffff;
    --sidebar-bg: #f3f5f9;

    /* Shadows */
    --card-shadow: 0 1px 2px 0 rgba(0,0,0,0.05), 0 1px 3px 0 rgba(0,0,0,0.03);
    --card-shadow-hover: 0 4px 12px -2px rgba(0,0,0,0.09), 0 2px 6px -1px rgba(0,0,0,0.05);

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Brand marketplace colors */
    --brand-amazon: #d27400;
    --brand-takealot: #0064bc;
    --brand-makro: #be0019;
    --brand-leroy: #007b0a;

    /* Chart colors */
    --chart-1: #e75f00;
    --chart-2: #0073cd;
    --chart-3: #008a21;
    --chart-4: #e85a48;
    --chart-5: #544ec5;
}

/* ========== Reset & Base ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-page);
    overflow-x: hidden;
    width: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    color: var(--primary-hover);
}

/* ========== Layout ========== */
#app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

/* ========== Sidebar ========== */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: var(--text-primary);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    border-right: 1px solid var(--border-color);
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--sidebar-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-logo {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo-icon {
    height: var(--logo-height);
    object-fit: contain;
}

/* ========== Organization Switcher ========== */
.org-switcher {
    position: relative;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.org-switcher-button {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background-color: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.org-switcher-button:hover {
    border-color: #d1d5db;
}

.org-switcher.active .org-switcher-button {
    border-color: var(--primary-color);
}

.org-switcher .org-icon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.org-switcher .org-name {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: left;
}

.org-switcher .chevron-icon {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
    transition: transform 0.15s ease;
}

.org-switcher.active .chevron-icon {
    transform: rotate(180deg);
}

.org-switcher-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 16px;
    right: 16px;
    margin-top: 4px;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    max-height: 300px;
    overflow-y: auto;
}

.org-switcher.active .org-switcher-dropdown {
    display: block;
}

.org-switcher-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 14px;
    transition: background-color 0.15s ease;
    cursor: pointer;
}

.org-switcher-item:hover {
    background-color: var(--bg-light);
}

.org-switcher-item.active {
    background-color: var(--primary-light);
    color: var(--primary-color);
    font-weight: 600;
}

.org-switcher-item:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.org-switcher-item:last-child {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.org-switcher-item .org-item-name {
    flex: 1;
}

.org-switcher-item .checkmark {
    width: 16px;
    height: 16px;
    color: var(--primary-color);
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 12px 8px;
}

.sidebar-menu ul {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 2px;
}

.menu-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 12px 12px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    color: var(--text-secondary);
    transition: all 0.15s ease;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.sidebar-menu a:hover {
    background-color: var(--bg-light);
    color: var(--text-primary);
}

.sidebar-menu a.active {
    background-color: var(--primary-light);
    color: var(--primary-color);
    font-weight: 600;
}

.sidebar-menu .menu-icon {
    width: 17px;
    height: 17px;
    margin-right: 10px;
    flex-shrink: 0;
    opacity: 0.75;
}

.sidebar-menu a.active .menu-icon,
.sidebar-menu a:hover .menu-icon {
    opacity: 1;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    background-color: var(--sidebar-bg);
}

/* ========== Main Content ========== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    height: 100vh;
}

.main-content.sidebar-collapsed {
    margin-left: 0;
}

/* ========== Topbar ========== */
.topbar {
    height: var(--topbar-height);
    background-color: var(--sidebar-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.menu-toggle:hover {
    background-color: var(--bg-light);
}

.topbar-search {
    position: relative;
}

.topbar-search input {
    padding: 8px 16px 8px 40px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    width: 300px;
    font-size: 14px;
    display: none;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.user-menu:hover {
    background-color: var(--bg-light);
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.02em;
}

/* ========== Page Content ========== */
.page-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    overflow-x: hidden;
}

.page-header {
    margin-bottom: 10px;
}

/* Only use flex layout when actions are present */
.page-header:has(.page-header-actions) {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.page-header > div:first-child {
    flex: 1;
}

.page-header-actions {
    display: flex;
    gap: 12px;
    margin-right: 15px;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.025em;
}


/* ========== Cards ========== */
.card {
    background-color: #fff;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
    border-color: #cbd5e1;
}

.card-header {
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.card-body {
    padding: 0;
}

/* ========== Buttons ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 500;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    letter-spacing: -0.01em;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* disabled button animation */

.btn:disabled {
    animation: pulse 2s infinite;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    color: #fff;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: #fff;
}

.btn-secondary:hover {
    background-color: #475569;
}

.btn-success {
    background-color: var(--success-color);
    color: #fff;
}

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

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

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

/* ========== Forms ========== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-error {
    color: var(--danger-color);
    font-size: 13px;
    margin-top: 6px;
}

/* ========== Tables ========== */
.table-container {
    overflow-x: auto;
}

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

thead {
    background-color: var(--bg-light);
}

th {
    padding: 11px 16px;
    text-align: left;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

tr:last-child td {
    border-bottom: none;
}

/* ========== Responsive Tables ========== */
.responsive-table-container {
    overflow-x: auto;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

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

.responsive-table thead {
    background-color: var(--bg-light);
}

.responsive-table th {
    padding: 11px 16px;
    text-align: left;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-bottom: 1px solid var(--border-color);
}

.responsive-table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-primary);
}

.responsive-table tbody tr {
    transition: background-color 0.2s;
}

.responsive-table tbody tr:hover {
    background-color: var(--bg-light);
}

.responsive-table tbody tr:last-child td {
    border-bottom: none;
}

/* Mobile card layout */
@media (max-width: 768px) {
    .responsive-table-container {
        overflow-x: visible;
        background: transparent;
        box-shadow: none;
    }

    .responsive-table thead {
        display: none;
    }

    .responsive-table tbody {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .responsive-table tbody tr {
        display: block;
        background: #fff;
        border: 1px solid var(--border-color);
        border-radius: 12px;
        padding: 20px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
        transition: all 0.2s;
    }

    .responsive-table tbody tr:hover {
        background: #fff;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        transform: translateY(-2px);
    }

    .responsive-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 0;
        border-bottom: 1px solid #f1f5f9;
    }

    .responsive-table td:first-child {
        padding-top: 0;
    }

    .responsive-table td:last-child {
        border-bottom: none;
        padding-bottom: 0;
        margin-top: 8px;
    }

    .responsive-table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 11px;
        text-transform: uppercase;
        color: var(--text-secondary);
        letter-spacing: 0.5px;
        min-width: 100px;
    }

    .responsive-table td[data-label="Actions"] {
        justify-content: flex-end;
        flex-wrap: wrap;
        padding-top: 16px;
        border-top: 1px solid #f1f5f9;
    }

    .responsive-table td[data-label="Actions"]::before {
        content: none;
    }

    .responsive-table td[data-label="Actions"] > div {
        width: 100%;
        justify-content: flex-end;
    }

    .responsive-table td[data-label="Actions"] .btn {
        width: 100%;
    }

    .responsive-table td[data-label="Organizations"],
    .responsive-table td[data-label="Status"] {
        align-items: flex-start;
    }

    .responsive-table td[data-label="Organizations"] {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .responsive-table td[data-label="Organizations"]::before {
        margin-bottom: 4px;
    }

    .responsive-table .no-data-row {
        display: block;
        text-align: center;
        padding: 40px 20px;
        border: none;
    }

    .responsive-table .no-data-row::before {
        content: none;
    }
}

/* ========== Pagination ========== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
}

.pagination button,
.pagination a {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: #fff;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.pagination button:hover,
.pagination a:hover {
    background-color: var(--bg-light);
}

.pagination .active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* ========== Alerts ========== */
.alert {
    padding: 14px 18px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background-color: var(--success-light);
    color: #005a15;
    border: 1px solid #a3d9b0;
}

.alert-error {
    background-color: var(--danger-light);
    color: #8b0614;
    border: 1px solid #f5a3ae;
}

.alert-info {
    background-color: #dbeeff;
    color: #004e8c;
    border: 1px solid #9ac5ed;
}

.alert-warning {
    background-color: var(--warning-light);
    color: #7a5900;
    border: 1px solid #e9cc7a;
}

/* ========== Modal ========== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

/* When modal is inside modal-backdrop, it's just a content box not an overlay */
.modal-backdrop .modal {
    position: static;
    background-color: #fff;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    display: block;
    z-index: auto;
}

.modal-content {
    background-color: #fff;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.modal-close:hover {
    background-color: var(--bg-light);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Modal animations */
.success-icon,
.error-icon {
    display: block;
    margin: 0 auto;
}

.success-circle,
.error-circle {
    stroke-dasharray: 157;
    stroke-dashoffset: 157;
    animation: circle-draw 0.6s ease-out forwards;
}

.success-check {
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: success-check-animation 0.3s 0.6s ease-out forwards;
}

.error-cross-left,
.error-cross-right {
    stroke-dasharray: 28;
    stroke-dashoffset: 28;
    animation: error-cross-animation 0.3s ease-out forwards;
}

.error-cross-left {
    animation-delay: 0.6s;
}

.error-cross-right {
    animation-delay: 0.75s;
}

@keyframes circle-draw {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes success-check-animation {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes error-cross-animation {
    to {
        stroke-dashoffset: 0;
    }
}

/* ========== Utilities ========== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 16px;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(0%);
        position: fixed;
        z-index: 1001;
    }
    
    .sidebar.collapsed {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        width: 100vw;
        max-width: 100vw;
    }
    
    .topbar {
        padding: 0 16px;
        width: 100%;
    }
    
    .topbar-search {
        display: none;
    }
    
    .topbar-search input {
        width: 150px;
    }
    
    .page-content {
        padding: 16px;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
    }
    
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    
    .page-header-actions {
        flex-direction: column;
        width: 100%;
        margin-right: 0;
    }
    
    .btn-export,
    .btn-import {
        width: 100%;
        justify-content: center;
    }
}

/* ========== Dropdowns ========== */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background-color: #fff;
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    z-index: 1000;
    padding: 4px 0;
}

.dropdown.active .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: var(--text-primary);
    transition: background-color 0.15s;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
}

.dropdown-item:hover {
    background-color: var(--bg-light);
}

.dropdown-item:first-child {
    border-top-left-radius: 7px;
    border-top-right-radius: 7px;
}

.dropdown-item:last-child {
    border-bottom-left-radius: 7px;
    border-bottom-right-radius: 7px;
}

.dropdown-icon {
    width: 24px;
    height: 24px;
    margin-right: 12px;
    object-fit: contain;
}

.drop-text{
    width: 100%;
    height: 100%;
}

.show{
    display: block!important;
}

/* ========== Flash Messages ========== */
#flash-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    pointer-events: none;
}

.flash-message {
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    animation: slideIn 0.3s ease-out;
    pointer-events: auto;
    min-width: 300px;
}

.flash-message.flash-success {
    background: var(--success-light);
    color: #005a15;
    border-left: 4px solid var(--success-color);
}

.flash-message.flash-error {
    background: var(--danger-light);
    color: #8b0614;
    border-left: 4px solid var(--danger-color);
}

.flash-message.flash-warning {
    background: var(--warning-light);
    color: #7a5900;
    border-left: 4px solid var(--warning-color);
}

.flash-message.flash-info {
    background: #dbeeff;
    color: #004e8c;
    border-left: 4px solid var(--primary-color);
}

.flash-message .flash-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.flash-message .flash-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flash-message .flash-close:hover {
    opacity: 1;
}

.flash-message.flash-hiding {
    animation: slideOut 0.3s ease-in forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

@media (max-width: 768px) {
    #flash-container {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .flash-message {
        min-width: auto;
    }
}

/* ========== Products Page ========== */
.products-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.filter-toolbar {
    display: flex;
    align-items: flex-end;
    gap: 0;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.filter-toolbar__divider {
    width: 1px;
    height: 40px;
    background: var(--border-color);
    margin: 0 20px;
    flex-shrink: 0;
    align-self: flex-end;
    margin-bottom: 1px;
}

.filter-toolbar__actions {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-shrink: 0;
    padding-bottom: 1px;
}

.filters-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
    flex: 1;
}

.filter-item {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
}

.filter-item label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.filter-item input,
.filter-item select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.filter-item input:focus,
.filter-item select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.filter-actions {
    flex: 0 0 auto;
    min-width: 200px;
}

.filter-actions-buttons {
    display: flex;
    gap: 8px;
    width: 100%;
}

.btn-filter {
    width: 36px;
    height: 36px;
    padding: 0;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-filter:hover {
    background: var(--primary-hover);
}

.btn-clear {
    width: 36px;
    height: 36px;
    padding: 0;
    background: #fff;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-clear:hover {
    background: var(--bg-light);
    border-color: var(--text-secondary);
}

.btn-export {
    width: 36px;
    height: 36px;
    padding: 0;
    background: #fff;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-export:hover {
    background: var(--primary-light);
}

.btn-import {
    width: 36px;
    height: 36px;
    padding: 0;
    background: #fff;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-import:hover {
    background: var(--primary-light);
}

.btn-filter--small {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-clear--ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-secondary);
}

.btn-clear--ghost:hover {
    background: var(--bg-light);
    border-color: var(--border-color);
}

.products-table-container {
    overflow-x: auto;
    margin-bottom: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: #fff;
}

.products-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
    background: #fff;
}

.products-table thead {
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
}

.products-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.products-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-primary);
}

.products-table tbody tr:hover {
    background: #f8fafc;
}

.products-table tbody tr:last-child td {
    border-bottom: none;
}

.products-column-heading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.products-column-heading__logo {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.products-table__meta-cell {
    padding: 0 !important;
    vertical-align: middle;
}

.connection-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #f1f5f9;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.connection-badge img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.inv-sync {
    display: block;
    font-size: 11px;
    font-weight: 500;
    margin-top: 4px;
    padding-left: 2px;
}
.inv-sync--ok     { color: #059669; }
.inv-sync--warn   { color: #d97706; }
.inv-sync--stale  { color: #dc2626; }
.inv-sync--never  { color: #94a3b8; font-style: italic; }

.sku-text {
    font-family: 'Courier New', monospace;
    font-weight: 500;
    color: #2563eb;
}

.barcode-text {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #64748b;
}

.price-text {
    font-weight: 600;
    color: #10b981;
    white-space: nowrap;
}

.quantity-text {
    font-weight: 500;
}

.quantity-low {
    color: #f59e0b;
}

.quantity-out {
    color: #ef4444;
}

.products-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    gap: 16px;
}

.products-pagination--top {
    margin-bottom: 16px;
    padding-bottom: 14px;
}

.products-pagination .pagination-info {
    font-size: 13px;
    color: var(--text-secondary);
}

.pagination-chevrons {
    display: flex;
    gap: 6px;
    align-items: center;
}

.pagination-chevron {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.pagination-chevron__icon {
    width: 16px;
    height: 16px;
}

.pagination-chevron:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination-chevron:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.products-pagination .pagination-controls {
    display: flex;
    gap: 4px;
    align-items: center;
}

.products-pagination .pagination-btn {
    padding: 6px 12px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    min-width: 34px;
    text-align: center;
}

.products-pagination .pagination-btn:hover:not(:disabled) {
    background: var(--bg-light);
    color: var(--text-primary);
}

.products-pagination .pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.products-pagination .pagination-btn.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    font-weight: 600;
}

.products-pagination .page-numbers {
    display: flex;
    gap: 2px;
}

@media (max-width: 768px) {
    .filter-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .filter-toolbar__divider {
        width: 100%;
        height: 1px;
        margin: 4px 0;
    }

    .filter-toolbar__actions {
        align-items: center;
        justify-content: flex-end;
    }

    .filters-row {
        gap: 10px;
    }

    .filter-item {
        min-width: 100%;
        max-width: 100% !important;
    }

    .filter-actions {
        min-width: unset;
        flex-direction: row;
        align-items: center;
    }

    .filter-actions label {
        display: none;
    }

    .filter-actions-buttons {
        flex-direction: row;
    }

    .products-pagination {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        padding: 16px 8px;
    }

    .products-pagination .pagination-info {
        text-align: center;
        order: 1;
        font-size: 13px;
    }

    .pagination-chevrons {
        order: 2;
        justify-content: center;
    }

    .products-pagination .pagination-controls {
        width: 100%;
        justify-content: space-between;
        order: 2;
        flex-wrap: wrap;
        gap: 8px;
    }

    .products-pagination .pagination-btn {
        padding: 10px 14px;
        font-size: 13px;
        min-height: 44px;
        min-width: 44px;
    }

    .products-pagination .page-numbers {
        flex: 1;
        justify-content: center;
        flex-wrap: wrap;
        gap: 6px;
        order: 2;
    }

    /* Hide ellipsis on mobile for cleaner look */
    .products-pagination .page-numbers span {
        display: none;
    }

    /* Make Previous/Next buttons more prominent */
    .products-pagination .pagination-btn:first-child,
    .products-pagination .pagination-btn:last-child {
        flex-shrink: 0;
    }

    /* Top pagination responsive styles */
    .products-pagination--top {
        flex-direction: row;
        justify-content: space-between;
        padding: 12px 8px;
    }

    .products-pagination--top .pagination-info {
        font-size: 12px;
        gap: 4px;
    }

    .pagination-chevron {
        width: 44px;
        height: 44px;
    }

    .pagination-chevron__icon {
        width: 20px;
        height: 20px;
    }
}

.product-meta {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    position: relative;
}

.product-meta__cell-button {
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 12px 8px;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100%;
    font-family: inherit;
}

.product-meta__cell-button:hover {
    background: rgba(0, 0, 0, 0.03);
}

.product-meta__cell-button--pairs {
    align-items: stretch;
}

/* HTMX loading indicator for cell buttons */
.product-meta__cell-button.htmx-request .sync-badge {
    opacity: 0.4;
}

.product-meta__cell-button.htmx-request::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid #e2e8f0;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: meta-spin 0.6s linear infinite;
}

.product-meta__icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.product-meta__icon--check {
    color: #10b981;
}

.product-meta__icon--cross {
    color: #ef4444;
}

.product-meta__pairs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.product-meta__pair {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.product-meta__label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.product-meta__form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    animation: meta-expand 0.15s ease-out;
}

@keyframes meta-expand {
    from {
        opacity: 0;
        transform: scale(0.97);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

.product-meta__field-group {
    position: relative;
}

.product-meta__input {
    width: 100%;
    padding: 8px 10px;
    padding-left: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
    color: var(--text-primary);
    transition: border-color 0.15s, box-shadow 0.15s;
    min-width: 160px;
}

.product-meta__input::placeholder {
    color: #94a3b8;
    font-size: 11px;
}

.product-meta__input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.product-meta__input--has-label {
    padding-left: 50px;
}

.product-meta__input-label {
    position: absolute;
    left: 1px;
    top: 1px;
    bottom: 1px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #f1f5f9;
    border-right: 1px solid #e2e8f0;
    border-radius: 5px 0 0 5px;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
}

.productMetaActions {
    display: flex;
    gap: 6px;
    margin-top: 2px;
}

.productMetaActions .meta-btn {
    flex: 1;
    padding: 7px 12px;
    border: none;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    position: relative;
}

.productMetaActions .meta-btn svg {
    width: 12px;
    height: 12px;
}

/* Submit spinner — shown during htmx-request */
.product-meta__form.htmx-request .meta-btn--save {
    pointer-events: none;
    opacity: 0.7;
}

.product-meta__form.htmx-request .meta-btn--save svg {
    display: none;
}

.product-meta__form.htmx-request .meta-btn--save::before {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: meta-spin 0.6s linear infinite;
    flex-shrink: 0;
}

.product-meta__form.htmx-request .meta-btn--cancel {
    pointer-events: none;
    opacity: 0.5;
}

.productMetaActions .meta-btn--save {
    background: var(--primary-color);
    color: #fff;
}

.productMetaActions .meta-btn--save:hover {
    opacity: 0.9;
}

.productMetaActions .meta-btn--cancel {
    background: #e2e8f0;
    color: #475569;
}

.productMetaActions .meta-btn--cancel:hover {
    background: #cbd5e1;
}

.product-meta__error {
    margin: 0;
    font-size: 11px;
    color: var(--danger-color);
    padding-left: 2px;
}

/* ========== Sync Badges ========== */
.sync-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.sync-badge svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}
.sync-badge--excluded {
    background: #f1f5f9;
    color: #64748b;
}
.sync-badge--failed {
    background: #fee2e2;
    color: #dc2626;
}
.sync-badge--captured {
    background: #fef3c7;
    color: #d97706;
}
.sync-badge--synced {
    background: #d1fae5;
    color: #059669;
}

/* ========== Info Popover ========== */
.products-table__info-cell {
    padding: 0 8px !important;
    text-align: center;
    vertical-align: middle;
}
.info-wrap {
    position: relative;
    display: flex;
    justify-content: center;
}
.info-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    color: #f97316;
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: center;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    transition: color 0.15s, background 0.15s;
}
.info-btn:hover {
    color: #ea580c;
    background: #fff7ed;
}
.info-btn svg {
    width: 16px;
    height: 16px;
}
.info-popover {
    display: none;
    position: fixed;
    z-index: 200;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    min-width: 240px;
    max-width: 320px;
    padding: 14px 16px;
    font-size: 13px;
}
.info-popover.active {
    display: block;
}
.info-popover__title {
    font-weight: 700;
    font-size: 11px;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.info-popover__title img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}
.info-popover__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}
.info-popover__label {
    font-weight: 600;
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}
.info-popover__value {
    font-size: 12px;
    color: #374151;
    text-align: right;
    font-family: monospace;
}
.info-popover__reason {
    font-size: 12px;
    color: #64748b;
    margin: 4px 0 6px;
}
.info-popover__reason--failed {
    color: #dc2626;
}
.info-popover__reason--synced {
    color: #059669;
}
.info-popover__divider {
    border: none;
    border-top: 1px solid #f1f5f9;
    margin: 10px 0;
}

/* ========== Profile Page ========== */
.profile-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.profile-account-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 768px) {
    .profile-sections {
        grid-template-columns: 1fr;
    }

    .profile-account-info {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* ========== Stat Cards ========== */
.stat-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.2s, border-color 0.2s;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    box-shadow: var(--card-shadow-hover);
    border-color: #cbd5e1;
}

.stat-card__label {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: none;
    letter-spacing: 0;
}

.stat-card__row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.stat-card__value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.04em;
    line-height: 1.1;
}

.stat-card__icon-box {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card__icon-box--blue {
    background-color: #dbeeff;
    color: var(--primary-color);
}

.stat-card__icon-box--green {
    background-color: var(--success-light);
    color: var(--success-color);
}

.stat-card__icon-box--amber {
    background-color: var(--warning-light);
    color: var(--warning-color);
}

.stat-card__icon-box--red {
    background-color: var(--danger-light);
    color: var(--danger-color);
}

.stat-card__icon-box svg {
    width: 22px;
    height: 22px;
}

.stat-card__delta {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 2px;
}

.stat-card__delta--up {
    color: var(--success-color);
}

.stat-card__delta--down {
    color: var(--danger-color);
}

.stat-card__delta--muted {
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-card__delta-icon {
    width: 12px;
    height: 12px;
}

/* ========== Status Badges ========== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.badge--healthy,
.badge--success,
.badge--active {
    background-color: var(--success-light);
    color: #005a15;
}

.badge--warning,
.badge--pending {
    background-color: var(--warning-light);
    color: #7a5900;
}

.badge--critical,
.badge--danger,
.badge--error {
    background-color: var(--danger-light);
    color: #8b0614;
}

.badge--info {
    background-color: #dbeeff;
    color: #004e8c;
}

.badge--neutral,
.badge--inactive {
    background-color: var(--bg-light);
    color: var(--text-secondary);
}

.badge__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
    flex-shrink: 0;
}

/* ========== AI Insight / Info Banners ========== */
.insight-banner {
    background: linear-gradient(135deg, #dbeeff 0%, #e8f4ff 100%);
    border: 1px solid #9ac5ed;
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}

.insight-banner__icon {
    width: 40px;
    height: 40px;
    background: #b8d9f5;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--primary-color);
}

.insight-banner__icon svg {
    width: 22px;
    height: 22px;
}

.insight-banner__body {
    flex: 1;
    min-width: 0;
}

.insight-banner__title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}

.insight-banner__text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 8px;
}

.insight-banner__highlight {
    color: var(--primary-color);
    font-weight: 700;
}

.insight-banner__link {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
}

.insight-banner__link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* ========== Notification Badge ========== */
.notif-btn {
    position: relative;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.15s ease;
}

.notif-btn:hover {
    background-color: var(--bg-light);
    color: var(--text-primary);
}

.notif-btn svg {
    width: 18px;
    height: 18px;
}

.notif-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 17px;
    height: 17px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    border: 2px solid #fff;
}

/* ========== Marketplace Health Cards ========== */
.health-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.health-card {
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 20px 22px;
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.2s, border-color 0.2s;
}

.health-card:hover {
    box-shadow: var(--card-shadow-hover);
    border-color: #cbd5e1;
}

.health-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.health-card__logo {
    height: 22px;
    object-fit: contain;
}

.health-card__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: 13.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--bg-light);
}

.health-card__row:last-child {
    border-bottom: none;
}

.health-card__val {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13.5px;
}

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

/* ========== Section Headers ========== */
.section-heading {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
    letter-spacing: -0.02em;
}

/* ========== Topbar action button (Sync All style) ========== */
.btn-topbar {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s ease;
    letter-spacing: -0.01em;
}

.btn-topbar:hover {
    background-color: var(--bg-light);
    border-color: #b8bec7;
}

.btn-topbar svg {
    width: 16px;
    height: 16px;
    color: var(--secondary-color);
}

/* ========== Page subtitle ========== */
.page-subtitle {
    font-size: 13.5px;
    color: var(--text-secondary);
    margin-top: 2px;
    letter-spacing: -0.01em;
}

/* ========== Scrollbar ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ========== Brand Marketplace Colors ========== */
.brand-color--amazon  { color: var(--brand-amazon); }
.brand-color--takealot { color: var(--brand-takealot); }
.brand-color--makro   { color: var(--brand-makro); }
.brand-color--leroy   { color: var(--brand-leroy); }

.brand-bg--amazon  { background-color: var(--brand-amazon); }
.brand-bg--takealot { background-color: var(--brand-takealot); }
.brand-bg--makro   { background-color: var(--brand-makro); }
.brand-bg--leroy   { background-color: var(--brand-leroy); }

.badge--amazon  { background-color: #fdf0dc; color: var(--brand-amazon); }
.badge--takealot { background-color: #dbeaff; color: var(--brand-takealot); }
.badge--makro   { background-color: #fde8ea; color: var(--brand-makro); }
.badge--leroy   { background-color: #ddf3e4; color: var(--brand-leroy); }

/* ========== Chart Color Utilities ========== */
.chart-color-1 { color: var(--chart-1); }
.chart-color-2 { color: var(--chart-2); }
.chart-color-3 { color: var(--chart-3); }
.chart-color-4 { color: var(--chart-4); }
.chart-color-5 { color: var(--chart-5); }

.chart-bg-1 { background-color: var(--chart-1); }
.chart-bg-2 { background-color: var(--chart-2); }
.chart-bg-3 { background-color: var(--chart-3); }
.chart-bg-4 { background-color: var(--chart-4); }
.chart-bg-5 { background-color: var(--chart-5); }

/* ========== Transition Theme Utility ========== */
.transition-theme {
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* ========== Alert Banners ========== */
.alert-banner {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.alert-banner svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-banner a {
    font-weight: 600;
    text-decoration: underline;
}

.alert-banner--danger {
    background: var(--danger-light);
    border-color: #f5b8bd;
    color: #7a0011;
}

.alert-banner--warning {
    background: var(--warning-light);
    border-color: #f5d87a;
    color: #7a4f00;
}

.alert-banner--info {
    background: var(--primary-light);
    border-color: #9fd0ff;
    color: #003d6e;
}

/* ========== Dashboard Sections ========== */
.dash-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

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

.dash-col {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.dash-section {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}

.dash-section > div[hx-get] {
    flex: 1;
    display: flex;
    flex-direction: column;
}



.dash-section__title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dash-section__badge {
    font-size: 11px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    padding: 2px 8px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--text-secondary);
}

/* ========== Skeleton Loader ========== */
.skeleton-card {
    pointer-events: none;
}

.skeleton-line {
    display: block;
    background: linear-gradient(90deg, var(--bg-light) 25%, #eaecf0 50%, var(--bg-light) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s infinite;
    border-radius: 4px;
}

@keyframes skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ========== Help Icon Button ========== */
.btn-help {
    background: none;
    border: none;
    padding: 0 0 0 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    opacity: 0.5;
    vertical-align: middle;
    transition: opacity 0.15s;
}

.btn-help:hover {
    opacity: 1;
}

/* ========== Marketplace Cards ========== */
.mp-breakdown {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mp-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mp-card:hover {
    box-shadow: var(--card-shadow-hover);
    border-color: #cbd5e1;
}

.mp-card__header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mp-card__logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.mp-card__title {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.mp-card__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.mp-card__connections {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.2;
}

.mp-card__stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.mp-card__stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.mp-card__stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.mp-card__stat-value--green {
    color: var(--success-color);
}

.mp-card__stat-value--red {
    color: var(--danger-color);
}

.mp-card__stat-value--muted {
    color: var(--text-secondary);
}

.mp-card__stat-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.mp-card__bar {
    display: flex;
    height: 4px;
    border-radius: 2px;
    background: #f1f5f9;
    overflow: hidden;
}

.mp-card__bar-fill {
    height: 100%;
    transition: width 0.4s ease;
    min-width: 0;
}

.mp-card__bar-fill--green {
    background: var(--success-color);
}

.mp-card__bar-fill--amber {
    background: #f59e0b;
}

.mp-card__bar-fill--red {
    background: var(--danger-color);
}

/* ========== Marketplace Cards Skeleton ========== */
.mp-breakdown--skeleton {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.mp-card-skeleton {
    height: 108px;
    border-radius: var(--radius-lg);
    background: linear-gradient(90deg, var(--bg-light) 25%, #eaecf0 50%, var(--bg-light) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s infinite;
    margin-bottom: 0;
    width: 100%;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

/* ========== Dashboard Logs Skeleton ========== */
.dash-logs--skeleton {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    min-height: 220px;
    display: flex;
    flex-direction: column;
}
.dash-logs--skeleton .dash-logs__list {
    padding: 0;
    margin: 0;
    max-height: 420px;
    overflow-y: hidden;
}
.dash-log-skeleton {
    height: 52px;
    margin: 0;
    border-radius: 0;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(90deg, var(--bg-light) 25%, #eaecf0 50%, var(--bg-light) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s infinite;
}
.dash-log-skeleton:last-child {
    border-bottom: none;
}

/* ========== Dashboard Logs ========== */
.dash-logs {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dash-logs__list {
    max-height: 420px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.dash-logs__list::-webkit-scrollbar {
    width: 5px;
}

.dash-logs__list::-webkit-scrollbar-track {
    background: transparent;
}

.dash-logs__list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.dash-log {
    display: flex;
    align-items: flex-start;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.15s;
}

.dash-log:last-child {
    border-bottom: none;
}

.dash-log:hover {
    background: #f8fafc;
}

.dash-log__left {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.dash-log__level {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}

.dash-log__level svg {
    width: 16px;
    height: 16px;
}

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

.dash-log__level--warning {
    color: #f59e0b;
}

.dash-log__level--info {
    color: var(--primary-color);
}

.dash-log__level--debug {
    color: var(--text-secondary);
}

.dash-log__content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.dash-log__message {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.4;
    word-break: break-word;
}

.dash-log__meta {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.3;
}

.dash-log__ref {
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 10px;
    background: var(--bg-light);
    padding: 1px 5px;
    border-radius: 3px;
}

.dash-logs__view-all {
    display: block;
    text-align: center;
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-color);
    border-top: 1px solid var(--border-color);
    transition: background-color 0.15s;
}

.dash-logs__view-all:hover {
    background: var(--bg-light);
}

.dash-logs__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 13px;
}