:root {
    --primary: #6d28d9; /* رنگ بنفش هدر */
    --bg: #f3f4f6;
    --card: #ffffff;
    --text: #1f2937;
    --green: #10b981;
    --red: #ef4444;
    --yellow: #f59e0b;
    --border: #e5e7eb;
}
* { box-sizing: border-box; font-family: Tahoma, "Segoe UI", sans-serif; }
body { margin: 0; background: var(--bg); color: var(--text); }

/* هدر بالای صفحه */
.topbar {
    background: linear-gradient(135deg, #7c3aed, #4c1d95);
    color: #fff; padding: 1rem 2rem; display: flex;
    justify-content: space-between; align-items: center;
    border-radius: 0 0 20px 20px; margin-bottom: 2rem;
}
.topbar h1 { margin: 0; font-size: 1.2rem; }
.topbar .date { background: rgba(255,255,255,0.2); padding: 0.4rem 1rem; border-radius: 20px; font-size: 0.9rem;}

.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }

/* کارت‌های آمار بالا */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2rem; }
.stat-card {
    background: #fff; padding: 1.2rem; border-radius: 12px;
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); border-bottom: 4px solid transparent;
}
.stat-card.total { border-color: var(--primary); }
.stat-card.present { border-color: var(--green); }
.stat-card.late { border-color: var(--yellow); }
.stat-card.absent { border-color: var(--red); }
.stat-card h3 { margin: 0; font-size: 1.8rem; color: var(--text); }
.stat-card span { color: #6b7280; font-size: 0.9rem; }
.stat-icon { font-size: 1.5rem; }

/* بخش کارت کارمندان */
.section-title { margin-bottom: 1rem; font-size: 1.1rem; color: #374151; }
.employees-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; }

.emp-card {
    background: #fff; border-radius: 16px; padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); border: 1px solid var(--border);
}
.emp-header { display: flex; align-items: center; margin-bottom: 1rem; }
.avatar {
    width: 45px; height: 45px; border-radius: 50%; background: var(--primary);
    color: white; display: flex; justify-content: center; align-items: center;
    font-size: 1.2rem; font-weight: bold; margin-left: 1rem;
}
.emp-info h4 { margin: 0 0 0.2rem 0; font-size: 1.1rem; }
.emp-info p { margin: 0; font-size: 0.8rem; color: #6b7280; }
.badge {
    margin-right: auto; padding: 0.2rem 0.8rem; border-radius: 20px; font-size: 0.75rem;
}
.badge.present { background: #d1fae5; color: #065f46; }
.badge.late { background: #fef3c7; color: #92400e; }
.badge.absent { background: #fee2e2; color: #991b1b; }

/* جعبه‌های ساعت */
.time-boxes { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-bottom: 1rem; }
.time-box { background: #f9fafb; padding: 0.8rem; border-radius: 8px; text-align: center; }
.time-box span { display: block; font-size: 0.75rem; color: #6b7280; margin-bottom: 0.3rem; }
.time-box b { font-size: 1rem; color: var(--text); }

/* دکمه‌ها */
.btn-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-bottom: 0.8rem; }
.btn { padding: 0.6rem; border-radius: 8px; border: none; cursor: pointer; font-weight: bold; font-size: 0.85rem; transition: 0.3s; }
.btn-in { background: var(--green); color: white; }
.btn-out { background: var(--red); color: white; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-dash { width: 100%; background: #e0e7ff; color: var(--primary); padding: 0.6rem; border-radius: 8px; border: none; cursor: pointer; font-weight: bold; }

/* استایل تقویم */
.calendar-strip {
    display: flex; gap: 10px; margin-bottom: 2rem; overflow-x: auto; padding-bottom: 10px;
}
.cal-day {
    background: #fff; padding: 1rem; border-radius: 10px; text-align: center;
    min-width: 100px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); border-top: 4px solid var(--primary);
}
.cal-day span { display: block; font-size: 0.8rem; color: #6b7280; }
.cal-day b { display: block; font-size: 1.2rem; margin: 5px 0; color: var(--text); }
.cal-day small { font-size: 0.7rem; color: #9ca3af; }

/* --- استایل‌های اختصاصی صفحه لاگین --- */

.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    /* پس‌زمینه گرادیانت ملایم برای خارج شدن از حالت ساده */
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

.login-card {
    background: #ffffff;
    padding: 3rem 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 420px;
    text-align: right; /* راست‌چین کردن کل محتوا */
}

/* عنوان */
.login-title {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 900;
    margin-top: 0;
    margin-bottom: 2rem;
    /* رنگ نارنجی ملایم و قرمز گرم */
    background: linear-gradient(45deg, #f97316, #ef4444);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* گروه‌های فرم */
.form-group {
    margin-bottom: 1.5rem;
}

/* متن‌های نام کاربری و رمز عبور */
.form-group label {
    display: block;
    color: #374151; /* طوسی تیره جذاب */
    font-weight: 700;
    margin-bottom: 0.5rem;
    margin-right: 0.5rem; /* فاصله از سمت راست */
    font-size: 0.95rem;
}

/* کادرهای ورودی (بیضی با حاشیه نارنجی شفاف) */
.form-group input {
    width: 100%;
    padding: 0.8rem 1.2rem;
    border: 2px solid rgba(249, 115, 22, 0.4); /* حاشیه نارنجی شفاف */
    border-radius: 50px; /* بیضی شکل */
    font-size: 1rem;
    color: #1f2937;
    outline: none;
    transition: all 0.3s ease;
    background-color: #f9fafb;
    font-family: inherit;
}

.form-group input:focus {
    border-color: #f97316; /* نارنجی پررنگ تر در حالت کلیک */
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.1);
    background-color: #fff;
}

/* دکمه ورود (بنفش مخملی و بیضی) */
.btn-login {
    width: 100%;
    padding: 0.9rem;
    margin-top: 1rem;
    border: none;
    border-radius: 50px; /* بیضی شکل */
    background: #7c3aed; /* بنفش مخملی */
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
    font-family: inherit;
}

.btn-login:hover {
    background: #6d28d9; /* بنفش تیره‌تر در هاور */
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}