/* نظام HR - تصميم بسيط ونظيف */
* { box-sizing: border-box; }
html, body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    background: #f4f6f9;
    color: #1f2937;
    line-height: 1.6;
}

a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
    max-width: 1100px;
    margin: 24px auto;
    padding: 0 16px;
}

/* الشريط العلوي */
.topbar {
    background: #1e3a8a;
    color: #fff;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.topbar .brand {
    font-size: 18px;
    font-weight: 700;
}
.topbar .nav {
    display: flex;
    gap: 6px;
    flex: 1;
    flex-wrap: wrap;
}
.topbar .nav a {
    color: #cbd5e1;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
}
.topbar .nav a:hover {
    background: rgba(255,255,255,.1);
    color: #fff;
    text-decoration: none;
}
.topbar .nav a.active {
    background: #2563eb;
    color: #fff;
}
.topbar .user-area {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

/* البطاقات */
.card {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.card h1, .card h2 {
    margin: 0 0 16px;
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.card-header h2 { margin: 0; }

/* صفحة الدخول والتثبيت */
.auth-bg {
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-card {
    background: #fff;
    padding: 36px;
    border-radius: 12px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 10px 30px rgba(0,0,0,.2);
}
.login-card .brand {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 8px;
}
.login-card h1 {
    text-align: center;
    margin: 0 0 20px;
    font-size: 18px;
    color: #6b7280;
    font-weight: 500;
}

/* النماذج */
label {
    display: block;
    margin-bottom: 14px;
    font-size: 14px;
    color: #374151;
}
input[type=text], input[type=password], input[type=email],
input[type=tel], input[type=date], select {
    width: 100%;
    padding: 10px 12px;
    margin-top: 4px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
}
input:focus, select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}
.form-grid .form-actions {
    grid-column: 1 / -1;
}

.filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: end;
    margin-bottom: 16px;
}
.filters label { margin: 0; }

/* الأزرار */
.btn {
    display: inline-block;
    padding: 9px 18px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
    background: #e5e7eb;
    color: #1f2937;
    transition: background .15s, opacity .15s;
}
.btn:hover { opacity: .9; text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: #2563eb; color: #fff; }
.btn.danger  { background: #dc2626; color: #fff; }
.btn.ghost   { background: transparent; border: 1px solid #d1d5db; color: #fff; }
.topbar .btn.ghost { color: #fff; }
.card .btn.ghost { color: #374151; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.big { padding: 14px 36px; font-size: 16px; }
.btn.block { width: 100%; display: block; }

.inline { display: inline; }
.row-actions { white-space: nowrap; }
.row-actions form { margin-left: 4px; }

/* التنبيهات */
.alert {
    padding: 12px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}
.alert.success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert.error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* الجداول */
table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
table.data th, table.data td {
    padding: 10px 12px;
    text-align: right;
    border-bottom: 1px solid #e5e7eb;
}
table.data th {
    background: #f9fafb;
    color: #4b5563;
    font-weight: 600;
}
table.data tr:hover td { background: #f9fafb; }

/* الشارات */
.badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
}
.badge.small { padding: 3px 10px; font-size: 12px; }
.badge.in      { background: #dcfce7; color: #166534; }
.badge.out     { background: #dbeafe; color: #1e40af; }
.badge.neutral { background: #f3f4f6; color: #4b5563; }

/* صفحة الموظف الرئيسية */
.big-center { text-align: center; }
.big-clock {
    font-size: 56px;
    font-weight: 700;
    color: #1e3a8a;
    margin: 8px 0 16px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 2px;
}
.status-box { margin: 12px 0 24px; }
.actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* الإحصائيات */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    text-align: center;
}
.stat-label { color: #6b7280; font-size: 14px; }
.stat-value { font-size: 32px; font-weight: 700; color: #1e3a8a; margin-top: 4px; }

.muted { color: #6b7280; }
.center { text-align: center; }
code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}
