/* (٢١٤) قائمة القضايا — تصميم النموذج المعتمد: بطاقتا تبويب، شريط أدوات بقوائم، جدول مختصر، ترقيم رقمي.
   يعتمد على رموز styles.css (--brand/--line/--card/--muted/--info/--warn/--accent) فيعمل في الفاتح والداكن. */
.cl-page { --cl-blue: var(--info); --cl-amber: var(--warn); --cl-gray: var(--muted); }

/* ── بطاقتا التبويب ── */
.cl-tabs.classtabs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; background: none; box-shadow: none; overflow: visible; border-radius: 0; margin-bottom: 14px; }
.cl-tabs.classtabs button { background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); transition: border-color .18s, box-shadow .18s; }
.cl-tabs.classtabs button .in { padding: 16px 18px; font-size: 17px; justify-content: center; gap: 12px; }
.cl-tabs.classtabs button .cl-ti { font-size: 22px; line-height: 1; }
.cl-tabs.classtabs button.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft), var(--shadow); }
.cl-tabs.classtabs button.on.enf { border-color: var(--cl-blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cl-blue) 18%, transparent), var(--shadow); }
.cl-tabs.classtabs button.on.enf .in { color: var(--cl-blue); background: color-mix(in srgb, var(--cl-blue) 9%, transparent); }
.cl-tabs.classtabs button.on::after { display: none; }
.cl-tabs.classtabs button.on.enf .n { background: var(--cl-blue); color: #fff; }

/* ── شريط الأدوات ── */
.cl-toolbar.toolbar { gap: 10px; margin-bottom: 14px; align-items: stretch; }
.cl-toolbar .cl-mi { font-size: 14px; opacity: .85; }
.cl-search { flex: 1 1 200px; min-width: 200px; display: flex; align-items: center; gap: 8px; margin: 0; padding: 0 12px; background: var(--card); border: 1.5px solid var(--line); border-radius: 10px; }
.cl-search:focus-within { border-color: var(--brand); }
.cl-toolbar .cl-search input { flex: 1; min-width: 0; width: auto; border: 0; background: none; padding: 10px 0; box-shadow: none; outline: 0; }
.cl-menu { position: relative; margin: 0; }
.cl-menu > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 7px; height: 100%; padding: 9px 12px; background: var(--card); border: 1.5px solid var(--line); border-radius: 10px; font-weight: 600; font-size: 13.5px; color: var(--ink); white-space: nowrap; user-select: none; }
.cl-menu > summary::-webkit-details-marker { display: none; }
.cl-menu > summary::after { content: "▾"; color: var(--muted); font-size: 12px; margin-inline-start: 2px; }
.cl-menu > summary:hover, .cl-menu[open] > summary { border-color: var(--brand); color: var(--brand); }
.cl-panel { position: absolute; top: calc(100% + 6px); inset-inline-start: 0; z-index: 40; min-width: 240px; max-width: min(92vw, 360px); display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.18); }
/* (إصلاح ٢١٤) قوائم طرف الشريط (أدوات/تصدير/عرض) تنفتح نحو داخل الصفحة كي لا تخرج من حافة الشاشة */
#cl-m-tools .cl-panel, #cl-m-export .cl-panel, #cl-m-view .cl-panel { inset-inline-start: auto; inset-inline-end: 0; }
.cl-panel > button { width: 100%; text-align: start; justify-content: flex-start; }
.cl-panel .cl-f { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); margin: 0; }
.cl-panel .cl-f > span { font-weight: 600; }
.cl-toolbar .cl-panel .cl-f select, .cl-toolbar .cl-panel .cl-f input[type="number"] { width: 100%; min-width: 0; }
.cl-panel .cl-f-row { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); }
.cl-toolbar .cl-panel .cl-f-row input[type="checkbox"] { width: auto; min-width: 0; }
.cl-panel .cl-f-range { flex-direction: row; align-items: center; flex-wrap: wrap; }
.cl-panel .cl-f-range > span { flex: 0 0 100%; }
.cl-toolbar .cl-panel .cl-f-range input { flex: 1; }
.cl-toolbar .cl-primary { font-weight: 700; padding-inline: 18px; border-radius: 10px; }

/* ── الجدول ── */
.cl-card.card { padding: 0; overflow: hidden; border: 1.5px solid var(--line); }
.cl-grid.cs-grid th { font-size: 13px; padding: 11px 12px; text-align: center; }
.cl-grid.cs-grid td { text-align: center; }
.cl-grid.cs-grid td.cut, .cl-grid.cs-grid th.c-client, .cl-grid.cs-grid th + th.c-lawyer { text-align: start; }
.cl-grid.cs-grid .stick1, .cl-grid.cs-grid th.stick1 { width: 86px; min-width: 86px; max-width: 86px; font-size: 14px; }
.cl-grid.cs-grid .stick2, .cl-grid.cs-grid th.stick2 { inset-inline-start: 86px; width: 150px; min-width: 150px; max-width: 150px; }
.cl-grid.cs-grid .c-client { width: 170px; max-width: 170px; }
.cl-grid.cs-grid .c-lawyer { width: 120px; max-width: 120px; }
.cl-grid.cs-grid td.cut { max-width: 180px; }
.cl-grid tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--brand) 5%, var(--card)); }
.cl-grid tbody tr:nth-child(even) .stick1, .cl-grid tbody tr:nth-child(even) .stick2 { background: color-mix(in srgb, var(--brand) 5%, var(--card)) !important; }
.cl-file { display: inline-flex; align-items: center; gap: 6px; direction: ltr; }
.cl-file .cl-fi { color: var(--cl-blue); font-size: 14px; }
.cl-file b { color: var(--ink); font-weight: 600; }
.cl-no { font-weight: 600; font-variant-numeric: tabular-nums; }
.cl-role.badge { padding: 4px 11px; font-size: 12px; border: 1px solid color-mix(in srgb, var(--cl-blue) 35%, transparent); }
.cl-st { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 8px; font-size: 12px; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.cl-st i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.cl-st-blue  { color: var(--cl-blue);  background: color-mix(in srgb, var(--cl-blue) 12%, transparent);  border-color: color-mix(in srgb, var(--cl-blue) 40%, transparent); }
.cl-st-amber { color: var(--cl-amber); background: color-mix(in srgb, var(--cl-amber) 12%, transparent); border-color: color-mix(in srgb, var(--cl-amber) 45%, transparent); }
.cl-st-gray  { color: var(--cl-gray);  background: color-mix(in srgb, var(--cl-gray) 10%, transparent);  border-color: color-mix(in srgb, var(--cl-gray) 35%, transparent); }
.cl-th-more, .cl-td-more { width: 56px; min-width: 56px; }
.cl-more { position: relative; display: inline-block; }
.cl-more > summary { list-style: none; cursor: pointer; font-size: 20px; line-height: 1; letter-spacing: 1px; padding: 2px 8px; border-radius: 8px; color: var(--ink); }
.cl-more > summary::-webkit-details-marker { display: none; }
.cl-more > summary:hover, .cl-more[open] > summary { background: var(--brand-soft); color: var(--brand); }
.cl-more-panel { position: absolute; top: calc(100% + 4px); inset-inline-end: 0; z-index: 30; min-width: 190px; display: flex; flex-direction: column; gap: 2px; padding: 6px; background: var(--card); border: 1.5px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.2); text-align: start; }
.cl-more-panel a, .cl-more-panel button { display: block; width: 100%; text-align: start; padding: 7px 10px; border-radius: 7px; background: none; border: 0; color: var(--ink); font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; }
.cl-more-panel a:hover, .cl-more-panel button:hover { background: var(--brand-soft); color: var(--brand); filter: none; }
.cl-more-note { display: block; padding: 5px 10px; font-size: 12px; color: var(--muted); border-top: 1px dashed var(--line); }
.cl-grid tbody tr:last-child .cl-more-panel, .cl-grid tbody tr:nth-last-child(2) .cl-more-panel { top: auto; bottom: calc(100% + 4px); }

/* ── ترقيم الصفحات ── */
.cl-pager { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.cl-pg-info { font-size: 13px; color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cl-pg-info b { color: var(--ink); }
.cl-pg-per { margin: 0; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.cl-pg-per select { width: auto; min-width: 0; padding: 4px 8px; font-size: 12.5px; }
.cl-pg-nav { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.cl-pg-n { min-width: 40px; height: 38px; padding: 0 10px; border-radius: 9px; background: var(--card); border: 1.5px solid var(--line); color: var(--ink); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.cl-pg-n:hover { border-color: var(--brand); color: var(--brand); filter: none; }
.cl-pg-n.on { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.cl-pg-n[disabled] { opacity: .4; cursor: default; }
.cl-pg-gap { color: var(--muted); padding: 0 2px; }

/* ── الجوال ── */
@media (max-width: 760px) {
  .cl-tabs.classtabs { grid-template-columns: 1fr; gap: 8px; }
  .cl-tabs.classtabs button .in { padding: 12px 14px; font-size: 15.5px; }
  .cl-search { flex-basis: 100%; }
  .cl-menu > summary { padding: 8px 11px; font-size: 13px; }
  .cl-toolbar .cl-primary { flex: 1 1 auto; }
  .cl-panel { inset-inline-start: auto; inset-inline-end: 0; max-width: 92vw; }
  .cl-card.card .table-wrap { max-height: none; }
  .cl-grid.cs-grid .stick1, .cl-grid.cs-grid .stick2 { position: static; }
  .cl-pg-nav { justify-content: center; }
  .cl-pg-info { justify-content: center; text-align: center; }
}
@media print { .cl-th-more, .cl-td-more { display: none; } }

/* ===== (٢١٤) القائمة الجانبية: مطوية افتراضيًا، تُفتح بالضغط، أو تُثبَّت ===== */
@media (min-width: 961px) {
  :root { --sidebar-mini: 64px; }
  html:not([data-sidebar="pinned"]) .main { margin-inline-start: var(--sidebar-mini); }
  html:not([data-sidebar="pinned"]) .sidebar { width: var(--sidebar-mini); overflow: hidden; transition: width .22s ease; }
  html:not([data-sidebar="pinned"]) .sidebar.open { width: var(--sidebar-w); box-shadow: 0 0 40px rgba(0,0,0,.35); }
  html:not([data-sidebar="pinned"]) .sidebar:not(.open) .logo-box { margin: 10px 8px; padding: 0; height: 48px; border-radius: 10px; }
  html:not([data-sidebar="pinned"]) .sidebar:not(.open) .logo-box img { object-position: 50% 44%; transform: scale(1.35); }
  html:not([data-sidebar="pinned"]) .sidebar:not(.open) .side-nav { padding-inline: 8px; }
  html:not([data-sidebar="pinned"]) .sidebar:not(.open) .side-nav a { padding: 10px 0; justify-content: center; gap: 0; font-size: 0; margin-inline: 2px; }
  html:not([data-sidebar="pinned"]) .sidebar:not(.open) .side-nav a .ico { width: auto; font-size: 20px; }
  html:not([data-sidebar="pinned"]) .sidebar:not(.open) .side-nav a.active::before { inset-inline-start: -8px; }
  html:not([data-sidebar="pinned"]) .sidebar:not(.open) .side-nav .sec,
  html:not([data-sidebar="pinned"]) .sidebar:not(.open) .side-foot { display: none; }
  html:not([data-sidebar="pinned"]) .sidebar:not(.open) .sb-pin .sb-pin-txt { display: none; }
  .topbar .burger { display: inline-flex; }
  html[data-sidebar="pinned"] .topbar .burger { display: none; }
}
.sb-pin { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0 10px 6px; padding: 6px 8px; border-radius: 8px; background: #ffffff14; color: #ffffffd0; border: 1px solid #ffffff22; font-size: 12px; cursor: pointer; }
.sb-pin:hover { background: #ffffff24; color: #fff; }
html[data-sidebar="pinned"] .sb-pin { background: var(--accent); color: #1c1c1c; border-color: transparent; }
@media (max-width: 960px) { .sb-pin { display: none; } }
@media print { .sb-pin { display: none; } }
