/* =====================================================================
   نظام إدارة قسم الحاسوب — الأنماط
   الهوية: «سبّورة هادئة» — لوح أخضر مائل للرمادي، ورق فاتح، ولون تركوازي واحد للتفاعل.
   الألوان الدلالية فقط للحالات: أخضر/أصفر/أحمر/أزرق.
   ===================================================================== */
:root {
  --ink: #1c2b2f;
  --ink-2: #4c5e63;
  --muted: #7a8b8f;
  --paper: #f2f5f4;
  --surface: #ffffff;
  --line: #dde5e6;
  --slate: #1e3a3f;
  --slate-2: #274a50;
  --primary: #2b6e76;
  --primary-soft: #e3eff0;
  --success: #2f8a5b;
  --warning: #c98a12;
  --danger: #c0473d;
  --info: #2f6db0;
  --radius-lg: 18px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(28, 43, 47, .04), 0 6px 20px -8px rgba(28, 43, 47, .12);
  --bs-body-font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  --bs-primary: var(--primary);
  --bs-primary-rgb: 43, 110, 118;
  --bs-success-rgb: 47, 138, 91;
  --bs-warning-rgb: 201, 138, 18;
  --bs-danger-rgb: 192, 71, 61;
  --bs-info-rgb: 47, 109, 176;
  --bs-link-color: var(--primary);
  --bs-link-color-rgb: 43, 110, 118;
  --bs-body-color: var(--ink);
  --bs-border-color: var(--line);
}

* { box-sizing: border-box; }
html, body { background: var(--paper); }
body { font-family: var(--bs-body-font-family); color: var(--ink); font-size: .95rem; line-height: 1.7; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--slate); }
:focus-visible { outline: 3px solid rgba(43, 110, 118, .45); outline-offset: 2px; }

.bg-success { background-color: var(--success) !important; }
.bg-warning { background-color: var(--warning) !important; }
.bg-danger { background-color: var(--danger) !important; }
.bg-info { background-color: var(--info) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-info { color: var(--info) !important; }

.btn { font-weight: 600; border-radius: var(--radius-sm); }
.btn-primary { --bs-btn-bg: var(--primary); --bs-btn-border-color: var(--primary); --bs-btn-hover-bg: var(--slate-2); --bs-btn-hover-border-color: var(--slate-2); --bs-btn-active-bg: var(--slate); --bs-btn-disabled-bg: var(--primary); }
.btn-outline-primary { --bs-btn-color: var(--primary); --bs-btn-border-color: var(--primary); --bs-btn-hover-bg: var(--primary); --bs-btn-hover-border-color: var(--primary); }
.btn-outline-secondary { --bs-btn-color: var(--ink-2); --bs-btn-border-color: var(--line); --bs-btn-hover-bg: var(--primary-soft); --bs-btn-hover-color: var(--slate); --bs-btn-hover-border-color: var(--line); background: var(--surface); }
.btn-icon { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border-radius: 10px; color: var(--ink-2); border: 0; background: transparent; }
.btn-icon:hover { background: var(--primary-soft); color: var(--slate); }
.form-control, .form-select { border-radius: var(--radius-sm); border-color: var(--line); }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 .2rem rgba(43, 110, 118, .15); }
.form-label { font-weight: 600; font-size: .88rem; color: var(--ink-2); margin-bottom: .3rem; }

/* ---------------- الهيكل ---------------- */
.app { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { padding: 24px clamp(14px, 3vw, 32px) 40px; flex: 1; }
.app-foot { padding: 14px 32px; color: var(--muted); font-size: .8rem; }

.sidebar { background: var(--slate); color: #d7e4e2; display: flex; flex-direction: column; }
@media (min-width: 992px) { .sidebar.offcanvas-lg { width: 272px; top: 0; height: 100vh; flex-shrink: 0; position: sticky; visibility: visible !important; transform: none !important; background-color: var(--slate) !important; } }
@media (max-width: 991.98px) { .sidebar { height: 100%; --bs-offcanvas-width: 290px; background: var(--slate) !important; } }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px 18px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.brand-mark { width: 42px; height: 42px; border-radius: 12px; background: rgba(255, 255, 255, .1); display: grid; place-items: center; font-size: 1.3rem; color: #fff; flex-shrink: 0; }
.brand-title { color: #fff; font-weight: 800; font-size: 1.05rem; line-height: 1.3; }
.brand-sub { color: #9fb9b6; font-size: .78rem; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 12px 20px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.sidebar .nav-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 14px; border-radius: 10px; color: #c9d9d7; font-weight: 600; font-size: .92rem; background: none; border: 0; text-align: start; margin-bottom: 2px; }
.sidebar .nav-item i:first-child { font-size: 1.08rem; width: 20px; text-align: center; opacity: .85; }
.sidebar .nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar .nav-item.active { background: rgba(255, 255, 255, .11); color: #fff; box-shadow: inset -3px 0 0 #7fc3bd; }
.sidebar .nav-item .caret { margin-inline-start: auto; font-size: .75rem; transition: transform .2s; }
.nav-toggle[aria-expanded="true"] .caret { transform: rotate(180deg); }
.nav-sub { display: block; padding: 6px 48px 6px 14px; color: #a9c1be; font-size: .86rem; border-radius: 8px; }
.nav-sub:hover { color: #fff; }
.nav-sub.active { color: #fff; font-weight: 700; }
.sidebar-foot { padding: 14px 20px; font-size: .78rem; color: #8fb0ac; border-top: 1px solid rgba(255, 255, 255, .08); }

.topbar { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: 12px; padding: 12px clamp(14px, 3vw, 32px); background: rgba(242, 245, 244, .78); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid rgba(221, 229, 230, .7); }
.top-search { position: relative; flex: 1; max-width: 520px; }
.top-search i { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.top-search input { padding-right: 40px; background: var(--surface); border-radius: 999px; height: 42px; }
.topbar-end { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; }
.user-btn { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 4px 8px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; }
.notif-count { position: absolute; top: 2px; left: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; }
.notif-menu { width: 340px; max-height: 70vh; overflow-y: auto; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); }
.notif-head { padding: 12px 16px; font-weight: 700; border-bottom: 1px solid var(--line); }
.notif-item { display: flex; gap: 10px; padding: 10px 16px; color: var(--ink); font-size: .88rem; border-bottom: 1px solid #eef2f2; }
.notif-item:hover { background: var(--primary-soft); color: var(--ink); }
.notif-icon { font-size: 1.05rem; }

/* ---------------- ترويسة الصفحة والألواح ---------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-title { font-size: 1.45rem; font-weight: 800; margin: 0; color: var(--ink); }
.page-title i { color: var(--primary); }
.page-sub { margin: 4px 0 0; color: var(--muted); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow); margin-bottom: 20px; }
.panel-title { font-size: 1.02rem; font-weight: 700; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.panel-title small { font-weight: 500; color: var(--muted); font-size: .8rem; }

/* ---------------- الترحيب ---------------- */
.welcome { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.welcome h1 { font-size: clamp(1.35rem, 2.4vw, 1.8rem); font-weight: 800; margin: 0; }
.welcome .meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .82rem; color: var(--ink-2); font-weight: 600; }

/* ---------------- «يحتاج إلى إجراء» — العنصر المميّز ---------------- */
.action-board { background: var(--slate); border-radius: var(--radius-lg); padding: 22px; margin-bottom: 22px; color: #e6efee; position: relative; overflow: hidden; }
.action-board::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px); background-size: 18px 18px; pointer-events: none; }
.action-board h2 { font-size: 1.1rem; font-weight: 800; margin: 0 0 4px; color: #fff; position: relative; }
.action-board .sub { color: #a9c1be; font-size: .85rem; margin-bottom: 16px; position: relative; }
.action-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; position: relative; }
.action-tile { display: flex; align-items: center; gap: 14px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .08); border-radius: var(--radius); padding: 14px 16px; color: #e6efee; transition: background .15s, transform .15s; border-right: 4px solid; }
.action-tile:hover { background: rgba(255, 255, 255, .13); color: #fff; transform: translateY(-1px); }
.action-tile.lv-danger { border-right-color: #e8766b; }
.action-tile.lv-warning { border-right-color: #f0b640; }
.action-tile.lv-info { border-right-color: #7fb2e8; }
.action-tile .num { font-size: 1.9rem; font-weight: 800; line-height: 1; color: #fff; min-width: 44px; text-align: center; }
.action-tile .txt { font-size: .88rem; line-height: 1.5; }
.action-clear { position: relative; display: flex; align-items: center; gap: 10px; color: #bfe3d0; font-weight: 600; }

/* ---------------- بطاقات الإحصاء ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; color: var(--ink); }
a.stat:hover { border-color: #b9cfd1; color: var(--ink); }
.stat-label { font-size: .84rem; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stat-label i { color: var(--primary); }
.stat-value { font-size: 1.75rem; font-weight: 800; line-height: 1.3; }
.stat-value small { font-size: .9rem; font-weight: 600; color: var(--muted); }
.stat-foot { font-size: .78rem; color: var(--muted); }

/* ---------------- الرسوم ---------------- */
.chart-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; }
.chart-grid > .panel { margin: 0; }
.span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
@media (max-width: 1199.98px) { .span-4, .span-5, .span-7 { grid-column: span 6; } .span-8 { grid-column: span 12; } }
@media (max-width: 767.98px) { .chart-grid > * { grid-column: span 12 !important; } }
.chart-box { position: relative; height: 270px; }
.chart-box.tall { height: 320px; }

/* ---------------- الشارات والتقدم ---------------- */
.badge-soft { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.badge-soft .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-success { background: #e2f2e9; color: #226a45; }
.badge-warning { background: #fbf0d9; color: #8a5d05; }
.badge-danger { background: #f8e3e1; color: #9b3128; }
.badge-info { background: #e2ecf8; color: #24568c; }
.badge-secondary { background: #eceff0; color: #56676b; }
.pbar { display: flex; align-items: center; gap: 10px; min-width: 140px; }
.pbar-track { flex: 1; height: 8px; background: #e8eeef; border-radius: 99px; overflow: hidden; }
.pbar-fill { height: 100%; border-radius: 99px; }
.pbar-val { font-weight: 700; font-size: .82rem; min-width: 44px; text-align: end; }

/* ---------------- الجداول والفلاتر ---------------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; align-items: center; }
.filters .form-select { width: auto; min-width: 150px; max-width: 240px; }
.filter-search { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.filter-search i { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.filter-search input { padding-right: 36px; }
.data-table { margin: 0; }
.data-table thead th { background: #f6f9f9; color: var(--ink-2); font-weight: 700; font-size: .83rem; border-bottom: 1px solid var(--line); white-space: nowrap; padding: 10px 12px; }
.data-table td { padding: 10px 12px; border-color: #eef2f2; font-size: .9rem; }
.data-table tbody tr:hover { background: #fafcfc; }
.sort-link { color: inherit; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 320px; }
.table-responsive { border-radius: var(--radius); }
.link-file { font-weight: 600; white-space: nowrap; }
.pagination .page-link { color: var(--primary); border-color: var(--line); }
.pagination .active > .page-link { background: var(--primary); border-color: var(--primary); color: #fff; }

.empty-state { text-align: center; padding: 42px 20px; color: var(--muted); }
.empty-state i { font-size: 2.4rem; color: #b8c7c9; display: block; margin-bottom: 8px; }
.empty-state p { margin-bottom: 14px; }

/* ---------------- قوائم وبطاقات صغيرة ---------------- */
.list-clean { list-style: none; padding: 0; margin: 0; }
.list-clean li { padding: 10px 0; border-bottom: 1px solid #eef2f2; display: flex; gap: 10px; align-items: flex-start; }
.list-clean li:last-child { border-bottom: 0; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; }
.kv dt { color: var(--muted); font-weight: 600; font-size: .88rem; }
.kv dd { margin: 0; }
@media (max-width: 575.98px) { .kv { grid-template-columns: 1fr; } .kv dd { margin-bottom: 8px; } }
.course-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--surface); height: 100%; }
.course-card h3 { font-size: 1.02rem; font-weight: 800; margin: 0; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; text-align: center; }
.mini-stats div { background: #f6f9f9; border-radius: 10px; padding: 6px; }
.mini-stats b { display: block; font-size: 1.1rem; }
.mini-stats span { font-size: .75rem; color: var(--muted); }
.nav-tabs .nav-link { color: var(--ink-2); font-weight: 600; }
.nav-tabs .nav-link.active { color: var(--primary); }
.lesson-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 10px; }
.lesson-row:hover { background: #f6f9f9; }
.lesson-row.done .lesson-title { color: var(--muted); text-decoration: line-through; text-decoration-color: #b8c7c9; }
.score-input { width: 84px; text-align: center; }
.rubric td, .rubric th { vertical-align: middle; }
.rubric .btn-check + .btn { min-width: 38px; }
.evidence-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--surface); height: 100%; display: flex; flex-direction: column; gap: 6px; }
.evidence-card .ic { width: 42px; height: 42px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-size: 1.3rem; }

/* ---------------- المساعد الذكي ---------------- */
.chat { display: flex; flex-direction: column; height: calc(100vh - 230px); min-height: 460px; }
.chat-log { flex: 1; overflow-y: auto; padding: 8px 4px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 86%; padding: 12px 16px; border-radius: 16px; line-height: 1.8; white-space: pre-wrap; }
.msg.user { align-self: flex-start; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-end; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.bot .src { display: block; margin-top: 8px; font-size: .78rem; color: var(--muted); }
.chat-form { display: flex; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.suggest button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 14px; font-size: .84rem; color: var(--ink-2); }
.suggest button:hover { border-color: var(--primary); color: var(--primary); }
.typing span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); margin: 0 2px; animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }

/* ---------------- الهيكل العظمي للتحميل ---------------- */
.skeleton { background: linear-gradient(90deg, #eef2f2 25%, #f7f9f9 50%, #eef2f2 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; min-height: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------------- الدخول والتثبيت ---------------- */
.plain-wrap { min-height: 100vh; }
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-side { background: var(--slate); color: #d7e4e2; padding: clamp(28px, 5vw, 64px); display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.06) 1px, transparent 1px); background-size: 20px 20px; }
.auth-side > * { position: relative; }
.auth-side h1 { color: #fff; font-weight: 800; font-size: clamp(1.8rem, 3.4vw, 2.7rem); line-height: 1.35; max-width: 16ch; }
.auth-side p { color: #a9c1be; max-width: 44ch; }
.auth-q { display: grid; gap: 8px; margin-top: 28px; }
.auth-q span { display: inline-flex; gap: 8px; align-items: center; color: #d7e4e2; font-weight: 600; }
.auth-q i { color: #7fc3bd; }
.auth-form { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 400px; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth-side { min-height: auto; } .auth-q { display: none; } }

/* ---------------- الطباعة و PDF ---------------- */
@media screen { .print-only { display: none !important; } }
@page {
  size: A4; margin: 14mm 12mm 18mm;
  @bottom-center { content: "صفحة " counter(page) " من " counter(pages); font-family: Cairo, sans-serif; font-size: 9pt; color: #666; }
}
@media print {
  body { background: #fff; font-size: 11pt; }
  .sidebar, .topbar, .app-foot, .no-print, .toast-container, .modal, .btn { display: none !important; }
  .content { padding: 0; }
  .panel { box-shadow: none; border: 1px solid #ccc; break-inside: auto; padding: 12px; }
  .stat, .chart-box, .data-table tr, .signatures, .panel-title { break-inside: avoid; }
  .panel-title { break-after: avoid; }
  body:has(.report-head) .page-head { display: none !important; }
  .chart-box { height: 230px; }
  .data-table thead th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .badge-soft, .pbar-fill, .bg-success, .bg-warning, .bg-danger { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit; }
  .table-responsive { overflow: visible !important; }
  .tab-content > .tab-pane { display: block !important; opacity: 1 !important; margin-bottom: 14px; }
  .nav-tabs { display: none !important; }
  .report-footer { position: fixed; bottom: 0; left: 0; right: 0; font-size: 8.5pt; color: #666; border-top: 1px solid #ccc; padding-top: 4px; display: flex; justify-content: space-between; }
}
.report-head { display: flex; align-items: center; gap: 16px; border-bottom: 2px solid var(--slate); padding-bottom: 12px; margin-bottom: 16px; }
.report-head img { max-height: 70px; max-width: 120px; }
.report-head h2 { margin: 0; font-size: 1.3rem; font-weight: 800; }
.report-head .meta { color: var(--ink-2); font-size: .85rem; }
.report-section { margin-bottom: 22px; }
.report-section h3 { font-size: 1.05rem; font-weight: 800; border-right: 4px solid var(--primary); padding-right: 10px; margin-bottom: 12px; }
.signatures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 40px; text-align: center; }
.signatures div { border-top: 1px dashed #999; padding-top: 8px; font-weight: 600; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------------- إضافات الوحدات ---------------- */
div.kv { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px 20px; }
div.kv > div > span { display: block; color: var(--muted); font-size: .8rem; font-weight: 600; margin-bottom: 2px; }
div.kv > div > strong { font-weight: 600; }
.clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.rubric-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid #eef2f2; }
.rubric-q { flex: 1 1 240px; }
.rubric-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.rubric-total { padding-top: 12px; text-align: left; font-size: 1.05rem; }
.insights { margin: 0 0 12px; padding-inline-start: 1.2rem; line-height: 2; }
.results-grid input.form-control-sm { width: 82px; text-align: center; }
.sticky-actions { position: sticky; bottom: 0; background: var(--surface); padding: 10px 0; border-top: 1px solid var(--line); z-index: 2; }
.cand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.cand { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.cand > div { flex: 1; min-width: 0; }
.lab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; margin-bottom: 18px; }
.lab-card { display: block; color: inherit; text-decoration: none; margin: 0; transition: border-color .15s; }
.lab-card:hover { border-color: var(--primary); }
.lab-bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: #eef2f2; margin: 12px 0 8px; }
.lab-bar span { display: block; height: 100%; }
.week-grid th, .week-grid td { text-align: center; vertical-align: middle; min-width: 110px; font-size: .88rem; }
.week-grid thead th.today { background: var(--primary-soft); color: var(--primary); }
.week-grid td.busy { background: #fbf4e6; }
.evidence-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.evidence-grid .evidence-card { padding: 0; overflow: hidden; }
.evidence-card .thumb { height: 150px; background: var(--primary-soft); display: grid; place-items: center; color: var(--primary); font-size: 2.6rem; }
.evidence-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.evidence-card .body { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.evidence-card h3 { font-size: .98rem; font-weight: 700; margin: 4px 0 0; }
.msg.bot { white-space: normal; }
.msg.bot ul { margin: 6px 0; padding-inline-start: 1.2rem; }
.msg.bot p { margin: 0 0 6px; }
.search-group { margin-bottom: 18px; }
.search-group h2 { font-size: .95rem; font-weight: 700; color: var(--ink-2); }
.search-hit { display: block; padding: 10px 12px; border-radius: 10px; color: inherit; text-decoration: none; border-bottom: 1px solid #eef2f2; }
.search-hit:hover { background: #f6f9f9; }
.search-hit mark { padding: 0 2px; background: #fff0c2; }
.report-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.report-card { display: flex; gap: 12px; align-items: flex-start; color: inherit; text-decoration: none; margin: 0; }
.report-card:hover { border-color: var(--primary); }
.report-card i { font-size: 1.6rem; color: var(--primary); }
@media print {
  .lab-bar, .thumb { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .evidence-grid { grid-template-columns: repeat(3, 1fr); }
  .chat-form, .suggest { display: none !important; }
}
