/* app.css — إضافات النسخة الأونلاين فوق board.css (بنفس ألوان وخطوط اللوحة القديمة) */

[hidden] { display: none !important; }

/* المستخدم في الهيدر */
.user-block { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 700; color: var(--text-muted); }
.user-block .user-name { color: var(--primary-dark); font-weight: 800; }
.role-pill { display: inline-block; padding: 3px 10px; border-radius: 12px; background: var(--primary-light); color: var(--primary-dark); font-size: 11px; font-weight: 800; border: 1px solid #b9d0e8; }

/* التنقل بين الشاشات */
.app-nav { max-width: 1400px; width: 100%; margin: 0 auto 18px; padding: 0 32px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.app-nav button { cursor: pointer; padding: 8px 16px; border-radius: 8px; background: white; border: 1px solid var(--border-heavy); color: var(--primary-dark); font-family: inherit; font-size: 13px; font-weight: 800; }
.app-nav button:hover { background: var(--primary-light); }
.app-nav button.active { background: var(--primary-dark); color: white; border-color: var(--primary-dark); box-shadow: inset 0 -3px 0 var(--accent-gold); }

/* الدخول والحالات الخاصة */
.auth-panel { max-width: 420px; margin: 30px auto; padding: 26px 28px; display: flex; flex-direction: column; gap: 14px; }
.center-note { text-align: center; padding: 40px 20px; color: var(--text-muted); font-weight: 700; font-size: 14px; }
.center-note .btn { margin-top: 14px; }

/* النماذج */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 14px; padding: 18px; }
.field label { display: block; font-size: 11px; font-weight: 800; color: var(--text-muted); margin-bottom: 5px; letter-spacing: 0.02em; }
.field input:not([type=checkbox]), .field select, .field textarea {
    width: 100%; padding: 8px 10px; border: 1px solid var(--border-heavy); border-radius: 6px; font-family: inherit;
    font-size: 13px; font-weight: 700; color: var(--primary-dark); background: white; }
.field input:focus, .field select:focus, .field textarea:focus, .inp:focus { outline: 2px solid var(--accent-gold-light); border-color: var(--accent-gold); }
.field.wide { grid-column: 1 / -1; }
.field .hint { font-size: 11px; color: var(--text-muted); margin-top: 5px; line-height: 1.6; font-weight: 600; }
.bad { color: var(--cut) !important; font-weight: 800; }
.form-actions { display: flex; gap: 8px; padding: 0 18px 18px; align-items: center; flex-wrap: wrap; }
.btn[disabled] { opacity: 0.55; cursor: progress; }
.btn.small { padding: 3px 9px; font-size: 11px; }
.btn.primary.small { padding: 3px 9px; }
.block-title { font-size: 15px; font-weight: 900; color: var(--primary-dark); padding: 16px 18px 0; }
.block-sub { font-size: 12px; color: var(--text-muted); padding: 4px 18px 0; line-height: 1.7; }
.ro-val.big { font-size: 16px; padding: 6px 12px; color: var(--primary-dark); }

.msg { padding: 9px 14px; border-radius: 6px; font-size: 12px; font-weight: 700; margin: 0 18px 14px; line-height: 1.6; }
.msg.error { background: #fdecea; color: #9b2c1f; border: 1px solid #f1c4bf; }
.msg.ok { background: #e6f4ea; color: #1e7b45; border: 1px solid #b7dfc3; }
.msg.warn { background: #fdf0e3; color: #9a5b12; border: 1px solid #f0d2a8; margin: 0 0 14px; }

/* الجداول */
.list-wrap { max-height: 70vh; overflow: auto; }
table.list { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
table.list th { position: sticky; top: 0; z-index: 2; background: var(--primary-dark); color: white; font-size: 11px; font-weight: 800; padding: 8px 8px; text-align: right; white-space: nowrap; border-bottom: 2px solid var(--accent-gold); }
table.list td { padding: 7px 8px; border-bottom: 1px solid var(--border-light); vertical-align: top; }
table.list tr:hover td { background: #f8fafc; }
table.list td.num, table.list td.sta { direction: ltr; text-align: right; white-space: nowrap; font-weight: 700; }
table.list td.actions { white-space: nowrap; }
table.list td.notes { max-width: 280px; color: var(--text-muted); }
table.list .inp { width: 90px; }
table.list td.center-note { padding: 26px; }

.status { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.status.s1 { background: #f6ecd6; color: #7a5a1c; }
.status.s2 { background: #e0f1e7; color: #1e7b45; }
.status.s3 { background: #fdecea; color: #9b2c1f; }

/* علامة الكميات المبدئية (سماكة رصف افتراضية) */
.prov { display: inline-block; margin: 0 4px; padding: 0 6px; border-radius: 8px; background: #fdf0e3; color: #9a5b12;
    font-size: 9.5px; font-weight: 900; vertical-align: middle; border: 1px dashed #e0a458; line-height: 1.6; direction: rtl; white-space: nowrap; }
.prov-banner { grid-column: 1 / -1; background: #fdf0e3; border: 1px dashed #e0a458; color: #7a4a0c; border-radius: 8px;
    padding: 8px 12px; font-size: 12px; font-weight: 700; line-height: 1.7; }

.impact { font-size: 11px; color: var(--text-muted); font-weight: 700; line-height: 1.7; }

/* نقص بيانات الرفع: الكمية أقل من الحقيقية */
.survey-gap { display: inline-block; margin: 0 6px; padding: 0 7px; border-radius: 8px; background: #fdecea; color: #9b2c1f;
    font-size: 9.5px; font-weight: 900; vertical-align: middle; border: 1px solid #f1c4bf; line-height: 1.7; white-space: nowrap; cursor: help; }
.survey-banner { grid-column: 1 / -1; background: #fdecea; border: 1px solid #f1c4bf; color: #7b2318; border-radius: 8px;
    padding: 8px 12px; font-size: 12px; font-weight: 700; line-height: 1.7; text-align: right; cursor: help; }

/* أقصى نسبة إنجاز ممكنة بطريقة الحساب (لو أقل من 100٪) */
small.cap { display: block; font-size: 10px; color: var(--text-muted); font-weight: 800; margin-top: 2px; cursor: help; white-space: nowrap; }
.stat-sub.cap { color: #7a5a1c; font-weight: 800; cursor: help; }
.cap-inline { color: #7a5a1c; font-weight: 800; cursor: help; }
.impact b { color: var(--primary-dark); }

/* سجل التدقيق */
.audit-diff { font-size: 12px; line-height: 1.8; }
.audit-diff b { color: var(--primary-dark); }
.audit-diff .old { color: #9b2c1f; text-decoration: line-through; unicode-bidi: isolate; }
.audit-diff .new { color: #1e7b45; font-weight: 800; unicode-bidi: isolate; }
.actor-system { color: var(--text-muted); font-style: italic; }

@media (max-width: 768px) {
    .app-nav { padding: 0 14px; }
    .user-block .user-email { display: none; }
    .form-grid { grid-template-columns: 1fr; }
}
@media print {
    .app-nav, .user-block { display: none !important; }
}
