/* ===== الصفحات ===== */

/* ---------- شاشة البدء — لوحة أم توليدية ---------- */
.splash { position: fixed; inset: 0; z-index: 100; overflow: hidden; background: var(--bg); color: var(--ink); }
.splash canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.splash-cpu { position: absolute; left: 50%; top: calc(50% - 44px); width: min(46vmin, 260px); aspect-ratio: 1; transform: translate(-50%, -50%); display: grid; place-items: center; background: #151716; border: 2px solid #2B2E2C; border-radius: 6px; box-shadow: 0 0 0 6px #0A2E24, 0 0 0 7px #1B5A47, 0 0 60px rgba(227, 195, 99, 0); transition: box-shadow 1.2s ease; }
.splash-cpu.awake { box-shadow: 0 0 0 6px #0A2E24, 0 0 0 7px #1B5A47, 0 0 90px rgba(227, 195, 99, .28); }
.splash-cpu::before { content: ''; position: absolute; inset: -14px; border-radius: 8px; pointer-events: none; opacity: .8; background: repeating-linear-gradient(90deg, #8E948F 0 3px, transparent 3px 9px) center top / calc(100% - 28px) 8px no-repeat, repeating-linear-gradient(90deg, #8E948F 0 3px, transparent 3px 9px) center bottom / calc(100% - 28px) 8px no-repeat, repeating-linear-gradient(180deg, #8E948F 0 3px, transparent 3px 9px) left center / 8px calc(100% - 28px) no-repeat, repeating-linear-gradient(180deg, #8E948F 0 3px, transparent 3px 9px) right center / 8px calc(100% - 28px) no-repeat; }
.motherboard-mark { width: 58%; height: 58%; background: var(--accent); -webkit-mask: url('/img/logo-c.svg') center / contain no-repeat; mask: url('/img/logo-c.svg') center / contain no-repeat; opacity: 0; transform: scale(.92); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .8, .2, 1); }
.splash-cpu.awake .motherboard-mark { opacity: 1; transform: none; }
.splash-pin { position: absolute; inset-inline-start: 10px; inset-block-start: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.splash-led { position: absolute; inset-inline-end: 12px; inset-block-end: 12px; width: 6px; height: 6px; border-radius: 50%; background: #3A1F1F; transition: background .3s, box-shadow .3s; }
.splash-cpu.awake .splash-led { background: #E6553F; box-shadow: 0 0 8px #E6553F; }
.splash-title { position: absolute; left: 50%; top: calc(50% + min(23vmin, 130px) - 10px); transform: translateX(-50%); width: min(calc(100% - 48px), 560px); text-align: center; opacity: 0; transition: opacity .9s ease .3s; }
.splash-title.show { opacity: 1; }
.splash-title h1 { color: #FFFFFF; font-family: var(--font-display); font-size: clamp(23px, 3.6vmin, 36px); font-weight: 700; line-height: 1.28; }
.splash-sub { color: var(--ink-3); font-size: clamp(14px, 1.8vmin, 17px); line-height: 1.45; margin-top: 6px; }
.splash-bar { position: absolute; left: 50%; top: calc(50% + min(23vmin, 130px) + 98px); width: 220px; height: 2px; overflow: hidden; transform: translateX(-50%); background: rgba(255, 255, 255, .12); border-radius: 2px; }
.splash-bar i { display: block; width: 0; height: 100%; background: var(--accent); transition: width .2s linear; }
.splash.leave { animation: splash-fade-out .5s ease forwards; pointer-events: none; }
@keyframes splash-fade-out { to { opacity: 0; visibility: hidden; } }

/* ---------- تسجيل الدخول ---------- */
.login { position: relative; isolation: isolate; min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); overflow: hidden; }
.login .board-stage { opacity: calc(var(--board-opacity) + .08); }
.login-card { position: relative; z-index: 1; width: min(440px, 100%); background: #151716; border: 1px solid #2B2E2C; border-radius: 6px; padding: 40px; display: flex; flex-direction: column; gap: 20px; overflow: hidden; }
.login-card::before { content: ''; position: absolute; inset-inline-end: 36px; inset-block-start: -1px; width: 64px; height: 3px; background: var(--accent); }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand .brand-mark { width: 44px; height: 44px; }
.login-brand h1 { font-size: var(--fs-17); }
.login-brand p { font-size: var(--fs-13); color: var(--ink-3); }
.login form { display: flex; flex-direction: column; gap: 16px; }
.login .btn { height: 42px; }
.login-foot { font-size: var(--fs-12); color: var(--ink-3); text-align: center; }

/* ---------- الرئيسية ---------- */
/* البنية: فترة ← أرقام ← فريق ← ثلاثة رسوم واضحة. */
.dashboard-page { display: flex; flex-direction: column; gap: var(--page-gap); }
.period-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.period-heading { font-size: var(--fs-20); font-weight: 600; min-width: 172px; text-align: center; font-variant-numeric: tabular-nums; line-height: 1.2; }
.updated { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-12); color: var(--ink-3); }
.updated svg { width: 14px; height: 14px; }
.dashboard-toolbar { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.dashboard-toolbar::after { content: ''; position: absolute; inset-block-end: -1px; inset-inline-end: 0; width: 86px; height: 3px; background: var(--accent); }
.dashboard-toolbar .toolbar-group { gap: 10px; }

.dashboard-figures .figure { position: relative; padding-block: 16px 14px; }
.dashboard-figures .figure::before { content: ''; width: 7px; height: 7px; border-radius: 2px; background: var(--c-cases); position: absolute; inset-block-start: 12px; inset-inline-end: 18px; }
.dashboard-figures .figure:nth-child(2)::before { background: var(--c-exhibits); }
.dashboard-figures .figure:nth-child(3)::before { background: var(--c-audits); }
.dashboard-figures .figure:nth-child(4)::before { background: var(--accent); }
.dashboard-figures .figure-label { padding-inline-end: 13px; }
.dashboard-figures .figure-note { margin-top: 6px; display: flex; min-height: 20px; align-items: center; }
.dashboard-figures .figure-value { margin-top: 2px; }

.dashboard-team .panel-head { padding-block: 13px; }
.dashboard-team table.data th { background: var(--surface-2); }
.dashboard-team-foot { align-items: center; }
.dashboard-team-foot .ops-note { color: var(--ink-3); }
.dashboard-charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); align-items: start; }
.dashboard-charts.has-photography { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dashboard-chart { min-width: 0; border-top: 3px solid var(--c-cases); }
.dashboard-chart:nth-child(2) { border-top-color: var(--c-exhibits); }
.dashboard-chart:nth-child(3) { border-top-color: var(--c-audits); }
.dashboard-chart:nth-child(4) { border-top-color: var(--c-photography); }
.dashboard-chart .panel-head { min-height: 78px; }
.dashboard-chart .bars { padding-block: 12px 16px; }
.dashboard-exhibit-types { min-width: 0; }
.exhibit-types-card { border-top: 3px solid var(--c-exhibits); }
.exhibit-kind-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 var(--space-5); padding: 12px 20px 16px; }
.exhibit-kind { display: grid; grid-template-columns: minmax(82px, 1fr) minmax(54px, 1.3fr) auto; align-items: center; gap: 9px; min-height: 46px; border-top: 1px solid var(--line-2); font-size: var(--fs-13); }
.exhibit-kind:nth-child(-n+3) { border-top: 0; }
.exhibit-kind-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-weight: 600; direction: ltr; text-align: right; }
.exhibit-kind-value { min-width: 2ch; text-align: left; font-variant-numeric: tabular-nums; }

/* ---------- الملف الشخصي ---------- */
.profile-page { display: flex; flex-direction: column; gap: var(--page-gap); }
.profile-identity-body { display: flex; align-items: center; gap: 14px; min-height: 92px; }
.profile-avatar { display: grid; place-items: center; width: 54px; height: 54px; flex: none; border: 1px solid var(--line); border-radius: 50%; background: var(--accent-soft); color: var(--accent-soft-ink); font-family: var(--font-display); font-size: var(--fs-24); font-weight: 700; }
.profile-identity-copy { min-width: 0; }
.profile-kicker { color: var(--ink-3); font-size: var(--fs-12); font-weight: 500; }
.profile-identity-copy h2 { margin-top: 2px; font-size: var(--fs-20); font-weight: 600; }
.profile-identity-copy p, .profile-toolbar p { margin-top: 3px; color: var(--ink-2); font-size: var(--fs-13); }
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-inline-start: auto; }
.profile-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.profile-toolbar h2 { font-size: var(--fs-20); font-weight: 600; }
.profile-work-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.profile-list { display: flex; flex-direction: column; }
.profile-list-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-2); color: inherit; font-size: var(--fs-13); }
.profile-list-item:first-child { border-top: 0; padding-top: 0; }
a.profile-list-item:hover { color: var(--accent); text-decoration: none; }
.profile-list-item > span:first-child { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.profile-list-item b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-list-item small, .profile-list-item > span:last-child { color: var(--ink-3); font-size: var(--fs-12); }
.profile-list-item > span:last-child { flex: none; white-space: nowrap; }
.compact-empty { min-height: 130px; }

/* ---------- مساعد الإنتاجية المحلي ---------- */
.assistant-page { display: flex; flex-direction: column; gap: var(--page-gap); }
.assistant-intro-body { display: flex; align-items: center; gap: 14px; }
.assistant-intro-mark { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-soft-ink); }
.assistant-intro-mark svg { width: 22px; height: 22px; }
.assistant-intro h2, .assistant-toolbar h2 { font-size: var(--fs-20); font-weight: 600; }
.assistant-intro p, .assistant-toolbar p { margin-top: 3px; color: var(--ink-2); font-size: var(--fs-13); }
.assistant-intro .pill { margin-inline-start: auto; }
.assistant-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.assistant-messages { display: flex; flex-direction: column; gap: 10px; min-height: 260px; max-height: 460px; overflow: auto; padding: var(--space-4) 20px; background: var(--surface-2); }
.assistant-message { max-width: min(82%, 680px); padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.assistant-message.is-user { align-self: flex-start; border-color: transparent; background: var(--accent-soft); color: var(--accent-soft-ink); }
.assistant-message.is-assistant { align-self: flex-end; }
.assistant-message-label { display: block; margin-bottom: 3px; color: var(--ink-3); font-size: var(--fs-12); font-weight: 600; }
.assistant-message.is-user .assistant-message-label { color: inherit; opacity: .72; }
.assistant-message p { margin: 0; white-space: pre-wrap; font-size: var(--fs-14); line-height: 1.7; }
.assistant-thinking { display: inline-flex; align-items: center; align-self: flex-end; gap: 7px; color: var(--ink-3); font-size: var(--fs-13); }
.assistant-thinking svg { width: 15px; height: 15px; }
.assistant-questions { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line-2); }
.assistant-suggestion { white-space: normal; text-align: start; }
.assistant-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; padding: 14px 20px 16px; border-top: 1px solid var(--line-2); }
.assistant-form .field { margin: 0; }
.assistant-form .btn { min-height: var(--control-h); }

/* تكيّف الرئيسية (هذا الملف يأتي بعد layout.css). */
@media (max-width: 1099px) {
  .dashboard-charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-chart:last-child { grid-column: 1 / -1; }
  .dashboard-charts.has-photography .dashboard-chart:last-child { grid-column: auto; }
  .exhibit-kind-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exhibit-kind:nth-child(-n+3) { border-top: 1px solid var(--line-2); }
  .exhibit-kind:nth-child(-n+2) { border-top: 0; }
}
@media (max-width: 719px) {
  .dashboard-toolbar .updated { width: 100%; }
  .dashboard-charts { grid-template-columns: minmax(0, 1fr); }
  .dashboard-chart:last-child { grid-column: auto; }
  .exhibit-kind-grid { grid-template-columns: 1fr; }
  .exhibit-kind:nth-child(-n+2) { border-top: 1px solid var(--line-2); }
  .exhibit-kind:first-child { border-top: 0; }
}
@media (max-width: 719px) { .profile-identity-body, .profile-toolbar { align-items: flex-start; flex-direction: column; } .profile-actions { margin-inline-start: 0; } .profile-work-grid { grid-template-columns: 1fr; } }
@media (max-width: 719px) { .assistant-intro-body, .assistant-toolbar { align-items: flex-start; flex-direction: column; } .assistant-intro .pill { margin-inline-start: 0; } .assistant-message { max-width: 100%; } .assistant-form { grid-template-columns: 1fr; } }

/* ---------- الملخص السنوي ---------- */
.month-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.month-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px 10px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; text-align: right; color: inherit; font: inherit; transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease); }
.month-card:hover { border-color: var(--accent); background: var(--surface-2); }
.month-card.empty-month { opacity: .55; }
.month-card.empty-month:hover { opacity: 1; }
.month-head { display: flex; justify-content: space-between; align-items: center; }
.month-name { font-weight: 600; font-size: var(--fs-14); }
.month-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.month-nums.four { grid-template-columns: repeat(4, 1fr); }
.mn { display: flex; flex-direction: column; }
.mn b { font-size: var(--fs-20); font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.mn span { font-size: var(--fs-12); color: var(--ink-3); display: flex; align-items: center; gap: 4px; }
.mn span::before { content: ''; width: 6px; height: 6px; border-radius: 2px; background: var(--c-cases); }
.mn.exhibits span::before { background: var(--c-exhibits); }
.mn.audits span::before { background: var(--c-audits); }
.mn.photography span::before { background: var(--c-photography); }

.totals-split { display: grid; grid-template-columns: 2fr 1fr; gap: var(--space-4); }
.totals-split.three { grid-template-columns: 2fr 1fr 2fr; }
.totals-group { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-4); }
.totals-head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: var(--fs-14); margin-bottom: 10px; }
.totals-head svg { width: 17px; height: 17px; color: var(--ink-3); }
.totals-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.totals-nums b { display: block; font-size: var(--fs-24); font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.totals-nums span { font-size: var(--fs-12); color: var(--ink-2); }

/* ---------- نموذج القضية ---------- */
.form-section { padding: 16px 18px; border-bottom: 1px solid var(--line-2); display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px 24px; }
.form-section:last-of-type { border-bottom: 0; }
.form-section-title { font-size: var(--fs-14); font-weight: 600; }
.form-section-title p { font-size: var(--fs-12); color: var(--ink-3); font-weight: 400; margin-top: 2px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3) var(--space-4); }
.exhibit-types-field { min-width: 0; }
.exhibit-type-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3) var(--space-4); }
.exhibit-type-grid .input { direction: ltr; text-align: right; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line-2); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.form-actions .spacer { flex: 1; }
.computed { display: flex; flex-wrap: wrap; gap: 8px; }
.computed-item { display: inline-flex; align-items: center; gap: 7px; height: var(--control-h); padding: 0 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px dashed var(--line); font-size: var(--fs-13); color: var(--ink-2); }
.computed-item b { color: var(--ink); font-weight: 600; }
.computed-item svg { width: 15px; height: 15px; color: var(--ink-3); }
.computed-item.accent { background: var(--accent-soft); border-style: solid; border-color: transparent; color: var(--accent-soft-ink); }
.computed-item.accent b { color: inherit; }
@media (max-width: 899px) { .form-section { grid-template-columns: 1fr; gap: 10px; } .exhibit-type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.side-note ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: var(--fs-13); color: var(--ink-2); }
.side-note li { display: flex; gap: 8px; }
.side-note li svg { width: 15px; height: 15px; flex: none; margin-top: 3px; color: var(--accent); }
.side-note b { color: var(--ink); }
.recent { display: flex; flex-direction: column; }
.recent a { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line-2); font-size: var(--fs-13); color: inherit; }
.recent a:first-child { border-top: 0; }
.recent a:hover { text-decoration: none; color: var(--accent); }
.recent b { font-variant-numeric: tabular-nums; }
.recent span { color: var(--ink-3); }

/* ---------- تفاصيل القضية ---------- */
.dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3) var(--space-5); margin: 0; }
.dl > div { display: flex; flex-direction: column; gap: 2px; }
.dl dt { font-size: var(--fs-12); color: var(--ink-3); }
.dl dd { margin: 0; font-weight: 500; font-size: var(--fs-15); }
.dl .full { grid-column: 1 / -1; }
.exhibit-detail-list { display: flex; flex-wrap: wrap; gap: 7px; }
.exhibit-detail-list > span { display: inline-flex; align-items: center; gap: 7px; min-height: 28px; padding: 3px 9px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); font-size: var(--fs-13); font-weight: 500; }
.exhibit-detail-list i { min-width: 2ch; color: var(--accent-soft-ink); font-style: normal; font-variant-numeric: tabular-nums; }
.timeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.tl-step { padding: 10px 12px; border-inline-start: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 2px; }
.tl-step:first-child { border-inline-start: 0; }
.tl-k { font-size: var(--fs-12); color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.tl-k i { width: 18px; height: 18px; border-radius: 50%; background: var(--surface-3); color: var(--ink-2); display: grid; place-items: center; font-size: 11px; font-style: normal; font-weight: 600; }
.tl-v { font-size: var(--fs-14); font-weight: 500; font-variant-numeric: tabular-nums; }
.history { display: flex; flex-direction: column; }
.history-item { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 4px 16px; padding: 10px 0; border-top: 1px solid var(--line-2); font-size: var(--fs-13); }
.history-item:first-child { border-top: 0; }
.history-when { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.history-changes { margin: 4px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; color: var(--ink-2); }
.history-changes code { font-family: inherit; background: var(--surface-3); padding: 0 5px; border-radius: 3px; }
@media (max-width: 899px) { .dl { grid-template-columns: 1fr 1fr; } .timeline { grid-template-columns: 1fr 1fr; } .tl-step:nth-child(3) { border-inline-start: 0; } .tl-step:nth-child(n+3) { border-top: 1px solid var(--line-2); } .history-item { grid-template-columns: 1fr; } }
@media (max-width: 719px) { .dl { grid-template-columns: 1fr; } .month-grid { grid-template-columns: 1fr 1fr; } .totals-split { grid-template-columns: 1fr; } }
@media (max-width: 1199px) and (min-width: 720px) { .month-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.ops-note { display: flex; gap: 8px; align-items: flex-start; font-size: var(--fs-13); color: var(--ink-3); }
.ops-note svg { width: 15px; height: 15px; flex: none; margin-top: 3px; }
.ops-note b { color: var(--ink-2); }

/* ---------- الإدارة ---------- */
.role-tag { font-size: var(--fs-12); color: var(--ink-2); }
.pw-strip { display: flex; gap: 8px; align-items: center; }

/* ---------- تصوير الأحراز ---------- */
.photography-page { gap: var(--page-gap); }
.photography-intro .panel-head { border-bottom: 0; }
.photography-toolbar { padding: 0 2px; }
.photography-table th:nth-child(3), .photography-table td:nth-child(3) { background: var(--photography-soft); }
.photography-table td:nth-child(3) { border-inline: 1px solid var(--line-2); }
