/* ════════════════════════════════════════════════════════════
   CRM Pro — Shared stylesheet
   كل الـ CSS المشترك بين الصفحات.
   ════════════════════════════════════════════════════════════ */

/* ─── المتغيرات الأساسية ─── */
:root {
    --bg: #f5f5f7;
    --surface: #f9f9fb;
    --card: #ffffff;
    --border: #e4e4e7;
    --accent: #B11116;
    --accent2: #D62828;
    --text: #1a1a1a;
    --muted: #6e6e6e;
    --success: #2ecc71;
    --danger: #e74c3c;
    --radius: 12px;
    --shadow: 0 2px 12px rgba(0,0,0,.06);
}

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

body {
    font-family: 'Cairo', sans-serif;
    background: var(--bg);
    color: var(--text);
    direction: rtl;
    min-height: 100vh;
}

/* صفحات الدخول وتغيير الباسورد (centered card layout) */
body.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(177,17,22,.05), transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(177,17,22,.05), transparent 50%);
}

/* ─── الـ Header العلوي ─── */
.header {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.logo {
    display: flex;
    align-items: center;
    gap: .75rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: .5px;
}
.logo-dot {
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(177,17,22,.3);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .5; transform: scale(1.3); }
}
.header-nav {
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
}
.nav-btn {
    padding: .4rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    font-family: 'Cairo', sans-serif;
    font-size: .85rem;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
}
.nav-btn:hover, .nav-btn.active {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
    font-weight: 700;
}
.user-chip {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem .8rem;
    background: #f5f5f7;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: .78rem;
    color: var(--muted);
    margin-left: .5rem;
}
.user-chip strong { color: var(--text); }
.btn-logout {
    background: rgba(231,76,60,.12);
    border: 1px solid rgba(231,76,60,.35);
    color: #e74c3c;
}
.btn-logout:hover {
    background: #e74c3c;
    color: #fff;
    border-color: #e74c3c;
}

/* ─── الـ Page Container ─── */
.page {
    max-width: 1300px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}
.page-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.page-title h1 {
    font-size: 1.6rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent2), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.page-title .subtitle {
    font-size: .85rem;
    color: var(--muted);
    margin-top: .2rem;
}

/* ─── الـ Badges ─── */
.badge {
    display: inline-block;
    background: var(--accent);
    color: #ffffff;
    font-size: .7rem;
    font-weight: 700;
    padding: .25rem .7rem;
    border-radius: 20px;
}
.badge-edit { background: linear-gradient(135deg, #f39c12, #e67e22); }

/* ─── الـ Cards ─── */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}
.card-title {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 1.2rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--border);
}
.card-title svg { width: 18px; height: 18px; }

/* ─── Inputs والـ Form Fields ─── */
input, select, textarea {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .65rem .9rem;
    color: var(--text);
    font-family: 'Cairo', sans-serif;
    font-size: .9rem;
    outline: none;
    direction: rtl;
    width: 100%;
    transition: border-color .2s;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(177,17,22,.12);
}
textarea {
    resize: vertical;
    min-height: 80px;
}
input[readonly], select[disabled] {
    background: #f0f0f3;
    color: var(--muted);
    cursor: not-allowed;
}
.field {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.field label {
    font-size: .78rem;
    font-weight: 600;
    color: var(--muted);
}
.field label .req { color: var(--accent); }
.field-hint {
    font-size: .72rem;
    color: var(--muted);
    margin-top: .25rem;
}
.readonly-note {
    font-size: .68rem;
    color: var(--muted);
    font-style: italic;
    margin-top: .15rem;
}

/* ─── الـ Grids ─── */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.grid-6 { grid-template-columns: repeat(6, 1fr); gap: .5rem; }
.grid2  { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 700px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .grid-6 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
    .grid2 { grid-template-columns: 1fr; }
}

/* ─── الـ Buttons ─── */
.btn {
    padding: .65rem 1.5rem;
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all .2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}
.btn-primary {
    background: linear-gradient(135deg, var(--accent2), var(--accent));
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(177,17,22,.25);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(177,17,22,.35);
}
.btn-warning {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: #ffffff;
}
.btn-warning:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(243,156,18,.35);
}
.btn-success {
    background: rgba(46,204,113,.12);
    color: #27ae60;
    border: 1px solid rgba(46,204,113,.35);
}
.btn-success:hover {
    background: #27ae60;
    color: #fff;
    border-color: #27ae60;
}
.btn-danger {
    background: rgba(231,76,60,.12);
    color: #e74c3c;
    border: 1px solid rgba(231,76,60,.35);
}
.btn-danger:hover {
    background: #e74c3c;
    color: #fff;
    border-color: #e74c3c;
}
.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
}
.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
}
.btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.btn-sm {
    padding: .3rem .8rem;
    font-size: .76rem;
}

/* ─── الـ Form Footer ─── */
.form-footer {
    display: flex;
    gap: .75rem;
    justify-content: flex-end;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

/* ─── الـ Filters ─── */
.filters {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    align-items: center;
}
.filters input, .filters select {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .55rem .9rem;
    color: var(--text);
    font-family: 'Cairo', sans-serif;
    font-size: .88rem;
    outline: none;
    direction: rtl;
    min-width: 160px;
    width: auto;
}
.filters input:focus, .filters select:focus { border-color: var(--accent); }

/* ─── رابط التليفون (اضغط للاتصال) ─── */
.phone-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
    border-bottom: 1px dashed rgba(177,17,22,.45);
    white-space: nowrap;
    direction: ltr;
    unicode-bidi: isolate;
}
.phone-link:hover { color: var(--accent2); }

/* ─── حقل نطاق التاريخ (من / إلى) داخل الفلاتر ─── */
.date-range {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    font-size: .68rem;
    font-weight: 700;
    color: var(--muted);
}
.date-range input[type="date"] {
    min-width: 160px;
    width: auto;
    padding: .5rem .9rem;
    font-size: .85rem;
    font-family: 'Cairo', sans-serif;
}

/* ─── الـ Tables ─── */
.table-wrap { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
}
th {
    background: var(--surface);
    color: var(--muted);
    font-weight: 600;
    padding: .7rem .85rem;
    text-align: right;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
td {
    padding: .65rem .85rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
tr:hover td { background: rgba(177,17,22,.04); }
tr.inactive td { opacity: .55; }
tr.self td { background: rgba(243,156,18,.08); }

/* ─── الـ Status Badges ─── */
.status-badge {
    display: inline-block;
    padding: .18rem .7rem;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 700;
}
.role-badge {
    display: inline-block;
    padding: .18rem .6rem;
    border-radius: 20px;
    font-size: .7rem;
    font-weight: 700;
}
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: .4rem;
}
.status-active {
    background: #27ae60;
    box-shadow: 0 0 6px rgba(39,174,96,.5);
}
.status-inactive { background: #95a5a6; }

.shared-badge {
    display: inline-block;
    background: rgba(155,89,182,.12);
    color: #9b59b6;
    border: 1px solid rgba(155,89,182,.3);
    font-size: .65rem;
    font-weight: 700;
    padding: .1rem .45rem;
    border-radius: 10px;
    margin-right: .3rem;
}
.pwd-pending {
    display: inline-block;
    background: rgba(243,156,18,.15);
    color: #e67e22;
    font-size: .65rem;
    font-weight: 700;
    padding: .1rem .45rem;
    border-radius: 10px;
    margin-right: .35rem;
}
.self-tag {
    display: inline-block;
    background: rgba(243,156,18,.15);
    color: #e67e22;
    font-size: .65rem;
    font-weight: 700;
    padding: .1rem .45rem;
    border-radius: 10px;
    margin-right: .3rem;
}
.status-mini {
    background: rgba(177,17,22,.1);
    color: var(--accent);
    font-size: .65rem;
    font-weight: 700;
    padding: .1rem .4rem;
    border-radius: 10px;
    margin-right: .4rem;
}

/* ─── Action Buttons (داخل الجداول) ─── */
.action-btns {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.action-btns .btn { margin: 0; }

/* ─── الـ Modals ─── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.85rem;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
}
.modal h2 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 1.2rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--border);
}

/* ─── Alerts ─── */
.alert {
    padding: .85rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: .9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: .7rem;
}
.alert-success {
    background: rgba(46,204,113,.15);
    border: 1px solid rgba(46,204,113,.3);
    color: var(--success);
}
.alert-danger {
    background: rgba(231,76,60,.15);
    border: 1px solid rgba(231,76,60,.3);
    color: var(--danger);
}
.warn-banner {
    background: rgba(243,156,18,.1);
    border: 1px solid rgba(243,156,18,.3);
    color: #e67e22;
    padding: .6rem .9rem;
    border-radius: 8px;
    margin-bottom: .9rem;
    font-size: .82rem;
    font-weight: 600;
}

/* ─── Stats Grid ─── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: .75rem;
    margin-bottom: 1.25rem;
}
.stats-grid.cols-7 { grid-template-columns: repeat(7, 1fr); }
@media (max-width: 900px) {
    .stats-grid, .stats-grid.cols-7 { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 500px) {
    .stats-grid, .stats-grid.cols-7 { grid-template-columns: repeat(2, 1fr); }
}
.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .9rem 1rem;
    text-align: center;
}
.stat-num {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--accent);
    line-height: 1;
}
.stat-label {
    font-size: .7rem;
    color: var(--muted);
    margin-top: .25rem;
    font-weight: 600;
}

/* ─── Pagination ─── */
.pagination {
    display: flex;
    gap: .4rem;
    justify-content: center;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    padding: .4rem .8rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    font-size: .82rem;
    text-decoration: none;
    color: var(--muted);
    transition: all .2s;
}
.pagination a:hover, .pagination .current {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
    font-weight: 700;
}

/* ─── Reps Multi-Select ─── */
.reps-multi {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .6rem;
    max-height: 200px;
    overflow-y: auto;
}
.reps-multi label {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .3rem .5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: .85rem;
    color: var(--text);
    font-weight: 500;
}
.reps-multi label:hover { background: rgba(177,17,22,.05); }
.reps-multi input[type="checkbox"] { width: auto; cursor: pointer; }
.reps-help {
    font-size: .72rem;
    color: var(--muted);
    margin-top: .35rem;
}

/* ─── Rep Tags ─── */
.rep-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: .3rem;
}
.rep-tag {
    display: inline-block;
    background: rgba(177,17,22,.1);
    color: var(--accent);
    border: 1px solid rgba(177,17,22,.25);
    font-size: .72rem;
    font-weight: 700;
    padding: .15rem .55rem;
    border-radius: 20px;
}

/* ─── Info Grid (لعرض بيانات العميل) ─── */
.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .55rem;
    margin-bottom: 1rem;
}
.info-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 700px) {
    .info-grid { grid-template-columns: 1fr 1fr; }
    .info-grid.cols-2 { grid-template-columns: 1fr; }
}
.info-item {
    background: var(--surface);
    border-radius: 6px;
    padding: .5rem .75rem;
}
.info-lbl, .info-item .lbl {
    font-size: .68rem;
    color: var(--muted);
    font-weight: 600;
}
.info-val, .info-item .val {
    font-size: .85rem;
    margin-top: .15rem;
    font-weight: 600;
}
.info-val.muted, .info-item .val.muted {
    color: var(--muted);
    font-weight: 400;
}
.info-section { margin-bottom: 1.25rem; }
.info-section-title {
    font-size: .78rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: .55rem;
    padding-bottom: .4rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: .4rem;
}

/* ─── Follow-up Items ─── */
.fup-item, .fup-row {
    background: var(--surface);
    border-right: 3px solid var(--accent);
    padding: .65rem .85rem;
    border-radius: 6px;
    margin-bottom: .5rem;
    font-size: .85rem;
}
.fup-meta {
    font-size: .72rem;
    color: var(--muted);
    margin-bottom: .25rem;
    display: flex;
    gap: .6rem;
    flex-wrap: wrap;
}
.fup-date { font-weight: 700; color: var(--accent); }
.fup-rep  { font-weight: 600; }
.fup-notes, .fup-row .fup-notes {
    color: var(--text);
    white-space: pre-wrap;
    font-size: .88rem;
}
.no-fups {
    text-align: center;
    color: var(--muted);
    font-style: italic;
    padding: 1.5rem 0;
    font-size: .85rem;
}
.followup-list { margin-top: 1rem; }
.followup-list-title {
    font-size: .85rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: .55rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}

/* ═══ خاص بشاشة الاستقبال (Reception) ═══ */
.search-card {
    background: linear-gradient(135deg, #fff, rgba(177,17,22,.03));
    border: 1px solid rgba(177,17,22,.18);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}
.search-card-title {
    font-size: .85rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: .7rem;
}
.search-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: .6rem;
    margin-bottom: .5rem;
}
@media (max-width: 700px) {
    .search-grid { grid-template-columns: 1fr; }
}
.search-row { position: relative; }
.search-input {
    font-size: .95rem;
    padding: .7rem .9rem;
    padding-right: 2.5rem;
}
.search-icon {
    position: absolute;
    right: .85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent);
    font-size: 1.05rem;
    pointer-events: none;
}
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 320px;
    overflow-y: auto;
    display: none;
    z-index: 50;
    box-shadow: 0 6px 16px rgba(0,0,0,.08);
}
.search-suggestions.open { display: block; }
.search-item {
    padding: .6rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
    font-size: .85rem;
}
.search-item:hover { background: rgba(177,17,22,.05); }
.search-item:last-child { border: none; }
.search-item .phone {
    color: var(--muted);
    font-size: .78rem;
    direction: ltr;
}

.found-client {
    background: #fff;
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-top: 1rem;
    display: none;
}
.found-client.open { display: block; }
.found-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--border);
    gap: .5rem;
    flex-wrap: wrap;
}
.found-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--accent);
}
.found-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}
.btn-close-found {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: .3rem .6rem;
    cursor: pointer;
    font-size: .85rem;
    color: var(--muted);
    white-space: nowrap;
}
.btn-close-found:hover { color: var(--danger); border-color: var(--danger); }
.btn-edit-found {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: .45rem .85rem;
    cursor: pointer;
    font-size: .82rem;
    font-weight: 700;
    text-decoration: none;
    font-family: 'Cairo', sans-serif;
}
.btn-edit-found:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(243,156,18,.3);
}

.phones-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .4rem;
    margin-bottom: .8rem;
}
@media (max-width: 500px) {
    .phones-grid { grid-template-columns: 1fr; }
}
.phone-item {
    background: var(--surface);
    border-radius: 6px;
    padding: .45rem .75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.phone-item .phone-lbl {
    font-size: .68rem;
    color: var(--muted);
    font-weight: 600;
}
.phone-item .phone-val {
    font-size: .88rem;
    direction: ltr;
    font-weight: 600;
}

.gender-row { display: flex; gap: .75rem; }
.gender-opt {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .55rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    cursor: pointer;
    font-size: .88rem;
    transition: all .2s;
}
.gender-opt:hover { border-color: var(--accent); }
.gender-opt input { width: auto; cursor: pointer; }

.edit-banner {
    background: linear-gradient(135deg, rgba(243,156,18,.1), rgba(230,126,34,.1));
    border: 1px solid rgba(243,156,18,.4);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.edit-banner .edit-info {
    display: flex;
    align-items: center;
    gap: .8rem;
    flex-wrap: wrap;
}
.edit-banner .edit-info .icon { font-size: 1.5rem; }
.edit-banner .edit-info-text strong {
    color: #e67e22;
    font-weight: 800;
}
.edit-banner .edit-info-text small {
    color: var(--muted);
    font-size: .75rem;
}

/* ═══ خاص بشاشة مدير المبيعات ═══ */
.chart-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}
.chart-title {
    font-size: .9rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 1rem;
}
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: .6rem;
    height: 140px;
    padding: 0 .5rem;
}
.bar-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .3rem;
    min-width: 0;
}
.bar {
    width: 100%;
    background: linear-gradient(180deg, var(--accent2), var(--accent));
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    position: relative;
    transition: opacity .2s;
}
.bar:hover { opacity: .85; }
.bar-val {
    position: absolute;
    top: -1.2rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: .7rem;
    color: var(--text);
    font-weight: 700;
    white-space: nowrap;
}
.bar-lbl {
    font-size: .65rem;
    color: var(--muted);
    text-align: center;
    font-weight: 600;
}

/* ═══ خاص بشاشة المستخدمين ═══ */
.checkbox-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: var(--surface);
    padding: .55rem .85rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    cursor: pointer;
}
.checkbox-row input { width: auto; cursor: pointer; }
.checkbox-row label {
    cursor: pointer;
    font-size: .88rem;
    color: var(--text);
    font-weight: 600;
    margin: 0;
}

/* ═══ Advanced Filter (Multi-row) ═══ */
.adv-rows-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1.4fr 40px;
    gap: .5rem;
    padding: 0 .25rem;
    margin-bottom: .4rem;
    font-size: .72rem;
    color: var(--muted);
    font-weight: 700;
}
.adv-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1.4fr 40px;
    gap: .5rem;
    padding: .5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: .5rem;
    align-items: center;
    transition: background .2s, border-color .2s;
}
.adv-row select,
.adv-row input {
    background: #fff;
    font-size: .82rem;
    padding: .45rem .65rem;
}
.adv-remove {
    background: rgba(231,76,60,.1);
    border: 1px solid rgba(231,76,60,.3);
    color: #e74c3c;
    border-radius: 6px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: .85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
}
.adv-remove:hover {
    background: #e74c3c;
    color: #fff;
    border-color: #e74c3c;
}
@media (max-width: 600px) {
    .adv-rows-header { display: none; }
    .adv-row {
        grid-template-columns: 1fr;
        gap: .35rem;
        padding: .65rem;
    }
    .adv-row .adv-remove {
        width: 100%;
        height: 32px;
    }
}

/* Chips الفلتر النشط */
#advFilterChip {
    flex-wrap: wrap;
    gap: .4rem;
    align-items: center;
}
.adv-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: #fff;
    padding: .35rem .7rem;
    border-radius: 20px;
    font-size: .76rem;
    font-weight: 600;
}
.adv-chip strong { font-weight: 800; }
.adv-chip button {
    background: rgba(255,255,255,.25);
    border: none;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: .75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.adv-chip button:hover { background: rgba(255,255,255,.4); }
.adv-chip-edit {
    background: transparent;
    border: 1px dashed var(--muted);
    color: var(--muted);
    padding: .35rem .7rem;
    border-radius: 20px;
    font-size: .76rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
}
.adv-chip-edit:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ═══ خاص بصفحات Login و Change Password ═══ */
.login-box, .box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem 2.25rem;
    width: 100%;
    max-width: 460px;
    box-shadow: var(--shadow);
}
.brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    justify-content: center;
    margin-bottom: .4rem;
}
.brand-dot {
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(177,17,22,.3);
    animation: pulse 2s infinite;
}
.brand-name {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--accent);
    letter-spacing: .5px;
}
/* ─── شعار + اسم الشركة على صفحة الدخول ─── */
.brand-logo-wrap {
    margin-bottom: 1rem;
}
.brand-logo {
    width: 130px;
    height: 130px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 4px 12px rgba(177,17,22,.18));
}
.brand-name-main {
    text-align: center;
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--accent);
    letter-spacing: .3px;
    margin: 0 0 .25rem;
    line-height: 1.4;
}
/* زرار الدخول — ممتد على عرض الفورم */
.btn-login {
    width: 100%;
    margin-top: .5rem;
    padding: .8rem 1rem;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
}
.login-box .subtitle, .box .subtitle {
    text-align: center;
    color: var(--muted);
    font-size: .88rem;
    margin: .3rem 0 1.5rem;
    line-height: 1.5;
}
.box h1 {
    font-size: 1.15rem;
    font-weight: 800;
    text-align: center;
    color: var(--text);
    margin-top: .7rem;
}
.input-pwd {
    direction: ltr;
    text-align: right;
}
.forced-warning {
    background: rgba(231,76,60,.1);
    border: 1px solid rgba(231,76,60,.3);
    color: var(--danger);
    padding: .7rem .9rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: .85rem;
    text-align: center;
    font-weight: 600;
}
.footer-note {
    text-align: center;
    color: var(--muted);
    font-size: .75rem;
    margin-top: 1.5rem;
}

/* ═══ Focus Mode (جلسة الاتصالات) ═══ */

/* بانر الـ launch في شاشة المندوب */
.focus-banner {
    background: linear-gradient(135deg, var(--accent2), var(--accent));
    color: #fff;
    border-radius: 14px;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 6px 20px rgba(177,17,22,.25);
}
.focus-banner-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.focus-banner-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: .35rem;
}
.focus-banner-subtitle {
    font-size: .92rem;
    opacity: .92;
    line-height: 1.6;
}
.focus-banner-btn {
    background: #fff;
    color: var(--accent);
    padding: .85rem 2rem;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1.05rem;
    text-decoration: none;
    transition: all .2s;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    white-space: nowrap;
}
.focus-banner-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,.22);
}
.focus-banner-hint {
    font-size: .78rem;
    opacity: .8;
    margin-top: .85rem;
    padding-top: .85rem;
    border-top: 1px solid rgba(255,255,255,.2);
}

/* صفحة Focus Mode نفسها */
.focus-page {
    max-width: 760px;
    margin: 0 auto;
    padding: 1.25rem 1rem 3rem;
    min-height: 100vh;
}
.focus-page-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    padding: 1.5rem;
}
.focus-empty-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 3rem 2.5rem;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow);
}

/* Header */
.focus-header {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    box-shadow: var(--shadow);
}
.focus-exit {
    background: rgba(231,76,60,.1);
    color: var(--danger);
    border: 1px solid rgba(231,76,60,.3);
    padding: .5rem 1rem;
    border-radius: 8px;
    font-size: .82rem;
    font-weight: 700;
    text-decoration: none;
    transition: all .2s;
}
.focus-exit:hover {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}
.focus-title-block {
    text-align: center;
    flex: 1;
}
.focus-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: .25rem;
}
.focus-stats {
    display: flex;
    gap: .5rem;
    justify-content: center;
    flex-wrap: wrap;
}
.focus-stat {
    font-size: .68rem;
    font-weight: 700;
    padding: .15rem .6rem;
    border-radius: 12px;
}
.focus-stat.overdue { background: rgba(231,76,60,.12); color: #e74c3c; }
.focus-stat.today   { background: rgba(52,152,219,.12); color: #3498db; }
.focus-stat.new     { background: rgba(46,204,113,.12); color: #27ae60; }

.focus-progress-block {
    text-align: left;
    min-width: 110px;
}
.focus-progress-text {
    font-size: .85rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: .35rem;
}
.focus-progress-bar {
    background: var(--surface);
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    width: 100px;
}
.focus-progress-fill {
    background: linear-gradient(90deg, var(--accent2), var(--accent));
    height: 100%;
    transition: width .4s ease;
    width: 0%;
}

/* Client Card */
.focus-client-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.75rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}
.priority-badge {
    display: inline-block;
    padding: .35rem .85rem;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 700;
    margin-bottom: 1rem;
}
.priority-overdue { background: rgba(231,76,60,.12); color: #e74c3c; border: 1px solid rgba(231,76,60,.3); }
.priority-today   { background: rgba(52,152,219,.12); color: #3498db; border: 1px solid rgba(52,152,219,.3); }
.priority-new     { background: rgba(46,204,113,.12); color: #27ae60; border: 1px solid rgba(46,204,113,.3); }

.client-name {
    font-size: 1.7rem;
    font-weight: 900;
    color: var(--text);
    margin-bottom: .65rem;
    line-height: 1.2;
}
.client-meta {
    display: flex;
    gap: .55rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1.25rem;
}
.status-pill {
    display: inline-block;
    padding: .2rem .7rem;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 700;
}
.meta-item {
    font-size: .82rem;
    color: var(--muted);
    background: var(--surface);
    padding: .2rem .65rem;
    border-radius: 12px;
}

.phone-block {
    background: linear-gradient(135deg, rgba(46,204,113,.04), rgba(46,204,113,.01));
    border: 1px solid rgba(46,204,113,.25);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    text-align: center;
}
.phone-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text);
    direction: ltr;
    margin-bottom: .85rem;
    font-family: 'Cairo', monospace;
    letter-spacing: 1px;
}
.phone-actions {
    display: flex;
    gap: .7rem;
    justify-content: center;
    flex-wrap: wrap;
}
.phone-btn {
    padding: .75rem 1.5rem;
    border-radius: 10px;
    font-weight: 800;
    font-size: 1rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    transition: all .2s;
    box-shadow: 0 3px 10px rgba(0,0,0,.1);
}
.phone-btn.whatsapp {
    background: #25D366;
    color: #fff;
}
.phone-btn.whatsapp:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(37,211,102,.4);
}
.phone-btn.call {
    background: #3498db;
    color: #fff;
}
.phone-btn.call:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(52,152,219,.4);
}
.phone-secondary {
    font-size: .75rem;
    color: var(--muted);
    margin-top: .65rem;
}

.last-note-box {
    background: var(--surface);
    border-right: 3px solid var(--accent);
    padding: .85rem 1rem;
    border-radius: 8px;
}
.last-note-box.no-note {
    border-right-color: var(--muted);
    color: var(--muted);
    font-style: italic;
    font-size: .85rem;
    text-align: center;
}
.last-note-label {
    font-size: .72rem;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: .35rem;
}
.last-note-text {
    font-size: .92rem;
    color: var(--text);
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Actions Card */
.focus-actions-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}
.focus-actions-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 1rem;
    padding-bottom: .55rem;
    border-bottom: 1px solid var(--border);
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .55rem;
    margin-bottom: 1rem;
}
.quick-btn {
    background: var(--surface);
    border: 2px solid var(--border);
    color: var(--text);
    padding: .8rem 1rem;
    border-radius: 10px;
    font-family: 'Cairo', sans-serif;
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
    display: flex;
    align-items: center;
    gap: .55rem;
    text-align: right;
}
.quick-btn:hover {
    transform: translateY(-2px);
}
.quick-btn i {
    font-size: 1.15rem;
    font-style: normal;
}
.quick-answered:hover { background: rgba(46,204,113,.1); border-color: #27ae60; color: #27ae60; }
.quick-noanswer:hover { background: rgba(243,156,18,.1); border-color: #f39c12; color: #e67e22; }
.quick-notinterested:hover { background: rgba(231,76,60,.1); border-color: #e74c3c; color: #e74c3c; }
.quick-booked:hover { background: rgba(155,89,182,.1); border-color: #9b59b6; color: #9b59b6; }

.quick-actions-divider {
    text-align: center;
    font-size: .72rem;
    color: var(--muted);
    margin: 1rem 0;
    position: relative;
}
.quick-actions-divider::before,
.quick-actions-divider::after {
    content: '';
    display: inline-block;
    width: 30%;
    height: 1px;
    background: var(--border);
    vertical-align: middle;
    margin: 0 .65rem;
}

.focus-form .field { margin-bottom: .85rem; }

.focus-bottom-actions {
    display: flex;
    gap: .75rem;
    margin-top: 1.25rem;
    align-items: center;
    flex-wrap: wrap;
}
.btn-skip {
    flex: 0 0 auto;
}
.btn-save-next {
    flex: 1;
    background: linear-gradient(135deg, var(--accent2), var(--accent));
    color: #fff;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-family: 'Cairo', sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 4px 14px rgba(177,17,22,.25);
}
.btn-save-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(177,17,22,.4);
}

.saving-msg {
    margin-top: .8rem;
    padding: .65rem .9rem;
    border-radius: 8px;
    font-size: .88rem;
    font-weight: 700;
    text-align: center;
}
.saving-info    { background: rgba(52,152,219,.12); color: #3498db; }
.saving-success { background: rgba(46,204,113,.12); color: #27ae60; }
.saving-error   { background: rgba(231,76,60,.12);  color: #e74c3c; }

/* Up Next */
.focus-up-next {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: .85rem 1.25rem;
}
.up-next-title {
    font-size: .78rem;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: .6rem;
}
.up-next-list {
    display: flex;
    gap: .6rem;
    flex-wrap: wrap;
}
.up-next-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .4rem .75rem;
    display: flex;
    align-items: center;
    gap: .45rem;
    font-size: .8rem;
}
.up-next-name {
    font-weight: 700;
    color: var(--text);
}
.up-next-type {
    font-size: .68rem;
    font-weight: 700;
}

@media (max-width: 600px) {
    .quick-actions { grid-template-columns: 1fr; }
    .client-name { font-size: 1.4rem; }
    .phone-number { font-size: 1.6rem; }
    .focus-banner-content { flex-direction: column; align-items: stretch; text-align: center; }
    .focus-banner-btn { width: 100%; text-align: center; }
}

/* ═══ Reception Tabs ═══ */
.reception-tabs {
    display: flex;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 6px;
    gap: 6px;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}
.reception-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--muted);
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    padding: .85rem 1.25rem;
    border-radius: 8px;
    transition: all .2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    white-space: nowrap;
}
.reception-tab:hover:not(.active) {
    background: rgba(177,17,22,.06);
    color: var(--accent);
}
.reception-tab.active {
    background: linear-gradient(135deg, var(--accent2), var(--accent));
    color: #fff;
    box-shadow: 0 3px 12px rgba(177,17,22,.3);
}
.reception-tab .tab-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.tab-panel {
    background: transparent;
    padding-top: .25rem;
    animation: tabFadeIn .25s ease;
}
@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
    .reception-tab {
        font-size: .85rem;
        padding: .7rem .5rem;
        gap: .35rem;
    }
    .reception-tab .tab-icon { width: 16px; height: 16px; }
}

/* ═══ Task Sections (في شاشة المندوب) ═══ */
.task-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.task-section-header {
    padding: .8rem 1.1rem;
    display: flex;
    align-items: center;
    gap: .6rem;
    border-bottom: 1px solid var(--border);
}
.task-section-icon { font-size: 1.15rem; }
.task-section-title {
    font-weight: 800;
    font-size: .95rem;
    flex: 1;
}
.task-section-count {
    font-size: .75rem;
    font-weight: 800;
    padding: .15rem .65rem;
    border-radius: 999px;
    color: #fff;
}

/* Overdue */
.task-overdue .task-section-header {
    background: rgba(231,76,60,.08);
    color: #c0392b;
}
.task-overdue .task-section-count { background: #e74c3c; }

/* Today */
.task-today .task-section-header {
    background: rgba(52,152,219,.08);
    color: #2c79b8;
}
.task-today .task-section-count { background: #3498db; }

/* New */
.task-new .task-section-header {
    background: rgba(46,204,113,.08);
    color: #1e8449;
}
.task-new .task-section-count { background: #27ae60; }

.task-section-body {
    padding: 0;
}
.task-card {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .8rem 1.1rem;
    border-bottom: 1px solid var(--border);
    transition: background .15s;
}
.task-card:last-child { border-bottom: none; }
.task-card:hover { background: rgba(177,17,22,.02); }

.task-card-info {
    flex: 1;
    min-width: 0;
}
.task-card-name {
    font-weight: 700;
    font-size: .95rem;
    margin-bottom: .25rem;
}
.task-card-meta {
    font-size: .78rem;
    color: var(--muted);
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
    align-items: center;
}
.task-phone {
    font-family: 'Cairo', monospace;
    color: var(--text);
    font-weight: 600;
}
.task-status-pill {
    font-size: .7rem;
    padding: .1rem .55rem;
    border-radius: 10px;
    font-weight: 700;
    margin-right: .35rem;
}

.task-overdue-badge {
    background: rgba(231,76,60,.12);
    color: #c0392b;
    font-size: .72rem;
    font-weight: 800;
    padding: .25rem .7rem;
    border-radius: 999px;
    white-space: nowrap;
}
.task-new-badge {
    background: rgba(46,204,113,.12);
    color: #1e8449;
    font-size: .72rem;
    font-weight: 800;
    padding: .25rem .7rem;
    border-radius: 999px;
    white-space: nowrap;
}

.task-card-actions {
    display: flex;
    gap: .35rem;
    flex-shrink: 0;
}

.task-section-footer {
    display: block;
    text-align: center;
    padding: .65rem;
    font-size: .82rem;
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
    background: var(--surface);
    border-top: 1px solid var(--border);
    transition: background .15s;
}
.task-section-footer:hover {
    background: rgba(177,17,22,.06);
}

.tab-badge {
    background: rgba(255,255,255,.25);
    color: inherit;
    font-size: .7rem;
    font-weight: 800;
    padding: .1rem .5rem;
    border-radius: 10px;
    margin-right: .3rem;
}
.reception-tab.active .tab-badge {
    background: rgba(255,255,255,.3);
    color: #fff;
}
.reception-tab:not(.active) .tab-badge {
    background: var(--accent);
    color: #fff;
}

@media (max-width: 700px) {
    .task-card {
        flex-wrap: wrap;
    }
    .task-card-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ═══ Notifications Bell ═══ */
.notif-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.notif-bell {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all .2s;
    padding: 0;
}
.notif-bell:hover {
    background: var(--surface);
    color: var(--accent);
    border-color: var(--accent);
}
.notif-bell.has-overdue {
    color: var(--accent);
    border-color: rgba(177,17,22,.3);
    background: rgba(177,17,22,.04);
    animation: bellShake 2s infinite;
}
@keyframes bellShake {
    0%, 90%, 100% { transform: rotate(0); }
    93%           { transform: rotate(-8deg); }
    96%           { transform: rotate(8deg); }
}

.notif-badge {
    position: absolute;
    top: -4px;
    left: -4px;
    background: #3498db;
    color: #fff;
    font-size: .65rem;
    font-weight: 800;
    padding: .05rem .35rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1.3;
    border: 2px solid var(--card);
}
.notif-badge.urgent {
    background: #e74c3c;
    animation: badgePulse 1.5s infinite;
}
@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231,76,60,.5); }
    50%      { box-shadow: 0 0 0 6px rgba(231,76,60,0); }
}

/* الـ Panel */
.notif-panel {
    display: none;
    position: absolute;
    top: calc(100% + .4rem);
    left: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,.15);
    width: 340px;
    max-height: 500px;
    overflow-y: auto;
    z-index: 80;
}
.notif-panel.open {
    display: block;
    animation: notifIn .2s ease;
}
@keyframes notifIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.notif-header {
    padding: .85rem 1rem;
    font-size: .92rem;
    font-weight: 800;
    color: var(--accent);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    position: sticky;
    top: 0;
}
.notif-total {
    background: var(--accent);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    padding: .15rem .55rem;
    border-radius: 10px;
}

.notif-section {
    padding: .65rem 0;
    border-bottom: 1px solid var(--border);
}
.notif-section:last-of-type { border-bottom: none; }

.notif-section-title {
    padding: 0 1rem .5rem;
    font-size: .82rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.notif-overdue .notif-section-title { color: #e74c3c; }
.notif-today   .notif-section-title { color: #3498db; }
.notif-new     .notif-section-title { color: #27ae60; }

.notif-count {
    background: var(--surface);
    font-size: .72rem;
    padding: .1rem .55rem;
    border-radius: 10px;
    color: var(--text);
}

.notif-item {
    padding: .45rem 1rem;
    transition: background .15s;
}
.notif-item:hover { background: var(--surface); }

.notif-item-name {
    font-size: .85rem;
    font-weight: 700;
    color: var(--text);
}
.notif-item-meta {
    font-size: .72rem;
    color: var(--muted);
    margin-top: .15rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
}
.notif-overdue-days {
    background: rgba(231,76,60,.12);
    color: #c0392b;
    padding: .1rem .5rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: .68rem;
    white-space: nowrap;
}

.notif-more {
    padding: .35rem 1rem;
    font-size: .72rem;
    color: var(--muted);
    font-style: italic;
}

.notif-empty {
    padding: 2rem 1rem;
    text-align: center;
}

.notif-footer {
    padding: .75rem 1rem;
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-radius: 0 0 12px 12px;
    display: flex;
    gap: .4rem;
    position: sticky;
    bottom: 0;
}
.notif-action-btn {
    flex: 1;
    padding: .55rem .65rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: .78rem;
    font-weight: 700;
    text-align: center;
    transition: all .2s;
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
}
.notif-action-btn:hover {
    background: var(--surface);
    transform: translateY(-1px);
}
.notif-action-btn.primary {
    background: linear-gradient(135deg, var(--accent2), var(--accent));
    color: #fff;
    border-color: transparent;
}
.notif-action-btn.primary:hover {
    box-shadow: 0 3px 10px rgba(177,17,22,.3);
}

@media (max-width: 600px) {
    .notif-panel {
        width: calc(100vw - 2rem);
        right: -1rem;
        left: auto;
    }
}

/* ═══ Flash animation لما يجي overdue جديد عبر AJAX ═══ */
.notif-bell.notif-flash {
    animation: notifFlash 1.5s ease;
}
@keyframes notifFlash {
    0%, 100% {
        background: rgba(177,17,22,.04);
        transform: scale(1);
    }
    25% {
        background: rgba(231,76,60,.3);
        transform: scale(1.15);
        box-shadow: 0 0 20px rgba(231,76,60,.5);
    }
    50% {
        background: rgba(231,76,60,.15);
        transform: scale(1.08);
    }
    75% {
        background: rgba(231,76,60,.25);
        transform: scale(1.12);
    }
}

/* ═══ Marketing Reports — Layout + Sidebar ═══ */
.mkt-layout {
    display: grid;
    grid-template-columns: 1fr 230px;
    gap: 1rem;
    align-items: start;
}
.mkt-content {
    min-width: 0; /* عشان grid ما يطلعش flex children */
}
.mkt-panel {
    animation: mktPanelIn .2s ease;
}
@keyframes mktPanelIn {
    from { opacity: 0; transform: translateY(-3px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Sidebar */
.mkt-sidebar {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    position: sticky;
    top: 1rem;
}
.mkt-sidebar-title {
    font-size: .7rem;
    color: var(--muted);
    padding: .3rem .6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: .2rem;
}
.mkt-side-btn {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .7rem .85rem;
    text-align: right;
    cursor: pointer;
    font-family: inherit;
    font-size: .85rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: .55rem;
    transition: all .15s;
    width: 100%;
}
.mkt-side-btn:hover {
    background: var(--surface);
    border-color: var(--accent2);
}
.mkt-side-btn.active {
    background: rgba(177,17,22,.06);
    border-color: rgba(177,17,22,.25);
    border-right: 3px solid var(--accent);
    color: var(--accent);
    font-weight: 700;
}
.mkt-side-icon {
    font-size: 1rem;
    flex-shrink: 0;
}
.mkt-side-label {
    flex: 1;
}
.mkt-side-badge {
    background: rgba(231,76,60,.15);
    color: #c0392b;
    font-size: .65rem;
    padding: .1rem .45rem;
    border-radius: 8px;
    font-weight: 800;
    margin-right: auto;
}

/* Responsive: مع الموبايل، Sidebar فوق المحتوى */
@media (max-width: 900px) {
    .mkt-layout {
        grid-template-columns: 1fr;
    }
    .mkt-sidebar {
        position: static;
        flex-direction: row;
        overflow-x: auto;
        flex-wrap: wrap;
    }
    .mkt-side-btn {
        flex: 1 1 auto;
        min-width: 130px;
    }
    .mkt-sidebar-title { display: none; }
}

/* ════════════════════════════════════════════════════════════
   📱 Mobile responsiveness — صفحتَي المندوب ومدير المبيعات فقط
   كل القواعد محصورة تحت body.mobile-ready عشان ما تأثرش على
   باقي الصفحات (الاستقبال، المستخدمين، إلخ).
   ════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

    /* ─── الـ Header: يلتف بشكل مرتب ──────────────────────── */
    body.mobile-ready .header {
        flex-wrap: wrap;
        height: auto;
        min-height: 56px;
        padding: .55rem .9rem;
        gap: .5rem .65rem;
    }
    body.mobile-ready .logo { font-size: 1.05rem; }
    body.mobile-ready .header-nav {
        width: 100%;
        gap: .4rem;
        row-gap: .45rem;
        justify-content: flex-start;
    }
    body.mobile-ready .header-nav .nav-btn {
        padding: .45rem .75rem;
        font-size: .8rem;
    }
    body.mobile-ready .user-chip {
        margin-left: 0;
        font-size: .72rem;
        padding: .3rem .65rem;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* ─── مساحة الصفحة ──────────────────────────────────── */
    body.mobile-ready .page { padding: 1rem .8rem 2.5rem; }
    body.mobile-ready .page-title { margin-bottom: 1rem; }
    body.mobile-ready .page-title h1 { font-size: 1.3rem; }
    body.mobile-ready .card { padding: 1rem; margin-bottom: 1rem; }

    /* ─── الفلاتر: عمود واحد، عرض كامل ───────────────────── */
    body.mobile-ready .filters {
        flex-direction: column;
        align-items: stretch;
        gap: .6rem;
    }
    body.mobile-ready .filters input,
    body.mobile-ready .filters select {
        min-width: 0;
        width: 100%;
    }
    body.mobile-ready .filters .btn { width: 100%; }
    body.mobile-ready .filters .date-range { width: 100%; }
    body.mobile-ready .filters .date-range input[type="date"] {
        min-width: 0;
        width: 100%;
    }
    body.mobile-ready .filters span[style*="margin-right:auto"] {
        text-align: center;
        margin: .2rem 0 0;
    }

    /* ─── الجداول → بطاقات (Cards) ───────────────────────── */
    body.mobile-ready .table-wrap { overflow-x: visible; }
    body.mobile-ready table { font-size: .9rem; }
    body.mobile-ready table,
    body.mobile-ready thead,
    body.mobile-ready tbody,
    body.mobile-ready tr,
    body.mobile-ready td {
        display: block;
        width: 100%;
    }
    body.mobile-ready thead { display: none; }       /* نخفي رأس الجدول */
    body.mobile-ready tr {
        background: #fff;
        border: 1px solid var(--border);
        border-radius: 12px;
        box-shadow: var(--shadow);
        margin-bottom: .85rem;
        overflow: hidden;
    }
    body.mobile-ready tr:hover td { background: transparent; }
    body.mobile-ready tr.inactive td { opacity: 1; }
    body.mobile-ready tr.self td { background: transparent; }

    body.mobile-ready td {
        border: none;
        border-bottom: 1px solid #f1f1f4;
        padding: .55rem .95rem;
        text-align: right;
        white-space: normal;
    }
    body.mobile-ready td:last-child { border-bottom: none; }

    /* رقم التليفون: منطقة لمس أكبر وأوضح كرابط اتصال */
    body.mobile-ready td[data-label="التليفون"] .phone-link {
        font-size: 1.02rem;
        padding: .25rem 0;
        display: inline-block;
    }

    /* اسم الحقل (label) قبل القيمة على نفس السطر */
    body.mobile-ready td[data-label]::before {
        content: attr(data-label) " :";
        font-weight: 700;
        color: var(--muted);
        font-size: .76rem;
        margin-left: .5rem;
    }

    /* صف "لا يوجد عملاء" (colspan) يتمركز ومن غير label */
    body.mobile-ready td[colspan] { text-align: center; }
    body.mobile-ready td[colspan]::before { display: none; }

    /* خلية الإجراءات: من غير label + أزرار في صف واحد */
    body.mobile-ready td[data-label="إجراء"]::before,
    body.mobile-ready td[data-label="إجراءات"]::before { display: none; }
    body.mobile-ready td[data-label="إجراء"],
    body.mobile-ready td[data-label="إجراءات"] {
        background: #fafafa;
        padding-top: .65rem;
        padding-bottom: .65rem;
    }
    body.mobile-ready .action-btns {
        flex-direction: row;
        flex-wrap: wrap;
        gap: .45rem;
    }
    body.mobile-ready .action-btns .btn {
        flex: 1 1 auto;
        min-width: 95px;
        padding: .6rem .5rem;
        font-size: .82rem;
    }

    /* ─── الـ Pagination ─────────────────────────────────── */
    body.mobile-ready .pagination { gap: .3rem; }
    body.mobile-ready .pagination a,
    body.mobile-ready .pagination span { padding: .45rem .7rem; }

    /* ─── الـ Modals ─────────────────────────────────────── */
    body.mobile-ready .modal-overlay { padding: .6rem; align-items: flex-start; }
    body.mobile-ready .modal {
        padding: 1.15rem;
        border-radius: 14px;
        max-height: 94vh;
        margin-top: .5rem;
    }
    body.mobile-ready .modal h2 { font-size: 1rem; }
    /* أزرار الحفظ/الإلغاء داخل المودال تبقى عريضة وسهلة الضغط */
    body.mobile-ready .modal .grid2 ~ div[style*="justify-content:flex-end"] .btn,
    body.mobile-ready .modal form > div[style*="justify-content:flex-end"] .btn { flex: 1 1 auto; }

    /* شبكات التفاصيل (1fr 1fr) جوّه المودال تبقى عمود واحد على الموبايل الضيق */
    body.mobile-ready #detailsContent div[style*="grid-template-columns:1fr 1fr"],
    body.mobile-ready #viewContent div[style*="grid-template-columns:1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
}

/* شاشات صغيرة جداً (< 380px) — تكبير منطقة الضغط */
@media (max-width: 380px) {
    body.mobile-ready .header-nav .nav-btn { font-size: .75rem; padding: .4rem .6rem; }
    body.mobile-ready .action-btns .btn { min-width: 100%; }
}

/* ════════════════════════════════════════════════════════════
   🧭 تخطيط القائمة الجانبية (يمين) + الشريط العلوي
   يُطبَّق تلقائياً على أي صفحة فيها .app-sidebar (كل صفحات القائمة)
   ════════════════════════════════════════════════════════════ */
:root{
    --side-w: 266px;
    --topbar-h: 64px;
    --side-bg:#1c1d22; --side-bg2:#26272e; --side-muted:#8a8b93;
}

/* الإزاحة: نحجز مساحة يمين للقائمة وأعلى للشريط */
body:has(.app-sidebar){
    padding-right: var(--side-w);
    padding-top: var(--topbar-h);
}
/* إخفاء أي بقايا من الهيدر القديم */
body:has(.app-sidebar) .header{ display:none !important; }

/* ─── القائمة الجانبية ─── */
.app-sidebar{
    position:fixed; top:0; right:0; width:var(--side-w); height:100vh;
    background:var(--side-bg); color:#e9e9ec; z-index:60;
    display:flex; flex-direction:column; border-left:1px solid #0c0c0e;
}
.app-brand{display:flex;align-items:center;gap:.7rem;padding:1.05rem 1.2rem;border-bottom:1px solid rgba(255,255,255,.07)}
.app-brand img{width:42px;height:42px;border-radius:9px;background:#fff;padding:3px;object-fit:contain;flex-shrink:0}
.app-brand .bt{font-weight:800;font-size:1.05rem;line-height:1.1;color:#fff}
.app-brand .bs{font-size:.7rem;color:var(--side-muted);margin-top:2px}

.app-nav{flex:1;overflow-y:auto;padding:.5rem 0 1rem}
.app-sec{font-size:.66rem;font-weight:700;letter-spacing:.03em;color:var(--side-muted);padding:.9rem 1.35rem .35rem}
.app-item{display:flex;align-items:center;gap:.8rem;padding:.7rem 1.35rem;color:#cfd0d6;font-size:.92rem;font-weight:600;border-right:3px solid transparent;transition:.15s;text-decoration:none}
.app-item svg{width:19px;height:19px;flex-shrink:0;opacity:.85}
.app-item:hover{background:var(--side-bg2);color:#fff}
.app-item.active{background:linear-gradient(90deg,rgba(177,17,22,.20),transparent);color:#fff;border-right-color:var(--accent)}
.app-item.active svg{opacity:1;color:#ff6b6b}

.app-foot{padding:.85rem 1rem;border-top:1px solid rgba(255,255,255,.07)}
.app-user{display:flex;align-items:center;gap:.6rem;background:var(--side-bg2);border-radius:10px;padding:.55rem .7rem}
.app-user .av{width:34px;height:34px;border-radius:50%;background:var(--accent);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:.9rem;flex-shrink:0}
.app-user .un{font-size:.83rem;font-weight:700;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:150px}
.app-user .ur{font-size:.68rem;color:var(--side-muted)}

/* ─── الشريط العلوي ─── */
.app-topbar{
    position:fixed; top:0; right:var(--side-w); left:0; height:var(--topbar-h);
    background:#fff; border-bottom:1px solid var(--border); z-index:40;
    display:flex; align-items:center; gap:.7rem; padding:0 1.3rem;
}
.app-hamb{display:none;width:40px;height:40px;border:1px solid var(--border);border-radius:10px;background:#fff;align-items:center;justify-content:center;cursor:pointer;color:var(--text);flex-shrink:0}
.app-hamb svg{width:20px;height:20px}
.app-crumb{font-weight:800;font-size:1.05rem;color:var(--text);min-width:0;flex-shrink:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.app-tb-spacer{flex:1}
.app-tb-ico{width:40px;height:40px;border:1px solid var(--border);border-radius:10px;background:#fff;display:flex;align-items:center;justify-content:center;text-decoration:none;font-size:1.05rem;flex-shrink:0}
.app-tb-ico:hover{background:var(--surface)}
.app-tb-logout{border:1px solid #f3c6c8;color:var(--accent);border-radius:10px;padding:.5rem 1rem;font-weight:700;font-size:.85rem;text-decoration:none;white-space:nowrap;flex-shrink:0}
.app-tb-logout:hover{background:#fdeaea}

/* الجرس داخل الشريط العلوي */
body:has(.app-sidebar) .notif-wrap{position:relative;flex-shrink:0}

/* ─── الحجاب (الموبايل) ─── */
.app-scrim{display:none;position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:55;opacity:0;pointer-events:none;transition:.25s}

/* ════════════ الموبايل ════════════ */
@media (max-width:900px){
    body:has(.app-sidebar){ padding-right:0; padding-top:56px; }
    .app-sidebar{transform:translateX(100%);transition:transform .25s ease;box-shadow:-10px 0 30px rgba(0,0,0,.35)}
    body.nav-open .app-sidebar{transform:translateX(0)}
    .app-scrim{display:block}
    body.nav-open .app-scrim{opacity:1;pointer-events:auto}
    .app-topbar{right:0;height:56px;padding:0 .8rem;gap:.5rem}
    .app-hamb{display:flex}
    .app-crumb{font-size:1rem}
    .app-tb-ico{width:38px;height:38px}
    .app-tb-logout{padding:.45rem .8rem}
}

/* ════════════════════════════════════════════════════════════
   ↔ وضع العرض: مدمج (افتراضي) / كامل — يتحكم فيه زر بالشريط العلوي
   ════════════════════════════════════════════════════════════ */
/* (أ) الافتراضي: مدمج وملاصق لليمين جنب القائمة، الفراغ يتجمّع شمال */
body:has(.app-sidebar) .page{
    margin-right: 0;
    margin-left: auto;
}
/* (ب) عند التفعيل: المحتوى يملأ عرض الشاشة بالكامل */
body.layout-full .page{
    max-width: none;
    margin: 0;
}

/* أيقونة زر التبديل (تتبدّل حسب الوضع) */
.app-layout-toggle .ico-expand,
.app-layout-toggle .ico-compress{ width:19px; height:19px; }
.app-layout-toggle .ico-compress{ display:none; }
body.layout-full .app-layout-toggle .ico-expand{ display:none; }
body.layout-full .app-layout-toggle .ico-compress{ display:inline; }
.app-layout-toggle{ cursor:pointer; }

/* على الموبايل: العرض دايماً كامل (مفيش داعي للتبديل) ونخفي الزر */
@media (max-width:900px){
    body:has(.app-sidebar) .page{ margin: 0; }
    .app-layout-toggle{ display:none; }
}

/* ─── زرّ واتساب جنب الرقم ─── */
.wa-btn{
    display:inline-flex; align-items:center; justify-content:center;
    width:28px; height:28px; border-radius:7px;
    background:#25D366; color:#fff; text-decoration:none;
    margin-right:.45rem; flex-shrink:0; vertical-align:middle;
    transition:background .15s;
}
.wa-btn svg{ width:16px; height:16px; }
.wa-btn:hover{ background:#1da851; }
/* على الموبايل (نظام الكروت) نكبّر شوية لسهولة اللمس */
body.mobile-ready td[data-label="التليفون"] .wa-btn{ width:32px; height:32px; }
body.mobile-ready td[data-label="التليفون"] .wa-btn svg{ width:18px; height:18px; }

/* ════════════════════════════════════════════════════════════
   🔍 فلاتر مدمجة قابلة للطي — المندوب ومدير المبيعات
   الديسكتوب: كل العناصر في صف واحد زي الأصل (display:contents)
   الموبايل: البحث + زر "فلترة"، والباقي مطوي بتنسيق مدمج
   ════════════════════════════════════════════════════════════ */
.filter-search-row, .filter-advanced { display: contents; }
.filter-toggle { display: none; }

@media (max-width: 768px){
    body.mobile-ready .filter-search-row{
        display: flex; gap: .5rem; align-items: stretch; width: 100%;
    }
    body.mobile-ready .filter-search-row input[name="search"]{
        flex: 1; min-width: 0; width: auto;
    }
    body.mobile-ready .filter-toggle{
        display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; cursor: pointer;
        border: 1px solid var(--border); background: #fff; color: var(--text);
        border-radius: 10px; padding: 0 1rem; font-family: inherit; font-weight: 700; font-size: .85rem;
    }
    body.mobile-ready .filter-toggle svg{ width: 16px; height: 16px; }
    body.mobile-ready .filter-toggle.active{ border-color: var(--accent); color: var(--accent); background: #fdeaea; }

    body.mobile-ready .filter-advanced{ display: none; width: 100%; }
    body.mobile-ready .filter-advanced.open{
        display: grid; grid-template-columns: 1fr 1fr; gap: .6rem;
        margin-top: .2rem; padding-top: .8rem; border-top: 1px dashed var(--border);
    }
    /* القوائم المنسدلة (الحالة/المندوب) بعرض كامل، والتواريخ كمان كل واحد بسطر (مش متزاحمين)، والأزرار عمودين */
    body.mobile-ready .filter-advanced.open > select{ grid-column: 1 / -1; }
    body.mobile-ready .filter-advanced.open .date-range{ grid-column: 1 / -1; }
}

/* ════════════════════════════════════════════════════════════
   🔎 قائمة اقتراحات البحث اللحظي (Autocomplete)
   ════════════════════════════════════════════════════════════ */
.search-ac{ position: relative; min-width: 160px; }
.search-ac input{ width: 100%; }
.ac-list{
    display: none; position: absolute; top: calc(100% + 5px); right: 0; left: auto;
    min-width: 280px; max-width: min(440px, 92vw); width: max-content;
    background: #fff; border: 1px solid var(--border); border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,.16); z-index: 50; max-height: 340px; overflow-y: auto;
}
.ac-list.open{ display: block; }
.ac-item{
    display: flex; align-items: center; gap: .7rem; padding: .6rem .85rem;
    cursor: pointer; border-bottom: 1px solid #f1f1f4;
}
.ac-item:last-child{ border-bottom: none; }
.ac-item:hover, .ac-item.active{ background: var(--surface); }
.ac-name{ font-weight: 700; font-size: .9rem; flex: 1; min-width: 0; }
.ac-name small{ color: var(--muted); font-weight: 500; }
.ac-phone{ font-size: .82rem; color: var(--accent); font-weight: 700; direction: ltr; }
.ac-empty{ padding: .9rem; text-align: center; color: var(--muted); font-size: .85rem; }

@media (max-width: 768px){
    body.mobile-ready .filter-search-row .search-ac{ flex: 1; min-width: 0; }
    body.mobile-ready .ac-list{ right: 0; left: 0; min-width: 0; width: auto; max-width: none; }
}

/* لوجو الشريط العلوي الأفقي */
.logo-img{ width:34px; height:34px; border-radius:7px; object-fit:contain; }

/* ════════════════════════════════════════════════════════════
   📞 إدارة أرقام التليفون (المندوب / مدير المبيعات) — داخل النوافذ
   ════════════════════════════════════════════════════════════ */
.phones-list { display:flex; flex-direction:column; gap:.5rem; margin-bottom:.6rem; }
.phone-row { display:grid; grid-template-columns:1fr 140px 40px 36px; gap:.5rem; align-items:center; }
.phone-row .phone-input { padding:.5rem .75rem; border:1px solid var(--border); border-radius:8px; background:#fff; font-size:.9rem; font-family:inherit; direction:ltr; text-align:right; }
.phone-row .phone-input:focus { outline:none; border-color:var(--accent); }
.phone-row .phone-label-select { padding:.5rem .5rem; border:1px solid var(--border); border-radius:8px; background:#fff; font-size:.85rem; font-family:inherit; color:#555; }
.phone-row .phone-primary-btn { width:40px; height:40px; display:flex; align-items:center; justify-content:center; border-radius:8px; cursor:pointer; font-size:1.2rem; background:transparent; border:1px solid transparent; transition:all .15s; color:#ccc; }
.phone-row .phone-primary-btn:hover { background:#fffbf0; border-color:#f0d77a; }
.phone-row .phone-primary-btn.active { color:#e6a817; background:#fff8e1; border-color:#f0d77a; }
.phone-row .phone-remove-btn { width:36px; height:40px; display:flex; align-items:center; justify-content:center; border-radius:8px; cursor:pointer; font-size:1.3rem; background:transparent; border:1px solid transparent; color:#999; transition:all .15s; line-height:1; }
.phone-row .phone-remove-btn:hover { background:rgba(193,39,45,.08); color:var(--accent); border-color:rgba(193,39,45,.2); }
.phone-row .phone-remove-btn[disabled] { visibility:hidden; }
.phones-add-btn { display:inline-flex; align-items:center; gap:.4rem; padding:.5rem 1rem; background:transparent; border:1px dashed var(--accent); border-radius:8px; color:var(--accent); font-size:.88rem; font-family:inherit; cursor:pointer; transition:all .15s; }
.phones-add-btn:hover { background:rgba(193,39,45,.05); }
.phones-hint { font-size:.78rem; color:var(--muted); margin-bottom:.5rem; }
@media (max-width:600px){ .phone-row { grid-template-columns:1fr 110px 36px 32px; gap:.3rem; } }

/* ════════════════════════════════════════════════════════════
   ◀ طيّ القائمة الجانبية (المندوب / مدير المبيعات) — افتراضي مقفولة
   ════════════════════════════════════════════════════════════ */
.app-sidebar { transition: transform .25s ease; }
.app-topbar  { transition: right .25s ease; }
body:has(.app-sidebar) { transition: padding-right .25s ease; }

@media (min-width: 901px) {
    /* زرّ ☰ يظهر على الكمبيوتر فقط للصفحات القابلة للطيّ */
    body.sidebar-collapsible .app-hamb { display: flex; }
    /* عند الطيّ: القائمة تختفي والمحتوى يبقى بعرض الشاشة كامل */
    body.sidebar-collapsible.sidebar-collapsed { padding-right: 0 !important; }
    body.sidebar-collapsible.sidebar-collapsed .app-sidebar { transform: translateX(100%); box-shadow: none; }
    body.sidebar-collapsible.sidebar-collapsed .app-topbar { right: 0 !important; }
}

/* ═══ جداول التقارير الهرمية (Drill-down) ═══ */
.drill-toggle{
    cursor:pointer;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:18px;height:18px;
    border-radius:5px;
    background:rgba(177,17,22,.1);
    color:var(--accent);
    font-weight:800;
    font-size:.9rem;
    line-height:1;
    user-select:none;
    transition:background .15s;
}
.drill-toggle:hover{ background:rgba(177,17,22,.22); }
.drill-spacer{ display:inline-block; width:18px; }
.drill-table tbody .drill-row:hover{ background:rgba(52,152,219,.05); }
