/**
 * تنسيقات لوحة إدارة قرية الشين (RTL)
 * Elsheen Village Admin Panel CSS
 */

:root {
    --primary: #2474D8;
    --primary-dark: #1A5CB0;
    --primary-light: #EBF3FC;
    --bg-dark: #07162C;
    --bg-body: #F8FAFC;
    --card-bg: #FFFFFF;
    --text-main: #0F172A;
    --text-muted: #64748B;
    --border: #E2E8F0;
    --success: #10B981;
    --success-bg: #ECFDF5;
    --warning: #F59E0B;
    --warning-bg: #FFFBEB;
    --danger: #EF4444;
    --danger-bg: #FEF2F2;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.1);
}

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

body {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

/* Navbar */
.navbar {
    background-color: var(--bg-dark);
    color: #fff;
    padding: 14px 20px;
    border-bottom: 2px solid var(--primary);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #fff;
}

.brand-badge {
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
}

.brand h1 {
    font-size: 18px;
    font-weight: 900;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
}

.nav-link {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nav-link:hover, .nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.pill-count {
    background: var(--warning);
    color: #000;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 999px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    font-size: 13px;
    color: #cbd5e1;
}

.btn-logout {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: var(--danger);
    color: #fff;
}

/* Main Layout */
.main-content {
    max-width: 1200px;
    width: 100%;
    margin: 24px auto;
    padding: 0 16px;
    flex: 1;
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 22px;
    font-weight: 900;
    color: var(--text-main);
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Cards & Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.stat-info h3 {
    font-size: 28px;
    font-weight: 900;
    color: var(--text-main);
}

.stat-info p {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.stat-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.2); }
.stat-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.2); }
.stat-primary { background: var(--primary-light); color: var(--primary); border: 1px solid rgba(36, 116, 216, 0.2); }
.stat-danger  { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.2); }

/* Table Container */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 24px;
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.card-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-main);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
    font-size: 14px;
}

.table th {
    background: #f1f5f9;
    padding: 12px 18px;
    font-weight: 800;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.table tr:hover td {
    background: #f8fafc;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge-pending {
    background: var(--warning-bg);
    color: #b45309;
    border: 1px solid #fde68a;
}

.badge-approved {
    background: var(--success-bg);
    color: #047857;
    border: 1px solid #a7f3d0;
}

.badge-rejected {
    background: var(--danger-bg);
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
}
.btn-outline:hover { background: #f1f5f9; }

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.input, .select {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    background: #fff;
    outline: none;
}

.input:focus, .select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(36, 116, 216, 0.15);
}

/* Alerts */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 600;
}

.alert-success { background: var(--success-bg); color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger  { background: var(--danger-bg);  color: #991b1b; border: 1px solid #fecaca; }

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: #fff;
    border-radius: var(--radius-lg);
    max-width: 520px;
    width: 100%;
    padding: 24px;
    box-shadow: var(--shadow-lg);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-muted);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .nav-container { flex-direction: column; align-items: stretch; }
    .nav-links { flex-wrap: wrap; justify-content: center; }
    .user-menu { justify-content: space-between; }
    .page-header { flex-direction: column; align-items: stretch; }
}
