/* Input Mode Toggle */
.input-mode-toggle {
    display: flex;
    background-color: var(--bg-primary);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    width: fit-content;
}

.mode-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-btn:hover {
    color: var(--text-primary);
    background-color: var(--bg-secondary);
}

.mode-btn.active {
    background-color: var(--accent);
    color: var(--bg-primary);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.auto-extract-input {
    display: flex;
    gap: 8px;
}

.btn-extract {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 16px;
    background-color: var(--accent);
    color: var(--bg-primary);
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-extract:hover:not(:disabled) {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn-extract:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-extract.loading {
    opacity: 0.8;
}

.spin {
    animation: spin 1s linear infinite;
}

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

.extraction-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--accent);
    margin-top: 8px;
}

.auto-mode-cursor {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2339FF14' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'%3E%3C/path%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'%3E%3C/path%3E%3C/svg%3E") 12 12, pointer !important;
}

/* Modern Global Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

/* Disable number input spin buttons and scroll interaction */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
    border: 2px solid var(--bg-primary); /* ایجاد فاصله بین تامب و ترک */
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* برای فایرفاکس */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--bg-primary);
}

/* Modern Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none; /* غیرفعال کردن انتخاب متن به صورت سراسری */
    -webkit-user-drag: none; /* غیرفعال کردن درگ کردن المان‌ها */
}

/* استثنا برای فیلدهای ورودی و جدول‌ها */
input, textarea, select, .table td, .table th, [contenteditable="true"] {
    user-select: text;
}

/* Remove Number Input Spinners */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    direction: rtl;
    transition: background-color 0.4s ease, color 0.4s ease;
    font-family: 'Vazirmatn', sans-serif;
    overflow-x: hidden;
}

/* Font preview styles */
.font-vazir {
    font-family: 'Vazirmatn', sans-serif !important;
}

.font-shabnam {
    font-family: 'Shabnam', sans-serif !important;
}

.font-iransans {
    font-family: 'Samim', sans-serif !important;
}

body.font-vazir, body.font-vazir * {
    font-family: 'Vazirmatn', sans-serif !important;
}

body.font-shabnam, body.font-shabnam * {
    font-family: 'Shabnam', sans-serif !important;
}

body.font-iransans, body.font-iransans * {
    font-family: 'Samim', sans-serif !important;
}

/* Enhanced Sidebar */
.layout {
    display: flex;
    width: 100%;
    min-height: 100vh;
    position: relative;
}


.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 20px;
    color: var(--accent);
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--accent);
    color: var(--bg-primary);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
}


.menu-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.group-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-primary);
    padding: 8px 16px;
    font-weight: 800;
    background-color: rgba(var(--accent-rgb, 57, 255, 20), 0.08);
    border-radius: 8px;
    display: inline-block;
    width: fit-content;
    margin-right: 4px;
}

.menu-list {
    list-style: none;
    padding: 0;
}

.menu-item {
    margin-bottom: 4px;
}

.menu-item a, .menu-item.no-hover > div {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 14px;
    user-select: none;
    -webkit-user-drag: none;
}

.menu-item a:hover {
    background-color: rgba(var(--accent-rgb, 57, 255, 20), 0.1);
    color: var(--accent);
}

.menu-item.active a {
    background-color: var(--accent);
    color: var(--bg-primary);
    box-shadow: 0 4px 12px var(--shadow-color);
}

/* Palette Selector */
.palette-selector-container, .font-selector-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.font-options {
    display: flex;
    gap: 6px;
    background-color: var(--bg-primary);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.font-btn {
    flex: 1;
    padding: 10px 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.font-btn:hover {
    color: var(--text-primary);
    background-color: var(--border-color);
}

.font-btn.active {
    background-color: var(--accent);
    color: var(--bg-primary);
    font-weight: 600;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.palette-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.palette-options {
    display: flex;
    gap: 8px;
}

.palette-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    transition: transform 0.2s;
}

.palette-btn:hover {
    transform: scale(1.2);
}

.palette-btn.active {
    border-color: var(--text-primary);
    box-shadow: 0 0 8px var(--accent);
}

/* Theme Toggle */
.theme-toggle-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    cursor: pointer;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: 12px;
}

.theme-toggle-info {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
}

.theme-switch {
    width: 44px;
    height: 24px;
    background: var(--border-color);
    border-radius: 20px;
    position: relative;
    transition: all 0.3s ease;
}

.theme-switch.dark {
    background: var(--accent);
}

.theme-switch-handle {
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    right: 3px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-switch.light .theme-switch-handle {
    right: calc(100% - 21px);
}

/* Main Content Adjustments */
.main-content {
    flex: 1;
    margin-right: 312px;
    padding: 32px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

.btn-primary {
    background-color: var(--accent);
    color: var(--bg-primary);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-color);
    filter: brightness(1.1);
}

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

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

.btn-outline:hover {
    background-color: var(--bg-primary);
    border-color: var(--text-secondary);
    transform: translateY(-2px);
}

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

/* Page Header & Layout */
.page-container {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding: 8px 4px;
    width: 100%;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    position: relative;
    display: inline-block;
}

.page-title h1::after {
    content: '';
    position: absolute;
    bottom: -4px;
    right: 0;
    width: 40px;
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
}

/* Section Header Spacing */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.section-title i, .section-title svg {
    color: var(--accent);
}

/* Enhanced Cards */
.stat-card {
    background-color: var(--bg-secondary);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px var(--shadow-color);
}

.stat-icon {
    background-color: rgba(var(--accent-rgb, 57, 255, 20), 0.1);
    color: var(--accent);
}

.stat-number {
    font-size: 28px;
    letter-spacing: -0.5px;
}

/* Enhanced Table */
.section-card {
    background-color: var(--bg-secondary);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    padding: 24px;
    margin-top: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.03);
}

.table-wrapper {
    overflow: auto;
    max-height: 600px;
    padding-bottom: 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    position: relative; /* برای مدیریت بهتر لایه‌ها */
}

.table-wrapper::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);

    margin-top: 8px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px; /* کمی کوچک‌تر برای جا شدن بهتر */
    min-width: 900px; /* جلوگیری از فشرده شدن بیش از حد ستون‌ها */
}

.table th, .table td {
    padding: 12px 10px; /* کاهش پدینگ برای صرفه‌جویی در فضا */
    text-align: right;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap; /* جلوگیری از شکستن خطوط */
}

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

.table th {
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 10;
    user-select: none;
}

.table tr:hover td {
    background-color: rgba(var(--accent-rgb, 57, 255, 20), 0.05);
}

.table th:first-child {
    border-top-right-radius: 12px;
}

.table th:last-child {
    border-top-left-radius: 12px;
}

/* Action Buttons in Tables */
.edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background-color: rgba(var(--accent-rgb, 57, 255, 20), 0.1);
    color: var(--accent);
    border: 1px solid rgba(var(--accent-rgb, 57, 255, 20), 0.2);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.edit-btn:hover {
    background-color: var(--accent);
    color: var(--bg-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

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

.delete-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background-color: rgba(255, 77, 77, 0.1);
    color: #ff4d4d;
    border: 1px solid rgba(255, 77, 77, 0.2);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.delete-btn:hover {
    background-color: #ff4d4d;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 77, 77, 0.3);
}

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

/* Modern Confirm Modal Styles */
.modern-confirm {
    max-width: 450px !important;
    border-radius: 24px !important;
    padding: 40px 30px !important;
    background: rgba(var(--bg-secondary-rgb, 20, 20, 20), 0.8) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
}

.confirm-icon-wrapper-modern {
    width: 90px;
    height: 90px;
    border-radius: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 24px;
    position: relative;
}

.confirm-icon-wrapper-modern::after {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 40px;
    opacity: 0.2;
    z-index: -1;
}

.confirm-icon-wrapper-modern.danger {
    background: linear-gradient(135deg, #ff4d4d, #f44336);
    color: white;
    box-shadow: 0 10px 20px rgba(255, 77, 77, 0.3);
}

.confirm-icon-wrapper-modern.danger::after {
    background: #ff4d4d;
}

.confirm-icon-wrapper-modern.warning {
    background: linear-gradient(135deg, #ffaa00, #ff9800);
    color: white;
    box-shadow: 0 10px 20px rgba(255, 170, 0, 0.3);
}

.confirm-icon-wrapper-modern.warning::after {
    background: #ffaa00;
}

.confirm-icon-wrapper-modern.info {
    background: linear-gradient(135deg, var(--accent), #2196f3);
    color: white;
    box-shadow: 0 10px 20px rgba(var(--accent-rgb), 0.3);
}

.confirm-icon-wrapper-modern.info::after {
    background: var(--accent);
}

.confirm-icon-wrapper-modern.success {
    background: linear-gradient(135deg, #00e676, #4caf50);
    color: white;
    box-shadow: 0 10px 20px rgba(0, 230, 118, 0.3);
}

.confirm-icon-wrapper-modern.success::after {
    background: #00e676;
}

.confirm-title-modern {
    font-size: 24px;
    font-weight: 900;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.confirm-message-modern {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 32px;
}

.confirm-actions-modern {
    display: flex;
    gap: 16px;
    width: 100%;
}

.btn-confirm-modern, .btn-cancel-modern {
    flex: 1;
    height: 54px;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

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

.btn-cancel-modern:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.btn-confirm-modern.danger {
    background: #ff4d4d;
    color: white;
}

.btn-confirm-modern.warning {
    background: #ffaa00;
    color: white;
}

.btn-confirm-modern.info {
    background: var(--accent);
    color: var(--bg-primary);
}

.btn-confirm-modern.success {
    background: #00e676;
    color: white;
}

.btn-confirm-modern:hover:not(:disabled) {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.btn-confirm-modern:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Confirm Modal Styles */
.confirm-modal {
    max-width: 400px !important;
    padding: 40px 32px !important;
    text-align: center;
}

.confirm-modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.confirm-icon-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 8px;
}

.confirm-icon-wrapper.danger {
    background-color: rgba(255, 77, 77, 0.1);
    color: #ff4d4d;
}

.confirm-icon-wrapper.warning {
    background-color: rgba(255, 170, 0, 0.1);
    color: #ffaa00;
}

.confirm-icon-wrapper.info {
    background-color: rgba(var(--accent-rgb), 0.1);
    color: var(--accent);
}

.confirm-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}

.confirm-message {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* Boost Order Panel Styles */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.full-width {
    grid-column: span 2;
}

.history-tags {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

.history-label {
    font-size: 11px;
    color: var(--text-secondary);
}

.history-tag {
    font-size: 11px;
    background: rgba(var(--accent-rgb, 57, 255, 20), 0.1);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(var(--accent-rgb, 57, 255, 20), 0.2);
}

.amount-formatted {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: var(--text-secondary);
    pointer-events: none;
}

.comments-section {
    background: var(--bg-secondary);
    padding: 20px;
    direction: ltr;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-top: 20px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: var(--accent);
}

.section-header h3 {
    margin: 0;
    font-size: 16px;
}

/* Comment items and lists are now at the end of the file */
.comment-text {
    font-size: 13px;
    line-height: 1.6;
}

.no-comments {
    text-align: center;
    color: var(--text-secondary);
    padding: 20px;
    font-size: 13px;
}

.order-number-cell, .user-cell, .duration-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.booster-info {
    display: flex;
    align-items: center;
    gap: 5px;
}

.history-indicator {
    font-size: 10px;
    color: var(--accent);
    background: rgba(var(--accent-rgb, 57, 255, 20), 0.1);
    padding: 1px 4px;
    border-radius: 4px;
}

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

.amount-val {
    font-weight: bold;
}

.amount-desc {
    color: var(--text-secondary);
    cursor: help;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.status-badge.pending {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.status-badge.in_progress {
    background: rgba(0, 123, 255, 0.1);
    color: #007bff;
}

.status-badge.completed {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.status-badge.cancelled {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    width: 100%;
    margin-top: 12px;
}

.confirm-actions .btn {
    flex: 1;
    justify-content: center;
    padding: 12px;
}

.btn-cancel {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-cancel:hover {
    background-color: var(--border-color);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.btn-danger {
    background-color: #ff4d4d;
    color: white;
    box-shadow: 0 4px 12px rgba(255, 77, 77, 0.3);
}

.btn-danger:hover {
    background-color: #ff3333;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 77, 77, 0.4);
}

.btn-warning {
    background-color: #ffaa00;
    color: white;
    box-shadow: 0 4px 12px rgba(255, 170, 0, 0.3);
}

.btn-success {
    background-color: #2f8f4a;
    color: white;
    box-shadow: 0 4px 12px rgba(47, 143, 74, 0.25);
}

.btn-success:hover {
    background-color: #287f40;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(47, 143, 74, 0.35);
}

.payment-action-btn {
    min-width: 104px;
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 13px;
    line-height: 1;
}

/* Portal Tooltip Styles */
.portal-tooltip {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    text-align: right;
    border-radius: 10px;
    padding: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 25px var(--shadow-color);
    font-size: 13px;
    max-width: 250px;
    line-height: 1.5;
    pointer-events: auto;
    z-index: 999999;
}

.portal-tooltip .tooltip-arrow {
    content: "";
    position: absolute;
    border-width: 6px;
    border-style: solid;
}

.portal-tooltip.bottom .tooltip-arrow {
    bottom: 100%;
    left: 50%;
    margin-left: -6px;
    border-color: transparent transparent var(--bg-secondary) transparent;
}

.portal-tooltip.top .tooltip-arrow {
    top: 100%;
    left: 50%;
    margin-left: -6px;
    border-color: var(--bg-secondary) transparent transparent transparent;
}

/* End of Tooltip Styles */

.tooltip-container:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.btn-warning:hover {
    background-color: #e69900;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 170, 0, 0.4);
}


/* Modern Global Loader */
.main-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: all 0.5s ease;
}

.main-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.loader-logo-container {
    position: relative;
    width: 100px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader-logo-img {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    z-index: 2;
    animation: pulseLogo 2s infinite ease-in-out;
}

.loader-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--accent);
    border-bottom-color: var(--accent);
    animation: spin 1.5s linear infinite;
    z-index: 1;
}

.loader-ring::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-left-color: var(--accent);
    border-right-color: var(--accent);
    opacity: 0.5;
    animation: spinReverse 2s linear infinite;
}

.loader-text {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.loader-dots span {
    animation: loadingDots 1.4s infinite;
    opacity: 0;
}

.loader-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loader-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes pulseLogo {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 0px var(--shadow-color));
    }
    50% {
        transform: scale(1.05);
        filter: drop-shadow(0 0 20px var(--shadow-color));
    }
}

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

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

@keyframes loadingDots {
    0%, 100% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
}

.spinner {
    width: 45px;
    height: 45px;
    border: 4px solid var(--accent);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* DatePicker Global Fixes */
.rmdp-wrapper,
.rmdp-calendar,
.rmdp-time-picker {
    background-color: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 10px 30px var(--shadow-color) !important;
}

.rmdp-header-values,
.rmdp-week-day,
.rmdp-day span,
.rmdp-button,
.rmdp-time-picker input {
    color: var(--text-primary) !important;
    background-color: transparent !important;
}

.rmdp-day.rmdp-deactive {
    color: var(--text-secondary) !important;
}

/* Payment Panel Styles */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.status-badge.completed {
    background-color: rgba(var(--accent-rgb, 57, 255, 20), 0.1);
    color: var(--accent);
}

.status-badge.pending {
    background-color: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.date-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 10px;
}

.date-input {
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--bg-primary);
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 400px;
}

.search-box input {
    border: none;
    background: transparent;
    color: var(--text-primary);
    width: 100%;
    outline: none;
    font-size: 14px;
}


.rmdp-arrow {
    border-color: var(--text-primary) !important;
}

.rmdp-arrow-container {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    height: 28px !important;
    padding: 0 !important;
    transition: all 0.2s ease !important;
    border: 1px solid transparent !important;
}

.rmdp-arrow-container svg {
    color: var(--text-primary);
    transition: all 0.2s ease !important;
}

.rmdp-arrow-container:hover {
    background-color: var(--bg-secondary) !important;
    border: 1px solid var(--accent) !important;
    border-radius: 6px !important;
    box-shadow: 0 0 10px var(--shadow-color) !important;
}

.rmdp-arrow-container:hover svg {
    color: var(--accent) !important;
}

/* Remove old arrow styles since we use Feather icons */
.rmdp-arrow,
.rmdp-arrow-container:hover .rmdp-arrow {
    display: none !important;
}

.rmdp-day.rmdp-selected span:not(.highlight),
.rmdp-day.rmdp-range span,
.rmdp-day.rmdp-range-hover span {
    background-color: var(--accent) !important;
    color: #FFFFFF !important;
    box-shadow: 0 0 10px var(--shadow-color) !important;
}

.rmdp-day.rmdp-range {
    background-color: rgba(var(--accent-rgb, 57, 255, 20), 0.15) !important;
}

.rmdp-day:not(.rmdp-disabled, .rmdp-day-hidden) span:hover {
    background-color: var(--accent) !important;
    color: #FFFFFF !important;
}

.rmdp-today span {
    background-color: var(--text-secondary) !important;
    color: var(--bg-secondary) !important;
}

.rmdp-shadow {
    box-shadow: 0 10px 30px var(--shadow-color) !important;
}

[data-feather] {
    display: inline-block;
    vertical-align: middle;
}

/* Boost Order Cards Redesign */
.boost-sections {
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin-top: 20px;
}

.boost-section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 40px;
}

.boost-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.boost-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 800;
    padding: 0 10px;
}

.boost-cards-container {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 25px 20px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
}

.boost-cards-container::-webkit-scrollbar {
    height: 6px;
}

.boost-cards-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.boost-card {
    flex: 0 0 300px;
    height: 220px; /* افزایش ارتفاع برای فضای بیشتر */
    border-radius: 24px;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    cursor: default;
    margin: 10px 5px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.boost-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

.boost-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg,
    rgba(0, 0, 0, 0.2) 0%,
    rgba(0, 0, 0, 0.6) 40%,
    rgba(0, 0, 0, 0.95) 100%);
    padding: 12px 14px 10px 14px; /* کاهش پدینگ کلی */
    display: flex;
    flex-direction: column;
    gap: 8px; /* کاهش فاصله بین سکشن‌ها */
    color: white;
}

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

.boost-order-num {
    font-size: 13px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

.boost-edit-icon {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.boost-edit-icon:hover {
    background: var(--accent);
    color: var(--bg-primary);
    transform: translateY(-2px);
}

.boost-edit-icon.delete:hover {
    background: #ff4d4d;
}

.boost-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.boost-names-row {
    display: flex;
    gap: 6px;
    width: 100%;
}

.boost-info-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 8px;
    border-radius: 10px;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.info-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    opacity: 0.8;
}

.boost-info-item span {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.boost-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}

.price-tag {
    flex: 1;
    text-align: center;
    padding: 6px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 13px;
}

.price-tag.primary {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.2);
}

.price-tag.accent {
    background: rgba(var(--accent-rgb), 0.15);
    color: var(--accent);
    border: 1px solid rgba(var(--accent-rgb), 0.2);
}

.boost-deadline-row {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
}

.boost-card-footer {
    margin-top: auto;
    padding-bottom: 2px;
}

.boost-progress-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 2px;
}

.progress-label {
    display: flex;
    align-items: center;
    gap: 4px;
}

.progress-label svg {
    color: var(--accent);
}

.overdue-text {
    color: #ff4d4d;
}

.boost-progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.boost-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, #00f2fe 100%);
    border-radius: 10px;
    position: relative;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.boost-progress-fill.overdue {
    background: linear-gradient(90deg, #ff4d4d 0%, #f093fb 100%);
    width: 100% !important;
}

.progress-shimmer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
            90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.2) 50%,
            transparent 100%
    );
    animation: progress-shimmer 2s infinite linear;
}

@keyframes progress-shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.status-badge {
    width: 100%;
    text-align: center;
    padding: 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.status-badge.completed {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.cancelled {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.boost-amount-tag {
    font-weight: 800;
    font-size: 15px;
    color: var(--accent);
}

.boost-empty-state {
    width: 100%;
    padding: 40px;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Shimmer Animation */
@keyframes shimmer {
    0% {
        background-position: -468px 0;
    }
    100% {
        background-position: 468px 0;
    }
}

.boost-card-placeholder {
    flex: 0 0 300px;
    height: 180px;
    border-radius: 20px;
    background: #1a1a1a;
    background-image: linear-gradient(
            to right,
            #1a1a1a 0%,
            #2a2a2a 20%,
            #1a1a1a 40%,
            #1a1a1a 100%
    );
    background-repeat: no-repeat;
    background-size: 800px 180px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px dashed var(--border-color);
    animation: shimmer 1.5s infinite linear forwards;
    margin: 5px 0;
}

.boost-placeholder-icon {
    color: var(--accent);
    opacity: 0.3;
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.2;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.5;
    }
}

.feather-icon {
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.feather-sm {
    width: 16px;
    height: 16px;
    stroke-width: 1.5;
}

.feather-md {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

.feather-lg {
    width: 24px;
    height: 24px;
    stroke-width: 2.5;
}

/* Modern Modal System */
.comments-section {
    margin-top: 24px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 16px;
}

.comments-section .section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.comments-section .section-header h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

/* Comment Section Styles */
.comment-input-area {
    display: flex;
    flex-direction: row;
    align-items: center;
    direction: rtl;
    gap: 10px;
    margin-bottom: 10px;
}

.btn-send-comment {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(var(--accent-rgb), 0.3);
}

.btn-send-comment:hover:not(:disabled) {
    transform: scale(1.05) rotate(-10deg);
    box-shadow: 0 6px 15px rgba(var(--accent-rgb), 0.4);
}

.btn-send-comment:disabled {
    background: var(--bg-primary);
    color: var(--text-secondary);
    opacity: 0.5;
    cursor: not-allowed;
}

.comment-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

.comment-time {
    font-size: 10px;
    opacity: 0.6;
}

.comment-input-area .form-textarea,
.comment-input-area .form-input {
    flex: 1;
    min-height: 45px;
    height: 45px;
    padding: 10px 15px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    resize: none;
    transition: all 0.2s;
}

.comment-input-area {
    display: flex;
    gap: 10px;
    align-items: center;
    background: var(--bg-primary);
    padding: 8px;
    border-radius: 25px;
    border: 1px solid var(--border-color);
}

.comment-input-area .form-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 8px 15px;
    color: var(--text-primary);
    font-size: 14px;
}

.comment-input-area .form-input:focus {
    outline: none;
}

.comment-input-area .btn-modern-primary {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: var(--accent);
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.comment-input-area .btn-modern-primary:hover {
    transform: scale(1.05);
    background: var(--accent-hover, var(--accent));
}

.comment-input-area .btn-modern-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.comments-list {
    background: rgba(0, 0, 0, 0.05);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background-image: radial-gradient(var(--border-color) 0.5px, transparent 0.5px);
    background-size: 15px 15px;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    scrollbar-width: thin;
}

.comments-list::-webkit-scrollbar {
    width: 4px;
}

.comments-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.comment-item {
    padding: 8px 12px;
    border-radius: 18px;
    width: fit-content;
    max-width: 85%;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    position: relative;
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
    animation: messageAppear 0.3s ease-out;
}

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

.comment-item.admin-self {
    align-self: flex-end;
    background: rgba(var(--accent-rgb), 0.15);
    border-color: var(--accent);
    border-bottom-right-radius: 2px;
}

.comment-item.admin-other {
    align-self: flex-start;
    background: var(--bg-secondary);
    border-bottom-left-radius: 2px;
}

.comment-item.creator-comment {
    background: rgba(255, 159, 67, 0.1); /* Orange/Gold tint for senior admins */
    border-color: #ff9f43;
}

.admin-name {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    font-size: 11px;
    font-weight: 800;
    margin-bottom: 4px;
    opacity: 0.9;
}

.comment-item.admin-self .admin-name {
    color: var(--accent);
    text-align: left; /* Name on the right side for self but aligned left inside bubble */
}

.comment-item.admin-other .admin-name {
    color: #3b82f6; /* Blue for others */
}

.comment-item.creator-comment .admin-name {
    color: #ff9f43; /* Orange for creator */
}

.comment-content-wrapper {
    display: flex;
    flex-direction: column;
    position: relative;
}

.comment-text {
    font-size: 14px;
    line-height: 1.4;
    color: inherit;
    white-space: pre-wrap;
    word-break: break-word;
    padding-bottom: 4px;
}

.comment-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    font-size: 10px;
    opacity: 0.7;
    margin-top: 2px;
    align-self: flex-end;
    pointer-events: none;
    min-width: 45px;
}

.admin-self .comment-footer {
    color: rgba(255, 255, 255, 0.8);
}

.admin-other .comment-footer {
    color: var(--text-secondary);
}

.comment-time {
    font-family: 'Tahoma', sans-serif;
    direction: ltr;
}

.comment-status {
    font-size: 12px;
    font-weight: bold;
}

.no-comments {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    opacity: 0.6;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    width: 1000px;
    max-width: 95vw;
    max-height: 90vh;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.modal-container > form {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.modal-overlay.active .modal-container {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
}

.modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.icon-wrapper {
    width: 36px;
    height: 36px;
    background: var(--accent);
    color: var(--bg-primary);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    transition: 0.2s;
}

.close-btn:hover {
    background: rgba(255, 0, 0, 0.1);
    color: #ff4d4d;
    border-radius: 8px;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-start;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
    flex-shrink: 0;
}

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

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

/* Modern Form Elements */
.modern-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-sections {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.section-heading {
    font-size: 15px;
    font-weight: 600;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border-color);
}

.section-header-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border-color);
    margin-bottom: 16px;
}

.section-header-inline .section-heading {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.btn-add-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--accent);
    border: 1px dashed var(--accent);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    width: fit-content;
}

.btn-add-row:hover {
    background: rgba(var(--accent-rgb), 0.2);
    transform: translateY(-2px);
}

.payments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.payment-row {
    background: rgba(255, 255, 255, 0.02);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.payment-row-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr) auto; /* نمایش ۳ اینپوت در هر ردیف */
    gap: 16px;
    align-items: flex-end;
}

.highlight-price {
    color: #bb86fc !important;
    background: rgba(187, 134, 252, 0.05) !important;
    border-color: rgba(187, 134, 252, 0.2) !important;
}

.payout-highlight {
    color: #03dac6 !important;
    background: rgba(3, 218, 198, 0.05) !important;
    border-color: rgba(3, 218, 198, 0.2) !important;
}

.net-highlight {
    color: #00e676 !important;
    border-color: rgba(0, 230, 118, 0.2) !important;
    direction: ltr !important;
    text-align: right !important;
}

.tax-highlight {
    color: #ff4d4d !important;
    background: rgba(255, 77, 77, 0.05) !important;
    border-color: rgba(255, 77, 77, 0.2) !important;
    direction: ltr !important;
    text-align: right !important;
}

.btn-remove-row {
    background: rgba(255, 77, 77, 0.1);
    color: #ff4d4d;
    border: 1px solid rgba(255, 77, 77, 0.2);
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-remove-row:hover {
    background: #ff4d4d;
    color: white;
}

.total-payment-summary {
    margin-top: 24px;
    padding: 16px;
    background: rgba(var(--accent-rgb), 0.05);
    border-radius: 12px;
    border: 1px solid var(--accent);
    display: flex;
    gap: 20px;
}

.total-payment-summary .form-group {
    flex: 1;
    margin-bottom: 0;
}

.total-highlight {
    font-size: 18px !important;
    font-weight: 800 !important;
    color: var(--accent) !important;
    text-align: center;
}

.section-header-clickable {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 8px 12px;
    background: rgba(var(--accent-rgb), 0.03);
    border-radius: 8px;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.section-header-clickable:hover {
    background: rgba(var(--accent-rgb), 0.08);
    border-color: rgba(var(--accent-rgb), 0.2);
}

.section-header-clickable .section-heading {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.collapse-icon {
    color: var(--accent);
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.collapsible-section.collapsed .section-grid {
    display: none;
}

.animated-fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 16px 4px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-input, .form-select, .form-textarea, .form-input-display {
    width: 100%;
    padding: 10px 12px;
    height: 45px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
    box-sizing: border-box;
    text-align: right;
}

.form-input-display {
    min-height: 45px;
    display: flex;
    align-items: center;
}

.form-input-display.readonly {
    background: rgba(255, 255, 255, 0.02);
    cursor: default;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(57, 255, 20, 0.1);
}

.form-input.error-border {
    border-color: #ef4444 !important;
    background-color: rgba(239, 68, 68, 0.05) !important;
}

.form-input.error-border:focus {
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2) !important;
}

.form-input.highlight {
    border-width: 2px;
    border-color: var(--accent);
}

.form-input.readonly {
    background: rgba(255, 255, 255, 0.05);
    cursor: not-allowed;
    border-style: dashed;
}

.static-text {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    padding: 12px;
    border-radius: 12px;
    color: var(--text-primary);
    font-weight: 500;
    cursor: default;
    min-height: 45px;
    display: flex;
    align-items: center;
    text-align: right;
}

.error-banner {
    background: rgba(255, 77, 77, 0.1);
    border: 1px solid #ff4d4d;
    color: #ff4d4d;
    padding: 12px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 24px;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(255, 77, 77, 0.05);
}

.error-banner .retry-btn {
    background: #ff4d4d;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.error-banner .retry-btn:hover {
    background: #ff3333;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(255, 77, 77, 0.2);
}

.error-banner .retry-btn:active {
    transform: translateY(0);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

/* React Multi Date Picker Custom Styles */
.rmdp-container {
    width: 100%;
}

.rmdp-calendar {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2) !important;
}

.rmdp-day span {
    color: var(--text-primary) !important;
}

.rmdp-day.rmdp-today span {
    background-color: var(--accent) !important;
    color: var(--bg-primary) !important;
}

.rmdp-day.rmdp-selected span {
    background-color: var(--accent) !important;
    color: var(--bg-primary) !important;
    box-shadow: 0 4px 10px var(--shadow-color) !important;
}

.rmdp-day:not(.rmdp-disabled):not(.rmdp-day-hidden) span:hover {
    background-color: rgba(var(--accent-rgb, 57, 255, 20), 0.2) !important;
    color: var(--text-primary) !important;
}

.rmdp-header-values {
    color: var(--accent) !important;
    font-weight: 700 !important;
}

.rmdp-arrow {
    border-color: var(--text-secondary) !important;
}

.rmdp-arrow:hover {
    background-color: var(--border-color) !important;
}

.rmdp-week-day {
    color: var(--text-secondary) !important;
    font-weight: 600 !important;
}

.rmdp-panel-header, .rmdp-panel-body::-webkit-scrollbar-thumb {
    background-color: var(--accent) !important;
}

.rmdp-input {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    color: var(--text-primary) !important;
    font-size: 14px !important;
    transition: all 0.3s ease !important;
    font-family: inherit !important;
    text-align: right;
}

.rmdp-input:focus {
    outline: none !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(57, 255, 20, 0.1) !important;
}

/* Modal Footer Styles */
.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-start; /* Moved to left as requested */
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
    flex-shrink: 0;
}

.btn-cancel {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: 0.2s;
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
}

.btn-submit {
    padding: 10px 24px;
    background: var(--accent);
    border: none;
    color: var(--bg-primary);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s;
    box-shadow: 0 4px 12px var(--shadow-color);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--shadow-color);
    filter: brightness(1.1);
}

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

/* Modal Table Styles */
.payments-table-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    max-height: 480px; /* حدوداً برای ۱۰ ردیف */
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 8px;
}

.modal-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0; /* تغییر از 0 8px برای چسبیدن هدر */
}

.modal-table th {
    text-align: right;
    padding: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
    user-select: none;
    position: sticky;
    top: 0;
    background: var(--bg-secondary); /* هدر باید پس‌زمینه داشته باشد تا ردیف‌ها زیرش دیده نشوند */
    z-index: 10;
    border-bottom: 1px solid var(--border-color);
}

.modal-table td {
    padding: 8px; /* پدینگ ثابت */
    vertical-align: middle;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03); /* جداکننده ردیف‌ها */
}

.modal-table .form-input {
    min-height: 38px;
    padding: 8px 12px;
    font-size: 14px;
}

.table-display {
    min-height: 38px;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.btn-remove-row-mini {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 77, 77, 0.1);
    color: #ff4d4d;
    border: 1px solid rgba(255, 77, 77, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-remove-row-mini:hover {
    background: #ff4d4d;
    color: white;
}

@media (max-width: 768px) {
    .section-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .section-grid {
        grid-template-columns: 1fr;
    }
}

/* Modal legacy styles removed */
/* Icon color alignment inside buttons */
.btn .feather-icon {
    width: 18px;
    height: 18px;
}

.btn-outline .feather-icon {
    stroke: var(--accent);
}

.btn-primary .feather-icon {
    stroke: var(--bg-primary);
}

/* Modern Theme Toggle */
.theme-toggle-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.theme-toggle-wrapper:hover {
    /* No color change on hover as requested */
}

/* Theme toggle hover effects removed */

.theme-toggle-info {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
}

.theme-toggle-info span {
    font-size: 14px;
    font-weight: 500;
}

.theme-switch {
    width: 42px;
    height: 22px;
    background-color: var(--border-color);
    border-radius: 20px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-switch.dark {
    background-color: var(--accent);
}

.theme-switch-handle {
    width: 16px;
    height: 16px;
    background-color: #fff;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.theme-switch.dark .theme-switch-handle {
    transform: translateX(0);
}

.theme-switch.light .theme-switch-handle {
    transform: translateX(0);
}

/* Old theme toggle styles removed */

/* Modern Logout Buttons */
.logout-group {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.modern-logout-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: rgba(255, 77, 77, 0.05);
    color: #ff4d4d;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logout-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 77, 77, 0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.modern-logout-btn:hover {
    background: #ff4d4d;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 77, 77, 0.3);
}

.modern-logout-btn:hover .logout-icon-wrapper {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(-15deg);
}

/* Modern Mini Logout Button (Near Username) */
.modern-mini-logout {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 77, 77, 0.2);
    background: rgba(255, 77, 77, 0.05);
    color: #ff4d4d;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.modern-mini-logout span {
    font-size: 11px;
    font-weight: 600;
}

.modern-mini-logout:hover {
    background: #ff4d4d;
    color: white;
    border-color: #ff4d4d;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(255, 77, 77, 0.2);
}

.mini-logout-btn {
    display: none;
}

.user-logout-btn {
    display: none;
}

/* Input with Badge Styles */
.input-with-badge {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-with-badge .form-input {
    width: 100%;
    padding-left: 55px; /* Space for the badge on the left in RTL */
}

.input-badge {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--accent-color);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    pointer-events: none;
    border: 1px solid rgba(var(--accent-rgb), 0.2);
    z-index: 1;
}

/* Handle LTR inputs if needed, but since the app is RTL, we prioritize left placement for badges */
[dir="rtl"] .input-with-badge .form-input {
    padding-left: 55px;
    padding-right: 12px;
}

[dir="rtl"] .input-badge {
    left: 12px;
    right: auto;
}

.skeleton-row td {
    padding: 14px 10px;
}

.skeleton {
    height: 12px;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    background: #2a2f3a;
}

.skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(
            90deg,
            transparent,
            rgba(255, 255, 255, 0.12),
            transparent
    );
    animation: skeleton-shimmer 1.4s infinite;
}

@keyframes skeleton-shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* ستون عملیات */
.skeleton-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.skeleton-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
}

.notif-badge {
    background: #ff3b3b;
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-right: auto;
}

.notif-badge-collapsed {
    background: #ff3b3b;
    position: absolute;
    right: 52px;
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-right: auto;
}
