/* ============================================
   ✨ نظام تقييم الأداء — Modern Theme v1.0
   Linear/Notion Inspired — Clean & Minimal
   ============================================ */

/* === Google Font === */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&display=swap');

:root {
    /* Accent */
    --accent: #6366F1;
    --accent-hover: #4F46E5;
    --accent-light: rgba(99, 102, 241, 0.08);
    --accent-medium: rgba(99, 102, 241, 0.15);

    /* Backgrounds */
    --bg-body: #F8F8F8;
    --bg-surface: #FFFFFF;
    --bg-surface-hover: #FAFAFA;
    --bg-elevated: #FFFFFF;
    --bg-muted: #F3F3F3;
    --bg-subtle: #F0F0F0;

    /* Text */
    --text-primary: #111111;
    --text-secondary: #6B6B6B;
    --text-muted: #9B9B9B;
    --text-on-accent: #FFFFFF;

    /* Borders */
    --border: #E6E6E6;
    --border-light: #F0F0F0;
    --border-focus: var(--accent);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.08);

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Status Colors */
    --success: #22C55E;
    --success-bg: rgba(34, 197, 94, 0.08);
    --warning: #EAB308;
    --warning-bg: rgba(234, 179, 8, 0.08);
    --danger: #EF4444;
    --danger-bg: rgba(239, 68, 68, 0.08);
    --info: #3B82F6;
    --info-bg: rgba(59, 130, 246, 0.08);
}

.dark {
    --accent-light: rgba(99, 102, 241, 0.12);
    --accent-medium: rgba(99, 102, 241, 0.2);

    --bg-body: #0E0E10;
    --bg-surface: #18181B;
    --bg-surface-hover: #1E1E22;
    --bg-elevated: #1E1E22;
    --bg-muted: #27272A;
    --bg-subtle: #222225;

    --text-primary: #EDEDEF;
    --text-secondary: #A0A0A8;
    --text-muted: #63636B;

    --border: #2A2A2E;
    --border-light: #222225;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.4);

    --success-bg: rgba(34, 197, 94, 0.12);
    --warning-bg: rgba(234, 179, 8, 0.12);
    --danger-bg: rgba(239, 68, 68, 0.12);
    --info-bg: rgba(59, 130, 246, 0.12);
}

/* === Base Font === */
* {
    font-family: 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

/* ============================================
   صفحة تسجيل الدخول — Clean & Centered
   ============================================ */
.fi-simple-layout {
    background: var(--bg-body) !important;
    min-height: 100vh;
}
.dark .fi-simple-layout {
    background: #09090B !important;
}
.fi-simple-layout .fi-simple-main-ctn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
.fi-simple-layout .fi-simple-page {
    background: var(--bg-surface) !important;
    border-radius: var(--radius-xl) !important;
    box-shadow: none !important;
    border: none !important;
    max-width: 400px !important;
    width: 100%;
}
.fi-simple-layout .fi-logo {
    color: var(--text-primary) !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
}
.fi-simple-layout .fi-simple-page label {
    color: var(--text-secondary) !important;
    font-size: 0.8rem !important;
    font-weight: 500 !important;
}
.fi-simple-layout .fi-simple-page input {
    background: var(--bg-muted) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    font-size: 0.875rem !important;
    transition: all 0.15s ease !important;
}
.fi-simple-layout .fi-simple-page input:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px var(--accent-light) !important;
    background: var(--bg-surface) !important;
}
.fi-simple-layout .fi-btn-primary {
    background: var(--accent) !important;
    color: white !important;
    border: none !important;
    border-radius: var(--radius-md) !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    transition: all 0.15s ease !important;
}
.fi-simple-layout .fi-btn-primary:hover {
    background: var(--accent-hover) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3) !important;
}

/* ============================================
   Sidebar — Clean Dark
   ============================================ */
.fi-sidebar {
    background: #111113 !important;
    border-left: none !important;
    border-right: none !important;
}
.dark .fi-sidebar {
    background: #09090B !important;
}
.fi-sidebar-header {
    border-bottom: 1px solid rgba(255,255,255,0.06) !important;
    padding: 1rem !important;
}
.fi-sidebar .fi-logo,
.fi-sidebar .fi-logo * {
    color: #FFFFFF !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
}
.fi-sidebar-nav {
    padding: 0.5rem !important;
}
.fi-sidebar-item-button {
    color: rgba(255, 255, 255, 0.55) !important;
    border-radius: var(--radius-md) !important;
    margin: 1px 4px !important;
    padding: 0.5rem 0.75rem !important;
    transition: all 0.15s ease !important;
    font-size: 0.85rem !important;
    font-weight: 400 !important;
}
.fi-sidebar-item-button span {
    color: inherit !important;
}
.fi-sidebar-item-button:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    color: rgba(255, 255, 255, 0.9) !important;
}
.fi-sidebar-item-active .fi-sidebar-item-button,
.fi-sidebar-item-active .fi-sidebar-item-button:hover {
    background: var(--accent-medium) !important;
    color: #C7C8FF !important;
}
.fi-sidebar-item-active .fi-sidebar-item-button span {
    color: #C7C8FF !important;
}
.fi-sidebar-item-icon {
    color: rgba(255, 255, 255, 0.3) !important;
    width: 18px !important;
    height: 18px !important;
}
.fi-sidebar-item-button:hover .fi-sidebar-item-icon {
    color: rgba(255, 255, 255, 0.6) !important;
}
.fi-sidebar-item-active .fi-sidebar-item-icon {
    color: #A5B4FC !important;
}
.fi-sidebar-group-label,
.fi-sidebar-group-label * {
    color: rgba(255, 255, 255, 0.3) !important;
    font-size: 0.65rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    padding: 0.75rem 0.75rem 0.25rem !important;
}
.fi-sidebar-close-btn,
.fi-sidebar-close-btn * {
    color: rgba(255,255,255,0.4) !important;
}
.fi-sidebar::-webkit-scrollbar { width: 3px; }
.fi-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
}
/* Navigation badge */
.fi-sidebar-item-badge, .fi-badge {
    font-size: 0.65rem !important;
    font-weight: 600 !important;
}

/* ============================================
   Top Bar — Minimal
   ============================================ */
.fi-topbar {
    background: var(--bg-surface) !important;
    border-bottom: 1px solid var(--border) !important;
    box-shadow: none !important;
}
.fi-topbar nav {
    padding: 0 1rem !important;
}

/* ============================================
   Main Content Area
   ============================================ */
.fi-main {
    background: var(--bg-body) !important;
}

/* ============================================
   Page Headers
   ============================================ */
.fi-header-heading {
    font-weight: 700 !important;
    font-size: 1.5rem !important;
    color: var(--text-primary) !important;
}

/* ============================================
   Stats Widgets — Flat Cards
   ============================================ */
.fi-wi-stats-overview-stat {
    background: var(--bg-surface) !important;
    border-radius: var(--radius-lg) !important;
    border: 1px solid var(--border) !important;
    box-shadow: none !important;
    transition: all 0.15s ease !important;
    position: relative;
    overflow: hidden;
}
.fi-wi-stats-overview-stat::before {
    content: '';
    position: absolute;
    top: 0; right: 0; left: 0;
    height: 2px;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.15s ease;
}
.fi-wi-stats-overview-stat:hover {
    border-color: var(--accent);
}
.fi-wi-stats-overview-stat:hover::before {
    opacity: 1;
}
.fi-wi-stats-overview-stat-label {
    color: var(--text-secondary) !important;
    font-size: 0.8rem !important;
}
.fi-wi-stats-overview-stat-value {
    color: var(--text-primary) !important;
    font-weight: 700 !important;
}
.fi-wi-stats-overview-stat-description {
    font-size: 0.75rem !important;
}

/* ============================================
   Tables — Clean & Minimal
   ============================================ */
.fi-ta-ctn {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;
    overflow: hidden;
    box-shadow: none !important;
}
.fi-ta-header-cell {
    background: var(--bg-muted) !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    color: var(--text-secondary) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.03em !important;
    border-bottom: 1px solid var(--border) !important;
}
.fi-ta-row {
    background: var(--bg-surface) !important;
    border-bottom: 1px solid var(--border-light) !important;
    transition: background 0.1s ease !important;
}
.fi-ta-row:hover {
    background: var(--bg-surface-hover) !important;
}
.fi-ta-row:last-child {
    border-bottom: none !important;
}
.fi-ta-cell {
    color: var(--text-primary) !important;
    font-size: 0.85rem !important;
}
.fi-ta-search-field input {
    background: var(--bg-muted) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
}
.fi-ta-search-field input:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px var(--accent-light) !important;
}
/* Empty state */
.fi-ta-empty-state {
    color: var(--text-muted) !important;
}

/* ============================================
   Buttons
   ============================================ */
.fi-btn-primary,
.fi-btn[style*="--c-500"] {
    background: var(--accent) !important;
    color: white !important;
    border-radius: var(--radius-md) !important;
    border: none !important;
    font-weight: 500 !important;
    font-size: 0.85rem !important;
    transition: all 0.15s ease !important;
}
.fi-btn-primary:hover {
    background: var(--accent-hover) !important;
    transform: translateY(-1px);
}
/* Gray/secondary buttons */
.fi-btn-color-gray {
    border: 1px solid var(--border) !important;
    background: var(--bg-surface) !important;
    color: var(--text-primary) !important;
}
.fi-btn-color-gray:hover {
    background: var(--bg-muted) !important;
}

/* ============================================
   Sections / Cards
   ============================================ */
.fi-section {
    background: var(--bg-surface) !important;
    border-radius: var(--radius-lg) !important;
    border: 1px solid var(--border) !important;
    box-shadow: none !important;
}
.fi-section-header {
    border-bottom: 1px solid var(--border-light) !important;
}

/* ============================================
   Forms
   ============================================ */
.fi-fo-field-wrp label {
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    color: var(--text-secondary) !important;
}
.fi-input,
.fi-select,
.fi-textarea {
    background: var(--bg-muted) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    transition: all 0.15s ease !important;
    font-size: 0.875rem !important;
}
.fi-input:focus-within,
.fi-select:focus-within,
.fi-textarea:focus-within {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px var(--accent-light) !important;
    background: var(--bg-surface) !important;
}

/* ============================================
   Modals
   ============================================ */
.fi-modal-window {
    background: var(--bg-surface) !important;
    border-radius: var(--radius-xl) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-lg) !important;
}

/* ============================================
   Dropdowns
   ============================================ */
.fi-dropdown-panel {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-lg) !important;
}
.fi-dropdown-list-item-button {
    color: var(--text-primary) !important;
    border-radius: var(--radius-sm) !important;
    font-size: 0.85rem !important;
}
.fi-dropdown-list-item-button:hover {
    background: var(--bg-muted) !important;
}

/* ============================================
   Tabs
   ============================================ */
.fi-tabs-tab {
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    border-radius: var(--radius-md) !important;
}

/* ============================================
   Notification Bell
   ============================================ */
.notification-bell-badge {
    background: var(--danger) !important;
    font-size: 0.6rem;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -3px;
    right: -3px;
    color: white !important;
    font-weight: 700;
}

/* ============================================
   Helper Classes for Custom Pages
   ============================================ */
.modern-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.modern-card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.modern-card-body {
    padding: 1.25rem;
}
.modern-text { color: var(--text-primary); }
.modern-text-secondary { color: var(--text-secondary); }
.modern-text-muted { color: var(--text-muted); }
.modern-bg { background: var(--bg-body); }
.modern-bg-surface { background: var(--bg-surface); }
.modern-bg-muted { background: var(--bg-muted); }
.modern-border { border-color: var(--border); }
.modern-divider { border-color: var(--border-light); }

.modern-input {
    background: var(--bg-muted);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    transition: all 0.15s ease;
    outline: none;
    width: 100%;
}
.modern-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
    background: var(--bg-surface);
}
.modern-input::placeholder {
    color: var(--text-muted);
}

/* Accent badge */
.modern-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
}
.modern-badge-accent {
    background: var(--accent-light);
    color: var(--accent);
}
.modern-badge-success {
    background: var(--success-bg);
    color: var(--success);
}
.modern-badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}
.modern-badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
}
.modern-badge-info {
    background: var(--info-bg);
    color: var(--info);
}
.modern-badge-muted {
    background: var(--bg-muted);
    color: var(--text-secondary);
}

/* Score display */
.modern-score {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 1rem;
}
.modern-score-success { background: var(--success-bg); color: var(--success); }
.modern-score-warning { background: var(--warning-bg); color: #B45309; }
.dark .modern-score-warning { color: var(--warning); }
.modern-score-danger { background: var(--danger-bg); color: var(--danger); }

/* Accent gradient header for hero sections */
.modern-hero {
    background: var(--accent);
    border-radius: var(--radius-xl);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}
.modern-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.1) 100%);
    pointer-events: none;
}

/* Score hero (big centered score) */
.modern-score-hero {
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.modern-score-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.15) 0%, transparent 60%);
    pointer-events: none;
}

/* Workflow tracker */
.modern-tracker {
    display: flex;
    align-items: flex-start;
    gap: 0;
    overflow-x: auto;
    padding: 0.5rem 0;
}
.modern-tracker-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 100px;
    position: relative;
    text-align: center;
}
.modern-tracker-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 16px;
    left: -50%;
    width: 100%;
    height: 2px;
    background: var(--border);
    z-index: 0;
}
.modern-tracker-step.done:not(:last-child)::after {
    background: var(--success);
}
.modern-tracker-step.active:not(:last-child)::after {
    background: linear-gradient(to left, var(--border) 50%, var(--accent) 50%);
}
.modern-tracker-dot {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
    transition: all 0.2s ease;
}
.modern-tracker-dot-pending {
    background: var(--bg-muted);
    color: var(--text-muted);
    border: 2px solid var(--border);
}
.modern-tracker-dot-active {
    background: var(--accent);
    color: white;
    border: 2px solid var(--accent);
    box-shadow: 0 0 0 4px var(--accent-light);
}
.modern-tracker-dot-done {
    background: var(--success);
    color: white;
    border: 2px solid var(--success);
}
.modern-tracker-label {
    margin-top: 0.5rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.3;
}
.modern-tracker-step.active .modern-tracker-label {
    color: var(--accent);
    font-weight: 600;
}
.modern-tracker-step.done .modern-tracker-label {
    color: var(--success);
}

/* Footer */
.fi-main::after {
    content: 'نظام تقييم الأداء الوظيفي';
    display: block;
    text-align: center;
    padding: 1.5rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

/* Print */
@media print {
    .fi-sidebar, .fi-topbar { display: none !important; }
    .fi-main { margin: 0 !important; padding: 0 !important; background: white !important; }
}
@media (max-width: 768px) {
    .fi-simple-layout .fi-simple-page { margin: 1rem !important; }
    .modern-tracker { gap: 0; }
    .modern-tracker-step { min-width: 70px; }
}

/* Fix: Navigation badge visibility */
.fi-sidebar-item-badge span,
.fi-badge {
    color: inherit !important;
}
.fi-sidebar-nav .fi-badge {
    font-weight: 700 !important;
    min-width: 1.25rem;
    text-align: center;
}

