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

:root {
    --bg-primary: #070d08;
    --bg-secondary: #0c1a0e;
    --bg-glass: rgba(255, 255, 255, 0.03);
    --bg-glass-hover: rgba(255, 255, 255, 0.06);
    --bg-glass-active: rgba(255, 255, 255, 0.08);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-hover: rgba(255, 255, 255, 0.15);
    --text-primary: rgba(255, 255, 255, 0.95);
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-tertiary: rgba(255, 255, 255, 0.35);
    --accent-blue: #1a8a4a;
    --accent-blue-glow: rgba(26, 138, 74, 0.3);
    --accent-pink: #2dba6e;
    --accent-green: #10b981;
    --accent-amber: #f59e0b;
    --accent-red: #ef4444;
    --accent-purple: #15803d;
    --accent-cyan: #059669;
    --glass-blur: 20px;
    --glass-blur-heavy: 40px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 40px rgba(0, 104, 56, 0.15);
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

body[dir="rtl"] {
    font-family: 'Cairo', 'Inter', -apple-system, sans-serif;
}

.bg-mesh {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 20%, rgba(0, 104, 56, 0.1), transparent),
        radial-gradient(ellipse 60% 80% at 80% 80%, rgba(21, 128, 61, 0.08), transparent),
        radial-gradient(ellipse 50% 50% at 50% 50%, rgba(5, 150, 105, 0.05), transparent);
    pointer-events: none;
}

.particles {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(0, 104, 56, 0.5);
    border-radius: 50%;
    animation: float-particle linear infinite;
}

@keyframes float-particle {
    0% { transform: translateY(100vh) scale(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

.data-flow-line {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 104, 56, 0.35), transparent);
    animation: flow-horizontal 8s linear infinite;
}

@keyframes flow-horizontal {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100vw); }
}

/* LOGIN */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.login-card {
    background: var(--bg-glass);
    backdrop-filter: blur(var(--glass-blur-heavy));
    -webkit-backdrop-filter: blur(var(--glass-blur-heavy));
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    padding: 48px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-glass), var(--shadow-glow);
    animation: fadeInUp 0.6s ease-out;
}

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

.login-logo {
    text-align: center;
    margin-bottom: 40px;
}

.login-logo .logo-icon {
    width: 120px;
    height: 60px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.login-logo .logo-icon img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.login-logo h1 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.login-logo p {
    color: var(--text-secondary);
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition-fast);
    outline: none;
}

.form-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(0, 104, 56, 0.2);
    background: rgba(255, 255, 255, 0.06);
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition-fast);
    outline: none;
}

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #006838, #1a8a4a);
    color: white;
    padding: 14px;
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(0, 104, 56, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 25px rgba(0, 104, 56, 0.4);
}

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

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-glass);
}

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

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

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

.login-demo {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-glass);
    text-align: center;
}

.login-demo p {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}

.demo-accounts {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.demo-btn {
    padding: 6px 12px;
    font-size: 11px;
    background: rgba(0, 104, 56, 0.15);
    border: 1px solid rgba(0, 104, 56, 0.25);
    color: var(--accent-blue);
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition-fast);
}

.demo-btn:hover {
    background: rgba(0, 104, 56, 0.3);
}

.error-msg {
    color: var(--accent-red);
    font-size: 13px;
    margin-bottom: 16px;
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: var(--radius-sm);
    display: none;
}

.error-msg.show { display: block; }

/* APP LAYOUT */
.app-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* SIDEBAR */
.sidebar {
    width: 260px;
    min-height: 100vh;
    background: var(--bg-glass);
    backdrop-filter: blur(var(--glass-blur-heavy));
    -webkit-backdrop-filter: blur(var(--glass-blur-heavy));
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    transition: var(--transition-normal);
}

body[dir="rtl"] .sidebar {
    left: auto;
    right: 0;
    border-right: none;
    border-left: 1px solid var(--border-glass);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-glass);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand .brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.sidebar-brand .brand-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sidebar-brand h2 {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.sidebar-brand span {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 400;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 14px;
    font-weight: 400;
    user-select: none;
    position: relative;
}

.nav-item:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(0, 104, 56, 0.15);
    color: var(--accent-blue);
    font-weight: 500;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--accent-blue);
    border-radius: 0 3px 3px 0;
}

body[dir="rtl"] .nav-item.active::before {
    left: auto;
    right: 0;
    border-radius: 3px 0 0 3px;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-item .badge {
    margin-left: auto;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(0, 104, 56, 0.2);
    color: var(--accent-blue);
    border-radius: 10px;
}

body[dir="rtl"] .nav-item .badge {
    margin-left: 0;
    margin-right: auto;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-glass);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

.user-card:hover {
    background: var(--bg-glass-hover);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #006838, #1a8a4a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-info .name {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-info .role {
    font-size: 11px;
    color: var(--text-tertiary);
    text-transform: capitalize;
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
}

body[dir="rtl"] .main-content {
    margin-left: 0;
    margin-right: 260px;
}

.top-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 16px 32px;
    background: rgba(10, 10, 15, 0.7);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-bar-left h1 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.top-bar-left .breadcrumb {
    font-size: 13px;
    color: var(--text-tertiary);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box {
    position: relative;
}

.search-box input {
    padding: 8px 16px 8px 36px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    width: 240px;
    outline: none;
    transition: var(--transition-fast);
    font-family: inherit;
}

body[dir="rtl"] .search-box input {
    padding: 8px 36px 8px 16px;
}

.search-box input:focus {
    border-color: #1a8a4a;
    width: 300px;
}

.search-box svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-tertiary);
}

body[dir="rtl"] .search-box svg {
    left: auto;
    right: 12px;
}

.notification-btn {
    position: relative;
}

.notification-btn .dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--accent-red);
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
}

.page-content {
    padding: 32px;
}

/* GLASS CARDS */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition-normal);
}

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

.glass-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.glass-card-header h3 {
    font-size: 16px;
    font-weight: 600;
}

/* iOS GLASS BANNER */
.glass-banner {
    background: linear-gradient(135deg, rgba(0, 104, 56, 0.12), rgba(21, 128, 61, 0.08));
    backdrop-filter: blur(var(--glass-blur-heavy));
    -webkit-backdrop-filter: blur(var(--glass-blur-heavy));
    border: 1px solid rgba(0, 104, 56, 0.2);
    border-radius: var(--radius-xl);
    padding: 32px;
    position: relative;
    overflow: hidden;
    animation: bannerGlow 4s ease-in-out infinite alternate;
}

@keyframes bannerGlow {
    0% { box-shadow: 0 0 30px rgba(0, 104, 56, 0.1); }
    100% { box-shadow: 0 0 50px rgba(0, 104, 56, 0.2); }
}

.glass-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 30%, rgba(255, 255, 255, 0.03) 50%, transparent 70%);
    animation: shimmer 6s linear infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) rotate(15deg); }
    100% { transform: translateX(100%) rotate(15deg); }
}

.glass-banner .banner-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.glass-banner h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.glass-banner p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.glass-banner .banner-visual {
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(0, 104, 56, 0.3), transparent 70%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.05); opacity: 1; }
}

.glass-banner .banner-visual svg {
    width: 48px;
    height: 48px;
    color: var(--accent-blue);
}

/* STAT CARDS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-glass);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: var(--transition-normal);
    cursor: default;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--stat-color, var(--accent-blue));
    opacity: 0;
    transition: var(--transition-fast);
}

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

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

.stat-card .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.stat-card .stat-icon svg {
    width: 20px;
    height: 20px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.stat-card .stat-change {
    font-size: 12px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-change.up { color: var(--accent-green); }
.stat-change.down { color: var(--accent-red); }

/* DATA TABLE */
.glass-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.glass-table thead th {
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
    border-bottom: 1px solid var(--border-glass);
}

body[dir="rtl"] .glass-table thead th {
    text-align: right;
}

.glass-table tbody tr {
    transition: var(--transition-fast);
}

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

.glass-table tbody td {
    padding: 14px 16px;
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}

/* STATUS BADGES */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-active, .status-present, .status-paid, .status-completed, .status-filled {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-green);
}
.status-active::before, .status-present::before, .status-paid::before, .status-completed::before, .status-filled::before {
    background: var(--accent-green);
}

.status-pending, .status-late, .status-screening, .status-draft {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-amber);
}
.status-pending::before, .status-late::before, .status-screening::before, .status-draft::before {
    background: var(--accent-amber);
}

.status-absent, .status-terminated, .status-closed {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
}
.status-absent::before, .status-terminated::before, .status-closed::before {
    background: var(--accent-red);
}

.status-leave, .status-on_leave {
    background: rgba(0, 104, 56, 0.1);
    color: var(--accent-blue);
}
.status-leave::before, .status-on_leave::before {
    background: var(--accent-blue);
}

.status-open, .status-interviewing, .status-approved {
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent-cyan);
}
.status-open::before, .status-interviewing::before, .status-approved::before {
    background: var(--accent-cyan);
}

.status-probation, .status-half_day {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-purple);
}
.status-probation::before, .status-half_day::before {
    background: var(--accent-purple);
}

/* PRIORITY BADGES */
.priority-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.priority-low { background: rgba(16, 185, 129, 0.1); color: var(--accent-green); }
.priority-medium { background: rgba(245, 158, 11, 0.1); color: var(--accent-amber); }
.priority-high { background: rgba(239, 68, 68, 0.1); color: var(--accent-red); }
.priority-urgent { background: rgba(239, 68, 68, 0.2); color: var(--accent-red); }

/* GRID LAYOUTS */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

/* ACTIVITY FEED */
.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.activity-item:last-child { border-bottom: none; }

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-blue);
    margin-top: 6px;
    flex-shrink: 0;
}

.activity-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.activity-text strong {
    color: var(--text-primary);
    font-weight: 500;
}

.activity-time {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

/* DEPARTMENT CARD */
.dept-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    cursor: pointer;
}

.dept-card:hover {
    border-color: var(--border-glass-hover);
    background: var(--bg-glass-hover);
}

.dept-color {
    width: 4px;
    height: 40px;
    border-radius: 2px;
    flex-shrink: 0;
}

.dept-info { flex: 1; }
.dept-info .dept-name { font-size: 14px; font-weight: 500; }
.dept-info .dept-count { font-size: 12px; color: var(--text-tertiary); }

/* MODALS */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-normal);
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(20px);
    transition: var(--transition-normal);
}

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

.modal-header {
    padding: 24px 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 0 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* AI CHAT */
.ai-chat-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 150;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, #006838, #1a8a4a);
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 104, 56, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-normal);
    animation: float-button 3s ease-in-out infinite;
}

body[dir="rtl"] .ai-chat-toggle {
    right: auto;
    left: 24px;
}

@keyframes float-button {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.ai-chat-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 30px rgba(0, 104, 56, 0.5);
}

.ai-chat-panel {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 200;
    width: 400px;
    max-height: 600px;
    background: var(--bg-secondary);
    backdrop-filter: blur(var(--glass-blur-heavy));
    -webkit-backdrop-filter: blur(var(--glass-blur-heavy));
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-normal);
}

body[dir="rtl"] .ai-chat-panel {
    right: auto;
    left: 24px;
}

.ai-chat-panel.show {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all;
}

.ai-chat-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-chat-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
}

.ai-chat-header .ai-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    animation: pulse 2s infinite;
}

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

.ai-chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    max-height: 400px;
}

.ai-message {
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease-out;
}

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

.ai-message.assistant {
    padding: 14px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 16px 16px 16px 4px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

body[dir="rtl"] .ai-message.assistant {
    border-radius: 16px 16px 4px 16px;
}

.ai-message.user {
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(0, 104, 56, 0.15), rgba(21, 128, 61, 0.1));
    border: 1px solid rgba(0, 104, 56, 0.2);
    border-radius: 16px 16px 4px 16px;
    font-size: 14px;
    margin-left: 40px;
    color: var(--text-primary);
}

body[dir="rtl"] .ai-message.user {
    margin-left: 0;
    margin-right: 40px;
    border-radius: 16px 16px 16px 4px;
}

.ai-chat-input {
    padding: 16px;
    border-top: 1px solid var(--border-glass);
    display: flex;
    gap: 10px;
}

.ai-chat-input input {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    font-family: inherit;
    transition: var(--transition-fast);
}

.ai-chat-input input:focus {
    border-color: var(--accent-blue);
}

.ai-chat-input button {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #006838, #1a8a4a);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.ai-chat-input button:hover {
    transform: scale(1.05);
}

/* LANG TOGGLE */
.lang-toggle {
    display: flex;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.lang-toggle button {
    padding: 6px 12px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    font-family: inherit;
}

.lang-toggle button.active {
    background: rgba(0, 104, 56, 0.2);
    color: var(--accent-blue);
}

/* CHART BAR */
.chart-bar-container {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 120px;
    padding-top: 10px;
}

.chart-bar {
    flex: 1;
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: var(--transition-normal);
    position: relative;
    cursor: default;
}

.chart-bar:hover {
    opacity: 0.8;
}

.chart-bar-label {
    text-align: center;
    font-size: 10px;
    color: var(--text-tertiary);
    margin-top: 6px;
}

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

/* LOADING SPINNER */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: #1a8a4a;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    flex-direction: column;
    gap: 16px;
}

.loading-overlay p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* EMPTY STATE */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-tertiary);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 13px;
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    body[dir="rtl"] .sidebar { transform: translateX(100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0 !important; margin-right: 0 !important; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
    .page-content { padding: 16px; }
    .glass-banner .banner-content { flex-direction: column; text-align: center; }
    .glass-banner .banner-visual { width: 100px; height: 100px; }
    .ai-chat-panel { width: calc(100% - 48px); right: 24px; left: 24px; }
}

/* PAGE TRANSITIONS */
.page { display: none; animation: fadeInUp 0.4s ease-out; }
.page.active { display: block; }

/* TABS */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 0;
}

.tab {
    padding: 10px 20px;
    font-size: 14px;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    position: relative;
    transition: var(--transition-fast);
}

.tab:hover { color: var(--text-primary); }

.tab.active {
    color: var(--accent-blue);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-blue);
    border-radius: 2px 2px 0 0;
}

/* SCORE BAR */
.score-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

.score-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 1s ease-out;
}

/* ABSENCE BANNER */
.absence-banner {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(245, 158, 11, 0.06));
    border: 1px solid rgba(239, 68, 68, 0.12);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
}

.absence-banner-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.absence-banner-header .icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.absence-banner-header h4 {
    font-size: 15px;
    font-weight: 600;
}

.absence-banner-header .count {
    margin-left: auto;
    font-size: 13px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
}

body[dir="rtl"] .absence-banner-header .count {
    margin-left: 0;
    margin-right: auto;
}

.absence-employee-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-md);
    margin-bottom: 6px;
    transition: var(--transition-fast);
}

.absence-employee-row:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.absence-employee-row .emp-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.absence-employee-row .emp-info {
    flex: 1;
    min-width: 0;
}

.absence-employee-row .emp-name {
    font-size: 13px;
    font-weight: 500;
}

.absence-employee-row .emp-dept {
    font-size: 11px;
    color: var(--text-tertiary);
}

.absence-employee-row .emp-reason {
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 8px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* AGENT PAGE */
.agent-task-card {
    background: var(--bg-glass);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
    transition: var(--transition-normal);
}

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

.agent-task-card.running {
    border-color: rgba(16, 185, 129, 0.3);
    animation: agent-pulse 2s ease-in-out infinite;
}

@keyframes agent-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
    50% { box-shadow: 0 0 20px rgba(16, 185, 129, 0.1); }
}

.agent-task-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.agent-task-header .task-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.agent-task-header .task-info { flex: 1; }

.agent-task-header .task-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.agent-task-header .task-meta {
    font-size: 12px;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.agent-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 16px;
}

.agent-progress-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--accent-green), var(--accent-cyan));
    transition: width 0.5s ease-out;
    position: relative;
}

.agent-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    animation: progress-shine 1.5s ease-in-out infinite;
}

@keyframes progress-shine {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

.agent-steps-timeline {
    position: relative;
    padding-left: 24px;
}

body[dir="rtl"] .agent-steps-timeline {
    padding-left: 0;
    padding-right: 24px;
}

.agent-steps-timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.06);
}

body[dir="rtl"] .agent-steps-timeline::before {
    left: auto;
    right: 7px;
}

.agent-step {
    position: relative;
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.agent-step .step-dot {
    position: absolute;
    left: -24px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 1;
}

body[dir="rtl"] .agent-step .step-dot {
    left: auto;
    right: -24px;
}

.agent-step.completed .step-dot {
    background: var(--accent-green);
}

.agent-step.completed .step-dot::after {
    content: '✓';
    font-size: 9px;
    color: white;
}

.agent-step.running .step-dot {
    background: var(--accent-cyan);
    animation: pulse 1s infinite;
}

.agent-step.running .step-dot::after {
    content: '';
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
}

.agent-step.pending .step-dot {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.agent-step .step-content {
    flex: 1;
}

.agent-step .step-name {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-tertiary);
}

.agent-step.completed .step-name { color: var(--text-secondary); }
.agent-step.running .step-name { color: var(--text-primary); font-weight: 500; }

.agent-step .step-time {
    font-size: 11px;
    color: var(--text-tertiary);
    font-family: monospace;
}

.agent-step.running .step-time {
    color: var(--accent-cyan);
}

.agent-type-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 20px;
    cursor: pointer;
    transition: var(--transition-normal);
}

.agent-type-card:hover {
    border-color: rgba(16, 185, 129, 0.3);
    background: var(--bg-glass-hover);
    transform: translateY(-2px);
}

.agent-type-card .type-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(16, 185, 129, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.agent-type-card .type-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.agent-type-card .type-site {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}

.agent-type-card .type-steps {
    font-size: 11px;
    color: var(--accent-green);
}

/* HIDDEN */
.hidden { display: none !important; }
