:root {
    --primary: #0f766e;
    --primary-dark: #115e59;
    --secondary: #f59e0b;
    --bg: #f5f7fb;
    --surface: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --success: #16a34a;
    --danger: #dc2626;
    --shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
    --radius: 18px;
}

* { box-sizing: border-box; }
body {
    font-family: 'Cairo', sans-serif;
    background: linear-gradient(180deg, #eef5f8 0%, var(--bg) 40%, #f8fafc 100%);
    color: var(--text);
}
.topbar {
    background: linear-gradient(135deg, #0f172a, #134e4a);
    box-shadow: var(--shadow);
}
.navbar-brand, .nav-link, .user-badge, .navbar-brand small { color: #fff !important; }
.nav-link { opacity: 0.9; font-weight: 600; }
.nav-link:hover, .nav-link.active { opacity: 1; color: #fcd34d !important; }
.brand-mark {
    width: 48px; height: 48px; display: grid; place-items: center;
    background: rgba(255,255,255,0.12); border-radius: 14px; font-size: 1.3rem;
}
.card-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.page-title { font-size: 1.7rem; font-weight: 800; margin-bottom: .35rem; }
.text-muted-custom { color: var(--muted); }
.stat-card {
    padding: 1.25rem;
    border-radius: var(--radius);
    color: #fff;
    min-height: 145px;
    position: relative;
    overflow: hidden;
}
.stat-card::after {
    content: '';
    position: absolute;
    inset: auto -20px -20px auto;
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,.08);
    border-radius: 50%;
}
.gradient-a { background: linear-gradient(135deg, #0f766e, #14b8a6); }
.gradient-b { background: linear-gradient(135deg, #1d4ed8, #60a5fa); }
.gradient-c { background: linear-gradient(135deg, #b45309, #f59e0b); }
.table thead th {
    background: #f8fafc;
    color: #334155;
    font-size: .92rem;
    border-bottom: 1px solid var(--border);
}
.table td { vertical-align: middle; }
.badge-status {
    padding: .55rem .8rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: .78rem;
}
.status-pending { background: #fef3c7; color: #92400e; }
.status-arrived { background: #dcfce7; color: #166534; }
.form-control, .form-select {
    border-radius: 14px;
    min-height: 46px;
    border: 1px solid #d7dee8;
}
.form-control:focus, .form-select:focus {
    border-color: #14b8a6;
    box-shadow: 0 0 0 .25rem rgba(20,184,166,.15);
}
.btn {
    border-radius: 14px;
    font-weight: 700;
    min-height: 44px;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), #14b8a6);
    border: none;
}
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); }
.login-wrapper { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.login-card {
    width: min(100%, 460px);
    background: rgba(255,255,255,.95);
    backdrop-filter: blur(12px);
    border-radius: 28px;
    border: 1px solid rgba(255,255,255,.65);
    box-shadow: 0 20px 60px rgba(15,23,42,.18);
    overflow: hidden;
}
.hero-strip {
    background: linear-gradient(135deg, #0f172a, #115e59);
    color: #fff;
    padding: 2rem;
}
.section-toolbar {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}
.search-box { max-width: 320px; }
.empty-box {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--muted);
}
/* تخصيص زر التوجل باللون الأبيض */
.navbar-toggler {
    border-color: rgba(255, 255, 255, 0.25) !important;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.15) !important;
    border-color: #fff !important;
}

/* تغيير لون الخطوط الثلاثة الداخلية إلى الأبيض */
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23ffffff' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

@media (max-width: 768px) {
    .page-title { font-size: 1.35rem; }
    .section-toolbar { align-items: stretch; }
    .search-box { max-width: 100%; width: 100%; }
    .table-responsive { border-radius: 16px; }
}

/* ── بطاقات الوصول القادم ─────────────────────────────────── */
.upcoming-card {
    transition: transform .18s ease, box-shadow .18s ease;
    cursor: pointer;
}
.upcoming-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 50px rgba(15,23,42,.18);
}
.upcoming-today     { background: linear-gradient(135deg, #065f46, #10b981); }
.upcoming-tomorrow  { background: linear-gradient(135deg, #1e3a8a, #3b82f6); }
.upcoming-day-after { background: linear-gradient(135deg, #78350f, #f59e0b); }

.upcoming-icon {
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,.15);
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

/* ── قائمة الدروب داون ────────────────────────────────────── */
.dropdown-menu {
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: .5rem;
}
.dropdown-item {
    font-weight: 600;
    padding: .65rem 1.2rem;
    border-radius: 12px;
}
.dropdown-item:hover { background: #f0fdf9; color: var(--primary); }
.dropdown-item.active { background: var(--primary); color: #fff !important; }

/* ── روابط الترتيب في رؤوس الجدول ────────────────────────── */
th a { white-space: nowrap; }
th a:hover { color: var(--primary) !important; }

/* ── أنماط الطباعة ────────────────────────────────────────── */
@media print {
    .topbar,
    .no-print,
    .btn,
    .section-toolbar,
    .card-panel form {
        display: none !important;
    }
    .card-panel {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
    body { background: #fff !important; }
    main { padding: 0 !important; }
}

/* ── ألوان خطوط القائمة العلوية - أسود ─────────────────────── */
.topbar {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0) !important;
    box-shadow: 0 2px 12px rgba(15,23,42,.08);
}

.navbar-brand,
.navbar-brand small,
.navbar-brand strong {
    color: #0f172a !important;
}

.nav-link {
    color: #1e293b !important;
    opacity: 1 !important;
}

.nav-link:hover,
.nav-link.active {
    color: #0f766e !important;
}

.dropdown-toggle {
    color: #1e293b !important;
}

.brand-mark {
    background: rgba(15, 118, 110, 0.12) !important;
    color: #0f766e !important;
}

.user-badge .fw-bold {
    color: #0f172a !important;
}

.user-badge .text-muted {
    color: #64748b !important;
}

.btn-outline-light {
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}

.btn-outline-light:hover {
    background: #0f172a !important;
    color: #fff !important;
}

.navbar-toggler-icon {
    filter: invert(1) brightness(0);
}

