/* =====================================================================================================================
   TecMCH - Workshop side stylesheet
   ---------------------------------------------------------------------------------------------------------------------
   Loaded by resources/views/layout/master.blade.php when a workshop-side user is logged in (web guard: Super Admin,
   Admin, Workshop, Workshop Admin, Signatory, Technician ...), after tecmch-common.css.

   Shared styles (brand colour, sidebar, header, loaders, dashboard count cards) are in tecmch-common.css.

   Sections
     1. Work Orders page   (dashboard/work-orders/index, wrapped in .wo-page)

   See README.md in this folder before adding to it.
   ===================================================================================================================== */


/* =====================================================================================================================
   1. Work Orders page (Jobs Dashboard > Work Orders)
   ===================================================================================================================== */

/* Count cards, as the Jobs List's tiles: white, a coloured left bar (--tile), the big number then the label; click to filter */
.wo-page .wo-cards { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.wo-page .wo-card { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 6px; padding: 16px 16px 14px; border: 0; border-radius: 14px; background: #fff; text-align: left; box-shadow: 0 1px 2px rgba(20,35,59,.06); cursor: pointer; transition: transform .18s, box-shadow .18s; }
.wo-page .wo-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(30,58,95,.14); }
.wo-page .wo-card[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--tile), 0 6px 16px rgba(30,58,95,.12); }
.wo-page .wo-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--tile); }
.wo-page .wo-card strong { font-size: 30px; font-weight: 800; color: var(--tile); line-height: 1; }
.wo-page .wo-card span { font-size: 13px; font-weight: 600; color: #0b0b0b; }

/* Tabs + the filter panel under them: one box with the primary-colour border */
.wo-page .wo-tabs { display: flex; flex-wrap: wrap; gap: 6px; background: #fff; border: 2px solid #274698; border-bottom: 1px solid #e3e8f2; border-radius: 16px 16px 0 0; padding: 10px 16px 0; }
.wo-page .wo-tab { border: 0; border-bottom: 3px solid transparent; background: none; padding: 12px 14px; color: #1e2f5a; font-weight: 600; font-size: 14px; }
.wo-page .wo-tab.active { color: #274698; border-bottom-color: #274698; }
.wo-page .wo-tab span { font-size: 11px; font-weight: 700; color: #1e2f5a; background: #e9edf5; border-radius: 12px; padding: 2px 8px; margin-left: 6px; }
.wo-page .wo-panel { background: #fff; border: 2px solid #274698; border-top: 0; border-radius: 0 0 16px 16px; padding: 20px 22px; margin-bottom: 14px; }
.wo-page .wo-panel h3 { color: #0b0b0b; font-weight: 700; }
.wo-page .wo-panel .text-muted { color: #1e2f5a !important; }

/* Filters */
.wo-page .wo-filters { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)) auto; gap: 12px; margin-top: 16px; align-items: end; }
.wo-page .wo-filters label { font-size: 12px; color: #0b0b0b; font-weight: 700; margin-bottom: 6px; display: block; }
.wo-page .wo-filters .form-control,
.wo-page .wo-filters .form-select { background-color: #fff; border: 1px solid #c9d3e6; border-radius: 8px; }

/* Buttons in the panel: the off one of By Work Order / All Jobs and Expand / Collapse All outlined; Reset light blue */
#paneReceived .btn.btn-light { background: #fff; border: 1px solid #c9d3e6; color: #1e2f5a; }
#paneReceived #expandAll,
#paneReceived #collapseAll { border-color: #274698; color: #274698; }
#paneReceived .btn.btn-light:hover { background: #f3f6fb; }
#paneReceived #fReset { background: #e9edf5; border-color: #e9edf5; color: #274698; font-weight: 600; }

/* SLA legend */
.wo-page .wo-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: #0b0b0b; padding: 12px 0 4px; }
.wo-page .wo-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }

/* A work order (batch) and its lines */
.wo-page .wo-batch { background: #fff; border: 1px solid #e4eaf0; border-radius: 9px; margin: 10px 0; overflow: hidden; }
.wo-page .wo-batchhead { display: flex; align-items: center; gap: 14px; padding: 12px 15px; background: #fafcfe; flex-wrap: wrap; }
.wo-page .wo-batchhead .meta { color: #5d7185; }
.wo-page .wo-caret { border: 0; background: none; font-size: 15px; color: #245c88; width: 26px; }
/* Fits the page: no sideways scrolling - long values wrap onto the next line */
.wo-page table.wo-table { width: 100%; }
/* Fixed header: only the rows of a long table scroll */
.wo-page .table-responsive:has(> .wo-table) { max-height: max(260px, calc(100vh - 280px)); overflow: auto; }
.wo-page .wo-table thead th { position: sticky; top: 0; z-index: 2; }
.wo-page .wo-table th, .wo-page .wo-table td { white-space: normal; overflow-wrap: break-word; }
.wo-page .wo-table th:has(.form-check-input), .wo-page .wo-table td:has(> .form-check-input) { width: 36px; }
.wo-page .wo-table td .d-flex { flex-wrap: wrap; }
.wo-page .wo-table th { overflow-wrap: normal !important; font-size: 11px; color: #000000; background: #f3f7fa; font-weight: 700; padding: 10px 9px; text-transform: uppercase; }
.wo-page .wo-table td { padding: 10px 6px; border-bottom: 1px solid #eaf0f4; vertical-align: middle; }

/* Status pills */
.wo-page .wo-pill { font-size: 11px; border-radius: 5px; padding: 3px 7px; background: #eaf3fc; color: #24628e; display: inline-block; font-weight: 600; }
.wo-page .wo-pill.wait { background: #fff4e4; color: #9a6a23; }
.wo-page .wo-pill.good { background: #e9f6ee; color: #21754b; }
.wo-page .wo-pill.bad { background: #fcecee; color: #ac3542; }

/* SLA progress bar */
.wo-page .wo-progress { width: 100%; max-width: 100px; height: 6px; border-radius: 5px; background: #e2e9f0; overflow: hidden; }
.wo-page .wo-progress i { display: block; height: 100%; }

.wo-page .wo-bulk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 4px 0; }
.wo-page .wo-audit { padding: 10px 0; border-bottom: 1px solid #eef2f6; }
.wo-page .btn-xs { padding: 5px 9px !important; font-size: 12px; }
/* Black text across the page and its Assign pop-up (buttons, status pills and red warnings keep their colours) */
.wo-page, #woAssignModal,
.wo-page .text-muted, #woAssignModal .text-muted,
.wo-page .wo-panel .text-muted,
.wo-page [class*="text-gray-"], #woAssignModal [class*="text-gray-"],
.wo-page .wo-tab:not(.active), .wo-page .wo-tab span,
.wo-page .wo-batchhead .meta, .wo-page .wo-caret,
.wo-page .wo-table th, .wo-page .wo-table td,
.wo-page .wo-filters .form-control, .wo-page .wo-filters .form-select { color: #0b0b0b !important; }
.wo-page .wo-filters .form-control::placeholder { color: #4a6794; }

/* Assign modal: people to pick */
#woAssignModal .wo-people { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-height: 55vh; overflow-y: auto; }
#woAssignModal .wo-person { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 38px 10px 10px; border: 1px solid #e4e6ef; border-radius: 8px; cursor: pointer; }
#woAssignModal .wo-person.is-on { border-color: #0b8ad6; background: #f1faff; }
#woAssignModal .wo-person input { position: absolute; top: 10px; right: 10px; }

@media (max-width: 1100px) {
    .wo-page .wo-cards { grid-template-columns: repeat(3, 1fr); }
    .wo-page .wo-filters { grid-template-columns: repeat(3, 1fr); }
    #woAssignModal .wo-people { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .wo-page .wo-cards,
    .wo-page .wo-filters,
    #woAssignModal .wo-people { grid-template-columns: 1fr 1fr; }
}
