/* المطراش ALMATRAASH - الأنماط المشتركة (هوية بصرية جديدة) */
        :root {
            --navy: #0E3B2E;
            --navy-light: #15A876;
            --navy-card: #123F30;
            --gold: #C6F247;
            --gold-light: #DFF98B;
            --gold-dark: #A8D62E;
            --white: #FFFFFF;
            --cream: #F8F9F7;
            --gray: #6C757D;
            --gray-light: #E6E9EC;
            --success: #28A745;
            --danger: #DC3545;
            --warning: #FFA000;
            --shadow: 0 10px 40px rgba(5, 59, 46, 0.15);
            --shadow-lg: 0 20px 60px rgba(5, 59, 46, 0.25);
            --radius: 24px;
            --radius-sm: 16px;
            --radius-xs: 12px;
        }
        * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Tajawal', sans-serif; -webkit-tap-highlight-color: transparent; }
        body {
            background: var(--cream);
            min-height: 100vh;
            color: var(--navy);
            overflow-x: hidden;
        }
        .app-container {
            max-width: 480px;
            margin: 0 auto;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            background: var(--cream);
            position: relative;
        }
        /* Header - Navy with gold accent */
        .header {
            background: linear-gradient(180deg, var(--navy) 0%, var(--navy-light) 100%);
            padding: 28px 24px 80px;
            border-radius: 0 0 40px 40px;
            position: relative;
            overflow: hidden;
            box-shadow: var(--shadow-lg);
        }
        .header::before {
            content: '';
            position: absolute;
            top: -50%;
            right: -20%;
            width: 300px;
            height: 300px;
            background: radial-gradient(circle, rgba(214,242,74,0.08) 0%, transparent 70%);
            border-radius: 50%;
        }
        .header::after {
            content: '';
            position: absolute;
            bottom: 20px;
            left: 10%;
            right: 10%;
            height: 2px;
            background: repeating-linear-gradient(90deg, var(--gold) 0px, var(--gold) 8px, transparent 8px, transparent 16px);
            opacity: 0.4;
        }
        .header-top {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 24px;
            position: relative;
            z-index: 1;
        }
        .home-link {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            color: rgba(255,255,255,0.85);
            text-decoration: none;
            font-size: 13px;
            font-weight: 800;
            background: rgba(255,255,255,0.08);
            border: 1px solid rgba(214,242,74,0.25);
            padding: 9px 16px;
            border-radius: 14px;
            transition: all 0.3s ease;
        }
        .home-link:hover {
            background: var(--gold);
            color: var(--navy);
            border-color: var(--gold);
        }
        .brand {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        .brand-logo {
            width: 52px;
            height: 52px;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }
        .brand-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 14px; }
        .brand-logo svg {
            width: 36px;
            height: 36px;
        }
        .brand-text {
            color: var(--white);
        }
        .brand-text h1 {
            font-size: 26px;
            font-weight: 900;
            letter-spacing: -0.5px;
            line-height: 1;
        }
        .brand-text span {
            font-size: 12px;
            color: var(--gold);
            font-weight: 700;
            letter-spacing: 2px;
        }
        .header-subtitle {
            color: rgba(255,255,255,0.7);
            font-size: 14px;
            font-weight: 500;
            position: relative;
            z-index: 1;
        }
        /* Role Switcher */
        .role-switcher {
            display: flex;
            background: rgba(255,255,255,0.08);
            border-radius: 20px;
            padding: 5px;
            backdrop-filter: blur(10px);
            margin-top: 20px;
            position: relative;
            z-index: 1;
            border: 1px solid rgba(214,242,74,0.15);
        }
        .role-btn {
            flex: 1;
            padding: 12px 8px;
            border: none;
            background: transparent;
            color: rgba(255,255,255,0.6);
            font-size: 13px;
            font-weight: 700;
            border-radius: 16px;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            font-family: 'Tajawal', sans-serif;
        }
        .role-btn.active {
            background: var(--gold);
            color: var(--navy);
            box-shadow: 0 4px 15px rgba(214,242,74,0.3);
        }
        .role-btn svg {
            width: 16px;
            height: 16px;
        }
        /* Main Content */
        .main-content {
            flex: 1;
            padding: 0 20px 100px;
            margin-top: -50px;
            position: relative;
            z-index: 2;
        }
        /* Cards */
        .card {
            background: var(--white);
            border-radius: var(--radius);
            padding: 24px;
            box-shadow: var(--shadow);
            margin-bottom: 16px;
            border: 1px solid var(--gray-light);
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }
        .card:active {
            transform: scale(0.98);
        }
        .card-navy {
            background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
            color: var(--white);
            border: none;
        }
        .card-gold {
            background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
            color: var(--navy);
            border: none;
        }
        .card-title {
            font-size: 17px;
            font-weight: 800;
            color: var(--navy);
            margin-bottom: 6px;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .card-navy .card-title { color: var(--white); }
        .card-gold .card-title { color: var(--navy); }
        .card-subtitle {
            font-size: 13px;
            color: var(--gray);
            font-weight: 500;
        }
        .card-navy .card-subtitle { color: rgba(255,255,255,0.7); }
        /* Rider Cards */
        .rider-card {
            background: var(--white);
            border-radius: var(--radius-sm);
            padding: 20px;
            margin-bottom: 14px;
            box-shadow: 0 4px 20px rgba(13,27,42,0.08);
            border: 2px solid transparent;
            transition: all 0.3s ease;
            cursor: pointer;
            position: relative;
            overflow: hidden;
        }
        .rider-card::before {
            content: '';
            position: absolute;
            top: 0;
            right: 0;
            width: 5px;
            height: 100%;
            background: var(--gold);
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        .rider-card:hover::before, .rider-card.selected::before {
            opacity: 1;
        }
        .rider-card.selected {
            border-color: var(--gold);
            box-shadow: 0 4px 25px rgba(214,242,74,0.2);
        }
        .rider-header {
            display: flex;
            align-items: center;
            gap: 14px;
            margin-bottom: 12px;
        }
        .rider-avatar {
            width: 56px;
            height: 56px;
            border-radius: 18px;
            background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--gold);
            font-size: 22px;
            font-weight: 900;
            flex-shrink: 0;
            border: 2px solid var(--gold);
        }
        .rider-info h4 {
            font-size: 16px;
            font-weight: 800;
            color: var(--navy);
        }
        .rider-info p {
            font-size: 13px;
            color: var(--gray);
            display: flex;
            align-items: center;
            gap: 6px;
            font-weight: 500;
        }
        .rider-meta {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 10px;
            padding-top: 10px;
            border-top: 1px dashed var(--gray-light);
        }
        .status-badge {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 6px 14px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 800;
        }
        .status-available {
            background: rgba(40,167,69,0.1);
            color: var(--success);
        }
        .status-busy {
            background: rgba(214,242,74,0.15);
            color: var(--gold-dark);
        }
        .status-offline {
            background: var(--gray-light);
            color: var(--gray);
        }
        .status-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            animation: pulse 2s infinite;
        }
        .status-available .status-dot { background: var(--success); }
        .status-busy .status-dot { background: var(--gold-dark); }
        .status-offline .status-dot { background: var(--gray); animation: none; }
        @keyframes pulse {
            0%, 100% { opacity: 1; transform: scale(1); }
            50% { opacity: 0.5; transform: scale(0.8); }
        }
        .rider-stats {
            font-size: 12px;
            color: var(--gray);
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 4px;
        }
        /* Forms */
        .form-group {
            margin-bottom: 18px;
        }
        .form-label {
            display: block;
            font-size: 14px;
            font-weight: 700;
            color: var(--navy);
            margin-bottom: 8px;
        }
        .form-input {
            width: 100%;
            padding: 16px 18px;
            border: 2px solid var(--gray-light);
            border-radius: var(--radius-xs);
            font-size: 15px;
            background: var(--white);
            transition: all 0.3s ease;
            color: var(--navy);
            font-family: 'Tajawal', sans-serif;
            font-weight: 500;
        }
        .form-input:focus {
            outline: none;
            border-color: var(--gold);
            box-shadow: 0 0 0 4px rgba(214,242,74,0.15);
        }
        .form-input::placeholder {
            color: #ADB5BD;
            font-weight: 400;
        }
        textarea.form-input {
            resize: vertical;
            min-height: 90px;
        }
        /* Buttons */
        .btn {
            width: 100%;
            padding: 16px;
            border: none;
            border-radius: var(--radius-xs);
            font-size: 16px;
            font-weight: 800;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            font-family: 'Tajawal', sans-serif;
        }
        .btn-gold {
            background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
            color: var(--navy);
            box-shadow: 0 6px 20px rgba(214,242,74,0.35);
        }
        .btn-gold:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 30px rgba(214,242,74,0.45);
        }
        .btn-gold:active {
            transform: translateY(0);
        }
        .btn-navy {
            background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
            color: var(--white);
            box-shadow: 0 6px 20px rgba(13,27,42,0.25);
        }
        .btn-navy:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 30px rgba(13,27,42,0.35);
        }
        .btn-outline {
            background: transparent;
            color: var(--navy);
            border: 2px solid var(--gray-light);
        }
        .btn-outline:hover {
            border-color: var(--gold);
            color: var(--navy);
            background: rgba(214,242,74,0.05);
        }
        .btn-sm {
            padding: 10px 20px;
            font-size: 13px;
            width: auto;
        }
        /* Order Card */
        .order-card {
            background: var(--white);
            border-radius: var(--radius-sm);
            padding: 20px;
            margin-bottom: 14px;
            box-shadow: 0 4px 20px rgba(13,27,42,0.08);
            border-right: 4px solid var(--gold);
            position: relative;
        }
        .order-card.delivered { border-right-color: var(--success); }
        .order-card.cancelled { border-right-color: var(--danger); }
        .order-card.pending { border-right-color: var(--warning); }
        .order-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 12px;
        }
        .order-route {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            margin: 10px 0;
            font-size: 14px;
            color: var(--navy);
        }
        .order-route-icon {
            width: 32px;
            height: 32px;
            background: rgba(214,242,74,0.15);
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }
        .order-route-icon svg {
            width: 16px;
            height: 16px;
            color: var(--gold-dark);
        }
        .order-actions {
            display: flex;
            gap: 10px;
            margin-top: 14px;
        }
        .order-actions .btn {
            flex: 1;
        }
        /* Empty State */
        .empty-state {
            text-align: center;
            padding: 50px 24px;
        }
        .empty-state-icon {
            width: 90px;
            height: 90px;
            margin: 0 auto 20px;
            background: linear-gradient(135deg, rgba(214,242,74,0.15) 0%, rgba(214,242,74,0.05) 100%);
            border-radius: 28px;
            display: flex;
            align-items: center;
            justify-content: center;
            border: 2px dashed var(--gold);
        }
        .empty-state-icon svg {
            width: 40px;
            height: 40px;
            color: var(--gold-dark);
        }
        .empty-state h3 {
            font-size: 18px;
            font-weight: 800;
            color: var(--navy);
            margin-bottom: 6px;
        }
        .empty-state p {
            font-size: 14px;
            color: var(--gray);
            font-weight: 500;
        }
        /* Stats Grid */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 10px;
            margin-bottom: 20px;
        }
        .stat-card {
            background: var(--white);
            border-radius: var(--radius-sm);
            padding: 20px 8px;
            text-align: center;
            box-shadow: var(--shadow);
            border: 1px solid var(--gray-light);
            position: relative;
            overflow: hidden;
        }
        .stat-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: linear-gradient(90deg, var(--gold), var(--gold-light));
        }
        .stat-value {
            font-size: 26px;
            font-weight: 900;
            color: var(--navy);
        }
        .stat-label {
            font-size: 11px;
            color: var(--gray);
            font-weight: 700;
            margin-top: 4px;
        }
        /* Table */
        .table-container {
            background: var(--white);
            border-radius: var(--radius-sm);
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            box-shadow: var(--shadow);
            border: 1px solid var(--gray-light);
        }
        .table-container::-webkit-scrollbar { height: 4px; }
        .table-container::-webkit-scrollbar-thumb { background: var(--gray-light); border-radius: 2px; }
        .data-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 13px;
        }
        .data-table th {
            background: var(--navy);
            padding: 14px 16px;
            text-align: right;
            font-weight: 800;
            color: var(--gold);
            font-size: 12px;
            letter-spacing: 0.5px;
        }
        .data-table td {
            padding: 14px 16px;
            border-bottom: 1px solid var(--gray-light);
            color: var(--navy);
            font-weight: 500;
        }
        .data-table tr:last-child td {
            border-bottom: none;
        }
        .data-table tr:hover td {
            background: rgba(214,242,74,0.04);
        }
        /* Tabs */
        .tabs {
            display: flex;
            gap: 10px;
            margin-bottom: 18px;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            scrollbar-width: none;
        }
        .tabs::-webkit-scrollbar { display: none; }
        .tab {
            white-space: nowrap;
            flex-shrink: 0;
            padding: 12px 24px;
            border-radius: var(--radius-xs);
            font-size: 14px;
            font-weight: 800;
            cursor: pointer;
            border: none;
            background: var(--white);
            color: var(--gray);
            transition: all 0.3s ease;
            font-family: 'Tajawal', sans-serif;
            box-shadow: 0 2px 10px rgba(13,27,42,0.06);
        }
        .tab.active {
            background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
            color: var(--navy);
            box-shadow: 0 4px 15px rgba(214,242,74,0.3);
        }
        /* Modal */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(13, 59, 59, 0.6);
            backdrop-filter: blur(12px);
            z-index: 200;
            display: flex;
            align-items: flex-end;
            justify-content: center;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.3s ease;
        }
        .modal-overlay.active {
            opacity: 1;
            pointer-events: all;
        }
        .modal-content {
            background: var(--white);
            width: 100%;
            max-width: 480px;
            border-radius: 40px 40px 0 0;
            padding: 28px;
            transform: translateY(100%);
            transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
            max-height: 90vh;
            overflow-y: auto;
        }
        .modal-overlay.active .modal-content {
            transform: translateY(0);
        }
        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 24px;
        }
        .modal-title {
            font-size: 20px;
            font-weight: 900;
            color: var(--navy);
        }
        .modal-close {
            width: 40px;
            height: 40px;
            border-radius: 14px;
            background: var(--gray-light);
            border: none;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            color: var(--gray);
            transition: all 0.3s ease;
        }
        .modal-close:hover {
            background: var(--gold);
            color: var(--navy);
        }
        /* Toast */
        .toast-container {
            position: fixed;
            top: 24px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 300;
            display: flex;
            flex-direction: column;
            gap: 10px;
            pointer-events: none;
            width: 90%;
            max-width: 400px;
        }
        .toast {
            background: var(--white);
            padding: 16px 20px;
            border-radius: 20px;
            box-shadow: 0 15px 50px rgba(13,27,42,0.2);
            display: flex;
            align-items: center;
            gap: 12px;
            font-size: 14px;
            font-weight: 700;
            animation: slideDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
            pointer-events: all;
            border-right: 4px solid var(--gold);
        }
        .toast.success { border-right-color: var(--success); }
        .toast.error { border-right-color: var(--danger); }
        .toast.info { border-right-color: var(--gold); }
        @keyframes slideDown {
            from { opacity: 0; transform: translateY(-20px) scale(0.9); }
            to { opacity: 1; transform: translateY(0) scale(1); }
        }
        /* Animations */
        .fade-in {
            animation: fadeIn 0.4s ease-out;
        }
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .slide-up {
            animation: slideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
        }
        @keyframes slideUp {
            from { opacity: 0; transform: translateY(30px); }
            to { opacity: 1; transform: translateY(0); }
        }
        /* View transitions */
        .view {
            display: none;
        }
        .view.active {
            display: block;
            animation: fadeIn 0.3s ease-out;
        }
        /* Rider Status Toggle */
        .status-toggle {
            display: flex;
            background: var(--gray-light);
            border-radius: 18px;
            padding: 5px;
            gap: 5px;
        }
        .status-toggle-btn {
            flex: 1;
            padding: 12px;
            border: none;
            border-radius: 14px;
            font-size: 13px;
            font-weight: 800;
            cursor: pointer;
            transition: all 0.3s ease;
            background: transparent;
            color: var(--gray);
            font-family: 'Tajawal', sans-serif;
        }
        .status-toggle-btn.active {
            background: var(--white);
            box-shadow: 0 4px 15px rgba(13,27,42,0.1);
            color: var(--navy);
        }
        /* Selected rider preview */
        .selected-rider-preview {
            background: linear-gradient(135deg, rgba(214,242,74,0.1) 0%, rgba(214,242,74,0.05) 100%);
            border: 2px solid var(--gold);
            border-radius: var(--radius-xs);
            padding: 16px;
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            gap: 14px;
        }
        .selected-rider-preview .avatar {
            width: 48px;
            height: 48px;
            border-radius: 14px;
            background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--gold);
            font-weight: 900;
            font-size: 18px;
            border: 2px solid var(--gold);
        }
        /* Order note */
        .order-note {
            background: rgba(214,242,74,0.1);
            border-radius: 10px;
            padding: 10px 14px;
            font-size: 13px;
            color: var(--navy);
            margin-top: 10px;
            display: flex;
            align-items: flex-start;
            gap: 8px;
            font-weight: 500;
            border-right: 3px solid var(--gold);
        }
        /* Section divider */
        .section-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 14px;
            margin-top: 10px;
        }
        .section-title {
            font-size: 17px;
            font-weight: 900;
            color: var(--navy);
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .section-count {
            background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
            color: var(--navy);
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 900;
            box-shadow: 0 2px 10px rgba(214,242,74,0.3);
        }
        /* Dashed line decoration */
        .dashed-line {
            height: 2px;
            background: repeating-linear-gradient(90deg, var(--gold) 0px, var(--gold) 6px, transparent 6px, transparent 12px);
            opacity: 0.5;
            margin: 16px 0;
        }
        /* Gold accent bar */
        .gold-bar {
            width: 40px;
            height: 4px;
            background: linear-gradient(90deg, var(--gold), var(--gold-light));
            border-radius: 2px;
            margin-bottom: 12px;
        }
        /* Hidden utility */
        .hidden {
            display: none !important;
        }
        /* Responsive */
        @media (min-width: 768px) {
            .app-container { max-width: 520px; }
        }
        @media (min-width: 1024px) {
            .app-container { box-shadow: 0 0 60px rgba(13,27,42,0.12); border-radius: 0; }
        }
        /* ط£ط¬ظ‡ط²ط© طµط؛ظٹط±ط© */
        @media (max-width: 420px) {
            .main-content { padding-left: 14px; padding-right: 14px; }
            .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
            .stat-card { padding: 16px 6px; }
            .stat-value { font-size: 24px; }
            .header { padding: 22px 18px 70px; }
            .role-btn { padding: 11px 4px; font-size: 12px; gap: 4px; }
            .role-btn svg { width: 15px; height: 15px; }
            .card { padding: 20px; }
            .rider-card { padding: 16px; }
            .brand-text h1 { font-size: 23px; }
            .home-link { padding: 8px 12px; font-size: 12px; gap: 5px; }
            .modal-content { padding: 22px; }
            .tabs { gap: 8px; }
            .tab { padding: 11px 16px; font-size: 13px; }
        }
        /* ط´ط§ط´ط§طھ طµط؛ظٹط±ط© ط¬ط¯ط§ظ‹ */
        @media (max-width: 340px) {
            .header-top { align-items: flex-start; gap: 8px; }
            .brand-text h1 { font-size: 20px; }
            .brand-text span { font-size: 10px; letter-spacing: 1px; }
            .brand-logo { width: 44px; height: 44px; }
            .home-link span { display: none; }
            .home-link svg { width: 20px; height: 20px; }
            .role-btn { font-size: 11px; }
            .hero-sub { font-size: 13px; }
        }
        /* ط£ظ…ط§ظ† ط­ظˆط§ظپ ط§ظ„ط´ط§ط´ط§طھ (ظ‡ظˆط§طھظپ ط¨ظ†ظˆطھط´) */
        .app-container { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
        .main-content { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
        .modal-content { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
        /* Scrollbar */
        ::-webkit-scrollbar { width: 6px; }
        ::-webkit-scrollbar-track { background: transparent; }
        ::-webkit-scrollbar-thumb { background: var(--gray-light); border-radius: 3px; }
    </style>
/* الروابط في مبدّل الأدوار */
a.role-btn { text-decoration: none; }
