/* ============================================================================
   Offers page — list, expandable rows, slide-in detail, modals.
   Global (non-scoped) like wm.invoice.css / wm.reports.css.
   ============================================================================ */

.off-page { padding: 4px 2px 40px; }

/* ---- header ------------------------------------------------------------- */
.off-head { margin-bottom: 18px; }
.off-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.off-btn {
    display: inline-flex; align-items: center; gap: 7px;
    border: none; border-radius: 10px; padding: 10px 16px;
    font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
    transition: filter .15s ease, background .15s ease;
}
.off-btn:disabled { opacity: .55; cursor: not-allowed; }
.off-btn-primary { background: #5263FF; color: #fff; }
.off-btn-primary:hover:not(:disabled) { filter: brightness(1.06); }
.off-btn-ghost { background: #F3F4F6; color: #374151; }
.off-btn-ghost:hover:not(:disabled) { background: #E9EBEF; }
.off-btn i { font-size: 15px; }

/* ---- card --------------------------------------------------------------- */
.off-card {
    background: #fff; border: 1px solid #EEF0F3; border-radius: 16px;
    box-shadow: 0 6px 20px rgba(16,24,40,.04); overflow: visible;
}
.off-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; padding: 16px 18px;
}

/* ---- tabs --------------------------------------------------------------- */
.off-tabs { display: inline-flex; gap: 4px; background: #F4F5F7; border-radius: 12px; padding: 4px; }
.off-tabs button {
    display: inline-flex; align-items: center; gap: 8px;
    border: none; background: transparent; color: #6B7280;
    border-radius: 9px; padding: 7px 14px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.off-tabs button.active { background: #fff; color: #5263FF; box-shadow: 0 1px 3px rgba(16,24,40,.10); }
.off-count {
    background: #E5E7EB; color: #6B7280; border-radius: 10px;
    font-size: 12px; font-weight: 700; padding: 1px 8px; min-width: 20px; text-align: center;
}
.off-tabs button.active .off-count { background: #5263FF; color: #fff; }

.off-search { min-width: 280px; flex: 0 1 360px; }

/* ---- table -------------------------------------------------------------- */
.off-table { width: 100%; border-collapse: collapse; }
.off-table thead th {
    text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .04em;
    text-transform: uppercase; color: #9AA2B1; padding: 12px 18px;
    border-top: 1px solid #F1F2F4; border-bottom: 1px solid #F1F2F4; background: #FBFBFC;
}
.off-table thead th.off-right, .off-table td.off-right { text-align: right; }
.off-crow > td { padding: 16px 18px; border-bottom: 1px solid #F1F2F4; vertical-align: middle; }
.off-crow { cursor: pointer; }
.off-crow:hover { background: #F8F9FF; }
.off-crow.expanded { background: #F6F7FF; }

.off-cust { display: flex; align-items: center; gap: 10px; }
.off-cust-name { font-weight: 700; color: #1F2430; font-size: 14.5px; }
.off-addr { color: #4B5563; font-size: 14px; }
.off-phone { color: #4B5563; font-size: 14px; white-space: nowrap; }

.off-badge-new {
    display: inline-flex; align-items: center; background: #EEF0FF; color: #5263FF;
    border-radius: 8px; font-size: 12px; font-weight: 700; padding: 2px 9px;
}
.off-pending {
    display: inline-flex; align-items: center; gap: 6px; color: #5263FF;
    background: #EEF2FF; border-radius: 8px; padding: 4px 10px; font-size: 13px; font-weight: 700;
}
.off-pending i { font-size: 13px; }

.off-rowactions { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }

/* kebab dropdown */
.off-dropdown { position: relative; display: inline-block; }
.off-kebab {
    border: 1px solid #E8EAEE; background: #fff; color: #64748B;
    border-radius: 9px; width: 36px; height: 36px; cursor: pointer;
}
.off-kebab:hover { background: #F3F4F6; }
.off-menu {
    position: absolute; z-index: 1001; top: calc(100% + 6px); right: 0; min-width: 190px;
    background: #fff; border: 1px solid #ECECEC; border-radius: 12px;
    box-shadow: 0 12px 30px rgba(16,24,40,.16); padding: 6px; display: none;
}
.off-menu.show { display: block; }
.off-menu button {
    display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
    border: none; background: transparent; border-radius: 8px; padding: 9px 10px;
    font-size: 14px; color: #374151; cursor: pointer;
}
.off-menu button:hover { background: #F3F4F6; }
.off-menu button.danger { color: #DF2917; }
.off-menu button img { width: 16px; height: 16px; }
.off-backdrop { position: fixed; inset: 0; z-index: 1000; background: transparent; }

.off-chev { color: #9CA3AF; font-size: 13px; transition: transform .15s ease; }
.off-crow.expanded .off-chev { transform: rotate(180deg); }
.off-iconbtn {
    border: 1px solid #E8EAEE; background: #fff; color: #5263FF; border-radius: 9px;
    width: 36px; height: 36px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.off-iconbtn:hover { background: #F3F4F6; }
.off-addloc {
    display: inline-flex; align-items: center; gap: 6px; border: 1px solid #E8EAEE; background: #fff;
    color: #374151; border-radius: 9px; padding: 7px 12px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.off-addloc:hover { background: #F3F4F6; }
.off-addloc i { font-size: 13px; color: #5263FF; }

/* expanded location sub-table */
.off-subwrap { background: #F6F7FF; border-bottom: 1px solid #F1F2F4; }
.off-subtable { width: 100%; border-collapse: collapse; }
.off-subtable thead th {
    text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    color: #9AA2B1; padding: 10px 18px;
}
.off-subtable td { padding: 12px 18px; border-top: 1px solid #ECEEFB; vertical-align: middle; }
.off-lrow { cursor: pointer; }
.off-lrow:hover { background: #EEF1FF; }

.off-loc { display: flex; align-items: center; gap: 12px; }
.off-loc-thumb {
    width: 46px; height: 46px; border-radius: 9px; object-fit: cover; flex-shrink: 0;
    border: 1px solid #E3E7F5; background: #E8ECF7;
}
.off-loc-thumb.placeholder { display: inline-flex; align-items: center; justify-content: center; color: #9AA7C7; }
.off-loc-name { font-weight: 700; color: #1F2430; font-size: 14px; }
.off-loc-sub { color: #6B7280; font-size: 13px; }

.off-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.off-chip {
    display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid #E3E7F5;
    border-radius: 8px; padding: 4px 9px; font-size: 12.5px; color: #374151; font-weight: 600;
}
.off-chip .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.off-chip-more { background: #E8ECF7; border-color: #E8ECF7; color: #5263FF; }

.off-price { font-weight: 700; color: #1F7A43; background: #E9F7EE; border-radius: 8px; padding: 5px 11px; display: inline-block; }
.off-warn {
    display: inline-flex; align-items: center; gap: 6px; background: #FBF3E2; color: #B47500;
    border-radius: 8px; padding: 5px 10px; font-size: 13px; font-weight: 600; border: none; cursor: pointer;
}
.off-warn i { font-size: 13px; }

/* status pills */
.off-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 8px; white-space: nowrap; }
.off-status-nodrawing { background: #F1F3F5; color: #6B7280; }
.off-status-draft     { background: #E7F3FB; color: #1583C4; }
.off-status-sent      { background: #EEF0FF; color: #5263FF; }
.off-status-approved  { background: #E9F7EE; color: #2E8B4F; }
.off-status-declined  { background: #FDECEA; color: #DF2917; }

/* action buttons */
.off-act { display: inline-flex; align-items: center; gap: 6px; border: none; border-radius: 9px; padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.off-act:disabled { opacity: .5; cursor: not-allowed; }
.off-approve { background: #16A34A; color: #fff; }
.off-decline { background: #DF2917; color: #fff; }
.off-send { background: #5263FF; color: #fff; }
.off-send.muted { background: #E5E7EB; color: #9AA2B1; }
.off-quote { background: #EEF2FF; color: #2563EB; }
.off-act-group { display: inline-flex; gap: 8px; justify-content: flex-end; }

.off-empty { text-align: center; color: #6B7280; padding: 60px 20px; }
.off-empty img { width: 44px; height: 44px; opacity: .6; margin-bottom: 10px; }

.off-pager { padding: 12px 18px; border-top: 1px solid #F1F2F4; }

/* ============================================================================
   Slide-in detail panel
   ============================================================================ */
.off-slider-backdrop { position: fixed; inset: 0; background: rgba(16,24,40,.45); z-index: 1090; opacity: 0; transition: opacity .25s ease; }
.off-slider-backdrop.show { opacity: 1; }
.off-slider {
    position: fixed; top: 0; right: 0; height: 100vh; width: 100%; max-width: 760px;
    background: #fff; z-index: 1091; display: flex; flex-direction: column;
    transform: translateX(100%); transition: transform .3s ease-out; box-shadow: -16px 0 40px rgba(16,24,40,.18);
}
.off-slider.show { transform: translateX(0); }

.off-sl-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid #F1F2F4; flex-shrink: 0; }
.off-sl-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.off-sl-pin { width: 42px; height: 42px; border-radius: 11px; background: #EEF0FF; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.off-sl-pin img { width: 20px; height: 20px; }
.off-sl-title { font-weight: 800; font-size: 18px; color: #1F2430; line-height: 1.2; }
.off-sl-sub { color: #6B7280; font-size: 13.5px; }
.off-sl-headbtns { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.off-sl-x { border: 1px solid #E8EAEE; background: #fff; color: #64748B; border-radius: 9px; width: 38px; height: 38px; cursor: pointer; }
.off-sl-x:hover { background: #F3F4F6; }

.off-sl-body { flex: 1; overflow-y: auto; padding: 20px 22px 40px; scrollbar-width: thin; }

.off-map { position: relative; border-radius: 14px; overflow: hidden; background: #E8ECF7; border: 1px solid #E3E7F5; aspect-ratio: 16 / 8.4; }
.off-map img { width: 100%; height: 100%; object-fit: cover; display: block; }
.off-map-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: #8A93A8; gap: 8px; }
.off-map-empty i { font-size: 30px; }

.off-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.off-legend .off-chip { background: #F7F8FA; }

.off-drawbtn {
    width: 100%; margin-top: 14px; border: 1px solid #DfE3Fb; background: #EEF1FF; color: #5263FF;
    border-radius: 12px; padding: 12px; font-size: 14px; font-weight: 700; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.off-drawbtn:hover { background: #E6EAFF; }

.off-sec-title { font-weight: 800; font-size: 16px; color: #1F2430; margin: 26px 0 12px; }
.off-actions-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.off-sent-note { color: #2E8B4F; font-size: 13.5px; display: inline-flex; align-items: center; gap: 7px; }

.off-details { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 28px; margin-top: 6px; }
.off-detail-label { font-size: 12px; font-weight: 700; color: #9AA2B1; text-transform: uppercase; letter-spacing: .03em; }
.off-detail-value { font-size: 14.5px; color: #1F2430; margin-top: 3px; word-break: break-word; }

/* ============================================================================
   Center modals (customer / location / prices)
   ============================================================================ */
.off-modal-backdrop { position: fixed; inset: 0; background: rgba(16,24,40,.5); display: flex; align-items: center; justify-content: center; z-index: 1100; padding: 20px; }
.off-modal { background: #fff; border-radius: 16px; width: 620px; max-width: 96vw; max-height: 92vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 24px 60px rgba(16,24,40,.28); }
.off-modal.narrow { width: 480px; }
.off-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid #F3F4F6; }
.off-modal-head h3 { margin: 0; font-size: 18px; font-weight: 800; color: #1F2430; }
.off-modal-x { border: none; background: transparent; color: #64748B; font-size: 18px; cursor: pointer; width: 34px; height: 34px; border-radius: 8px; }
.off-modal-x:hover { background: #F3F4F6; }
.off-modal-body { padding: 18px 22px; overflow-y: auto; }
.off-modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid #F3F4F6; }

.off-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.off-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.off-field.span2 { grid-column: 1 / -1; }
.off-field label { font-size: 13px; font-weight: 600; color: #374151; }
.off-field input, .off-field textarea {
    border: 1px solid #E5E7EB; border-radius: 10px; padding: 10px 12px; font-size: 14px; color: #1F2430; width: 100%;
    font-family: inherit;
}
.off-field input:focus, .off-field textarea:focus { outline: none; border-color: #5263FF; box-shadow: 0 0 0 3px rgba(82,99,255,.12); }
.off-field textarea { resize: vertical; min-height: 76px; }
.off-field .suffix-input { position: relative; }
.off-field .suffix-input input { padding-right: 56px; }
.off-field .suffix-input .suffix { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: #9AA2B1; font-size: 13px; font-weight: 600; }
.off-modal-err { color: #DF2917; font-size: 13px; margin-top: 4px; }

.off-price-row { display: grid; grid-template-columns: 1fr 150px; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid #F3F4F6; }
.off-price-row:last-child { border-bottom: none; }
.off-price-cat { display: flex; align-items: center; gap: 10px; font-weight: 600; color: #1F2430; font-size: 14px; }
.off-price-cat .dot { width: 11px; height: 11px; border-radius: 50%; }
.off-price-cat small { display: block; color: #9AA2B1; font-weight: 500; font-size: 12px; }

/* Default prices — per-service size tiers */
.off-modal-help { color: #6B7280; font-size: 13.5px; margin: 0 0 14px; }
.off-svc { padding: 14px 0; border-bottom: 1px solid #F3F4F6; }
.off-svc:last-of-type { border-bottom: none; }
.off-svc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.off-svc-head .dot { width: 11px; height: 11px; border-radius: 50%; }
.off-svc-name { font-weight: 700; color: #1F2430; font-size: 14px; }
.off-svc-unit { margin-left: auto; color: #9AA2B1; font-weight: 600; font-size: 12px; }
.off-tier { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.off-tier-range { display: flex; align-items: center; gap: 6px; flex: 1 1 auto; min-width: 0; color: #475467; font-size: 13px; }
.off-tier-from { color: #98A2B3; min-width: 30px; text-align: right; }
.off-tier-dash { color: #98A2B3; }
.off-tier-inf { color: #475467; font-weight: 600; }
.off-tier-sizeunit { color: #98A2B3; }
.off-tier-bound { width: 80px; flex: 0 0 auto; }
.off-tier-bound input { padding: 8px 10px; }
.off-tier-price { width: 132px; flex: 0 0 auto; }
.off-tier-flat { color: #98A2B3; font-style: italic; }
.off-tier-del { border: none; background: transparent; color: #B42318; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; flex: 0 0 auto; }
.off-tier-del:hover { background: #FEE4E2; }
.off-tier-del-spacer { width: 30px; flex: 0 0 auto; }
.off-tier-add { display: inline-flex; align-items: center; gap: 6px; border: 1px dashed #D0D5DD; background: #fff; color: #5263FF; font-weight: 600; font-size: 13px; border-radius: 8px; padding: 6px 12px; cursor: pointer; margin-top: 2px; }
.off-tier-add:hover { background: #F5F6FF; border-color: #5263FF; }

/* AI pricing insight note on the location slider */
.off-ai-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 12px 14px; border-radius: 12px; border: 1px solid #E0E7FF; background: linear-gradient(180deg, #F5F7FF 0%, #FBFCFF 100%); }
.off-ai-ico { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 7px; display: flex; align-items: center; justify-content: center; color: #fff; background: linear-gradient(135deg, #6366F1, #8B5CF6); font-size: 14px; }
.off-ai-body { min-width: 0; }
.off-ai-title { font-weight: 700; color: #3730A3; font-size: 12.5px; letter-spacing: .01em; margin-bottom: 2px; }
.off-ai-text { color: #475467; font-size: 13px; line-height: 1.45; }
.off-ai-text strong { color: #1F2430; }
.off-ai-pill { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; font-weight: 700; font-size: 12px; padding: 3px 10px; border-radius: 999px; }
.off-ai-pill.down { color: #067647; background: #ECFDF3; }
.off-ai-pill.up { color: #B54708; background: #FFFAEB; }
.off-ai-pill.flat { color: #475467; background: #F2F4F7; }

@media (max-width: 640px) {
    .off-details, .off-grid2 { grid-template-columns: 1fr; }
}
