/* أنا قريب - الأنماط المشتركة */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&display=swap');

:root {
    --lp-primary: #ec6100;
    --lp-primary-dark: #c95300;
    --lp-primary-foreground: #fffaf6;
    --lp-secondary: #0c2140;
    --lp-secondary-foreground: #f7fbfd;
    --lp-bg: #fefdfa;
    --lp-card: #ffffff;
    --lp-muted: #eaf1f8;
    --lp-muted-foreground: #5a6a80;
    --lp-border: #dfe6ee;
    --lp-peach: #ffdbbf;
    --lp-cream: #fcf4e6;
    --lp-shadow-card: 0 12px 32px -14px rgba(12, 33, 64, 0.16);
    --lp-shadow-soft: 0 20px 50px -20px rgba(12, 33, 64, 0.22);
    --lp-shadow-orange: 0 14px 34px -12px rgba(236, 97, 0, 0.45);
}

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

/* GPS prompt banner */
.geo-banner {
    display: none;
    background: linear-gradient(135deg, var(--lp-secondary) 0%, #16345c 100%);
    color: white;
    padding: 14px 20px;
    box-shadow: var(--lp-shadow-soft);
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    position: sticky; top: 0; z-index: 200;
    animation: geoSlideDown 0.4s ease-out;
}
.geo-banner.open { display: flex; }
.geo-banner.warn { background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%); }
.geo-banner-icon {
    font-size: 32px;
    background: rgba(255,255,255,0.2);
    width: 52px; height: 52px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    animation: geoPulse 2s ease-in-out infinite;
}
.geo-banner-text { flex: 1; min-width: 220px; }
.geo-banner-text strong { display: block; font-size: 16px; margin-bottom: 4px; }
.geo-banner-text span { font-size: 13px; opacity: 0.95; line-height: 1.6; }
.geo-banner-actions { display: flex; gap: 8px; align-items: center; }
.geo-banner-actions .btn {
    background: white !important; color: var(--lp-primary) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-weight: bold;
}
.geo-banner-actions .btn:hover { transform: translateY(-2px); }
.geo-banner-close {
    background: rgba(255,255,255,0.2); color: white;
    border: 1px solid rgba(255,255,255,0.4);
    width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
    font-size: 14px; transition: background 0.2s;
}
.geo-banner-close:hover { background: rgba(255,255,255,0.35); }

@keyframes geoSlideDown { from { transform: translateY(-100%); } to { transform: translateY(0); } }
@keyframes geoPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }

@media (max-width: 600px) {
    .geo-banner { padding: 12px 14px; gap: 10px; }
    .geo-banner-icon { width: 44px; height: 44px; font-size: 26px; }
    .geo-banner-text { width: 100%; }
    .geo-banner-text strong { font-size: 14px; }
    .geo-banner-text span { font-size: 12px; }
    .geo-banner-actions { width: 100%; justify-content: space-between; }
}

body {
    font-family: 'Cairo', 'Segoe UI', 'Tahoma', sans-serif;
    background: var(--lp-bg);
    color: var(--lp-secondary);
    line-height: 1.5;
}

a { color: inherit; }

/* Navbar */
.navbar {
    background: linear-gradient(135deg, var(--lp-secondary) 0%, #16345c 100%);
    color: white;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    position: sticky; top: 0; z-index: 1100; /* > Leaflet (400-700) */
}

/* تأكد أن خرائط Leaflet لا تُغطي الـ navbar */
.leaflet-pane,
.leaflet-top,
.leaflet-bottom,
.leaflet-control { z-index: 400 !important; }
.leaflet-control-zoom { z-index: 600 !important; }
.leaflet-popup-pane { z-index: 700 !important; }
.navbar-brand { display: flex; align-items: center; gap: 10px; }
.navbar-logo { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; }
.navbar h1 { font-size: 20px; }

.navbar-toggle {
    display: none;
    background: rgba(255,255,255,0.15);
    color: white; border: 1px solid rgba(255,255,255,0.4);
    width: 40px; height: 40px; border-radius: 8px;
    font-size: 20px; cursor: pointer;
}

.navbar-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.user-info { display: flex; align-items: center; gap: 8px; padding: 0 8px; }
.user-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    display: flex; align-items: center; justify-content: center;
    font-weight: bold; font-size: 14px;
    overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.user-name { font-size: 14px; }
.btn-link {
    background: rgba(255, 255, 255, 0.1);
    color: white; border: 1px solid rgba(255,255,255,0.15);
    padding: 8px 16px; border-radius: 999px; cursor: pointer;
    text-decoration: none; transition: all 0.2s; font-size: 13px; font-weight: 600;
    white-space: nowrap;
}
.btn-link:hover { background: rgba(255, 255, 255, 0.2); }
.btn-logout { background: var(--lp-primary); border-color: var(--lp-primary); }
.btn-logout:hover { background: var(--lp-primary-dark); }

/* Plain nav links (center of the navbar), distinct from the pill action buttons */
.navbar-right a.nav-link,
.navbar-links a.nav-link {
    background: none; border: none; padding: 6px 2px;
    color: rgba(255, 255, 255, 0.75); font-weight: 700;
    border-bottom: 2px solid transparent;
}
.navbar-right a.nav-link:hover,
.navbar-links a.nav-link:hover { background: none; color: white; }
.navbar-right a.nav-link.active,
.navbar-links a.nav-link.active { color: white; border-bottom-color: var(--lp-primary); }

.btn-link.bell {
    position: relative; width: 38px; height: 38px; padding: 0;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.navbar-mobile-actions { display: none; align-items: center; gap: 8px; }
.mobile-bell { display: none; }
.mobile-logout { display: none; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; background: var(--lp-primary); border-color: var(--lp-primary); }
.bell-count {
    background: var(--lp-primary); color: white;
    border-radius: 12px; padding: 1px 7px;
    font-size: 10px; font-weight: bold;
    position: absolute; top: -4px; left: -4px;
    min-width: 18px; text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* شريط تنقّل الإدارة - صفّان: (الشعار + إجراءات المستخدم) ثم (روابط التنقّل) */
.navbar.admin { flex-direction: column; align-items: stretch; }
.navbar-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; }
.navbar-admin-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.navbar-links {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    width: 100%; padding-top: 10px; margin-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.container { max-width: 1200px; margin: 0 auto; padding: 25px 20px; }

.page-header { margin-bottom: 25px; }
.page-header h2 { font-size: 26px; color: var(--lp-secondary); margin-bottom: 6px; }
.page-header p { color: #777; font-size: 14px; }

/* Grid & Cards */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 25px;
}
.card {
    background: var(--lp-card); border-radius: 12px; padding: 20px;
    box-shadow: 0 2px 12px rgba(12, 33, 64, 0.06);
    border: 1px solid var(--lp-border);
}
.card-title {
    font-size: 13px; color: #666; margin-bottom: 8px;
    font-weight: 600; text-transform: uppercase;
}
.card-number {
    font-size: 30px; font-weight: bold; color: var(--lp-primary); margin-bottom: 4px;
}
.card-subtitle { font-size: 12px; color: #999; }

.section {
    background: var(--lp-card); border-radius: 12px; padding: 20px;
    margin-bottom: 18px; box-shadow: 0 2px 12px rgba(12, 33, 64, 0.06);
}
.section-title {
    font-size: 18px; color: var(--lp-secondary); margin-bottom: 18px;
    padding-bottom: 10px; border-bottom: 3px solid var(--lp-primary);
}

/* Buttons */
.btn {
    display: inline-block;
    background: var(--lp-primary);
    color: var(--lp-primary-foreground); border: none; padding: 10px 20px;
    border-radius: 10px; cursor: pointer; font-size: 14px;
    font-weight: 700; transition: all 0.2s; text-decoration: none;
    font-family: inherit;
    box-shadow: var(--lp-shadow-orange);
}
.btn:hover { transform: translateY(-2px); background: var(--lp-primary-dark); }
.btn:active { transform: translateY(0) scale(0.97); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 6px; }
.btn-secondary { background: var(--lp-cream); color: var(--lp-primary); border: 1px solid var(--lp-primary); box-shadow: none; }
.btn-secondary:hover { background: var(--lp-peach); color: var(--lp-primary-dark); border-color: var(--lp-primary-dark); }
.btn-success { background: linear-gradient(135deg, #27ae60 0%, #229954 100%); box-shadow: none; }
.btn-success:hover { background: linear-gradient(135deg, #229954 0%, #1e8449 100%); }
.btn-danger { background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%); box-shadow: none; }
.btn-danger:hover { background: linear-gradient(135deg, #c0392b 0%, #a93226 100%); }
.btn-warning { background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%); box-shadow: none; }
.btn-warning:hover { background: linear-gradient(135deg, #e67e22 0%, #d35400 100%); }

/* Forms */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block; margin-bottom: 6px; color: #333;
    font-weight: 600; font-size: 14px;
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%; padding: 11px 12px; border: 2px solid var(--lp-border);
    border-radius: 10px; font-size: 14px; font-family: inherit;
    transition: border-color 0.2s; background: var(--lp-card);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { outline: none; border-color: var(--lp-primary); box-shadow: 0 0 0 3px rgba(236, 97, 0, 0.15); }
.form-group textarea { resize: vertical; min-height: 100px; }
.form-group input:disabled { background: #f5f5f5; color: #888; }
.error { color: #e74c3c; font-size: 12px; margin-top: 4px; display: block; }
.help-text { font-size: 12px; color: #999; margin-top: 4px; display: block; }

/* Page header with an icon badge */
.profile-header-row { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.profile-header-row h2 { font-size: 24px; color: var(--lp-secondary); margin-bottom: 4px; }
.profile-header-row p { color: #777; font-size: 14px; }
.profile-header-icon, .section-icon, .profile-security-icon {
    flex-shrink: 0; width: 42px; height: 42px; border-radius: 12px;
    border: 2px solid var(--lp-primary); color: var(--lp-primary);
    background: rgba(236, 97, 0, 0.06);
    display: flex; align-items: center; justify-content: center; font-size: 18px;
}

/* Section head with icon badge + subtitle */
.section-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.section-sub { color: var(--lp-muted-foreground); font-size: 12px; margin-top: 2px; }

/* Profile layout: main form (right) + summary sidebar (left) */
.profile-grid { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: start; }
@media (min-width: 900px) {
    .profile-grid { grid-template-columns: 1fr 300px; }
}
.profile-main { display: flex; flex-direction: column; gap: 18px; }
.profile-sidebar { display: flex; flex-direction: column; gap: 18px; }

/* Avatar circle (shared by the dropzone preview and the sidebar) */
.avatar-circle {
    position: relative; flex-shrink: 0; border-radius: 50%; overflow: visible;
    background: var(--lp-peach); color: var(--lp-primary);
}
.avatar-circle-img {
    width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800;
    border: 3px solid var(--lp-card); box-shadow: var(--lp-shadow-card);
}
.avatar-circle-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-circle-md { width: 96px; height: 96px; }
.avatar-circle-md .avatar-circle-img { font-size: 34px; }
.avatar-circle-lg { width: 130px; height: 130px; margin: 0 auto 14px; }
.avatar-circle-lg .avatar-circle-img { font-size: 46px; }
.avatar-camera-badge {
    position: absolute; bottom: 0; left: 0; z-index: 2; cursor: pointer;
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--lp-primary); color: white; border: 3px solid var(--lp-card);
    display: flex; align-items: center; justify-content: center; font-size: 12px;
    transition: opacity 0.2s;
}
.avatar-camera-badge:hover { background: var(--lp-primary-dark); }

/* Avatar dropzone */
.avatar-dropzone {
    display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
    border: 2px dashed rgba(236, 97, 0, 0.4); border-radius: 16px;
    background: var(--lp-cream); padding: 26px 22px;
}
.avatar-dropzone-inner {
    flex: 1; min-width: 200px; cursor: pointer; text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.avatar-dropzone-inner i { font-size: 30px; color: var(--lp-secondary); }
.avatar-dropzone-inner strong { color: var(--lp-secondary); font-size: 14px; }
.avatar-dropzone-inner span { color: var(--lp-muted-foreground); font-size: 12px; }
.avatar-dropzone-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.avatar-remove-link {
    background: none; border: none; color: #d64545; font-size: 12px; font-weight: 700;
    cursor: pointer; padding: 0; display: flex; align-items: center; gap: 4px; white-space: nowrap;
}
.avatar-remove-link:hover { text-decoration: underline; }

/* Two-column form rows */
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 600px) { .form-row-2 { grid-template-columns: 1fr; } }

/* Sidebar summary card */
.profile-summary-card { background: var(--lp-card); border: 1px solid var(--lp-border); border-radius: 16px; padding: 24px 20px; text-align: center; box-shadow: 0 2px 12px rgba(12,33,64,0.06); }
.profile-summary-name { font-size: 18px; color: var(--lp-secondary); margin-bottom: 8px; }
.badge-verified {
    display: inline-flex; align-items: center; gap: 6px;
    background: #e7f9ef; color: #1a9c5c; font-size: 12px; font-weight: 700;
    padding: 4px 14px; border-radius: 999px; margin-bottom: 16px;
}
.profile-info-list { display: flex; flex-direction: column; gap: 8px; text-align: right; margin-top: 6px; }
.profile-info-row {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    background: var(--lp-muted); border-radius: 12px; padding: 10px 14px;
}
.profile-info-row strong { display: block; font-size: 13px; color: var(--lp-secondary); }
.profile-info-row small { display: block; font-size: 11px; color: var(--lp-muted-foreground); margin-top: 2px; }
.profile-info-row > i { color: var(--lp-primary); font-size: 15px; flex-shrink: 0; }

.profile-security-box {
    background: var(--lp-cream); border: 1px solid rgba(236, 97, 0, 0.25); border-radius: 16px;
    padding: 20px; text-align: center;
}
.profile-security-icon { margin: 0 auto 10px; }
.profile-security-box strong { display: block; color: var(--lp-secondary); font-size: 14px; margin-bottom: 4px; }
.profile-security-box p { color: var(--lp-muted-foreground); font-size: 12px; margin-bottom: 14px; }

/* Inputs with a leading icon (and optionally a show/hide toggle) */
.field-icon { position: relative; }
.field-icon-lead {
    position: absolute; top: 50%; right: 14px; transform: translateY(-50%);
    color: var(--lp-muted-foreground); font-size: 15px; pointer-events: none;
}
.field-icon input { padding-right: 40px; }
.field-icon.has-toggle input { padding-left: 40px; }
.field-toggle-btn {
    position: absolute; top: 50%; left: 10px; transform: translateY(-50%);
    background: none; border: none; color: var(--lp-muted-foreground); cursor: pointer;
    padding: 4px; display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.field-toggle-btn:hover { color: var(--lp-primary); }

/* Expand/collapse panel (e.g. change-password form inside the security box) */
.expand-panel {
    max-height: 0; opacity: 0; overflow: hidden; visibility: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin-top 0.4s ease, visibility 0s linear 0.4s;
    margin-top: 0; text-align: right;
}
.expand-panel.open {
    max-height: 600px; opacity: 1; visibility: visible;
    margin-top: 16px;
    transition: max-height 0.5s ease, opacity 0.4s ease 0.1s, margin-top 0.5s ease;
}
.avatar-actions .help-text { margin-top: 0; }

/* Client/specialist dashboard hero + stats */
.dash-hero { display: flex; align-items: center; gap: 30px; margin-bottom: 24px; }
.dash-hero-photo { position: relative; flex-shrink: 0; width: 240px; }
.dash-hero-photo-blob {
    position: absolute; inset: 8% 8% 4% 8%; border-radius: 45% 45% 50% 50% / 55% 55% 45% 45%;
    background: radial-gradient(circle at 50% 30%, var(--lp-peach) 0%, rgba(236, 97, 0, 0.15) 100%);
    z-index: 0;
}
.dash-hero-photo img { position: relative; z-index: 1; width: 100%; display: block; }
.dash-hero-main { flex: 1; min-width: 0; }

.dash-greeting-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.dash-greeting-row h2 { font-size: 26px; color: var(--lp-secondary); margin-bottom: 4px; }
.dash-greeting-row p { color: #777; font-size: 14px; }

.dash-commission-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dash-commission-icon {
    flex-shrink: 0; width: 46px; height: 46px; border-radius: 50%;
    background: var(--lp-card); color: var(--lp-primary); box-shadow: var(--lp-shadow-card);
    display: flex; align-items: center; justify-content: center; font-size: 18px;
}

.dash-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 16px 0; }
.dash-stat-card {
    background: var(--lp-card); border: 1px solid var(--lp-border); border-radius: 16px;
    padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 14px;
    box-shadow: 0 2px 12px rgba(12, 33, 64, 0.06);
}
.dash-stat-label { font-size: 13px; color: var(--lp-muted-foreground); font-weight: 600; margin-bottom: 6px; }
.dash-stat-value { font-size: 26px; font-weight: 800; color: var(--lp-secondary); }
.dash-stat-value.orange { color: var(--lp-primary); }
.dash-stat-value.green { color: #1a9c5c; }
.dash-stat-value.blue { color: #5b6bda; }
.dash-stat-icon {
    flex-shrink: 0; width: 52px; height: 52px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.dash-stat-icon.orange { background: var(--lp-peach); color: var(--lp-primary); }
.dash-stat-icon.green { background: #e7f9ef; color: #1a9c5c; }
.dash-stat-icon.blue { background: #eef1fd; color: #5b6bda; }

.dash-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-lg { padding: 14px 26px; font-size: 15px; border-radius: 14px; }

.dash-section-head {
    display: flex; align-items: center; justify-content: space-between;
    border-top: 3px solid var(--lp-primary); padding-top: 16px; margin: 30px 0 16px;
}
.dash-section-head h3 { font-size: 18px; color: var(--lp-secondary); margin: 0; }
.dash-section-head > i { color: var(--lp-primary); font-size: 18px; }

.dash-empty {
    position: relative; overflow: hidden; background: var(--lp-card); border: 1px solid var(--lp-border);
    border-radius: 20px; padding: 60px 20px; text-align: center;
}
.dash-empty-icon { font-size: 60px; color: var(--lp-primary); opacity: 0.85; margin-bottom: 16px; }
.dash-empty h4 { font-size: 17px; color: var(--lp-secondary); margin-bottom: 6px; }
.dash-empty p { color: var(--lp-muted-foreground); font-size: 13px; margin-bottom: 22px; }
.dash-empty-dots {
    position: absolute; bottom: 20px; left: 20px; width: 70px; height: 50px;
    background-image: radial-gradient(var(--lp-border) 1.5px, transparent 1.5px);
    background-size: 10px 10px; opacity: 0.7;
}

@media (max-width: 768px) {
    .dash-hero { flex-direction: column; }
    .dash-hero-photo { width: 180px; }
    .dash-stats { grid-template-columns: 1fr; }
}

/* Modal (shared: confirm dialogs, forms, etc.) */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(12, 33, 64, 0.55);
    display: none; align-items: center; justify-content: center;
    z-index: 1200; padding: 20px; /* > navbar (1100) حتى لا يظهر فوق النافذة المنبثقة */
}
.modal-backdrop.open { display: flex; }
.modal {
    background: var(--lp-card); border-radius: 18px; padding: 28px;
    width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto;
    box-shadow: var(--lp-shadow-soft);
}
.modal h3 { margin-bottom: 6px; color: var(--lp-secondary); }
.modal-sub { color: var(--lp-muted-foreground); font-size: 13px; margin-bottom: 18px; }
.modal-actions { display: flex; gap: 8px; margin-top: 15px; }
.confirm-modal-icon {
    width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 14px;
    background: #fdeceb; color: #d64545; font-size: 26px;
    display: flex; align-items: center; justify-content: center;
}

/* Alerts */
.alert { padding: 12px 15px; border-radius: 8px; margin-bottom: 15px; font-size: 14px; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffc107; }
.alert-info    { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* زر "اختيار ملفات" الافتراضي لحقل type="file" — بلون العلامة بدل الأزرق الافتراضي */
input[type="file"]::-webkit-file-upload-button,
input[type="file"]::file-selector-button {
    background: #fff3ea; color: var(--lp-primary, #ec6100);
    border: 1px solid #ffd9b3; border-radius: 6px;
    padding: 6px 14px; margin-inline-end: 10px;
    font-family: inherit; font-size: 13px; cursor: pointer;
    transition: background 0.15s;
}
input[type="file"]::-webkit-file-upload-button:hover,
input[type="file"]::file-selector-button:hover {
    background: #ffe6d1;
}

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 600px; }
table th {
    background: #f5f6fa; padding: 10px 12px; text-align: right;
    font-weight: 600; color: #333; border-bottom: 1px solid #e0e0e0;
    font-size: 13px;
}
table td { padding: 10px 12px; border-bottom: 1px solid #eee; color: #555; font-size: 13px; }
table tr:hover { background: #f9f9f9; }

/* Badges */
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 600;
}
.badge-active   { background: #d4edda; color: #155724; }
.badge-pending  { background: #fff3cd; color: #856404; }
.badge-rejected { background: #f8d7da; color: #721c24; }
.badge-info     { background: #cfe2ff; color: #084298; }

/* Empty */
.empty-state {
    text-align: center; padding: 40px 20px; background: white;
    border-radius: 12px; color: #888;
}
.empty-state-icon { font-size: 48px; margin-bottom: 15px; }

/* Request item */
.request-item {
    background: var(--lp-card); border-radius: 10px; padding: 15px;
    margin-bottom: 12px; border-right: 4px solid var(--lp-primary);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
}
.request-item-header {
    display: flex; justify-content: space-between;
    align-items: start; margin-bottom: 8px; flex-wrap: wrap; gap: 8px;
}
.request-title { font-weight: 600; color: var(--lp-secondary); font-size: 16px; }
.request-info { font-size: 13px; color: #666; margin: 5px 0; }
.request-info span { font-weight: 600; color: #333; }

/* Status pills */
.status-pill {
    background: var(--lp-secondary); color: white; padding: 3px 10px;
    border-radius: 20px; font-size: 11px; font-weight: 600;
}
.status-pill.completed { background: #27ae60; }
.status-pill.in_progress { background: #f39c12; }
.status-pill.cancelled, .status-pill.rejected { background: #e74c3c; }
.status-pill.assigned { background: #3498db; }
.status-pill.accepted { background: #27ae60; }
.status-pill.pending { background: #95a5a6; }

.rating-stars { color: #f39c12; font-size: 18px; letter-spacing: 2px; }
.rating-stars.dim { color: #d0d0d0; }

/* Star input (interactive) */
.star-input {
    display: inline-flex; flex-direction: row-reverse;
    gap: 4px; font-size: 32px; cursor: pointer; user-select: none;
}
.star-input input { display: none; }
.star-input label { color: #d0d0d0; transition: color .15s; line-height: 1; }
.star-input label:hover,
.star-input label:hover ~ label,
.star-input input:checked ~ label { color: #f39c12; }

/* Rating card (one review) */
.rating-card {
    background: #fafbfd; border: 1px solid #eee; border-radius: 10px;
    padding: 14px 16px; margin-bottom: 10px;
}
.rating-card-head {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 8px;
}
.rating-card-from { font-weight: 600; color: #2c3e50; }
.rating-card-date { font-size: 12px; color: #999; }
.rating-card-comment {
    color: #555; line-height: 1.6; margin-top: 6px; font-size: 13px;
}
.rating-card-meta {
    display: flex; flex-wrap: wrap; gap: 6px 14px;
    margin-top: 8px; font-size: 12px; color: #666;
}
.rating-card-meta span strong { color: #f39c12; }

/* Rating histogram bar */
.rating-bar-row {
    display: grid; grid-template-columns: 22px 1fr 36px;
    gap: 8px; align-items: center; font-size: 12px; color: #666;
    margin: 3px 0;
}
.rating-bar-row .bar {
    height: 8px; background: #eee; border-radius: 4px; overflow: hidden;
}
.rating-bar-row .bar > span {
    display: block; height: 100%; background: #f39c12;
}

.rating-summary-big { font-size: 42px; font-weight: bold; color: #f39c12; line-height: 1; }
.rating-summary-sub { color: #777; font-size: 13px; }

.row { display: flex; gap: 15px; flex-wrap: wrap; }
.col { flex: 1; min-width: 280px; }

/* Responsive */
@media (max-width: 768px) {
    .navbar { padding: 10px 15px; flex-wrap: nowrap; }
    .navbar h1 { font-size: 17px; }
    .navbar-logo { width: 32px; height: 32px; }
    .navbar-toggle { display: flex; align-items: center; justify-content: center; }
    .navbar-mobile-actions { display: flex; }
    .mobile-bell { display: inline-flex; align-items: center; justify-content: center; width:40px; height:40px; padding: 0; }
    .mobile-logout { display: inline-flex !important; }
    .desktop-bell { display: none !important; }
    .navbar-right .btn-logout { display: none; }
    .navbar-right {
        display: none;
        position: absolute; top: 100%; right: 0; left: 0;
        background: inherit; padding: 12px 15px;
        flex-direction: column; align-items: stretch;
        box-shadow: 0 5px 20px rgba(0,0,0,0.15);
        gap: 6px;
    }
    .navbar.open .navbar-right { display: flex; }
    .navbar-right .btn-link { text-align: right; padding: 10px 12px; }
    .user-info { padding: 8px 0; border-top: 1px solid rgba(255,255,255,0.2); border-bottom: 1px solid rgba(255,255,255,0.2); }

    /* لوحة الإدارة: نفس منطق الطي، لكن على صفّين (الإجراءات ثم الروابط) */
    .navbar.admin { flex-wrap: nowrap; }
    .navbar-top { flex-wrap: nowrap; }
    .navbar-admin-actions,
    .navbar-links {
        display: none;
        width: 100%; flex-direction: column; align-items: stretch;
        gap: 6px; margin-top: 0; padding-top: 12px; border-top: none;
    }
    .navbar-links { border-top: 1px solid rgba(255,255,255,0.15); }
    .navbar.admin.open .navbar-admin-actions,
    .navbar.admin.open .navbar-links { display: flex; }
    .navbar-admin-actions .btn-link,
    .navbar-links .btn-link { text-align: right; padding: 10px 12px; }

    .container { padding: 15px; }
    .page-header h2 { font-size: 22px; }

    .card-number { font-size: 24px; }

    .row { flex-direction: column; }
    .col { width: 100%; min-width: 0; }
}

@media (max-width: 480px) {
    .navbar h1 { font-size: 15px; }
    .page-header h2 { font-size: 20px; }
    .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .card { padding: 15px; }
    .section { padding: 15px; }
    .btn { padding: 9px 16px; font-size: 13px; }
    .request-item { padding: 12px; }
    .request-title { font-size: 14px; }
}

/* تبديل اللغة: زر صغير برمز اللغة الحالية (بلا علم) وسهم، وعند النقر تنسدل قائمة رموز + أسماء */
.lang-switch { position: relative; display: inline-block; }
.lang-switch-btn {
    display: flex; align-items: center; gap: 5px;
    padding: 6px 9px; font-size: 15px; line-height: 1;
    background: #fff; color: #ec6100; border: 1px solid #ffd9b3; border-radius: 20px;
    cursor: pointer; box-shadow: 0 2px 6px rgba(236, 97, 0, 0.15);
    transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
}
.lang-switch-btn:hover { box-shadow: 0 4px 12px rgba(236, 97, 0, 0.22); transform: translateY(-1px); }
.lang-switch.is-open .lang-switch-btn {
    background: #fff3ea; box-shadow: 0 4px 12px rgba(236, 97, 0, 0.25);
}
.lang-switch-code { font-size: 13px; font-weight: 700; letter-spacing: 0.2px; }
.lang-switch-caret {
    width: 7px; height: 7px; margin-top: -3px;
    border-inline-end: 2px solid currentColor; border-block-end: 2px solid currentColor;
    transform: rotate(45deg); transition: transform 0.15s;
}
.lang-switch.is-open .lang-switch-caret { transform: rotate(-135deg); margin-top: 2px; }
.lang-switch-dark .lang-switch-btn {
    background: rgba(255,255,255,0.12); color: #fff; border-color: rgba(255,255,255,0.3);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.lang-switch-dark .lang-switch-btn:hover,
.lang-switch-dark.is-open .lang-switch-btn { background: rgba(255,255,255,0.24); }

.lang-switch-menu {
    position: absolute; inset-inline-end: 0; top: calc(100% + 10px); z-index: 50;
    display: flex; flex-direction: column; gap: 2px;
    background: #fff; padding: 6px; border-radius: 14px; min-width: 150px;
    border: 1px solid #f3e6d8; box-shadow: 0 12px 32px rgba(20, 20, 20, 0.16);
    opacity: 0; visibility: hidden; pointer-events: none;
    transform: translateY(-6px) scale(0.96); transform-origin: top right;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}
:dir(rtl) .lang-switch-menu { transform-origin: top left; }
.lang-switch-menu::before {
    content: ''; position: absolute; top: -5px; inset-inline-end: 16px;
    width: 10px; height: 10px; background: #fff;
    border-inline-start: 1px solid #f3e6d8; border-block-start: 1px solid #f3e6d8;
    transform: rotate(45deg);
}
.lang-switch.is-open .lang-switch-menu {
    opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0) scale(1);
}
.lang-switch-option {
    display: flex; align-items: center; gap: 9px;
    padding: 8px 10px; border-radius: 9px; font-size: 13px; font-weight: 600;
    color: #333; background: transparent;
    text-decoration: none; direction: ltr; text-align: start;
    transition: background 0.15s;
}
.lang-switch-option:hover { background: #fbf3ea; }
.lang-switch-option.is-active { background: #fff3ea; color: #ec6100; }
.lang-switch-option-code {
    display: flex; align-items: center; justify-content: center;
    min-width: 26px; padding: 3px 5px; border-radius: 6px;
    background: #fbf3ea; color: #ec6100; font-size: 11px; font-weight: 700;
    letter-spacing: 0.2px;
}
.lang-switch-option.is-active .lang-switch-option-code { background: #ec6100; color: #fff; }
.lang-switch-option-label { flex: 1; }
.lang-switch-check { color: #2fa84f; font-size: 14px; font-weight: 700; }
.lang-switch-dark .lang-switch-menu { border-color: #eee; }
.lang-switch-dark .lang-switch-menu::before { border-color: #eee; }

/* منع التمرير/الاهتزاز الأفقي للصفحة على الجوال وداخل التطبيق */
html, body { max-width: 100%; overflow-x: clip; }
