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

/* إصلاح مشكلة 100vh على متصفحات Android - استخدام dvh مع fallback */
@supports (height: 100dvh) {
    .login-page {
        min-height: 100dvh !important;
    }
    .admin-container,
    .delegate-container {
        height: 100dvh !important;
    }
}

body {
    font-family: 'Tajawal', sans-serif;
    background: #F5F0E8;
    color: #1C1917;
    overflow-x: hidden;
}

:root {
    --primary-dark: #071F17;
    --primary: #0B3D2E;
    --primary-mid: #1B5E3B;
    --primary-light: #2D8659;
    --accent: #C8963E;
    --accent-light: #D4A853;
    --bg: #F5F0E8;
    --card: #FFFFFF;
    --text: #1C1917;
    --text-muted: #78716C;
    --border: #E7E0D5;
    --success: #16A34A;
    --warning: #D97706;
    --danger: #DC2626;
    --info: #0284C7;
    --whatsapp: #25D366;
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(-45deg, #071F17, #0B3D2E, #1B5E3B, #0B3D2E);
    background-size: 400% 400%;
    animation: gm 12s ease infinite;
    position: relative;
    overflow: hidden;
}

@keyframes gm {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 48px 40px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2;
    animation: ca .6s ease-out;
}

@keyframes ca {
    from {
        opacity: 0;
        transform: translateY(30px) scale(.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-card .logo-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: 0 8px 24px rgba(11, 61, 46, 0.3);
}

.login-card .logo-icon i {
    font-size: 32px;
    color: var(--accent);
}

.login-card h1 {
    text-align: center;
    color: var(--primary-dark);
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 6px;
}

.login-card p.subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 32px;
}

/* Form Fields */
.form-field {
    margin-bottom: 18px;
    position: relative;
}

.form-field label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
    margin-bottom: 6px;
}

.form-field .input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.form-field .input-wrapper i {
    position: absolute;
    right: 14px;
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
}

.form-field input,
.form-field select {
    width: 100%;
    padding: 12px 14px;
    padding-right: 40px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-family: 'Tajawal', sans-serif;
    font-size: 15px;
    transition: all .25s;
    background: #FAFAF7;
    color: var(--text);
}

.form-field input:focus,
.form-field select:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(45, 134, 89, 0.12);
    background: #fff;
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border: none;
    border-radius: 12px;
    font-family: 'Tajawal', sans-serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all .25s;
    box-shadow: 0 4px 16px rgba(11, 61, 46, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(11, 61, 46, 0.4);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 10px;
    font-family: 'Tajawal', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all .2s;
    white-space: nowrap;
}

.btn:active {
    transform: scale(.97);
}

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

.btn-gold {
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: white;
    box-shadow: 0 2px 8px rgba(200, 150, 62, .3);
}

.btn-gold:hover {
    box-shadow: 0 4px 14px rgba(200, 150, 62, .4);
}

.btn-green {
    background: var(--success);
    color: white;
}

.btn-green:hover {
    background: #15803D;
}

.btn-blue {
    background: var(--info);
    color: white;
}

.btn-blue:hover {
    background: #0369A1;
}

.btn-red {
    background: var(--danger);
    color: white;
}

.btn-red:hover {
    background: #B91C1C;
}

.btn-whatsapp {
    background: var(--whatsapp);
    color: white;
    box-shadow: 0 2px 8px rgba(37, 211, 102, .3);
}

.btn-whatsapp:hover {
    background: #1DA851;
    box-shadow: 0 4px 14px rgba(37, 211, 102, .4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-muted);
}

.btn-outline:hover {
    border-color: var(--primary-light);
    color: var(--primary-light);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 260px;
    height: 100vh;
    background: var(--primary-dark);
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform .35s cubic-bezier(.4, 0, .2, 1);
    overflow-y: auto;
}

.sidebar-brand {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand .brand-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-brand .brand-icon i {
    color: var(--primary-dark);
    font-size: 18px;
}

.sidebar-brand h2 {
    color: white;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
}

.sidebar-brand small {
    color: rgba(255, 255, 255, .5);
    font-size: 11px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
}

.nav-section-title {
    color: rgba(255, 255, 255, .35);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px 12px 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 10px;
    color: rgba(255, 255, 255, .65);
    cursor: pointer;
    transition: all .2s;
    margin-bottom: 2px;
    font-size: 14px;
    font-weight: 500;
}

.nav-item:hover {
    background: rgba(255, 255, 255, .06);
    color: rgba(255, 255, 255, .9);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary-mid), var(--primary-light));
    color: white;
    box-shadow: 0 4px 12px rgba(45, 134, 89, .3);
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 15px;
}

.nav-item .badges {
    margin-right: auto;
    margin-left: 0;
    display: flex;
    gap: 4px;
}

.nav-item .badge {
    background: var(--danger);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 700;
}

.nav-item .badge-warn {
    background: var(--warning);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 700;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .05);
    margin-bottom: 10px;
}

.sidebar-user .avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-dark);
    font-weight: 800;
    font-size: 14px;
}

.sidebar-user .user-info span {
    color: rgba(255, 255, 255, .9);
    font-size: 13px;
    font-weight: 600;
    display: block;
}

.sidebar-user .user-info small {
    color: rgba(255, 255, 255, .4);
    font-size: 11px;
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    color: rgba(255, 255, 255, .5);
    cursor: pointer;
    transition: all .2s;
    border: none;
    background: none;
    width: 100%;
    font-family: 'Tajawal', sans-serif;
    font-size: 14px;
}

.btn-logout:hover {
    background: rgba(220, 38, 38, .15);
    color: #FCA5A5;
}

/* Main Content */
.main-content {
    margin-right: 260px;
    min-height: 100vh;
    transition: margin .35s cubic-bezier(.4, 0, .2, 1);
}

.top-bar {
    background: rgba(245, 240, 232, .85);
    backdrop-filter: blur(12px);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--border);
}

.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--card);
    border-radius: 10px;
    cursor: pointer;
    font-size: 18px;
    color: var(--text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

.top-bar h1 {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary-dark);
}

.page-content {
    padding: 28px;
}

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

.stat-card {
    background: var(--card);
    border-radius: 16px;
    padding: 22px;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    transition: all .3s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .08);
}

.stat-card .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 14px;
}

.stat-card .stat-value {
    font-size: 30px;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-card .stat-decoration {
    position: absolute;
    top: -20px;
    left: -20px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    opacity: .06;
}

/* Content Card */
.content-card {
    background: var(--card);
    border-radius: 16px;
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 24px;
    animation: fi .4s ease-out;
}

@keyframes fi {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.card-header h2 {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h2 i {
    color: var(--accent);
    font-size: 20px;
}

.card-body {
    padding: 24px;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

.data-table thead th {
    padding: 12px 14px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    background: #FAFAF7;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.data-table tbody tr {
    transition: background .15s;
    border-bottom: 1px solid #F0ECE4;
}

.data-table tbody tr:hover {
    background: #FAFAF7;
}

.data-table tbody td {
    padding: 14px;
    text-align: center;
    font-size: 13px;
    vertical-align: middle;
}

/* Badges */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.badge-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.badge-pending {
    background: #FEF3C7;
    color: #92400E;
}

.badge-pending::before {
    background: #D97706;
}

.badge-picked {
    background: #DBEAFE;
    color: #1E40AF;
}

.badge-picked::before {
    background: #2563EB;
}

.badge-ready {
    background: #D1FAE5;
    color: #065F46;
}

.badge-ready::before {
    background: #059669;
}

.badge-washing {
    background: #F3E5F5;
    color: #6A1B9A;
}

.badge-washing::before {
    background: #9C27B0;
}

.badge-completed {
    background: #D1FAE5;
    color: #065F46;
}

.badge-completed::before {
    background: #059669;
}

.badge-cancelled {
    background: #FEE2E2;
    color: #991B1B;
}

.badge-cancelled::before {
    background: #DC2626;
}

.badge-rejected {
    background: #FEE2E2;
    color: #991B1B;
}

.badge-rejected::before {
    background: #DC2626;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 20px;
    border-radius: 12px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    max-width: 420px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
    animation: ti .4s ease-out;
    position: relative;
    overflow: hidden;
}

.toast.removing {
    animation: to .3s ease-in forwards;
}

.toast-success {
    background: linear-gradient(135deg, #059669, #10B981);
}

.toast-error {
    background: linear-gradient(135deg, #DC2626, #EF4444);
}

.toast-warning {
    background: linear-gradient(135deg, #D97706, #F59E0B);
}

.toast-info {
    background: linear-gradient(135deg, #0284C7, #0EA5E9);
}

.toast .toast-progress {
    position: absolute;
    bottom: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, .4);
    border-radius: 0 0 12px 12px;
    animation: tp 3s linear forwards;
}

@keyframes ti {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes to {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-40px);
    }
}

@keyframes tp {
    from {
        width: 100%;
    }
    to {
        width: 0;
    }
}

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

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

.modal-box {
    background: var(--card);
    border-radius: 20px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0, 0, 0, .2);
    animation: mi .35s ease-out;
}

@keyframes mi {
    from {
        opacity: 0;
        transform: scale(.92) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h3 i {
    color: var(--accent);
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: #F3F4F6;
    border-radius: 10px;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-muted);
    transition: all .2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: #FEE2E2;
    color: var(--danger);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    justify-content: flex-start;
}

/* Alerts */
.alert-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1.5px solid;
}

.alert-warn {
    background: #FFFBEB;
    border-color: #F59E0B;
}

.alert-warn i {
    color: #D97706;
    font-size: 20px;
}

.alert-warn strong {
    color: #92400E;
}

.alert-warn span {
    color: #92400E;
    font-size: 13px;
}

/* Delegate Cards */
.delegate-order-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 14px;
    transition: all .25s;
}

.delegate-order-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, .06);
    transform: translateY(-2px);
}

.delegate-order-card .card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}

.delegate-order-card .customer-name {
    font-size: 17px;
    font-weight: 800;
    color: var(--primary-dark);
}

.delegate-order-card .customer-phone {
    font-size: 13px;
    color: var(--text-muted);
    direction: ltr;
    display: inline-block;
    margin-top: 4px;
}

.delegate-order-card .card-details {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 14px;
}

.delegate-order-card .detail-item {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.delegate-order-card .detail-item i {
    color: var(--accent);
    font-size: 12px;
}

.delegate-order-card .card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Carpet Items */
.carpet-summary {
    background: #FAFAF7;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 14px;
}

.carpet-summary h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.carpet-summary .cs-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    padding: 3px 0;
    border-bottom: 1px dashed #E7E0D5;
}

.carpet-summary .cs-row:last-child {
    border: none;
}

.carpet-summary .cs-total {
    font-weight: 800;
    color: var(--primary-dark);
    font-size: 14px;
    padding-top: 6px;
    border-top: 2px solid var(--border);
    margin-top: 4px;
}

/* Filter Chips */
.filter-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filter-chip {
    padding: 9px 20px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid var(--border);
    background: var(--card);
    color: var(--text-muted);
    transition: all .2s;
    font-family: 'Tajawal', sans-serif;
}

.filter-chip:hover {
    border-color: var(--primary-light);
    color: var(--primary-light);
}

.filter-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(11, 61, 46, .2);
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}

.total-box {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: white;
    padding: 16px;
    border-radius: 12px;
    text-align: center;
    font-size: 22px;
    font-weight: 900;
}

.delegate-layout {
    max-width: 800px;
    margin: 0 auto;
    padding: 16px;
}

.delegate-header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-mid));
    color: white;
    padding: 20px;
    border-radius: 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.delegate-header .header-info h2 {
    font-size: 20px;
    font-weight: 800;
}

.delegate-header .header-info small {
    opacity: .7;
    font-size: 13px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 56px;
    color: var(--border);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text);
}

.link-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all .2s;
}

.link-location {
    background: #D1FAE5;
    color: #065F46;
}

.link-location:hover {
    background: #A7F3D0;
}

/* Carpet Items Grid */
.ci-header {
    display: grid;
    grid-template-columns: 1.4fr .7fr .7fr .7fr .7fr .8fr 36px;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 8px;
    padding: 0 2px;
}

.ci-row {
    display: grid;
    grid-template-columns: 1.4fr .7fr .7fr .7fr .7fr .8fr 36px;
    gap: 6px;
    align-items: center;
    margin-bottom: 8px;
    animation: fi .3s ease-out;
}

.ci-row input {
    padding: 9px 8px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-family: 'Tajawal', sans-serif;
    font-size: 13px;
    text-align: center;
    background: #FAFAF7;
    transition: border-color .2s;
    width: 100%;
}

.ci-row input:focus {
    outline: none;
    border-color: var(--primary-light);
    background: #fff;
}

.ci-val {
    text-align: center;
    font-weight: 700;
    font-size: 13px;
    padding: 9px 4px;
    background: #F0FDF4;
    border-radius: 8px;
    color: var(--primary-dark);
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ci-remove {
    width: 32px;
    height: 32px;
    border: none;
    background: #FEE2E2;
    color: var(--danger);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
    font-size: 13px;
}

.ci-remove:hover {
    background: #FCA5A5;
}

.view-section {
    display: none;
}

.view-section.active {
    display: block;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    z-index: 99;
}

.sidebar-overlay.active {
    display: block;
}

.gps-active {
    animation: pulseGreen 1.5s infinite;
    background: #28a745;
    color: white;
}

@keyframes pulseGreen {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.payment-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.payment-method {
    flex: 1;
    background: #FAFAF7;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    border: 2px solid var(--border);
    transition: all .2s;
}

.payment-method input {
    width: 100%;
    padding: 8px;
    margin-top: 8px;
    border-radius: 8px;
    border: 1px solid var(--border);
    text-align: center;
    font-weight: bold;
}

.payment-method label {
    font-weight: 700;
    color: var(--primary-dark);
    display: block;
    margin-bottom: 5px;
}

.payment-summary {
    background: #FAFAF7;
    border-radius: 12px;
    padding: 15px;
    margin-top: 15px;
    text-align: center;
}

.payment-summary .total-paid {
    font-size: 18px;
    font-weight: 800;
    color: var(--success);
}

.payment-summary .remaining {
    font-size: 16px;
    font-weight: 700;
    color: var(--danger);
}

.discount-box {
    background: #FEF3C7;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 15px;
    text-align: center;
    border: 2px solid var(--warning);
}

.discount-box label {
    font-weight: 700;
    color: #92400E;
    display: block;
    margin-bottom: 8px;
}

.discount-box input {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 2px solid var(--warning);
    text-align: center;
    font-weight: bold;
    font-size: 16px;
    background: #FFF8EB;
}

.original-amount {
    text-decoration: line-through;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 5px;
}

.customer-suggestion {
    position: absolute;
    z-index: 1000;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 100%;
    max-height: 150px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
}

.customer-suggestion div {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.customer-suggestion div:hover {
    background: #F0FDF4;
}

.price-presets {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.price-preset-btn {
    background: #FAFAF7;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all .2s;
}

.price-preset-btn:hover {
    background: var(--primary-light);
    color: white;
    border-color: var(--primary-light);
}

.inv-settings-section {
    margin-bottom: 20px;
    padding: 16px;
    background: #FAFAF7;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.inv-settings-section h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.inv-settings-section h4 i {
    color: var(--accent);
    font-size: 14px;
}

.bank-account-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
    position: relative;
}

.bank-account-card .bank-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.bank-account-card .bank-fields input {
    width: 100%;
    padding: 10px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-family: 'Tajawal', sans-serif;
    font-size: 13px;
    background: white;
}

.bank-account-card .bank-fields input:focus {
    outline: none;
    border-color: var(--primary-light);
}

.bank-account-card .bank-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: #F0FDF4;
    border-radius: 8px;
    margin-bottom: 10px;
}

.bank-account-card .bank-preview img {
    max-height: 60px;
    max-width: 150px;
    border-radius: 6px;
    border: 1px solid #ddd;
    object-fit: contain;
}

.bank-account-card .bank-preview .no-img {
    font-size: 12px;
    color: var(--text-muted);
    padding: 8px 12px;
    background: #f5f5f5;
    border-radius: 6px;
}

.bank-remove-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 28px;
    height: 28px;
    border: none;
    background: #FEE2E2;
    color: var(--danger);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all .2s;
}

.bank-remove-btn:hover {
    background: #FCA5A5;
}

.logo-preview-box {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: #F0FDF4;
    border-radius: 8px;
}

.logo-preview-box img {
    max-height: 80px;
    max-width: 120px;
    border-radius: 8px;
    border: 2px solid var(--border);
    object-fit: contain;
}

.logo-preview-box .no-img {
    font-size: 12px;
    color: var(--text-muted);
    padding: 8px 16px;
    background: #f5f5f5;
    border-radius: 6px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-right: 0;
    }
    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .page-content {
        padding: 16px;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .stats-grid[style*="repeat(5"] {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    .card-body {
        padding: 16px;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .delegate-layout {
        padding: 10px;
    }
    .bank-account-card .bank-fields {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .login-card {
        padding: 32px 24px;
    }
}

/* إصلاحات إضافية للموبايل - تسجيل الدخول */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    .login-page {
        min-height: 100vh;
        min-height: 100dvh;
        align-items: flex-start !important;
        padding: 20px 0;
        overflow-y: auto;
    }
    .login-card {
        max-width: 95%;
        margin: 0 auto;
    }
    .login-card .logo-icon {
        width: 56px;
        height: 56px;
        margin-bottom: 16px;
    }
    .login-card h1 {
        font-size: 22px;
        margin-bottom: 4px;
    }
    .login-card p.subtitle {
        font-size: 13px;
        margin-bottom: 20px;
    }
    .form-field {
        margin-bottom: 14px;
    }
    .btn-primary {
        min-height: 48px;
        font-size: 16px;
    }
    /* منع المتصفح من تكبير الصفحة عند التركيز على الحقول */
    input[type="text"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    input[type="date"],
    input[type="search"],
    select,
    textarea {
        font-size: 16px !important;
    }
}
/* إضافات لإعدادات المغسلة */
#laundryLogoPreview img {
    max-height: 80px;
    max-width: 120px;
    border-radius: 10px;
    border: 1px solid var(--border);
    object-fit: contain;
}

/* Transfer Delivery Badge Styles */
.delegate-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.badge-pickup {
    background: #DBEAFE;
    color: #1E40AF;
}
.badge-delivery {
    background: #D1FAE5;
    color: #065F46;
}

/* Image Upload */
.image-upload-box { width:100%; min-height:120px; border:2px dashed var(--border); border-radius:12px; display:flex; align-items:center; justify-content:center; cursor:pointer; transition:all 0.2s; background:#FAFAF7; overflow:hidden; }
.image-upload-box:hover { border-color:var(--primary); background:#F0FDF4; }
.image-preview-placeholder { text-align:center; padding:20px; }
.image-preview-placeholder p { margin-top:8px; font-size:14px; font-weight:600; color:var(--fg); }
.image-upload-box img { max-width:100%; max-height:200px; object-fit:contain; border-radius:8px; }
.order-thumb { width:45px; height:45px; object-fit:cover; border-radius:8px; cursor:pointer; border:2px solid var(--border); transition:all 0.2s; }
.order-thumb:hover { transform:scale(1.1); border-color:var(--accent); }
.delegate-order-image { width:100%; max-height:180px; object-fit:cover; border-radius:10px; margin-top:10px; cursor:pointer; border:2px solid var(--border); }
.delegate-order-image:hover { border-color:var(--accent); }
.image-lightbox { position:fixed; inset:0; background:rgba(0,0,0,0.85); z-index:9999; display:flex; align-items:center; justify-content:center; cursor:pointer; }
.image-lightbox img { max-width:95vw; max-height:90vh; object-fit:contain; border-radius:12px; }

/* ========== إعدادات الموقع التعريفي ========== */
.landing-settings-section {
    background: #FAFAF7;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
}
.landing-settings-section h3 {
    font-size: 15px;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}
.landing-settings-section h3 i {
    color: var(--accent);
    font-size: 16px;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.landing-settings-section .form-grid {
    margin-bottom: 0;
}
.landing-settings-section input,
.landing-settings-section textarea,
.landing-settings-section select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-family: 'Tajawal', sans-serif;
    font-size: 14px;
    transition: all .25s;
    background: #fff;
    color: var(--text);
}
.landing-settings-section input:focus,
.landing-settings-section textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(45, 134, 89, 0.12);
}

/* بطاقات الخدمات */
.ls-service-item {
    background: white;
    border: 2px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 14px;
    transition: all .2s;
    position: relative;
}
.ls-service-item:hover {
    border-color: var(--primary-light);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .06);
}
.ls-service-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.ls-service-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
}

/* بطاقات المميزات */
.ls-feature-item {
    background: white;
    border: 2px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 14px;
    transition: all .2s;
}
.ls-feature-item:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .06);
}

/* بطاقات التقييمات */
.ls-testimonial-item {
    background: white;
    border: 2px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 14px;
    transition: all .2s;
    position: relative;
}
.ls-testimonial-item:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .06);
}
.ls-testimonial-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.ls-t-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: white;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
}

/* Responsive لقسم الإعدادات */
@media (max-width: 768px) {
    .landing-settings-section {
        padding: 16px;
        margin-bottom: 16px;
    }
    .landing-settings-section h3 {
        font-size: 14px;
    }
}

/* ========== Vertical Carpet Size Cards ========== */
.carpet-sizes-vertical {
    display: block;
}
.carpet-sizes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}
.carpet-size-card {
    background: #FAFAF7;
    border: 1.5px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    transition: all .25s;
}
.carpet-size-card:hover {
    border-color: var(--primary-light);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .06);
    transform: translateY(-2px);
}
.carpet-size-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-mid));
    color: white;
}
.carpet-size-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(255,255,255,.2);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
    flex-shrink: 0;
}
.carpet-size-desc {
    font-size: 15px;
    font-weight: 700;
}
.carpet-size-card-body {
    padding: 12px 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.carpet-size-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.carpet-size-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .3px;
}
.carpet-size-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}
.carpet-size-meters {
    color: #059669;
    background: #F0FDF4;
    padding: 2px 8px;
    border-radius: 6px;
    text-align: center;
}
.carpet-size-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-top: 1.5px dashed var(--border);
    background: #FFFDF7;
}
.carpet-size-total {
    font-size: 15px;
    font-weight: 800;
    color: var(--accent);
}
.carpet-size-actions {
    display: flex;
    gap: 6px;
}
@media (max-width: 768px) {
    .carpet-sizes-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== تفاصيل العميل ===== */
.cust-detail-modal-box { max-width: 780px !important; }
.cust-detail-body { padding: 0 !important; }
.cust-detail-header {
    display: flex; align-items: center; gap: 14px;
    padding: 18px 20px; background: linear-gradient(135deg, var(--primary), var(--primaryMid));
    color: white; border-radius: 0 0 16px 16px; margin: -20px -20px 0 -20px;
}
.cust-avatar {
    width: 50px; height: 50px; border-radius: 50%; background: rgba(255,255,255,.15);
    display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0;
}
.cust-info-main { flex: 1; min-width: 0; }
.cust-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cust-name { font-size: 17px; font-weight: 800; }
.cust-badge {
    font-size: 10px; font-weight: 700; padding: 2px 10px; border-radius: 20px;
    color: white; text-transform: uppercase; letter-spacing: .5px;
}
.cust-sub { font-size: 12px; opacity: .85; margin-top: 4px; }
.cust-quick-actions { display: flex; gap: 6px; flex-shrink: 0; }
.cust-quick-actions .btn { padding: 8px 10px; font-size: 14px; }

/* إحصائيات العميل */
.cust-stats-compact {
    display: grid; grid-template-columns: repeat(6, 1fr); gap: 0;
    margin: 16px 0 0 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
}
.cust-stat-item {
    display: flex; flex-direction: column; align-items: center; padding: 14px 6px;
    background: var(--card);
}
.cust-stat-item:not(:last-child) { border-left: 1px solid var(--border); }
.cust-stat-num { font-size: 20px; font-weight: 800; line-height: 1.2; }
.cust-stat-lbl { font-size: 10px; color: var(--text-muted); margin-top: 2px; font-weight: 600; }

/* عنوان الطلبات */
.cust-orders-title {
    font-size: 14px; font-weight: 700; color: var(--text-secondary);
    margin: 20px 0 10px 0; padding-bottom: 8px; border-bottom: 1px solid var(--border);
}

/* قائمة طلبات العميل */
.cust-orders-list { display: flex; flex-direction: column; gap: 8px; padding-bottom: 10px; }
.cust-order-card {
    border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px;
    background: var(--card); transition: box-shadow .2s;
}
.cust-order-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.cust-card-warning { border-left: 4px solid #D97706; background: #FFFBEB; }
.cust-card-done { border-left: 4px solid #059669; background: #F0FDF4; }
.cust-card-cancel { border-left: 4px solid #DC2626; background: #FEF2F2; }
.cust-card-dataready { border-left: 4px solid #2563EB; background: #EFF6FF; }
.cust-card-ready { border-left: 4px solid #059669; background: #ECFDF5; }

/* صفوف البطاقة */
.cust-order-row1 {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px;
}
.cust-order-idx { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.cust-order-inv { font-size: 12px; font-weight: 700; color: var(--accent); }
.cust-order-btns { display: flex; gap: 4px; margin-right: auto; }
.cust-order-row2 {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    font-size: 12px; color: var(--text-secondary); margin-bottom: 8px;
}
.cust-order-price { font-weight: 700; color: var(--primary); margin-right: auto; }
.cust-order-date { color: var(--text-muted); font-size: 11px; }
.cust-order-status-row { display: flex; gap: 8px; align-items: center; }
.cust-quick-status {
    font-family: Tajawal, sans-serif; font-size: 12px; padding: 5px 10px;
    border: 1px solid var(--border); border-radius: 8px; background: var(--bg);
    color: var(--text); cursor: pointer; max-width: 180px;
}

/* التجاوب */
@media (max-width: 600px) {
    .cust-stats-compact { grid-template-columns: repeat(3, 1fr); }
    .cust-stat-item:nth-child(3) { border-left: none; }
    .cust-detail-header { flex-wrap: wrap; padding: 14px 16px; }
    .cust-quick-actions { width: 100%; justify-content: flex-end; margin-top: 6px; }
}

/* ===== صفحة تتبع الطلبات للعملاء ===== */
.public-tracking-page {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg); z-index: 9999; overflow-y: auto;
    font-family: 'Tajawal', sans-serif;
}
.ptrack-container {
    max-width: 520px; margin: 0 auto; padding: 20px 16px 40px;
}
.ptrack-header {
    text-align: center; padding: 30px 0 20px;
}
.ptrack-brand {
    display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 6px;
}
.ptrack-logo {
    width: 48px; height: 48px; border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primaryMid));
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 22px; box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.ptrack-brand h1 {
    font-size: 22px; font-weight: 800; color: var(--text); margin: 0;
}
.ptrack-subtitle {
    font-size: 14px; color: var(--text-muted); margin: 0;
}
.ptrack-search-box {
    display: flex; gap: 8px; margin-bottom: 20px;
}
.ptrack-input-wrap {
    flex: 1; position: relative;
}
.ptrack-input-wrap i {
    position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); font-size: 14px;
}
.ptrack-input-wrap input {
    width: 100%; padding: 14px 40px 14px 14px; border: 2px solid var(--border);
    border-radius: 12px; font-size: 15px; font-family: 'Tajawal', sans-serif;
    background: var(--card); color: var(--text); box-sizing: border-box;
}
.ptrack-input-wrap input:focus { border-color: var(--primary); outline: none; }
.ptrack-search-btn {
    padding: 14px 20px; border-radius: 12px; font-size: 15px; font-weight: 700;
    white-space: nowrap; flex-shrink: 0;
}
/* نتائج التتبع */
.ptrack-orders-count {
    font-size: 13px; color: var(--text-muted); font-weight: 600;
    padding: 10px 0; margin-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.ptrack-order-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 14px; padding: 16px; margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.ptrack-order-top {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 10px; margin-bottom: 12px;
}
.ptrack-order-info { flex: 1; }
.ptrack-customer-name { font-size: 16px; font-weight: 700; color: var(--text); }
.ptrack-order-id { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.ptrack-status-badge {
    font-size: 11px; font-weight: 700; color: white;
    padding: 5px 12px; border-radius: 20px; white-space: nowrap;
    display: flex; align-items: center; gap: 5px;
}
.ptrack-order-details {
    display: flex; flex-wrap: wrap; gap: 6px 16px;
}
.ptrack-detail {
    font-size: 12px; color: var(--text-secondary);
}
.ptrack-detail strong { color: var(--text); }
.ptrack-detail i { color: var(--text-muted); margin-left: 4px; font-size: 11px; }
/* حالة التحميل والفارغ */
.ptrack-loading {
    text-align: center; padding: 40px 0; color: var(--text-muted);
}
.ptrack-loading p { margin-top: 12px; font-size: 14px; }
.ptrack-spinner {
    width: 36px; height: 36px; border: 3px solid var(--border);
    border-top-color: var(--primary); border-radius: 50%;
    margin: 0 auto; animation: ptrack-spin .8s linear infinite;
}
@keyframes ptrack-spin { to { transform: rotate(360deg); } }
.ptrack-empty {
    text-align: center; padding: 40px 0; color: var(--text-muted);
}
.ptrack-empty i { font-size: 40px; margin-bottom: 12px; opacity: .4; display: block; }
.ptrack-empty p { font-size: 14px; }
/* رابط الدخول */
.ptrack-footer {
    text-align: center; padding: 30px 0 10px; font-size: 12px;
}
.ptrack-footer a {
    color: var(--text-muted); text-decoration: none;
    border-bottom: 1px dashed var(--border);
    padding-bottom: 2px;
}
.ptrack-footer a:hover { color: var(--primary); }
