@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;700;800&display=swap');

:root {
    --bg-primary: #08090d;
    --bg-secondary: #0f1016;
    --bg-card: #141622;
    --bg-active: rgba(139, 92, 246, 0.15);
    
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-active: rgba(139, 92, 246, 0.4);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #4b5563;
    
    --accent-purple: #8b5cf6;
    --accent-purple-glow: rgba(139, 92, 246, 0.25);
    --accent-cyan: #06b6d4;
    --accent-cyan-glow: rgba(6, 182, 212, 0.25);
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-gold: #fbbf24;
    
    --font-sans: 'Vazirmatn', sans-serif;
    --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    direction: rtl;
    text-align: right;
    height: 100vh;
    overflow: hidden;
}

/* Dashboard Wrapper layout */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    width: 260px;
    background-color: var(--bg-secondary);
    border-left: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    flex-shrink: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-glass);
    margin-bottom: 2rem;
}

.sidebar-logo {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: white;
    font-size: 1.1rem;
}

.sidebar-logo-text h2 {
    font-size: 1.15rem;
    font-weight: 800;
}

.sidebar-logo-text span {
    font-size: 0.7rem;
    color: var(--accent-cyan);
    display: block;
    margin-top: -2px;
}

.niche-info-badge {
    display: none;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.25);
    color: #22d3ee;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 1.5rem;
}

.menu-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex-grow: 1;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.38rem 0.65rem;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    font-weight: 400;
    font-size: 0.84rem;
    transition: var(--transition-smooth);
}

.menu-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
}

.menu-item:hover .menu-icon {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
    color: var(--accent-purple);
}

.menu-item.active {
    color: white;
    background: var(--bg-active);
    border-right: 3px solid var(--accent-purple);
}

.menu-item.active .menu-icon {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
    color: white;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
}

.menu-icon {
    font-size: 0.85rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: 6px;
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

/* Sidebar Niche Config Switcher (For demo evaluation) */
.demo-switcher-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    margin-top: auto;
}

.demo-switcher-box label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.5rem;
}

.demo-select {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    outline: none;
}

/* Main Dashboard Area */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    height: 100vh;
}

/* Top Navbar */
.top-navbar {
    height: 70px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    flex-shrink: 0;
}

.nav-title h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.nav-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 38px;
    height: 38px;
    background: rgba(139, 92, 246, 0.2);
    color: #c084fc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Content Container */
.dashboard-container {
    padding: 2rem;
    flex-grow: 1;
}

/* Tab Panel States */
.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.stat-info h5 {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.stat-info h4 {
    font-size: 1.6rem;
    font-weight: 800;
}

.stat-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon-purple {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
}

.stat-icon-cyan {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
}

.stat-icon-green {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

/* Split view layouts (For POS and products pages) */
.split-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 992px) {
    .split-layout {
        grid-template-columns: 1.2fr 0.8fr;
    }
    
    .split-layout.reverse-columns {
        grid-template-columns: 0.8fr 1.2fr;
    }
}

/* Panel Card */
.panel-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.panel-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* POS product grid selector */
.pos-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    max-height: 450px;
    overflow-y: auto;
    padding-left: 0.5rem;
}

.pos-product-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 140px;
}

.pos-product-item:hover {
    border-color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.05);
    transform: translateY(-2px);
}

.pos-prod-title {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.pos-prod-sku {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: monospace;
}

.pos-prod-niche-pill {
    background: rgba(6, 182, 212, 0.1);
    color: #22d3ee;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.65rem;
    width: fit-content;
    margin-top: 0.25rem;
}

.pos-prod-price-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.pos-prod-price {
    font-size: 0.85rem;
    font-weight: 700;
    color: #a78bfa;
}

.pos-prod-stock {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* POS Billing/Cart Panel */
.cart-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 240px;
    overflow-y: auto;
    margin-bottom: 1.5rem;
    padding-left: 0.5rem;
}

.cart-item {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-item-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.cart-item-title {
    font-size: 0.85rem;
    font-weight: 700;
}

.cart-item-price {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cart-qty-btn {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    cursor: pointer;
    font-weight: bold;
}

.cart-qty-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.cart-item-qty {
    font-size: 0.85rem;
    font-weight: 700;
}

/* Forms general */
.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

@media (min-width: 576px) {
    .form-grid {
        grid-template-columns: 1fr 1fr;
    }
}

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

.form-group label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.form-input, .form-select {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition-smooth);
}

.form-input:focus, .form-select:focus {
    border-color: var(--accent-purple);
}

.billing-totals {
    border-top: 1px solid var(--border-glass);
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.total-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.total-row.grand-total {
    font-size: 1.1rem;
    font-weight: 800;
    color: #a78bfa;
    border-top: 1px dashed var(--border-glass);
    padding-top: 0.5rem;
    margin-top: 0.25rem;
}

/* Standard Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-family: var(--font-sans);
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-purple), #7c3aed);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2);
}

.btn-primary:hover {
    filter: brightness(1.1);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.35);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateY(-1px);
}

.btn-secondary:active {
    transform: translateY(0);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
    border-radius: 8px;
}

/* Tables general (Customers, Accounting, Invoices) */
.table-responsive {
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
    font-size: 0.9rem;
}

.custom-table th {
    padding: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    border-bottom: 2px solid var(--border-glass);
}

.custom-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-glass);
    color: var(--text-primary);
}

.custom-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.01);
}

/* Ledger income/expense markers */
.txt-green {
    color: var(--accent-green);
    font-weight: 700;
}

.txt-red {
    color: var(--accent-red);
    font-weight: 700;
}

.status-badge {
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge-paid {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.status-badge-unpaid {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.status-badge-returned {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-badge-partially_returned {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ==================== POSTGRESQL CODE ROW INSPECTOR ==================== */
.postgres-inspector-panel {
    display: none !important;
    background: #090a10;
    border: 1px solid #1e2030;
    border-radius: 20px;
    padding: 1.5rem;
    margin-top: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

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

.inspector-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--accent-cyan);
}

.inspector-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.inspector-code {
    background: #06070a;
    border: 1px solid #141624;
    border-radius: 12px;
    padding: 1.25rem;
    overflow-x: auto;
    font-family: monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    color: #c9d1d9;
}

.sql-kw { color: #ff7b72; font-weight: bold; }
.sql-fn { color: #d2a8ff; }
.sql-str { color: #a5d6ff; }
.sql-cmt { color: #8b949e; font-style: italic; }
.sql-val { color: #f2cc60; }

/* Payment Methods buttons */
.pay-method-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 0.65rem 0.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-smooth);
    font-size: 0.8rem;
    font-weight: 700;
    text-align: center;
    font-family: var(--font-sans);
}

.pay-method-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.pay-method-btn.active {
    background: var(--bg-active);
    border-color: var(--accent-purple);
    color: white;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.15);
}

/* Print CSS style to isolate the receipt during browser print operations */
@media print {
    body * {
        visibility: hidden !important;
    }
    #receipt-print-area, #receipt-print-area * {
        visibility: visible !important;
    }
    #receipt-print-area {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        background: #ffffff !important;
        color: #000000 !important;
        box-shadow: none !important;
    }
}

/* Inline stock adjustment buttons */
.btn-stock-adjust {
    transition: var(--transition-smooth);
}

.btn-stock-adjust:hover {
    transform: scale(1.1);
    filter: brightness(1.2);
}

.btn-stock-adjust:active {
    transform: scale(0.95);
}

/* Barcode Scanner pulsing animation */
@keyframes barcode-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
        transform: scale(1);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
        transform: scale(1.1);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
        transform: scale(1);
    }
}

.barcode-pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--accent-green);
    border-radius: 50%;
    animation: barcode-pulse 2s infinite;
}

/* User Profile micro-animations */
#profile-pic-container:hover {
    transform: scale(1.05) rotate(2deg) !important;
    border-color: var(--accent-cyan) !important;
    box-shadow: 0 0 35px rgba(6, 182, 212, 0.5) !important;
}

/* Invoice Paper Theme */
.invoice-paper {
    background-color: #ffffff;
    color: #1f2937;
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
    font-family: var(--font-sans);
    border: 1px solid #e5e7eb;
    margin-bottom: 0.4rem;
}

.invoice-header {
    border-bottom: 1.5px solid #374151;
    padding-bottom: 0.25rem;
    margin-bottom: 0.25rem;
}

.invoice-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.invoice-logo-title {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.invoice-logo-title h1 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #111827;
    margin: 0;
}

.invoice-logo-title span {
    font-size: 0.68rem;
    color: #6b7280;
    margin-top: 0.05rem;
}

.invoice-meta {
    font-size: 0.68rem;
    color: #4b5563;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    text-align: right;
}

.invoice-meta span strong {
    color: #111827;
}

.invoice-customer-details {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    margin-bottom: 0.25rem;
    font-size: 0.74rem;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.35rem;
    color: #374151;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
}

.invoice-table th {
    background: #f3f4f6;
    color: #1f2937;
    font-weight: 700;
    padding: 0.35rem;
    border: 1px solid #d1d5db;
    text-align: center;
}

.invoice-table td {
    padding: 0.35rem;
    border: 1px solid #e5e7eb;
    text-align: center;
    color: #374151;
}

.invoice-table tr:nth-child(even) {
    background: #f9fafb;
}

.invoice-table-btn {
    border: none;
    background: #f3f4f6;
    color: #374151;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.invoice-table-btn:hover {
    background: #e5e7eb;
    color: #111827;
}

.invoice-table-btn.btn-danger {
    color: #ef4444;
}

.invoice-table-btn.btn-danger:hover {
    background: #fee2e2;
}

.invoice-summary-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
    font-size: 0.8rem;
}

.invoice-summary-table td {
    padding: 0.35rem 0.5rem;
    border: none;
    color: #4b5563;
}

.invoice-summary-table .label {
    text-align: right;
    width: 75%;
}

.invoice-summary-table .val {
    text-align: left;
    width: 25%;
    font-weight: bold;
    color: #111827;
}

.invoice-summary-table .grand-total-row td {
    border-top: 2px solid #1f2937;
    font-size: 0.95rem;
    font-weight: 800;
    color: #111827;
    padding-top: 0.6rem;
}

.invoice-summary-table .grand-total-row .val {
    color: #7c3aed;
}

.invoice-words-row td {
    border-top: 1px dashed #d1d5db;
    font-style: italic;
    color: #4b5563;
    font-size: 0.78rem;
    padding: 0.5rem;
    text-align: right;
}

.invoice-signatures {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
    font-size: 0.78rem;
    color: #4b5563;
    padding: 0 0.5rem;
}

.invoice-signature-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    width: 130px;
}

.invoice-signature-line {
    border-top: 1px dashed #d1d5db;
    width: 100%;
    text-align: center;
    padding-top: 0.2rem;
}

.invoice-footer-details {
    margin-top: 1rem;
    border-top: 1px solid #e5e7eb;
    padding-top: 0.6rem;
    text-align: center;
    font-size: 0.68rem;
    color: #9ca3af;
}

/* Discount Input custom styling inside invoice */
.invoice-discount-input {
    width: 120px;
    padding: 0.2rem 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    text-align: right;
    direction: ltr;
    outline: none;
    background: #ffffff;
    color: #111827;
    transition: var(--transition-smooth);
}

.invoice-discount-input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

/* Fullscreen Live Storefront Preview Styling */
#preview-browser-container:fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    padding: 1.5rem !important;
    background: #0c0d12 !important;
    border-radius: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    gap: 1rem !important;
    box-sizing: border-box !important;
    border: none !important;
}

#preview-browser-container:fullscreen #preview-iframe-wrapper {
    flex-grow: 1 !important;
    height: calc(100vh - 100px) !important;
    border-radius: 12px !important;
}

#preview-browser-container:-webkit-full-screen {
    width: 100vw !important;
    height: 100vh !important;
    padding: 1.5rem !important;
    background: #0c0d12 !important;
    border-radius: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    gap: 1rem !important;
    box-sizing: border-box !important;
    border: none !important;
}

#preview-browser-container:-webkit-full-screen #preview-iframe-wrapper {
    flex-grow: 1 !important;
    height: calc(100vh - 100px) !important;
    border-radius: 12px !important;
}

/* ==========================================================================
   Compact Cheque Registration Modal Override (No Scroll / Delicate Layout)
   ========================================================================== */
.cheque-modal-overlay {
    display: none; 
    position: fixed; 
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0; 
    background: rgba(8, 9, 13, 0.85); 
    z-index: 99990; 
    align-items: center; 
    justify-content: center; 
    backdrop-filter: blur(8px); 
    padding: 0.75rem;
}

.cheque-modal-card {
    background: var(--bg-card); 
    border: 1px solid var(--border-glass-active); 
    border-radius: 16px; 
    padding: 1rem 1.25rem; 
    width: 100%; 
    max-width: 520px; 
    box-shadow: 0 15px 40px rgba(6, 182, 212, 0.25); 
    text-align: right; 
    direction: rtl; 
    display: flex; 
    flex-direction: column; 
    gap: 0.85rem;
    max-height: calc(100vh - 1.5rem);
    overflow-y: auto;
}

/* Custom styling for compact scrollbar inside modal card */
.cheque-modal-card::-webkit-scrollbar {
    width: 5px;
}
.cheque-modal-card::-webkit-scrollbar-track {
    background: transparent;
}
.cheque-modal-card::-webkit-scrollbar-thumb {
    background: rgba(6, 182, 212, 0.2);
    border-radius: 10px;
}
.cheque-modal-card::-webkit-scrollbar-thumb:hover {
    background: rgba(6, 182, 212, 0.4);
}

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

.cheque-modal-header-left {
    display: flex; 
    align-items: center; 
    gap: 0.5rem;
}

.cheque-modal-icon-container {
    width: 30px; 
    height: 30px; 
    background: rgba(6, 182, 212, 0.12); 
    color: var(--accent-cyan); 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 0.95rem;
}

.cheque-modal-title {
    margin: 0; 
    font-size: 0.95rem; 
    font-weight: 800; 
    color: white;
}

.cheque-modal-subtitle {
    font-size: 0.65rem; 
    color: var(--text-secondary);
}

.cheque-modal-close {
    background: transparent; 
    border: none; 
    color: var(--text-secondary); 
    cursor: pointer; 
    font-size: 1.25rem; 
    font-weight: bold;
    line-height: 1;
    transition: var(--transition-smooth);
}

.cheque-modal-close:hover {
    color: var(--accent-cyan);
}

.cheque-modal-form {
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 0.55rem 0.75rem;
}

.cheque-modal-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.cheque-modal-form .form-group label {
    font-size: 0.72rem; 
    margin-bottom: 0.1rem; 
    display: block; 
    color: var(--text-secondary);
    font-weight: 600;
}

/* Make form controls within this modal very slim */
.cheque-modal-form .form-input,
.cheque-modal-form .form-select {
    width: 100% !important;
    padding: 0.45rem 0.6rem !important; 
    font-size: 0.76rem !important;
    height: 32px !important;
    box-sizing: border-box !important;
    border-radius: 6px !important;
    background: rgba(0, 0, 0, 0.25) !important;
    border: 1px solid var(--border-glass) !important;
    color: var(--text-primary) !important;
    transition: var(--transition-smooth) !important;
}

.cheque-modal-form .form-input:focus,
.cheque-modal-form .form-select:focus {
    border-color: var(--accent-cyan) !important;
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.15) !important;
}

.cheque-modal-bank-container {
    grid-column: span 2; 
    display: flex; 
    flex-direction: column; 
    gap: 0.2rem;
}

.cheque-modal-bank-label {
    font-weight: 700; 
    color: var(--text-primary); 
    font-size: 0.72rem;
    margin-bottom: 0.1rem;
}

.cheque-modal-bank-grid {
    display: grid; 
    grid-template-columns: repeat(8, 1fr); 
    gap: 0.25rem; 
    margin-top: 0.1rem;
}

/* Bank options are customized with precise paddings and tiny SVG spacing */
.cheque-modal-bank-grid .bank-option {
    background: rgba(255,255,255,0.02) !important; 
    border: 1px solid var(--border-glass) !important; 
    border-radius: 6px !important; 
    padding: 0.25rem 0.05rem !important; 
    text-align: center; 
    cursor: pointer; 
    transition: all 0.2s ease !important; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center;
    gap: 0.15rem !important;
}

.cheque-modal-bank-grid .bank-option:hover {
    background: rgba(6, 182, 212, 0.05) !important;
    border-color: rgba(6, 182, 212, 0.3) !important;
}

.cheque-modal-bank-grid .bank-option svg {
    width: 20px !important;
    height: 20px !important;
    transition: transform 0.2s ease;
}

.cheque-modal-bank-grid .bank-option:hover svg {
    transform: scale(1.08);
}

.cheque-modal-bank-grid .bank-option span {
    font-size: 0.58rem !important; 
    color: var(--text-secondary) !important; 
    font-weight: 700 !important;
    white-space: nowrap;
}

.cheque-modal-other-bank {
    display: none; 
    margin-top: 0.2rem;
}

.cheque-modal-actions {
    grid-column: span 2; 
    display: flex; 
    gap: 0.5rem; 
    margin-top: 0.3rem; 
    justify-content: flex-end;
}

.cheque-modal-btn {
    padding: 0.4rem 1.25rem !important; 
    font-size: 0.78rem !important;
    font-weight: 700;
    border-radius: 6px !important;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
}

.cheque-modal-btn-cancel {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--border-glass) !important;
    color: var(--text-secondary) !important;
}

.cheque-modal-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
}

.cheque-modal-btn-submit {
    background: linear-gradient(135deg, var(--accent-cyan), #0891b2) !important;
    color: white !important;
    box-shadow: 0 3px 10px rgba(6, 182, 212, 0.2) !important;
}

.cheque-modal-btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(6, 182, 212, 0.3) !important;
}

/* User Profile Sub-tabs layout styling */
.tab-panel#tab-profile .inst-sub-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 0.5rem;
}

.tab-panel#tab-profile .inst-sub-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.45rem 1rem;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.tab-panel#tab-profile .inst-sub-tab-btn:hover {
    background: rgba(255, 255, 255, 0.03);
    color: white;
}

.tab-panel#tab-profile .inst-sub-tab-btn.active {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-purple);
    box-shadow: inset 0 0 6px rgba(139, 92, 246, 0.15);
}

.tab-panel#tab-profile .inst-tab-view {
    display: none;
}

.tab-panel#tab-profile .inst-tab-view.active {
    display: block;
}



