/* ═══════════════════════════════════════════════════
   ADMIN PANEL — Dedicated Styles
   ═══════════════════════════════════════════════════ */

/* ── Layout Shell ─────────────────────────────────── */
.admin-layout {
    display: flex;
    min-height: 100vh;
    background: radial-gradient(ellipse at 20% 50%, rgba(var(--primary-rgb), 0.08) 0%, transparent 50%),
        radial-gradient(circle at center, var(--bg-dark) 0%, var(--bg-dark) 100%);
    transition: background 0.3s ease;
}

body.light-mode .admin-layout {
    background: radial-gradient(ellipse at 20% 50%, rgba(var(--primary-rgb), 0.04) 0%, transparent 50%),
        #f1f5f9;
}

/* ── Sidebar ──────────────────────────────────────── */
.admin-sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--glass-bg);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--primary-rgb), 0.3) transparent;
}

.admin-sidebar::-webkit-scrollbar {
    width: 4px;
}

.admin-sidebar::-webkit-scrollbar-thumb {
    background: rgba(var(--primary-rgb), 0.3);
    border-radius: 4px;
}

.sidebar-brand {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-main);
    transition: background 0.2s;
}

.sidebar-brand:hover {
    background: var(--glass-border);
}

.sidebar-brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary) 0%, #4c1d95 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-main);
    flex-shrink: 0;
}

.sidebar-brand-text {
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-brand-img {
    max-height: 42px;
    max-width: 160px;
    object-fit: contain;
    transition: transform 0.3s ease;
    margin-right: 12px;
}

.sidebar-brand:hover .sidebar-brand-img {
    transform: scale(1.05);
}

.sidebar-brand-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: block;
    margin-top: 1px;
}

/* Sidebar Navigation */
.sidebar-nav {
    padding: 0.75rem 0;
    flex: 1;
}

.sidebar-section {
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
}

.sidebar-section-title {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--glass-border);
    padding: 0.75rem 0.75rem 0.4rem;
    user-select: none;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.sidebar-link:hover {
    color: var(--text-main);
    background: var(--glass-border);
}

.sidebar-link.active {
    color: var(--text-main);
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.25) 0%, rgba(var(--primary-rgb), 0.15) 100%);
    border: 1px solid rgba(var(--primary-rgb), 0.3);
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.sidebar-link.active i {
    color: var(--primary-hover, #7c3aed);
}

.sidebar-link .sidebar-badge {
    margin-left: auto;
    background: rgba(var(--primary-rgb), 0.3);
    color: var(--primary-hover);
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-weight: 600;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--glass-border);
}

.sidebar-footer-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    padding: 0.5rem 0;
    transition: color 0.2s;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
}

.sidebar-footer-link:hover {
    color: var(--text-main);
}

/* ── Main Content ─────────────────────────────────── */
.admin-main {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top Header Bar */
.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 50;
    gap: 1rem;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

.topbar-title i {
    color: var(--primary);
    margin-right: 0.5rem;
}

.topbar-breadcrumb {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.topbar-user i {
    color: var(--primary);
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* Content Area */
.admin-content {
    flex: 1;
    padding: 2rem;
    animation: adminFadeIn 0.3s ease;
}

@keyframes adminFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Cards & Panels ───────────────────────────────── */
.admin-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    backdrop-filter: blur(8px);
    transition: border-color 0.2s;
}

.admin-card:hover {
    border-color: var(--glass-border);
}

.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.admin-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    gap: 0.5rem;
}

.admin-card-title i {
    color: var(--primary);
    font-size: 0.9rem;
}

/* ── Custom Tabs (CMS Settings) ───────────────────── */
.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 1.5rem;
    padding: 6px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    width: fit-content;
}

.btn-tab {
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.btn-tab i {
    font-size: 0.9rem;
    opacity: 0.7;
}

.btn-tab:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}

.btn-tab.active {
    color: #fff;
    background: linear-gradient(135deg, var(--primary) 0%, rgba(var(--primary-rgb), 0.6) 100%);
    border-color: rgba(var(--primary-rgb), 0.3);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.2);
}

.btn-tab.active i {
    opacity: 1;
}

body.light-mode .admin-tabs {
    background: #f1f5f9;
}

body.light-mode .btn-tab.active {
    background: var(--primary);
    color: #fff;
}


/* ── Grid System ──────────────────────────────────── */
.admin-grid {
    display: grid;
    gap: 1.5rem;
}

.admin-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.admin-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.admin-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.admin-grid-sidebar {
    grid-template-columns: 380px 1fr;
}

@media (max-width: 1200px) {

    .admin-grid-sidebar,
    .admin-grid-3,
    .admin-grid-4 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .admin-grid-2 {
        grid-template-columns: 1fr;
    }
}

/* ── Stat Cards (Dashboard) ───────────────────────── */
.stat-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s;
}

.stat-card:hover {
    border-color: rgba(var(--primary-rgb), 0.3);
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.stat-icon.purple {
    background: rgba(var(--primary-rgb), 0.15);
    color: var(--primary-hover);
}

.stat-icon.blue {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.stat-icon.green {
    background: rgba(var(--success-rgb), 0.15);
    color: var(--success);
}

.stat-icon.gold {
    background: rgba(var(--gold-rgb), 0.15);
    color: var(--gold);
}

.stat-icon.red {
    background: rgba(var(--danger-rgb), 0.15);
    color: var(--danger);
}

.stat-icon.cyan {
    background: rgba(var(--accent-rgb), 0.15);
    color: var(--accent);
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-main);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Tables ───────────────────────────────────────── */
.admin-table-wrap {
    background: var(--item-bg);
    border-radius: 8px;
    overflow-x: auto;
    border: 1px solid var(--glass-border);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-main);
    min-width: 500px;
}

.admin-table th,
.admin-table td {
    padding: 0.85rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
    vertical-align: middle;
}

.admin-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    background: var(--input-bg);
    white-space: nowrap;
}

.admin-table tbody tr {
    transition: background 0.15s;
}

.admin-table tbody tr:hover {
    background: var(--input-bg);
}

/* ── Forms ─────────────────────────────────────────── */
.admin-input {
    width: 100%;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: var(--input-bg);
    color: var(--text-main);
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.admin-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

.admin-input::placeholder {
    color: var(--text-muted);
}

.admin-select {
    width: 100%;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: var(--input-bg);
    color: var(--text-main);
    font-size: 0.875rem;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.admin-select:focus {
    border-color: var(--primary);
}

.admin-select option {
    background: var(--card-bg);
    color: var(--text-main);
}

.admin-textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: var(--input-bg);
    color: var(--text-main);
    font-size: 0.875rem;
    outline: none;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.admin-textarea:focus {
    border-color: var(--primary);
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

/* ── Buttons ──────────────────────────────────────── */
.btn-admin {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, rgba(var(--primary-rgb), 0.6) 100%);
    color: var(--text-main);
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.4);
}

.btn-secondary {
    background: var(--glass-border);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: var(--glass-border);
}

.btn-danger {
    background: rgba(var(--danger-rgb), 0.1);
    color: var(--danger);
    border: 1px solid rgba(var(--danger-rgb), 0.25);
}

.btn-danger:hover {
    background: rgba(var(--danger-rgb), 0.2);
    box-shadow: 0 0 12px rgba(var(--danger-rgb), 0.2);
}

.btn-success {
    background: rgba(var(--success-rgb), 0.1);
    color: var(--success);
    border: 1px solid rgba(var(--success-rgb), 0.25);
}

.btn-success:hover {
    background: rgba(var(--success-rgb), 0.2);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* ── Badges ───────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    gap: 0.3rem;
}

.badge-purple {
    background: rgba(var(--primary-rgb), 0.15);
    color: var(--primary-hover);
}

.badge-green {
    background: rgba(var(--success-rgb), 0.15);
    color: var(--success);
}

.badge-red {
    background: rgba(var(--danger-rgb), 0.15);
    color: var(--danger);
}

.badge-gold {
    background: rgba(var(--gold-rgb), 0.15);
    color: var(--gold);
}

.badge-blue {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.badge-muted {
    background: var(--glass-border);
    color: var(--text-muted);
}

/* ── Toggle/Switch ────────────────────────────────── */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--glass-border);
    border-radius: 24px;
    transition: background 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

.toggle-switch input:checked+.toggle-slider {
    background: var(--primary);
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(20px);
}

/* ── Toast Notifications ──────────────────────────── */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    border-radius: 10px;
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 280px;
    max-width: 420px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: toastIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    color: var(--text-main);
    font-size: 0.875rem;
}

.toast.toast-out {
    animation: toastOut 0.3s ease forwards;
}

.toast-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.toast-success .toast-icon {
    color: var(--success);
}

.toast-error .toast-icon {
    color: var(--danger);
}

.toast-info .toast-icon {
    color: #60a5fa;
}

.toast-warning .toast-icon {
    color: var(--gold);
}

.toast-success {
    border-left: 3px solid var(--success);
}

.toast-error {
    border-left: 3px solid var(--danger);
}

.toast-info {
    border-left: 3px solid #60a5fa;
}

.toast-warning {
    border-left: 3px solid var(--gold);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

/* ── Modals ────────────────────────────────────────── */
.admin-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalOverlayIn 0.2s ease;
}

.admin-modal {
    background: rgba(var(--bg-dark-rgb), 0.98);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    width: 480px;
    max-width: 92vw;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
    animation: modalIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.admin-modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-modal-title i {
    color: var(--primary);
}

.admin-modal-close,
.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s;
}

.admin-modal-close:hover,
.modal-close:hover {
    color: var(--text-main);
}

.admin-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
}

@keyframes modalOverlayIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ── Search ───────────────────────────────────────── */
.search-group {
    position: relative;
}

.search-group i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.search-group .admin-input {
    padding-left: 2.5rem;
}

/* ── Empty State ──────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state p {
    font-size: 0.9rem;
}

/* ── Item Icon Box ────────────────────────────────── */
.item-icon-box {
    width: 42px;
    height: 42px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.item-icon-box img {
    max-width: 36px;
    max-height: 36px;
    image-rendering: pixelated;
}

/* ── Check/Cross Icons ────────────────────────────── */
.check-yes {
    color: var(--success);
}

.check-no {
    color: var(--glass-border);
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 1024px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
    }

    .mobile-toggle {
        display: block;
    }

    .admin-content {
        padding: 1.25rem;
    }
}

/* ── Utility ──────────────────────────────────────── */
.text-muted {
    color: var(--text-muted);
}

.text-main {
    color: var(--text-main);
}

.text-primary {
    color: var(--primary);
}

.text-gold {
    color: var(--gold);
}

.text-danger {
    color: var(--danger);
}

.text-success {
    color: var(--success);
}

.text-sm {
    font-size: 0.8rem;
}

.text-xs {
    font-size: 0.7rem;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.gap-1 {
    gap: 0.5rem;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-1 {
    flex: 1;
}

.w-full {
    width: 100%;
}

.hidden {
    display: none;
}

/* ── ItemSearchPicker Component ───────────────────── */
.isp-wrapper {
    position: relative;
}

.isp-input-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.isp-search-box {
    position: relative;
    flex: 1;
}

.isp-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}

.isp-input {
    padding-left: 2.5rem !important;
    padding-right: 2.2rem !important;
}

.isp-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    transition: color 0.2s;
}

.isp-clear:hover {
    color: var(--text-main);
}

.isp-preview {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: rgba(var(--primary-rgb), 0.08);
    border: 1px solid rgba(var(--primary-rgb), 0.2);
    border-radius: 8px;
    min-width: 0;
    white-space: nowrap;
}

.isp-preview-label {
    font-size: 0.8rem;
    color: var(--text-main);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

/* Dropdown */
.isp-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: rgba(var(--bg-dark-rgb), 0.98);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 500;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--primary-rgb), 0.3) transparent;
    animation: ispDropIn 0.15s ease;
}

.isp-dropdown::-webkit-scrollbar {
    width: 4px;
}

.isp-dropdown::-webkit-scrollbar-thumb {
    background: rgba(var(--primary-rgb), 0.3);
    border-radius: 4px;
}

@keyframes ispDropIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.isp-result {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.85rem;
    width: 100%;
    background: none;
    border: none;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-main);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
    font-family: inherit;
    font-size: inherit;
}

.isp-result:hover {
    background: rgba(var(--primary-rgb), 0.1);
}

.isp-result:last-child {
    border-bottom: none;
}

.isp-result-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.isp-result-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.isp-result-vnum {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.isp-result-meta {
    margin-left: 0.5rem;
    opacity: 0.6;
}

/* Modal results */
.isp-modal-results {
    max-height: 400px;
    overflow-y: auto;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--primary-rgb), 0.3) transparent;
}

.isp-modal-results::-webkit-scrollbar {
    width: 4px;
}

.isp-modal-results::-webkit-scrollbar-thumb {
    background: rgba(var(--primary-rgb), 0.3);
    border-radius: 4px;
}

.isp-modal-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    width: 100%;
    background: none;
    border: none;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-main);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
    font-family: inherit;
}

.isp-modal-item:hover {
    background: rgba(var(--primary-rgb), 0.12);
}

.isp-modal-item:last-child {
    border-bottom: none;
}

/* ── Item Creator ─────────────────────────────────── */
.creator-sockets-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.creator-bonus-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.creator-bonus-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.creator-bonus-num {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--primary-hover);
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Preview Card */
.preview-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    border: 1px solid var(--glass-border);
}

.preview-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.preview-icon img {
    max-width: 56px;
    max-height: 56px;
}

.preview-info {
    flex: 1;
    min-width: 0;
}

.preview-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-main);
}

.preview-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.preview-price {
    margin-top: 0.4rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.preview-desc {
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: var(--accent);
    font-style: italic;
}

.preview-section {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--glass-border);
}

.preview-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--glass-border);
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.preview-socket,
.preview-attr {
    font-size: 0.82rem;
    color: var(--text-main);
    padding: 0.3rem 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Recent Items */
.recent-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.recent-item:last-child {
    border-bottom: none;
}

.recent-item-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.recent-item-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-main);
}

.recent-item-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 3px;
    flex-wrap: wrap;
}

/* Item Icon Box (shared) */
.item-icon-box {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.item-icon-box img {
    max-width: 100%;
    max-height: 100%;
}

@media (max-width: 768px) {
    .creator-sockets-grid {
        grid-template-columns: 1fr;
    }

    .creator-bonus-row {
        flex-wrap: wrap;
    }
}

/* ── Icon Converter ───────────────────────────────── */
.icon-drop-zone {
    border: 2px dashed var(--glass-border);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(var(--primary-rgb), 0.03);
    margin-bottom: 1rem;
}

.icon-drop-zone:hover,
.icon-drop-zone.drag-over {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.08);
}

.icon-drop-inner i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
    opacity: 0.7;
}

.icon-drop-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-main);
    margin-bottom: 0.4rem;
}

.icon-drop-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.icon-file-list {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 1rem;
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.icon-file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
}

.icon-file-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: var(--glass-border);
    border-radius: 6px;
    font-size: 0.75rem;
}

.icon-file-item i {
    color: var(--primary);
}

.icon-file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.icon-progress-bar-wrap {
    height: 8px;
    background: var(--glass-border);
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.icon-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    width: 0%;
    transition: width 0.3s ease;
}

.icon-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.icon-result-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--item-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    text-align: center;
}

.icon-result-item img {
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
    background: rgba(0, 0, 0, 0.1);
    padding: 2px;
    border-radius: 4px;
}

/* ── Light Mode Fixes ──────────────────────────────── */
body.light-mode .admin-sidebar {
    background: #ffffff;
    box-shadow: 4px 0 24px rgba(30, 41, 59, 0.05);
}

body.light-mode .sidebar-brand:hover {
    background: #f8fafc;
}

body.light-mode .admin-topbar {
    background: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(30, 41, 59, 0.1);
}

body.light-mode .admin-card {
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(30, 41, 59, 0.05);
}

body.light-mode .admin-table th {
    background: #f8fafc;
    color: #475569;
}

body.light-mode .stat-icon.blue { color: #2563eb; background: rgba(37, 99, 235, 0.1); }
body.light-mode .stat-icon.purple { color: #7c3aed; background: rgba(124, 58, 237, 0.1); }
body.light-mode .stat-icon.green { color: #059669; background: rgba(5, 150, 105, 0.1); }
body.light-mode .stat-icon.red { color: #dc2626; background: rgba(220, 38, 38, 0.1); }
body.light-mode .stat-icon.gold { color: #d97706; background: rgba(217, 119, 6, 0.1); }

body.light-mode .admin-modal {
    background: #ffffff;
    box-shadow: 0 20px 50px rgba(30, 41, 59, 0.2);
}

body.light-mode .admin-modal-overlay {
    background: rgba(30, 41, 59, 0.4);
}

body.light-mode .admin-input:focus {
    background: #ffffff;
}

body.light-mode .sidebar-section-title {
    color: #94a3b8;
}
