/* ============================================
   استایل داشبورد مدیریتی - نسخه کامل با طراحی مدرن و شیشه‌ای
   مسیر: modules/admin-dashboard/style.css
   Version: 1.0.0
   ============================================ */

/* ============================================
   متغیرهای رنگ - تم شیشه‌ای شاد جزیره‌ای
   ============================================ */
:root {
    --glass-bg-primary: rgba(255, 255, 255, 0.06);
    --glass-bg-secondary: rgba(255, 255, 255, 0.10);
    --glass-bg-hover: rgba(255, 255, 255, 0.14);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-hover: rgba(255, 255, 255, 0.15);
    
    --ocean-blue: rgba(0, 180, 216, 0.85);
    --turquoise: rgba(0, 220, 200, 0.85);
    --golden: rgba(255, 215, 0, 0.85);
    --sunset-orange: rgba(255, 165, 0, 0.85);
    --coral-pink: rgba(255, 99, 132, 0.85);
    --lime-green: rgba(50, 205, 50, 0.85);
    
    --text-primary: rgba(255, 255, 255, 0.95);
    --text-secondary: rgba(255, 255, 255, 0.70);
    --text-muted: rgba(255, 255, 255, 0.45);
    
    --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 30px rgba(0, 200, 200, 0.10);
}

/* ============================================
   صفحه داشبورد مدیریتی
   ============================================ */
.venus-admin-dashboard {
    padding: 20px 0;
    direction: rtl;
    font-family: 'Estedad', 'Vazir', 'IRANSans', sans-serif;
}

.venus-admin-dashboard .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ============================================
   هدر داشبورد
   ============================================ */
.admin-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--glass-border);
}

.admin-dashboard-header .header-left h1 {
    color: var(--text-primary);
    font-size: 26px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-weight: 700;
}

.admin-dashboard-header .header-left h1 i {
    color: var(--golden);
}

.header-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin: 4px 0 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.last-update {
    color: var(--text-muted);
    font-size: 13px;
}

.last-update i {
    color: var(--turquoise);
}

.btn-refresh {
    background: var(--glass-bg-primary);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.btn-refresh:hover {
    background: var(--glass-bg-hover);
    color: var(--text-primary);
    border-color: var(--glass-border-hover);
    transform: rotate(180deg);
    box-shadow: var(--shadow-glow);
}

.btn-refresh:active {
    transform: rotate(180deg) scale(0.90);
}

.btn-refresh.spinning {
    animation: spin 1s ease-in-out;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   کارت‌های آمار
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--glass-bg-primary);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 14px;
    padding: 16px 18px;
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.02) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:hover {
    background: var(--glass-bg-hover);
    transform: translateY(-3px);
    border-color: var(--glass-border-hover);
    box-shadow: var(--shadow-glow);
}

.stat-card:active {
    transform: scale(0.98);
}

.stat-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.stat-card-units .stat-icon { background: rgba(0, 200, 200, 0.15); color: var(--turquoise); }
.stat-card-users .stat-icon { background: rgba(33, 150, 243, 0.15); color: #2196F3; }
.stat-card-debt .stat-icon { background: rgba(244, 67, 54, 0.15); color: #f44336; }
.stat-card-paid .stat-icon { background: rgba(255, 215, 0, 0.15); color: var(--golden); }
.stat-card-today .stat-icon { background: rgba(156, 39, 176, 0.15); color: #9C27B0; }
.stat-card-card .stat-icon { background: rgba(255, 152, 0, 0.15); color: #FF9800; }

.stat-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.stat-number {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-number.debt-amount {
    color: #ff6b6b;
}

.stat-number.golden-amount {
    color: var(--golden);
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-details {
    display: flex;
    gap: 10px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.stat-details .detail-item {
    font-size: 11px;
    color: var(--text-muted);
}

.stat-details .detail-item.shop { color: var(--turquoise); }
.stat-details .detail-item.counter { color: #FF9800; }
.stat-details .detail-item.owner { color: #2196F3; }
.stat-details .detail-item.operator { color: #9C27B0; }

/* ============================================
   نمودارها
   ============================================ */
.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.chart-card {
    background: var(--glass-bg-primary);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 14px;
    padding: 18px 20px;
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.chart-card:hover {
    border-color: var(--glass-border-hover);
}

.chart-card.full-width {
    grid-column: 1 / -1;
}

.chart-card h3 {
    color: var(--text-primary);
    font-size: 15px;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-card h3 i {
    color: var(--turquoise);
}

.chart-container {
    position: relative;
    height: 220px;
    width: 100%;
}

.chart-card.full-width .chart-container {
    height: 260px;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

.chart-loading,
.chart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 180px;
    color: var(--text-muted);
}

.chart-loading i,
.chart-empty i {
    font-size: 28px;
    margin-bottom: 10px;
}

.chart-loading i {
    color: var(--turquoise);
}

.chart-empty i {
    color: var(--text-muted);
}

/* ============================================
   بخش‌های جدول
   ============================================ */
.section-card {
    background: var(--glass-bg-primary);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 14px;
    padding: 18px 20px;
    border: 1px solid var(--glass-border);
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.section-card:hover {
    border-color: var(--glass-border-hover);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.section-header h3 {
    color: var(--text-primary);
    font-size: 16px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.view-all {
    color: var(--text-muted);
    font-size: 13px;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.view-all:hover {
    color: var(--turquoise);
}

/* ============================================
   جدول
   ============================================ */
.table-wrapper {
    overflow-x: auto;
    border-radius: 10px;
}

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

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

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

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
    font-size: 13px;
}

.admin-table thead {
    background: rgba(255, 255, 255, 0.04);
}

.admin-table th {
    padding: 10px 12px;
    text-align: right;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 2px solid var(--glass-border);
    white-space: nowrap;
}

.admin-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-size: 13px;
    transition: background 0.2s ease;
}

.admin-table tbody tr:hover td {
    background: var(--glass-bg-hover);
}

.admin-table .debt-amount {
    color: #ff6b6b;
    font-weight: 600;
}

.admin-table .paid-amount {
    color: #4CAF50;
    font-weight: 600;
}

.admin-table .ref-id {
    direction: ltr;
    font-family: 'Courier New', monospace;
    color: var(--text-muted);
    font-size: 12px;
}

.admin-table .unit-type-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.admin-table .unit-type-badge.shop { background: rgba(0,200,200,0.15); color: var(--turquoise); }
.admin-table .unit-type-badge.counter { background: rgba(255,165,0,0.15); color: #FF9800; }

.admin-table .floor-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
}

.admin-table .floor-badge.floor-0 { background: rgba(76,175,80,0.15); color: #4CAF50; }
.admin-table .floor-badge.floor-minus1 { background: rgba(255,152,0,0.15); color: #FF9800; }
.admin-table .floor-badge.floor-1 { background: rgba(33,150,243,0.15); color: #2196F3; }
.admin-table .floor-badge.floor-2 { background: rgba(156,39,176,0.15); color: #9C27B0; }

.empty-row {
    text-align: center !important;
    padding: 30px 20px !important;
    color: var(--text-muted);
}

.empty-row i {
    font-size: 28px;
    display: block;
    margin-bottom: 6px;
    opacity: 0.5;
}

/* ============================================
   خلاصه وضعیت
   ============================================ */
.summary-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding: 14px 18px;
    background: var(--glass-bg-primary);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-label {
    color: var(--text-muted);
    font-size: 13px;
}

.summary-value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
}

.summary-value.success {
    color: #4CAF50;
}

.summary-value.warning {
    color: #FFA500;
}

.summary-value.danger {
    color: #ff6b6b;
}

/* ============================================
   Toast Notification
   ============================================ */
.toast-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 12px 24px;
    background: rgba(0, 200, 200, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #ffffff;
    border-radius: 12px;
    font-size: 14px;
    z-index: 99999;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.20);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-family: 'Estedad', 'Vazir', sans-serif;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================
   دکمه‌های عمومی
   ============================================ */
.venus-auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Estedad', 'Vazir', sans-serif;
    color: #ffffff;
    text-decoration: none;
}

.venus-auth-btn.btn-primary {
    background: linear-gradient(135deg, var(--turquoise), var(--ocean-blue));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 20px rgba(0, 200, 200, 0.10);
}

.venus-auth-btn.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 200, 200, 0.20);
}

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

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

/* ============================================
   واکنش‌گرایی
   ============================================ */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .charts-row {
        grid-template-columns: 1fr;
    }
    .chart-card.full-width {
        grid-column: auto;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stat-card {
        padding: 12px 14px;
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .stat-icon {
        align-self: center;
    }
    
    .stat-details {
        justify-content: center;
    }
    
    .stat-number {
        font-size: 18px;
    }
    
    .admin-dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .admin-table {
        font-size: 12px;
        min-width: 600px;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 6px 8px;
    }
    
    .summary-footer {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .summary-item {
        justify-content: center;
    }
    
    .chart-container {
        height: 180px;
    }
    
    .chart-card.full-width .chart-container {
        height: 200px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .stat-card {
        padding: 10px 12px;
    }
    
    .stat-number {
        font-size: 16px;
    }
    
    .stat-details {
        font-size: 10px;
        gap: 6px;
    }
    
    .stat-details .detail-item {
        font-size: 10px;
    }
    
    .admin-dashboard-header .header-left h1 {
        font-size: 20px;
    }
    
    .header-subtitle {
        font-size: 12px;
    }
    
    .last-update {
        font-size: 11px;
    }
    
    .btn-refresh {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .admin-table {
        font-size: 11px;
        min-width: 500px;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 4px 6px;
    }
    
    .chart-container {
        height: 160px;
    }
    
    .chart-card.full-width .chart-container {
        height: 180px;
    }
    
    .section-card {
        padding: 12px 14px;
    }
    
    .toast-notification {
        bottom: 16px;
        right: 16px;
        left: 16px;
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* ============================================
   پشتیبانی از حالت تاریک و پرینت
   ============================================ */
@media (prefers-color-scheme: dark) {
    .stat-card {
        background: rgba(0, 0, 0, 0.20);
    }
    
    .chart-card {
        background: rgba(0, 0, 0, 0.20);
    }
    
    .section-card {
        background: rgba(0, 0, 0, 0.20);
    }
    
    .summary-footer {
        background: rgba(0, 0, 0, 0.20);
    }
}

@media print {
    .venus-admin-dashboard {
        background: #ffffff !important;
        padding: 0 !important;
    }
    
    .admin-dashboard-header {
        border-bottom-color: #dee2e6 !important;
    }
    
    .admin-dashboard-header .header-left h1 {
        color: #1a2332 !important;
    }
    
    .header-subtitle {
        color: #6c757d !important;
    }
    
    .stat-card {
        background: #f8f9fa !important;
        border-color: #e9ecef !important;
        break-inside: avoid;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    .stat-number {
        color: #1a2332 !important;
    }
    
    .stat-number.debt-amount {
        color: #dc3545 !important;
    }
    
    .stat-number.golden-amount {
        color: #d39e00 !important;
    }
    
    .stat-label {
        color: #6c757d !important;
    }
    
    .chart-card {
        background: #ffffff !important;
        border: 1px solid #e9ecef !important;
        break-inside: avoid;
    }
    
    .chart-card h3 {
        color: #1a2332 !important;
    }
    
    .section-card {
        background: #ffffff !important;
        border: 1px solid #e9ecef !important;
        break-inside: avoid;
    }
    
    .section-header h3 {
        color: #1a2332 !important;
    }
    
    .admin-table thead {
        background: #f8f9fa !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    .admin-table th {
        color: #495057 !important;
        border-bottom-color: #dee2e6 !important;
    }
    
    .admin-table td {
        color: #212529 !important;
        border-bottom-color: #e9ecef !important;
    }
    
    .admin-table .debt-amount {
        color: #dc3545 !important;
    }
    
    .admin-table .paid-amount {
        color: #28a745 !important;
    }
    
    .view-all {
        display: none !important;
    }
    
    .header-right {
        display: none !important;
    }
    
    .summary-footer {
        border-top: 1px solid #e9ecef !important;
    }
    
    .empty-row {
        color: #6c757d !important;
    }
    
    .toast-notification {
        display: none !important;
    }
}

/* ============================================
   اسکرول‌بار سفارشی
   ============================================ */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--glass-border-hover);
}