/* =====================================================================
   POSNEW - Repair module   public/css/repair.css   (task 31, 2026-10-02)
   Builds on contacts.css (ct-*), variation-templates.css (vt-*), catalog-lists.css (cl-*).
   ===================================================================== */
.rp-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 16px 16px; padding: 6px; border: 1px solid #e5e7eb; border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.06); }
.ct-page .rp-tabs { margin: 0 0 16px; }
.rp-tabs a { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 8px; color: #475569; font-weight: 600; font-size: 13.5px; text-decoration: none; }
.rp-tabs a:hover { background: #f8fafc; color: #0f172a; text-decoration: none; }
.rp-tabs a.is-active { background: #eff6ff; color: #1d4ed8; }
.rp-tabs__brand { margin-right: auto; padding: 0 10px; color: #0f172a !important; font-weight: 700 !important; }

.rp-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.rp-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 991px) { .rp-grid, .rp-three { grid-template-columns: 1fr; } }
.rp-card { margin-bottom: 14px; padding: 16px; border: 1px solid var(--ct-border, #e2e8f0); border-radius: var(--ct-radius, 14px); background: var(--ct-surface, #ffffff); box-shadow: var(--ct-shadow, 0 1px 3px rgba(15,23,42,.08)); }
.rp-card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.rp-card__title { margin: 0; font-size: 15px; font-weight: 700; }
.rp-card__sub { margin: 2px 0 0; color: var(--ct-text-3); font-size: 12.5px; }

/* status bar */
.rp-bar { display: flex; height: 14px; overflow: hidden; border-radius: 999px; background: var(--ct-muted-bg, #f8fafc); }
.rp-bar span { display: block; height: 100%; min-width: 2px; }
.rp-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; }
.rp-legend a { display: inline-flex; align-items: center; gap: 6px; color: var(--ct-text-2); font-size: 13px; text-decoration: none; }
.rp-legend a:hover { color: var(--ct-primary-600); }
.rp-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: #94a3b8; }
.rp-legend b { color: var(--ct-text, #0f172a); font-variant-numeric: tabular-nums; }
.rp-done { font-size: 11px; color: var(--ct-success, #16a34a); }

/* lists */
.rp-list { margin: 0; padding: 0; list-style: none; }
.rp-list li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--ct-border, #e2e8f0); }
.rp-list li:last-child { border-bottom: 0; }
.rp-list a.rp-no { font-weight: 700; color: var(--ct-primary-600); white-space: nowrap; }
.rp-list .rp-main { flex: 1; min-width: 0; }
.rp-list .rp-main div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-list small { color: var(--ct-text-3); }
.rp-when { font-size: 12px; font-weight: 700; white-space: nowrap; }
.rp-when.is-late { color: var(--ct-danger, #dc2626); }
.rp-when.is-today { color: var(--ct-warning, #d97706); }
.rp-pill { display: inline-block; padding: 1px 8px; border-radius: 999px; color: #fff; font-size: 11px; font-weight: 700; white-space: nowrap; }
.rp-empty { padding: 14px 0; color: var(--ct-text-3); text-align: center; font-size: 13px; }

/* horizontal bars */
.rp-hbars { margin: 0; padding: 0; list-style: none; }
.rp-hbars li { display: grid; grid-template-columns: minmax(80px, 1fr) 2fr 40px; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px; }
.rp-hbars .rp-track { height: 10px; border-radius: 999px; background: var(--ct-muted-bg, #f8fafc); overflow: hidden; }
.rp-hbars .rp-fill { height: 100%; border-radius: 999px; background: var(--ct-primary, #2563eb); }
.rp-hbars b { text-align: right; font-variant-numeric: tabular-nums; }
.rp-hbars span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rp-table { width: 100%; font-size: 13px; }
.rp-table th { padding: 6px 4px; color: var(--ct-text-3); font-size: 11.5px; font-weight: 700; text-transform: uppercase; border-bottom: 1px solid var(--ct-border, #e2e8f0); }
.rp-table td { padding: 7px 4px; border-bottom: 1px solid var(--ct-border, #e2e8f0); }
.rp-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.rp-alert { margin-bottom: 14px; padding: 12px 14px; border-radius: var(--ct-radius-sm, 10px); background: #fffbeb; border: 1px solid #fde68a; color: #92400e; font-size: 13.5px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.rp-alert .ct-btn { height: 34px; }
.rp-overdue-badge { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; font-size: 10.5px; font-weight: 700; vertical-align: middle; }

/* public tracking */
.rp-track-page { max-width: 560px; margin: 0 auto; }
.rp-track-card { padding: 22px; border-radius: 16px; background: #fff; box-shadow: 0 1px 3px rgba(15,23,42,.08); border: 1px solid #e5e7eb; }
.rp-track-card h1 { margin: 0 0 4px; font-size: 22px; font-weight: 700; color: #0f172a; }
.rp-track-card p.rp-sub { margin: 0 0 16px; color: #64748b; font-size: 13.5px; }
.rp-field { margin-bottom: 12px; }
.rp-field label { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 600; color: #0f172a; }
.rp-field input, .rp-field select { width: 100%; height: 44px; padding: 0 12px; border: 1px solid #cbd5e1; border-radius: 10px; font-size: 15px; background: #fff; }
.rp-field input:focus, .rp-field select:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.2); }
.rp-btn { width: 100%; height: 46px; border: 0; border-radius: 10px; background: #2563eb; color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; }
.rp-btn[disabled] { opacity: .6; }
.rp-err { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: #fef2f2; color: #991b1b; font-size: 13.5px; }
.rp-result { margin-top: 16px; }
.rp-job { margin-bottom: 14px; padding: 18px; border-radius: 16px; background: #fff; border: 1px solid #e5e7eb; box-shadow: 0 1px 3px rgba(15,23,42,.06); }
.rp-job__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.rp-job__head h2 { margin: 0; font-size: 18px; font-weight: 700; }
.rp-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin-bottom: 14px; font-size: 13.5px; }
.rp-facts small { display: block; color: #64748b; font-size: 12px; }
.rp-timeline { margin: 0; padding: 0 0 0 18px; list-style: none; border-left: 2px solid #e5e7eb; }
.rp-timeline li { position: relative; padding: 0 0 12px 8px; font-size: 13.5px; }
.rp-timeline li::before { content: ""; position: absolute; left: -25px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: #2563eb; border: 2px solid #fff; box-shadow: 0 0 0 1px #2563eb; }
.rp-timeline small { display: block; color: #64748b; font-size: 12px; }
@media (max-width: 480px) { .rp-facts { grid-template-columns: 1fr; } }

/* POSNEW task 31b */
.rp-alert--warn { flex-wrap: nowrap; align-items: flex-start; background: #fff7ed; border-color: #fdba74; color: #9a3412; }
.rp-alert--warn a { color: #c2410c; font-weight: 600; text-decoration: underline; }
.rp-form-actions { margin-top: 18px; padding: 16px 0 4px; border-top: 1px solid #e5e7eb; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px; clear: both; }
.rp-form-actions__hint { flex: 1 1 320px; margin: 0; color: #64748b; font-size: 13px; }
.rp-form-actions .tw-dw-btn-lg { height: 44px; min-height: 44px; font-size: 15px; padding: 0 20px; }
.rp-form-actions #save { order: 3; }
.rp-form-actions #save_and_add_parts { order: 2; }
.rp-form-actions #save_and_upload_docs { order: 1; }
.dropdown-menu.rp-fixed-menu { z-index: 1060; max-height: calc(100vh - 16px); overflow-y: auto; }
.rp-muted { color: #94a3b8; }
@media (max-width: 767px) { .rp-form-actions { justify-content: stretch; } .rp-form-actions .tw-dw-btn-lg { flex: 1 1 100%; } }

/* POSNEW task 31c – list chips, setup card, parts page, aligned checkboxes, colour picker, WhatsApp */
.rp-chipbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.rp-chipbtn { --rp-chip: #2563eb; display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border: 1px solid #e2e8f0; border-radius: 999px; background: #fff; color: #334155; font-size: 13px; font-weight: 600; cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s; }
.rp-chipbtn:hover { border-color: var(--rp-chip); }
.rp-chipbtn:focus-visible { outline: 2px solid var(--rp-chip); outline-offset: 2px; }
.rp-chipbtn.is-active { border-color: var(--rp-chip); background: color-mix(in srgb, var(--rp-chip) 10%, #fff); box-shadow: 0 0 0 1px var(--rp-chip) inset; }
.rp-chipbtn__n { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: #f1f5f9; color: #0f172a; font-size: 12px; text-align: center; }
.rp-chipbtn__done { color: #16a34a; }
.rp-tabcount { display: inline-block; min-width: 20px; margin-left: 4px; padding: 0 7px; border-radius: 999px; background: rgba(15, 23, 42, .08); font-size: 12px; line-height: 20px; text-align: center; }
.nav-tabs-custom > .nav-tabs > li.active .rp-tabcount { background: rgba(255, 255, 255, .3); }
.rp-setup { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: flex-start; border-color: #fdba74; background: #fff7ed; }
.rp-setup__text { flex: 1 1 320px; }
.rp-setup__text p { margin: 4px 0 0; }
.rp-setup__pick { flex: 1 1 360px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rp-pick { display: inline-flex; align-items: center; gap: 7px; margin: 0; padding: 6px 12px; border: 1px solid #e2e8f0; border-radius: 999px; background: #fff; font-weight: 600; cursor: pointer; }
.rp-pick input { margin: 0; width: 16px; height: 16px; accent-color: #2563eb; }
.rp-check { display: inline-flex; align-items: center; gap: 8px; margin: 0 18px 0 0; font-weight: 600; cursor: pointer; vertical-align: middle; }
.rp-check input[type="checkbox"] { position: static !important; margin: 0 !important; width: 17px; height: 17px; flex: 0 0 auto; accent-color: #2563eb; }
.rp-check--block { display: flex; align-items: flex-start; margin: 0; }
.rp-check--block input[type="checkbox"] { margin-top: 3px !important; }
.rp-color { display: flex; gap: 8px; align-items: center; }
.rp-color__pick { width: 44px; height: 38px; padding: 2px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; cursor: pointer; flex: 0 0 auto; }
.rp-job-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px 20px; }
.rp-job-summary__item { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rp-label { color: #64748b; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.rp-strong { color: #0f172a; font-weight: 700; overflow-wrap: anywhere; }
.rp-chip { --rp-chip: #64748b; display: inline-block; align-self: flex-start; padding: 2px 10px; border-radius: 999px; background: var(--rp-chip); color: #fff; font-size: 12px; font-weight: 700; }
.rp-part-search { position: relative; max-width: 640px; margin: 4px 0 14px; }
.rp-part-search .fa-search { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #94a3b8; }
.rp-part-search input.form-control { height: 44px; padding-left: 38px; border-radius: 10px; }
.rp-parts-table > tbody > tr > td { vertical-align: middle; }
.rp-part-name { font-weight: 600; color: #0f172a; }
.rp-stock { display: inline-block; margin-top: 3px; padding: 1px 8px; border-radius: 999px; background: #ecfdf5; color: #047857; font-size: 12px; font-weight: 600; }
.rp-stock.is-low { background: #fffbeb; color: #b45309; }
.rp-stock.is-out { background: #fef2f2; color: #b91c1c; }
.rp-stock.is-service { background: #f1f5f9; color: #475569; }
.rp-part-qty .input-group { max-width: 170px; }
.rp-parts-table tfoot th, .rp-parts-table tfoot td { border-top: 1px solid #e2e8f0; font-size: 14px; }
.rp-parts-empty td { padding: 22px 8px !important; }
.rp-icon-btn { width: 34px; height: 34px; border: 1px solid #fecaca; border-radius: 8px; background: #fff; color: #dc2626; cursor: pointer; }
.rp-icon-btn:hover, .rp-icon-btn:focus-visible { background: #dc2626; color: #fff; }
.rp-wa { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; padding-top: 10px; border-top: 1px dashed #e2e8f0; }
.rp-wa__btn { background: #16a34a !important; border: none !important; color: #fff !important; }
.rp-wa__btn:hover { background: #15803d !important; }
.rp-card__head { flex-wrap: wrap; }

/* POSNEW task 31d – settings tabs, status list, repair details, windows and table toolbars (repair pages only) */
.rp-settings { background: transparent; box-shadow: none; }
.rp-settings > .nav-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; padding: 6px; border: 1px solid #e2e8f0 !important; border-radius: 14px; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .06); }
.rp-settings > .nav-tabs > li { float: none; margin: 0 !important; border: 0 !important; }
.rp-settings > .nav-tabs > li > a { display: inline-flex; align-items: center; gap: 7px; margin: 0 !important; padding: 9px 14px !important; border: 0 !important; border-radius: 10px !important; background: transparent !important; color: #334155 !important; font-weight: 600; }
.rp-settings > .nav-tabs > li > a:hover { background: #f1f5f9 !important; }
.rp-settings > .nav-tabs > li.active > a, .rp-settings > .nav-tabs > li.active > a:hover, .rp-settings > .nav-tabs > li.active > a:focus { background: #2563eb !important; color: #fff !important; box-shadow: 0 4px 12px rgba(37, 99, 235, .3); }
.rp-settings > .nav-tabs > li.active > a .fa-info-circle, .rp-settings > .nav-tabs > li.active > a i { color: #fff !important; }
.rp-settings > .nav-tabs > li { border-top: 0 !important; }
.rp-settings > .nav-tabs > li.active { border-top-color: transparent !important; }
.rp-settings > .tab-content { padding: 16px; border: 1px solid #e2e8f0; border-radius: 14px; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .06); }
.rp-tabintro { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: #eff6ff; color: #1e3a8a; font-size: 13px; }
.rp-tabintro i { margin-right: 4px; }
.rp-stname { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.rp-done-badge { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: #dcfce7; color: #15803d; font-size: 11.5px; font-weight: 700; }
/* repair details window */
.rp-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-bottom: 16px; }
.rp-sum__card { display: flex; flex-direction: column; gap: 3px; padding: 14px; border: 1px solid #e2e8f0; border-radius: 12px; background: #f8fafc; min-width: 0; }
.rp-sum__big { font-size: 18px; }
.rp-sum__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.rp-sum__money { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 13px; }
.rp-dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 6px 0 0; font-size: 13px; }
.rp-dl dt { color: #64748b; font-weight: 600; }
.rp-dl dd { margin: 0; color: #0f172a; overflow-wrap: anywhere; }
.rp-defects { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 14px; }
.rp-defect { padding: 3px 10px; border-radius: 999px; background: #fef3c7; color: #92400e; font-size: 12.5px; font-weight: 600; }
/* windows on repair pages */
.rp-page .modal-content { border: 0; border-radius: 16px; overflow: hidden; box-shadow: 0 20px 50px rgba(15, 23, 42, .25); }
.rp-page .modal-header { padding: 16px 20px; border-bottom: 1px solid #e2e8f0; background: #f8fafc; }
.rp-page .modal-title { font-weight: 700; color: #0f172a; }
.rp-page .modal-body { padding: 18px 20px; }
.rp-page .modal-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid #e2e8f0; background: #f8fafc; }
.rp-page .modal-footer > * { margin: 0 !important; }
.rp-page .modal-body .table > thead > tr > th { background: #f1f5f9; color: #334155; font-size: 12.5px; text-transform: uppercase; letter-spacing: .02em; border-bottom: 1px solid #e2e8f0; }
.rp-page .modal-body .box.box-solid { border: 1px solid #e2e8f0; border-radius: 12px; box-shadow: none; overflow: hidden; }
.rp-page .modal-body .box.box-solid > .box-header { padding: 12px 14px; background: #fff; }
.rp-page .modal-body .box.box-solid > .box-header .box-title { font-size: 15px; font-weight: 700; }
.rp-page .modal-body .box.box-solid > .box-header:hover { background: #f8fafc; }
.rp-page .modal-body .help-block { color: #64748b; }
/* data table toolbar: one compact row */
.rp-page .dataTables_wrapper .dt-buttons { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.rp-page .dataTables_wrapper .dt-buttons .btn, .rp-page .dataTables_wrapper .dt-buttons .dt-button { margin: 0 !important; padding: 6px 12px !important; font-size: 12.5px !important; border-radius: 8px !important; }
