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

@font-face {
    font-family: 'Vazir';
    src: url('https://cdn.jsdelivr.net/gh/rastikerdar/vazir-font@v30.1.0/dist/Vazir-Regular.eot?#iefix') format('embedded-opentype'),
         url('https://cdn.jsdelivr.net/gh/rastikerdar/vazir-font@v30.1.0/dist/Vazir-Regular.woff2') format('woff2'),
         url('https://cdn.jsdelivr.net/gh/rastikerdar/vazir-font@v30.1.0/dist/Vazir-Regular.woff') format('woff'),
         url('https://cdn.jsdelivr.net/gh/rastikerdar/vazir-font@v30.1.0/dist/Vazir-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --sidebar-width: 220px;
    --sidebar-bg: #0f172a;
    --sidebar-accent: #3b82f6;
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #f1f5f9;
    --sidebar-hover-bg: rgba(59, 130, 246, 0.1);
    --sidebar-active-bg: rgba(59, 130, 246, 0.15);

    --body-bg: #f1f5f9;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --text-primary: #0f172a;
    --text-muted: #64748b;
    --text-subtle: #94a3b8;

    --blue: #1e40af;
    --blue-light: #3b82f6;
    --green: #166534;
    --teal: #0e7490;
    --red: #dc2626;
    --amber: #d97706;
    --rose: #9f1239;
}

body {
    font-family: 'Vazir', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--body-bg);
    color: var(--text-primary);
    line-height: 1.6;
    direction: rtl;
    text-align: right;
    font-size: 14px;
}

/* ─── APP LAYOUT ─────────────────────────────────────────── */
.app-layout {
    display: flex;
    flex-direction: row-reverse; /* sidebar on right */
    min-height: 100vh;
}

/* ─── SIDEBAR ────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    border-left: 1px solid rgba(255,255,255,0.04);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 16px;
}

.sidebar-logo-image {
    display: block;
    width: 150px;
    height: auto;
    max-height: 55px;
    object-fit: contain;
}

.logo-mark {
    width: 34px;
    height: 34px;
    background: var(--sidebar-accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: white;
    flex-shrink: 0;
}

.logo-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--sidebar-text-active);
    letter-spacing: 0.02em;
}

/* ─── NAV ────────────────────────────────────────────────── */
.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.25);
    border-radius: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.4);
}

/* Firefox */
.sidebar-nav {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.25) transparent;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--sidebar-text);
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    position: relative;
}

.nav-item:hover {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-text-active);
}

.nav-item.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-accent);
}

.nav-item.active .nav-icon svg {
    stroke: var(--sidebar-accent);
}

.nav-item--disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.nav-label {
    flex: 1;
}

.nav-badge {
    font-size: 0.65rem;
    background: rgba(148,163,184,0.15);
    color: var(--text-subtle);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    white-space: nowrap;
}
   
/* ─── NAV GROUP / SUBMENU ─────────────────────────────────────── */

.nav-group {
    width: 100%;
}

.nav-parent {
    width: 100%;
    border: none;
    background: transparent;
    font: inherit;
    text-align: right;
    cursor: pointer;
}

.nav-parent .nav-arrow {
    margin-right: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.nav-parent .nav-arrow svg {
    width: 16px;
    height: 16px;
}

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


/* Submenu */

.nav-submenu {
    display: none;
    flex-direction: column;
    gap: 2px;
    margin-right: 12px;
    padding-right: 12px;
}

.nav-group.open .nav-submenu {
    display: flex;
}

.nav-subitem {
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: #64748b;
    font-size: 0.8rem;
    transition: background 0.15s, color 0.15s;
}

.nav-subitem:hover {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-text-active);
}

.nav-subitem.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-accent);
}

.nav-subitem .nav-icon svg {
    width: 16px;
    height: 16px;
}

/* ─── SIDEBAR FOOTER ─────────────────────────────────────── */
.sidebar-footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
    min-width: 0;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--sidebar-text-active);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.7rem;
    color: var(--sidebar-text);
}

.logout-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.logout-btn:hover {
    background: rgba(220, 38, 38, 0.15);
    color: #f87171;
}

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

/* ─── MAIN CONTENT ───────────────────────────────────────── */
.main-content {
    flex: 1;
    margin-right: var(--sidebar-width);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ─── PAGE HEADER ────────────────────────────────────────── */
.page-header {
    padding: 1.75rem 2rem 0;
    margin-bottom: 1.5rem;
}

.page-header--center {
    text-align: center;
}

.page-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.page-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ─── CONTENT AREA ───────────────────────────────────────── */
.content-area {
    padding: 0 2rem 2rem;
}

/* ─── SECTION CARD ───────────────────────────────────────── */
.section-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    position: relative;
}

.section-header {
    background: #f8fafc;
    padding: 0.9rem 1.5rem;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-excel {
    margin-right: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    background: #1e40af;
    color: white;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s;
}

.btn-excel:hover {
    background: #1e3a8a;
}

.btn-excel svg {
    width: 14px;
    height: 14px;
    stroke: white;
}

.section-header svg {
    width: 16px;
    height: 16px;
    stroke: var(--text-muted);
    flex-shrink: 0;
}

.section-body {
    padding: 1.5rem;
}

/* ─── TABLE ──────────────────────────────────────────────── */
.table-wrap {
    overflow: auto;
    max-height: 600px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.table th,
.table td {
    padding: 0.75rem 1rem;
    text-align: right;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    white-space: nowrap;
}

.table thead th {
    background: #f8fafc;
    font-weight: 600;
    color: #334155;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 1px 0 var(--border);
}

.table tbody tr:hover {
    background: #f8fafc;
}

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

/* Pin operations column while horizontal-scrolling (RTL: last col sits on the left) */
.table th.col-sticky-end,
.table td.col-sticky-end {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #fff;
    box-shadow: 4px 0 8px -4px rgba(15, 23, 42, 0.12);
}
.table thead th.col-sticky-end {
    z-index: 12;
    background: #f8fafc;
}
.table tbody tr:hover td.col-sticky-end {
    background: #f8fafc;
}

/* ─── ADMIN DASHBOARD SHORTCUTS ──────────────────────────── */
.dash-shortcut-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(180px, 220px));
    gap: 1.25rem;
    justify-content: center;
    max-width: 720px;
    margin: 0 auto;
}

.dash-shortcut {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 1.35rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    text-decoration: none;
    color: var(--text-primary);
    text-align: center;
    transition: box-shadow 0.2s, transform 0.15s;
}

.dash-shortcut:hover {
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.1);
    transform: translateY(-2px);
}

.dash-shortcut-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 12px;
}

.dash-shortcut-icon svg {
    width: 26px;
    height: 26px;
}

.dash-shortcut-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.35;
}

.dash-shortcut-desc {
    font-size: 0.72rem;
    font-weight: 400;
    line-height: 1.4;
    color: var(--text-muted);
    max-width: 90%;
}

.dash-shortcut--blue .dash-shortcut-icon { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
.dash-shortcut--blue:hover { border-color: #3b82f6; }
.dash-shortcut--teal .dash-shortcut-icon { background: rgba(14, 116, 144, 0.12); color: #0e7490; }
.dash-shortcut--teal:hover { border-color: #0e7490; }
.dash-shortcut--green .dash-shortcut-icon { background: rgba(22, 101, 52, 0.12); color: #166534; }
.dash-shortcut--green:hover { border-color: #16a34a; }
.dash-shortcut--amber .dash-shortcut-icon { background: rgba(217, 119, 6, 0.12); color: #d97706; }
.dash-shortcut--amber:hover { border-color: #d97706; }
.dash-shortcut--rose .dash-shortcut-icon { background: rgba(159, 18, 57, 0.12); color: #be123c; }
.dash-shortcut--rose:hover { border-color: #e11d48; }
.dash-shortcut--indigo .dash-shortcut-icon { background: rgba(67, 56, 202, 0.12); color: #4338ca; }
.dash-shortcut--indigo:hover { border-color: #6366f1; }
.dash-shortcut--cyan .dash-shortcut-icon { background: rgba(8, 145, 178, 0.12); color: #0891b2; }
.dash-shortcut--cyan:hover { border-color: #06b6d4; }
.dash-shortcut--orange .dash-shortcut-icon { background: rgba(234, 88, 12, 0.12); color: #ea580c; }
.dash-shortcut--orange:hover { border-color: #f97316; }
.dash-shortcut--violet .dash-shortcut-icon { background: rgba(124, 58, 237, 0.12); color: #7c3aed; }
.dash-shortcut--violet:hover { border-color: #8b5cf6; }
.dash-shortcut--slate .dash-shortcut-icon { background: rgba(71, 85, 105, 0.12); color: #475569; }
.dash-shortcut--slate:hover { border-color: #64748b; }

@media (max-width: 700px) {
    .dash-shortcut-grid {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
        max-width: 100%;
    }
}

@media (max-width: 420px) {
    .dash-shortcut-grid {
        grid-template-columns: 1fr;
    }
}

/* ─── CINEMA CARDS ───────────────────────────────────────── */
.dashboard-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.dashboard-detail-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
    transition: box-shadow 0.2s;
}

.dashboard-detail-card:hover {
    box-shadow: 0 4px 12px rgba(15,23,42,0.08);
}

.dashboard-detail-card-name {
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.dashboard-detail-card-row {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
    display: flex;
    gap: 0.3rem;
}

.dashboard-detail-card-row span { color: var(--text-primary); }

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    background: #f3f4f6;
    color: #6b7280;
    margin-top: 0.6rem;
}

/* dashboard cinema cards */
.status-badge--published { background: #dcfce7; color: #166534; }
.status-badge--draft { background: #fef3c7; color: #92400e; }
.status-badge--other { background: #fee2e2; color: #991b1b; }

/* cinema list table */
.status-badge--success { background: #dcfce7; color: #15803d; }
.status-badge--warning { background: #fef3c7; color: #b45309; }
.status-badge--danger  { background: #fee2e2; color: #b91c1c; }
.status-badge--info    { background: #dbeafe; color: #1d4ed8; }

/* ─── EMPTY STATE ────────────────────────────────────────── */
.empty-state {
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-muted);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    stroke: #cbd5e1;
    margin-bottom: 1rem;
}

.empty-state .btn-filter {
    display: inline-block;
    margin-top: 0.75rem;
}

/* ─── UTILITIES ──────────────────────────────────────────── */
.text-muted { color: var(--text-muted); }
.fw-bold { font-weight: 700; }
.text-center { text-align: center; }
.w-100 { width: 100%; }
.d-block { display: block; }

/* ─── AUTH PAGES (login / otp) ───────────────────────────── */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e40af 100%);
    padding: 1rem;
}

.auth-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    padding: 2.5rem;
    max-width: 420px;
    width: 100%;
}

.auth-card h2, .auth-card h3 {
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.auth-card p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: 'Vazir', sans-serif;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    direction: ltr;
    text-align: center;
}

.form-control:focus {
    outline: none;
    border-color: #1e40af;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.12);
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-family: inherit;
    font-size: 0.7rem;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: #1e40af;
    color: white;
    width: 100%;
    margin-top: 0.5rem;
}

.btn-primary:hover {
    background-color: #1e3a8a;
    transform: translateY(-1px);
}

.mb-4 { margin-bottom: 1rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.text-danger { color: var(--red); }
.small { font-size: 0.8rem; }
.text-decoration-none { text-decoration: none; color: var(--blue-light); }

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 768px) {
    :root { --sidebar-width: 64px; }

    .logo-text,
    .nav-label,
    .nav-badge,
    .user-details { display: none; }

    .sidebar-logo { justify-content: center; padding: 1.25rem 0; }
    .nav-item { justify-content: center; padding: 0.75rem; }
    .sidebar-footer { justify-content: center; }
    .user-info { justify-content: center; }
    .logout-btn { margin: 0; }

    .main-content { margin-right: var(--sidebar-width); }
    .content-area, .page-header { padding-left: 1rem; padding-right: 1rem; }
}

/* ─── FILTER BAR ─────────────────────────────────────────── */
.filter-bar {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: #fafbfc;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: flex-start;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 140px;
    flex: 1;
}

.filter-group--checkbox {
    min-width: 140px;
    flex: 1;
}

.filter-checkbox {
    margin-left: 0.4rem;
    vertical-align: middle;
    accent-color: var(--blue-light, #3b82f6);
}

/* ─── TOGGLE SWITCH ─────────────────────────────────────── */
.toggle-switch-wrap {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch {
    position: relative;
    width: 36px;
    height: 20px;
    background: #cbd5e1;
    border-radius: 10px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle-input:checked + .toggle-switch {
    background: var(--blue-light, #3b82f6);
}

.toggle-input:checked + .toggle-switch::after {
    transform: translateX(-16px);
}

.toggle-input:focus-visible + .toggle-switch {
    box-shadow: 0 0 0 2px rgba(59,130,246,0.3);
}

.filter-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.filter-input {
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: 'Vazir', sans-serif;
    font-size: 0.82rem;
    background: white;
    color: var(--text-primary);
    transition: border-color 0.15s, box-shadow 0.15s;
    direction: rtl;
    max-width: 120px;
}

.filter-input:focus {
    outline: none;
    border-color: var(--blue-light);
    box-shadow: 0 0 0 2px rgba(59,130,246,0.12);
}

.filter-actions {
    display: flex;
    gap: 0.4rem;
    align-items: flex-start;
    padding-bottom: 0;
}

.btn-filter {
    padding: 0.45rem 1rem;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: 'Vazir', sans-serif;
    cursor: pointer;
    border: none;
    white-space: nowrap;
    text-decoration: none;
    background: #1e40af;
    color: white;
    transition: background 0.15s;
}

.btn-filter:hover { background: #1e3a8a; }

.btn-filter--clear {
    background: white;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-filter--clear:hover {
    background: #f1f5f9;
    color: var(--text-primary);
}

/* ─── SORTABLE TH ────────────────────────────────────────── */
.th-sort { padding: 0 !important; }

.th-link {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: #334155;
    font-weight: 600;
    font-size: 0.82rem;
    white-space: nowrap;
    transition: color 0.15s, background 0.15s;
}

.th-link:hover {
    color: var(--blue-light);
    background: #f1f5f9;
}

.th-sort--asc .th-link,
.th-sort--desc .th-link {
    color: #1e40af;
    background: #eff6ff;
}

.sort-icon {
    font-size: 0.75rem;
    opacity: 0.9;
}

.sort-icon--idle {
    opacity: 0.3;
    font-size: 0.7rem;
}

/* ─── PAGINATION ─────────────────────────────────────────── */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.5rem;
    border-top: 1px solid var(--border);
    background: #fafbfc;
    font-size: 0.82rem;
}

.page-info {
    color: var(--text-muted);
}

.page-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: white;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: background 0.15s, border-color 0.15s;
}

.page-btn:hover {
    background: #eff6ff;
    border-color: var(--blue-light);
    color: var(--blue-light);
}

.page-current {
    padding: 0 0.75rem;
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* ─── SIDEBAR TOGGLE ──────────────────────────────────────── */
.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.6rem 0;
    border: none;
    border-top: 1px solid rgba(255,255,255,0.06);
    background: transparent;
    color: var(--sidebar-text);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-text-active);
}

.sidebar-toggle svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.sidebar-toggle .icon-closed { display: none; }
.sidebar-toggle .icon-open { display: block; }

.sidebar.collapsed .sidebar-toggle .icon-closed { display: block; }
.sidebar.collapsed .sidebar-toggle .icon-open { display: none; }

/* ─── SIDEBAR COLLAPSED STATE ────────────────────────────── */
.sidebar.collapsed {
    width: 64px;
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .user-details {
    display: none;
}

.sidebar.collapsed .sidebar-logo {
    justify-content: center;
    padding: 1.25rem 0;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 0.75rem;
}

.sidebar.collapsed .sidebar-footer {
    justify-content: center;
}

.sidebar.collapsed .user-info {
    justify-content: center;
}

.sidebar.collapsed .logout-btn {
    margin: 0;
}

.sidebar.collapsed ~ .main-content {
    margin-right: 64px;
}

/* ─── SIDEBAR TRANSITION FIX ─────────────────────────────── */
.sidebar {
    transition: width 0.25s ease;
}

.main-content {
    transition: margin-right 0.25s ease;
}

/* ─── ACTIVE FILTER CHIPS ────────────────────────────────── */
.active-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}

.active-filters-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
    flex-shrink: 0;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.filter-chip:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}

.chip-remove {
    opacity: 0.6;
    font-size: 0.7rem;
}

.filter-chip--clear-all {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.filter-chip--clear-all:hover {
    background: #f1f5f9;
    color: var(--text-primary);
}

/* ─── GROUPED TABLE HEADERS ──────────────────────────────── */
.table--grouped { font-size: 0.8rem; }

.table-group-row th {
    position: sticky;
    top: 0;
    z-index: 11;
    padding: 0.5rem 1rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-align: center;
    border-bottom: 2px solid transparent;
    letter-spacing: 0.02em;
}

.group-label--general {
    background: #f8fafc;
    color: #64748b;
    border-bottom-color: #cbd5e1;
}

.group-label--overall {
    background: #eff6ff;
    color: #1d4ed8;
    border-bottom-color: #93c5fd;
}

.group-label--cinema {
    background: #ecfdf5;
    color: #047857;
    border-bottom-color: #6ee7b7;
}

.group-label--distributor {
    background: #fef2f2;
    color: #b91c1c;
    border-bottom-color: #fca5a5;
}

/* second header row sits below the group-label row, so adjust sticky offset */
.table--grouped thead tr:nth-child(2) th {
    top: 33px;
}

.group-overall { background: #f8fbff; }
.group-cinema { background: #ffffff; }
.group-distributor { background: #f8fbff; }

.cell-overall { background: #f8fbff; }
.cell-cinema { background: #ffffff; }
.cell-distributor { background: #f8fbff; }

.table tbody tr:hover .cell-overall { background: #eff6ff; }
.table tbody tr:hover .cell-cinema { background: #ecfdf5; }
.table tbody tr:hover .cell-distributor { background: #fef2f2; }

/* ─── CELL TRUNCATION ───────────────────────────────────── */
.cell-truncate {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cell-truncate--wide {
    max-width: 260px;
}

/* ─── UPLOAD HEADER BUTTON ──────────────────────────────── */
.upload-form {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-right: auto;
}

.upload-form input[type="file"] {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.btn-upload-header {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    border: none;
    background: #0e7490;
    color: white;
    font-family: 'Vazir', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.btn-upload-header:hover {
    background: #0c6678;
}

/* ─── TABLE SCROLL HINT (fade on edges when horizontally scrollable) ─── */
.table-wrap {
    position: relative;
    background:
        linear-gradient(to left, white 30%, rgba(255,255,255,0)),
        linear-gradient(to right, white 30%, rgba(255,255,255,0)) left,
        linear-gradient(to left, rgba(0,0,0,0.08), rgba(0,0,0,0)) ,
        linear-gradient(to right, rgba(0,0,0,0.08), rgba(0,0,0,0)) left;
    background-repeat: no-repeat;
    background-size: 24px 100%, 24px 100%, 8px 100%, 8px 100%;
    background-attachment: local, local, scroll, scroll;
}

/* ─── DATEPICKER WRAPPER ─────────────────────────────────── */
.datepicker-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.datepicker-wrap .datepicker-input {
    padding-right: 2.4rem;
    padding-left: 0.7rem;
    cursor: pointer;
    text-align: right;
    direction: ltr;
    flex: 1;
    min-width: 0;
}

.datepicker-icon {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: all;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 0;
    z-index: 10;
}

.datepicker-icon svg {
    width: 15px;
    height: 15px;
}

/* Override JalaliDatePicker */
.jalalidatepicker {
    font-family: 'Vazir', sans-serif !important;
    direction: rtl;
    z-index: 1050 !important;
}

.datepicker-plot-area {
    border-radius: 10px !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15) !important;
}

.jalalidatepicker .selected {
    background: #3b82f6 !important;
    color: white !important;
}

.jalalidatepicker .day:hover {
    background: #eff6ff !important;
}



/* ─── SUMMARY CARDS ─────────────────────────────────────── */
.summary-cards {
    display: flex;
    flex-wrap: nowrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-card {
    flex: 1;
    min-width: 0; /* prevents long values/labels from forcing overflow */
    border-radius: 10px;
    padding: 1rem 1.25rem;
    border: 1px solid;
}

.summary-card--deposit {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.summary-card--debit {
    background: #fef2f2;
    border-color: #fecaca;
}

.summary-card--balance {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.summary-card--requested {
    background: #fff7ed;
    border-color: #fdba74;
}

.summary-card-label {
    font-size: 0.78rem;
    margin-bottom: 0.3rem;
}

.summary-card--deposit .summary-card-label { color: #166534; }
.summary-card--debit .summary-card-label { color: #991b1b; }
.summary-card--balance .summary-card-label { color: #1e40af; }
.summary-card--requested .summary-card-label { color: #c2410c; }

.summary-card-value {
    font-size: 1.3rem;
    font-weight: 700;
}

.summary-card--deposit .summary-card-value { color: #166534; }
.summary-card--debit .summary-card-value { color: #991b1b; }
.summary-card--balance .summary-card-value { color: #1e40af; }
.summary-card--requested .summary-card-value { color: #c2410c; }

.summary-card-unit {
    font-size: 0.7rem;
    font-weight: 400;
}

@media (max-width: 640px) {
    .summary-cards {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .summary-card {
        flex: 0 0 200px;
    }
}

/* ─── TEXT COLORS ────────────────────────────────────────── */
.text-deposit { color: #16a34a; }
.text-debit { color: #dc2626; }
.text-daily { color: #2563eb; }
.text-requested { color: #c2410c;}

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

.modal-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-card--wide {
    max-width: 960px;
}

.reserve-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0 1rem;
}

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

.modal-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    line-height: 1;
}

.modal-field {
    margin-bottom: 0.8rem;
}

.modal-field:last-of-type {
    margin-bottom: 1rem;
}

.modal-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.modal-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: 'Vazir', sans-serif;
}

textarea.modal-input {
    resize: vertical;
}

.modal-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.modal-divider {
    border-top: 1px solid #e5e7eb;
    margin: 1rem 0;
}

/* ─── SNACKBAR ───────────────────────────────────────────── */
/* Standalone snackbar (date filter, etc.) */
.snackbar {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    background: #1e293b;
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    font-size: 0.85rem;
}

.snackbar.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.snackbar-icon {
    width: 20px;
    height: 20px;
    stroke: #fbbf24;
    flex-shrink: 0;
}

.snackbar-text strong {
    color: #fbbf24;
}

/* Django messages snackbar (top notification) */
.messages-container {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 600px;
    width: 90%;
}

.messages-container .snackbar {
    position: static;
    transform: none;
    opacity: 1;
    transition: none;
    justify-content: space-between;
    animation: msg-in 0.3s ease;
}

.messages-container .snackbar--error { background: #dc2626; }
.messages-container .snackbar--success { background: #16a34a; }
.messages-container .snackbar--warning { background: #d97706; }
.messages-container .snackbar--info { background: #2563eb; }

.messages-container .snackbar-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.7;
    padding: 0 0.25rem;
}
.messages-container .snackbar-close:hover { opacity: 1; }

@keyframes msg-in {
    from { opacity: 0; transform: translateY(-1rem); }
    to { opacity: 1; transform: translateY(0); }
}

/* ─── SEARCHABLE SELECT ──────────────────────────────────── */
.searchable-select {
    position: relative;
    max-width: 130px;
}

.searchable-select--wide {
    max-width: 280px;
}

.searchable-select__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-family: 'Vazir', sans-serif;
    font-size: 0.82rem;
    color: var(--text-primary);
    direction: rtl;
    transition: border-color 0.15s, box-shadow 0.15s;
    user-select: none;
    min-width: 100px;
}

.searchable-select__trigger:hover {
    border-color: var(--blue-light);
}

.searchable-select__trigger:focus {
    outline: none;
    border-color: var(--blue-light);
    box-shadow: 0 0 0 2px rgba(59,130,246,0.12);
}

.searchable-select__trigger::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--text-muted);
    margin-right: 0.5rem;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.searchable-select.open .searchable-select__trigger::after {
    transform: rotate(180deg);
}

.searchable-select__dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    margin-top: 4px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
    max-height: 250px;
    overflow: hidden;
}

.searchable-select.open .searchable-select__dropdown {
    display: block;
}

.searchable-select__search {
    padding: 8px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: white;
}

.searchable-select__search input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: 'Vazir', sans-serif;
    font-size: 0.82rem;
    outline: none;
    direction: rtl;
    background: var(--body-bg);
}

.searchable-select__search input:focus {
    border-color: var(--blue-light);
}

.searchable-select__options {
    overflow-y: auto;
    max-height: 200px;
}

.searchable-select__option {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.82rem;
    font-family: 'Vazir', sans-serif;
    transition: background 0.1s;
}

.searchable-select__option:hover {
    background: var(--body-bg);
}

.searchable-select__option--selected {
    background: rgba(59, 130, 246, 0.1);
    color: var(--blue);
    font-weight: 600;
}

.searchable-select__option--hidden {
    display: none;
}

.searchable-select__empty {
    padding: 12px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* ─── MULTI-SELECT ───────────────────────────────────────── */

.searchable-select[data-multi="1"] .searchable-select__option {
    position: relative;
    padding-right: 2rem; /* room for checkmark (RTL) */
}

.searchable-select[data-multi="1"] .searchable-select__option--selected::before {
    content: '✓';
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--blue);
    font-weight: 700;
    font-size: 0.85rem;
}

.searchable-select[data-multi="1"] .searchable-select__option[data-value=""].searchable-select__option--selected::before {
    content: none;
}

.searchable-select[data-multi="1"] .searchable-select__option--selected {
    background: rgba(59, 130, 246, 0.12);
    color: var(--blue);
    font-weight: 600;
}

/* ─── SAMFA PLACE PICKER ─────────────────────────────────── */
.samfa-id-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.samfa-id-row .modal-input {
    flex: 1;
    min-width: 0;
}

.samfa-id-row .btn-filter {
    white-space: nowrap;
    flex-shrink: 0;
}

.samfa-places-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 360px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.samfa-places-item {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.samfa-places-item:last-child {
    border-bottom: none;
}

.samfa-places-item:hover {
    background: #f8fafc;
}

.samfa-places-item__title {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
}

.samfa-places-item__meta {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.samfa-places-star {
    color: #dc2626;
}

.samfa-places-msg {
    padding: 0.75rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.samfa-places-msg--error {
    color: #dc2626;
}

/* ─── ACTION BUTTONS (edit / delete) ─── */
.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
}

.btn-action svg {
    width: 14px;
    height: 14px;
}

.btn-action--edit {
    background: #eff6ff;
    color: #2563eb;
}

.btn-action--edit:hover {
    background: #dbeafe;
}

.btn-action--delete {
    background: #fef2f2;
    color: #dc2626;
}

.btn-action--delete:hover {
    background: #fee2e2;
}

/* ─── DESCRIPTION CELL (multi-line) ─── */
.cell-description {
    white-space: pre-line !important;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 350px;
    line-height: 1.5;
}


/* ─── LOADING STATE ──────────────────────────────────────── */
.is-loading {
    position: relative;
    min-height: 120px;
    pointer-events: none;
    opacity: 0.5;
    transition: opacity 0.15s;
}

.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    margin: -16px 0 0 -16px;
    border: 3px solid #e2e8f0;
    border-top-color: #1e40af;
    border-radius: 50%;
    animation: jdp-spin 0.7s linear infinite;
    z-index: 20;
}

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

.btn-filter:disabled,
.btn-filter[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

.edit-permissions label:hover {
    background: #f8fafc;
    border-color: var(--blue-light);
}

/* ─── TASHEEM SIDE-BY-SIDE COLUMNS ───────────────────────── */
.tasheem-columns {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

.tasheem-column {
    flex: 1 1 0;
    min-width: 0; /* prevents flex overflow from breaking table layout */
}

.tasheem-column .table-wrap {
    max-height: 480px; /* shorter than the default 600px since it's half-width now */
}

@media (max-width: 1100px) {
    .tasheem-columns {
        flex-direction: column;
    }
}

/* ─── CINEMA CREATE / EDIT FORM ──────────────────────────── */

.cinema-form-page {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Hero upload (poster / background) — the big top box with the "+" badge */

.cinema-hero-upload {
    padding: 20px;
}

.hero-upload-box {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
    border-radius: 16px;
    background: #eef2f7;
    border: 1px solid #dbe2ea;
}

/* Background */

.background-upload {
    position: absolute;
    inset: 0;
    cursor: pointer;
}

#backgroundPreview,
#bannerPreview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Poster */

.poster-upload {
    position: absolute;
    right: 24px;
    bottom: 24px;

    width: 260px;
    height: 150px;

    border-radius: 12px;
    overflow: hidden;

    border: 4px solid white;
    background: white;

    box-shadow: 0 8px 30px rgba(0,0,0,.25);

    z-index: 2;

    cursor: pointer;
}

#posterPreview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Event poster overlay: closer to 490×700 */
.event-poster-upload {
    width: 140px;
    height: 200px;
}

/* Cast actor photo */
.cast-pic-upload {
    position: relative;
    width: 180px;
    height: 240px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #dbe2ea;
    background: #eef2f7;
    cursor: pointer;
}

/* Event form — linked actors (search + chips) */
.event-actors {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.event-actors__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    min-height: 0.5rem;
}

.event-actor-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.5rem 0.35rem 0.35rem;
    border: 1px solid var(--border, #dbe2ea);
    border-radius: 999px;
    background: #fff;
    max-width: 100%;
}

.event-actor-chip__img,
.event-actor-option__img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #eef2f7;
}

.event-actor-chip__img--empty,
.event-actor-option__img--empty {
    display: inline-block;
}

.event-actor-chip__name {
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 10rem;
}

.event-actor-chip__remove {
    border: none;
    background: transparent;
    color: var(--text-muted, #6b7280);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.15rem;
}

.event-actor-chip__remove:hover {
    color: #b91c1c;
}

.event-actor-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.event-actor-option__img {
    width: 28px;
    height: 28px;
}

/* Event form — trailers */
.event-trailers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.event-trailer-slot {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 1px solid var(--border, #dbe2ea);
    border-radius: 10px;
    background: #f8fafc;
}

.event-trailer-preview {
    width: 100%;
    max-height: 200px;
    border-radius: 8px;
    background: #0f172a;
}

#picPreview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#picUploadBtn {
    position: absolute;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,.75);
    color: white;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

/* ==========================
   Upload buttons
========================== */

#backgroundUploadBtn,
#posterUploadBtn,
#bannerUploadBtn {

    position: absolute;

    width: 36px;
    height: 36px;

    border-radius: 50%;

    border: none;

    background: rgba(0,0,0,.75);

    color: white;

    font-size: 22px;

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;
}

#backgroundUploadBtn {
    top: 18px;
    left: 18px;
    z-index: 3;
}

#posterUploadBtn {
    top: 10px;
    left: 10px;
    z-index: 4;
}

/* Hide empty images */

#backgroundPreview[src=""],
#posterPreview[src=""] {
    display: none;
}

.upload-hint{
    margin-top:15px;
    color:#6b7280;
    text-align:center;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.gallery-upload-zone {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    border: 2px dashed var(--border, #d1d5db);
    border-radius: 12px;
    background: #f9fafb;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    color: #6b7280;
    font-size: 0.85rem;
    gap: 0.35rem;
}

.gallery-upload-zone:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #3b82f6;
}

.gallery-upload-icon {
    font-size: 1.75rem;
    font-weight: 300;
    line-height: 1;
}

.gallery-item {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border, #e5e7eb);
}

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

.gallery-item .gallery-delete {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.15s;
}

.gallery-item:hover .gallery-delete {
    opacity: 1;
}


.transaction-buttons {
    margin-right: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.transaction-buttons .btn-excel {
    margin-right: 0;
}

/* ─── Comment Threads ──────────────────────────── */

.thread-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--surface-subtle, #f3f4f6);
    border: 1px solid var(--border, #e5e5e5);
    border-radius: 999px;
    cursor: pointer;
    padding: 4px 10px;
    color: var(--text-secondary, #555);
    font-size: 0.78rem;
    transition: background 0.15s ease, transform 0.15s ease;
}
.thread-toggle:hover {
    background: var(--brand-subtle, #eef4ff);
    color: var(--brand, #2563eb);
}
.thread-toggle__icon {
    width: 14px;
    height: 14px;
    transition: transform 0.15s ease;
}
.thread-toggle[aria-expanded="true"] .thread-toggle__icon {
    transform: rotate(90deg);
}
.thread-toggle__count {
    font-weight: 600;
}
.thread-toggle[aria-expanded="true"] .thread-toggle__icon {
    transform: rotate(90deg);
}

.thread-replies-row td {
    background: var(--surface-subtle, #fafafa);
    padding: 0;
}
.thread-replies-container {
    padding: 12px 20px;
}

.thread-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.thread-item {
    background: #fff;
    border: 1px solid var(--border, #e5e5e5);
    border-radius: 8px;
    padding: 10px 14px;
    position: relative;
}
.thread-item--admin {
    border-inline-start: 3px solid var(--brand, #2563eb);
    background: var(--brand-subtle, #eef4ff);
}
.thread-item__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    color: var(--text-secondary, #777);
    margin-bottom: 6px;
}
.thread-item__badge {
    display: inline-block;
    background: var(--brand, #2563eb);
    color: #fff;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 999px;
}
.thread-item__content {
    font-size: 0.92rem;
    line-height: 1.6;
    white-space: pre-wrap;
}
.thread-item__actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    align-items: center;
}
.thread-list__empty {
    color: var(--text-secondary, #999);
    font-size: 0.85rem;
    padding: 4px 0;
}

mark {
    background: #fff3a3;
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
}

.thread-row--match td {
    background: #fffdf2;
}

.thread-toggle__match-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #f59e0b;
    margin-inline-start: 2px;
    vertical-align: middle;
}

.thread-item--match {
    border-color: #f59e0b;
    box-shadow: 0 0 0 1px #f59e0b inset;
}
/* ─── DISCOUNT FORM ─────────────────────────────────────── */

.discount-form-page .section-body {
    padding: 1.25rem 1.5rem;
}

.discount-form-page .discount-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.1rem 1.5rem;
    align-items: start;
}

.discount-form-page .discount-form-grid .filter-group {
    margin: 0;
    min-width: 0;
    flex: none;
    width: 100%;
    max-width: none;
    gap: 0.4rem;
}

.discount-form-page .discount-form-grid__full {
    grid-column: 1 / -1;
}

/* Labels: same baseline height so fields line up across columns */
.discount-form-page .discount-form-grid > .filter-group > .modal-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 1.75rem;
    margin-bottom: 0;
    line-height: 1.35;
}

.discount-form-page .discount-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    min-height: auto;
}

/* Inputs + selects share one control height/width */
.discount-form-page .modal-input,
.discount-form-page .searchable-select__trigger {
    box-sizing: border-box;
    width: 100%;
    min-height: 2.5rem;
    padding: 0.55rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 8px;
}

.discount-form-page textarea.modal-input {
    min-height: 5.5rem;
    resize: vertical;
}

.discount-form-page .searchable-select,
.discount-form-page .searchable-select--wide {
    max-width: none;
    width: 100%;
}

.discount-form-page .searchable-select__trigger {
    min-width: 0;
}

.discount-form-page .searchable-select__text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.searchable-select--disabled {
    opacity: 0.55;
    pointer-events: none;
}

.discount-cinema-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 1.75rem;
    margin-bottom: 0;
}

.discount-cinema-label-row .modal-label {
    margin-bottom: 0;
}

.discount-select-all {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: #374151;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.discount-select-all input:disabled {
    cursor: not-allowed;
}

.discount-select-all-summary {
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    font-size: 0.875rem;
    color: #374151;
    margin-bottom: 0.35rem;
}

.discount-sel-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.discount-sel-preview[hidden] {
    display: none !important;
}

.discount-sel-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    max-width: 100%;
    padding: 0.3rem 0.5rem;
    border-radius: 999px;
    border: 1px solid #6ee7b7;
    background: #ecfdf5;
    color: #065f46;
    font-size: 0.8rem;
    line-height: 1.2;
}

.discount-sel-chip__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 11rem;
}

.discount-sel-chip__remove {
    border: none;
    background: transparent;
    color: #047857;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.1rem;
    flex-shrink: 0;
}

.discount-sel-chip__remove:hover {
    color: #b91c1c;
}

.discount-sel-more {
    border: 1px dashed #94a3b8;
    background: #f8fafc;
    color: #334155;
    border-radius: 999px;
    padding: 0.3rem 0.65rem;
    font: inherit;
    font-size: 0.8rem;
    line-height: 1.2;
    cursor: pointer;
}

.discount-sel-more:hover {
    background: #eef2ff;
    border-color: #818cf8;
    color: #3730a3;
}

.discount-sel-modal__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    max-height: 60vh;
    overflow-y: auto;
    padding-top: 0.25rem;
}

.discount-form-page .modal-input[readonly] {
    background: #f8fafc;
    color: #64748b;
}

.discount-form-page .discount-field-stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.discount-weekday-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.discount-weekday-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #f9fafb;
    cursor: pointer;
    font-size: 0.875rem;
    margin: 0;
}

.discount-weekday-chip:has(input:checked) {
    background: #ecfdf5;
    border-color: #6ee7b7;
    color: #065f46;
}

.discount-weekday-chip input {
    margin: 0;
}

.discount-cat-add-btn {
    width: 1.75rem;
    height: 1.75rem;
    margin-right: auto;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
    color: #111827;
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}

.discount-cat-add-btn:hover {
    background: #ecfdf5;
    border-color: #6ee7b7;
}

.discount-add-category {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.15rem;
    align-items: stretch;
}

.discount-add-category[hidden] {
    display: none !important;
}

.discount-add-category .modal-input {
    flex: 1 1 180px;
    min-width: 0;
}

.discount-add-category .btn-filter,
.discount-phones__add .btn-filter {
    min-height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.discount-phones {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 36rem;
}

.discount-phones__add {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    align-items: stretch;
}

.discount-phones__add .modal-input {
    flex: 1 1 auto;
    min-width: 0;
}

.discount-phones__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 0.5rem;
}

.discount-phone-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.55rem;
    border-radius: 999px;
    border: 1px solid #6ee7b7;
    background: #ecfdf5;
    color: #065f46;
    font-size: 0.9rem;
}

.discount-phone-chip__num {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.discount-phone-chip__remove {
    border: none;
    background: transparent;
    color: #047857;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.15rem;
}

.discount-phone-chip__remove:hover {
    color: #b91c1c;
}

.discount-form-page .modal-actions {
    justify-content: flex-start;
    margin-top: 0.5rem;
    margin-bottom: 2rem;
    gap: 0.65rem;
}

@media (max-width: 768px) {
    .discount-form-page .discount-form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .discount-form-page .section-body {
        padding: 1rem;
    }

    .discount-phones__add {
        flex-wrap: wrap;
    }

    .discount-phones__add .btn-filter {
        width: 100%;
    }
}
