@import url('https://fonts.bunny.net/css?family=cairo:400,500,600,700,800&display=swap');

:root {
    color-scheme: light;
    --af-border-light: rgba(148, 163, 184, 0.18);
    --af-border-dark: rgba(148, 163, 184, 0.14);
    --af-surface-light: rgba(255, 255, 255, 0.96);
    --af-surface-dark: rgba(15, 23, 42, 0.9);
    --af-muted-light: #64748b;
    --af-muted-dark: #94a3b8;
    --af-accent: #10b981;
    --af-accent-strong: #059669;
    --af-shadow-panel: 0 10px 30px rgba(15, 23, 42, 0.06);
}

html[dir='rtl'] body.fi-body {
    direction: rtl;
    text-align: right;
}

body.fi-body {
    font-family: 'Cairo', 'IBM Plex Sans Arabic', 'Tajawal', ui-sans-serif, system-ui, sans-serif;
    background: #f4f7fb;
}

.dark body.fi-body {
    color-scheme: dark;
    background: #0b1120;
}

.fi-sidebar {
    border-inline-end: 1px solid var(--af-border-light);
    background: var(--af-surface-light);
    backdrop-filter: blur(10px);
    box-shadow: none;
}

.dark .fi-sidebar {
    border-inline-end-color: var(--af-border-dark);
    background: var(--af-surface-dark);
    box-shadow: none;
}

.fi-topbar {
    margin: 0.75rem 1rem 0;
    border: 1px solid var(--af-border-light);
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
}

.dark .fi-topbar {
    border-color: var(--af-border-dark);
    background: rgba(15, 23, 42, 0.92);
    box-shadow: 0 4px 18px rgba(2, 6, 23, 0.24);
}

.fi-section:not(.fi-section-not-contained),
.fi-ta-ctn,
.fi-wi-stats-overview-stat,
.fi-simple-main {
    border: 1px solid var(--af-border-light);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--af-shadow-panel);
}

.dark .fi-section:not(.fi-section-not-contained),
.dark .fi-ta-ctn,
.dark .fi-wi-stats-overview-stat,
.dark .fi-simple-main {
    border-color: var(--af-border-dark);
    background: rgba(15, 23, 42, 0.9);
    box-shadow: 0 10px 28px rgba(2, 6, 23, 0.26);
}

.fi-section-header-heading,
.fi-page-header-heading,
.fi-sidebar-group-label,
.fi-sidebar-item-label,
.fi-topbar-item-label {
    letter-spacing: 0;
}

.fi-sidebar-item-btn,
.fi-sidebar-group-btn,
.fi-topbar-item-btn,
.fi-btn,
.fi-input,
.fi-select-input,
.fi-textarea,
.fi-fo-field-wrp .fi-input-wrp {
    border-radius: 0.9rem;
}

.fi-sidebar-item-btn,
.fi-sidebar-group-btn,
.fi-topbar-item-btn {
    min-height: 2.8rem;
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn,
.fi-sidebar-item-btn:hover,
.fi-sidebar-group-btn:hover {
    background: color-mix(in srgb, var(--af-accent) 8%, white);
}

.dark .fi-sidebar-item.fi-active > .fi-sidebar-item-btn,
.dark .fi-sidebar-item-btn:hover,
.dark .fi-sidebar-group-btn:hover {
    background: color-mix(in srgb, var(--af-accent) 10%, transparent);
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn {
    color: var(--af-accent-strong);
    font-weight: 700;
}

.fi-sidebar-group-label {
    margin-block: 0.65rem 0.35rem;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--af-muted-light);
}

.dark .fi-sidebar-group-label {
    color: var(--af-muted-dark);
}

.af-login-hero,
.af-sidebar-footer-card,
.af-topbar-badge {
    border: 1px solid var(--af-border-light);
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(14, 165, 233, 0.08));
    padding: 1rem 1.1rem;
}

.dark .af-login-hero,
.dark .af-sidebar-footer-card,
.dark .af-topbar-badge {
    border-color: var(--af-border-dark);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(14, 165, 233, 0.12));
}

.af-login-hero-title,
.af-sidebar-footer-title,
.af-topbar-badge-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
}

.dark .af-login-hero-title,
.dark .af-sidebar-footer-title,
.dark .af-topbar-badge-title {
    color: #f8fafc;
}

.af-login-hero-text,
.af-sidebar-footer-text,
.af-topbar-badge-text {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--af-muted-light);
}

.dark .af-login-hero-text,
.dark .af-sidebar-footer-text,
.dark .af-topbar-badge-text {
    color: var(--af-muted-dark);
}

.af-login-pill-row {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.af-login-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    border-radius: 9999px;
    border: 1px solid rgba(16, 185, 129, 0.22);
    background: rgba(255, 255, 255, 0.6);
    padding-inline: 0.75rem;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--af-accent-strong);
}

.dark .af-login-pill {
    border-color: rgba(16, 185, 129, 0.28);
    background: rgba(15, 23, 42, 0.52);
}

.fi-ta-table thead th {
    font-size: 0.78rem;
    font-weight: 800;
    background: rgba(248, 250, 252, 0.92);
}

.fi-ta-table tbody tr:hover {
    background: rgba(16, 185, 129, 0.04);
}

.dark .fi-ta-table tbody tr:hover {
    background: rgba(16, 185, 129, 0.08);
}

.dark .fi-ta-table thead th {
    background: rgba(15, 23, 42, 0.88);
}

.af-report-page {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.af-report-overview {
    display: grid;
    gap: 1rem;
    border: 1px solid var(--af-border-light);
    border-radius: 1.15rem;
    background:
        radial-gradient(circle at top left, rgba(16, 185, 129, 0.12), transparent 32%),
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.1), transparent 28%),
        rgba(255, 255, 255, 0.96);
    padding: 1.25rem;
    box-shadow: var(--af-shadow-panel);
}

.dark .af-report-overview {
    border-color: var(--af-border-dark);
    background:
        radial-gradient(circle at top left, rgba(16, 185, 129, 0.16), transparent 32%),
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.14), transparent 28%),
        rgba(15, 23, 42, 0.9);
    box-shadow: 0 10px 28px rgba(2, 6, 23, 0.26);
}

.af-report-overview-copy {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.af-report-overview-kicker {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--af-accent-strong);
}

.af-report-overview-title {
    font-size: clamp(1.45rem, 2vw, 2rem);
    font-weight: 900;
    line-height: 1.2;
    color: #0f172a;
}

.dark .af-report-overview-title {
    color: #f8fafc;
}

.af-report-overview-text {
    max-width: 58rem;
    font-size: 0.92rem;
    line-height: 1.8;
    color: #475569;
}

.dark .af-report-overview-text {
    color: #cbd5e1;
}

.af-report-scope {
    display: grid;
    gap: 0.85rem;
}

.af-report-scope-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.72);
    padding: 0.9rem 1rem;
}

.dark .af-report-scope-card {
    border-color: rgba(148, 163, 184, 0.14);
    background: rgba(2, 6, 23, 0.4);
}

.af-report-scope-label {
    font-size: 0.76rem;
    font-weight: 700;
    color: #64748b;
}

.dark .af-report-scope-label {
    color: #94a3b8;
}

.af-report-scope-value {
    font-size: 0.98rem;
    font-weight: 800;
    color: #0f172a;
}

.dark .af-report-scope-value {
    color: #f8fafc;
}

.af-page-actions {
    display: flex;
    justify-content: flex-start;
    gap: 0.75rem;
}

.af-report-toolbar,
.af-report-card-grid,
.af-report-chart-grid,
.af-report-two-column,
.af-report-stat-grid,
.af-monitor-grid,
.af-monitor-info-grid {
    display: grid;
    gap: 1rem;
}

.af-report-toolbar {
    border: 1px solid var(--af-border-light);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.96);
    padding: 1rem;
    box-shadow: var(--af-shadow-panel);
}

.dark .af-report-toolbar {
    border-color: var(--af-border-dark);
    background: rgba(15, 23, 42, 0.9);
    box-shadow: 0 10px 28px rgba(2, 6, 23, 0.26);
}

.af-report-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.af-report-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #334155;
}

.dark .af-report-label {
    color: #e2e8f0;
}

.af-report-select {
    min-height: 2.85rem;
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.96);
    padding-inline: 0.9rem;
    color: #0f172a;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.af-report-select:focus {
    border-color: rgba(16, 185, 129, 0.45);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12);
}

.dark .af-report-select {
    border-color: rgba(148, 163, 184, 0.2);
    background: rgba(2, 6, 23, 0.68);
    color: #f8fafc;
}

.af-report-toolbar-actions {
    display: flex;
    align-items: end;
}

.af-report-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.af-report-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.85rem;
    border-radius: 0.9rem;
    padding-inline: 1rem;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.af-report-button:hover {
    transform: translateY(-1px);
}

.af-report-button--primary {
    border: 1px solid transparent;
    background: linear-gradient(135deg, #059669, #10b981);
    color: #fff;
}

.af-report-button--primary:hover {
    background: linear-gradient(135deg, #047857, #059669);
}

.af-report-button--secondary {
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(255, 255, 255, 0.92);
    color: #334155;
}

.af-report-button--secondary:hover {
    background: rgba(248, 250, 252, 1);
}

.dark .af-report-button--secondary {
    border-color: rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.72);
    color: #e2e8f0;
}

.dark .af-report-button--secondary:hover {
    background: rgba(30, 41, 59, 0.9);
}

.af-report-card-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.af-report-card,
.af-report-panel,
.af-report-stat-card {
    border: 1px solid var(--af-border-light);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--af-shadow-panel);
}

.dark .af-report-card,
.dark .af-report-panel,
.dark .af-report-stat-card {
    border-color: var(--af-border-dark);
    background: rgba(15, 23, 42, 0.9);
    box-shadow: 0 10px 28px rgba(2, 6, 23, 0.26);
}

.af-report-card,
.af-report-panel {
    padding: 1.25rem;
}

.af-report-card {
    position: relative;
    overflow: hidden;
}

.af-report-card::after {
    content: '';
    position: absolute;
    inset-inline: 1.25rem 1.25rem;
    top: 0;
    height: 3px;
    border-radius: 9999px;
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.95), rgba(59, 130, 246, 0.95));
    opacity: 0.85;
}

.af-report-card-title,
.af-report-stat-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
}

.dark .af-report-card-title,
.dark .af-report-stat-title,
.dark .af-report-panel-meta {
    color: #94a3b8;
}

.af-report-card-value,
.af-report-stat-value {
    margin-top: 0.55rem;
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1.1;
    color: #0f172a;
}

.dark .af-report-card-value,
.dark .af-report-stat-value,
.dark .af-report-panel-title,
.dark .af-report-table td {
    color: #f8fafc;
}

.af-report-card-value--success {
    color: #059669;
}

.af-report-card-value--warning {
    color: #d97706;
}

.af-report-card-value--danger {
    color: #dc2626;
}

.af-report-card-value--accent {
    color: #2563eb;
}

.af-report-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.af-report-panel-title {
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
}

.af-report-panel-meta {
    font-size: 0.82rem;
    color: #64748b;
}

.af-monitor-head,
.af-monitor-split,
.af-monitor-info-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.af-monitor-head {
    margin-bottom: 1rem;
}

.af-monitor-body,
.af-monitor-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.af-monitor-note,
.af-monitor-key {
    font-size: 0.82rem;
    color: #64748b;
}

.dark .af-monitor-note,
.dark .af-monitor-key {
    color: #94a3b8;
}

.af-monitor-progress {
    height: 0.85rem;
    overflow: hidden;
    border-radius: 9999px;
    background: rgba(226, 232, 240, 0.9);
}

.dark .af-monitor-progress {
    background: rgba(30, 41, 59, 0.9);
}

.af-monitor-progress-bar {
    height: 100%;
    border-radius: 9999px;
    background: linear-gradient(135deg, #059669, #10b981);
    transition: width 0.35s ease;
}

.af-monitor-value {
    font-weight: 800;
    color: #0f172a;
}

.dark .af-monitor-value {
    color: #f8fafc;
}

.af-monitor-info-item {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.dark .af-monitor-info-item {
    border-bottom-color: rgba(51, 65, 85, 0.9);
}

.af-monitor-info-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.af-report-stat-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.af-report-chart-grid > .fi-wi-chart {
    height: 100%;
}

.af-report-stat-card {
    padding: 1rem;
    background: rgba(248, 250, 252, 0.9);
}

.dark .af-report-stat-card {
    background: rgba(2, 6, 23, 0.68);
}

.af-report-table-wrap {
    overflow-x: auto;
}

.af-report-table {
    min-width: 100%;
    border-collapse: collapse;
}

.af-report-table thead th {
    padding-bottom: 0.9rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    font-size: 0.78rem;
    font-weight: 800;
    color: #64748b;
    text-align: right;
    white-space: nowrap;
}

.dark .af-report-table thead th {
    border-bottom-color: rgba(51, 65, 85, 0.9);
    color: #94a3b8;
}

.af-report-table tbody td {
    padding-block: 0.9rem;
    border-bottom: 1px solid rgba(241, 245, 249, 0.95);
    font-size: 0.9rem;
    color: #334155;
    vertical-align: middle;
}

.dark .af-report-table tbody td {
    border-bottom-color: rgba(30, 41, 59, 0.95);
}

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

.af-report-empty {
    padding-block: 1rem;
    text-align: center;
    font-size: 0.9rem;
    color: #64748b;
}

.dark .af-report-empty {
    color: #94a3b8;
}

.af-report-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.9rem;
    border-radius: 9999px;
    padding-inline: 0.7rem;
    font-size: 0.75rem;
    font-weight: 800;
}

.af-report-badge--success {
    background: rgba(16, 185, 129, 0.14);
    color: #047857;
}

.af-report-badge--warning {
    background: rgba(245, 158, 11, 0.16);
    color: #b45309;
}

.af-report-badge--danger {
    background: rgba(239, 68, 68, 0.14);
    color: #b91c1c;
}

.dark .af-report-badge--success {
    background: rgba(16, 185, 129, 0.18);
    color: #6ee7b7;
}

.dark .af-report-badge--warning {
    background: rgba(245, 158, 11, 0.18);
    color: #fcd34d;
}

.dark .af-report-badge--danger {
    background: rgba(239, 68, 68, 0.18);
    color: #fda4af;
}

@media (min-width: 768px) {
    .af-report-overview,
    .af-report-toolbar,
    .af-report-two-column {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .af-report-toolbar {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .af-report-toolbar-actions {
        grid-column: span 2 / span 2;
    }

    .af-report-card-grid,
    .af-report-chart-grid,
    .af-report-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .af-monitor-grid,
    .af-monitor-info-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1280px) {
    .af-report-card-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .af-report-card-grid--five {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .fi-topbar {
        margin-inline: 0.75rem;
    }

    .af-login-hero,
    .af-sidebar-footer-card,
    .af-topbar-badge {
        border-radius: 1rem;
    }

    .af-report-overview-title {
        font-size: 1.35rem;
    }
}
