/* Paginile Acasă, Atelier (tabla) și Fișe (listă + fișă) — designul nou. */

/* ---------- Bara „Spune-i lui Bobiță…” ---------- */
.cmd-bar { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 7px 7px 7px 16px; }
.cmd-bar input { flex: 1; border: 0; padding: 8px 0; background: transparent; outline: none; font-size: 15px; min-width: 0; }
.cmd-bar:focus-within { border-color: var(--blue); }
.cmd-mic { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--blue); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.cmd-mic .ic { width: 18px; height: 18px; }
.cmd-bar.big { border-radius: 40px; padding: 10px 10px 10px 24px; margin: 34px 0 46px; }
.cmd-bar.big input { font-size: 16.5px; }
.cmd-bar.big .cmd-mic { width: 52px; height: 52px; }
.cmd-bar.big .cmd-mic .ic { width: 22px; height: 22px; }
/* butonul rotund al lui Bobiță se ascunde lângă bara mare, DAR rămâne mereu vizibil cât e conectat (ca să-l poți opri) */
body:has(#main .cmd-bar.big) .fab:not(.live) { display: none !important; }
@media (min-width: 901px) { body:has(.mail.has-sel) .fab:not(.live) { display: none !important; } }

/* ---------- Acasă ---------- */
.home { max-width: 760px; margin: 0 auto; padding: 20px 0 40px; }
.home .home-hi { font-size: 32px; font-weight: 300; letter-spacing: -.02em; line-height: 1.3; margin: 10px 0 0; color: var(--text); }
.home .home-hi a { color: var(--blue); border-bottom: 1px solid var(--blue-soft); }
.home .home-hi a:hover { border-bottom-color: var(--blue); }
.home-h { font-size: 13px !important; font-weight: 500 !important; color: var(--muted); margin: 34px 0 8px !important; }
.lines { border-bottom: 1px solid var(--line); }
.line { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; padding: 13px 4px; border-top: 1px solid var(--line); align-items: baseline; color: var(--text); }
.line:hover { background: var(--blue-soft); }
.l-id { color: var(--muted); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.l-main b { font-weight: 500; }
.l-end { font-size: 13.5px; color: var(--muted); text-align: right; white-space: nowrap; }
.l-end.owe { color: var(--red); }

/* ---------- Atelier: tabla ---------- */
#main:has(.board) { max-width: none; }
.board-head { display: flex; align-items: baseline; gap: 22px; flex-wrap: wrap; margin-bottom: 14px; }
.board-head h1 { margin: 0; }
.board-head p { margin: 0; }
.board-head b { font-weight: 500; color: var(--text); }
.b-hint { margin-left: auto; }
.board { display: grid; gap: 14px; align-items: start; }
.b-col { min-height: 140px; border-radius: 12px; padding: 4px; transition: background .12s; }
.b-col.over { background: var(--blue-soft); }
.b-col h2 { font-size: 13.5px !important; font-weight: 500 !important; color: var(--muted); margin: 4px 4px 10px !important; display: flex; justify-content: space-between; }
.b-col h2 i { font-style: normal; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 0 8px; color: var(--text); font-size: 12.5px; }
.b-empty { color: var(--muted); font-size: 13px; padding: 10px; text-align: center; }
.board { grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* Zona „Predat” apare jos doar în timp ce tragi un bilet; coloanele nu se mișcă. */
.b-drop-done { display: none; position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); width: min(520px, 90vw); min-height: 0; z-index: 40;
  border: 1.5px dashed var(--green); background: var(--green-soft); border-radius: 14px; padding: 6px 14px; text-align: center; }
.b-drop-done h2 { justify-content: center !important; color: var(--green) !important; margin: 4px !important; }
.b-drop-done .b-empty { padding: 2px 0 6px; }
.board.is-dragging .b-drop-done { display: block; }
.b-drop-done.over { background: #d5eedd; }
.ticket { display: grid; gap: 1px; background: var(--card); border-radius: 10px; padding: 11px 13px 12px; margin-bottom: 10px; color: var(--text); border: 1px solid var(--line); border-top: 3px solid var(--c, #8a96a0); cursor: grab; }
.ticket:hover { border-color: #cfd8db; border-top-color: var(--c); box-shadow: 0 4px 14px rgba(20, 40, 50, .06); }
.ticket.dragging { opacity: .5; }
.ticket.st-primit { --c: #8a96a0; } .ticket.st-in_lucru { --c: #c27c1b; } .ticket.st-asteapta_piese { --c: #7a62b8; } .ticket.st-gata { --c: #2f8a57; }
.t-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted); }
.t-who { font-weight: 500; margin-top: 2px; }
.t-car { color: var(--muted); font-size: 13.5px; }
.t-foot { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); margin-top: 4px; }
.t-foot b { font-weight: 500; color: var(--red); white-space: nowrap; }
.dots { display: inline-flex; gap: 5px; margin: 9px 0 3px; flex-wrap: wrap; }
.dots i { width: 18px; height: 6px; border-radius: 3px; background: #e2e7e9; }
.dots .d-in_lucru { background: #e8b15d; } .dots .d-verificat, .dots .d-reparat, .dots .d-inlocuit { background: var(--green); } .dots .d-nereparabil { background: #d0574d; }
.dot-legend { display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; margin-top: 18px; }
.dot-legend .dots { margin: 0 4px 0 0; }

/* ---------- Fișe: filtre + listă + fișa ---------- */
#main:has(.mail) { padding: 0 !important; max-width: none; overflow: hidden; }
.workspace:has(.mail) .topbar { display: none; }
.mail { display: grid; grid-template-columns: 200px 370px minmax(0, 1fr); height: calc(100vh - 58px); background: var(--card); }
.m-filters { background: var(--bg); padding: 18px 12px; display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--line); overflow: auto; }
.m-filters a { display: flex; justify-content: space-between; padding: 7px 10px; border-radius: 7px; color: var(--muted); font-size: 14.5px; }
.m-filters a i { font-style: normal; font-size: 12.5px; }
.m-filters a:hover { color: var(--text); }
.m-filters a.on { background: var(--blue-soft); color: var(--blue-2); font-weight: 500; }
.m-filters .m-new { margin-top: 14px; color: var(--blue); gap: 6px; justify-content: flex-start; }
.m-filters .m-new .ic { width: 17px; height: 17px; }
.m-list { border-right: 1px solid var(--line); overflow: auto; }
.m-search { margin: 12px 14px; max-width: none !important; }
.m-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); color: var(--text); }
.m-item:hover { background: var(--bg); }
.m-item.on { background: var(--blue-soft); box-shadow: inset 3px 0 0 var(--blue); }
.mi-who { font-weight: 500; }
.mi-when { color: var(--muted); font-size: 12.5px; text-align: right; }
.mi-sub { grid-column: 1 / -1; color: var(--muted); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mi-st { font-size: 12.5px; color: var(--muted); }
.mi-st::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; background: #8a96a0; vertical-align: 1px; }
.mi-st.ms-in_lucru::before { background: #c27c1b; } .mi-st.ms-asteapta_piese::before { background: #7a62b8; } .mi-st.ms-gata::before { background: #2f8a57; } .mi-st.ms-predat::before { background: var(--blue); }
.mi-owe { font-size: 12.5px; color: var(--red); text-align: right; }
.m-detail { position: relative; overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.m-scroll { flex: 1; min-height: 0; overflow: auto; padding: 26px 40px 30px; }
.m-detail .card { background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; }
.m-detail .page-head a.small { display: none; }
.m-back { display: none; }
.m-none { display: grid; place-items: center; height: 60%; }
/* Bobiță pe pagina fișei: lipit jos, sub conținut — nu mai acoperă nimic */
.cmd-bar.dock-bottom { flex: none; margin: 0 40px 16px; box-shadow: 0 -6px 20px rgba(20, 40, 50, .05), 0 6px 18px rgba(20, 40, 50, .06); }
.m-detail:has(.cmd-bar.dock-bottom)::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 84px; background: var(--card); border-top: 1px solid var(--line); z-index: 0; pointer-events: none; }
.cmd-bar.dock-bottom { position: relative; z-index: 1; }

/* Ecrane mai mici */
@media (max-width: 1100px) {
  .mail { grid-template-columns: 170px 300px minmax(0, 1fr); }
  .m-scroll { padding: 22px 24px 30px; } .cmd-bar.dock-bottom { margin: 0 24px 14px; }
}
@media (max-width: 900px) {
  .mail { grid-template-columns: 1fr; height: auto; min-height: 70vh; }
  #main:has(.mail) { overflow: auto !important; } /* tabletă/telefon: pagina Fișe se derulează normal */
  .m-filters { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px; }
  .m-filters a { white-space: nowrap; gap: 6px; }
  .m-filters .m-new { margin: 0; }
  .mail.has-sel .m-filters, .mail.has-sel .m-list { display: none; }
  .mail:not(.has-sel) .m-detail { display: none; }
  .m-back { display: inline-block; margin-bottom: 10px; font-size: 14px; }
  .m-detail { display: block; overflow: visible; } .m-scroll { overflow: visible; padding: 16px 16px 30px; }
  .m-detail::before { display: none; } .cmd-bar.dock-bottom { position: sticky; bottom: 12px; margin: 0 16px 12px; }
  .board { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .b-col { min-width: 82%; scroll-snap-align: start; }
  .b-hint { display: none; }
}
@media (max-width: 680px) {
  .home .home-hi { font-size: 25px; }
  .cmd-bar.big { margin: 22px 0 30px; }
  .line { grid-template-columns: 52px 1fr; }
  .line .l-end { grid-column: 2; text-align: left; }
  #main:has(.mail) { padding: 0 !important; overflow: auto !important; } /* pe telefon pagina Fișe se derulează */
  .mail { height: auto; }
  .cmd-bar.dock-bottom { bottom: 10px; }
}

.m-filters .m-quick { margin-top: 2px; }
.m-item .mi-mech { grid-column: 1 / -1; }
