:root {
    --color-primary: #4f46e5;
    --color-primary-hover: #4338ca;
    --color-secondary: #64748b;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-bg: #f1f5f9;
    --color-surface: #ffffff;
    --color-border: #e2e8f0;
    --color-text: #1e293b;
    --color-text-muted: #64748b;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --header-height: 64px;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --transition: 0.2s ease;
}

[data-theme="dark"] {
    --color-bg: #0f172a;
    --color-surface: #1e293b;
    --color-border: #334155;
    --color-text: #f1f5f9;
    --color-text-muted: #94a3b8;
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
}

/* Layout */
.app-wrapper { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: width var(--transition);
    overflow-y: auto;
}

.sidebar.collapsed { width: var(--sidebar-collapsed-width); }
.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .nav-arrow { display: none; }

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--transition);
}

.sidebar.collapsed ~ .main-content { margin-left: var(--sidebar-collapsed-width); }

/* Sidebar */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--color-border);
    height: var(--header-height);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--color-text);
    font-weight: 700;
}

.logo-icon {
    width: 36px; height: 36px;
    background: var(--color-primary);
    color: #fff;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.logo-icon.logo-icon-img {
    background: transparent;
    object-fit: contain;
    padding: 2px;
}

.sidebar-toggle, .mobile-menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 0.5rem;
    border-radius: var(--radius);
}

.sidebar-toggle:hover, .mobile-menu-toggle:hover { background: var(--color-bg); }

.nav-list { list-style: none; padding: 0.5rem; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    color: var(--color-text-muted);
    text-decoration: none;
    border-radius: var(--radius);
    transition: all var(--transition);
    font-size: 0.875rem;
}

.nav-link:hover, .nav-link.active {
    background: var(--color-primary);
    color: #fff;
}

.nav-link-pos-back {
    margin-bottom: 0.35rem;
    font-weight: 600;
    color: var(--color-text);
    border: 1px solid var(--color-border);
    background: var(--color-bg);
}

.nav-link-pos-back:hover {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.nav-group-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.625rem 0.75rem;
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    border-radius: var(--radius);
    font-size: 0.875rem;
    text-align: left;
}

.nav-group-toggle:hover { background: var(--color-bg); color: var(--color-text); }

.nav-arrow {
    margin-left: auto;
    transition: transform var(--transition);
}

.nav-group.open > .nav-group-toggle {
    color: var(--color-primary);
    font-weight: 600;
}

.nav-group.open .nav-arrow { transform: rotate(90deg); }

.nav-submenu {
    list-style: none;
    padding-left: 2.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition);
}

.nav-group.open .nav-submenu { max-height: 500px; }

.nav-submenu .nav-link { padding: 0.5rem 0.75rem; font-size: 0.8125rem; }

/* Header */
.header {
    height: var(--header-height);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left { display: flex; align-items: center; gap: 1rem; }

.mobile-menu-toggle { display: none; }

.search-input {
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-bg);
    color: var(--color-text);
    width: 240px;
    font-size: 0.875rem;
}

.header-right { display: flex; align-items: center; gap: 0.5rem; }

.header-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    color: var(--color-text-muted);
    position: relative;
}

.header-btn:hover { background: var(--color-bg); }

.badge {
    position: absolute;
    top: 0; right: 0;
    background: var(--color-danger);
    color: #fff;
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    border-radius: 999px;
}

[data-theme="dark"] .theme-icon-light { display: none; }
[data-theme="light"] .theme-icon-dark { display: none; }

.user-menu { position: relative; }

.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.375rem;
    border-radius: var(--radius);
    color: var(--color-text);
}

.user-avatar {
    width: 32px; height: 32px;
    background: var(--color-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
}

.user-dropdown {
    position: absolute;
    top: 100%; right: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    display: none;
    z-index: 200;
}

.user-dropdown.show { display: block; }

.dropdown-item {
    display: block;
    padding: 0.625rem 1rem;
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.875rem;
}

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

.dropdown-divider { border: none; border-top: 1px solid var(--color-border); margin: 0.25rem 0; }

.dropdown-header {
    padding: 0.625rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.dropdown-header small { color: var(--color-text-muted); font-size: 0.75rem; }

.dropdown-btn {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--color-text);
}

.logout-form { margin: 0; }

/* Page Content */
.page-content { flex: 1; padding: 1.5rem; }

.breadcrumb { margin-bottom: 1rem; }

.breadcrumb-list {
    display: flex;
    list-style: none;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.breadcrumb-list a { color: var(--color-primary); text-decoration: none; }
.breadcrumb-separator { margin: 0 0.25rem; }
.breadcrumb-current { color: var(--color-text); }

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.page-title { font-size: 1.5rem; font-weight: 700; }

.page-actions { display: flex; gap: 0.5rem; }

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

.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
}

.stat-label { display: block; font-size: 0.8125rem; color: var(--color-text-muted); }
.stat-value { display: block; font-size: 1.5rem; font-weight: 700; margin-top: 0.25rem; }
.stat-card-icon { font-size: 2rem; opacity: 0.8; }

/* Cards */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

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

.card-header h2 { font-size: 1.125rem; }

.card-body { padding: 1.25rem; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
}

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

/* Dashboard */
.setup-checklist { margin: 1.5rem 0; }
.setup-checklist h3 { margin-bottom: 0.75rem; font-size: 1rem; }
.setup-checklist ul { padding-left: 1.5rem; }
.setup-checklist li { margin-bottom: 0.375rem; }
.setup-checklist code {
    background: var(--color-bg);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.8125rem;
}

.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.quick-link-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem;
    background: var(--color-bg);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--color-text);
    transition: all var(--transition);
}

.quick-link-card:hover {
    background: var(--color-primary);
    color: #fff;
    transform: translateY(-2px);
}

.ql-icon { font-size: 1.5rem; }
.ql-label { font-size: 0.8125rem; font-weight: 500; }

/* Footer */
.footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--color-border);
    text-align: center;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

/* Toast */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    color: #fff;
    font-size: 0.875rem;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    min-width: 280px;
}

.toast-success { background: var(--color-success); }
.toast-error { background: var(--color-danger); }
.toast-warning { background: var(--color-warning); }
.toast-info { background: var(--color-primary); }

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

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

.modal-overlay[hidden] { display: none; }

.modal {
    background: var(--color-surface);
    border-radius: var(--radius);
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}

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

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-text-muted);
}

.modal-body { padding: 1.25rem; }
.modal-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Spinner */
.spinner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner-overlay[hidden] { display: none; }

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

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

/* Error Page */
.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.error-container { text-align: center; }
.error-container h1 { font-size: 4rem; color: var(--color-primary); }
.error-container p { margin: 1rem 0 1.5rem; color: var(--color-text-muted); }

/* Media Library & Picker */
.media-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.media-library-item {
    border: 1px solid var(--color-border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--color-bg);
}

.media-library-thumb {
    display: block;
    aspect-ratio: 1;
    background: #f3f4f6;
}

.media-library-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-library-meta {
    padding: 0.625rem 0.75rem 0.25rem;
}

.media-library-meta strong {
    display: block;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-library-meta small {
    color: var(--color-text-muted);
}

.media-library-actions {
    display: flex;
    gap: 0.375rem;
    padding: 0 0.75rem 0.75rem;
}

.media-picker-field .media-picker-preview {
    width: 220px;
    height: 140px;
    border: 1px dashed var(--color-border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 0.75rem;
    background: var(--color-bg);
}

.media-picker-field .media-picker-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-picker-placeholder {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.media-picker-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.media-picker-modal {
    width: min(920px, 96vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.media-picker-modal .modal-body {
    overflow: auto;
}

.media-picker-toolbar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    align-items: center;
}

.media-picker-toolbar .form-control {
    flex: 1;
}

.media-picker-upload-btn {
    margin: 0;
    cursor: pointer;
}

.media-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    min-height: 180px;
}

.media-picker-item {
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    padding: 0;
    background: #f3f4f6;
    cursor: pointer;
}

.media-picker-item:hover,
.media-picker-item:focus {
    border-color: var(--color-primary);
}

.media-picker-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

.media-picker-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--color-text-muted);
    padding: 2rem 0;
}

.media-picker-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.product-images-panel {
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 1rem;
    background: var(--color-bg);
}

.product-images-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.product-images-count {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(79, 70, 229, 0.12);
    color: var(--color-primary);
    font-size: 0.8125rem;
    font-weight: 600;
}

.product-images-summary {
    margin: 0 0 0.875rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.product-images-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.75rem;
}

.product-images-grid.has-images {
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
}

.product-image-card {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--color-surface);
    display: flex;
    flex-direction: column;
    width: 112px;
    flex: 0 0 112px;
    max-width: 112px;
}

.product-image-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem;
    padding: 0.35rem 0.45rem;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}

.product-image-index {
    font-size: 0.6875rem;
    font-weight: 600;
}

.product-image-primary {
    font-size: 0.625rem;
    padding: 0.1rem 0.35rem;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-success);
    font-weight: 600;
}

.product-image-thumb {
    width: 112px;
    height: 84px;
    max-width: 112px;
    max-height: 84px;
    overflow: hidden;
    background: #f3f4f6;
    flex-shrink: 0;
}

.product-image-thumb img {
    width: 112px;
    height: 84px;
    max-width: 112px;
    max-height: 84px;
    object-fit: cover;
    display: block;
}

.product-images-field img {
    max-width: 112px;
    max-height: 84px;
}

.product-image-name {
    padding: 0.35rem 0.45rem 0;
    font-size: 0.625rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-image-card .product-image-remove {
    margin: 0.4rem;
    padding: 0.25rem 0.4rem;
    font-size: 0.6875rem;
    width: auto;
    height: auto;
    border-radius: var(--radius);
    position: static;
    background: var(--color-danger);
}

.product-images-strip-empty {
    margin-bottom: 0.875rem;
    padding: 1.25rem;
    border: 2px dashed var(--color-border);
    border-radius: 10px;
    text-align: center;
    color: var(--color-text-muted);
    background: var(--color-surface);
}

.product-image-card.is-new {
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.35);
    animation: productImagePop 0.35s ease;
}

@keyframes productImagePop {
    from { transform: scale(0.92); opacity: 0.5; }
    to { transform: scale(1); opacity: 1; }
}

.product-images-upload-label {
    margin: 0;
    cursor: pointer;
}

.product-images-field--compact .product-image-card {
    width: 88px;
    flex: 0 0 88px;
    max-width: 88px;
}

.product-images-field--compact .product-image-thumb,
.product-images-field--compact .product-image-thumb img,
.product-images-field--compact .product-images-field img {
    width: 88px;
    height: 66px;
    max-width: 88px;
    max-height: 66px;
}

.product-images-field--compact .product-image-card-head {
    padding: 0.25rem 0.35rem;
}

.product-images-field--compact .product-image-name {
    font-size: 0.5625rem;
    padding: 0.25rem 0.35rem 0;
}

.product-images-field--compact .product-image-card .product-image-remove {
    font-size: 0.625rem;
    padding: 0.2rem 0.35rem;
    margin: 0.35rem;
}

.product-images-strip-empty {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin: 0 0 0.875rem;
    padding: 0.875rem;
    border: 1px dashed var(--color-border);
    border-radius: 8px;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .mobile-menu-toggle { display: block; }
    .search-input { width: 160px; }
    .user-name { display: none; }
}

/* Auth / Login */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
}

.auth-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 1.5rem;
}

.auth-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
}

.auth-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-brand .logo-icon {
    width: 48px; height: 48px;
    background: var(--color-primary);
    color: #fff;
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.auth-brand h1 { font-size: 1.25rem; margin-bottom: 0.25rem; }
.auth-brand p { color: var(--color-text-muted); font-size: 0.875rem; }

.auth-form { display: flex; flex-direction: column; gap: 1rem; }

.product-upload-section {
    padding-top: 1.25rem !important;
    margin-top: 0.25rem;
    border-top: 2px solid var(--color-border);
    background: var(--color-bg);
}

.product-upload-files {
    padding: 0;
}

.product-upload-files__title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: var(--color-text);
}

.product-upload-files__hint,
.product-upload-files__empty {
    margin: 0 0 1rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

.product-upload-files__list {
    display: grid;
    gap: 1rem;
}

.product-upload-file-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1rem;
    background: var(--color-surface, #fff);
}

.product-upload-file-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

.product-upload-file-card__status {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.product-upload-file-card__status--ok {
    color: var(--color-success);
}

.product-upload-file-card__current code {
    font-size: 0.8125rem;
}

.product-upload-file-card__size {
    margin-left: 0.35rem;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.product-upload-form {
    max-width: 720px;
    margin-bottom: 1.25rem;
}

.product-upload-form__actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.product-upload-files__notice {
    margin: 0;
    padding: 0.875rem 1rem;
    border-radius: var(--radius);
    background: var(--color-bg);
    border: 1px dashed var(--color-border);
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.product-upload-files__existing {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--color-border);
}

.product-upload-files__existing-title {
    margin: 0 0 0.75rem;
    font-size: 0.9375rem;
    font-weight: 600;
}

.product-upload-files__existing-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.5rem;
}

.product-upload-files__existing-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface, #fff);
}

.product-upload-files__existing-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.75rem;
    font-size: 0.875rem;
}

.product-upload-files__existing-version,
.product-upload-files__existing-size {
    color: var(--color-text-muted);
    font-size: 0.8125rem;
}



.form-group { display: flex; flex-direction: column; gap: 0.375rem; }

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
}

.form-control {
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 0.875rem;
    transition: border-color var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.form-control.is-invalid { border-color: var(--color-danger); }

.form-error { color: var(--color-danger); font-size: 0.8125rem; }

.form-check { flex-direction: row; align-items: center; }

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
}

.btn-block { width: 100%; justify-content: center; padding: 0.75rem; }

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.password-field {
    position: relative;
    display: flex;
    align-items: center;
}

.password-field .form-control {
    padding-right: 4.5rem;
}

.password-toggle {
    position: absolute;
    right: 0.5rem;
    border: none;
    background: transparent;
    color: var(--color-primary);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--color-success); }
.badge-info { background: rgba(37, 99, 235, 0.12); color: #2563eb; }
.badge-warning { background: rgba(217, 119, 6, 0.15); color: #d97706; }

.description-editor { display: flex; flex-direction: column; gap: 0.5rem; }
.description-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-bg);
}
.description-textarea { min-height: 180px; font-family: inherit; line-height: 1.6; }
.description-editor-hint {
    color: var(--color-text-muted);
    font-size: 0.8125rem;
    line-height: 1.5;
}
.description-editor-hint code {
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.05);
    font-size: 0.75rem;
}

.post-content-editor-wrap .form-hint,
.rich-content-editor-wrap .form-hint {
    display: block;
    margin-top: 0.5rem;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.post-content-editor-wrap .tox-tinymce,
.rich-content-editor-wrap .tox-tinymce {
    border-radius: var(--radius);
    border-color: var(--color-border) !important;
}

@media (max-width: 992px) {
    .grid-2-col {
        grid-template-columns: 1fr !important;
    }
}

.ga4-panel {
    margin-bottom: 1rem;
    overflow: hidden;
}

.ga4-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    background: linear-gradient(180deg, rgba(79, 70, 229, 0.04) 0%, transparent 100%);
}

.ga4-panel__title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ga4-panel__icon {
    font-size: 1.15rem;
}

.ga4-panel__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.ga4-panel__subtitle {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.35rem;
}

.ga4-panel__measurement-id {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    font-family: Consolas, Monaco, monospace;
}

.ga4-panel__tracking-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.14);
    color: #059669;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ga4-panel__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.ga4-panel__period-form {
    margin: 0;
}

.ga4-panel__period-select {
    min-width: 140px;
    height: 36px;
    padding: 0.35rem 0.65rem;
    font-size: 0.875rem;
}

.ga4-panel__body {
    padding: 1rem 1.25rem 1.25rem;
}

.ga4-panel__alert {
    margin: 0 0 1rem;
}

.ga4-panel__metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.ga4-panel__metric {
    padding: 0.9rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
}

.ga4-panel__metric-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 0.35rem;
}

.ga4-panel__metric-value {
    font-size: 1.45rem;
    line-height: 1.1;
}

.ga4-panel__columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.ga4-panel__column {
    margin: 0;
    overflow: hidden;
}

.ga4-panel__column-header {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.92rem;
    font-weight: 600;
}

.ga4-panel__column-body {
    padding: 0.85rem 1rem 1rem;
    min-height: 180px;
}

.ga4-panel__empty {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.ga4-panel__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ga4-panel__list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.9rem;
}

.ga4-panel__list-item:last-child {
    border-bottom: none;
}

.ga4-panel__page-path {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 75%;
    color: var(--color-text-muted);
    font-family: Consolas, Monaco, monospace;
    font-size: 0.82rem;
}

@media (max-width: 1100px) {
    .ga4-panel__metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .ga4-panel__header,
    .ga4-panel__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .ga4-panel__metrics,
    .ga4-panel__columns {
        grid-template-columns: 1fr;
    }
}
