/* A «Реестр»: спокойная бухгалтерская админка. Onest, зелёные «чернила учёта»,
   плотные таблицы, одна смелая деталь — шкала смен под шапкой трейдера. */
[data-variant='ledger'] body { background: var(--bg); }

.L-shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.L-side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 20px 14px; background: #10201B; color: #D5E3DE; }
.L-brand { display: flex; gap: 10px; align-items: center; text-decoration: none; font-weight: 700; font-size: 15px; line-height: 1.15; color: #fff; padding: 0 6px; }
.L-mark { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: #1FA385; color: #fff; font-size: 19px; font-weight: 700; }
.L-nav { display: flex; flex-direction: column; gap: 2px; }
.L-nav a { text-decoration: none; padding: 8px 10px; border-radius: 7px; color: #A9BDB6; font-weight: 500; }
.L-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.L-nav a.on { background: rgba(31, 163, 133, .18); color: #fff; box-shadow: inset 3px 0 0 #1FA385; }
.L-search { display: flex; justify-content: space-between; align-items: center; border: 1px solid rgba(255, 255, 255, .12); background: transparent; color: #A9BDB6; border-radius: 7px; padding: 7px 10px; cursor: pointer; font-size: 13px; }
.L-search kbd { background: transparent; border-color: rgba(255, 255, 255, .2); color: #A9BDB6; }
.L-side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 14px; }
.L-side .admin-picker select { color: #fff; }
.L-side .admin-picker select option { color: #15221E; }
.L-side .av-admin { background: #1FA385; color: #fff; }
.L-variant small { display: block; color: #7F968E; margin-bottom: 6px; }
.L-side .variant-switch { background: rgba(255, 255, 255, .07); }
.L-side .variant-switch button { color: #A9BDB6; }
.L-side .variant-switch button.on { background: #fff; color: #10201B; }

.L-main { padding: 26px 32px 60px; min-width: 0; }
.L-head { margin-bottom: 18px; }
.L-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 4px; }
.L-head p { color: var(--muted); max-width: 72ch; }
.L-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.L-stats { display: flex; gap: 28px; margin: 0; }
.L-stats div { text-align: right; }
.L-stats dt { font-size: 12px; color: var(--muted); }
.L-stats dd { margin: 0; font-size: 26px; font-weight: 700; }
.L-stats .warn dd { color: var(--sched); }
.L-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.L-sort { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; margin-left: auto; }

.L-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.L-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.L-table td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.L-table tbody tr { cursor: pointer; }
.L-table tbody tr:hover td { background: #F6FAF8; }
.L-table tbody tr:last-child td { border-bottom: 0; }
.L-table a { text-decoration: none; }
.L-table tr.no-snap td:first-child { box-shadow: inset 3px 0 0 var(--sched); }
.names { display: flex; flex-wrap: wrap; gap: 4px; }
.nm { font-size: 12.5px; padding: 1px 7px; border-radius: 4px; white-space: nowrap; }
.nm small { opacity: .7; }
.nm-aff { background: var(--aff-soft); color: var(--aff); }
.nm-staff { background: var(--staff-soft); color: var(--staff); }
.more { font-size: 12px; color: var(--muted); }
.L-mini { width: 120px; }

.L-actions { display: flex; gap: 8px; }
.L-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin: 0 0 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.L-kpis > div { padding: 12px 16px; }
.L-kpis > div + div { border-left: 1px solid var(--line-2); }
.L-kpis dt { font-size: 12px; color: var(--muted); }
.L-kpis dd { margin: 2px 0 0; font-size: 20px; font-weight: 700; display: flex; flex-direction: column; }
.L-kpis dd small { font-size: 12px; font-weight: 400; color: var(--muted); }
.L-kpis .hl dd { color: var(--sched); font-size: 16px; }

/* шкала смен — главная деталь варианта */
.L-rail { position: relative; height: 46px; margin: 8px 0 22px; background: repeating-linear-gradient(90deg, transparent 0 calc(100% / 30 - 1px), var(--line-2) calc(100% / 30 - 1px) calc(100% / 30)); border-radius: 8px; }
.L-rail .seg-v { position: absolute; top: 6px; bottom: 6px; border: 0; border-left: 2px solid var(--surface); cursor: pointer; text-align: left; padding: 0 8px; overflow: hidden; font-size: 12px; font-weight: 600; white-space: nowrap; }
.L-rail .st-active { background: #CFE8E0; color: #0B5A4A; }
.L-rail .st-scheduled { background: repeating-linear-gradient(135deg, #FBEBD2 0 6px, #F6DDB6 6px 12px); color: var(--sched); }
.L-rail .seg-v:first-child { border-radius: 6px 0 0 6px; }
.L-rail .seg-v:last-of-type { border-radius: 0 6px 6px 0; }
.L-rail .seg-v.sel { outline: 2px solid var(--ink); outline-offset: -2px; z-index: 1; }
.L-rail .now { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--danger); z-index: 2; }
.L-rail .now span { position: absolute; top: -16px; left: 4px; font-size: 11px; font-weight: 600; color: var(--danger); white-space: nowrap; }

.L-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.L-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; min-width: 0; }
.L-card-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.L-card-head h2 { font-size: 16px; }
.L-picture .sharebar { margin-bottom: 14px; }
.L-ptable { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.L-ptable th { font-size: 12px; color: var(--muted); text-align: left; font-weight: 600; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.L-ptable td { padding: 6px 4px; border-bottom: 1px solid var(--line-2); }
.L-ptable td:first-child { width: 70px; color: var(--muted); }
.L-ptable th:nth-child(2) { color: var(--aff); }
.L-ptable + .L-ptable th:nth-child(2) { color: var(--staff); }
.L-history { list-style: none; margin: 0; padding: 0; }
.L-history li { padding: 10px 0 10px 14px; border-left: 2px solid var(--line); position: relative; }
.L-history li::before { content: ''; position: absolute; left: -6px; top: 16px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line); }
.L-history li.st-active::before { border-color: var(--accent); }
.L-history li.st-scheduled::before { border-color: var(--sched); background: var(--sched-soft); }
.L-history li.st-cancelled { opacity: .6; }
.L-history li.sel { background: linear-gradient(90deg, var(--accent-soft), transparent 70%); }
.h-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border: 0; background: none; padding: 0; cursor: pointer; text-align: left; }
.h-date { font-weight: 600; }
.h-who { font-size: 12px; color: var(--muted); }
.h-comment { font-size: 13px; margin: 4px 0 2px; }
.h-changes { margin: 0; }

/* выезжающая панель правки */
.drawer-back { position: fixed; inset: 0; background: rgba(16, 32, 27, .28); z-index: 50; display: flex; justify-content: flex-end; }
.drawer { width: min(640px, 100%); height: 100%; background: var(--bg); display: flex; flex-direction: column; box-shadow: -20px 0 40px -20px rgba(0, 0, 0, .3); animation: drawerIn .22s ease-out; }
@keyframes drawerIn { from { transform: translateX(40px); opacity: .4; } }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 18px 20px 10px; background: var(--surface); }
.drawer-head h2 { font-size: 18px; }
.drawer .stepper { background: var(--surface); padding-bottom: 12px; margin: 0; border-bottom: 1px solid var(--line); }
.drawer-body { flex: 1; overflow: auto; padding: 16px 20px; }
.drawer-foot { display: flex; justify-content: space-between; gap: 8px; padding: 12px 20px; background: var(--surface); border-top: 1px solid var(--line); }

@media (max-width: 1100px) {
  .L-grid { grid-template-columns: 1fr; }
  .L-kpis { grid-template-columns: repeat(2, 1fr); }
  .L-kpis > div + div { border-left: 0; }
}
@media (max-width: 760px) {
  .L-shell { grid-template-columns: 1fr; }
  .L-side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 16px; }
  .L-nav { flex-direction: row; flex-wrap: wrap; }
  .L-side-foot { margin: 0; flex-direction: row; flex-wrap: wrap; }
  .L-search { display: none; }
  .L-main { padding: 18px 16px 60px; }
  .L-stats { gap: 16px; }
}
.L-railwrap { display: flex; gap: 12px; align-items: center; margin: 8px 0 22px; }
.L-railwrap .L-rail { flex: 1; margin: 0; }
.L-rail .seg-v.clipped { border-left: 0; border-radius: 0 !important; -webkit-mask-image: linear-gradient(90deg, transparent, #000 24px); mask-image: linear-gradient(90deg, transparent, #000 24px); padding-left: 20px; }

/* реестр назначений */
.L-ivtable { width: 100%; border-collapse: collapse; font-size: 13px; }
.L-ivtable th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px; border-bottom: 1px solid var(--line); }
.L-ivtable td { padding: 6px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.L-ivgroup th { padding-top: 14px; color: var(--ink); font-size: 12.5px; border-bottom: 0; }
.g-aff .L-ivgroup th { color: var(--aff); } .g-staff .L-ivgroup th { color: var(--staff); }
.L-ivtable tr.on td { background: var(--accent-soft); }
.L-ivtable tr.on td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.L-ivtable tr.st-past td, .L-ivtable tr.st-cancelled td { color: var(--muted); }
.L-ivtable tr.st-cancelled td:first-child { text-decoration: line-through; }
.L-period { white-space: nowrap; font-variant-numeric: tabular-nums; }
.L-period .arr { color: var(--muted); margin: 0 6px; }
.L-shown { margin-top: 14px; }
.L-dates { display: grid; gap: 10px; }
.L-ivtable td:first-child { white-space: nowrap; }
.L-rowact { text-align: right; white-space: nowrap; }
.L-rowact .btn { opacity: .6; } .L-ivtable tr:hover .L-rowact .btn { opacity: 1; }
.L-add { text-align: right; }
.L-past { margin-top: 10px; } .L-past summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.L-period small.L-by { display: block; color: var(--muted); font-size: 11.5px; }
@media (min-width: 1101px) { .L-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }
