/* ===== CSS Variables ===== */
:root {
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --primary-alpha: rgba(37, 99, 235, 0.1);
    --bg-primary: #f0f4f8;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --sidebar-width: 240px;
}

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

html {
    font-size: 14px;
}

body {
    font-family: 'Pretendard Variable', -apple-system, BlinkMacSystemFont, system-ui, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

/* ===== App Layout ===== */
#app {
    display: flex;
    min-height: 100vh;
}

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

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.logo svg {
    width: 28px;
    height: 28px;
    fill: var(--primary);
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: 6px;
}

.sidebar-toggle:hover {
    background: var(--bg-primary);
}

.sidebar-toggle svg {
    width: 20px;
    height: 20px;
}

/* ===== Navigation ===== */
.nav-menu {
    flex: 1;
    padding: 12px 8px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 4px;
    cursor: pointer;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-item:hover {
    background: var(--primary-alpha);
    color: var(--primary);
}

.nav-item.active {
    background: var(--primary-alpha);
    color: var(--primary);
    font-weight: 600;
}

.nav-item.active svg {
    fill: var(--primary);
}

/* ===== User Section ===== */
.user-section {
    padding: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary-alpha);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar svg {
    width: 20px;
    height: 20px;
    fill: var(--primary);
}

.user-details {
    line-height: 1.3;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

.logout-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: 6px;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: #fef2f2;
    color: var(--danger);
}

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

/* ===== Sidebar Overlay (Mobile) ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99;
}

.sidebar-overlay.active {
    display: block;
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

#content {
    padding: 24px;
}

/* ===== Mobile Header ===== */
.mobile-header {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.mobile-menu-btn {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: 6px;
}

.mobile-menu-btn:hover {
    background: var(--bg-primary);
}

.mobile-menu-btn svg {
    width: 22px;
    height: 22px;
}

.mobile-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
}

.mobile-logo svg {
    width: 22px;
    height: 22px;
    fill: var(--primary);
}

/* ===== Page Header ===== */
.page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.text-muted {
    color: var(--text-muted);
    font-size: 14px;
}

/* ===== Stats Grid (Dashboard) ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-pending .stat-value { color: var(--text-muted); }
.stat-ready .stat-value { color: var(--warning); }
.stat-registered .stat-value { color: var(--success); }
.stat-failed .stat-value { color: var(--danger); }

/* ===== Status Tabs ===== */
.status-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
    overflow-x: auto;
    flex-wrap: nowrap;
}

.tab-btn {
    padding: 8px 16px;
    border: none;
    background: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.tab-btn.active {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

.tab-count {
    font-size: 11px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.06);
}

.tab-btn.active .tab-count {
    background: rgba(255, 255, 255, 0.25);
}

/* ===== Search Bar ===== */
.search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.search-bar input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    background: var(--bg-secondary);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-bar input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-alpha);
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    line-height: 1.4;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

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

.btn-secondary:hover {
    background: var(--bg-tertiary);
}

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

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

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

.btn-success:hover {
    background: #059669;
}

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

/* ===== Status Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-pending {
    background: #f1f5f9;
    color: #64748b;
}

.badge-editing {
    background: #dbeafe;
    color: #2563eb;
}

.badge-ready {
    background: #fef3c7;
    color: #d97706;
}

.badge-registering {
    background: #ffedd5;
    color: #ea580c;
}

.badge-registered {
    background: #d1fae5;
    color: #059669;
}

.badge-failed {
    background: #fee2e2;
    color: #dc2626;
}

/* ===== Product List ===== */
.product-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.product-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.product-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.product-thumbnail {
    width: 72px;
    height: 72px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-image {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
}

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

.product-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-title-cn {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-prices {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.price-cny {
    color: var(--text-secondary);
    font-weight: 500;
}

.price-arrow {
    color: var(--text-muted);
    font-size: 11px;
}

.price-krw {
    color: var(--primary);
    font-weight: 700;
}

.product-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.product-date {
    font-size: 11px;
    color: var(--text-muted);
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 15px;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 16px 0;
    flex-wrap: wrap;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.page-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-alpha);
}

.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    font-weight: 600;
}

/* ===== Detail Page ===== */
.detail-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 24px;
}

.detail-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.detail-section h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.detail-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* ===== Form Elements ===== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    background: var(--bg-secondary);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-alpha);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.input-readonly {
    background: var(--bg-primary) !important;
    color: var(--text-secondary) !important;
    cursor: default;
}

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

.input-suffix {
    font-size: 13px;
    color: var(--text-muted);
    margin-left: 4px;
}

.link {
    color: var(--primary);
    font-size: 13px;
    word-break: break-all;
}

.link:hover {
    text-decoration: underline;
}

/* ===== Image Grid ===== */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}

.image-item {
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-primary);
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== Data Table ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table thead th {
    background: var(--bg-primary);
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.data-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.data-table tbody tr:hover {
    background: var(--primary-alpha);
}

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

/* ===== Settings ===== */
.settings-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 24px;
}

.settings-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.settings-section h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.settings-actions {
    display: flex;
    justify-content: flex-end;
}

.cafe24-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-indicator.connected {
    background: var(--success);
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

.status-indicator.disconnected {
    background: var(--text-muted);
}

/* ===== Cards ===== */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

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

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ===== Loading Overlay ===== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ===== Toast Notifications ===== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    z-index: 2000;
    pointer-events: none;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-md);
    pointer-events: auto;
    animation: toastSlideIn 0.3s ease forwards;
    max-width: 360px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.removing {
    animation: toastSlideOut 0.3s ease forwards;
}

.toast-info {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-left: 4px solid var(--info);
}

.toast-success {
    background: #f0fdf4;
    color: #166534;
    border-left: 4px solid var(--success);
}

.toast-warning {
    background: #fffbeb;
    color: #92400e;
    border-left: 4px solid var(--warning);
}

.toast-error {
    background: #fef2f2;
    color: #991b1b;
    border-left: 4px solid var(--danger);
}

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

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

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--bg-secondary);
    border-radius: 12px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: 6px;
    font-size: 20px;
    line-height: 1;
    transition: all 0.2s;
}

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

.modal-body {
    padding: 24px;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

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

    .mobile-header {
        display: flex;
    }

    #content {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-card {
        padding: 16px;
    }

    .stat-value {
        font-size: 24px;
    }

    .product-card {
        flex-wrap: wrap;
    }

    .product-info {
        min-width: calc(100% - 88px);
    }

    .product-meta {
        flex-direction: row;
        align-items: center;
        width: 100%;
    }

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

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

    .status-tabs {
        overflow-x: auto;
    }

    .detail-actions {
        flex-direction: column;
    }

    .detail-actions .btn {
        width: 100%;
    }

    .page-header h1 {
        font-size: 20px;
    }

    .toast-container {
        bottom: 16px;
        right: 16px;
        left: 16px;
    }

    .toast {
        max-width: 100%;
    }
}

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

    .search-bar {
        flex-direction: column;
    }

    .search-bar .btn {
        width: 100%;
    }

    .product-thumbnail {
        width: 56px;
        height: 56px;
    }

    .pagination {
        gap: 2px;
    }

    .page-btn {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
    }
}

/* ===== Bulk Toolbar ===== */
.bulk-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--primary-light, #eff6ff);
    border: 1px solid var(--primary);
    border-radius: 8px;
    margin-bottom: 12px;
}

.bulk-count {
    font-size: 14px;
    color: var(--text);
    margin-right: auto;
}

/* ===== Checkbox ===== */
.product-checkbox {
    display: flex;
    align-items: center;
    padding: 0 8px;
    cursor: pointer;
    flex-shrink: 0;
}

.product-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.select-all-row {
    padding: 8px 16px !important;
    background: var(--surface, #f8fafc);
    border-bottom: 1px solid var(--border);
    min-height: auto !important;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* ===== Image Badge ===== */
.image-item {
    position: relative;
}

.img-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    z-index: 1;
}

.img-local {
    background: var(--success);
    color: white;
}

.img-remote {
    background: var(--warning, #f59e0b);
    color: white;
}

/* ===== Preview Section ===== */
.preview-actions {
    display: flex;
    gap: 8px;
}

/* ===== Button sizes ===== */
.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* ===== Extension Install Guide ===== */
.extension-install-guide {
    margin-top: 12px;
}

.extension-download {
    margin-bottom: 20px;
}

.install-steps {
    background: var(--surface, #f8fafc);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 20px;
}

.install-steps h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 12px 0;
}

.install-steps ol {
    margin: 0;
    padding-left: 20px;
}

.install-steps li {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.install-steps li strong {
    color: var(--text);
}

.install-steps code {
    background: var(--border);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'SF Mono', Monaco, monospace;
}

/* ===== API Key ===== */
.api-key-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.api-key-input {
    flex: 1;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 13px;
    letter-spacing: 0.5px;
}
