/* BravesTickets Technician Planner */
.technician-planner-page .planner-shell { gap: 1rem; }
.planner-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: linear-gradient(135deg, #101827, #172033 55%, #231b09);
  color: #fff;
  border: 1px solid rgba(255, 202, 40, .28);
  box-shadow: 0 18px 40px rgba(0,0,0,.18);
}
.planner-hero h1 { margin: .15rem 0 .35rem; color: #fff; }
.planner-hero p { color: rgba(255,255,255,.78); margin: 0; max-width: 760px; }
.planner-kicker {
  margin: 0 0 .2rem;
  color: #f8c32d !important;
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 900;
}
.planner-actions-top { display: flex; align-items: end; gap: .65rem; flex-wrap: wrap; }
.planner-tech-picker { display: grid; gap: .25rem; min-width: 230px; }
.planner-tech-picker label { font-size: .78rem; font-weight: 800; color: rgba(255,255,255,.72); text-transform: uppercase; letter-spacing: .06em; }
.planner-tech-picker select {
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.08);
  color: #fff;
  padding: .65rem .8rem;
  font-weight: 800;
}
.planner-tech-picker option { color: #111827; }
.planner-selected-tech {
  padding: .7rem .9rem;
  border-radius: 12px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18);
  color: #fff;
}
.planner-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, .75fr);
  gap: 1rem;
  align-items: start;
}
.planner-panel {
  overflow: hidden;
  border: 1px solid rgba(15,23,42,.1);
}
.planner-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .8rem;
}
.planner-panel-head h2 { margin: 0; }
.planner-count {
  white-space: nowrap;
  border-radius: 999px;
  padding: .35rem .65rem;
  background: #111827;
  color: #fff;
  font-size: .8rem;
  font-weight: 900;
}
.planner-queue,
.planner-available-list {
  display: grid;
  gap: .55rem;
}
.planner-ticket,
.planner-available-ticket {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto auto;
  gap: .7rem;
  align-items: center;
  padding: .68rem .75rem;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(148,163,184,.28);
  box-shadow: 0 8px 20px rgba(15,23,42,.06);
  position: relative;
}
.planner-ticket { cursor: grab; }
.planner-ticket:active { cursor: grabbing; }
.planner-ticket.dragging { opacity: .55; transform: scale(.995); }
.planner-ticket::before,
.planner-available-ticket::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 6px;
  border-radius: 0 8px 8px 0;
  background: #7dd3fc;
}
.planner-priority-urgent::before { background: #ff5757; }
.planner-priority-high::before { background: #f8c32d; }
.planner-priority-normal::before { background: #7dd3fc; }
.planner-priority-low::before { background: #94a3b8; }
.planner-rank {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #111827;
  color: #f8c32d;
  font-weight: 1000;
  font-size: 1.05rem;
}
.planner-main { min-width: 0; }
.planner-ticket-top {
  display: flex;
  gap: .5rem;
  align-items: center;
  min-width: 0;
}
.planner-ticket-top a {
  color: #111827;
  text-decoration: none;
  font-weight: 1000;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.planner-ticket-top a:hover { text-decoration: underline; }
.planner-age { color: #64748b; font-size: .76rem; font-weight: 800; white-space: nowrap; }
.planner-subject {
  margin-top: .12rem;
  color: #111827;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.planner-meta {
  margin-top: .25rem;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  color: #475569;
  font-size: .78rem;
  font-weight: 750;
}
.planner-meta span {
  border-radius: 999px;
  padding: .16rem .45rem;
  background: #f1f5f9;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.planner-badges { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; justify-content: end; }
.planner-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: .26rem .55rem;
  font-size: .72rem;
  font-weight: 1000;
  letter-spacing: .02em;
  color: #111827;
  background: #e2e8f0;
}
.planner-badge.priority.urgent { background: #ff5757; color: #fff; }
.planner-badge.priority.high { background: #f8c32d; color: #111827; }
.planner-badge.priority.normal { background: #7dd3fc; color: #082f49; }
.planner-badge.priority.low { background: #cbd5e1; color: #334155; }
.planner-badge.status { background: #dcfce7; color: #166534; }
.planner-icon-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: #fee2e2;
  color: #991b1b;
  font-size: 1.2rem;
  font-weight: 1000;
  cursor: pointer;
}
.planner-remove-form { margin: 0; }
.planner-save-row,
.planner-clear-form {
  margin-top: .8rem;
  display: flex;
  align-items: center;
  gap: .65rem;
}
.planner-save-status { color: #64748b; font-size: .85rem; font-weight: 750; }
.planner-available-ticket {
  grid-template-columns: minmax(0, 1fr) auto;
  padding-left: 1rem;
}
.planner-available-ticket .planner-ticket-top { justify-content: space-between; }
.planner-empty {
  padding: 1.2rem;
  border-radius: 16px;
  background: #f8fafc;
  color: #64748b;
  font-weight: 800;
  text-align: center;
  border: 1px dashed #cbd5e1;
}
.btn.small {
  padding: .42rem .7rem;
  font-size: .82rem;
  border-radius: 10px;
}
.alert.success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
  border-radius: 12px;
  padding: .75rem 1rem;
  font-weight: 800;
}
.alert.error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
  border-radius: 12px;
  padding: .75rem 1rem;
  font-weight: 800;
}
@media (max-width: 1100px) {
  .planner-grid { grid-template-columns: 1fr; }
  .planner-hero { align-items: stretch; flex-direction: column; }
}
@media (max-width: 720px) {
  .planner-ticket { grid-template-columns: 38px minmax(0, 1fr); }
  .planner-badges, .planner-remove-form { grid-column: 2; justify-content: start; }
  .planner-available-ticket { grid-template-columns: 1fr; }
}

/* Priority-change controls for Technician Planner */
.planner-priority-form { margin: 0; }
.planner-priority-select {
  border: 0;
  border-radius: 999px;
  padding: .28rem 1.85rem .28rem .6rem;
  font-size: .72rem;
  font-weight: 1000;
  letter-spacing: .02em;
  color: #111827;
  background: #e2e8f0;
  cursor: pointer;
  max-width: 118px;
}
.planner-priority-select.urgent { background: #ff5757; color: #fff; }
.planner-priority-select.high { background: #f8c32d; color: #111827; }
.planner-priority-select.normal { background: #7dd3fc; color: #082f49; }
.planner-priority-select.low { background: #cbd5e1; color: #334155; }
.planner-priority-select.quick_win { background: #dcfce7; color: #166534; }
.planner-priority-quick_win::before { background: #22c55e; }
.planner-badge.priority.quick_win { background: #dcfce7; color: #166534; }


/* BravesTickets Planner Phase 2 + better ticket list */
.planner-phase2-page .planner-shell { min-width: 0; }
.planner-kanban-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(210px, 1fr));
  gap: .85rem;
  align-items: stretch;
}
.planner-lane {
  min-width: 0;
  background: #f8fafc;
  border: 1px solid rgba(148,163,184,.28);
  border-radius: 18px;
  padding: .75rem;
  box-shadow: 0 10px 24px rgba(15,23,42,.06);
}
.planner-lane-head { display:flex; justify-content:space-between; gap:.5rem; align-items:flex-start; margin-bottom:.6rem; }
.planner-lane-head h2 { margin:0; font-size:1rem; }
.planner-lane-head p { margin:.15rem 0 0; color:#64748b; font-weight:750; font-size:.76rem; line-height:1.2; }
.planner-lane-drop { min-height: 215px; display:grid; align-content:start; gap:.55rem; }
.planner-lane-empty { display:none; border:1px dashed #cbd5e1; border-radius:14px; color:#94a3b8; font-weight:900; padding:1rem; text-align:center; }
.planner-lane-drop:not(:has(.planner-kanban-card)) .planner-lane-empty { display:block; }
.planner-kanban-card { grid-template-columns: minmax(0,1fr); align-items:start; padding:.65rem .65rem .65rem .8rem; cursor:grab; }
.planner-kanban-card .planner-card-controls { display:flex; flex-wrap:wrap; gap:.35rem; align-items:center; margin-top:.5rem; }
.planner-kanban-card .planner-ticket-top { justify-content:space-between; }
.planner-kanban-card .planner-subject { white-space:normal; line-height:1.25; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.planner-kanban-card .planner-meta span { max-width: 100%; }
.planner-kanban-card.dragging { opacity:.6; transform:rotate(.5deg) scale(.99); }
.planner-lane-today { background: linear-gradient(180deg, #fff7d6, #f8fafc 48%); }
.planner-lane-waiting_parts, .planner-lane-waiting_user { background: linear-gradient(180deg, #eef2ff, #f8fafc 48%); }
.planner-lane-completed_today { background: linear-gradient(180deg, #dcfce7, #f8fafc 50%); }
.planner-phase2-save { position: sticky; bottom: 0; z-index: 5; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); padding:.75rem; border-radius:14px; border:1px solid rgba(148,163,184,.25); }
.phase2-available-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); display:grid; }
.planner-add-form { display:flex; gap:.4rem; justify-content:flex-end; align-items:center; flex-wrap:wrap; }
.planner-add-lane { border-radius:10px; padding:.42rem .55rem; border:1px solid #cbd5e1; font-weight:800; max-width:130px; }
@media (max-width: 1500px) { .planner-kanban-board { grid-template-columns: repeat(3, minmax(220px, 1fr)); } }
@media (max-width: 1050px) { .planner-kanban-board, .phase2-available-grid { grid-template-columns: 1fr; } }

/* Better All Tickets view: no more sideways slider for the big table. */
.bt-ticket-card-list { display:grid; gap:.65rem; }
.bt-ticket-card {
  display:grid;
  grid-template-columns: 132px minmax(220px, 1.35fr) minmax(180px, .85fr) minmax(180px, .85fr) 170px 72px;
  gap:.7rem;
  align-items:center;
  padding:.8rem .85rem;
  border:1px solid rgba(148,163,184,.26);
  border-radius:16px;
  background:#fff;
  box-shadow:0 8px 22px rgba(15,23,42,.055);
  position:relative;
  overflow:hidden;
}
.bt-ticket-card::before { content:''; position:absolute; left:0; top:10px; bottom:10px; width:6px; border-radius:0 8px 8px 0; background:#7dd3fc; }
.bt-ticket-card.row-urgent::before { background:#ff5757; }
.bt-ticket-card.row-high::before { background:#f8c32d; }
.bt-ticket-card-number a { color:#111827; font-weight:1000; text-decoration:none; }
.bt-ticket-card-number small, .bt-ticket-label { display:block; color:#64748b; font-weight:850; font-size:.72rem; text-transform:uppercase; letter-spacing:.04em; }
.bt-ticket-card-subject strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bt-ticket-card-subject small, .bt-ticket-card-cell small { color:#64748b; font-weight:750; }
.bt-ticket-card-cell { min-width:0; font-weight:850; }
.bt-ticket-card-cell .truncate { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bt-ticket-card-badges { display:flex; flex-wrap:wrap; gap:.35rem; }
.bt-ticket-card-actions { text-align:right; }
.bt-ticket-card-actions .table-link { display:inline-flex; align-items:center; justify-content:center; border-radius:10px; background:#111827; color:#fff; padding:.45rem .7rem; text-decoration:none; font-weight:900; }
@media (max-width: 1200px) { .bt-ticket-card { grid-template-columns: 118px minmax(0, 1fr) minmax(160px,.7fr) 150px 62px; } .bt-ticket-card-hide-md { display:none; } }
@media (max-width: 800px) { .bt-ticket-card { grid-template-columns: 1fr; gap:.45rem; } .bt-ticket-card-actions { text-align:left; } .bt-ticket-card-subject strong { white-space:normal; } }

/* Planner Phase 2B: wide layout + contrast cleanup
   Keeps the Technician Planner from feeling squeezed by moving the admin side nav
   into a horizontal top bar only on the planner page. */
html body .technician-planner-page.admin-layout,
html body main.technician-planner-page.admin-layout {
  display: block !important;
  grid-template-columns: none !important;
  max-width: min(1920px, calc(100vw - 24px)) !important;
  width: calc(100vw - 24px) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  overflow-x: hidden !important;
}
html body .technician-planner-page .content-stack,
html body .technician-planner-page .planner-shell {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
}

/* Move the left admin panel to the top on the planner page. */
html body .technician-planner-page .bt-admin-sidebar {
  position: static !important;
  width: 100% !important;
  max-width: none !important;
  min-height: 0 !important;
  margin: 0 0 1rem 0 !important;
  padding: .55rem !important;
  border-radius: 18px !important;
  display: block !important;
}
html body .technician-planner-page .bt-admin-nav {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: .45rem !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  padding-bottom: .1rem !important;
  scrollbar-width: thin;
}
html body .technician-planner-page .bt-admin-nav a {
  flex: 0 0 auto !important;
  min-width: auto !important;
  white-space: nowrap !important;
  padding: .52rem .72rem !important;
  border-radius: 999px !important;
}
html body .technician-planner-page .bt-admin-nav a span:last-child {
  display: inline !important;
}
html body .technician-planner-page .bt-admin-sidebar-footer {
  display: none !important;
}

/* Make the board use the newly freed width without forcing skinny ticket cards. */
html body .planner-phase2-page .planner-kanban-board {
  grid-template-columns: repeat(auto-fit, minmax(305px, 1fr)) !important;
  gap: .9rem !important;
  width: 100% !important;
  overflow: visible !important;
}
html body .planner-phase2-page .planner-lane {
  min-width: 0 !important;
  overflow: visible !important;
}
html body .planner-phase2-page .planner-lane-drop {
  min-width: 0 !important;
}

/* Fix white-on-white/faded text inside planner tickets, forms, and lanes. */
html body .technician-planner-page .planner-panel,
html body .technician-planner-page .planner-lane,
html body .technician-planner-page .planner-ticket,
html body .technician-planner-page .planner-available-ticket,
html body .technician-planner-page .planner-empty,
html body .technician-planner-page .planner-phase2-save {
  color: #111827 !important;
}
html body .technician-planner-page .planner-ticket *,
html body .technician-planner-page .planner-available-ticket *,
html body .technician-planner-page .planner-lane * {
  opacity: 1 !important;
}
html body .technician-planner-page .planner-subject,
html body .technician-planner-page .planner-ticket-top a,
html body .technician-planner-page .planner-card-main,
html body .technician-planner-page .planner-main,
html body .technician-planner-page .planner-panel-head h2,
html body .technician-planner-page .planner-lane-head h2,
html body .technician-planner-page .planner-meta,
html body .technician-planner-page .planner-meta span {
  color: #111827 !important;
}
html body .technician-planner-page .planner-lane-head p,
html body .technician-planner-page .planner-age,
html body .technician-planner-page .planner-save-status {
  color: #475569 !important;
}
html body .technician-planner-page select,
html body .technician-planner-page option,
html body .technician-planner-page input,
html body .technician-planner-page textarea {
  color: #111827 !important;
  background-color: #ffffff !important;
}
html body .technician-planner-page .planner-priority-select.urgent {
  background: #ff5757 !important;
  color: #ffffff !important;
}
html body .technician-planner-page .planner-priority-select.high {
  background: #f8c32d !important;
  color: #111827 !important;
}
html body .technician-planner-page .planner-priority-select.normal {
  background: #7dd3fc !important;
  color: #082f49 !important;
}
html body .technician-planner-page .planner-priority-select.low {
  background: #cbd5e1 !important;
  color: #334155 !important;
}
html body .technician-planner-page .planner-priority-select.quick_win {
  background: #dcfce7 !important;
  color: #166534 !important;
}

/* Available ticket selector: full-width top/bottom style instead of a cramped side panel. */
html body .planner-phase2-page .planner-phase2-available {
  width: 100% !important;
  max-width: none !important;
}
html body .planner-phase2-page .phase2-available-grid {
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)) !important;
}
html body .planner-phase2-page .planner-available-ticket {
  grid-template-columns: minmax(0, 1fr) auto !important;
}
html body .planner-phase2-page .planner-add-form {
  align-items: center !important;
}
html body .planner-phase2-page .planner-add-lane {
  max-width: 155px !important;
  color: #111827 !important;
  background: #fff !important;
}

@media (max-width: 900px) {
  html body .technician-planner-page.admin-layout,
  html body main.technician-planner-page.admin-layout {
    width: calc(100vw - 16px) !important;
  }
  html body .planner-phase2-page .planner-kanban-board,
  html body .planner-phase2-page .phase2-available-grid {
    grid-template-columns: 1fr !important;
  }
  html body .planner-phase2-page .planner-available-ticket {
    grid-template-columns: 1fr !important;
  }
}
