﻿/* ═══════════════════════════════════════════════════════════
   منو دیجیتال — style.css
   طراحی بر اساس STYLE_GUIDE.md
   ═══════════════════════════════════════════════════════════ */

/* ─── فونت IRANSans ──────────────────────────────────────── */
@font-face {
    font-family: 'IRANSans';
    src: url('../fonts/IRANSansWeb.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'IRANSans';
    src: url('../fonts/IRANSansWeb_Bold.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}

/* ─── CSS Variables ──────────────────────────────────────── */
:root {
    --bg:         #0f172a;
    --bg-2:       #020617;
    --bg-3:       #1e293b;
    --card:       rgba(30, 41, 59, 0.82);
    --text:       #f8fafc;
    --muted:      #94a3b8;
    --accent:     #8b5cf6;
    --accent-2:   #6366f1;
    --accent-h:   #7c3aed;
    --success:    #22c55e;
    --danger:     #ef4444;
    --warning:    #f59e0b;
    --border:     rgba(148, 163, 184, 0.16);
    --radius:     12px;
    --radius-lg:  20px;
    --radius-xl:  24px;
    --sidebar-w:  265px;
    --topbar-h:   64px;
    --shadow:     0 20px 35px rgba(0, 0, 0, 0.28);
    --shadow-sm:  0 4px 16px rgba(0, 0, 0, 0.2);
    --transition: 0.22s ease;
}

/* ─── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }

body {
    font-family: IRANSans, Tahoma, sans-serif;
    color: var(--text);
    direction: rtl;
    min-height: 100vh;
    overflow-x: hidden;
    background:
        radial-gradient(circle at top right, rgba(139,92,246,0.16), transparent 32%),
        radial-gradient(circle at bottom left, rgba(99,102,241,0.12), transparent 35%),
        linear-gradient(135deg, #020617, #0f172a);
    background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; font-size: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }
ul, ol { list-style: none; }

/* ─── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: rgba(15,23,42,0.6); }
::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.35); border-radius: 999px; }

/* ─── Layout ─────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0; right: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: linear-gradient(180deg, rgba(15,23,42,0.96), rgba(2,6,23,0.96));
    border-left: 1px solid var(--border);
    backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: transform var(--transition);
}

.main {
    margin-right: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin var(--transition);
}

/* ─── Sidebar Header ────────────────────────────────────── */
.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 1.4rem 1.2rem 1.2rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-header svg {
    width: 24px; height: 24px;
    stroke: var(--accent);
    flex-shrink: 0;
    filter: drop-shadow(0 0 8px rgba(139,92,246,0.5));
}

.sidebar-header span {
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── Sidebar Nav ───────────────────────────────────────── */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.85rem 0.75rem;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.2); border-radius: 999px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 1rem;
    color: var(--muted);
    border-radius: var(--radius);
    margin-bottom: 3px;
    transition: all var(--transition);
    font-size: 0.9rem;
    font-weight: 500;
}

.nav-item svg {
    width: 18px; height: 18px;
    flex-shrink: 0;
    stroke: currentColor;
}

.nav-item:hover {
    background: rgba(139,92,246,0.1);
    color: var(--text);
}

.nav-item.active {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: #fff;
    box-shadow: 0 8px 20px rgba(99,102,241,0.28);
}

.nav-item.active svg { stroke: #fff; }

.nav-divider {
    height: 1px;
    background: var(--border);
    margin: 0.6rem 0.25rem;
}

/* ─── Sidebar Footer ────────────────────────────────────── */
.sidebar-footer {
    padding: 0.85rem 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
    overflow: hidden;
}

.user-info svg {
    width: 32px; height: 32px;
    stroke: var(--accent);
    flex-shrink: 0;
}

.user-name {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    display: block;
    font-size: 0.72rem;
    color: var(--muted);
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    border-radius: var(--radius);
    color: var(--muted);
    transition: all var(--transition);
    flex-shrink: 0;
}

.btn-logout:hover {
    background: rgba(239,68,68,0.15);
    color: var(--danger);
}

.btn-logout svg { width: 18px; height: 18px; stroke: currentColor; }

/* ─── Topbar ─────────────────────────────────────────────── */
.topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-h);
    background: rgba(2,6,23,0.82);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.75rem;
    z-index: 100;
}

.topbar-title {
    flex: 1;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* خط رنگی کنار عنوان */
.topbar-title::before {
    content: "";
    width: 4px; height: 22px;
    border-radius: 999px;
    background: linear-gradient(180deg, #8b5cf6, #6366f1);
    box-shadow: 0 0 12px rgba(139,92,246,0.5);
    display: inline-block;
    flex-shrink: 0;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    border-radius: var(--radius);
    color: var(--muted);
    transition: all var(--transition);
}

.menu-toggle:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.menu-toggle svg { width: 20px; height: 20px; stroke: currentColor; }

/* ─── Content Area ───────────────────────────────────────── */
.content-area {
    flex: 1;
    padding: 1.75rem;
    max-width: 1200px;
    width: 100%;
}

/* ─── Overlay mobile ─────────────────────────────────────── */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(2px);
    z-index: 190;
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar { transform: translateX(100%); }
    .sidebar.open { transform: translateX(0); }
    .main { margin-right: 0; }
    .menu-toggle { display: flex; }
    .overlay.open { display: block; }
    .content-area { padding: 1rem; }
}

/* ═══════════════════════════════════════════════════════════
   تیکه دوم — بخش اول: Buttons، Forms، Card
   ═══════════════════════════════════════════════════════════ */

/* ─── Buttons ────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 700;
    transition: all var(--transition);
    white-space: nowrap;
    cursor: pointer;
}

.btn svg { width: 16px; height: 16px; stroke: currentColor; flex-shrink: 0; }
.btn:active { transform: scale(0.97); }

.btn-primary {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: #fff;
    border: none;
    box-shadow: 0 8px 20px rgba(99,102,241,0.28);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(99,102,241,0.38);
}

.btn-ghost {
    background: rgba(148,163,184,0.08);
    color: var(--muted);
    border: 1px solid var(--border);
}
.btn-ghost:hover {
    background: rgba(148,163,184,0.14);
    color: var(--text);
    border-color: rgba(148,163,184,0.28);
}

.btn-danger {
    background: rgba(239,68,68,0.08);
    color: var(--danger);
    border: 1px solid rgba(239,68,68,0.22);
}
.btn-danger:hover {
    background: rgba(239,68,68,0.16);
    box-shadow: 0 4px 14px rgba(239,68,68,0.2);
}

.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 0.32rem 0.7rem; font-size: 0.8rem; border-radius: 8px; }
.btn-sm svg { width: 14px; height: 14px; }

/* ─── Forms ──────────────────────────────────────────────── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 1.1rem;
}

.form-group label {
    font-size: 0.83rem;
    color: var(--muted);
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    background: rgba(15,23,42,0.92);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    padding: 0.72rem 0.9rem;
    outline: none;
    transition: all var(--transition);
    width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: rgba(139,92,246,0.8);
    box-shadow: 0 0 0 4px rgba(139,92,246,0.12);
}

.form-group input[type="file"] {
    padding: 0.5rem 0.9rem;
    color: var(--muted);
    cursor: pointer;
}

.form-group textarea {
    resize: vertical;
    min-height: 76px;
}

.form-group select { cursor: pointer; }

.form-hint {
    font-size: 0.76rem;
    color: var(--muted);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 520px) {
    .form-row { grid-template-columns: 1fr; }
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text);
}

.checkbox-label input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

/* Input با آیکون */
.input-icon { position: relative; }

.input-icon svg {
    position: absolute;
    right: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px; height: 16px;
    stroke: var(--muted);
    pointer-events: none;
}

.input-icon input {
    background: rgba(15,23,42,0.92);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    padding: 0.72rem 0.9rem;
    padding-right: 2.4rem;
    outline: none;
    width: 100%;
    transition: all var(--transition);
}

.input-icon input:focus {
    border-color: rgba(139,92,246,0.8);
    box-shadow: 0 0 0 4px rgba(139,92,246,0.12);
}

.form-control-inline {
    background: rgba(15,23,42,0.92);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    padding: 0.5rem 0.85rem;
    outline: none;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all var(--transition);
}

.form-control-inline:focus {
    border-color: rgba(139,92,246,0.8);
}

/* ─── Card ───────────────────────────────────────────────── */
.card {
    background: linear-gradient(180deg, rgba(30,41,59,0.92), rgba(15,23,42,0.82));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 1.1rem 1.4rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(2,6,23,0.3);
}

.card-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 700;
}

.card-header h3 svg { width: 18px; height: 18px; stroke: var(--accent); }

.card-body { padding: 1.4rem; }
.card-body.p-0 { padding: 0; }

/* ═══════════════════════════════════════════════════════════
   تیکه دوم — بخش دوم: Table، Badge، Modal، Toast
   ═══════════════════════════════════════════════════════════ */

/* ─── Table ──────────────────────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.88rem;
    background: rgba(30,41,59,0.55);
    backdrop-filter: blur(14px);
}

.data-table thead tr {
    background: rgba(2,6,23,0.6);
}

.data-table th {
    padding: 0.9rem 1.1rem;
    text-align: right;
    color: #cbd5e1;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 0.85rem 1.1rem;
    color: #e2e8f0;
    font-size: 0.88rem;
    border-bottom: 1px solid rgba(148,163,184,0.08);
    vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr {
    transition: background var(--transition);
}

.data-table tbody tr:hover {
    background: rgba(139,92,246,0.08);
}

.actions-cell {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

.table-thumb {
    width: 42px; height: 42px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid var(--border);
}

.table-thumb-placeholder {
    width: 42px; height: 42px;
    border-radius: 10px;
    background: rgba(148,163,184,0.08);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}

.table-thumb-placeholder svg { width: 18px; height: 18px; stroke: currentColor; }

/* ─── Badge ──────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(139,92,246,0.15);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid rgba(139,92,246,0.2);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.7rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
}

.status-badge.active {
    background: rgba(34,197,94,0.12);
    color: var(--success);
    border: 1px solid rgba(34,197,94,0.22);
}

.status-badge.inactive {
    background: rgba(148,163,184,0.08);
    color: var(--muted);
    border: 1px solid var(--border);
}

.role-badge {
    display: inline-flex;
    padding: 0.22rem 0.7rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
}

.role-badge.superadmin {
    background: rgba(139,92,246,0.15);
    color: var(--accent);
    border: 1px solid rgba(139,92,246,0.25);
}

.role-badge.restaurant_manager {
    background: rgba(99,102,241,0.12);
    color: #818cf8;
    border: 1px solid rgba(99,102,241,0.22);
}

/* ─── Modal ──────────────────────────────────────────────── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2,6,23,0.78);
    backdrop-filter: blur(8px);
    z-index: 300;
}

.modal-backdrop.hidden { display: none; }

#modalContainer {
    position: fixed;
    inset: 0;
    z-index: 301;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    pointer-events: none;
}

#modalContainer:not(:empty) { pointer-events: auto; }

.modal {
    background: linear-gradient(180deg, rgba(30,41,59,0.98), rgba(15,23,42,0.98));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    animation: modalIn 0.2s ease;
}

.modal.modal-lg { max-width: 640px; }

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.94) translateY(-12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.4rem;
    border-bottom: 1px solid var(--border);
    background: rgba(2,6,23,0.4);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 1rem;
    font-weight: 700;
    background: linear-gradient(135deg, #f8fafc, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-header > button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border-radius: 8px;
    color: var(--muted);
    transition: all var(--transition);
}

.modal-header > button:hover {
    background: rgba(239,68,68,0.12);
    color: var(--danger);
}

.modal-header > button svg { width: 16px; height: 16px; stroke: currentColor; }

.modal-body {
    padding: 1.4rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1rem 1.4rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
    background: rgba(2,6,23,0.3);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    flex-shrink: 0;
}

/* ─── Toast ──────────────────────────────────────────────── */
#toastContainer {
    position: fixed;
    bottom: 1.75rem;
    left: 1.75rem;
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 1.1rem;
    border-radius: 14px;
    font-size: 0.88rem;
    font-weight: 600;
    min-width: 230px;
    max-width: 340px;
    animation: toastIn 0.25s ease;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    color: #fff;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.toast.success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.toast.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.toast.warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.toast svg { width: 18px; height: 18px; stroke: currentColor; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════
   تیکه دوم — بخش سوم — قسمت اول: Dashboard، Items، Filter
   ═══════════════════════════════════════════════════════════ */

/* ─── Page Actions ───────────────────────────────────────── */
.page-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.4rem;
    flex-wrap: wrap;
}

/* ─── Dashboard Stats ────────────────────────────────────── */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: linear-gradient(180deg, rgba(30,41,59,0.92), rgba(15,23,42,0.82));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-sm);
    padding: 1.3rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all var(--transition);
}

.stat-card:hover {
    border-color: rgba(139,92,246,0.35);
    transform: translateY(-3px);
    box-shadow: 0 16px 32px rgba(99,102,241,0.18);
}

.stat-icon {
    width: 50px; height: 50px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(139,92,246,0.2), rgba(99,102,241,0.15));
    border: 1px solid rgba(139,92,246,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 22px; height: 22px;
    stroke: var(--accent);
    filter: drop-shadow(0 0 6px rgba(139,92,246,0.4));
}

.stat-info { display: flex; flex-direction: column; gap: 0.2rem; }

.stat-num {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
    background: linear-gradient(135deg, #f8fafc, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label { font-size: 0.78rem; color: var(--muted); font-weight: 500; }

/* ─── Restaurant Hero ────────────────────────────────────── */
.restaurant-hero {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    background: linear-gradient(135deg, rgba(139,92,246,0.1), rgba(99,102,241,0.06));
    border: 1px solid rgba(139,92,246,0.2);
    border-radius: var(--radius-lg);
    padding: 1.6rem;
    backdrop-filter: blur(16px);
}

.restaurant-logo {
    width: 76px; height: 76px;
    border-radius: var(--radius);
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(139,92,246,0.3);
    box-shadow: 0 0 20px rgba(139,92,246,0.2);
}

.restaurant-logo-placeholder {
    width: 76px; height: 76px;
    border-radius: var(--radius);
    background: rgba(139,92,246,0.1);
    border: 2px solid rgba(139,92,246,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.restaurant-logo-placeholder svg { width: 34px; height: 34px; stroke: var(--accent); }

.restaurant-hero h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    background: linear-gradient(135deg, #f8fafc, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.slug-badge {
    font-size: 0.76rem;
    background: rgba(15,23,42,0.8);
    color: var(--muted);
    padding: 0.18rem 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    direction: ltr;
    display: inline-block;
    font-family: monospace;
}

/* ─── Filter Tabs ────────────────────────────────────────── */
.filter-tabs {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    flex: 1;
}

.filter-btn {
    padding: 0.38rem 0.9rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
    background: rgba(148,163,184,0.07);
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.filter-btn:hover {
    color: var(--text);
    background: rgba(148,163,184,0.12);
}

.filter-btn.active {
    background: linear-gradient(135deg, rgba(139,92,246,0.2), rgba(99,102,241,0.15));
    color: var(--accent);
    border-color: rgba(139,92,246,0.35);
    box-shadow: 0 4px 12px rgba(139,92,246,0.15);
}

/* ─── Items Grid ─────────────────────────────────────────── */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
    gap: 1rem;
}

.item-card {
    background: linear-gradient(180deg, rgba(30,41,59,0.92), rgba(15,23,42,0.82));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all var(--transition);
    backdrop-filter: blur(16px);
}

.item-card:hover {
    border-color: rgba(139,92,246,0.35);
    transform: translateY(-3px);
    box-shadow: 0 16px 32px rgba(0,0,0,0.3);
}

.item-card.inactive { opacity: 0.55; }

.item-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: rgba(15,23,42,0.8);
    flex-shrink: 0;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.item-card:hover .item-image img { transform: scale(1.05); }

.item-image-placeholder {
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(139,92,246,0.06), rgba(99,102,241,0.04));
}

.item-image-placeholder svg { width: 38px; height: 38px; stroke: rgba(139,92,246,0.3); }

.item-inactive-badge {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    background: rgba(2,6,23,0.82);
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    backdrop-filter: blur(8px);
}

.item-info {
    padding: 0.9rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.item-category { font-size: 0.74rem; color: var(--muted); font-weight: 600; }

.item-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}

.item-desc {
    font-size: 0.78rem;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

.item-price {
    font-size: 0.95rem;
    font-weight: 700;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-top: auto;
    padding-top: 0.45rem;
}

.item-actions {
    display: flex;
    gap: 0.4rem;
    padding: 0.65rem 0.9rem;
    border-top: 1px solid var(--border);
    background: rgba(2,6,23,0.25);
}

/* ═══════════════════════════════════════════════════════════
   تیکه دوم — بخش سوم — قسمت دوم: Login، Empty، Loading، Utils
   ═══════════════════════════════════════════════════════════ */

/* ─── Login Page ─────────────────────────────────────────── */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
    background:
        radial-gradient(circle at top right, rgba(139,92,246,0.25), transparent 34%),
        radial-gradient(circle at bottom left, rgba(99,102,241,0.18), transparent 36%),
        linear-gradient(135deg, #020617, #0f172a);
    background-attachment: fixed;
}

.login-box {
    background: linear-gradient(180deg, rgba(30,41,59,0.92), rgba(15,23,42,0.88));
    border: 1px solid rgba(148,163,184,0.2);
    border-radius: var(--radius-xl);
    padding: 2.5rem 2rem;
    width: 92%;
    max-width: 410px;
    backdrop-filter: blur(18px);
    box-shadow: 0 30px 60px rgba(0,0,0,0.45);
    position: relative;
    overflow: hidden;
}

/* لکه‌های تزئینی */
.login-box::before {
    content: "";
    position: absolute;
    top: -80px; left: -80px;
    width: 180px; height: 180px;
    background: radial-gradient(circle, rgba(139,92,246,0.36), transparent 70%);
    pointer-events: none;
}

.login-box::after {
    content: "";
    position: absolute;
    right: -90px; bottom: -90px;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(99,102,241,0.25), transparent 70%);
    pointer-events: none;
}

.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.login-logo svg {
    width: 44px; height: 44px;
    stroke: var(--accent);
    filter: drop-shadow(0 0 14px rgba(139,92,246,0.6));
}

.login-logo h1 {
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-logo p { font-size: 0.82rem; color: var(--muted); }

.login-box .form-group,
.login-box .btn-block {
    position: relative;
    z-index: 1;
}

.captcha-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.captcha-row input { flex: 1; }

.captcha-row img {
    height: 44px;
    border-radius: var(--radius);
    cursor: pointer;
    border: 1px solid var(--border);
    flex-shrink: 0;
    transition: opacity var(--transition);
}

.captcha-row img:hover { opacity: 0.8; }

/* ─── Alert ──────────────────────────────────────────────── */
.alert {
    padding: 0.8rem 1rem;
    border-radius: var(--radius);
    font-size: 0.88rem;
    margin-bottom: 1.1rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.alert-error {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.28);
    color: #fca5a5;
}

/* ─── Empty State ────────────────────────────────────────── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    padding: 4.5rem 1rem;
    color: var(--muted);
    text-align: center;
}

.empty-state svg {
    width: 52px; height: 52px;
    stroke: rgba(148,163,184,0.25);
}

.empty-state p { font-size: 0.95rem; color: var(--muted); }

/* ─── Loading Spinner ────────────────────────────────────── */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5rem;
}

.loading-spinner svg {
    width: 34px; height: 34px;
    stroke: var(--accent);
    animation: spin 0.9s linear infinite;
    filter: drop-shadow(0 0 8px rgba(139,92,246,0.5));
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Utilities ──────────────────────────────────────────── */
.mt-4  { margin-top: 1rem; }
.mt-8  { margin-top: 2rem; }
.text-muted { color: var(--muted); }
.text-sm    { font-size: 0.82rem; }
.hidden     { display: none !important; }

code {
    font-family: monospace;
    font-size: 0.82rem;
    background: rgba(15,23,42,0.8);
    color: var(--accent);
    padding: 0.1rem 0.4rem;
    border-radius: 5px;
    border: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════════════════
   بخش تکمیلی: جزئیات مدرن و خفن
   ═══════════════════════════════════════════════════════════ */

/* ─── Glow روی کارت‌های hover ───────────────────────────── */
.stat-card:hover .stat-icon {
    box-shadow: 0 0 20px rgba(139,92,246,0.35);
}

/* ─── Topbar عنوان صفحه ──────────────────────────────────── */
#pageTitle {
    background: linear-gradient(135deg, #f8fafc, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── سایدبار: hover گلو روی آیکون active ───────────────── */
.nav-item.active {
    position: relative;
    overflow: hidden;
}

.nav-item.active::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.08), transparent);
    pointer-events: none;
}

/* ─── جدول: ردیف اول گوشه گرد ───────────────────────────── */
.data-table thead tr th:first-child { border-radius: 0 var(--radius) 0 0; }
.data-table thead tr th:last-child  { border-radius: var(--radius) 0 0 0; }

/* ─── Divider با gradient ────────────────────────────────── */
.nav-divider {
    background: linear-gradient(90deg, transparent, rgba(139,92,246,0.3), transparent);
    height: 1px;
    border: none;
}

/* ─── Input focus glow ───────────────────────────────────── */
.input-icon input:focus + svg,
.input-icon input:focus ~ svg {
    stroke: var(--accent);
}

/* ─── دکمه logout pulse ──────────────────────────────────── */
.btn-logout:hover svg {
    animation: pulse 0.6s ease;
}

@keyframes pulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ─── Page transition ────────────────────────────────────── */
.content-area > * {
    animation: fadeUp 0.22s ease;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Shimmer loading skeleton ───────────────────────────── */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(30,41,59,0.5) 25%,
        rgba(139,92,246,0.08) 50%,
        rgba(30,41,59,0.5) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: var(--radius);
}

@keyframes shimmer {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
}

/* ─── Glassmorphism روی topbar هنگام اسکرول ─────────────── */
.topbar {
    transition: box-shadow var(--transition);
}

.topbar.scrolled {
    box-shadow: 0 4px 30px rgba(0,0,0,0.4);
    border-bottom-color: rgba(139,92,246,0.15);
}

/* ─── Item card: نوار رنگی بالا ──────────────────────────── */
.item-card::before {
    content: "";
    display: block;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    opacity: 0;
    transition: opacity var(--transition);
}

.item-card:hover::before { opacity: 1; }

/* ─── Stat card: خط رنگی چپ ─────────────────────────────── */
.stat-card {
    border-right: 3px solid transparent;
    transition: all var(--transition);
}

.stat-card:hover {
    border-right-color: var(--accent);
}

/* ─── Modal backdrop blur بیشتر ─────────────────────────── */
.modal-backdrop {
    transition: opacity 0.2s ease;
}

/* ─── Btn primary: shimmer effect ───────────────────────── */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: "";
    position: absolute;
    top: -50%; left: -60%;
    width: 40%; height: 200%;
    background: rgba(255,255,255,0.12);
    transform: skewX(-20deg);
    transition: left 0.5s ease;
    pointer-events: none;
}

.btn-primary:hover::after { left: 120%; }

/* ─── Table action buttons: tooltip-like ────────────────── */
.btn-sm {
    position: relative;
}

/* ─── Status badge: نقطه زنده ────────────────────────────── */
.status-badge.active::before {
    content: "";
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--success);
    display: inline-block;
    margin-left: 4px;
    box-shadow: 0 0 6px var(--success);
    animation: blink 2s ease infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}

/* ─── Upload progress overlay ────────────────────────────── */
#uploadProgress .progress-card {
    animation: modalIn 0.2s ease;
}

/* ─── Responsive table: اسکرول افقی ─────────────────────── */
.card .card-body.p-0 {
    overflow-x: auto;
}

/* ─── Mobile: فاصله پایین برای toast ─────────────────────── */
@media (max-width: 600px) {
    #toastContainer {
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
    }
    .toast {
        max-width: 100%;
        min-width: unset;
    }
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
    }
    .items-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 420px) {
    .dashboard-grid,
    .items-grid {
        grid-template-columns: 1fr;
    }
}

/* ─── Item discount badge & price ───────────────────────── */
.item-discount-badge {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(239,68,68,0.4);
}

.item-price-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.45rem;
    flex-wrap: wrap;
}

.item-price-old {
    font-size: 0.78rem;
    color: var(--muted);
    text-decoration: line-through;
}

/* ─── Cropper overrides ──────────────────────────────────── */
.cropper-view-box,
.cropper-face {
    border-radius: 0;
}

/* ─── Item toggle switch ─────────────────────────────────── */
.item-toggle-btn {
    width: 36px; height: 20px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    transition: background 0.22s;
    padding: 2px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.item-toggle-btn.on  { background: rgba(34,197,94,0.85); }
.item-toggle-btn.off { background: rgba(148,163,184,0.35); }

.toggle-thumb {
    width: 16px; height: 16px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    transition: transform 0.22s;
    display: block;
}
.item-toggle-btn.on  .toggle-thumb { transform: translateX(-16px); }
.item-toggle-btn.off .toggle-thumb { transform: translateX(0); }

/* drag handle cursor */
.item-card[draggable="true"] { cursor: grab; }
.item-card[draggable="true"]:active { cursor: grabbing; }

/* ─── Items Toolbar ──────────────────────────────────────── */
.items-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(15,23,42,0.92);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem 0.85rem;
    flex: 1;
    min-width: 200px;
    transition: border-color var(--transition);
}

.search-box:focus-within {
    border-color: rgba(139,92,246,0.8);
    box-shadow: 0 0 0 3px rgba(139,92,246,0.1);
}

.search-box svg { width:16px;height:16px;stroke:var(--muted);flex-shrink:0; }

.search-box input {
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 0.88rem;
    width: 100%;
    padding: 0;
}

.search-box input::placeholder { color: var(--muted); }

.status-filters {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

/* ─── Rate Limit / Login ─────────────────────────────────── */
.alert-blocked {
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.35);
    color: #fca5a5;
    padding: 1rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 1.1rem;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%,100%{transform:translateX(0)}
    25%{transform:translateX(-6px)}
    75%{transform:translateX(6px)}
}

.attempts-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.attempt-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.attempt-dot.ok   { background: var(--success); box-shadow: 0 0 6px rgba(34,197,94,0.5); }
.attempt-dot.used { background: rgba(239,68,68,0.5); }

/* ─── Sortable drag states ───────────────────────────────── */
.sortable-ghost {
    opacity: 0.35;
    background: rgba(139,92,246,0.15) !important;
    border: 2px dashed rgba(139,92,246,0.5) !important;
}

.sortable-chosen {
    box-shadow: 0 12px 32px rgba(139,92,246,0.35) !important;
    transform: scale(1.03) !important;
    border-color: rgba(139,92,246,0.6) !important;
    z-index: 10;
}

.sortable-drag {
    opacity: 0.95;
    cursor: grabbing !important;
}

/* cursor نشان‌دهنده drag */
.items-grid .item-card,
.data-table tbody tr[data-id] {
    cursor: grab;
}

/* ─── View Toggle ────────────────────────────────────────── */
.view-toggle {
    display: flex;
    gap: 0.25rem;
    background: rgba(15,23,42,0.8);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3px;
    flex-shrink: 0;
}

.view-btn {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--muted);
    transition: all var(--transition);
    border: none;
    background: none;
    cursor: pointer;
}

.view-btn svg { width: 16px; height: 16px; stroke: currentColor; }
.view-btn:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.view-btn.active { background: linear-gradient(135deg, #8b5cf6, #6366f1); color: #fff; }

/* ─── Items List View ────────────────────────────────────── */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.item-row {
    background: linear-gradient(135deg, rgba(30,41,59,0.9), rgba(15,23,42,0.85));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    transition: all var(--transition);
    cursor: grab;
}

.item-row:hover {
    border-color: rgba(139,92,246,0.35);
    background: linear-gradient(135deg, rgba(30,41,59,0.95), rgba(15,23,42,0.9));
}

.item-row.inactive { opacity: 0.55; }

/* drag handle */
.item-row-drag {
    color: var(--muted);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    cursor: grab;
}
.item-row-drag svg { width: 16px; height: 16px; stroke: currentColor; }

/* thumbnail */
.item-row-img {
    width: 48px; height: 48px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(15,23,42,0.8);
    border: 1px solid var(--border);
}

.item-row-img img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
}

.item-row-img-ph {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
}
.item-row-img-ph svg { width: 20px; height: 20px; stroke: var(--muted); }

/* info */
.item-row-info { flex: 1; min-width: 0; }
.item-row-name { font-size: 0.9rem; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-row-cat  { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }

/* price */
.item-row-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
    min-width: 100px;
    text-align: left;
}

/* status */
.item-row-status {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
}

/* actions */
.item-row-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

/* موبایل */
@media (max-width: 600px) {
    .item-row-price { display: none; }
    .item-row-status { display: none; }
}

/* ─── Switch Component ───────────────────────────────────── */
.switch-group { margin-bottom: 1rem; }

.switch-label {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    cursor: pointer;
    user-select: none;
}

.switch-input { display: none; }

.switch-track {
    position: relative;
    width: 44px; height: 24px;
    background: rgba(148,163,184,0.25);
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.2);
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.switch-knob {
    position: absolute;
    top: 3px; right: 3px;
    width: 16px; height: 16px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    transition: all 0.25s ease;
}

.switch-input:checked + .switch-track {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border-color: rgba(139,92,246,0.5);
    box-shadow: 0 0 12px rgba(139,92,246,0.3);
}

.switch-input:checked + .switch-track .switch-knob {
    right: auto;
    left: 3px;
}

.switch-text {
    font-size: 0.9rem;
    color: var(--text);
    font-weight: 500;
}

/* drag handle در جدول */
.drag-handle {
    cursor: grab;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    border-radius: 4px;
    transition: color var(--transition);
}
.drag-handle:hover { color: var(--accent); }
.drag-handle svg { width: 16px; height: 16px; stroke: currentColor; }

/* ─── Fix: items-grid در صفحه آیتم‌ها ───────────────────── */
#itemsGrid.items-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
    gap: 1rem !important;
}

#itemsGrid.items-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
}

/* ─── Star / Featured Button ─────────────────────────────── */
.star-btn {
    width: 30px; height: 30px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    line-height: 1;
}

.star-btn:hover {
    background: rgba(245,158,11,0.12);
    border-color: rgba(245,158,11,0.4);
    color: #fbbf24;
    transform: scale(1.15);
}

.star-btn.on {
    background: rgba(245,158,11,0.15);
    border-color: rgba(245,158,11,0.5);
    color: #f59e0b;
    box-shadow: 0 0 10px rgba(245,158,11,0.3);
    text-shadow: 0 0 8px rgba(245,158,11,0.6);
}

/* ─── Image Editor ───────────────────────────────────────── */
.ie-tabs{display:flex;gap:0.5rem;margin-bottom:1.25rem;flex-wrap:wrap;}
.ie-tab{display:inline-flex;align-items:center;gap:0.45rem;padding:0.55rem 1.1rem;border-radius:var(--radius);font-size:0.88rem;font-weight:600;color:var(--muted);background:rgba(148,163,184,0.07);border:1px solid var(--border);cursor:pointer;transition:all var(--transition);}
.ie-tab:hover{color:var(--text);background:rgba(148,163,184,0.12);}
.ie-tab.active{background:linear-gradient(135deg,rgba(139,92,246,0.2),rgba(99,102,241,0.15));color:var(--accent);border-color:rgba(139,92,246,0.4);}
.ie-tab svg{width:16px;height:16px;stroke:currentColor;}

.ie-panel{display:none;}
.ie-panel.active{display:block;}

.ie-dropzone{border:2px dashed var(--border);border-radius:var(--radius-lg);padding:2.5rem 1rem;text-align:center;cursor:pointer;transition:all var(--transition);background:rgba(15,23,42,0.4);}
.ie-dropzone:hover,.ie-dropzone.drag-over{border-color:rgba(139,92,246,0.6);background:rgba(139,92,246,0.06);}
.ie-dropzone svg{width:40px;height:40px;stroke:var(--muted);margin-bottom:0.75rem;}
.ie-drop-text{font-size:0.9rem;font-weight:600;color:var(--text);margin-bottom:0.35rem;}
.ie-drop-hint{font-size:0.78rem;color:var(--muted);}

.ie-compare{display:grid;grid-template-columns:1fr auto 1fr;gap:0.75rem;align-items:center;margin-top:1.25rem;}
.ie-compare-side{position:relative;display:flex;flex-direction:column;gap:0.5rem;}
.ie-compare-label{font-size:0.78rem;font-weight:700;color:var(--muted);text-align:center;}
.ie-img-preview{width:100%;aspect-ratio:1/1;object-fit:contain;border-radius:var(--radius);border:1px solid var(--border);background:rgba(15,23,42,0.6);}
.ie-compress-placeholder{width:100%;aspect-ratio:1/1;border-radius:var(--radius);border:1px solid var(--border);background:rgba(15,23,42,0.6);display:flex;align-items:center;justify-content:center;}
.ie-spin{width:28px;height:28px;stroke:var(--accent);animation:spin 1s linear infinite;}
.ie-compare-arrow svg{width:22px;height:22px;stroke:var(--muted);}

.ie-size-badge{text-align:center;font-size:0.8rem;font-weight:700;color:var(--muted);padding:0.3rem 0.6rem;background:rgba(148,163,184,0.08);border-radius:999px;border:1px solid var(--border);}
.ie-size-badge.success{color:var(--success);background:rgba(34,197,94,0.1);border-color:rgba(34,197,94,0.25);}

.ie-saving-badge{display:flex;align-items:center;gap:0.5rem;padding:0.75rem 1rem;background:rgba(34,197,94,0.1);border:1px solid rgba(34,197,94,0.25);border-radius:var(--radius);margin-top:1rem;font-size:0.88rem;font-weight:700;color:var(--success);}
.ie-saving-badge svg{width:18px;height:18px;stroke:currentColor;}

@media(max-width:500px){.ie-compare{grid-template-columns:1fr;}.ie-compare-arrow{display:none;}}

/* ─── Image Enhance (Beautify) ───────────────────────────── */
.ie-enhance-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:0.6rem;margin:1rem 0;}
.ie-effect-card{border:2px solid var(--border);border-radius:var(--radius);overflow:hidden;cursor:pointer;transition:all var(--transition);background:rgba(15,23,42,0.6);position:relative;}
.ie-effect-card:hover{border-color:rgba(139,92,246,0.5);transform:translateY(-2px);box-shadow:0 8px 20px rgba(99,102,241,0.2);}
.ie-effect-card.selected{border-color:var(--accent);box-shadow:0 0 0 3px rgba(139,92,246,0.25);}
.ie-effect-thumb{width:100%;aspect-ratio:1/1;object-fit:cover;display:block;transition:filter 0.3s;}
.ie-effect-name{font-size:0.74rem;font-weight:700;color:var(--text);text-align:center;padding:0.4rem 0.3rem;background:rgba(2,6,23,0.7);}
.ie-effect-card.selected .ie-effect-name{color:var(--accent);}
.ie-effect-check{position:absolute;top:5px;right:5px;width:20px;height:20px;border-radius:50%;background:var(--accent);display:none;align-items:center;justify-content:center;box-shadow:0 2px 8px rgba(139,92,246,0.5);}
.ie-effect-card.selected .ie-effect-check{display:flex;}
.ie-effect-check svg{width:12px;height:12px;stroke:#fff;}
.ie-enhance-preview-wrap{display:grid;grid-template-columns:1fr auto 1fr;gap:0.75rem;align-items:start;margin:1rem 0;}
.ie-enhance-side{display:flex;flex-direction:column;gap:0.4rem;}
.ie-enhance-canvas{width:100%;border-radius:var(--radius);border:1px solid var(--border);display:block;background:rgba(15,23,42,0.6);}
.ie-intensity-row{display:flex;align-items:center;gap:0.75rem;margin:0.75rem 0;}
.ie-intensity-row label{font-size:0.82rem;color:var(--muted);white-space:nowrap;font-weight:600;}
.ie-intensity-row input[type=range]{flex:1;accent-color:var(--accent);height:4px;cursor:pointer;}
.ie-intensity-val{font-size:0.82rem;font-weight:700;color:var(--accent);min-width:2.5rem;text-align:center;}
@media(max-width:500px){.ie-enhance-preview-wrap{grid-template-columns:1fr;}.ie-enhance-grid{grid-template-columns:repeat(3,1fr);}}

/* ─── Jalali Date Picker ─────────────────────────────────── */
.jalali-date-wrapper { position: relative; width: 100%; }

.jalali-datepicker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.jalali-datepicker-header button {
    border: 1px solid var(--border);
    background: rgba(148,163,184,0.08);
    color: var(--muted);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    cursor: pointer;
    font-size: 11px;
    transition: all var(--transition);
}

.jalali-datepicker-header button:hover {
    background: rgba(139,92,246,0.15);
    color: var(--accent);
    border-color: rgba(139,92,246,0.3);
}

.jalali-datepicker-title {
    font-weight: 700;
    font-size: 13px;
    color: var(--text);
}

.jalali-weekdays,
.jalali-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

.jalali-weekdays div {
    text-align: center;
    font-size: 11px;
    color: var(--muted);
    padding: 5px 0;
}

.jalali-day {
    border: none;
    background: rgba(148,163,184,0.06);
    color: #cbd5e1;
    border-radius: 8px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    width: 100%;
    transition: all var(--transition);
}

.jalali-day:hover { background: rgba(139,92,246,0.15); color: var(--accent); }

.jalali-day.is-today {
    border: 1px solid rgba(139,92,246,0.5);
    color: var(--accent);
    background: rgba(139,92,246,0.08);
}

.jalali-day.is-selected {
    background: linear-gradient(135deg, #8b5cf6, #6366f1) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(139,92,246,0.35);
}

.jalali-day.is-muted {
    opacity: 0;
    cursor: default;
    pointer-events: none;
}

/* input نمایش تاریخ */
.jalali-input-display {
    background: rgba(15,23,42,0.92);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    padding: 0.65rem 0.9rem;
    width: 100%;
    cursor: pointer;
    font-size: 0.88rem;
    transition: all var(--transition);
    text-align: right;
}

.jalali-input-display:focus,
.jalali-input-display.open {
    border-color: rgba(139,92,246,0.8);
    box-shadow: 0 0 0 3px rgba(139,92,246,0.12);
    outline: none;
}

@media (max-width: 600px) {
    .jalali-datepicker {
        right: auto;
        left: 0;
        width: min(290px, 90vw);
    }
}

/* ─── Announcement nav badge ─────────────────────────────── */
.ann-nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    margin-right: auto;
    box-shadow: 0 0 8px rgba(239,68,68,0.5);
    animation: blink 2s ease infinite;
}

/* ─── Time Picker Drum ───────────────────────────────────── */
.tp-item {
    padding: 7px 4px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #94a3b8;
    transition: all 0.15s;
    user-select: none;
}

.tp-item:hover {
    background: rgba(139,92,246,0.12);
    color: var(--text);
}

.tp-item.tp-sel {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(139,92,246,0.35);
}

.tp-drum {
    scrollbar-width: thin;
    scrollbar-color: rgba(139,92,246,0.3) transparent;
}

.tp-drum::-webkit-scrollbar { width: 3px; }
.tp-drum::-webkit-scrollbar-thumb { background: rgba(139,92,246,0.3); border-radius: 99px; }

/* ─── Image Upload Warning ───────────────────────────────── */
.img-upload-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    background: rgba(245,158,11,0.08);
    border: 1px solid rgba(245,158,11,0.28);
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    font-size: 0.78rem;
    color: #fbbf24;
    line-height: 1.5;
    margin-bottom: 0.55rem;
}

.img-upload-warning svg { margin-top: 1px; }

.img-warn-link {
    background: none;
    border: none;
    padding: 0;
    color: #f59e0b;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-family: inherit;
}

.img-warn-link:hover { color: #fcd34d; }
