@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&display=swap');

/* =====================================================================
   المتخصصون CRM — الهوية: أسود + ذهبي + رمادي هادئ
   ===================================================================== */

:root {
    --black:        #0c0c0d;
    --black-soft:   #141416;
    --panel:        #17181b;
    --panel-2:      #1d1e22;
    --line:         #2a2c31;

    --gold:         #c9a227;
    --gold-light:   #e0c05a;
    --gold-dark:    #9c7c17;
    --gold-soft:    rgba(201, 162, 39, .12);

    --bg:           #f4f4f5;
    --card:         #ffffff;
    --card-line:    #e6e6e9;
    --text:         #1c1d20;
    --text-2:       #5d6068;
    --text-3:       #8b8f98;

    --success:      #1f9d63;
    --success-bg:   rgba(31, 157, 99, .12);
    --danger:       #c0392b;
    --danger-bg:    rgba(192, 57, 43, .12);
    --warning:      #d68910;
    --warning-bg:   rgba(214, 137, 16, .14);
    --info:         #2c6fb5;
    --info-bg:      rgba(44, 111, 181, .12);

    --radius:       14px;
    --radius-sm:    9px;
    --shadow:       0 1px 2px rgba(16,18,22,.04), 0 8px 24px rgba(16,18,22,.06);
    --shadow-lg:    0 20px 50px rgba(12,12,13,.18);
    --sidebar-w:    258px;
    --topbar-h:     70px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c9cad0; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #adaeb6; }

/* =====================================================================
   شاشة تسجيل الدخول
   ===================================================================== */
.login-body {
    background: var(--black);
    min-height: 100vh;
}

.login-wrapper {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    min-height: 100vh;
}

.login-visual {
    background:
        radial-gradient(900px 500px at 80% 10%, rgba(201,162,39,.14), transparent 60%),
        linear-gradient(160deg, #101012 0%, #17181b 60%, #0c0c0d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    position: relative;
    overflow: hidden;
}

.login-visual::after {
    content: '';
    position: absolute;
    inset-inline-start: -120px;
    bottom: -160px;
    width: 460px; height: 460px;
    border: 1px solid rgba(201,162,39,.16);
    border-radius: 50%;
}

.login-visual-inner { position: relative; z-index: 1; max-width: 430px; text-align: center; }
.login-visual-logo { width: 170px; margin: 0 auto 28px; }
.login-visual h1 { color: #fff; font-size: 30px; font-weight: 800; letter-spacing: -.3px; }
.login-visual p { color: #9a9ca4; margin-top: 10px; font-size: 15px; }

.login-features { list-style: none; margin-top: 34px; text-align: start; display: grid; gap: 14px; }
.login-features li {
    color: #cfd0d6; display: flex; align-items: center; gap: 12px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.06);
    padding: 12px 16px; border-radius: var(--radius-sm);
}
.login-features i { color: var(--gold); width: 20px; text-align: center; }

.login-panel {
    background: var(--bg);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 40px 24px;
}

.login-card {
    width: 100%; max-width: 400px;
    background: var(--card);
    border: 1px solid var(--card-line);
    border-radius: 18px;
    padding: 40px 34px;
    box-shadow: var(--shadow);
}
.login-card-logo { width: 92px; margin: 0 auto 22px; display: none; }
.login-card h2 { font-size: 23px; font-weight: 800; }
.login-sub { color: var(--text-2); margin: 6px 0 26px; font-size: 13.5px; }

.login-note {
    margin-top: 22px; padding: 13px 15px;
    background: var(--gold-soft);
    border: 1px solid rgba(201,162,39,.28);
    border-radius: var(--radius-sm);
    color: #7a6212; font-size: 12.5px; line-height: 1.75;
}
.login-note i { color: var(--gold-dark); margin-inline-end: 5px; }

.login-footer { margin-top: 24px; color: var(--text-3); font-size: 12px; }

/* =====================================================================
   التخطيط العام
   ===================================================================== */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    background: var(--black);
    color: #d7d8dd;
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    border-inline-end: 1px solid #1f2024;
}

.sidebar-brand {
    height: var(--topbar-h);
    display: flex; align-items: center; gap: 12px;
    padding: 0 20px;
    border-bottom: 1px solid #1f2024;
    flex-shrink: 0;
}
.sidebar-brand img { width: 40px; height: 40px; object-fit: contain; }
.sidebar-brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.sidebar-brand-text strong { color: #fff; font-size: 16px; font-weight: 800; }
.sidebar-brand-text span { color: var(--gold); font-size: 11.5px; letter-spacing: .5px; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 16px 12px; }
.sidebar-nav ul { list-style: none; display: grid; gap: 3px; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px;
    border-radius: 10px;
    color: #9b9da5;
    font-size: 14px;
    font-weight: 500;
    transition: .18s;
    position: relative;
}
.sidebar-nav a i { width: 19px; text-align: center; font-size: 15px; }
.sidebar-nav a:hover { background: #1a1b1f; color: #e9eaee; }
.sidebar-nav a.active {
    background: linear-gradient(90deg, rgba(201,162,39,.18), rgba(201,162,39,.04));
    color: var(--gold-light);
}
.sidebar-nav a.active::before {
    content: ''; position: absolute;
    inset-inline-start: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 22px; border-radius: 4px; background: var(--gold);
}

.sidebar-footer { padding: 14px 12px; border-top: 1px solid #1f2024; }
.logout-link {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px; border-radius: 10px;
    color: #c9686a; font-weight: 600; transition: .18s;
}
.logout-link:hover { background: rgba(192,57,43,.12); color: #e07f80; }

.sidebar-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.5);
    z-index: 99; display: none;
}
.sidebar-overlay.show { display: block; }

.app-main {
    flex: 1;
    margin-inline-start: var(--sidebar-w);
    display: flex; flex-direction: column;
    min-width: 0;
}

/* =====================================================================
   الشريط العلوي
   ===================================================================== */
.topbar {
    height: var(--topbar-h);
    background: var(--card);
    border-bottom: 1px solid var(--card-line);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px;
    position: sticky; top: 0; z-index: 60;
}
.topbar-right { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar-titles h1 { font-size: 18px; font-weight: 800; line-height: 1.3; }
.topbar-titles span { font-size: 11.5px; color: var(--text-3); }
.topbar-left { display: flex; align-items: center; gap: 10px; }

.icon-btn {
    width: 40px; height: 40px;
    border: 1px solid var(--card-line);
    background: #fafafb;
    border-radius: 10px;
    color: var(--text-2);
    cursor: pointer; position: relative;
    display: inline-flex; align-items: center; justify-content: center;
    transition: .18s;
}
.icon-btn:hover { background: #f0f0f2; color: var(--text); }
.sidebar-toggle { display: none; }

.notif-badge {
    position: absolute; top: -5px; inset-inline-end: -5px;
    background: var(--danger); color: #fff;
    font-size: 10px; font-weight: 700;
    min-width: 18px; height: 18px; padding: 0 4px;
    border-radius: 9px; display: flex; align-items: center; justify-content: center;
}

.user-chip {
    display: flex; align-items: center; gap: 10px;
    background: #fafafb; border: 1px solid var(--card-line);
    border-radius: 10px; padding: 5px 12px 5px 8px;
    cursor: pointer; transition: .18s;
}
.user-chip:hover { background: #f0f0f2; }
.avatar {
    width: 32px; height: 32px; border-radius: 8px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #17181b; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.25; text-align: start; }
.user-meta strong { font-size: 13px; }
.user-meta small { font-size: 11px; color: var(--text-3); }
.user-chip > .fa-chevron-down { font-size: 10px; color: var(--text-3); }

/* Dropdown */
.dropdown { position: relative; }
.dropdown-menu {
    position: absolute; top: calc(100% + 10px); inset-inline-end: 0;
    background: var(--card);
    border: 1px solid var(--card-line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 240px;
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: .16s; z-index: 80; overflow: hidden;
}
.dropdown.open .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }

.dropdown-notifications { width: 340px; }
.dropdown-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 13px 16px; border-bottom: 1px solid var(--card-line);
    font-weight: 700; font-size: 13.5px;
}
.dropdown-header a { color: var(--gold-dark); font-size: 11.5px; font-weight: 600; }
.dropdown-body { max-height: 340px; overflow-y: auto; }

.notif-item {
    display: flex; gap: 12px; padding: 12px 16px;
    border-bottom: 1px solid #f2f2f4; transition: .15s;
}
.notif-item:hover { background: #fafafb; }
.notif-item.unread { background: var(--gold-soft); }
.notif-icon {
    width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
    background: #f2f2f4; color: var(--gold-dark);
    display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.notif-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.notif-text strong { font-size: 13px; }
.notif-text small { font-size: 12px; color: var(--text-2); }
.notif-text em { font-size: 11px; color: var(--text-3); font-style: normal; }

.dropdown-user { min-width: 220px; }
.dropdown-user-head { padding: 14px 16px; border-bottom: 1px solid var(--card-line); }
.dropdown-user-head strong { display: block; font-size: 13.5px; }
.dropdown-user-head small { color: var(--text-3); font-size: 12px; }
.dropdown-user a {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 16px; font-size: 13.5px; transition: .15s;
}
.dropdown-user a:hover { background: #fafafb; }
.dropdown-user a.danger { color: var(--danger); border-top: 1px solid var(--card-line); }
.dropdown-user a i { width: 16px; text-align: center; color: var(--text-3); }
.dropdown-user a.danger i { color: var(--danger); }

.empty-mini { padding: 34px 16px; text-align: center; color: var(--text-3); }
.empty-mini i { font-size: 26px; margin-bottom: 8px; display: block; }
.empty-mini p { font-size: 13px; }

/* =====================================================================
   المحتوى
   ===================================================================== */
.app-content { padding: 24px; flex: 1; }

.app-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--card-line);
    display: flex; justify-content: space-between;
    color: var(--text-3); font-size: 12px;
    background: var(--card);
}

.page-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; margin-bottom: 20px;
}
.page-head h2 { font-size: 20px; font-weight: 800; }
.page-head p { color: var(--text-2); font-size: 13px; }
.page-head-actions { display: flex; gap: 9px; flex-wrap: wrap; }

/* =====================================================================
   الأزرار
   ===================================================================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 9px 17px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 13.5px; font-weight: 600;
    cursor: pointer; transition: .18s; white-space: nowrap;
    background: #fff; color: var(--text);
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-gold { background: linear-gradient(135deg, var(--gold), var(--gold-dark)); color: #16171a; }
.btn-gold:hover { filter: brightness(1.07); box-shadow: 0 6px 18px rgba(201,162,39,.3); }
.btn-dark { background: var(--black-soft); color: #fff; }
.btn-dark:hover { background: #232428; }
.btn-outline { border-color: var(--card-line); background: #fff; color: var(--text-2); }
.btn-outline:hover { border-color: #cfd0d6; color: var(--text); background: #fafafb; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { padding: 12px 22px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { width: 32px; height: 32px; padding: 0; border-radius: 8px; border-color: var(--card-line); background: #fff; color: var(--text-2); }
.btn-icon:hover { background: #f4f4f6; color: var(--text); }
.btn-icon.danger:hover { background: var(--danger-bg); color: var(--danger); border-color: rgba(192,57,43,.25); }

/* =====================================================================
   البطاقات
   ===================================================================== */
.card {
    background: var(--card);
    border: 1px solid var(--card-line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card + .card { margin-top: 20px; }
.card-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap;
    padding: 16px 20px; border-bottom: 1px solid var(--card-line);
}
.card-head h3 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.card-head h3 i { color: var(--gold-dark); }
.card-body { padding: 20px; }
.card-body.p0 { padding: 0; }

/* بطاقات الإحصائيات */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px; margin-bottom: 22px;
}
.stat-card {
    background: var(--card);
    border: 1px solid var(--card-line);
    border-radius: var(--radius);
    padding: 16px 18px;
    display: flex; align-items: center; gap: 14px;
    box-shadow: var(--shadow);
    transition: .2s;
    min-width: 0;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(16,18,22,.09); }
.stat-icon {
    width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 19px;
    background: var(--gold-soft); color: var(--gold-dark);
}
.stat-icon.green  { background: var(--success-bg); color: var(--success); }
.stat-icon.red    { background: var(--danger-bg);  color: var(--danger); }
.stat-icon.blue   { background: var(--info-bg);    color: var(--info); }
.stat-icon.orange { background: var(--warning-bg); color: var(--warning); }
.stat-icon.dark   { background: #ebebed;           color: var(--black-soft); }
.stat-info { min-width: 0; flex: 1; }
.stat-value {
    font-size: 20px; font-weight: 800; line-height: 1.3;
    overflow-wrap: anywhere; word-break: break-word;
}
.stat-label { font-size: 12.5px; color: var(--text-2); }

/* الإجراءات السريعة */
.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.quick-action {
    display: inline-flex; align-items: center; gap: 9px;
    background: var(--card); border: 1px solid var(--card-line);
    border-radius: var(--radius-sm); padding: 11px 16px;
    font-weight: 600; font-size: 13.5px; transition: .18s;
    box-shadow: var(--shadow);
}
.quick-action i { color: var(--gold-dark); }
.quick-action:hover { border-color: var(--gold); background: var(--gold-soft); }

/* =====================================================================
   الجداول
   ===================================================================== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data-table {
    width: 100%;
    min-width: 980px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    table-layout: auto;
}
table.data-table thead th {
    background: #fafafb;
    color: var(--text-2);
    font-weight: 700; font-size: 12px;
    text-align: start;
    padding: 12px 14px;
    border-bottom: 1px solid var(--card-line);
    white-space: nowrap;
    vertical-align: middle;
}
table.data-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f1f3;
    vertical-align: middle;
    white-space: nowrap;
}
table.data-table tbody tr:last-child td { border-bottom: 0; }
table.data-table tbody tr { transition: .13s; }
table.data-table tbody tr:hover { background: #fbfbfc; }
table.data-table .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data-table .actions {
    display: flex; gap: 6px; flex-wrap: nowrap; align-items: center;
}
table.data-table .actions form { display: inline-flex; margin: 0; }
table.data-table th:last-child,
table.data-table td:last-child { width: 1%; white-space: nowrap; }
.cell-main { font-weight: 700; }
.cell-sub { font-size: 11.5px; color: var(--text-3); display: block; }
.text-muted { color: var(--text-3); }
.text-end { text-align: end; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }

/* =====================================================================
   الشارات
   ===================================================================== */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 10px; border-radius: 20px;
    font-size: 11.5px; font-weight: 700; white-space: nowrap;
    border: 1px solid transparent;
}
.badge-new     { background: #eceef3; color: #454a56; }
.badge-info    { background: var(--info-bg);    color: var(--info); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: #a3660b; }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-muted   { background: #f0f0f2; color: var(--text-3); }
.badge-gold    { background: var(--gold-soft); color: var(--gold-dark); border-color: rgba(201,162,39,.3); }
.badge-hot     { background: rgba(214,64,16,.12); color: #b8430f; }
.badge-warm    { background: var(--warning-bg); color: #a3660b; }
.badge-cold    { background: var(--info-bg); color: var(--info); }
.badge-dark    { background: #1f2024; color: #e6c563; }

.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }

/* =====================================================================
   النماذج
   ===================================================================== */
.form-group { margin-bottom: 15px; }
.form-group label,
.form-label {
    display: block; margin-bottom: 6px;
    font-size: 12.5px; font-weight: 600; color: var(--text-2);
}
.form-label .req, label .req { color: var(--danger); }

input[type=text], input[type=tel], input[type=email], input[type=number],
input[type=date], input[type=time], input[type=url], input[type=search],
select, textarea {
    width: 100%;
    max-width: 100%;
    padding: 10px 13px;
    border: 1px solid var(--card-line);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text);
    transition: .16s;
    font-size: 13.5px;
}
input[type=date], input[type=time] {
    min-width: 0;
    direction: ltr;
    text-align: right;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-soft);
}
textarea { resize: vertical; min-height: 92px; }
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b8f98' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    background-size: 15px;
    padding-inline-start: 13px;
    padding-inline-end: 34px;
}

.input-icon { position: relative; }
.input-icon i {
    position: absolute; inset-inline-start: 13px; top: 50%;
    transform: translateY(-50%); color: var(--text-3); font-size: 13px;
}
.input-icon input { padding-inline-start: 38px; }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 16px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.form-grid .full, .form-grid-3 .full { grid-column: 1 / -1; }

.form-actions {
    display: flex; gap: 10px; justify-content: flex-end;
    padding-top: 16px; margin-top: 6px; border-top: 1px solid var(--card-line);
}

/* شريط الفلاتر */
.filters-bar {
    background: var(--card);
    border: 1px solid var(--card-line);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 18px;
    box-shadow: var(--shadow);
}
.filters-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-end;
}
.filters-grid .form-group {
    margin-bottom: 0;
    flex: 0 1 180px;
    width: 180px;
    min-width: 150px;
}
.filters-grid .filter-search {
    flex: 1 1 280px;
    width: auto;
    min-width: 240px;
    max-width: 420px;
}
.filters-actions {
    display: flex !important;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    margin-bottom: 0 !important;
    flex: 0 0 auto;
    width: auto !important;
    min-width: max-content;
}
.filters-actions .btn { flex-shrink: 0; }

@media (max-width: 640px) {
    .filters-grid .form-group,
    .filters-grid .filter-search {
        flex: 1 1 100%;
        width: 100%;
        max-width: none;
    }
}

/* شبكة بطاقات المشروعات */
.project-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}
.project-card {
    background: var(--card);
    border: 1px solid var(--card-line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}
.project-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.project-card-title {
    font-size: 16px;
    font-weight: 800;
    line-height: 1.35;
    margin: 0;
}
.project-card-meta {
    display: grid;
    gap: 6px;
    color: var(--text-2);
    font-size: 13px;
}
.project-card-meta span {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.project-card-meta i {
    width: 16px;
    color: var(--gold-dark);
    text-align: center;
    flex-shrink: 0;
}
.project-card-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--card-line);
}
.project-stat {
    text-align: center;
    background: #fafafb;
    border-radius: 10px;
    padding: 10px 6px;
    min-width: 0;
}
.project-stat strong {
    display: block;
    font-size: 15px;
    font-weight: 800;
    overflow-wrap: anywhere;
}
.project-stat small {
    color: var(--text-3);
    font-size: 11px;
}
.project-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 4px;
}
.project-card-actions .btn { flex: 1 1 auto; }

/* شبكة بطاقات الوحدات */
.unit-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}
.unit-card {
    background: var(--card);
    border: 1px solid var(--card-line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}
.unit-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.unit-card-head h4 {
    font-size: 17px;
    font-weight: 800;
    margin: 0;
}
.unit-card-project {
    color: var(--text-2);
    font-size: 13px;
}
.unit-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.unit-field {
    background: #fafafb;
    border-radius: 10px;
    padding: 10px 12px;
    min-width: 0;
}
.unit-field span {
    display: block;
    font-size: 11px;
    color: var(--text-3);
    margin-bottom: 2px;
}
.unit-field strong {
    font-size: 13.5px;
    font-weight: 700;
    overflow-wrap: anywhere;
}
.unit-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}
.unit-card-actions .btn { flex: 1; }

/* جدول مبيعات أوضح */
table.data-table.sales-table { min-width: 1100px; }
table.data-table.sales-table th,
table.data-table.sales-table td {
    padding: 14px 16px;
}
table.data-table .status-quick-form { margin: 0; min-width: 140px; }
table.data-table .status-select {
    width: 100%;
    min-width: 140px;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 700;
    border: 1px solid var(--card-line);
    background: #fff;
    cursor: pointer;
}
table.data-table .status-select.badge-success { background: var(--success-bg); color: var(--success); border-color: rgba(31,157,99,.25); }
table.data-table .status-select.badge-warning { background: var(--warning-bg); color: #a3660b; border-color: rgba(214,137,16,.25); }
table.data-table .status-select.badge-danger  { background: var(--danger-bg); color: var(--danger); border-color: rgba(192,57,43,.25); }
table.data-table .status-select.badge-info    { background: var(--info-bg); color: var(--info); border-color: rgba(44,111,181,.25); }
table.data-table .status-select.badge-gold    { background: var(--gold-soft); color: var(--gold-dark); border-color: rgba(201,162,39,.3); }
table.data-table .status-select.badge-new,
table.data-table .status-select.badge-muted   { background: #f0f0f2; color: var(--text-2); }

/* بصمة الحضور */
.attendance-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    background: var(--card);
    border: 1px solid var(--card-line);
    border-radius: var(--radius);
    padding: 28px 26px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}
.attendance-hero.is-pending {
    background:
        linear-gradient(135deg, rgba(201,162,39,.10), transparent 55%),
        var(--card);
    border-color: rgba(201,162,39,.35);
}
.attendance-hero.is-done {
    background:
        linear-gradient(135deg, rgba(31,157,99,.08), transparent 55%),
        var(--card);
}
.attendance-clock {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: 1px;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}
.attendance-date { color: var(--text-2); margin-top: 4px; font-size: 14px; }
.attendance-status-line { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.attendance-btn { min-width: 220px; padding: 14px 22px; font-size: 15px; }
.attendance-hero-actions { flex-shrink: 0; }
.attendance-loc { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.attendance-loc a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--gold-dark);
    text-decoration: none;
}
.attendance-loc a:hover { text-decoration: underline; }

/* =====================================================================
   التنبيهات
   ===================================================================== */
.alert {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 13.5px; font-weight: 500;
    border: 1px solid transparent;
    position: relative;
}
.alert-success { background: var(--success-bg); color: #147049; border-color: rgba(31,157,99,.25); }
.alert-danger  { background: var(--danger-bg);  color: #99291d; border-color: rgba(192,57,43,.25); }
.alert-warning { background: var(--warning-bg); color: #8a5709; border-color: rgba(214,137,16,.3); }
.alert-info    { background: var(--info-bg);    color: #21568c; border-color: rgba(44,111,181,.25); }
.alert-close {
    margin-inline-start: auto; background: none; border: 0;
    font-size: 19px; line-height: 1; cursor: pointer; color: inherit; opacity: .6;
}
.alert-close:hover { opacity: 1; }
.alert ul { margin: 0; padding-inline-start: 18px; }

/* =====================================================================
   Modal
   ===================================================================== */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(10,10,12,.6);
    backdrop-filter: blur(2px);
    display: none;
    align-items: flex-start; justify-content: center;
    z-index: 200; padding: 30px 16px; overflow-y: auto;
}
.modal-backdrop.show { display: flex; }
.modal {
    background: var(--card);
    border-radius: 16px;
    width: 100%; max-width: 680px;
    box-shadow: var(--shadow-lg);
    animation: modalIn .22s ease;
    margin: auto;
}
.modal.modal-sm { max-width: 460px; }
.modal.modal-lg { max-width: 880px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(-14px) scale(.985); } to { opacity: 1; transform: none; } }

.modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 17px 22px; border-bottom: 1px solid var(--card-line);
}
.modal-head h3 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.modal-head h3 i { color: var(--gold-dark); }
.modal-close {
    background: none; border: 0; font-size: 22px; line-height: 1;
    color: var(--text-3); cursor: pointer; padding: 0 4px;
}
.modal-close:hover { color: var(--danger); }
.modal-body { padding: 22px; }
.modal-foot {
    display: flex; gap: 10px; justify-content: flex-end;
    padding: 15px 22px; border-top: 1px solid var(--card-line);
    background: #fafafb; border-radius: 0 0 16px 16px;
}

/* =====================================================================
   الحالات الفارغة والتحميل
   ===================================================================== */
.empty-state { padding: 60px 20px; text-align: center; }
.empty-state .empty-icon {
    width: 74px; height: 74px; margin: 0 auto 16px;
    border-radius: 50%; background: #f4f4f6;
    display: flex; align-items: center; justify-content: center;
    font-size: 27px; color: var(--text-3);
}
.empty-state h4 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.empty-state p { color: var(--text-2); font-size: 13.5px; margin-bottom: 16px; }

.state-page {
    min-height: 100vh; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 14px;
    color: #d7d8dd; text-align: center; padding: 24px;
}
.state-page i { font-size: 52px; color: var(--gold); }
.state-page h1 { color: #fff; font-size: 26px; }
.state-page p { color: #9a9ca4; }

.loading-overlay {
    position: fixed; inset: 0; background: rgba(255,255,255,.65);
    display: none; align-items: center; justify-content: center; z-index: 300;
}
.loading-overlay.show { display: flex; }
.spinner {
    width: 40px; height: 40px; border-radius: 50%;
    border: 3px solid var(--card-line); border-top-color: var(--gold);
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
    content: ''; position: absolute; width: 15px; height: 15px;
    border-radius: 50%; border: 2px solid rgba(0,0,0,.25); border-top-color: #000;
    animation: spin .7s linear infinite;
}

/* =====================================================================
   Toast
   ===================================================================== */
.toast-container {
    position: fixed; bottom: 22px; inset-inline-end: 22px;
    display: flex; flex-direction: column; gap: 10px; z-index: 400;
}
.toast {
    background: var(--black-soft); color: #fff;
    border-radius: var(--radius-sm);
    padding: 13px 17px;
    min-width: 250px; max-width: 360px;
    display: flex; align-items: center; gap: 11px;
    box-shadow: var(--shadow-lg);
    font-size: 13.5px;
    border-inline-start: 3px solid var(--gold);
    animation: toastIn .25s ease;
}
.toast.success { border-inline-start-color: var(--success); }
.toast.danger  { border-inline-start-color: var(--danger); }
.toast.warning { border-inline-start-color: var(--warning); }
.toast i { font-size: 15px; color: var(--gold); }
.toast.success i { color: #45d295; }
.toast.danger i  { color: #ef8378; }
.toast.warning i { color: #f0b25a; }
.toast.hide { animation: toastOut .25s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(-20px); } }

/* =====================================================================
   الترقيم
   ===================================================================== */
.pagination {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap;
    padding: 14px 18px; border-top: 1px solid var(--card-line);
}
.pagination ul { list-style: none; display: flex; gap: 5px; }
.pagination li a {
    min-width: 34px; height: 34px; padding: 0 9px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--card-line);
    border-radius: 8px; font-size: 13px; font-weight: 600;
    color: var(--text-2); transition: .15s;
}
.pagination li a:hover { border-color: var(--gold); color: var(--gold-dark); }
.pagination li.active a { background: var(--black-soft); border-color: var(--black-soft); color: var(--gold); }
.pagination li.disabled a { opacity: .4; pointer-events: none; }
.pagination li.dots span { padding: 0 6px; color: var(--text-3); }
.pagination-info { font-size: 12px; color: var(--text-3); }

/* =====================================================================
   تفاصيل العميل / Timeline
   ===================================================================== */
.detail-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 20px; align-items: start; }

.profile-head {
    background: linear-gradient(135deg, #131417 0%, #1d1e22 100%);
    border-radius: var(--radius);
    padding: 24px;
    color: #fff;
    display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
    margin-bottom: 20px;
    position: relative; overflow: hidden;
}
.profile-head::after {
    content: ''; position: absolute; inset-inline-end: -70px; top: -70px;
    width: 220px; height: 220px; border-radius: 50%;
    background: radial-gradient(circle, rgba(201,162,39,.16), transparent 70%);
}
.profile-avatar {
    width: 64px; height: 64px; border-radius: 16px; flex-shrink: 0;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #16171a; font-size: 25px; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
}
.profile-info { min-width: 0; position: relative; z-index: 1; }
.profile-info h2 { font-size: 21px; font-weight: 800; }
.profile-tags { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.profile-actions { margin-inline-start: auto; display: flex; gap: 9px; flex-wrap: wrap; position: relative; z-index: 1; }

.info-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 2px 20px; }
.info-item { padding: 10px 0; border-bottom: 1px dashed #eeeef0; }
.info-item .k { font-size: 11.5px; color: var(--text-3); display: block; }
.info-item .v { font-size: 13.5px; font-weight: 600; }

.timeline { position: relative; padding-inline-start: 26px; }
.timeline::before {
    content: ''; position: absolute;
    inset-inline-start: 7px; top: 6px; bottom: 6px;
    width: 2px; background: linear-gradient(var(--gold), #eeeef0);
}
.timeline-item { position: relative; padding-bottom: 20px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
    content: ''; position: absolute;
    inset-inline-start: -25px; top: 5px;
    width: 14px; height: 14px; border-radius: 50%;
    background: #fff; border: 3px solid var(--gold);
}
.timeline-item.type-create::before  { border-color: var(--success); }
.timeline-item.type-viewing::before { border-color: var(--info); }
.timeline-item.type-status::before  { border-color: var(--warning); }
.timeline-item.type-transfer::before{ border-color: #7d5fb2; }
.timeline-time { font-size: 11.5px; color: var(--text-3); }
.timeline-title { font-weight: 700; font-size: 13.5px; margin-top: 1px; }
.timeline-notes {
    margin-top: 6px; background: #fafafb;
    border: 1px solid #f0f0f2; border-inline-start: 3px solid var(--gold);
    border-radius: 8px; padding: 9px 12px;
    font-size: 12.5px; color: var(--text-2); white-space: pre-line;
}
.timeline-user { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }
.timeline-user i { color: var(--gold-dark); }

/* شريط مراحل البيع */
.pipeline { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.pipeline-step {
    flex: 1; min-width: 78px; text-align: center;
    padding: 8px 6px; border-radius: 8px;
    background: #f4f4f6; color: var(--text-3);
    font-size: 11.5px; font-weight: 600;
    border: 1px solid transparent;
}
.pipeline-step.done { background: var(--gold-soft); color: var(--gold-dark); border-color: rgba(201,162,39,.3); }
.pipeline-step.current { background: var(--black-soft); color: var(--gold); }

/* جدول الأداء */
.progress-bar-mini {
    height: 6px; background: #f0f0f2; border-radius: 5px; overflow: hidden; min-width: 70px;
}
.progress-bar-mini span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-dark), var(--gold)); }

/* شبكة التقارير */
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.bar-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.bar-row .bar-label { min-width: 120px; font-size: 12.5px; font-weight: 600; }
.bar-row .bar-track { flex: 1; height: 9px; background: #f0f0f2; border-radius: 6px; overflow: hidden; }
.bar-row .bar-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--gold-dark), var(--gold-light)); }
.bar-row .bar-value { min-width: 44px; text-align: end; font-size: 12.5px; font-weight: 700; }

.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.mini-stat {
    background: #fafafb; border: 1px solid var(--card-line);
    border-radius: var(--radius-sm); padding: 14px; text-align: center;
}
.mini-stat strong { display: block; font-size: 20px; font-weight: 800; }
.mini-stat span { font-size: 12px; color: var(--text-2); }

.section-title {
    font-size: 15px; font-weight: 700;
    margin: 24px 0 12px; display: flex; align-items: center; gap: 9px;
}
.section-title i { color: var(--gold-dark); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--card-line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs a {
    padding: 10px 16px; font-size: 13.5px; font-weight: 600;
    color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a.active { color: var(--gold-dark); border-bottom-color: var(--gold); }
.tabs a:hover { color: var(--text); }

.divider { height: 1px; background: var(--card-line); margin: 18px 0; }

/* =====================================================================
   شريط تنقل الموبايل (شكل تطبيق)
   ===================================================================== */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 120;
    background: #0f1012;
    border-top: 1px solid #24262b;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    grid-template-columns: repeat(5, 1fr);
    gap: 2px;
    box-shadow: 0 -8px 30px rgba(0,0,0,.25);
}
.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 52px;
    padding: 6px 4px;
    border: 0;
    background: transparent;
    color: #8b8f98;
    font-family: inherit;
    font-size: 10.5px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 12px;
    cursor: pointer;
    transition: .15s;
    -webkit-tap-highlight-color: transparent;
}
.mobile-nav-item i { font-size: 18px; }
.mobile-nav-item.active,
.mobile-nav-item:active {
    color: var(--gold-light);
    background: rgba(201,162,39,.12);
}

.privacy-note {
    display: flex; align-items: flex-start; gap: 10px;
    background: var(--gold-soft);
    border: 1px solid rgba(201,162,39,.28);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #7a6212;
    line-height: 1.7;
}
.privacy-note i { color: var(--gold-dark); margin-top: 3px; }

/* =====================================================================
   الاستجابة للشاشات — جاهز للتطبيق
   ===================================================================== */
@media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .project-cards,
    .unit-cards { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

@media (max-width: 1100px) {
    .detail-grid { grid-template-columns: 1fr; }
    .login-wrapper { grid-template-columns: 1fr; }
    .login-visual { display: none; }
    .login-card-logo { display: block; }
    .report-grid { grid-template-columns: 1fr; }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(100%);
        transition: transform .28s cubic-bezier(.2,.8,.2,1);
        width: min(300px, 86vw);
        box-shadow: -12px 0 40px rgba(0,0,0,.35);
    }
    html[dir="rtl"] .sidebar { transform: translateX(100%); }
    html[dir="ltr"] .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0) !important; }
    .app-main { margin-inline-start: 0; }
    .sidebar-toggle { display: inline-flex; }
    .form-grid-3 { grid-template-columns: repeat(2, 1fr); }

    .mobile-bottom-nav { display: grid; }
    .app-content {
        padding-bottom: calc(88px + env(safe-area-inset-bottom)) !important;
    }
    .app-footer { display: none; }
    .toast-container {
        bottom: calc(78px + env(safe-area-inset-bottom));
    }
}

@media (max-width: 768px) {
    :root { --topbar-h: 60px; }

    body {
        overscroll-behavior-y: none;
        -webkit-tap-highlight-color: transparent;
    }

    .app-content { padding: 14px 14px calc(88px + env(safe-area-inset-bottom)); }
    .topbar {
        padding: 0 12px;
        padding-top: env(safe-area-inset-top);
        height: calc(var(--topbar-h) + env(safe-area-inset-top));
    }
    .topbar-titles h1 { font-size: 15px; }
    .topbar-titles span { display: none; }
    .user-meta { display: none; }
    .user-chip { padding: 4px; border-radius: 10px; }
    .user-chip > .fa-chevron-down { display: none; }

    .page-head {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 14px;
    }
    .page-head h2 { font-size: 18px; }
    .page-head-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .page-head-actions .btn {
        width: 100%;
        min-height: 44px;
        justify-content: center;
    }
    .page-head-actions .btn:only-child,
    .page-head-actions .btn:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-bottom: 14px;
    }
    .stat-card {
        padding: 12px;
        gap: 10px;
        border-radius: 12px;
    }
    .stat-icon { width: 38px; height: 38px; font-size: 15px; border-radius: 10px; }
    .stat-value { font-size: 16px; }
    .stat-label { font-size: 11.5px; }

    .filters-bar {
        padding: 14px;
        margin-bottom: 14px;
        border-radius: 12px;
    }
    .filters-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .filters-grid .form-group,
    .filters-grid .filter-search {
        width: 100% !important;
        max-width: none !important;
        flex: none !important;
        min-width: 0 !important;
    }
    .filters-grid .filter-search { grid-column: 1 / -1; }
    .filters-actions {
        grid-column: 1 / -1;
        width: 100% !important;
    }
    .filters-actions .btn { flex: 1; min-height: 44px; }

    .card { border-radius: 12px; }
    .card-head, .card-body { padding: 14px; }
    .card-body.p0 { padding: 0; }

    .table-wrap {
        margin-inline: -1px;
        border-radius: 0 0 12px 12px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    table.data-table {
        min-width: 720px;
        font-size: 12.5px;
    }
    table.data-table thead th,
    table.data-table tbody td {
        padding: 11px 12px;
    }
    table.data-table .status-select {
        min-width: 120px;
        min-height: 40px;
        font-size: 12px;
    }

    .btn, .icon-btn, .quick-action {
        min-height: 44px;
    }
    .btn-icon { width: 40px; height: 40px; min-height: 40px; }
    .quick-actions { gap: 8px; margin-bottom: 14px; }
    .quick-action {
        flex: 1 1 calc(50% - 8px);
        justify-content: center;
        padding: 12px 10px;
        font-size: 12.5px;
    }

    .project-cards,
    .unit-cards {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .attendance-hero {
        flex-direction: column;
        align-items: stretch;
        padding: 20px 16px;
        text-align: center;
    }
    .attendance-clock { font-size: 32px; }
    .attendance-hero-actions,
    .attendance-btn { width: 100%; }
    .attendance-status-line { justify-content: center; }

    .modal-backdrop {
        padding: 0;
        align-items: flex-end;
    }
    .modal {
        max-width: none;
        width: 100%;
        margin: 0;
        border-radius: 18px 18px 0 0;
        max-height: min(92vh, 920px);
        display: flex;
        flex-direction: column;
        animation: sheetUp .28s ease;
    }
    .modal.modal-lg, .modal.modal-sm { max-width: none; }
    @keyframes sheetUp {
        from { transform: translateY(40px); opacity: .6; }
        to { transform: none; opacity: 1; }
    }
    .modal-body {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 16px;
    }
    .modal-head, .modal-foot { padding: 14px 16px; }
    .modal-foot {
        padding-bottom: calc(14px + env(safe-area-inset-bottom));
    }
    .modal-foot .btn { flex: 1; min-height: 46px; }

    .dropdown-notifications {
        width: min(100vw - 24px, 360px);
        inset-inline-end: -8px;
    }
    .profile-head { flex-direction: column; align-items: flex-start; }
    .profile-actions { margin-inline-start: 0; width: 100%; }
    .pipeline-step { min-width: calc(50% - 6px); }
    .info-list { grid-template-columns: 1fr; }
    .bar-row { flex-wrap: wrap; }
    .bar-row .bar-label { min-width: 100%; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat-value { font-size: 15px; }
    .page-head-actions { grid-template-columns: 1fr; }
    .login-card { padding: 28px 20px; border-radius: 16px; }
    .login-panel { padding: 24px 16px; }
    .toast-container { inset-inline: 12px; }
    .toast { min-width: 0; max-width: none; }
    .mobile-nav-item span { font-size: 10px; }
}

/* تابلت بالعرض */
@media (min-width: 769px) and (max-width: 1100px) {
    .app-content { padding: 20px; }
    .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .project-cards,
    .unit-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media print {
    .sidebar, .topbar, .app-footer, .page-head-actions, .filters-bar,
    .pagination, .mobile-bottom-nav { display: none !important; }
    .app-main { margin: 0; }
    body { background: #fff; }
    .card { box-shadow: none; border-color: #ddd; }
    .app-content { padding: 0 !important; }
}
