/* Maintenance management (docs/maintenance-management.md): arrangement and status colours only. Controls,
   buttons, dialogs and tables use the shared UI foundation; no outlines. */
.smShell { display: grid; gap: 16px; min-width: 0; }
.smContent { display: grid; gap: 16px; min-width: 0; }
.smBar .pageHeader { flex-wrap: wrap; gap: 8px 12px; }
.smFilters { max-width: 1400px; }
.smTabs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.smTabs > button, .smQuick > button { width: auto; margin-top: 0; }
.smQuick { flex-wrap: wrap; }
.smHint { color: #64748b; font-size: 12px; }
.smNotice { color: #92400e; background: #fffbeb; border: 1px solid #fde68a; border-radius: 6px; padding: 8px 12px; }
.smWarn { color: #b45309; }

/* Status chips: planned, due, overdue, in progress, completed, cancelled. */
.smStatus { display: inline-block; border-radius: 999px; padding: 1px 8px; white-space: nowrap; background: #e2e8f0; color: #1f2937; }
.smStatus[data-status="planned"] { background: #e0f2fe; color: #075985; }
.smStatus[data-status="due"] { background: #fef3c7; color: #92400e; }
.smStatus[data-status="overdue"] { background: #fee2e2; color: #991b1b; }
.smStatus[data-status="in_progress"] { background: #ede9fe; color: #5b21b6; }
.smStatus[data-status="completed"] { background: #dcfce7; color: #166534; }
.smStatus[data-status="cancelled"] { background: #f1f5f9; color: #475569; }

/* Overview tiles. */
.smTiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.smTiles .smTile { display: grid; gap: 2px; justify-items: start; text-align: left; width: 100%; margin-top: 0; padding: 12px 14px; border-left: 4px solid #94a3b8; }
.smTile strong { font-size: 24px; line-height: 1.1; }
.smTile[data-status="overdue"] { border-left-color: #dc2626; }
.smTile[data-status="due"] { border-left-color: #d97706; }
.smTile[data-status="in_progress"] { border-left-color: #7c3aed; }
.smTile[data-status="planned"] { border-left-color: #0284c7; }
.smTile[data-status="findings"], .smTile[data-status="actions"] { border-left-color: #b45309; }

/* Calendar. */
.smCalendar .pageHeader { flex-wrap: wrap; gap: 8px; }
.smCalendar .pageHeaderActions { flex-wrap: wrap; }
.smGrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 12px; }
.smWeekday { font-weight: 600; color: #475569; padding: 4px 6px; }
.smDay { min-height: 96px; min-width: 0; border: 1px solid #e2e8f0; border-radius: 6px; padding: 4px; display: flex; flex-direction: column; gap: 3px; background: #fff; }
.smGrid-week .smDay { min-height: 220px; }
.smDay.smOutside { background: #f8fafc; color: #94a3b8; }
.smDay.smToday { border-color: #287db5; box-shadow: inset 0 0 0 1px #287db5; }
.smDate { font-weight: 600; }
.smDay .smEvent { width: 100%; margin-top: 0; padding: 2px 6px; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-left: 3px solid #94a3b8; }
.smEvent[data-status="planned"] { border-left-color: #0284c7; }
.smEvent[data-status="due"] { border-left-color: #d97706; }
.smEvent[data-status="overdue"] { border-left-color: #dc2626; }
.smEvent[data-status="in_progress"] { border-left-color: #7c3aed; }
.smEvent[data-status="completed"] { border-left-color: #16a34a; }
.smEvent[data-status="cancelled"] { border-left-color: #94a3b8; text-decoration: line-through; }

/* Execution view. */
.smView { display: grid; gap: 16px; min-width: 0; }
.smView .mhomeActions { flex-wrap: wrap; }
.smView .mhomeActions > button, .smView .mhomeActions > span > button { width: auto; margin-top: 0; }
.smTitle { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.smTitle h2 { margin: 0; }
.smFacts { margin-block: 8px 12px; }
.smFacts dd { overflow-wrap: anywhere; }
.smForm { max-width: 1200px; }
.smForm textarea { width: 100%; }
.smTask { border: 1px solid #e2e8f0; border-radius: 8px; padding: 12px; display: grid; gap: 8px; min-width: 0; }
.smTaskHead { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.smResults { display: flex; flex-wrap: wrap; gap: 6px; border: 0; padding: 0; margin: 0; }
.smResults legend { padding: 0; margin-bottom: 4px; font-weight: 600; }
.smResults > .smResult { width: auto; flex: 0 1 auto; margin: 0; }
.smResult { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #cbd5e1; border-radius: 6px; padding: 6px 10px; cursor: pointer; }
.smResult input { width: auto; margin: 0; }
.smResult:has(input:checked)[data-result="done"] { background: #dcfce7; border-color: #16a34a; }
.smResult:has(input:checked)[data-result="not_done"] { background: #fee2e2; border-color: #dc2626; }
.smResult:has(input:checked)[data-result="not_applicable"] { background: #f1f5f9; border-color: #64748b; }
.smResult:has(input:checked)[data-result="defect"] { background: #ffedd5; border-color: #ea580c; }
.smFiles { margin: 0; padding-left: 18px; }
.smFiles li { overflow-wrap: anywhere; }
.smCheck { display: flex; align-items: center; gap: 6px; }
.smCheck input { width: auto; }
.smTaskList { margin: 2px 0 8px 24px; padding: 0; color: #475569; }
.smTaskRow { align-items: end; border-bottom: 1px solid #e2e8f0; padding-bottom: 8px; }
.smTaskRow > button { width: auto; }
.smView .gatewayTableWrapper, .smWideDialog .gatewayTableWrapper, .smContent .gatewayTableWrapper { min-width: 0; max-width: 100%; overflow: auto; }
dialog.smWideDialog { --dialog-target-width: 1200px; }

/* Tablet and phone: one column, calendar becomes a compact agenda-like grid. */
@media (max-width: 760px) {
    .smFacts { grid-template-columns: minmax(0, 1fr); }
    .smFacts dt { font-weight: 600; }
    .smDay { min-height: 64px; }
    .smDay .smEvent { white-space: normal; }
    .smGrid-week { grid-template-columns: minmax(0, 1fr); }
    .smGrid-week .smWeekday { display: none; }
    .smGrid-week .smDay { min-height: 0; }
    .smResult { flex: 1 1 calc(50% - 6px); }
}
@media (max-width: 480px) {
    .smGrid-month .smEvent { font-size: 11px; padding: 1px 3px; }
    .smTiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
