* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

/* Login Screen */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    /* White background with a subtle gray overlay */
    background:
        linear-gradient(
            135deg,
            rgba(0, 0, 0, 0.04) 0%,
            rgba(0, 0, 0, 0.06) 50%,
            rgba(0, 0, 0, 0.04) 100%
        ),
        #ffffff;
    padding: 20px;
}

.login-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 24px;
    color: #333;
    margin-bottom: 8px;
}

.login-header p {
    color: #666;
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-form label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.login-form input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
    line-height: 1.4;
}

.login-form input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-block {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    font-weight: 500;
}

.login-form .btn-block {
    padding: 12px;
    font-size: 14px;
    line-height: 1.4;
    box-sizing: border-box;
    border-radius: 6px;
}

.login-form .error-message {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    border: 1px solid #fcc;
}

/* Dashboard Container */
.dashboard-container {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 80px);
    width: 100%;
}

/* Configuration Panel Wrapper - Collapsible */
.config-panel-wrapper {
    background: #ffffff;
    border-bottom: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

.config-panel-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
    position: relative;
}

.config-panel-toggle * {
    pointer-events: none; /* Allow all clicks to pass through to the toggle */
}

.config-panel-toggle:hover {
    background: #e9ecef;
}

.toggle-icon {
    font-size: 0.9em;
    color: #666;
    transition: transform 0.3s;
}

.config-panel-wrapper.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.toggle-text {
    font-weight: 600;
    color: #333;
    font-size: 0.95em;
}

.config-quick-status {
    display: flex;
    gap: 12px;
    margin-left: auto;
    flex-wrap: wrap;
    pointer-events: none; /* Allow clicks to pass through to parent toggle */
}

/* Shared pill-style status badges (header + config + quick statuses) */
.quick-status-badge,
.config-status,
.status-value {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 500;
}

.quick-status-badge.success {
    background: #e8f5e9;
    color: #2e7d32;
}

.quick-status-badge.error {
    background: #fce8e6;
    color: #c5221f;
}

.quick-status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

.config-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 20px;
    background: #ffffff;
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.config-panel-wrapper.collapsed .config-panel {
    max-height: 0;
    padding: 0 20px;
    overflow: hidden;
}

@media (max-width: 1200px) {
    .config-panel {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .config-quick-status {
        width: 100%;
        margin-left: 0;
        margin-top: 8px;
    }
}

.config-section {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px;
}

/* Reverse sync section spans full width of 2-column grid */
#reverseSyncSection {
    grid-column: 1 / -1;
}

#reverseSyncSection .config-content > p {
    margin-bottom: 8px !important;
}

#reverseSyncDetails {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    align-items: start;
}

#reverseSyncDetails > .form-group {
    margin-bottom: 0 !important;
}

#reverseSyncDetails > div:last-of-type {
    margin-bottom: 0;
}

@media (max-width: 1400px) {
    #reverseSyncDetails {
        grid-template-columns: 1fr 1fr !important;
    }
    #reverseSyncDetails > div:last-of-type {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1200px) {
    #reverseSyncSection {
        grid-column: 1;
    }
    #reverseSyncDetails {
        grid-template-columns: 1fr !important;
    }
}

.config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.config-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.config-header h2 {
    font-size: 0.95em;
    color: #333;
    margin: 0;
    font-weight: 600;
}

.config-status {
    background: #fce8e6;
    color: #c5221f;
}

.config-status.success {
    background: #e8f5e9;
    color: #2e7d32;
}

.config-status.error {
    background: #fce8e6;
    color: #c5221f;
}

.config-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-weight: 500;
    font-size: 0.8em;
    color: #555;
}

.form-group input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95em;
    transition: border-color 0.3s;
}

.form-group input:read-only {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.7;
}

.form-group input:read-only:focus {
    outline: none;
    border-color: #ddd;
    box-shadow: none;
}

.form-group input:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

/* Visual indicator for saved (masked) client secret */
.form-group input.secret-saved {
    background-color: #f0f8ff;
    border-color: #4caf50;
    border-left-width: 3px;
}

.form-group input.secret-saved::placeholder {
    color: #4caf50;
    font-style: italic;
}

/* Checkbox styling to match input height */
input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    cursor: pointer;
    accent-color: #1a73e8;
    flex-shrink: 0;
}

.form-actions label {
    font-size: 0.75em;
    color: #555;
    gap: 6px;
}

.form-group small {
    color: #666;
    font-size: 0.8em;
    margin-top: 2px;
}

.form-actions {
    display: flex;
    gap: 6px;
    margin-top: 2px;
    align-items: center;
    flex-wrap: wrap;
}

.form-group-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-right: 8px;
}

/* Section Cards */
.section-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.section-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid #e0e0e0;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h2 {
    font-size: 1.2em;
    color: #333;
    margin: 0;
    font-weight: 600;
}

/* Offers header search bar */
.offers-search-wrapper {
    flex: 0 0 260px;
    max-width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
}

.offers-search-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    font-size: 0.95em;
    background-color: #ffffff;
    color: #333;
    transition: all 0.2s;
}

.offers-search-input::placeholder {
    color: #999;
}

.offers-search-input:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.1);
    background-color: #ffffff;
}

#statusFilter {
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    font-size: 0.95em;
    color: #333;
    background: #ffffff;
    transition: all 0.2s;
    min-width: 120px;
}

#statusFilter:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.1);
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-left: auto;
}

.checkbox-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary, #6b7280);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.checkbox-inline input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--primary, #3b82f6);
}


/* Credentials Overlay */
.credentials-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.credentials-modal {
    background: #ffffff;
    border-radius: 12px;
    padding: 40px;
    max-width: 900px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* Configuration Tabs */
.config-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.config-tab {
    background: none;
    border: none;
    padding: 15px 25px;
    cursor: pointer;
    font-size: 1em;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.config-tab:hover {
    color: #1a73e8;
    background: #f8f9fa;
}

.config-tab.active {
    color: #1a73e8;
    border-bottom-color: #1a73e8;
    background: #f8f9fa;
}

.tab-icon {
    font-size: 1.2em;
}

.config-tab-content {
    display: none;
}

.config-tab-content.active {
    display: block;
}

.help-icon {
    font-size: 0.9em;
    cursor: help;
    margin-left: 5px;
    opacity: 0.6;
}

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

.credentials-modal h1 {
    text-align: center;
    color: #1a73e8;
    margin-bottom: 10px;
    font-size: 1.8em;
    font-weight: 500;
}

.subtitle {
    text-align: center;
    color: #666;
    font-size: 0.95em;
    margin-bottom: 30px;
}

.credentials-section h2 {
    display: block;
    font-size: 1.3em;
    color: #333;
    margin-bottom: 10px;
    font-weight: 600;
}

.credentials-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-size: 0.9em;
}

.message.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #2e7d32;
}

.message.error {
    background: #fce8e6;
    color: #c5221f;
    border: 1px solid #c5221f;
}

/* Main Application Layout */
.main-app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

/* Hide credentials overlay - not needed anymore */
.credentials-overlay {
    display: none !important;
}

/* Top Header */
.top-header {
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    padding: 8px 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.app-title h1 {
    font-size: 1.2em;
    color: #1a73e8;
    margin: 0;
    font-weight: 600;
    white-space: nowrap;
}

.app-title .subtitle {
    font-size: 0.8em;
    color: #666;
    margin: 2px 0 0 0;
    font-weight: 400;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 0.95em;
}

.status-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

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

.user-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #2e7d32;
    flex-shrink: 0;
}

.user-icon svg {
    width: 16px;
    height: 16px;
}

.status-label {
    font-weight: 500;
    color: #666;
    font-size: 0.9em;
}

.status-value {
    background: #e8f0fe;
    color: #1a73e8;
}

.status-value.success {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-value.error {
    background: #fce8e6;
    color: #c5221f;
}

.status-value.pending {
    background: #fff3cd;
    color: #856404;
}

.btn-small {
    padding: 6px 14px;
    font-size: 0.85em;
}

/* Export progress bar */
.export-progress {
    margin: 10px 0 0 0;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.export-progress-bar {
    position: relative;
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 999px;
    overflow: hidden;
}

.export-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #1a73e8, #34a853);
    transition: width 0.2s ease-out;
}

.export-progress-text {
    font-size: 12px;
    color: #555;
}

.export-progress-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

/* Dashboard Stats Bar */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    padding: 20px;
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.2s;
}

.stat-card:hover {
    border-color: #1a73e8;
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.1);
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 2em;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.8em;
    font-weight: 700;
    color: #1a73e8;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.85em;
    color: #666;
    margin-top: 4px;
    font-weight: 500;
}

/* Main Content Wrapper */
.main-content-wrapper {
    display: flex;
    flex: 1;
    width: 100%;
    padding: 20px;
    gap: 20px;
    overflow-y: auto;
    align-items: flex-start;
    background: #f5f5f5;
}

/* Left Sidebar - Categories */
.sidebar {
    width: 280px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    height: fit-content;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-header-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    text-align: center;
}

.sidebar-header h2 {
    font-size: 1.2em;
    color: #333;
    margin: 0;
    font-weight: 500;
    flex: 1;
}

.sidebar-header-sub {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.category-search-input,
.category-dropdown {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    font-size: 0.95em;
    background: #ffffff;
    color: #333;
    transition: all 0.2s;
}

.category-search-input:focus,
.category-dropdown:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.1);
}

.sidebar-actions {
    display: flex;
    gap: 8px;
}

.categories-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    max-height: 350px;
    padding-right: 5px;
}

.category-item {
    padding: 8px 12px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.category-item:hover {
    background: #f5f5f5;
    border-color: #1a73e8;
}

.category-item.selected {
    background: #1a73e8;
    color: #ffffff;
    border-color: #1a73e8;
}

.category-item-name {
    font-weight: 500;
    color: #333;
    font-size: 0.8em;
    flex: 1;
    min-width: 0;
}

.category-item.selected .category-item-name {
    color: #ffffff;
}

.category-item-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-item-count {
    display: inline-block;
    background: #e8f0fe;
    color: #1a73e8;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
    white-space: nowrap;
    opacity: 1;
    transition: all 0.2s ease;
}

.category-item.selected .category-item-count {
    background: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.category-item:hover .category-item-count {
    background: #1a73e8;
    color: #ffffff;
}

/* Category tree helpers */
.category-breadcrumb {
    font-size: 0.75em;
    color: #777;
    margin-bottom: 4px;
}

.category-back {
    font-size: 0.8em;
    color: #1a73e8;
    cursor: pointer;
    margin-bottom: 4px;
}

.category-back:hover {
    text-decoration: underline;
}

.category-chevron {
    font-size: 0.9em;
    color: #bbb;
}

.categories-list:empty::before {
    content: 'No categories loaded. Click "Reload" to fetch categories.';
    display: block;
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 0.9em;
}

/* Right Content Area */
.content-area {
    flex: 1;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    gap: 4px;
    padding: 12px 20px 0 20px;
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
    overflow-x: auto;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #666;
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    position: relative;
}

.tab-btn:hover {
    color: #1a73e8;
    background: rgba(26, 115, 232, 0.05);
}

.tab-btn.active {
    color: #1a73e8;
    border-bottom-color: #1a73e8;
    background: rgba(26, 115, 232, 0.05);
}


.tab-icon {
    font-size: 1.1em;
}

.tab-badge {
    background: #e8f0fe;
    color: #1a73e8;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.tab-btn.active .tab-badge {
    background: #e8f0fe;
    color: #1a73e8;
}

/* Tab Content */
.tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.tab-content.active {
    display: block;
}

.section-description {
    color: #666;
    font-size: 0.9em;
    margin: 8px 0 0 0;
    font-weight: 400;
}

/* CSV Export Grid */
.csv-export-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.csv-export-card {
    padding: 24px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    text-align: center;
    transition: all 0.2s;
}

.csv-export-card:hover {
    border-color: #1a73e8;
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.1);
    transform: translateY(-2px);
}

.csv-icon {
    font-size: 3em;
    margin-bottom: 12px;
}

.csv-export-card h3 {
    font-size: 1.1em;
    color: #333;
    margin: 0 0 8px 0;
    font-weight: 600;
}

.csv-export-card p {
    font-size: 0.85em;
    color: #666;
    margin: 0 0 16px 0;
    line-height: 1.5;
}

.csv-export-card .btn {
    width: 100%;
}

.info-text {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 20px;
}

.search-section {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
}

.search-section h2 {
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 1.3em;
}

.section-hint {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 20px;
}

.auth-required-message {
    background: #fff3cd;
    color: #856404;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 0.9em;
    text-align: center;
    border: 1px solid #ffc107;
}

.search-form {
    display: grid;
    grid-template-columns: 3fr 2fr auto;
    gap: 15px;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 500;
    color: #333;
    font-size: 0.9em;
}

.form-group input,
.form-group select {
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.95em;
    color: #333;
    background: #ffffff;
    transition: all 0.2s;
    width: 100%;
    min-width: 200px;
}

.search-form .form-group select {
    min-width: 250px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.1);
}

.form-group input::placeholder {
    color: #999;
}

/* Buttons */
.btn {
    padding: 6px 14px;
    border: 1px solid #1a73e8;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(26, 115, 232, 0.2);
}

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

.btn-primary {
    background: #1a73e8;
    color: #ffffff;
    border-color: #1a73e8;
}

.btn-primary:hover:not(:disabled) {
    background: #1557b0;
    border-color: #1557b0;
}

.btn-secondary {
    background: #ffffff;
    color: #1a73e8;
    border-color: #1a73e8;
}

.btn-secondary:hover:not(:disabled) {
    background: #1a73e8;
    color: #ffffff;
}

.btn-danger {
    background: #dc3545;
    color: #ffffff;
    border-color: #dc3545;
}

.btn-danger:hover:not(:disabled) {
    background: #c82333;
    border-color: #bd2130;
}

.btn-connected {
    background: #6c757d;
    color: #ffffff;
    border-color: #6c757d;
    cursor: not-allowed;
}

.btn-connected:hover {
    background: #6c757d;
    color: #ffffff;
    transform: none;
    box-shadow: none;
}

.btn-success {
    background: #1a73e8;
    color: #ffffff;
    border-color: #1a73e8;
}

.btn-success:hover:not(:disabled) {
    background: #1557b0;
    border-color: #1557b0;
}

/* Results Section */
.results-section {
    margin-bottom: 30px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.results-header h2 {
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    font-size: 1.3em;
}

.results-actions {
    display: flex;
    gap: 10px;
}

.count-badge {
    background: #1a73e8;
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.8em;
    font-weight: 500;
    display: inline-block;
}

.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1a73e8;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    background: #fce8e6;
    color: #c5221f;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #c5221f;
    border-radius: 8px;
    display: none;
    gap: 12px;
    align-items: flex-start;
    position: relative;
    animation: slideIn 0.3s ease-out;
}

.error-message[style*="display: flex"] {
    display: flex !important;
}

.error-message[style*="display: block"] {
    display: flex !important;
}

.error-message.hiding {
    animation: slideOut 0.3s ease-in forwards;
    margin-bottom: 0 !important;
}

.error-message[style*="display: none"] {
    margin-bottom: 0 !important;
}

.error-message-content {
    flex: 1;
    font-size: 0.9em;
    line-height: 1.6;
}

.error-message-content strong {
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

.error-message-close {
    background: transparent;
    border: none;
    color: #c5221f;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
    line-height: 1;
    opacity: 0.7;
}

.error-message-close:hover {
    background: rgba(197, 34, 31, 0.1);
    opacity: 1;
}

.error-message-close:active {
    transform: scale(0.9);
}

.info-message {
    background: #e8f0fe;
    color: #1a73e8;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #1a73e8;
    border-radius: 8px;
    display: none;
    gap: 12px;
    align-items: flex-start;
    position: relative;
    animation: slideIn 0.3s ease-out;
}

.info-message[style*="display: flex"] {
    display: flex !important;
}

.info-message.hiding {
    animation: slideOut 0.3s ease-in forwards;
    margin-bottom: 0 !important;
}

.info-message[style*="display: none"] {
    margin-bottom: 0 !important;
}

.info-message-icon {
    font-size: 20px;
    font-weight: bold;
    flex-shrink: 0;
    line-height: 1.4;
}

.info-message-content {
    flex: 1;
    font-size: 0.9em;
    line-height: 1.6;
}

.info-message-content strong {
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

.info-message-close {
    background: transparent;
    border: none;
    color: #1a73e8;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
    line-height: 1;
    opacity: 0.7;
}

.info-message-close:hover {
    background: rgba(26, 115, 232, 0.1);
    opacity: 1;
}

.info-message-close:active {
    transform: scale(0.9);
}

@keyframes slideIn {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-10px);
        opacity: 0;
    }
}

/* Products Grid - 6 columns */
.offers-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 30px;
}

@media (max-width: 1600px) {
    .offers-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 1400px) {
    .offers-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1024px) {
    .offers-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .offers-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .offer-card {
        flex-direction: column;
    }
    
    .offer-image-wrapper {
        width: 100%;
        height: 150px;
    }
}

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

.offer-card {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: white;
    transition: all 0.3s;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    overflow: visible;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    min-height: 100px;
    align-items: stretch;
}

/* Left column: status + image + quick stats */
.offer-left-column {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    width: 100px;
    min-width: 100px;
    padding: 4px 4px 6px 4px;
    gap: 4px;
    border-right: 1px solid #f0f0f0;
}

.offer-card:hover {
    border-color: #1a73e8;
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.2);
    transform: translateY(-2px);
}

.offer-card.selected {
    border: 3px solid #1a73e8;
    background: #e8f0fe;
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
    transform: translateY(-2px);
}

/* Image Section - Left Side */
.offer-image-wrapper {
    width: 90px;
    min-width: 90px;
    height: 90px;
    max-height: 90px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    align-self: center;
}

.offer-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: opacity 0.4s ease-in-out;
}

.offer-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.9em;
    background: #f5f5f5;
}

/* Image count badge - shows number of images available from Allegro */
.offer-image-count-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: #e8f0fe;
    color: #1a73e8;
    border-radius: 12px;
    padding: 2px 8px;
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 0.75em;
    font-weight: 600;
    z-index: 10;
}

.offer-image-count-icon {
    font-size: 0.8em;
    line-height: 1;
}

.offer-image-count-number {
    line-height: 1;
}

/* Clickable image cursor */
.offer-image-clickable {
    cursor: pointer;
}

.offer-image-clickable:hover {
    opacity: 0.9;
}

/* Image navigation buttons */
.offer-image-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(26, 115, 232, 0.85);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
    z-index: 15;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px);
}

.offer-image-wrapper:hover .offer-image-nav-btn,
.imported-item-image:hover .offer-image-nav-btn {
    opacity: 1;
}

.offer-image-nav-btn:hover {
    background: rgba(26, 115, 232, 1);
    transform: translateY(-50%) scale(1.1);
}

.offer-image-nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.offer-image-nav-prev {
    left: 4px;
}

.offer-image-nav-next {
    right: 4px;
}

/* Content Section - Right Side */
.offer-content {
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    justify-content: flex-start;
    gap: 3px;
}

.offer-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 8px;
}

.offer-title {
    font-size: 0.7em;
    font-weight: 400;
    color: #333;
    flex: 1;
    line-height: 1.2;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.offer-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #1a73e8;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Badges Section */
.offer-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
    align-items: center;
}

.offer-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-smart {
    background: #ff9800;
    color: #ffffff;
    font-size: 0.65em;
    padding: 2px 6px;
}

.badge-super-price {
    background: #34a853;
    color: #ffffff;
}

.badge-lowest-price {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #34a853;
    font-size: 0.75em;
    font-weight: 500;
}

.badge-lowest-price::before {
    content: "✓";
    font-weight: bold;
}

/* Price Section */
.offer-pricing {
    margin-bottom: 6px;
}

.price-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 3px;
    flex-wrap: wrap;
}

.discount-badge {
    background: #ea4335;
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7em;
    font-weight: 600;
}

.original-price {
    font-size: 0.75em;
    color: #999;
    text-decoration: line-through;
}

.current-price {
    font-size: 1.05em;
    font-weight: 700;
    color: #1a73e8; /* highlight price for quick scanning */
}

.price-currency {
    font-size: 0.85em;
    font-weight: 600;
    color: #1a73e8;
    opacity: 0.85;
}

.price-info {
    font-size: 0.7em;
    color: #666;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.price-info-icon {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #e0e0e0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6em;
    font-weight: bold;
    color: #666;
    cursor: help;
    flex-shrink: 0;
}

/* Payment & Delivery Section */
.offer-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #f0f0f0;
}

.payment-info {
    font-size: 0.7em;
    color: #333;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 4px;
}

.pay-badge {
    background: #1a73e8;
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.65em;
    font-weight: 600;
    text-transform: uppercase;
}

.delivery-info {
    font-size: 0.7em;
    color: #333;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 4px;
}

.delivery-info-icon {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #e0e0e0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6em;
    font-weight: bold;
    color: #666;
    flex-shrink: 0;
}

.no-data-text {
    font-size: 0.7em;
    color: #999;
    font-style: italic;
}

/* Stock / Watchers / Visits metrics */
.offer-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
    font-size: 0.7em;
}

.offer-metrics-overlay {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    justify-content: flex-start;
    padding: 0;
    background: none;
}

/* Metrics under image in left column */
.offer-metrics-left {
    flex-direction: column;
    align-items: stretch;
}

.offer-metrics-left .metric {
    width: 100%;
    justify-content: flex-start;
}

/* Metrics at bottom of whole product card */
.offer-metrics-bottom {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #f0f0f0;
}

/* Status badge on top of image (ACTIVE / ENDED / INACTIVE) */
.offer-status-badge {
    position: static;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 0.65em;
    font-weight: 600;
    letter-spacing: 0.4px;
    background: #f1f3f4;
    color: #555;
}

.offer-status-active {
    background: #e8f5e9;
    color: #2e7d32;
}

.offer-status-ended,
.offer-status-inactive {
    background: #eeeeee;
    color: #757575;
}

.metric {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 999px;
    background: #f1f3f4;
}

.metric-icon {
    font-size: 0.85em;
}

.metric-label {
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 600;
    color: #555;
}

.metric-value {
    font-weight: 700;
    color: #222;
}

.metric-sub {
    color: #777;
}

.metric-stock {
    background: #e8f5e9;
    color: #2e7d32;
}

.metric-stock .metric-label,
.metric-stock .metric-value {
    color: #2e7d32;
}

.metric-watchers {
    background: #f3e8fd;
    color: #6a1b9a;
}

.metric-watchers .metric-label,
.metric-watchers .metric-value {
    color: #6a1b9a;
}

.metric-visits {
    background: #e0f7fa;
    color: #006064;
}

.metric-visits .metric-label,
.metric-visits .metric-value {
    color: #006064;
}

/* Info Section */
.offer-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: auto;
    padding-top: 6px;
    border-top: 1px solid #f0f0f0;
}

.offer-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}

.info-label {
    font-size: 0.65em;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.info-value {
    font-size: 0.65em;
    color: #333;
    font-weight: 500;
    text-align: right;
    word-break: break-all;
}

.product-id,
.category-id {
    font-family: 'Courier New', monospace;
    font-size: 0.6em;
    color: #1a73e8;
}

.price-note {
    color: #666;
    font-style: italic;
    font-size: 0.7em;
}

/* Description Section */
.offer-description {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

.offer-description-full-width {
    width: 100%;
    flex-basis: 100%;
    padding: 8px;
    margin-top: 8px;
    border-top: 1px solid #f0f0f0;
    order: 999;
}

.offer-description-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    gap: 8px;
}

.offer-description-header strong {
    font-size: 0.7em;
    color: #333;
    font-weight: 600;
}

.description-toggle-btn {
    background: #e8f0fe;
    color: #1a73e8;
    border: none;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.75em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
}

.description-toggle-btn:hover {
    background: #1a73e8;
    color: #ffffff;
}

.description-toggle-btn:active {
    transform: scale(0.95);
}

.description-toggle-btn .toggle-icon {
    font-size: 0.9em;
    display: inline-block;
    transition: transform 0.2s ease;
    line-height: 1;
}

.offer-description-preview {
    font-size: 0.7em;
    color: #555;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.offer-description-preview.offer-description-html {
    white-space: normal;
}

.offer-description-preview.offer-description-html img {
    max-width: 100%;
    height: auto;
    margin: 4px 0;
}

.offer-description-preview.offer-description-html p {
    margin: 4px 0;
}

.offer-description-preview.offer-description-html ul,
.offer-description-preview.offer-description-html ol {
    margin: 4px 0;
    padding-left: 20px;
}

.offer-description-preview.offer-description-html li {
    margin: 2px 0;
}

.offer-description-full {
    font-size: 0.7em;
    color: #555;
    line-height: 1.5;
    white-space: normal;
    word-wrap: break-word;
    margin-top: 6px;
}

.offer-description-full img {
    max-width: 100%;
    height: auto;
    margin: 4px 0;
}

.offer-description-full p {
    margin: 4px 0;
}

.offer-description-full ul,
.offer-description-full ol {
    margin: 4px 0;
    padding-left: 20px;
}

.offer-description-full li {
    margin: 2px 0;
}

.offer-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.pagination > div {
    display: flex;
    align-items: center;
    gap: 20px;
}

.total-count-info {
    font-size: 0.9em;
    color: #666;
    font-weight: 500;
    margin-left: auto;
}

/* Imported Section */
.imported-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
}

.imported-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.imported-section h2 {
    color: #333;
    font-weight: 500;
    font-size: 1.3em;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.imported-section-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.imported-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.imported-item {
    background: #ffffff;
    padding: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    position: relative;
    transition: all 0.2s;
}

.imported-item:hover {
    border-color: #1a73e8;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.imported-item-image {
    width: 50px;
    min-width: 50px;
    height: 50px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    flex-shrink: 0;
    position: relative;
}

.imported-item-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: opacity 0.4s ease-in-out;
}

.imported-item-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.65em;
    background: #f5f5f5;
    text-align: center;
    padding: 2px;
}

.imported-item-content {
    flex: 1;
    min-width: 0;
}

.imported-item-title {
    font-weight: 500;
    color: #333;
    font-size: 0.75em;
    margin-bottom: 3px;
    word-wrap: break-word;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.imported-item-id {
    color: #666;
    font-size: 0.65em;
    word-break: break-all;
    font-family: 'Courier New', monospace;
}

.imported-item-remove {
    background: transparent;
    border: none;
    color: #c5221f;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    flex-shrink: 0;
    line-height: 1;
}

.imported-item-remove:hover {
    background: #fce8e6;
    color: #a50e0e;
    transform: scale(1.1);
}

.imported-item-remove:active {
    transform: scale(0.95);
}

.imported-item-remove span {
    display: block;
    line-height: 1;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.toast {
    background: #ffffff;
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
    border-left: 4px solid;
    min-width: 300px;
}

.toast.success {
    border-left-color: #34a853;
}

.toast.error {
    border-left-color: #ea4335;
}

.toast.info {
    border-left-color: #1a73e8;
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    color: #34a853;
}

.toast.error .toast-icon {
    color: #ea4335;
}

.toast.info .toast-icon {
    color: #1a73e8;
}

.toast-message {
    flex: 1;
    color: #333;
    font-size: 14px;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.toast-close:hover {
    opacity: 1;
}

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

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

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

/* Sync Stock Log Styles */
.sync-log-info {
    margin-bottom: 20px;
}

.sync-log-info-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

.sync-log-info-content {
    flex: 1;
    min-width: 0;
}

.sync-header-container {
    overflow: hidden;
    width: 100%;
}

.sync-header-left {
    float: left;
}

.sync-header-right {
    float: right;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.sync-status {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    font-size: 0.9em;
}

.sync-status-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.sync-status-row .info-icon-wrapper {
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
}

.sync-status-row .info-icon {
    display: inline-flex;
    align-items: center;
    color: #666;
    transition: color 0.2s ease;
}

.sync-status-row .info-icon:hover {
    color: #1a73e8;
}

.sync-status-row .info-icon svg {
    width: 14px;
    height: 14px;
}

.sync-status-label {
    font-weight: 600;
    color: #666;
    min-width: 80px;
}

.sync-status-value {
    color: #1a73e8;
    font-weight: 500;
}

.sync-time-elapsed,
.sync-time-countdown {
    font-size: 0.85em;
    font-weight: 400;
    margin-left: 4px;
}

.sync-log-container {
    margin-top: 20px;
}

.sync-log-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 5px;
}

.sync-log-entry {
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s;
}

.sync-log-entry:hover {
    border-color: #1a73e8;
    box-shadow: 0 2px 4px rgba(26, 115, 232, 0.1);
}

.sync-log-entry.success {
    border-left: 4px solid #34a853;
}

.sync-log-entry.error {
    border-left: 4px solid #ea4335;
}

.sync-log-entry.warning {
    border-left: 4px solid #ff9800;
}

.sync-log-entry.info {
    border-left: 4px solid #1a73e8;
}

.sync-log-entry.checking {
    border-left: 4px solid #1a73e8;
    animation: pulse-border 1.5s ease-in-out infinite;
}

.sync-log-entry.unchanged {
    border-left: 4px solid #9e9e9e;
}

@keyframes pulse-border {
    0%, 100% {
        border-left-color: #1a73e8;
    }
    50% {
        border-left-color: #4285f4;
    }
}

.sync-log-status.checking {
    background: #e8f0fe;
    color: #1a73e8;
}

.sync-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.sync-log-timestamp {
    font-size: 0.85em;
    color: #666;
    font-family: 'Courier New', monospace;
}

.sync-log-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
}

.sync-log-status.success {
    background: #e8f5e9;
    color: #2e7d32;
}

.sync-log-status.error {
    background: #fce8e6;
    color: #c5221f;
}

.sync-log-status.warning {
    background: #fff3cd;
    color: #856404;
}

.sync-log-status.info {
    background: #e8f0fe;
    color: #1a73e8;
}

.sync-log-status.unchanged {
    background: #f5f5f5;
    color: #616161;
}

.sync-log-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.9em;
}

.sync-log-product {
    font-weight: 600;
    color: #333;
}

.sync-log-message {
    color: #666;
    line-height: 1.5;
}

.sync-log-stock-change {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85em;
    color: #666;
}

.sync-log-stock-change .stock-arrow {
    color: #1a73e8;
    font-weight: bold;
}

.sync-log-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 0.9em;
}

/* Sync Statistics Styles */
.sync-statistics-container {
    margin-top: 15px;
}

.sync-statistics-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sync-statistics-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: none;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s ease;
    overflow: hidden;
    position: relative;
}

.sync-statistics-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #1a73e8, #34a853, #ff9800);
}

.sync-statistics-card:hover {
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.12);
}

.sync-statistics-header {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e8f0fe;
}

.sync-statistics-time-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
}

.sync-statistics-time-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: #f8f9fa;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.sync-statistics-time-item:hover {
    background: #e8f0fe;
}

.sync-statistics-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.sync-statistics-icon svg {
    width: 14px;
    height: 14px;
}

.sync-statistics-icon.time-icon {
    background: linear-gradient(135deg, #e8f0fe 0%, #d2e3fc 100%);
    color: #1a73e8;
}

.sync-statistics-icon.duration-icon {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    color: #2e7d32;
}

.sync-statistics-icon.product-icon {
    background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
    color: #7b1fa2;
}

.sync-statistics-icon.stock-icon {
    background: linear-gradient(135deg, #e0f7fa 0%, #b2ebf2 100%);
    color: #006064;
}

.sync-statistics-icon.price-icon {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    color: #ea4335;
}

.sync-statistics-time-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.sync-statistics-time-label {
    font-size: 0.65em;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.sync-statistics-time-value {
    font-size: 0.8em;
    font-weight: 600;
    color: #1a73e8;
    font-family: 'Courier New', monospace;
}

.sync-statistics-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
}

.sync-statistics-metric-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #ffffff;
    border: none;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.sync-statistics-metric-item:hover {
    box-shadow: 0 1px 4px rgba(26, 115, 232, 0.1);
}

.sync-statistics-metric-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.sync-statistics-metric-label {
    font-size: 0.7em;
    font-weight: 500;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.sync-statistics-metric-value {
    font-size: 1.1em;
    font-weight: 700;
    color: #333;
    line-height: 1.2;
}

.sync-statistics-metric-item:nth-child(1) .sync-statistics-metric-value {
    color: #7b1fa2;
}

.sync-statistics-metric-item:nth-child(2) .sync-statistics-metric-value {
    color: #006064;
}

.sync-statistics-metric-item:nth-child(3) .sync-statistics-metric-value {
    color: #ea4335;
}

.price-rate-value {
    color: #ea4335 !important;
}

.sync-statistics-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 0.85em;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px dashed #e0e0e0;
}

/* Changed Products Styles */
.sync-statistics-changes {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e8f0fe;
}

.sync-statistics-changes-header {
    margin-bottom: 10px;
}

.sync-statistics-changes-header h4 {
    font-size: 0.9em;
    font-weight: 600;
    color: #333;
    margin: 0;
    padding: 0;
}

.sync-statistics-changes-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sync-statistics-change-item {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px;
    transition: all 0.2s ease;
}

.sync-statistics-change-item:hover {
    border-color: #1a73e8;
    box-shadow: 0 1px 4px rgba(26, 115, 232, 0.1);
}

.sync-statistics-change-product {
    margin-bottom: 8px;
}

.sync-statistics-change-product-name {
    font-size: 0.85em;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    word-wrap: break-word;
}

.sync-statistics-change-product-ids {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.75em;
}

.sync-statistics-change-id {
    color: #666;
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
}

.sync-statistics-change-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.8em;
}

.sync-statistics-change-detail {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sync-statistics-change-label {
    font-weight: 500;
    color: #666;
    min-width: 50px;
}

.sync-statistics-change-value {
    color: #1a73e8;
    font-weight: 600;
}

@media (max-width: 768px) {
    .sync-statistics-time-section {
        grid-template-columns: 1fr;
    }
    
    .sync-statistics-metrics {
        grid-template-columns: 1fr;
    }
    
    .sync-statistics-card {
        padding: 10px;
    }
}

/* Product Checking List Styles */
.product-checking-list {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.checking-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e0e0e0;
}

.checking-list-header h3 {
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.checking-progress {
    font-size: 0.9em;
    color: #666;
    font-weight: 500;
}

.product-checking-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

.product-checking-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.2s;
}

.product-checking-item:hover {
    background: #f0f0f0;
    border-color: #1a73e8;
}

.product-checking-item.checking {
    background: #e8f0fe;
    border-color: #1a73e8;
}

.product-checking-item.success {
    background: #e8f5e9;
    border-color: #34a853;
}

.product-checking-item.unchanged {
    background: #f5f5f5;
    border-color: #9e9e9e;
}

.product-checking-item.error {
    background: #fce8e6;
    border-color: #ea4335;
}

.product-checking-item.skipped {
    background: #fff3cd;
    border-color: #ff9800;
}

.product-check-status {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.75em;
    font-weight: bold;
    flex-shrink: 0;
}

.product-check-status.checking {
    background: #1a73e8;
    color: white;
    animation: pulse 1.5s ease-in-out infinite;
}

.product-check-status.success {
    background: #34a853;
    color: white;
}

.product-check-status.unchanged {
    background: #9e9e9e;
    color: white;
}

.product-check-status.error {
    background: #ea4335;
    color: white;
}

.product-check-status.skipped {
    background: #ff9800;
    color: white;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.product-check-info {
    flex: 1;
    min-width: 0;
}

.product-check-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    font-size: 0.9em;
}

.product-check-details {
    font-size: 0.8em;
    color: #666;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.product-check-stock {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content-wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        position: relative;
        top: 0;
        max-height: 400px;
    }

    .offers-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (max-width: 768px) {
    .top-header {
        padding: 6px 12px;
    }
    
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .app-title h1 {
        font-size: 1em;
    }

    .user-info {
        width: 100%;
        justify-content: flex-start;
        gap: 8px;
    }
    
    .status-item {
        gap: 4px;
    }

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

    .results-header {
        flex-direction: column;
        align-items: stretch;
    }

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

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

    .toast-container {
        left: 20px;
        right: 20px;
        max-width: none;
    }

    .toast {
        min-width: auto;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
        padding: 12px;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .stat-value {
        font-size: 1.5em;
    }
    
    .tab-navigation {
        padding: 8px 12px 0 12px;
        overflow-x: auto;
    }
    
    .tab-btn {
        padding: 10px 16px;
        font-size: 0.85em;
    }
    
    .config-panel-toggle {
        padding: 10px 16px;
    }
    
    .config-panel {
        padding: 16px;
    }
    
    .sync-log-info-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .sync-log-info-header .section-actions {
        margin-top: 15px;
        justify-content: flex-start;
    }
}

/* General Table Styles - Small Height */
table tr {
    height: auto;
}

table th {
    padding: 8px 12px;
    line-height: 1.4;
}

table td {
    padding: 8px 12px;
    line-height: 1.4;
}

/* User Management Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal-content {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3em;
    color: #333;
}

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

.modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.modal-body {
    padding: 20px;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.users-table thead {
    background: #f8f9fa;
}

.users-table th {
    padding: 8px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9em;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
}

.users-table td {
    padding: 8px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9em;
    color: #666;
}

.users-table tr {
    width: 100%;
}

.users-table tbody tr:hover {
    background: #f8f9fa;
}

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

.user-role-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 500;
}

.user-role-badge.admin {
    background: #e8f0fe;
    color: #1a73e8;
}

.user-role-badge.user {
    background: #f1f3f4;
    color: #5f6368;
}

.user-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 500;
    background: #e8f5e9;
    color: #2e7d32;
}

.user-status-badge.admin {
    background: #e8f5e9;
    color: #2e7d32;
}

.user-status-badge.user {
    background: #e8f5e9;
    color: #2e7d32;
}

.user-status-badge.active {
    background: #e8f5e9;
    color: #2e7d32;
}

.user-status-badge.locked {
    background: #fff3cd;
    color: #856404;
}

/* Switch Toggle Button */
.user-status-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.user-status-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.user-status-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.user-status-switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.user-status-switch input:checked + .user-status-switch-slider {
    background-color: #34a853;
}

.user-status-switch input:focus + .user-status-switch-slider {
    box-shadow: 0 0 1px #34a853;
}

.user-status-switch input:checked + .user-status-switch-slider:before {
    transform: translateX(26px);
}

.user-status-switch input:disabled + .user-status-switch-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.user-actions {
    display: flex;
    gap: 8px;
}

.user-actions .btn {
    padding: 6px 12px;
    font-size: 0.85em;
}

@media (max-width: 768px) {
    .users-table {
        font-size: 0.85em;
    }
    
    .users-table th,
    .users-table td {
        padding: 6px 12px;
    }
    
    .modal-content {
        max-width: 95%;
    }
}

/* X Rate Input Styles */
#xRateInput {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 0.9em;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#xRateInput:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.1);
}

#xRateInput:invalid {
    border-color: #ea4335;
}

#xRateInput:invalid:focus {
    border-color: #ea4335;
    box-shadow: 0 0 0 2px rgba(234, 67, 53, 0.1);
}
/* ============================================
   Language Toggle Styles
   ============================================ */
.lang-toggle {
    display: flex;
    gap: 2px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.lang-btn {
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    border: none;
    background: #f5f5f5;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.lang-btn:hover {
    background: #e8e8e8;
    color: #333;
}

.lang-btn.active {
    background: #1a73e8;
    color: #fff;
}

.lang-btn.active:hover {
    background: #1557b0;
}

/* ═══════════════════════════════════════════════════════════════
   Application Logs Viewer
   ═══════════════════════════════════════════════════════════════ */
.logs-container {
    background: #1e1e1e;
    border-radius: 8px;
    margin-top: 15px;
    max-height: 70vh;
    min-height: 300px;
    overflow-y: auto;
    position: relative;
    border: 1px solid #333;
}

.logs-content {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12.5px;
    line-height: 1.5;
    color: #d4d4d4;
    padding: 16px;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    tab-size: 4;
}

.log-line {
    display: block;
    padding: 1px 0;
}

.log-line:hover {
    background: rgba(255, 255, 255, 0.05);
}

.log-line-err {
    color: #f48771;
}

.log-line-out {
    color: #d4d4d4;
}

.log-line-warn {
    color: #cca700;
}

.log-line-success {
    color: #89d185;
}

.log-line-highlight {
    background: rgba(255, 215, 0, 0.15);
}

.log-line-number {
    display: inline-block;
    min-width: 45px;
    color: #858585;
    text-align: right;
    margin-right: 16px;
    user-select: none;
    font-size: 11px;
}

.log-line-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 0 5px;
    border-radius: 3px;
    margin-right: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.log-badge-out {
    background: rgba(58, 150, 221, 0.2);
    color: #3a96dd;
}

.log-badge-err {
    background: rgba(244, 135, 113, 0.2);
    color: #f48771;
}

.logs-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 16px;
    background: #252526;
    border-top: 1px solid #333;
    font-size: 11px;
    color: #858585;
    border-radius: 0 0 8px 8px;
}


/* === CATEGORY MAPPING === */
.mapping-stats-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 8px 14px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 0.85em;
    color: #555;
    flex-wrap: wrap;
}

.mapping-stats-bar .stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.mapping-stats-bar .stat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.mapping-stats-bar .stat-dot.mapped { background: #28a745; }
.mapping-stats-bar .stat-dot.auto { background: #007bff; }
.mapping-stats-bar .stat-dot.unmatched { background: #dc3545; }

#mappingTable {
    width: 100%;
    font-size: 0.88em;
}

#mappingTable th {
    position: sticky;
    top: 0;
    background: #f8f9fa;
    z-index: 1;
}

#mappingTable td {
    vertical-align: middle;
}

.mapping-path {
    color: #888;
    font-size: 0.85em;
}

.mapping-path-separator {
    margin: 0 3px;
    color: #ccc;
}

.mapping-leaf {
    font-weight: 600;
    color: #333;
}

.mapping-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8em;
    font-weight: 500;
    white-space: nowrap;
}

.mapping-status-badge.mapped {
    background: #d4edda;
    color: #155724;
}

.mapping-status-badge.auto {
    background: #cce5ff;
    color: #004085;
}

.mapping-status-badge.unmatched {
    background: #f8d7da;
    color: #721c24;
}

.mapping-allegro-cell {
    position: relative;
    min-width: 280px;
}

.mapping-allegro-display {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mapping-allegro-name {
    flex: 1;
}

.mapping-allegro-name .allegro-path {
    font-size: 0.85em;
    color: #888;
}

.mapping-allegro-btn-change {
    padding: 2px 8px;
    font-size: 0.78em;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    color: #555;
}

.mapping-allegro-btn-change:hover {
    background: #f0f0f0;
    border-color: #bbb;
}

.mapping-allegro-search {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
}

.mapping-allegro-search input {
    padding: 5px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9em;
    width: 100%;
    position: relative;
    z-index: 12;
}

.mapping-allegro-search-results {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    position: fixed;
    z-index: 1000;
    min-width: 320px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.mapping-allegro-search-results .search-result-item {
    padding: 6px 10px;
    cursor: pointer;
    font-size: 0.85em;
    border-bottom: 1px solid #f0f0f0;
}

.mapping-allegro-search-results .search-result-item:hover {
    background: #e8f4fd;
}

.mapping-allegro-search-results .search-result-item:last-child {
    border-bottom: none;
}

.mapping-allegro-search-results .search-result-path {
    font-size: 0.82em;
    color: #999;
}

/* Product mapping search results — reuse category mapping styles */
.product-mapping-search-results {
    position: fixed;
    z-index: 10000;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 240px;
    overflow-y: auto;
}

.product-mapping-search-results .search-result-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9em;
}

.product-mapping-search-results .search-result-item:hover {
    background: #f0f7ff;
}

.product-mapping-search-results .search-result-item:last-child {
    border-bottom: none;
}

.product-mapping-search-results .search-result-path {
    font-size: 0.82em;
    color: #999;
}

/* NOSYNC checkbox styling in product mapping */
.product-nosync-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.product-nosync-checkbox:checked {
    accent-color: #e74c3c;
}

/* Extra bottom space for category sync tab to prevent dropdown clipping */
#tab-sync-category-log {
    padding-bottom: 180px;
}

/* Extra bottom space for product mapping tab to prevent dropdown clipping */
#tab-sync-product-mapping {
    padding-bottom: 180px;
}
