/*
 * MoveFlow Pro - النمط الرئيسي
 * واجهة عربية RTL بخط Cairo، متجاوبة من الجوال، مع أنماط الطباعة.
 */
:root {
    --primary: #0F4C81;
    --primary-dark: #0A3A63;
    --primary-light: #E8F1F8;
    --accent: #E8A33D;
    --bg: #F4F6F9;
    --surface: #FFFFFF;
    --text: #1F2A37;
    --text-muted: #64748B;
    --border: #DDE3EC;
    --success: #1E7D46;
    --success-bg: #E6F4EB;
    --danger: #B3261E;
    --danger-bg: #FBEAE9;
    --warning: #B26A00;
    --warning-bg: #FCF2E3;
    --info: #1D5FAD;
    --info-bg: #E8F1FB;
    --muted-bg: #EEF1F5;
    --sidebar-w: 264px;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(16, 34, 54, 0.08);
}

* { box-sizing: border-box; }
html { font-size: 15.5px; }
body {
    margin: 0;
    font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.4; }

/* ---------- الهيكل العام ---------- */
.app-shell { min-height: 100vh; }
.main {
    margin-inline-start: var(--sidebar-w);
    padding: 1.1rem 1.3rem 3rem;
    min-width: 0;
}
.app-foot {
    margin-inline-start: var(--sidebar-w);
    padding: .8rem 1.3rem;
    color: var(--text-muted);
    font-size: .8rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .4rem;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

/* ---------- الشريط العلوي ---------- */
.topbar {
    margin-inline-start: var(--sidebar-w);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: .55rem 1.1rem;
    display: flex;
    align-items: center;
    gap: .8rem;
    position: sticky;
    top: 0;
    z-index: 40;
}
.topbar-title { display: flex; align-items: baseline; gap: .6rem; min-width: 0; flex: 1; }
.topbar-title strong { font-size: 1.02rem; }
.topbar-company { color: var(--text-muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-user { display: flex; align-items: center; gap: .5rem; }
.user-chip { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }
.user-name { font-weight: 700; font-size: .85rem; }
.user-role { color: var(--text-muted); font-size: .72rem; }
.mobile-toggle {
    display: none;
    background: var(--primary);
    color: #fff;
    border: 0;
    border-radius: 8px;
    width: 40px; height: 38px;
    cursor: pointer;
    align-items: center; justify-content: center;
}

/* ---------- القائمة الجانبية ---------- */
.sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: var(--sidebar-w);
    background: var(--primary-dark);
    color: #E7EEF6;
    display: flex;
    flex-direction: column;
    z-index: 60;
    overflow-y: auto;
    scrollbar-width: thin;
}
.sidebar-brand {
    display: flex; align-items: center; gap: .6rem;
    padding: .9rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,.12);
    font-weight: 800; font-size: 1.05rem;
    position: sticky; top: 0; background: var(--primary-dark); z-index: 2;
}
.brand-mark {
    background: var(--accent); color: #1F2A37;
    border-radius: 8px; padding: .15rem .5rem;
    font-weight: 800; font-size: .95rem;
}
.sidebar-close { display: none; margin-inline-start: auto; background: none; border: 0; color: #fff; font-size: 1rem; cursor: pointer; }
.sidebar-nav { flex: 1; padding: .5rem .55rem 1rem; }
.menu-section { margin-bottom: .25rem; border-radius: 8px; }
.menu-section-btn {
    width: 100%;
    display: flex; align-items: center; gap: .55rem;
    background: none; border: 0; color: #D6E2EF;
    padding: .55rem .6rem;
    font-family: inherit; font-size: .92rem; font-weight: 700;
    cursor: pointer; border-radius: 8px; text-align: start;
}
.menu-section-btn:hover { background: rgba(255,255,255,.08); }
.menu-section.open > .menu-section-btn { background: rgba(255,255,255,.10); color: #fff; }
.menu-icon { width: 21px; height: 21px; display: inline-flex; flex: none; }
.menu-icon svg { width: 100%; height: 100%; }
.menu-title { flex: 1; }
.menu-chevron {
    width: 9px; height: 9px;
    border-inline-end: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform .18s ease;
    flex: none;
    margin-inline-end: .25rem;
    margin-top: -4px;
}
.menu-section.open .menu-chevron { transform: rotate(-135deg); margin-top: 4px; }
.menu-list { list-style: none; margin: 0; padding: 0 0 0 .3rem; display: none; }
.menu-section.open .menu-list { display: block; }
.menu-list .menu-item {
    display: block;
    color: #C4D3E3;
    padding: .42rem .8rem;
    border-radius: 7px;
    font-size: .87rem;
    border-inline-start: 3px solid transparent;
}
.menu-list .menu-item:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.menu-list .menu-item.active {
    background: var(--accent);
    color: #1F2A37;
    font-weight: 700;
    border-inline-start-color: #fff;
}
.sidebar-foot { padding: .7rem .8rem .9rem; border-top: 1px solid rgba(255,255,255,.12); display: flex; flex-direction: column; gap: .25rem; }
.sidebar-foot .menu-item { color: #C4D3E3; padding: .4rem .6rem; border-radius: 7px; font-size: .85rem; display: block; }
.sidebar-foot .menu-item:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.demo-chip {
    display: inline-block; background: var(--accent); color: #1F2A37;
    font-weight: 800; font-size: .78rem; padding: .2rem .7rem; border-radius: 20px; margin-bottom: .4rem;
    text-align: center;
}
.sidebar-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 30, 50, .5);
    z-index: 55;
}
.demo-banner {
    background: var(--warning-bg);
    color: var(--warning);
    border-bottom: 1px solid #EAD3A8;
    text-align: center;
    padding: .4rem 1rem;
    font-weight: 700;
    font-size: .85rem;
}

/* ---------- البطاقات والإحصاءات ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h2 { font-size: 1.25rem; margin: 0; }
.page-head .page-desc { color: var(--text-muted); font-size: .85rem; }
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
}
.card h3 { font-size: 1rem; margin-bottom: .7rem; }
.card .card-sub { color: var(--text-muted); font-size: .8rem; margin: -0.4rem 0 .8rem; }
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: .7rem;
    margin-bottom: 1rem;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-inline-start: 4px solid var(--primary);
    border-radius: var(--radius);
    padding: .7rem .9rem;
    box-shadow: var(--shadow);
}
.stat-card .stat-label { color: var(--text-muted); font-size: .78rem; }
.stat-card .stat-value { font-size: 1.25rem; font-weight: 800; direction: ltr; text-align: end; unicode-bidi: plaintext; }
.stat-card .stat-extra { font-size: .72rem; color: var(--text-muted); }
.stat-c-success { border-inline-start-color: var(--success); }
.stat-c-danger { border-inline-start-color: var(--danger); }
.stat-c-warning { border-inline-start-color: var(--accent); }
.stat-c-info { border-inline-start-color: var(--info); }
.stat-c-accent { border-inline-start-color: var(--accent); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-2 > .card, .grid-3 > .card { margin-bottom: 0; }

/* ---------- الجداول ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
table.table { width: 100%; border-collapse: collapse; min-width: 640px; }
table.table th, table.table td { padding: .55rem .7rem; text-align: start; border-bottom: 1px solid var(--border); font-size: .87rem; vertical-align: middle; }
table.table th { background: var(--primary-light); color: var(--primary-dark); font-weight: 700; white-space: nowrap; }
table.table tr:last-child td { border-bottom: 0; }
table.table tr:hover td { background: #F8FAFD; }
table.table .num { direction: ltr; text-align: end; unicode-bidi: plaintext; white-space: nowrap; }
.table-empty { padding: 2rem 1rem; text-align: center; color: var(--text-muted); }
.table-actions { display: flex; gap: .35rem; flex-wrap: wrap; }

/* ---------- الشارات ---------- */
.badge {
    display: inline-block;
    padding: .12rem .6rem;
    border-radius: 20px;
    font-size: .74rem;
    font-weight: 700;
    white-space: nowrap;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-muted { background: var(--muted-bg); color: var(--text-muted); }

/* ---------- الأزرار ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
    font-family: inherit;
    font-size: .87rem; font-weight: 700;
    padding: .45rem 1rem;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s ease;
    line-height: 1.5;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent { background: var(--accent); color: #1F2A37; }
.btn-accent:hover { background: #D18F27; }
.btn-outline { background: var(--surface); color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #961F18; }
.btn-ghost { background: var(--muted-bg); color: var(--text); }
.btn-ghost:hover { background: #E1E7EF; }
.btn-sm { padding: .22rem .6rem; font-size: .78rem; border-radius: 6px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- النماذج ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .8rem 1rem; }
.form-grid .field-full { grid-column: 1 / -1; }
.field label { display: block; font-weight: 700; font-size: .83rem; margin-bottom: .25rem; }
.field .req { color: var(--danger); }
.field input, .field select, .field textarea {
    width: 100%;
    font-family: inherit;
    font-size: .9rem;
    padding: .5rem .65rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: 2px solid var(--primary);
    outline-offset: 0;
    border-color: var(--primary);
}
.field textarea { min-height: 84px; resize: vertical; }
.field .hint { font-size: .74rem; color: var(--text-muted); margin-top: .2rem; }
.form-actions { display: flex; gap: .6rem; margin-top: 1.1rem; flex-wrap: wrap; }
fieldset.form-set { border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem 1rem; margin: 0 0 1rem; }
fieldset.form-set legend { font-weight: 800; font-size: .9rem; padding: 0 .4rem; color: var(--primary-dark); }
.checkbox-line { display: flex; align-items: center; gap: .45rem; font-size: .85rem; }
.checkbox-line input { width: auto; }
.search-bar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: .9rem; }
.search-bar .field { min-width: 170px; flex: 1; max-width: 320px; }
.search-bar .field-sm { min-width: 140px; max-width: 200px; }
.filter-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .9rem; }
.filter-tabs a {
    padding: .3rem .85rem; border-radius: 20px; font-size: .82rem; font-weight: 700;
    background: var(--surface); border: 1px solid var(--border); color: var(--text-muted);
}
.filter-tabs a.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.filter-tabs a:hover { text-decoration: none; }

/* ---------- التنبيهات ---------- */
.alert { padding: .65rem .9rem; border-radius: 8px; margin-bottom: .8rem; font-size: .88rem; border: 1px solid transparent; }
.alert a { font-weight: 700; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: #BFDECB; }
.alert-danger { background: var(--danger-bg); color: var(--danger); border-color: #EFC4C1; }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: #EAD3A8; }
.alert-info { background: var(--info-bg); color: var(--info); border-color: #C3D9F0; }

/* ---------- قائمة التنبيهات ---------- */
.alerts-list { list-style: none; margin: 0; padding: 0; }
.alerts-list li { display: flex; align-items: center; gap: .6rem; padding: .5rem .2rem; border-bottom: 1px dashed var(--border); font-size: .87rem; }
.alerts-list li:last-child { border-bottom: 0; }
.alert-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot-red { background: var(--danger); }
.dot-orange { background: var(--accent); }
.dot-green { background: var(--success); }
.dot-blue { background: var(--info); }
.alerts-list .alert-link { margin-inline-start: auto; font-size: .78rem; white-space: nowrap; }

/* ---------- الرسوم البيانية ---------- */
.chart-box { position: relative; width: 100%; }
.chart-box canvas { width: 100%; height: 260px; display: block; }
.chart-legend { display: flex; gap: .9rem; flex-wrap: wrap; margin-top: .6rem; font-size: .78rem; color: var(--text-muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.chart-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.chart-empty { padding: 2.2rem 1rem; text-align: center; color: var(--text-muted); font-size: .88rem; background: var(--muted-bg); border-radius: 8px; }

/* ---------- التقويم ---------- */
.cal-nav { display: flex; align-items: center; gap: .6rem; margin-bottom: .8rem; flex-wrap: wrap; }
.cal-nav .cal-title { font-weight: 800; font-size: 1.05rem; min-width: 190px; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-dow { text-align: center; font-weight: 800; font-size: .78rem; color: var(--primary-dark); padding: .3rem 0; background: var(--primary-light); border-radius: 6px; }
.cal-cell { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; min-height: 88px; padding: .3rem; overflow: hidden; }
.cal-cell.out-month { opacity: .45; background: #FAFBFD; }
.cal-cell.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cal-daynum { font-size: .72rem; font-weight: 800; color: var(--text-muted); }
.cal-event {
    display: block; font-size: .68rem; padding: .1rem .3rem; border-radius: 5px; margin-top: .15rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; font-weight: 700;
}
.cal-event:hover { text-decoration: none; filter: brightness(.92); }
.ce-new { background: #1D5FAD; } .ce-awaiting_quote, .ce-awaiting_approval, .ce-in_progress { background: #B26A00; }
.ce-confirmed, .ce-scheduled { background: #0F4C81; } .ce-completed { background: #1E7D46; } .ce-cancelled { background: #B3261E; }
.cal-legend { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: .7rem; font-size: .75rem; color: var(--text-muted); }
.cal-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; margin-inline-end: .3rem; }
.day-list { display: flex; flex-direction: column; gap: .6rem; }
.day-card { background: var(--surface); border: 1px solid var(--border); border-inline-start: 4px solid var(--primary); border-radius: 8px; padding: .6rem .8rem; display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.day-card .day-time { font-weight: 800; direction: ltr; min-width: 60px; }
.day-card .day-route { flex: 1; min-width: 200px; font-size: .87rem; }

/* ---------- لوحة التعيين ---------- */
.assign-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.assign-item { border: 1px solid var(--border); border-radius: 8px; padding: .55rem .7rem; margin-bottom: .55rem; background: #FBFCFE; }
.assign-item .row-title { font-weight: 700; font-size: .88rem; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.assign-item .row-meta { color: var(--text-muted); font-size: .78rem; margin-top: .15rem; }
.assign-form { display: flex; gap: .4rem; margin-top: .45rem; flex-wrap: wrap; }
.assign-form select { flex: 1; min-width: 150px; font-family: inherit; font-size: .82rem; padding: .35rem .5rem; border: 1px solid var(--border); border-radius: 7px; }

/* ---------- التفاصيل ---------- */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .7rem 1.2rem; }
.detail-item .dt { font-size: .76rem; color: var(--text-muted); font-weight: 700; }
.detail-item .dd { font-size: .9rem; font-weight: 600; }
.detail-item .dd.money { direction: ltr; text-align: end; unicode-bidi: plaintext; }
.status-flow { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-top: .6rem; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: .45rem 1.4rem .45rem 0; border-inline-end: 2px solid var(--border); margin-inline-end: .6rem; }
.timeline li::before { content: ''; position: absolute; inset-inline-end: -6px; top: .8rem; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.timeline .tl-time { font-size: .74rem; color: var(--text-muted); }

/* ---------- الصفحة العامة ---------- */
.public-page { background: #fff; }
.public-hero { background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 70%); color: #fff; padding: 4rem 1.5rem 5rem; text-align: center; }
.public-hero .hero-logo { font-size: 1.05rem; font-weight: 800; letter-spacing: .5px; color: var(--accent); margin-bottom: 1rem; }
.public-hero h1 { font-size: 2.1rem; margin-bottom: .7rem; }
.public-hero p { max-width: 640px; margin: 0 auto 1.8rem; font-size: 1.02rem; color: #DCE7F2; }
.hero-actions { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }
.public-section { padding: 3rem 1.4rem; max-width: 1080px; margin: 0 auto; }
.public-section.alt { background: var(--bg); max-width: none; }
.public-section.alt > .inner { max-width: 1080px; margin: 0 auto; }
.public-section h2 { text-align: center; font-size: 1.5rem; margin-bottom: .4rem; }
.public-section .section-sub { text-align: center; color: var(--text-muted); margin-bottom: 2rem; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem; box-shadow: var(--shadow); }
.feature-card h3 { font-size: 1rem; }
.feature-card p { font-size: .86rem; color: var(--text-muted); margin: 0; }
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; counter-reset: step; }
.step-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem; position: relative; box-shadow: var(--shadow); }
.step-card::before {
    counter-increment: step;
    content: counter(step);
    position: absolute; top: -14px; inset-inline-start: 1rem;
    background: var(--accent); color: #1F2A37; font-weight: 800;
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.step-card h3 { font-size: .95rem; margin-top: .4rem; }
.step-card p { font-size: .84rem; color: var(--text-muted); margin: 0; }
.faq-list { max-width: 760px; margin: 0 auto; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: .7rem; background: var(--surface); overflow: hidden; }
.faq-q {
    width: 100%; text-align: start; background: none; border: 0; font-family: inherit;
    font-size: .95rem; font-weight: 700; padding: .8rem 1rem; cursor: pointer;
    display: flex; justify-content: space-between; align-items: center; gap: .6rem; color: var(--text);
}
.faq-q .menu-chevron { color: var(--primary); }
.faq-a { padding: 0 1rem .9rem; color: var(--text-muted); font-size: .88rem; display: none; }
.faq-item.open .faq-a { display: block; }
.faq-item.open .faq-q .menu-chevron { transform: rotate(-135deg); margin-top: 4px; }
.public-footer { background: var(--primary-dark); color: #C9D6E4; padding: 1.6rem 1.4rem; text-align: center; font-size: .84rem; }
.public-footer a { color: #fff; }
.contact-block { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; font-size: .92rem; }
.contact-block span { background: var(--surface); border: 1px solid var(--border); padding: .4rem 1rem; border-radius: 20px; }

/* ---------- صفحة الدخول ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; background: linear-gradient(135deg, var(--primary-dark), var(--primary)); }
.login-card { background: #fff; border-radius: 14px; box-shadow: 0 10px 40px rgba(10,25,45,.35); width: 100%; max-width: 400px; padding: 2rem 1.8rem; }
.login-card .login-brand { text-align: center; margin-bottom: 1.4rem; }
.login-card .brand-mark { font-size: 1.2rem; padding: .3rem .8rem; }
.login-card h1 { font-size: 1.3rem; text-align: center; margin-bottom: .2rem; }
.login-card .login-sub { text-align: center; color: var(--text-muted); font-size: .84rem; margin-bottom: 1.4rem; }
.login-links { text-align: center; margin-top: 1rem; font-size: .84rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .4rem; }

/* ---------- الترقيم ---------- */
.pagination { display: flex; gap: .3rem; align-items: center; flex-wrap: wrap; margin-top: .9rem; justify-content: center; }
.pg-link { padding: .25rem .65rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); font-size: .82rem; }
.pg-link.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pg-info { font-size: .78rem; color: var(--text-muted); margin-inline-end: .5rem; }
.pg-dots { color: var(--text-muted); }

/* ---------- الطباعة ---------- */
.print-body { background: #fff; }
.print-doc { max-width: 830px; margin: 0 auto; padding: 1.2rem 1.4rem; }
.print-head { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 3px solid var(--primary); padding-bottom: .8rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.print-company h1 { font-size: 1.3rem; color: var(--primary-dark); margin: 0 0 .3rem; }
.print-meta { font-size: .78rem; color: var(--text-muted); }
.print-title h2 { font-size: 1.15rem; margin: 0; color: var(--primary); }
.print-no { font-size: .8rem; color: var(--text-muted); }
.print-doc table.table { min-width: 0; }
.print-doc table.table th, .print-doc table.table td { border-bottom: 1px solid #CBD5E1; }
.print-foot { margin-top: 1.4rem; border-top: 1px solid var(--border); padding-top: .7rem; font-size: .78rem; color: var(--text-muted); }
.print-hint { font-size: .74rem; }
.section-title { background: var(--primary-light); padding: .3rem .7rem; border-radius: 6px; font-size: .95rem; font-weight: 800; color: var(--primary-dark); margin: 1.1rem 0 .6rem; }
.signature-row { display: flex; justify-content: space-between; margin-top: 2.2rem; gap: 2rem; }
.signature-row .sig { flex: 1; text-align: center; border-top: 1px solid #94A3B8; padding-top: .3rem; font-size: .82rem; }

@media print {
    @page { margin: 12mm; }
    body { background: #fff; }
    .no-print, .topbar, .sidebar, .sidebar-overlay, .app-foot, .demo-banner, .print-actions { display: none !important; }
    .print-body { font-size: 12.5px; }
    .print-doc { padding: 0; max-width: none; }
    .print-doc table.table th { background: #EEF2F7 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    table.table tr, .print-head, .card, .detail-grid { break-inside: avoid; page-break-inside: avoid; }
    .section-title { break-after: avoid; }
    a { color: inherit; text-decoration: none; }
}

/* ---------- الجوال ---------- */
@media (max-width: 900px) {
    .grid-2, .grid-3, .assign-cols { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .mobile-toggle { display: inline-flex; }
    .sidebar { transform: translateX(100%); transition: transform .22s ease; box-shadow: -6px 0 24px rgba(10,25,45,.25); }
    html[dir="rtl"] .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0) !important; }
    .sidebar-close { display: block; }
    .main, .topbar, .app-foot { margin-inline-start: 0; }
    .topbar { padding: .5rem .7rem; }
    .topbar-company { display: none; }
    .cal-grid { gap: 3px; }
    .cal-cell { min-height: 62px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .public-hero h1 { font-size: 1.5rem; }
    .user-name { display: none; }
}
@media (min-width: 769px) {
    .sidebar-overlay { display: none !important; }
}
