/* Ture, planificare și pontaj (modulul A2): grila planificării, grila pontajului, problemele, tiparele.
   Fără derulare pe orizontală: grila își alege câte zile încap (lună / 2 săptămâni / săptămână). */

/* ---------- pensula și legenda ---------- */
.ts-brush { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ts-brush > span { font-size: 12.5px; }
.chip.ts-chip i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); display: inline-block; }
.chip.ts-chip.on { background: var(--c); border-color: var(--c); color: var(--t); }
.chip.ts-chip.on i { box-shadow: 0 0 0 1px rgba(255, 255, 255, .7); }
.ts-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11.5px; color: var(--text-weak); }
.ts-legend span { display: inline-flex; align-items: center; gap: 5px; }
.ts-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; border: 1px solid var(--border); }
.ts-legend i.lg-lv { background: repeating-linear-gradient(135deg, var(--blue-bg) 0 3px, #fff 3px 5px); }
.ts-legend i.lg-sp { background: #e3e6ea; }
.ts-legend i.lg-man { background: linear-gradient(135deg, #1b1f24 0 30%, #fff 30%); }
.ts-legend i.lg-virt { background: #fff; border-style: dashed; }
.ts-legend i.lg-hol { background: #fdecea; }
.ts-legend i.lg-flag { background: linear-gradient(225deg, #d39b2a 0 35%, #fff 35%); }
.ts-legend i.lg-fix { background: radial-gradient(circle at 30% 70%, var(--blue) 0 22%, #fff 24%); }
.ts-legend sup { color: var(--green-text); font-weight: 700; }
.ts-states { gap: 6px; }
.ts-pager { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 650; white-space: nowrap; }

/* ---------- grila (planificare și pontaj) ---------- */
.ts-wrap { overflow: hidden; }
.ts-grid { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12px; user-select: none; -webkit-user-select: none; }
.ts-grid th, .ts-grid td { height: 30px; padding: 0; text-align: center; vertical-align: middle; overflow: hidden; white-space: nowrap; text-overflow: clip;
  border-bottom: 1px solid var(--border-soft); border-right: 1px solid var(--border-soft); }
.ts-grid th { height: 32px; background: var(--bg-soft); font-size: 11px; font-weight: 650; color: var(--text-weak); line-height: 1.05; border-bottom-color: var(--border); }
.ts-grid th small { display: block; font-size: 9.5px; font-weight: 500; color: var(--text-faint); }
.ts-grid th.we { background: #eef0f3; }
.ts-grid th.hol { color: var(--red-text); background: #fdecea; }
.ts-grid th.today { color: #fff; background: var(--brand); }
.ts-grid th.today small { color: #ffe2d8; }
.ts-grid .nm { text-align: left; padding: 2px 8px; }
.ts-grid td.nm a { display: block; color: var(--text); font-size: 12.5px; line-height: 1.2; text-decoration: none; }
.ts-grid td.nm a:hover b { color: var(--link); }
.ts-grid td.nm small { display: block; font-size: 10.5px; color: var(--text-weak); line-height: 1.2; }
.ts-grid td.sum, .ts-grid th.sum { padding: 0 3px; font-size: 12px; }
.ts-grid td.sum b { font-weight: 700; }
.ts-grid td.sum small { font-size: 10.5px; color: var(--text-faint); }
.ts-grid td.sum.plus b { color: var(--amber-text); }
.ts-grid td.sum.minus b { color: var(--blue-text); }
.ts-grid tr.grp td { height: 22px; background: var(--bg-soft); text-align: left; padding: 0 8px; font-size: 11px; font-weight: 700; color: var(--text-weak); letter-spacing: .3px; text-transform: uppercase; }
.ts-grid tbody tr:hover td.nm { background: #f6f8fb; }
.ts-grid tfoot td { background: var(--bg-soft); font-weight: 700; border-top: 1px solid var(--border); }
.ts-grid td.we { background-color: #fafbfc; }
.ts-grid td.hol { background-color: #fff5f4; }

/* planificare */
.sched td.sc { position: relative; font-weight: 700; font-size: 11px; letter-spacing: -.2px; }
.sched.edit td.sc { cursor: pointer; }
.sched.edit.brush td.sc { cursor: crosshair; }
.sched td.sc.off::after { content: "·"; color: var(--border-strong); font-size: 14px; }
.sched td.sc.virt { opacity: .7; }
.sched td.sc.man::before { content: ""; position: absolute; left: 0; top: 0; border: 4px solid transparent; border-left-color: rgba(0, 0, 0, .55); border-top-color: rgba(0, 0, 0, .55); }
.sched td.sc.lv { background: repeating-linear-gradient(135deg, var(--blue-bg) 0 4px, #fff 4px 7px) !important; color: var(--blue-text) !important; font-size: 10.5px; }
.sched td.sc.sp { background: #e3e6ea !important; color: var(--slate) !important; }
.sched td.sc.nc { background: repeating-linear-gradient(135deg, #f1f2f4 0 3px, #fff 3px 6px); cursor: not-allowed; }
.sched td.sc.warn { box-shadow: inset 0 -3px 0 #d39b2a; }
.sched td.sc.sel { outline: 2px solid var(--focus); outline-offset: -2px; filter: brightness(.92); }
.sched td.sc.today { box-shadow: inset 0 0 0 1px var(--brand); }
.sched.edit td.sc:hover { filter: brightness(.94); }

/* pontaj */
.tsg td.tc { position: relative; cursor: pointer; font-weight: 650; font-size: 12px; }
.tsg td.tc:hover { background: #eaf2fb; }
.tsg td.tc.code { font-size: 10px; font-weight: 750; color: var(--blue-text); background-color: #f2f6fc; letter-spacing: -.3px; }
.tsg td.c-A, .tsg td.c-N { color: var(--red-text) !important; background-color: var(--red-bg) !important; }
.tsg td.c-M { color: var(--amber-text) !important; background-color: var(--amber-bg) !important; }
.tsg td.c-CM, .tsg td.c-MAT, .tsg td.c-CCB, .tsg td.c-RM { color: #6c2c95 !important; background-color: #f4ecfa !important; }
.tsg td.c-SL { color: var(--red-text) !important; background-color: #fff5f4 !important; }
.tsg td.c-S, .tsg td.c-CIC, .tsg td.c-CFP, .tsg td.c-NC { color: var(--slate) !important; background-color: #eceff2 !important; }
.tsg td.plan { color: var(--text-faint); font-weight: 500; font-size: 10px; cursor: default; }
.tsg td.flag::after { content: ""; position: absolute; top: 0; right: 0; border: 4px solid transparent; border-top-color: #d39b2a; border-right-color: #d39b2a; }
.tsg td.flag.red::after { border-top-color: var(--red); border-right-color: var(--red); }
.tsg td.fixed::before { content: ""; position: absolute; left: 2px; bottom: 2px; width: 5px; height: 5px; border-radius: 50%; background: var(--blue); }
.tsg td.today { box-shadow: inset 0 0 0 1px var(--brand); }
.tsg sup { font-size: 8.5px; font-weight: 700; color: var(--amber-text); margin-left: 1px; }
.tsg sup.ok { color: var(--green-text); }
.tsg td.sum small { display: block; line-height: 1; }

/* ---------- dialogul zilei și corecturi ---------- */
.ts-day { display: flex; flex-direction: column; gap: 10px; }
.ts-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.ts-corr { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.ts-corr li { padding: 6px 10px; border: 1px solid var(--border-soft); border-left: 3px solid var(--blue); border-radius: var(--radius-sm); background: #fbfcfe; }
.ts-corr s { color: var(--text-faint); }
.ts-corr small { display: block; font-size: 11.5px; color: var(--text-weak); margin-top: 2px; }
.ts-fix { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid #f4d9a8; background: #fffbf3; border-radius: var(--radius-sm); }
.ts-fix .sect-title { border-top: 0; padding-top: 0; }
.ts-fix .sect-title .faint { text-transform: none; letter-spacing: 0; font-weight: 500; }
.ts-oldnew { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--bg-soft); }
.ts-itext { font-size: 12.5px; color: var(--text-weak); white-space: normal; line-height: 1.35; }
.tbl td .ts-itext { white-space: normal; }
.ts-act { flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.ts-act .btn.sm { height: 26px; padding: 0 8px; font-size: 12px; }

/* alegerea turei */
.ts-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.ts-pickb { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; border: 1px solid rgba(0, 0, 0, .08); border-radius: var(--radius-sm); cursor: pointer; text-align: left; }
.ts-pickb:hover { filter: brightness(.94); }
.ts-pickb b { font-size: 15px; }
.ts-pickb small { font-size: 11px; opacity: .9; }
.ts-pickb.off { background: #fff; color: var(--text); border-color: var(--border-strong); }

/* avertismentele legale */
.ts-warn { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.ts-warn li { padding: 5px 8px; border-left: 3px solid #d39b2a; background: var(--amber-bg); border-radius: 4px; }
.ts-warn li.red { border-left-color: var(--red); background: var(--red-bg); }

/* tipuri de tură și tipare */
.ts-code { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 22px; padding: 0 6px; border-radius: 5px; font-size: 11.5px; font-weight: 750; background: #e3e6ea; color: var(--text); }
.ts-code.off { background: #fff; border: 1px dashed var(--border-strong); color: var(--text-faint); }
.ts-cycle { display: flex; flex-wrap: wrap; gap: 3px; }
.ts-cycle .ts-code { min-width: 26px; height: 20px; font-size: 10.5px; }
.modal .ts-cycle .ts-code { cursor: pointer; min-width: 30px; height: 26px; font-size: 12px; }
.modal .ts-cycle .ts-code:hover { text-decoration: line-through; }
.ts-prev { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 2px; flex: 1 1 360px; }
.ts-prev span { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 32px; border-radius: 4px; background: #e3e6ea; font-size: 10.5px; font-weight: 700; }
.ts-prev span.off { background: #fff; border: 1px dashed var(--border); color: var(--text-faint); }
.ts-prev small { font-size: 9px; font-weight: 500; opacity: .75; }
.inp.ts-color { padding: 2px; height: 32px; cursor: pointer; }
.hint-box.warn { border-color: #f4d9a8; background: var(--amber-bg); color: var(--amber-text); }
.ts-rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px 14px; margin-bottom: 10px; }
.ts-rule { display: flex; flex-direction: column; gap: 3px; }
.ts-rule label { font-size: 12.5px; font-weight: 600; color: var(--text); }
.ts-rule .inp { max-width: 160px; }
.ts-rule.wide .inp { max-width: 100%; }
.ts-rule small { font-size: 11px; color: var(--text-faint); }
.ts-rgroup .sect-title { margin-bottom: 6px; }
.ts-warn li.info { border-left-color: var(--blue); background: var(--blue-bg); }

/* tabul „Prezență” din Fișa persoană */
.tbl tr.ts-we td { background: #fafbfc; }
.tbl tr.ts-today td { background: #fff6f3; }

@media (max-width: 760px) {
  .ts-grid { font-size: 11px; }
  .ts-grid td.nm a { font-size: 11.5px; }
  .ts-grid td.nm small { display: none; }
  .ts-prev { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .ts-act { justify-content: flex-start; }
}
@media print {
  .ts-brush, .ts-pager, .ts-legend, .ts-warn { display: none !important; }
  .ts-grid { font-size: 9px; }
  .ts-grid th, .ts-grid td { height: 20px; }
}
