/* R18 litigation & legal affairs – LH – hearings, deadlines, judgments, enforcement & My legal day. Every class of this file starts with "lh-". Owned by that slice only. */

/* ---------- shared bits */
.lh-span-all { grid-column: 1 / -1; }
.lh-span-2 { grid-column: span 2; }
@media (max-width: 700px) { .lh-span-2 { grid-column: 1 / -1; } }
.lh-check-cell { align-self: end; padding-bottom: 8px; }
.lh-note { margin: 6px 0 10px; font-size: 12.5px; color: var(--muted); }
.lh-note.warn { color: var(--amber-fg); background: var(--amber-bg); padding: 8px 10px; border-radius: var(--radius-sm); }
.lh-pad { padding: 10px 16px; }
.lh-nowrap { white-space: nowrap; }
.lh-pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.lh-warn-text { color: var(--amber-fg); }
.lh-bad-text { color: var(--red-fg); font-weight: 600; }
.lh-section { margin: 14px 0 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.lh-list { margin: 0 0 8px; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 6px; }
.lh-box { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; margin: 8px 0; background: var(--surface); }
.lh-chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.lh-actions { flex-wrap: wrap; }
.lh-row-tools { display: flex; gap: 4px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.lh-click { cursor: pointer; }
.lh-click:hover > td { background: var(--gray-bg); }
tr.lh-row-bad > td:first-child { box-shadow: inset 3px 0 0 var(--red-fg); }
tr.lh-row-warn > td:first-child { box-shadow: inset 3px 0 0 var(--amber-fg); }
[dir="rtl"] tr.lh-row-bad > td:first-child { box-shadow: inset -3px 0 0 var(--red-fg); }
[dir="rtl"] tr.lh-row-warn > td:first-child { box-shadow: inset -3px 0 0 var(--amber-fg); }
tr.lh-total > td { font-weight: 600; border-top: 2px solid var(--border); }
.lh-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 16px; text-align: center; color: var(--muted); }
.lh-empty h2 { margin: 0; font-size: 17px; color: var(--text); }
.lh-empty p { margin: 0; max-width: 560px; }
.lh-empty svg { color: var(--primary); }
.lh-banner { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--border);
    background: var(--blue-bg); color: var(--blue-fg); margin-bottom: 12px; }
.lh-banner.warn { background: var(--amber-bg); color: var(--amber-fg); }
.lh-banner > .grow { flex: 1 1 260px; }
.lh-bar { display: block; height: 6px; min-width: 70px; border-radius: 3px; background: var(--gray-bg); overflow: hidden; margin: 4px 0; }
.lh-bar > span { display: block; height: 100%; background: var(--series-1); border-radius: 3px; }

/* segmented choice (view switch, record modes) */
.lh-seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; margin: 4px 0 10px; }
.lh-seg-btn { font: inherit; padding: 6px 12px; border: 0; background: var(--surface); color: var(--text); cursor: pointer; border-inline-end: 1px solid var(--border); }
.lh-seg-btn:last-child { border-inline-end: 0; }
.lh-seg-btn.on { background: var(--primary); color: #fff; }
.lh-seg-btn:disabled { opacity: .45; cursor: not-allowed; }

/* KPIs that filter */
.lh-kpi { text-align: start; cursor: pointer; font: inherit; color: inherit; border: 1px solid var(--border); }
.lh-kpi.on { border-color: var(--primary); box-shadow: inset 0 -3px 0 var(--primary); }
.lh-kpi-bad .kpi-value { color: var(--red-fg); }
.lh-kpi-warn .kpi-value { color: var(--amber-fg); }
.lh-kpi-money { font-size: 20px; }
.kpis.lh-kpis5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) { .kpis.lh-kpis5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .kpis.lh-kpis5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- calendar toolbar */
.lh-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 8px; }
.lh-toolbar .lh-seg { margin: 0; }
.lh-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lh-range { font-size: 16px; margin-inline-start: 6px; }
.lh-summary { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin: 4px 0 10px; font-size: 13px; }

/* month grid */
.lh-month { overflow: hidden; }
.lh-month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.lh-wd { padding: 6px 8px; font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--border); text-align: center; }
.lh-day { position: relative; min-height: 104px; padding: 4px 4px 6px; border-inline-end: 1px solid var(--row-line); border-bottom: 1px solid var(--row-line);
    display: flex; flex-direction: column; gap: 2px; cursor: pointer; outline: none; min-width: 0; }
.lh-day:nth-child(7n) { border-inline-end: 0; }
.lh-day.other { background: var(--gray-bg); }
.lh-day.other .lh-day-no { color: var(--muted); }
.lh-day.weekend:not(.other) { background: color-mix(in srgb, var(--gray-bg) 55%, transparent); }
.lh-day.today .lh-day-no { background: var(--primary); color: #fff; border-radius: 50%; }
.lh-day.sel, .lh-day:focus-visible { box-shadow: inset 0 0 0 2px var(--primary); }
.lh-day-no { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 600; }
.lh-day-count { display: none; position: absolute; inset-inline-end: 4px; top: 6px; font-size: 11px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
    background: var(--primary); color: #fff; align-items: center; justify-content: center; }
.lh-chip { display: block; font-size: 11.5px; line-height: 1.35; padding: 1px 5px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    background: var(--blue-bg); color: var(--blue-fg); border-inline-start: 3px solid var(--lh-c, var(--series-1)); }
.lh-chip.done { background: var(--green-bg); color: var(--green-fg); }
.lh-chip.late { background: var(--red-bg); color: var(--red-fg); }
.lh-chip.memo { background: var(--amber-bg); color: var(--amber-fg); }
.lh-chip.off { background: var(--gray-bg); color: var(--muted); text-decoration: line-through; }
.lh-more { font-size: 11px; color: var(--muted); padding: 0 4px; }
@media (max-width: 760px) {
    .lh-day { min-height: 52px; }
    .lh-day .lh-chip, .lh-day .lh-more { display: none; }
    .lh-day-count { display: inline-flex; }
}

/* week */
.lh-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.lh-week-day { padding: 8px; min-width: 0; margin: 0; }
.lh-week-day.today { box-shadow: inset 0 3px 0 var(--primary); }
.lh-week-day.weekend { background: var(--gray-bg); }
.lh-week-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.lh-week-head .icon-btn { margin-inline-start: auto; }
.lh-week .lh-item { grid-template-columns: 1fr; }
.lh-week .lh-item-tags { justify-content: flex-start; }
@media (max-width: 1200px) { .lh-week { grid-template-columns: repeat(2, minmax(0, 1fr)); } .lh-week .lh-item { grid-template-columns: auto 1fr; } }
@media (max-width: 700px) { .lh-week { grid-template-columns: 1fr; } }

/* agenda */
.lh-agenda-day { font-size: 14px; margin: 14px 0 6px; padding-bottom: 4px; border-bottom: 1px solid var(--row-line); }
.lh-agenda-day.today { color: var(--primary); }

/* ---------- hearing line (agenda, My day, case tab) */
.lh-items { display: flex; flex-direction: column; gap: 6px; }
.lh-item { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: start; width: 100%; text-align: start; font: inherit; color: inherit;
    text-decoration: none; background: var(--surface); border: 1px solid var(--border); border-inline-start: 4px solid var(--lh-c, var(--series-1));
    border-radius: var(--radius-sm); padding: 8px 10px; cursor: pointer; }
.lh-item:hover, .lh-item:focus-visible { border-color: var(--primary); outline: none; }
.lh-item.done { opacity: .82; }
.lh-item.late { border-inline-start-color: var(--red-fg); }
.lh-item-when { display: flex; flex-direction: column; min-width: 64px; }
.lh-item-date { font-size: 12px; color: var(--muted); }
.lh-item-time { font-weight: 600; font-variant-numeric: tabular-nums; }
.lh-item-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lh-item-case { overflow-wrap: anywhere; }
.lh-item-sub { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.lh-item-tags { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; justify-content: flex-end; }
@media (max-width: 600px) {
    .lh-item { grid-template-columns: auto 1fr; }
    .lh-item-tags { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ---------- details / dialogs */
.lh-dlg-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 8px 10px; margin-bottom: 10px; background: var(--gray-bg); border-radius: var(--radius-sm); }
.lh-detail-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; align-items: flex-start; margin-bottom: 10px; }
.lh-detail-date { font-size: 17px; font-weight: 600; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.lh-time { font-variant-numeric: tabular-nums; color: var(--primary); }
.lh-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 16px; margin: 8px 0 12px; }
.lh-facts > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lh-facts dt { font-size: 12px; color: var(--muted); }
.lh-facts dd { margin: 0; overflow-wrap: anywhere; }
.lh-timeline { margin-top: 12px; }
.lh-timeline summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); }
.lh-timeline ul { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 6px; }
.lh-timeline li { font-size: 13px; border-inline-start: 2px solid var(--border); padding-inline-start: 8px; }
.lh-preview { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; margin: 10px 0; background: var(--blue-bg); color: var(--blue-fg);
    display: flex; flex-direction: column; gap: 4px; }
.lh-preview.warn { background: var(--amber-bg); color: var(--amber-fg); }
.lh-preview strong { font-size: 16px; }
.lh-result h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; color: var(--green-fg); }
.lh-case-pick { display: flex; flex-direction: column; gap: 6px; }
.lh-case-search { width: 100%; }

/* ---------- cause list */
.lh-cause-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; padding: 12px 16px 0; }
.lh-cause-head h2 { margin: 0; font-size: 18px; }
.lh-cause-group { padding: 4px 0 8px; }
.lh-cause-group h3 { margin: 12px 16px 6px; font-size: 15px; }
.lh-cause-table td { vertical-align: top; }
.lh-print-col { width: 120px; }
@media screen and (max-width: 900px) { .lh-print-col { display: none; } }
@media print {
    .lh-cause-group { break-inside: avoid-page; }
    .lh-cause-table tr { break-inside: avoid; }
    .lh-print-col { border: 1px solid #999; }
    .lh-day { min-height: 80px; }
}

/* ---------- My legal day */
.lh-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.lh-tile { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface);
    color: var(--text); text-decoration: none; }
.lh-tile:hover { border-color: var(--primary); }
.lh-tile-n { font-size: 26px; font-weight: 700; line-height: 1.1; }
.lh-tile span:last-child { font-size: 12.5px; color: var(--muted); }
.lh-tile.warn .lh-tile-n { color: var(--amber-fg); }
.lh-tile.bad .lh-tile-n { color: var(--red-fg); }
@media (max-width: 700px) { .lh-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.lh-card-warn { border-color: var(--red-fg); }
.lh-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.lh-rows > li { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--row-line); flex-wrap: wrap; }
.lh-rows > li:last-child { border-bottom: 0; }
.lh-rows > li.bad { border-inline-start: 3px solid var(--red-fg); padding-inline-start: 8px; }
.lh-rows > li.warn { border-inline-start: 3px solid var(--amber-fg); padding-inline-start: 8px; }
.lh-rows > li.read { opacity: .7; }
.lh-row-main { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.lh-check-btn { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; border: 2px solid var(--border); background: var(--surface); color: transparent;
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.lh-check-btn:hover, .lh-check-btn:focus-visible { border-color: var(--green-fg); color: var(--green-fg); outline: none; }
.lh-feed { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.lh-feed input { flex: 1 1 260px; min-width: 0; font-family: var(--mono); font-size: 12px; }
