/**
 * Planning Timeline - Styles
 * Follows Dolibarr theme (like Board)
 */

/* Page layout - transparent background, inherit Dolibarr colors */
.pl-timeline-page {
  margin-top: 10px;
  padding: 10px 8px;
  background: transparent;
  color: var(--colortext, #333);
  /* Constrain to viewport: 100vh - Dolibarr top menu (~50px) - margins (~70px) */
  height: calc(100vh - 148px);
  max-height: calc(100vh - 148px);
  display: flex;
  flex-direction: column;
  overflow: hidden; /* NO scrollbars on page wrapper */
  overflow-x: hidden; /* Explicit: no horizontal scroll on page */
  box-sizing: border-box;
}

/* Nav tab colours — base shape (.pl-tab-sm) defined in board.css */
/* .pl-tab-board / .pl-tab-planning / .pl-tab-gantt colours defined in board.css */

/* Two-panel container - fills remaining height */
.pl-timeline-container {
  display: flex;
  gap: 16px;
  flex: 1 1 0;
  min-height: 0; /* Critical: allow flex child to shrink below content */
  overflow: hidden;
  overflow-x: hidden; /* Explicit: no horizontal scroll on container */
}

/* Left panel - Job card */
.pl-timeline-left {
  flex: 0 0 280px;
  overflow-y: auto;
  overflow-x: hidden; /* No horizontal scroll on left panel */
  min-height: 0;
}

.pl-job-card {
  background: var(--colorbackbody, #ffffff);
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  padding: 14px;
  min-height: 180px;
  color: var(--colortext, #333);
}

.pl-job-card-placeholder {
  color: #888;
  font-style: italic;
  text-align: center;
  padding: 40px 10px;
}

.pl-job-card-header {
  border-bottom: 1px solid rgba(0,0,0,0.08);
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.pl-job-card-title {
  font-size: 15px;
  font-weight: 700;
  color: inherit;
  margin-bottom: 4px;
}

.pl-job-card-status {
  font-size: 11px !important;
  margin-bottom: 8px;
}

.pl-job-card-machine {
  font-size: 12px;
  color: #666;
  font-weight: 500;
}

.pl-job-card-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Stats row */
.pl-job-card-row {
  display: flex;
  gap: 8px;
}

.pl-job-card-stat {
  flex: 1;
  background: rgba(0,0,0,0.03);
  border-radius: 6px;
  padding: 8px 6px;
  text-align: center;
}

.pl-job-card-stat-value {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--colortext, #333);
}

.pl-job-card-stat-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  color: #888;
  margin-top: 2px;
}

.pl-job-card-notice {
  background: rgba(182,146,26,0.1);
  color: #8a6d00;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 4px;
  text-align: center;
}

.pl-job-card-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pl-job-card-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: #666;
  letter-spacing: 0.3px;
}

.pl-job-card-segments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pl-job-card-seg {
  background: rgba(25,168,122,0.12);
  color: #148a62;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.pl-job-card-seg-overflow {
  background: rgba(188,0,0,0.1);
  color: #bc0000;
}

/* Collapsible details */
.pl-job-card-details {
  border-top: 1px solid rgba(0,0,0,0.06);
  padding-top: 10px;
  margin-top: 4px;
}

.pl-job-card-details summary {
  font-size: 12px;
  color: #666;
  cursor: pointer;
  user-select: none;
}

.pl-job-card-details summary:hover {
  color: #333;
}

.pl-job-card-details-body {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pl-job-card-detail {
  font-size: 12px;
  color: #555;
}

.pl-job-card-detail span {
  color: #888;
}

/* Right panel - Timeline (ONLY scroll container for horizontal) */
.pl-timeline-right {
  flex: 1 1 auto;
  width: 0; /* Force flex to control width, enables overflow */
  overflow: auto; /* Both X and Y scroll here only */
  min-height: 0; /* Critical: allow shrinking */
  min-width: 0;  /* Critical: allow shrinking */
}

.pl-timeline-grid {
  display: flex;
  flex-direction: column;
  /* CSS variables set by JS: dayWidth = clamp(55, availableWidth/days, 110) */
  --pl-day-count: 14;
  --pl-day-width: 80px;
  --pl-machine-width: 140px;
  /* Exact width from CSS vars */
  width: calc(var(--pl-machine-width) + (var(--pl-day-count) * var(--pl-day-width)));
  min-width: calc(var(--pl-machine-width) + (var(--pl-day-count) * var(--pl-day-width)));
  /* Grow to fill available height */
  height: 100%;
  position: relative; /* Anchor for toggle button positioning */
  gap: 0; /* Remove gaps between rows */
}

/* Compact mode adjustments for narrow day columns */
.pl-timeline-grid.pl-compact .pl-tl-day-cell {
  padding: 4px 2px;
}
.pl-timeline-grid.pl-compact .pl-tl-day-label {
  font-size: 10px;
}
.pl-timeline-grid.pl-compact .pl-tl-day-date {
  font-size: 9px;
}
.pl-timeline-grid.pl-compact .pl-tl-job-block {
  padding: 2px 3px;
  font-size: 9px;
}
.pl-timeline-grid.pl-compact .pl-tl-job-hours {
  display: none;
}
.pl-timeline-grid.pl-compact .pl-tl-job-ref {
  font-size: 8px;
}

.pl-timeline-loading,
.pl-timeline-error,
.pl-tl-empty {
  padding: 40px;
  text-align: center;
  color: #666;
  font-style: italic;
}

.pl-timeline-error {
  color: #bc0000;
}

/* Timeline rows */
.pl-tl-row {
  display: flex;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  flex: 1 0 auto; /* Grow equally, don't shrink */
}

.pl-tl-header-row {
  background: var(--colorbackbody, #ffffff);
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 2px solid rgba(0,0,0,0.1);
  flex: 0 0 auto; /* Header never grows — fixed height */
}

.pl-tl-machine-row {
  transition: background 0.1s;
}

.pl-tl-machine-row:nth-child(even) {
  background: rgba(0,0,0,0.015);
}

.pl-tl-machine-row:hover {
  background: rgba(25,168,122,0.04);
}

/* Machine cell - sticky on horizontal scroll */
.pl-tl-machine-cell {
  flex: 0 0 var(--pl-machine-width, 140px);
  padding: 10px 12px;
  border-right: 2px solid rgba(0,0,0,0.08);
  background: var(--colorbackbody, #ffffff);
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
  position: sticky;
  left: 0;
  z-index: 6; /* above gantt bars (z-index:5) so sticky column stays on top when scrolling */
}

.pl-tl-header-machine {
  font-weight: 700;
  font-size: 12px;
  color: #666;
  z-index: 11; /* Above header row and machine cells */
  padding: 6px 12px; /* override .pl-tl-machine-cell padding to keep header compact */
}

.pl-tl-machine-ref {
  font-weight: 700;
  font-size: 13px;
  color: var(--colortext, #333);
}

.pl-tl-machine-label {
  font-size: 10px;
  color: #888;
  margin-top: 2px;
}

/* Day cells */
.pl-tl-day-cell {
  flex: 0 0 var(--pl-day-width, 80px);
  min-height: 54px;
  padding: 6px 4px;
  border-right: 1px solid rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
  background: transparent;
  box-sizing: border-box;
}

/* Gantt rows have fixed height driven by bar content, not flex-grow */
.pl-tl-gantt-row {
  flex: 0 0 auto;
  min-height: 54px;
}

/* Header day cells don't need min-height */
.pl-tl-header-row .pl-tl-day-cell {
  min-height: 0;
}

.pl-tl-header-day {
  text-align: center;
  min-height: auto;
  padding: 8px 6px;
  background: var(--colorbackbody, #ffffff);
  border-bottom: 2px solid rgba(0,0,0,0.08);
}

.pl-tl-day-label {
  font-weight: 700;
  font-size: 12px;
  color: var(--colortext, #333);
}

.pl-tl-day-date {
  font-size: 10px;
  color: #888;
}

/* Job blocks - consistent green (like Board in-progress) */
.pl-tl-job-block {
  background: linear-gradient(135deg, #19a87a 0%, #148a62 100%);
  color: #fff;
  border-radius: 4px;
  padding: 3px 4px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2px;
  box-sizing: border-box;
  overflow: hidden;
}

.pl-tl-job-block:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}

/* Gantt mode: container for job bars */
.pl-tl-gantt-row {
  position: relative;
}

.pl-tl-gantt-bars-container {
  position: absolute;
  top: 0;
  left: 140px; /* Match machine cell width */
  right: 0;
  height: 100%;
  overflow: hidden;
  pointer-events: none; /* Allow clicks to pass through to day cells */
}

/* Gantt mode: job bars (absolutely positioned) */
.pl-tl-job-gantt-bar {
  position: absolute;
  /* top and height set inline by JS (multi-lane) */
  height: 24px;
  background: linear-gradient(135deg, #c9a030 0%, #b6921a 100%);
  border: 1px solid #8a6d0e;
  border-radius: 3px;
  padding: 2px 4px;
  color: #fff;
  font-size: 9px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: auto;
  transition: box-shadow 0.1s, transform 0.1s;
  z-index: 5;
  box-sizing: border-box;
}

.pl-tl-job-gantt-bar:hover {
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  transform: translateY(-1px);
}

/* Label inside gantt bar - clipped with ellipsis instead of JS clearing */
.pl-tl-gantt-bar-label {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 100%;
}

.pl-tl-gantt-day-cell {
  border-right: 1px solid rgba(0,0,0,0.05);
}

.pl-tl-job-selected {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #19a87a;
}

/* ── MO Gantt section separator ── */
.pl-tl-section-header {
  background: #4a6080;
  border-top: 2px solid #2d3f55;
  flex: 0 0 auto;
  padding: 0;
}

/* Label cell: reuses pl-tl-machine-cell for sticky + flex sizing.
   Only override: background, text colour, z-index above machine cells. */
.pl-tl-section-label-cell {
  background: #4a6080 !important; /* override pl-tl-machine-cell white bg */
  color: #e8f4ff !important;       /* bright text, readable on dark bg */
  border-right-color: rgba(255,255,255,0.15) !important;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  justify-content: flex-start;
  z-index: 7 !important;           /* above regular machine cells (z-index:6) */
}

/* Filler day cells: match day-cell width via CSS var, plain dark fill */
.pl-tl-section-day-cell {
  flex: 0 0 var(--pl-day-width, 80px);
  background: #4a6080;
  border-right: 1px solid rgba(255,255,255,0.08);
  box-sizing: border-box;
  min-height: 0;
}

/* ── MO Gantt bar variants ── */
/* Note: position:absolute on .pl-tl-job-gantt-bar already creates containing block for children */
.pl-gantt-bar-inprogress {
  background: linear-gradient(135deg, #22c490 0%, #19a87a 100%);
  border-color: #117a58;
}
.pl-gantt-bar-done {
  background: linear-gradient(135deg, #8e9aaa 0%, #6c7885 100%);
  border-color: #546270;
  opacity: 0.75;
}
.pl-gantt-bar-progress {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: rgba(255,255,255,0.22);
  pointer-events: none;
}
.pl-tl-now-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(210, 35, 35, 0.70);
  pointer-events: none;
  z-index: 2; /* below gantt bars (z-index:5) and machine cells (z-index:6) */
  border-radius: 1px;
}

/* ── MO Gantt card inner grid layout (P4) ── */
.pl-job-card-inner .pl-job-card-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 2px 8px;
  padding: 2px 0;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.pl-job-card-inner .pl-job-card-row:last-of-type {
  border-bottom: none;
}
.pl-job-card-inner .pl-job-card-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #999;
  align-self: center;
}
.pl-job-card-inner .pl-job-card-value {
  font-size: 12px;
  font-weight: 500;
  color: #222;
  align-self: center;
  word-break: break-word;
}
.pl-job-card-inner .pl-job-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #1a2535;
  margin-bottom: 4px;
}

/* ── P5: Today column highlight ── */
.pl-tl-day-cell[data-today="1"] {
  background: rgba(25,168,122,0.07);
}
.pl-tl-header-day[data-today="1"] .pl-tl-day-label,
.pl-tl-header-day[data-today="1"] .pl-tl-day-date {
  color: #19a87a;
  font-weight: 700;
}

/* ── P5: Weekend column dimming ── */
.pl-tl-day-cell[data-weekend="1"] {
  background: rgba(0,0,0,0.025);
}
.pl-tl-header-day[data-weekend="1"] .pl-tl-day-label,
.pl-tl-header-day[data-weekend="1"] .pl-tl-day-date {
  color: #bbb;
}
.pl-job-card-status {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 10px;
  margin-bottom: 10px;
  background: #ddd;
  color: #555;
}
.pl-job-card-status.pl-status-1 { background: #d4edda; color: #155724; }
.pl-job-card-status.pl-status-2 { background: #fff3cd; color: #856404; }
.pl-job-card-status.pl-status-3 { background: #e2e3e5; color: #383d41; }

.pl-job-card-value {
  font-weight: 500;
  color: #222;
  text-align: right;
  word-break: break-word;
}

/* ── Mini progress bar in MO card ── */
.pl-card-progress-bar {
  height: 6px;
  background: #e5e5e5;
  border-radius: 3px;
  margin-top: 10px;
  overflow: hidden;
}
.pl-card-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #19a87a 0%, #0d7a58 100%);
  border-radius: 3px;
  transition: width 0.3s;
}

.pl-tl-job-ref {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.pl-tl-job-hours {
  font-size: 9px;
  opacity: 0.85;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Available capacity indicator */
.pl-tl-available {
  height: 3px;
  background: rgba(25,168,122,0.15);
  border-radius: 2px;
  margin-top: auto;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Page becomes a normal block — no flex height tricks */
  .pl-timeline-page {
    display: block;
    height: auto;
    max-height: none;
    overflow: visible;
    padding: 6px 8px;
  }

  /* Container is the only element with a concrete height */
  .pl-timeline-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 62vh;
    min-height: 300px;
    overflow: hidden;
    flex: none; /* cancel base flex:1 1 0 */
  }

  /* Left panel: hidden when placeholder (no MO selected) */
  .pl-timeline-left {
    flex: 0 0 auto;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    max-height: 180px;
    transition: max-height 0.2s ease;
  }
  .pl-timeline-left:has(.pl-job-card-placeholder) {
    max-height: 0;
    overflow: hidden;
  }

  .pl-timeline-right {
    flex: 1 1 0;
    width: 100%; /* override base width:0 — in column flex, stretch doesn't apply to explicit width */
    min-height: 0;
    overflow: auto;
  }

  /* Narrower machine label column */
  .pl-timeline-grid {
    --pl-machine-width: 90px;
  }
  .pl-tl-machine-cell {
    flex: 0 0 90px;
    padding: 6px 8px;
  }
  .pl-tl-gantt-bars-container {
    left: 90px;
  }
  .pl-tl-machine-ref   { font-size: 11px; }
  .pl-tl-machine-label { font-size: 9px; }
}

/* Very small screens — hide left panel entirely */
@media (max-height: 600px) {
  .pl-timeline-page {
    height: calc(100vh - 80px);
    max-height: calc(100vh - 80px);
  }

  .pl-timeline-left {
    display: none;
  }
}

/* ========== ADD JOB BUTTON ========== */
.pl-btn-add-job {
  background: linear-gradient(135deg, #19a87a 0%, #148a62 100%);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}

.pl-btn-add-job:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(25,168,122,0.3);
}

.pl-btn-add-job:active {
  transform: translateY(0);
}


.pl-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.pl-modal-overlay.pl-modal-open {
  display: flex;
}

/* ========== MODAL BOX ========== */
.pl-modal {
  background: var(--colorbackbody, #ffffff);
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  width: 90%;
  max-width: 450px;
  max-height: 90vh;
  overflow-y: auto;
  color: var(--colortext, #333);
}

.pl-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

.pl-modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.pl-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #888;
  padding: 0;
  line-height: 1;
}

.pl-modal-close:hover {
  color: #333;
}

.pl-modal-body {
  padding: 20px;
}

.pl-modal-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(0,0,0,0.1);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ========== FORM ELEMENTS ========== */
.pl-form-group {
  margin-bottom: 16px;
}

.pl-form-group:last-child {
  margin-bottom: 0;
}

.pl-form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #666;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.pl-form-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 6px;
  background: var(--colorbackbody, #fff);
  color: var(--colortext, #333);
  box-sizing: border-box;
}

.pl-form-input:focus {
  outline: none;
  border-color: #19a87a;
  box-shadow: 0 0 0 3px rgba(25,168,122,0.15);
}

.pl-form-readonly {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  background: rgba(0,0,0,0.03);
  color: var(--colortext, #333);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 6px;
  box-sizing: border-box;
  min-height: 40px;
  display: flex;
  align-items: center;
}

.pl-form-error {
  color: #bc0000;
  font-size: 13px;
  margin-top: 12px;
  min-height: 18px;
}

/* ========== MODAL BUTTONS ========== */
.pl-btn {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.pl-btn-cancel {
  background: rgba(0,0,0,0.08);
  color: #666;
}

.pl-btn-cancel:hover {
  background: rgba(0,0,0,0.12);
}

.pl-btn-submit {
  background: linear-gradient(135deg, #19a87a 0%, #148a62 100%);
  color: #fff;
}

.pl-btn-submit:hover {
  box-shadow: 0 2px 8px rgba(25,168,122,0.3);
}

.pl-btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ========== CLICKABLE DAY CELLS ========== */
.pl-tl-machine-row .pl-tl-day-cell {
  cursor: pointer;
  transition: background 0.1s;
}

.pl-tl-machine-row .pl-tl-day-cell:hover {
  background: rgba(25,168,122,0.08);
}

/* ========== JOB CARD EDIT MODE ========== */

/* Header with actions */
.pl-job-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.pl-job-card-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  flex-shrink: 0;
}

.pl-job-card-header-actions-left {
  display: flex;
  gap: 4px;
}

.pl-job-card-header-actions-right {
  display: flex;
  gap: 4px;
}

.pl-btn-edit-job {
  background: rgba(0,0,0,0.06);
  color: #666;
  border: none;
  border-radius: 4px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.pl-btn-edit-job:hover {
  background: rgba(25,168,122,0.15);
  color: #148a62;
}

.pl-btn-delete-job {
  background: rgba(220,53,69,0.08);
  color: #c33;
  border: none;
  border-radius: 4px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.pl-btn-delete-job:hover {
  background: rgba(220,53,69,0.15);
  color: #d32f2f;
}

.pl-btn-create-mo {
  background: rgba(0,123,255,0.08);
  color: #0078d4;
  border: none;
  border-radius: 4px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.pl-btn-create-mo:hover {
  background: rgba(0,123,255,0.15);
  color: #0056b3;
}

/* Edit mode header */
.pl-job-card-edit-header {
  background: rgba(25,168,122,0.08);
  border-bottom-color: rgba(25,168,122,0.2);
}

/* Edit form */
.pl-job-card-edit-form {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.pl-job-card-edit-form .pl-job-card-body {
  flex: 1;
  overflow-y: auto;
}

.pl-job-card-edit-form .pl-form-group {
  margin-bottom: 12px;
}

.pl-job-card-edit-form .pl-form-label {
  font-size: 11px;
  margin-bottom: 4px;
}

.pl-job-card-edit-form .pl-form-input {
  padding: 8px 10px;
  font-size: 13px;
}

.pl-job-card-edit-form textarea.pl-form-input {
  resize: vertical;
  min-height: 50px;
}

/* Edit form footer */
.pl-job-card-edit-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(0,0,0,0.08);
  margin-top: 12px;
}

.pl-job-card-edit-footer .pl-btn {
  padding: 8px 16px;
  font-size: 13px;
}

/* Scheduled time display in view mode */
.pl-job-card-dates {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pl-job-card-date {
  font-size: 12px;
  color: #555;
}

.pl-job-card-date span {
  color: #888;
}

/* Notes display in view mode */
.pl-job-card-notes {
  font-size: 12px;
  color: #555;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Product autocomplete */
.pl-autocomplete-container {
  position: relative;
  width: 100%;
}

.pl-autocomplete-results {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ccc;
  border-radius: 4px;
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
  list-style: none;
  margin: 0;
  padding: 0;
  z-index: 10000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: none;
}

.pl-autocomplete-results:not(:empty) {
  display: block;
}

.pl-autocomplete-item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.15s;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pl-autocomplete-item:hover {
  background-color: #f9f9f9;
}

.pl-autocomplete-item:last-child {
  border-bottom: none;
}

.pl-autocomplete-no-results {
  padding: 10px 12px;
  color: #999;
  font-size: 13px;
  text-align: center;
}
