/* Modern Color Palette & Variables */
:root {
    /* 🟠 Primary Orange System */
    --primary: #F97316;          /* برتقالي أساسي */
    --primary-hover: #EA580C;    /* عند الهوفر */
    --primary-soft: #FDBA74;     /* لون فاتح */

    /* 🟠 Secondary (برتقالي مائل للذهبي) */
    --secondary: #F59E0B;
    --secondary-hover: #D97706;

    /* 🔴 Danger (نخليه برتقالي غامق بدل الأحمر الصريح) */
    --danger: #DC2626;
    --danger-hover: #B91C1C;

    /* ⚫ Text */
    --dark: #1F2937;
    --light: #FFF7ED;

    /* ✨ Glass (شفاف برتقالي خفيف) */
    --glass-bg: rgba(255, 247, 237, 0.85); /* خلفية شفافة مائلة للبرتقالي */
    --glass-border: rgba(251, 146, 60, 0.25);

    /* 🌟 Shadow */
    --glass-shadow: 0 8px 32px 0 rgba(249, 115, 22, 0.15);

    /* 🔥 Glow Effects */
    --glow-orange: 0 0 20px rgba(249, 115, 22, 0.35);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Cairo', sans-serif;
}

body {
    background: linear-gradient(135deg, #fff7ed 0%, #fed7aa 100%);
    min-height: 100vh;
    direction: rtl;
    position: relative;
    overflow-x: hidden;
    color: var(--dark);
}

/* Background animated CSS shapes */
.bg-shape {
    position: absolute;
    filter: blur(80px);
    z-index: -1;
    border-radius: 50%;
    animation: float 10s infinite ease-in-out alternate;
}

.shape1 {
    width: 400px;
    height: 400px;
    background: rgba(79, 70, 229, 0.4);
    top: -100px;
    left: -100px;
}

.shape2 {
    width: 300px;
    height: 300px;
    background: rgba(16, 185, 129, 0.3);
    bottom: -50px;
    right: 10%;
    animation-delay: -2s;
}

.shape3 {
    width: 250px;
    height: 250px;
    background: rgba(239, 68, 68, 0.2);
    top: 30%;
    left: 40%;
    animation-delay: -5s;
}

@keyframes float {
    0% {
        transform: translateY(0) scale(1);
    }

    100% {
        transform: translateY(-30px) scale(1.1);
    }
}

.shape1 {
    background: rgba(249, 115, 22, 0.35);
}

.shape2 {
    background: rgba(251, 191, 36, 0.3);
}

.shape3 {
    background: rgba(234, 88, 12, 0.25);
}

/* Glassmorphism Container */
.container,
.dashboard,
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 450px;
    text-align: center;
    transition: transform 0.3s ease;
}

.dashboard {
    max-width: 800px;
}

.container:hover,
.dashboard:hover {
    transform: translateY(-5px);
}

h2 {
    color: var(--dark);
    margin-bottom: 30px;
    font-weight: 700;
    font-size: 28px;
    position: relative;
    display: inline-block;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

/* Input Fields */
.input-group {
    position: relative;
    margin-bottom: 25px;
    text-align: right;
}

.input-group i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
    font-size: 18px;
}

input {
    width: 100%;
    padding: 15px 45px 15px 45px;
    /* مساحة لليمين للأيقونة ولليسار لعين كلمة المرور */
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    outline: none;
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
    --premium-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
    --glow-indigo: 0 0 20px rgba(79, 70, 229, 0.3);
}

/* --- Premium Icons & Badges --- */
.status-pulse {
    width: 10px;
    height: 10px;
    background: #10B981;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 rgba(16, 185, 129, 0.4);
    animation: pulse-ring 1.5s infinite;
}

@keyframes pulse-ring {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}


.status-pulse.break {
    width: 10px;
    height: 10px;
    background: #c2410c;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 rgba(194, 65, 12, 0.4);
    animation: pulse-ring-break 1.5s infinite;
}

@keyframes pulse-ring-break {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(194, 65, 12, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(194, 65, 12, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(194, 65, 12, 0);
    }
}

/* --- World Class Button Design --- */
.action-btn-premium {
    position: relative;
    padding: 18px 35px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.05);
}

.action-btn-premium:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.action-btn-premium:active { transform: scale(0.96); }

/* --- Info Chip (Smart Data) --- */
.info-chip {
    background: white;
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

/* Buttons */
button,
.btn {
    width: 100%;
    padding: 15px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

button:hover,
.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.2);
}

.btn-success {
    background: var(--secondary);
}

.btn-success:hover {
    background: var(--secondary-hover);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.2);
}

.btn-danger {
    background: var(--danger);
}

.btn-danger:hover {
    background: var(--danger-hover);
    box-shadow: 0 10px 20px rgba(239, 68, 68, 0.2);
}

.btn-logout {
    border: 2px solid #ef4444 !important;
    color: #ef4444 !important;
    background: transparent;
    transition: all 0.3s ease;
}

.btn-logout_admin {
    border: 2px solid rgba(255, 255, 255, 0.4) !important;
    color: #fff !important;
    background: transparent;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: #ef4444 !important;
    color: #fff !important;
    border-color: #ef4444 !important;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

.btn-logout_admin:hover {
    background: #ef4444 !important;
    color: #fff !important;
    border-color: #ef4444 !important;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff !important;
    border-color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.1);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.action-card {
    background: rgba(255, 255, 255, 0.6);
    border-radius: 15px;
    padding: 25px 15px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    text-decoration: none;
    color: var(--dark);
    display: block;
}

.action-card:hover {
    transform: translateY(-5px) scale(1.02);
    background: white;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.action-card i {
    font-size: 40px;
    color: var(--primary);
    margin-bottom: 15px;
    display: block;
}

.action-card h3 {
    font-size: 18px;
    font-weight: 600;
}

hr {
    border: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, #E5E7EB, transparent);
    margin: 30px 0;
}

/* Digital Clock */
.clock-widget {
    font-size: 48px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 2px;
    margin: 20px 0;
    text-shadow: 0 4px 10px rgba(79, 70, 229, 0.2);
}

.date-widget {
    font-size: 16px;
    color: #6B7280;
    margin-bottom: 30px;
}

/* User Profile Header */
.user-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    text-align: right;
    padding-bottom: 20px;
    border-bottom: 1px solid #E5E7EB;
}

.user-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), #818CF8);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 24px;
    font-weight: bold;
}

.user-info h3 {
    margin: 0;
    color: var(--dark);
    font-size: 22px;
}

.user-info p {
    margin: 5px 0 0;
    color: #6B7280;
    font-size: 14px;
}

@media (max-width: 768px) {

    .dashboard,
    .container {
        padding: 25px;
        margin: 20px;
    }

    .clock-widget {
        font-size: 36px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Elegant Data Tables */
.table-wrapper {
    overflow-x: auto;
    margin-top: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.8);
    text-align: right;
}

th,
td {
    padding: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

th {
    background: var(--primary);
    color: white;
    font-weight: 600;
    white-space: nowrap;
}

tr:hover {
    background: rgba(79, 70, 229, 0.05);
}


/* Password Eye Toggle - أقصى شمال الحقل (حل نهائي) */
.toggle-password {
    position: absolute !important;
    left: 12px !important;
    right: auto !important;
    /* إلغاء خاصية اليمين الموروثة */
    top: 50% !important;
    transform: translateY(-50%) !important;
    cursor: pointer;
    color: #9CA3AF;
    z-index: 30 !important;
    font-size: 16px;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: var(--primary);
}

.password-container {
    position: relative !important;
    width: 100%;
    display: block;
}


/* 📱 موبايل */
@media (max-width: 768px) {

    .dashboard {
        margin: 15px !important;
        max-width: 100% !important;
    }

    /* 🔷 الهيدر */
    .user-header {
        flex-direction: column !important;
        text-align: center;
        padding: 25px !important;
        gap: 20px;
    }

    .user-header h1 {
        font-size: 22px !important;
    }

    #digital-clock {
        font-size: 38px !important;
    }

    .user-header > div:last-child {
        min-width: auto !important;
        width: 100%;
        padding: 20px !important;
    }

    /* ⚡ كارت الحضور */
    .attendance-card {
        padding: 25px 15px !important;
        border-radius: 25px !important;
    }

    /* 🔘 الأزرار */
    .action-btn-premium {
        width: 100% !important;
        height: 60px !important;
        font-size: 16px;
    }

    /* 🧩 الجريد */
    .dashboard > div[style*="grid"] {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    /* 📦 الكروت */
    .action-card {
        padding: 25px !important;
    }

    .action-card span {
        font-size: 16px !important;
    }

    /* ⏱️ عداد العمل */
    #work-duration-counter {
        font-size: 22px !important;
    }

    /* 📊 الحالة */
    #status-controller div {
        font-size: 13px !important;
        padding: 10px 15px !important;
    }

    /* 🍔 زر الخروج */
    .btn {
        width: 100% !important;
        justify-content: center;
    }
}

/************Sidebar****************/
/* ===== Sidebar Pro ===== */
.sidebar-pro {
    position: fixed;
    right: 0;
    top: 0;
    width: 270px;
    height: 100%;
    background: linear-gradient(180deg, #0f172a, #020617);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-shadow: -20px 0 60px rgba(0,0,0,0.4);
}

/* Logo */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
}

.logo {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg,#4f46e5,#9333ea);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}

.brand-text h3 {
    margin: 0;
    font-size: 16px;
}
.brand-text span {
    font-size: 12px;
    color: #94a3b8;
}

/* Menu */
.menu {
    list-style: none;
    padding: 0;
    flex: 1;
}

.menu-title {
    font-size: 11px;
    text-transform: uppercase;
    color: #64748b;
    margin: 20px 10px 10px;
    display: block;
}

.menu li {
    margin-bottom: 8px;
}

.menu a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 15px;
    border-radius: 12px;
    color: #cbd5e1;
    text-decoration: none;
    position: relative;
    transition: 0.3s;
}

.menu a:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}

/* Active */
.menu a.active {
    background: linear-gradient(135deg,#4f46e5,#9333ea);
    color: #fff;
}

.active-pill {
    position: absolute;
    left: 10px;
    width: 6px;
    height: 60%;
    background: white;
    border-radius: 10px;
}

/* Icons */
.menu i {
    font-size: 18px;
}

/* User */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    border-radius: 15px;
    background: rgba(255,255,255,0.05);
    cursor: pointer;
}

.avatar {
    width: 40px;
    height: 40px;
    background: #4f46e5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
/*********************/
.sidebar-pro {
    position: fixed;
    right: 0;
    top: 0;
    width: 270px;
    height: 100%;
    background: linear-gradient(180deg, #0f172a, #020617);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

/* Logo */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
}

.logo {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg,#4f46e5,#9333ea);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.brand-text h3 {
    margin: 0;
    font-size: 16px;
}
.brand-text span {
    font-size: 12px;
    color: #94a3b8;
}

/* Menu */
.menu {
    list-style: none;
    padding: 0;
    flex: 1;
}

.menu-title {
    font-size: 12px;
    color: #64748b;
    margin: 15px 10px;
    display: block;
}

.menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: 12px;
    color: #cbd5e1;
    text-decoration: none;
    transition: 0.3s;
    position: relative;
}

.menu a:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}

.menu a.active {
    background: linear-gradient(135deg,#4f46e5,#9333ea);
}

/* User */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    cursor: pointer;
}

.avatar {
    width: 40px;
    height: 40px;
    background: #4f46e5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Dropdown */
.user-dropdown {
    display: none;
    background: #0b1220;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    margin-top: 10px;
    overflow: hidden;
}

.user-dropdown a {
    display: block;
    padding: 12px;
    color: #cbd5e1;
    text-decoration: none;
}

.user-dropdown a:hover {
    background: rgba(255,255,255,0.05);
}

.main-content {
    margin-right: 270px; 
    padding: 30px;
    display: flex;
    justify-content: center;
}
.dashboard {
    width: 100%;
    max-width: 1200px;
}

button:hover,
.btn:hover {
    box-shadow: 0 10px 25px rgba(249, 115, 22, 0.35);
}
.sidebar-pro {
    background: linear-gradient(180deg, #9A3412, #431407);
}
.logo {
    background: linear-gradient(135deg,#F97316,#FB923C);
}
.menu a.active {
    background: linear-gradient(135deg, #F97316, #FB923C);
    color: #fff;
    box-shadow: 0 10px 25px rgba(249, 115, 22, 0.35);
}
.avatar {
    background: #F97316;
    color: white;
    font-weight: bold;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 10px 20px rgba(249, 115, 22, 0.3);
}
.logo {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
select {
    width: 100%;
    padding: 12px 15px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 14px;
    color: #1e293b;
    outline: none;
    transition: 0.3s;
    appearance: none; /* يخفي الشكل الافتراضي */
    cursor: pointer;
}

/* Hover */
select:hover {
    border-color: #4f46e5;
    background: #fff;
}

/* Focus */
select:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79,70,229,0.15);
    background: #fff;
}

/* سهم مخصص */
.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: "▼";
    position: absolute;
    left: 15px; /* عشان RTL */
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #64748b;
    pointer-events: none;
}