/* ============================================
   أصول CRM - Design System
   Dark Tech Theme - Matching elosool.com
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* ---- Brand Colors (elosool.com) ---- */
    --accent: #FF4E20;
    --accent-hover: #FF6B3D;
    --accent-light: rgba(255, 78, 32, 0.15);
    --accent-glow: rgba(255, 78, 32, 0.4);
    --accent-gradient: linear-gradient(135deg, #FF4E20, #FF6B3D);

    /* ---- Dark Backgrounds ---- */
    --bg-body: #0a0a0a;
    --bg-main: #0f0f0f;
    --bg-card: #1a1a1a;
    --bg-card-hover: #1f1f1f;
    --bg: #141414;
    --bg-dark: #111111;
    --bg-glass: rgba(26, 26, 26, 0.7);
    --bg-elevated: #222222;

    /* ---- Text Colors ---- */
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-light: #666666;
    --text-muted: #555555;

    /* ---- Borders ---- */
    --border: #2a2a2a;
    --border-light: #1e1e1e;
    --border-accent: rgba(255, 78, 32, 0.3);

    /* ---- Status Colors ---- */
    --success: #10B981;
    --success-light: rgba(16, 185, 129, 0.15);
    --danger: #EF4444;
    --danger-light: rgba(239, 68, 68, 0.15);
    --warning: #F59E0B;
    --warning-light: rgba(245, 158, 11, 0.15);
    --info: #3B82F6;
    --info-light: rgba(59, 130, 246, 0.15);

    /* ---- Spacing ---- */
    --gap-xs: 4px;
    --gap-sm: 8px;
    --gap-md: 16px;
    --gap-lg: 24px;
    --gap-xl: 32px;

    /* ---- Sizing ---- */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --header-height: 64px;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;

    /* ---- Shadows ---- */
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(255, 78, 32, 0.15);

    /* ---- Fonts ---- */
    --font: 'Cairo', 'Inter', sans-serif;

    /* ---- Transitions ---- */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
}

/* ============ RESET & BASE ============ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
}

body {
    font-family: var(--font);
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ============ ANIMATED BACKGROUND ============ */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 80% 10%, rgba(255, 78, 32, 0.07) 0%, transparent 50%),
        radial-gradient(ellipse at 20% 90%, rgba(255, 107, 61, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(59, 130, 246, 0.03) 0%, transparent 60%);
}

/* Floating orbs */
.animated-bg::before,
.animated-bg::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
}

.animated-bg::before {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 78, 32, 0.12), transparent 70%);
    top: -10%;
    right: -5%;
    animation: orbFloat1 20s ease-in-out infinite;
}

.animated-bg::after {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.08), transparent 70%);
    bottom: -10%;
    left: -5%;
    animation: orbFloat2 25s ease-in-out infinite;
}

/* Particle dots */
.animated-bg-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    animation: particleRise linear infinite;
}

.particle:nth-child(1) {
    width: 3px; height: 3px;
    background: rgba(255, 78, 32, 0.5);
    left: 10%;
    animation-duration: 18s;
    animation-delay: 0s;
}
.particle:nth-child(2) {
    width: 2px; height: 2px;
    background: rgba(255, 107, 61, 0.4);
    left: 25%;
    animation-duration: 22s;
    animation-delay: 3s;
}
.particle:nth-child(3) {
    width: 4px; height: 4px;
    background: rgba(255, 78, 32, 0.3);
    left: 40%;
    animation-duration: 20s;
    animation-delay: 6s;
}
.particle:nth-child(4) {
    width: 2px; height: 2px;
    background: rgba(59, 130, 246, 0.4);
    left: 55%;
    animation-duration: 24s;
    animation-delay: 2s;
}
.particle:nth-child(5) {
    width: 3px; height: 3px;
    background: rgba(255, 78, 32, 0.35);
    left: 70%;
    animation-duration: 19s;
    animation-delay: 5s;
}
.particle:nth-child(6) {
    width: 2px; height: 2px;
    background: rgba(255, 107, 61, 0.45);
    left: 85%;
    animation-duration: 21s;
    animation-delay: 1s;
}
.particle:nth-child(7) {
    width: 3px; height: 3px;
    background: rgba(59, 130, 246, 0.3);
    left: 15%;
    animation-duration: 23s;
    animation-delay: 7s;
}
.particle:nth-child(8) {
    width: 2px; height: 2px;
    background: rgba(255, 78, 32, 0.4);
    left: 60%;
    animation-duration: 17s;
    animation-delay: 4s;
}
.particle:nth-child(9) {
    width: 4px; height: 4px;
    background: rgba(255, 78, 32, 0.25);
    left: 35%;
    animation-duration: 26s;
    animation-delay: 8s;
}
.particle:nth-child(10) {
    width: 2px; height: 2px;
    background: rgba(59, 130, 246, 0.35);
    left: 80%;
    animation-duration: 20s;
    animation-delay: 10s;
}
.particle:nth-child(11) {
    width: 3px; height: 3px;
    background: rgba(255, 78, 32, 0.3);
    left: 48%;
    animation-duration: 22s;
    animation-delay: 9s;
}
.particle:nth-child(12) {
    width: 2px; height: 2px;
    background: rgba(255, 107, 61, 0.4);
    left: 92%;
    animation-duration: 19s;
    animation-delay: 6s;
}

/* Grid lines overlay */
.animated-bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 78, 32, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 78, 32, 0.015) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: gridMove 30s linear infinite;
}

/* Scanning line effect */
.animated-bg-scan {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.animated-bg-scan::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 78, 32, 0.08), rgba(255, 78, 32, 0.15), rgba(255, 78, 32, 0.08), transparent);
    animation: scanLine 8s ease-in-out infinite;
}

/* Keyframes */
@keyframes orbFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(-60px, 80px) scale(1.1); }
    50% { transform: translate(-30px, 150px) scale(0.95); }
    75% { transform: translate(40px, 60px) scale(1.05); }
}

@keyframes orbFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(50px, -70px) scale(1.05); }
    50% { transform: translate(80px, -120px) scale(0.9); }
    75% { transform: translate(30px, -50px) scale(1.1); }
}

@keyframes particleRise {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) scale(1);
        opacity: 0;
    }
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(60px, 60px); }
}

@keyframes scanLine {
    0% { top: -2px; }
    50% { top: 100%; }
    100% { top: -2px; }
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
}

ul,
ol {
    list-style: none;
}

input,
select,
textarea,
button {
    font-family: var(--font);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* ============ LAYOUT ============ */
.app-layout {
    display: flex;
    min-height: 100vh;
    background: transparent;
    position: relative;
    z-index: 1;
}

.main-content {
    flex: 1;
    margin-right: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: var(--transition);
    background: rgba(15, 15, 15, 0.85);
    position: relative;
}

/* Premium dot pattern overlay on main content */
.main-content::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: var(--sidebar-width);
    bottom: 0;
    background-image:
        radial-gradient(rgba(255, 78, 32, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
    pointer-events: none;
    z-index: 0;
}

.main-content>* {
    position: relative;
    z-index: 1;
}

.page-content {
    padding: var(--gap-lg);
    flex: 1;
}

/* ============ HEADER ============ */
.header {
    height: var(--header-height);
    background: linear-gradient(90deg, rgba(15, 15, 15, 0.95) 0%, rgba(10, 10, 10, 0.98) 100%);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid rgba(255, 78, 32, 0.08);
    display: flex;
    align-items: center;
    padding: 0 var(--gap-lg);
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--gap-md);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--gap-md);
}

.header-search {
    position: relative;
    width: 280px;
}

.header-search input {
    width: 100%;
    padding: 9px 16px 9px 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    background: var(--bg);
    color: var(--text-primary);
    transition: var(--transition);
}

.header-search input:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-light);
}

.header-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.header-user:hover {
    background: var(--bg);
}

.header-user-info {
    text-align: left;
}

.header-user-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.header-user-role {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.header-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    background: var(--bg);
    border: 1px solid var(--border);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
    font-size: 0.95rem;
}

.header-icon:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-light);
}

.header-icon .badge-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    border: 2px solid var(--bg-card);
}

.mobile-toggle {
    display: none;
}

/* ============ USER AVATAR ============ */
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--accent-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px var(--accent-glow);
}

/* ============ PAGE HEADER ============ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--gap-lg);
    flex-wrap: wrap;
    gap: var(--gap-md);
}

.page-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.page-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font);
    text-decoration: none;
    justify-content: center;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    filter: brightness(1.15);
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.btn-outline:hover {
    background: var(--accent-light);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 12px 28px;
    font-size: 0.9rem;
}

/* ============ HEADER ACTION BUTTONS (Link Call Style) ============ */
.btn-add {
    background: linear-gradient(135deg, #43e97b, #38f9d7);
    color: white;
    border: none;
}

.btn-add:hover {
    box-shadow: 0 5px 15px rgba(67, 233, 123, 0.4);
    transform: translateY(-2px);
}

.btn-import {
    background: linear-gradient(135deg, #00E5FF, #00BCD4);
    color: white;
    border: none;
}

.btn-import:hover {
    box-shadow: 0 5px 15px rgba(0, 229, 255, 0.4);
    transform: translateY(-2px);
}

.btn-export {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    border: none;
}

.btn-export:hover {
    box-shadow: 0 5px 15px rgba(251, 191, 36, 0.4);
    transform: translateY(-2px);
}

.btn-distribute {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
    border: none;
}

.btn-distribute:hover {
    box-shadow: 0 5px 15px rgba(240, 147, 251, 0.4);
    transform: translateY(-2px);
}

.btn-delete-all {
    background: linear-gradient(135deg, #f56565, #c53030);
    color: white;
    border: none;
}

.btn-delete-all:hover {
    box-shadow: 0 5px 15px rgba(245, 101, 101, 0.4);
    transform: translateY(-2px);
}

.btn-icon {
    padding: 8px;
    width: 34px;
    height: 34px;
}

.w-full {
    width: 100%;
}

/* ============ TABLE ACTION BUTTONS (Link Call Style) ============ */
.table-action-btn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.table-action-btn:hover {
    transform: translateY(-3px);
}

.whatsapp-btn {
    background: linear-gradient(135deg, #25D366, #128C7E);
}

.whatsapp-btn:hover {
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.4);
}

.call-btn {
    background: linear-gradient(135deg, #4facfe, #00c6ff);
}

.call-btn:hover {
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.4);
}

.edit-btn {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.edit-btn:hover {
    box-shadow: 0 5px 15px rgba(251, 191, 36, 0.4);
}

.delete-btn {
    background: linear-gradient(135deg, #f56565, #c53030);
}

.delete-btn:hover {
    box-shadow: 0 5px 15px rgba(245, 101, 101, 0.4);
}

/* ============ CARDS ============ */
.card {
    background: linear-gradient(145deg, rgba(26, 26, 26, 0.9) 0%, rgba(20, 20, 20, 0.95) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--gap-lg);
    transition: var(--transition);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.card:hover {
    border-color: rgba(255, 78, 32, 0.25);
    box-shadow: 0 4px 30px rgba(255, 78, 32, 0.06);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--gap-md);
    padding-bottom: var(--gap-md);
    border-bottom: 1px solid var(--border-light);
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

/* ============ STATS GRID ============ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--gap-md);
    margin-bottom: var(--gap-lg);
}

.stat-card {
    background: linear-gradient(145deg, rgba(26, 26, 26, 0.95) 0%, rgba(18, 18, 18, 0.98) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--gap-lg);
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    transition: var(--transition);
}

/* Inner glow effect */
.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    transition: var(--transition);
}

.stat-card.primary::before {
    background: var(--accent-gradient);
}

.stat-card.primary::after {
    box-shadow: 0 0 30px 5px rgba(255, 78, 32, 0.15);
}

.stat-card.success::before {
    background: var(--success);
}

.stat-card.success::after {
    box-shadow: 0 0 30px 5px rgba(16, 185, 129, 0.12);
}

.stat-card.danger::before {
    background: var(--danger);
}

.stat-card.danger::after {
    box-shadow: 0 0 30px 5px rgba(239, 68, 68, 0.12);
}

.stat-card.warning::before {
    background: var(--warning);
}

.stat-card.warning::after {
    box-shadow: 0 0 30px 5px rgba(245, 158, 11, 0.12);
}

.stat-card.info::before {
    background: var(--info);
}

.stat-card.info::after {
    box-shadow: 0 0 30px 5px rgba(59, 130, 246, 0.12);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 40px rgba(255, 78, 32, 0.12), 0 0 0 1px rgba(255, 78, 32, 0.15);
    border-color: rgba(255, 78, 32, 0.2);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 1.2rem;
}

.stat-card.primary .stat-icon {
    background: var(--accent-light);
    color: var(--accent);
}

.stat-card.success .stat-icon {
    background: var(--success-light);
    color: var(--success);
}

.stat-card.danger .stat-icon {
    background: var(--danger-light);
    color: var(--danger);
}

.stat-card.warning .stat-icon {
    background: var(--warning-light);
    color: var(--warning);
}

.stat-card.info .stat-icon {
    background: var(--info-light);
    color: var(--info);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    margin-top: 8px;
}

.stat-badge.up {
    background: var(--success-light);
    color: var(--success);
}

.stat-badge.down {
    background: var(--danger-light);
    color: var(--danger);
}

/* ============ GRID LAYOUTS ============ */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gap-lg);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap-lg);
}

/* ============ TABS ============ */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: var(--gap-lg);
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 5px;
    overflow-x: auto;
    border: 1px solid var(--border);
}

.tab {
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
    color: var(--text-secondary);
}

.tab:hover {
    background: var(--bg);
    color: var(--text-primary);
}

.tab.active {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 2px 10px var(--accent-glow);
}

/* ============ TABLE ============ */
.table-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--gap-md) var(--gap-lg);
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
    gap: var(--gap-sm);
}

.table-search {
    position: relative;
    width: 280px;
}

.table-search input {
    width: 100%;
    padding: 9px 16px 9px 38px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    background: var(--bg);
    color: var(--text-primary);
    transition: var(--transition);
}

.table-search input:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-light);
}

.table-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.table-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--bg);
}

.data-table th {
    padding: 12px 16px;
    text-align: right;
    font-weight: 700;
    font-size: 0.78rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-light);
}

.data-table td {
    padding: 14px 16px;
    font-size: 0.85rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: var(--transition-fast);
}

.data-table tbody tr:hover {
    background: rgba(255, 78, 32, 0.03);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ============ FORMS ============ */
.form-group {
    margin-bottom: var(--gap-md);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gap-md);
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.form-input,
.form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    background: var(--bg);
    color: var(--text-primary);
    transition: var(--transition);
    font-family: var(--font);
}

.form-input:focus,
.form-select:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-light);
}

.form-input::placeholder {
    color: var(--text-light);
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
}

.form-select {
    cursor: pointer;
}

.form-select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* ============ BADGES ============ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-primary {
    background: var(--accent-light);
    color: var(--accent);
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-neutral {
    background: var(--bg);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

/* ============ PAGINATION ============ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--gap-md) var(--gap-lg);
    border-top: 1px solid var(--border-light);
    flex-wrap: wrap;
    gap: 10px;
}

.pagination-info {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.pagination-btns {
    display: flex;
    gap: 4px;
}

.pagination-btn {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.pagination-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.pagination-btn.active {
    background: var(--accent-gradient);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 2px 8px var(--accent-glow);
}

.pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ============ MODAL ============ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 540px;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px) scale(0.97);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    background: var(--bg);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--danger);
    border-color: var(--danger);
    background: var(--danger-light);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 10px;
    justify-content: flex-start;
}

/* ============ PROGRESS BAR ============ */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 10px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px var(--accent-glow);
}

/* ============ UPLOAD AREA ============ */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 50px 30px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg);
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--accent);
    background: var(--accent-light);
    box-shadow: inset 0 0 30px rgba(255, 78, 32, 0.05);
}

.upload-area i {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 14px;
    display: block;
}

.upload-area h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.upload-area p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ============ EMPTY STATE ============ */
.empty-state {
    text-align: center;
    padding: 40px;
}

.empty-state i {
    font-size: 3rem;
    color: var(--text-light);
    margin-bottom: 14px;
}

.empty-state h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* ============ CHART ============ */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* ============ ACTIVITY ITEMS ============ */
.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-light);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.activity-details {
    flex: 1;
}

.activity-text {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-primary);
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ============ TOAST ============ */
.toast-container {
    position: fixed;
    top: 80px;
    left: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease-out;
    min-width: 280px;
    backdrop-filter: blur(20px);
}

.toast.success {
    border-color: var(--success);
}

.toast.success::before {
    content: '✓';
    color: var(--success);
    font-weight: 800;
}

.toast.error {
    border-color: var(--danger);
}

.toast.error::before {
    content: '✗';
    color: var(--danger);
    font-weight: 800;
}

.toast.warning {
    border-color: var(--warning);
}

.toast.warning::before {
    content: '⚠';
    color: var(--warning);
}

.toast.info {
    border-color: var(--info);
}

.toast.info::before {
    content: 'ℹ';
    color: var(--info);
}

@keyframes slideIn {
    from {
        transform: translateX(-40px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============ WELCOME SECTION ============ */
.welcome-section {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: var(--gap-lg);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 78, 32, 0.2);
}

.welcome-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--accent-glow), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.welcome-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: 5%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.2), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.welcome-icon {
    font-size: 3rem;
    margin-bottom: 8px;
    opacity: 0.3;
    position: absolute;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
}

.welcome-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

.welcome-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    position: relative;
    z-index: 1;
}

/* ============ TOGGLE ============ */
.toggle {
    width: 44px;
    height: 24px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--text-secondary);
    transition: var(--transition);
}

.toggle.active {
    background: var(--accent);
    border-color: var(--accent);
}

.toggle.active::after {
    right: 22px;
    background: white;
}

/* ============ CHECKBOX ============ */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .main-content {
        margin-right: 0;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .header-search {
        display: none;
    }

    .mobile-toggle {
        display: flex;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .table-toolbar {
        flex-direction: column;
    }

    .table-search {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .page-content {
        padding: var(--gap-md);
    }

    .tabs {
        gap: 2px;
    }

    .tab {
        padding: 8px 12px;
        font-size: 0.75rem;
    }
}

@media (max-width: 768px) {
    .modal {
        margin: var(--gap-md);
        padding: var(--gap-lg);
    }

    .modal-footer {
        flex-direction: column;
        gap: var(--gap-md);
    }

    .modal-footer .btn {
        width: 100%;
    }
}

/* ============ LINK CALL DIALPAD (PORTED) ============ */
.link-call-modal .num-btn {
    width: 65px;
    height: 65px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin: 0 auto;
}

.link-call-modal .num-btn:hover {
    background: linear-gradient(145deg, #4facfe, #00c6ff);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.4);
    color: white;
}

.link-call-modal .num-btn:hover span {
    color: white;
}

.link-call-modal .num-btn:active {
    transform: translateY(-1px) scale(0.98);
}

.link-call-modal .num-btn span {
    font-size: 26px;
    font-weight: 600;
    color: #fff;
    line-height: 1;
}

.link-call-modal .num-btn small {
    font-size: 10px;
    color: #4facfe;
    margin-top: 2px;
    font-weight: 500;
    line-height: 1;
}

.link-call-modal .num-btn:hover small {
    color: rgba(255, 255, 255, 0.9);
}

.link-call-start-btn:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 12px 35px rgba(79, 172, 254, 0.6) !important;
}

.link-call-del-btn:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #ff4757 !important;
}

.call-pulse-anim {
    animation: pulseCall 1.5s infinite;
}

@keyframes pulseCall {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(67, 233, 123, 0.7);
        opacity: 1;
    }

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 15px rgba(67, 233, 123, 0);
        opacity: 0;
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(67, 233, 123, 0);
        opacity: 0;
    }
}