/* ============================================================
   🎨 ADMIN PANEL — Styles
   ============================================================ */

:root {
    --admin-bg: #0f172a;
    --admin-card: #1e293b;
    --admin-border: #334155;
    --admin-text: #e2e8f0;
    --admin-text-muted: #94a3b8;
    --admin-primary: #2563eb;
    --admin-accent: #93c5fd;
    --admin-primary-hover: #2563eb;
    --admin-success: #22c55e;
    --admin-danger: #ef4444;
    --admin-danger-hover: #dc2626;
    --admin-warning: #f59e0b;
}

/* ── Layout ─────────────────────────────────────────── */
.admin-body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background: var(--admin-bg);
    color: var(--admin-text);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

.admin-container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 30px 24px;
}

/* ── Header ─────────────────────────────────────────── */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--admin-border);
    margin-bottom: 26px;
}

.admin-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.admin-header h1 i {
    color: var(--admin-accent);
    margin-right: 10px;
}

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

.admin-user-info span {
    color: var(--admin-text-muted);
    font-size: 0.85rem;
}

/* ── Buttons ────────────────────────────────────────── */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

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

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

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

.btn-danger:hover {
    background: var(--admin-danger-hover);
}

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

.btn-outline:hover {
    border-color: var(--admin-accent);
    color: var(--admin-accent);
}

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

.btn-icon {
    padding: 10px 18px;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-ghost {
    background: transparent;
    border: 1px solid transparent;
    color: var(--admin-text-muted);
    padding: 11px 24px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-ghost:hover {
    background: rgba(255,255,255,0.04);
    color: var(--admin-text);
}

.btn-save {
    padding: 11px 28px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--admin-danger);
    color: var(--admin-danger);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

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

/* ── Stats Bar ──────────────────────────────────────── */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 26px;
}

.stat-card {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    padding: 20px 22px;
    min-height: 88px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
}

.stat-card .stat-number {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--admin-accent);
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--admin-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
}

/* ── Toolbar ────────────────────────────────────────── */
.admin-toolbar {
    display: grid;
    grid-template-columns: max-content minmax(380px, 1fr) max-content;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.admin-toolbar h2 {
    margin: 0;
    font-size: 1.2rem;
}

.admin-toolbar .btn-primary {
    height: 42px;
    white-space: nowrap;
}

/* ── Search Bar ─────────────────────────────────────── */
.admin-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    max-width: none;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.search-input-wrapper .search-icon {
    position: absolute;
    left: 12px;
    color: var(--admin-text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}

.search-input-wrapper input {
    width: 100%;
    height: 42px;
    padding: 9px 36px 9px 34px;
    background: var(--admin-bg);
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    color: var(--admin-text);
    font-size: 0.9rem;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.search-input-wrapper input:focus {
    outline: none;
    border-color: var(--admin-accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-clear-search {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: var(--admin-text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.btn-clear-search:hover {
    color: var(--admin-danger);
}

.admin-search-bar select {
    height: 42px;
    min-width: 170px;
    padding: 9px 34px 9px 12px;
    background: var(--admin-bg);
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    color: var(--admin-text);
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.2s;
    white-space: nowrap;
}

.admin-search-bar select:focus {
    outline: none;
    border-color: var(--admin-accent);
}

@media (max-width: 768px) {
    .admin-toolbar {
        grid-template-columns: 1fr auto;
    }

    .admin-search-bar {
        grid-column: 1 / -1;
    }

    .admin-search-bar select {
        min-width: 150px;
    }
}

/* ── Product Table ──────────────────────────────────── */
.product-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--admin-card);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--admin-border);
}

.product-table thead {
    background: rgba(59, 130, 246, 0.1);
}

.product-table th {
    text-align: left;
    padding: 13px 16px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--admin-text-muted);
    border-bottom: 1px solid var(--admin-border);
    white-space: nowrap;
}

.product-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--admin-border);
    vertical-align: middle;
}

.product-table th:nth-child(1),
.product-table td:nth-child(1) {
    width: 72px;
}

.product-table th:nth-child(3),
.product-table td:nth-child(3) {
    width: 150px;
}

.product-table th:nth-child(4),
.product-table td:nth-child(4) {
    width: 126px;
}

.product-table th:nth-child(5),
.product-table td:nth-child(5) {
    width: 112px;
    text-align: center;
}

.product-table th:nth-child(6),
.product-table td:nth-child(6) {
    width: 142px;
}

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

.product-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.table-img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    background: white;
    border-radius: 8px;
    padding: 4px;
    box-sizing: border-box;
}

.image-cell {
    padding-right: 8px;
}

.product-title {
    display: block;
    line-height: 1.45;
    max-width: 560px;
    overflow-wrap: anywhere;
}

.category-cell {
    line-height: 1.8;
}

.category-pill {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    margin: 2px 6px 2px 0;
    padding: 3px 8px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.08);
    color: var(--admin-text);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-cell,
.actions-cell-wrap {
    white-space: nowrap;
}

.badge-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    line-height: 1;
    white-space: nowrap;
}

.badge-status.in-stock {
    background: rgba(34, 197, 94, 0.15);
    color: var(--admin-success);
}

.badge-status.on-order {
    background: rgba(245, 158, 11, 0.15);
    color: var(--admin-warning);
}

.badge-status.out-of-stock {
    background: rgba(239, 68, 68, 0.15);
    color: var(--admin-danger);
}

.featured-star {
    color: var(--admin-warning);
    font-size: 1rem;
}

.muted-dash {
    color: var(--admin-text-muted);
}

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

.actions-cell .btn {
    min-height: 32px;
}

.actions-cell .btn-outline {
    padding: 7px 11px;
}

.btn-icon-only {
    width: 32px;
    height: 32px;
    justify-content: center;
    padding: 0;
}

/* ── Modal / Form ───────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    z-index: 1000;
    justify-content: center;
    align-items: flex-start;
    padding: 24px 20px;
    overflow-y: auto;
    animation: fadeIn 0.2s ease;
    scrollbar-width: thin;
    scrollbar-color: #475569 transparent;
}
.modal-overlay::-webkit-scrollbar {
    width: 10px;
}
.modal-overlay::-webkit-scrollbar-track {
    background: transparent;
}
.modal-overlay::-webkit-scrollbar-thumb {
    background: #475569;
    border: 3px solid rgba(0,0,0,0.75);
    border-radius: 999px;
}
.modal-overlay.active {
    display: flex;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
    background: #111827;
    border: 1px solid #1e293b;
    border-radius: 18px;
    width: 100%;
    max-width: 820px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    max-height: min(860px, calc(100dvh - 48px));
    overflow: hidden;
    animation: slideUp 0.25s ease;
}

.admin-header-subtitle {
    margin: 5px 0 0;
    color: var(--admin-text-muted);
    font-size: 0.86rem;
}

.form-wizard {
    display: flex;
    align-items: center;
    padding: 14px 32px;
    background: rgba(2, 6, 23, 0.42);
    border-bottom: 1px solid rgba(51, 65, 85, 0.55);
    flex-shrink: 0;
}

.wizard-step {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 0;
    background: transparent;
    color: var(--admin-text-muted);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 650;
    padding: 4px 0;
    cursor: default;
}

.wizard-step-number {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--admin-border);
    border-radius: 50%;
    background: #111827;
    color: inherit;
}

.wizard-step.active,
.wizard-step.complete {
    color: var(--admin-text);
}

.wizard-step.active .wizard-step-number {
    background: var(--admin-primary);
    border-color: var(--admin-accent);
    color: white;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.13);
}

.wizard-step.complete {
    cursor: pointer;
}

.wizard-step.complete .wizard-step-number {
    background: rgba(34, 197, 94, 0.14);
    border-color: var(--admin-success);
    color: var(--admin-success);
}

.wizard-line {
    height: 1px;
    background: var(--admin-border);
    flex: 1;
    margin: 0 14px;
}

.form-step-panel[hidden] {
    display: none !important;
}

.form-step-panel.active {
    animation: formStepIn 0.18s ease;
}

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

.form-alert {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid rgba(239, 68, 68, 0.55);
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.1);
    color: #fecaca;
    font-size: 0.83rem;
    line-height: 1.45;
}

.form-alert[hidden] {
    display: none;
}

.form-group.has-error input,
.form-group.has-error textarea,
.form-group.has-error select,
.form-group.has-error .hashtags-input-wrapper,
.file-slots-container.has-error {
    border-color: var(--admin-danger) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.modal-footer-spacer {
    flex: 1;
}

.modal-footer [hidden] {
    display: none !important;
}

.upload-summary {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    margin: -4px 0 20px;
    padding: 10px 13px;
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.06);
    color: #bfdbfe;
    font-size: 0.8rem;
}

.upload-summary.uploading i {
    animation: pulseUpload 0.9s ease-in-out infinite alternate;
}

.upload-summary.error {
    border-color: rgba(239, 68, 68, 0.45);
    background: rgba(239, 68, 68, 0.08);
    color: #fecaca;
}

@keyframes pulseUpload {
    to { transform: translateY(-2px); color: white; }
}

.review-intro {
    margin: -4px 0 18px;
    color: var(--admin-text-muted);
    font-size: 0.84rem;
    line-height: 1.55;
}

.product-review {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 18px;
    align-items: start;
}

.review-image {
    width: 150px;
    aspect-ratio: 1;
    object-fit: contain;
    border-radius: 12px;
    background: white;
    border: 1px solid var(--admin-border);
}

.review-details h4 {
    margin: 0 0 8px;
    color: var(--admin-text);
    font-size: 1.05rem;
    line-height: 1.35;
}

.review-details p {
    margin: 0 0 14px;
    color: var(--admin-text-muted);
    font-size: 0.82rem;
    line-height: 1.55;
}

.review-chip.review-chip--status { background: #422006; color: #fcd34d; border-color: #92400e; }
.review-chip.review-chip--status.in-stock { background: #052e16; color: #86efac; border-color: #166534; }
.review-chip.review-chip--status.out-of-stock { background: #450a0a; color: #fca5a5; border-color: #991b1b; }
.review-chip.review-chip--category { background: #2e1065; color: #ddd6fe; border-color: #6d28d9; }
.review-chip.review-chip--files { background: #172554; color: #bfdbfe; border-color: #1d4ed8; }
.review-chip.review-chip--featured { background: #36310f; color: #fef08a; border-color: #857018; }

.review-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.review-chip {
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.09);
    border: 1px solid rgba(59, 130, 246, 0.23);
    color: #bfdbfe;
    font-size: 0.72rem;
}

.review-ready {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 20px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.08);
    color: #86efac;
    font-size: 0.82rem;
    font-weight: 650;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── Modal Header ──────────────────────────────────── */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 28px 32px 18px;
    background: #111827;
    border-bottom: 1px solid rgba(51, 65, 85, 0.45);
    flex-shrink: 0;
}
.modal-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}
.modal-icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(59,130,246,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--admin-accent);
    flex-shrink: 0;
}
.modal-header h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--admin-text);
}
.modal-subtitle {
    margin: 3px 0 0;
    font-size: 0.8rem;
    color: var(--admin-text-muted);
}
.modal-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--admin-text-muted);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}
.modal-close-btn:hover {
    background: rgba(255,255,255,0.06);
    border-color: var(--admin-border);
    color: var(--admin-text);
}

/* ── Modal Body (scrollable) ───────────────────────── */
.modal-body {
    padding: 22px 26px 24px 32px;
    overflow-y: auto;
    flex: 1;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #475569 transparent;
}
.modal-body::-webkit-scrollbar {
    width: 10px;
}
.modal-body::-webkit-scrollbar-track {
    background: transparent;
}
.modal-body::-webkit-scrollbar-thumb {
    background: #475569;
    border: 3px solid #111827;
    border-radius: 999px;
}
.modal-body::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* ── Modal Footer ──────────────────────────────────── */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 32px 20px;
    background: #111827;
    border-top: 1px solid rgba(51, 65, 85, 0.65);
    box-shadow: 0 -18px 32px rgba(17, 24, 39, 0.88);
    flex-shrink: 0;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

/* ── Form Sections ─────────────────────────────────── */
.form-section {
    background: rgba(255,255,255,0.02);
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 22px;
    margin-bottom: 18px;
}
.form-section:last-child {
    margin-bottom: 0;
}
.form-section-header {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--admin-accent);
    text-transform: uppercase;
    letter-spacing: 0.7px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.form-section-header i { font-size: 14px; }

.form-section-import {
    background: rgba(59,130,246,0.04);
    border-color: rgba(59,130,246,0.2);
}
.form-section-data {
    background: rgba(255,255,255,0.025);
}
.form-section-import .form-section-header {
    color: var(--admin-accent);
}
.import-row {
    display: flex;
    gap: 10px;
}
.import-select {
    flex: 1;
    padding: 10px 14px;
    background: var(--admin-bg);
    border: 1px solid var(--admin-border);
    border-radius: 10px;
    color: var(--admin-text);
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}
.import-select:focus { border-color: var(--admin-accent); }

.form-section-files {
    border-style: dashed;
    background: rgba(59, 130, 246, 0.025);
}

.files-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 28px;
    row-gap: 22px;
}
.files-grid .form-group {
    margin-bottom: 0;
}
@media (max-width: 600px) {
    .files-grid { grid-template-columns: 1fr; }
}

.form-section-tip {
    background: rgba(251,191,36,0.075);
    border: 1px solid rgba(251,191,36,0.15);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 20px;
    font-size: 0.8rem;
    color: var(--admin-text-muted);
    display: flex;
    gap: 8px;
    align-items: flex-start;
    line-height: 1.55;
}
.form-section-tip i { color: #f59e0b; margin-top: 1px; flex-shrink: 0; }

/* ── Form Elements ─────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.82rem;
    color: var(--admin-text-muted);
    font-weight: 650;
}
.required-star { color: var(--admin-danger); }

.input-icon-wrapper {
    position: relative;
}
.input-icon-wrapper .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--admin-text-muted);
    font-size: 13px;
    pointer-events: none;
    opacity: 0.75;
}
.input-icon-wrapper input {
    width: 100%;
    padding: 12px 14px 12px 44px;
    background: var(--admin-bg);
    border: 1px solid var(--admin-border);
    border-radius: 10px;
    color: var(--admin-text);
    font-size: 0.9rem;
    font-family: inherit;
    box-sizing: border-box;
    transition: all 0.2s;
}
.input-icon-wrapper input:focus {
    outline: none;
    border-color: var(--admin-accent);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    background: var(--admin-bg);
    border: 1px solid var(--admin-border);
    border-radius: 10px;
    color: var(--admin-text);
    font-size: 0.9rem;
    font-family: inherit;
    box-sizing: border-box;
    transition: all 0.2s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--admin-accent);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.form-group textarea {
    resize: vertical;
    min-height: 96px;
    line-height: 1.55;
}
.char-counter {
    display: block;
    text-align: right;
    font-size: 0.7rem;
    color: var(--admin-text-muted);
    margin-top: 6px;
}

/* ── Featured Row ──────────────────────────────────── */
.featured-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 34px;
}
.featured-hint {
    font-size: 0.8rem;
    color: var(--admin-text-muted);
    line-height: 1.35;
}
.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--admin-text-muted);
    line-height: 1.4;
}

/* ── Login Page ─────────────────────────────────────── */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-card h1 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.login-card h1 i {
    color: var(--admin-accent);
    margin-right: 8px;
}

.login-card p {
    color: var(--admin-text-muted);
    font-size: 0.9rem;
    margin-bottom: 30px;
}

.login-card .form-group {
    text-align: left;
}

.login-card .btn {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 1rem;
    margin-top: 10px;
}

.login-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--admin-danger);
    color: var(--admin-danger);
    padding: 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 15px;
    display: none;
}

/* ── Loading ────────────────────────────────────────── */
.loading-spinner {
    text-align: center;
    padding: 40px;
    color: var(--admin-text-muted);
}

.loading-spinner i {
    font-size: 2rem;
    animation: spin 1s linear infinite;
}

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

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

.toast {
    box-sizing: border-box;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
    min-width: min(280px, calc(100vw - 40px));
    max-width: min(420px, calc(100vw - 40px));
    overflow-wrap: anywhere;
}

.toast.success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid var(--admin-success);
    color: var(--admin-success);
}

.toast.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--admin-danger);
    color: var(--admin-danger);
}

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

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 768px) {
    .admin-stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-card {
        min-height: 78px;
        padding: 18px 20px;
    }

    .admin-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .product-table {
        display: block;
        overflow-x: auto;
        font-size: 0.85rem;
    }

    .product-table thead,
    .product-table tbody {
        display: table;
        width: 900px;
    }

    .product-table td {
        padding: 10px 12px;
    }

    .product-title {
        max-width: 360px;
    }

    .actions-cell {
        flex-direction: row;
        gap: 6px;
    }
}

@media (max-width: 560px) {
    .admin-container {
        padding: 22px 14px;
    }

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

    .admin-search-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-search-bar select,
    .admin-toolbar .btn-primary {
        width: 100%;
    }

    .admin-toolbar .btn-primary {
        justify-content: center;
    }

    .modal-overlay {
        padding: 10px;
    }

    .modal-content {
        max-height: calc(100dvh - 20px);
        border-radius: 14px;
    }

    .modal-header {
        padding: 20px 20px 16px;
    }

    .form-wizard {
        padding: 12px 20px;
    }

    .wizard-step {
        gap: 5px;
        font-size: 0.7rem;
    }

    .wizard-step-number {
        width: 24px;
        height: 24px;
    }

    .wizard-line {
        margin: 0 7px;
    }

    .modal-body {
        padding: 18px 14px 20px 20px;
    }

    .modal-footer {
        padding: 14px 20px 18px;
    }

    .modal-footer .btn {
        padding-left: 16px;
        padding-right: 16px;
    }

    .modal-footer {
        flex-wrap: wrap;
    }

    .modal-footer-spacer {
        display: none;
    }

    #btn-cancel {
        margin-right: auto;
    }

    .product-review {
        grid-template-columns: 1fr;
    }

    .review-image {
        width: 120px;
    }

    .form-section {
        padding: 18px;
    }
}

/* ── File Explorer Modal ───────────────────────────── */
.modal-large {
    max-width: 900px;
    width: 90%;
    height: 80vh;
    display: flex;
    flex-direction: column;
}

.explorer-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.explorer-grid {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    padding: 10px;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
}

.explorer-item {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.explorer-item:hover {
    border-color: var(--admin-accent);
    transform: translateY(-2px);
    background: rgba(59, 130, 246, 0.1);
}

.explorer-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    background: #000;
}

.file-icon {
    font-size: 3rem;
    color: var(--admin-text-muted);
    margin: 20px 0;
}

.explorer-item .file-name {
    font-size: 0.8rem;
    text-align: center;
    word-break: break-all;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.loading-text,
.empty-text,
.error-text {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--admin-text-muted);
}

/* ── Visual Slots UI ───────────────────────────────── */
.file-slots-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
    min-height: 96px;
}

.file-slots-container.uploading {
    cursor: progress;
}

.file-slots-container.uploading .file-slot {
    opacity: 0.58;
    pointer-events: none;
}

.file-slot {
    width: 92px;
    height: 92px;
    border-radius: 8px;
    position: relative;
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all 0.2s ease;
}

.file-slot.filled {
    background: #1b273a;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.015);
}

.file-slot.slot-add {
    border: 2px dashed var(--admin-border);
    cursor: pointer;
    color: var(--admin-text-muted);
    flex-direction: column;
    gap: 7px;
    font: inherit;
    font-size: 0.7rem;
    font-weight: 650;
    padding: 8px;
}

.file-slot.slot-add i {
    font-size: 1.35rem;
}

.file-slot.slot-add:hover {
    border-color: var(--admin-accent);
    color: var(--admin-accent);
    background: rgba(59, 130, 246, 0.05);
}

.file-slot img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
}

.slot-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    background: var(--admin-danger);
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
    opacity: 0;
    transition: opacity 0.2s;
    border: 2px solid #111827;
}

.file-slot:hover .slot-remove {
    opacity: 1;
}

@media (hover: none) {
    .file-slot.filled .slot-remove {
        opacity: 1;
    }
}

.slot-icon {
    font-size: 2rem;
    color: var(--admin-text-muted);
    margin-bottom: 12px;
}

.slot-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(2,6,23,0.86);
    color: white;
    font-size: 0.62rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 4px 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Admin Pagination ──────────────────────────────── */
.admin-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 8px 0;
}
.admin-pagination .pagination-info {
    font-size: 13px;
    color: var(--admin-text-muted);
    min-width: 160px;
    text-align: center;
}
.admin-pagination button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.admin-pagination button:disabled:hover {
    border-color: var(--admin-border);
    color: var(--admin-text);
}

/* ── Hashtags Input ─────────────────────────────────── */
.hashtags-input-wrapper {
    position: relative;
    border: 1px solid var(--admin-border);
    border-radius: 10px;
    background: var(--admin-bg);
    padding: 8px 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    min-height: 46px;
    cursor: text;
    transition: border-color 0.2s;
}
.hashtags-input-wrapper:focus-within {
    border-color: var(--admin-accent);
}
.hashtags-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.hashtags-input-wrapper input#hashtag-input {
    flex: 1;
    min-width: 180px;
    width: auto;
    height: 28px;
    padding: 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.hashtags-input-wrapper input#hashtag-input:focus {
    border: 0;
    box-shadow: none;
}
.hashtag-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--admin-accent);
    padding: 4px 9px 4px 10px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.hashtag-pill .pill-remove {
    cursor: pointer;
    font-size: 14px;
    opacity: 0.6;
    transition: opacity 0.15s;
    line-height: 1;
    border: 0;
    background: transparent;
    color: inherit;
    padding: 0;
}
.hashtag-pill .pill-remove:hover {
    opacity: 1;
    color: var(--admin-danger);
}

.product-name-cell {
    min-width: 230px;
}

.product-quality-warning,
.product-quality-ok {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    font-size: 0.68rem;
    line-height: 1.3;
}

.product-quality-warning {
    color: #fbbf24;
}

.product-quality-ok {
    color: #4ade80;
}
.hashtags-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 0 0 8px 8px;
    max-height: 150px;
    overflow-y: auto;
    z-index: 50;
    margin-top: -1px;
}
.hashtags-suggestion-item {
    padding: 8px 14px;
    cursor: pointer;
    font-size: 13px;
    color: var(--admin-text);
    transition: background 0.15s;
}
.hashtags-suggestion-item:hover {
    background: rgba(59, 130, 246, 0.1);
}

/* ── Featured Switch ───────────────────────────────── */
.switch-wrapper {
    position: relative;
    display: inline-flex;
}
.switch-input {
    display: none;
}
.switch-label {
    display: inline-flex;
    align-items: center;
    width: 60px;
    height: 28px;
    background: var(--admin-border);
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.25s;
    position: relative;
    overflow: hidden;
}
.switch-label::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    transition: left 0.25s;
}
.switch-input:checked + .switch-label {
    background: var(--admin-primary);
}
.switch-input:checked + .switch-label::after {
    left: 35px;
}
.switch-text-off, .switch-text-on {
    position: absolute;
    font-size: 11px;
    font-weight: 700;
    top: 50%;
    transform: translateY(-50%);
    transition: opacity 0.2s;
    pointer-events: none;
}
.switch-text-off {
    right: 9px;
    opacity: 1;
    color: var(--admin-text-muted);
}
.switch-text-on {
    left: 9px;
    opacity: 0;
    color: white;
}
.switch-input:checked + .switch-label .switch-text-on {
    opacity: 1;
}
.switch-input:checked + .switch-label .switch-text-off {
    opacity: 0;
}

/* ── Back-to-site link ─────────────────────────────── */
.back-to-site {
    color: var(--admin-accent);
    text-decoration: none;
    font-size: 0.9rem;
}
.back-to-site:hover { text-decoration: underline; }

.publication-panel{padding:18px;margin:20px 0;border:1px solid #d97706;border-radius:8px;background:#fff7ed;color:#422006}.publication-panel[data-state="published"]{border-color:#16a34a;background:#f0fdf4;color:#14532d}.publication-panel p{margin-bottom:12px}.publication-panel>div{display:flex;flex-wrap:wrap;gap:8px}.publication-panel button[hidden]{display:none}

.form-section-header { color: #93c5fd; }
.btn-danger { background: #b91c1c; }
.btn-danger:hover { background: #991b1b; }
.seo-admin-options{margin:12px 0 22px;border:1px solid #cbd5e1;border-radius:8px;padding:14px}
.seo-admin-options summary{cursor:pointer;font-weight:600;color:inherit}
.seo-admin-options label{display:block;margin-top:14px}
.seo-admin-options input,.seo-admin-options textarea{width:100%;box-sizing:border-box;margin-top:6px}
#product-url-preview{display:block;overflow-wrap:anywhere;margin-top:6px}
