/* SYSTEM 2.3 — ONLY requested visual change */
#pipelineView .pipeline-column:nth-child(1) .pipeline-column-header,
#pipelineView .pipeline-column:nth-child(2) .pipeline-column-header,
#pipelineView .pipeline-column:nth-child(3) .pipeline-column-header,
#pipelineView .pipeline-column:nth-child(4) .pipeline-column-header,
#pipelineView .pipeline-column:nth-child(5) .pipeline-column-header,
#pipelineView .pipeline-column:nth-child(6) .pipeline-column-header,
#pipelineView .pipeline-column:nth-child(7) .pipeline-column-header {
    background: #FFFFFF !important;
}

/* SYSTEM 2.3 — ONLY requested card/header spacing */
#pipelineView .pipeline-column {
    padding: 4px;
    border-radius: 7px;
}

#pipelineView .pipeline-column-header {
    min-height: 34px;
    padding: 2px 5px 7px;
    border-bottom: 1px solid #E5E7EB;
}

#pipelineView .pipeline-column-title {
    font-size: 12px;
    line-height: 1.2;
}

#pipelineView .pipeline-column-count {
    min-width: 21px;
    height: 21px;
    font-size: 10px;
}

#pipelineView .pipeline-column-cards {
    padding: 4px 0 0;
    gap: 3px;
}

#pipelineView .pipeline-opportunity-card {
    padding: 7px 8px;
    margin: 0 0 3px;
    border-radius: 6px;
    border: 1px solid #E1E7EE;
    background: #FFFFFF;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

#pipelineView .pipeline-opportunity-card:last-child {
    margin-bottom: 0;
}

#pipelineView .pipeline-opportunity-title {
    font-size: 11px;
    line-height: 1.25;
    margin-bottom: 3px;
}

#pipelineView .pipeline-opportunity-contact {
    font-size: 10px;
    line-height: 1.25;
    margin-bottom: 4px;
}

#pipelineView .pipeline-opportunity-meta {
    font-size: 9.5px;
    line-height: 1.2;
}

#pipelineView .pipeline-opportunity-product {
    font-size: 9.5px;
    line-height: 1.2;
    margin-top: 3px;
}

#pipelineView .pipeline-empty {
    min-height: 55px;
    padding: 10px 4px;
    margin-top: 3px;
    border-radius: 6px;
    font-size: 10px;
}

/* =========================================================
   SYSTEM 2.3 FINAL VISUAL UPDATE
   ONLY: separate stage header cards from opportunity cards
   Existing System 1.9.4.3 HTML/JS preserved
========================================================= */

/* Remove the single outer column box so stage and opportunity
   areas can appear as two separate cards. */
#pipelineView .pipeline-column {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

/* Stage itself becomes a separate compact white card. */
#pipelineView .pipeline-column-header {
    background: #FFFFFF !important;
    border: 1px solid #DCE5EF;
    border-top-width: 4px;
    border-radius: 7px;
    min-height: 38px;
    padding: 5px 8px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

/* Preserve each stage's existing accent colour. */
#pipelineView .pipeline-column:nth-child(1) .pipeline-column-header {
    border-top-color: #64748B;
}
#pipelineView .pipeline-column:nth-child(2) .pipeline-column-header {
    border-top-color: #F59E0B;
}
#pipelineView .pipeline-column:nth-child(3) .pipeline-column-header {
    border-top-color: #EF4444;
}
#pipelineView .pipeline-column:nth-child(4) .pipeline-column-header {
    border-top-color: #2563EB;
}
#pipelineView .pipeline-column:nth-child(5) .pipeline-column-header {
    border-top-color: #7C3AED;
}
#pipelineView .pipeline-column:nth-child(6) .pipeline-column-header {
    border-top-color: #16A34A;
}
#pipelineView .pipeline-column:nth-child(7) .pipeline-column-header {
    border-top-color: #EC4899;
}

/* Opportunity area is a completely separate white card,
   with a clear gap below the stage header. */
#pipelineView .pipeline-column-cards {
    background: #FFFFFF;
    border: 1px solid #DCE5EF;
    border-radius: 7px;
    margin-top: 10px;
    padding: 7px;
    min-height: 125px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

/* Keep opportunity cards compact inside the separate area. */
#pipelineView .pipeline-opportunity-card {
    width: 100%;
    min-height: 48px;
    height: auto;
    padding: 7px 8px;
    margin: 0 0 3px;
    border-radius: 6px;
    background: #FFFFFF;
    border: 1px solid #E1E7EE;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

#pipelineView .pipeline-opportunity-card:last-child {
    margin-bottom: 0;
}

#pipelineView .pipeline-empty {
    min-height: 90px;
    margin: 0;
    padding: 12px 5px;
    border-radius: 6px;
    background: #FFFFFF;
    font-size: 10.5px;
}

/* Keep the seven columns aligned and compact. */
#pipelineView .pipeline-board {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
    align-items: start;
}

@media (max-width: 1050px) {
    #pipelineView .pipeline-board {
        grid-template-columns: repeat(4, minmax(150px, 1fr));
    }
}

@media (max-width: 700px) {
    #pipelineView .pipeline-board {
        grid-template-columns: repeat(2, minmax(145px, 1fr));
    }
}

/* =========================================================
   SYSTEM 2.3 FINAL — 5 STAGES VISIBLE IN ONE ROW
   ONLY ROW WIDTH / SPACING UPDATE
   Existing System 1.9.4.3 + System 2.3 functionality preserved
========================================================= */

#pipelineView .pipeline-board-wrap {
    overflow-x: auto;
    padding-bottom: 6px;
}

#pipelineView .pipeline-board {
    display: grid;
    grid-template-columns: repeat(7, minmax(205px, 1fr));
    gap: 10px;
    width: max-content;
    min-width: 100%;
    align-items: start;
}

/* Keep stage and opportunity sections compact and close together. */
#pipelineView .pipeline-column {
    width: 205px;
    min-width: 205px;
}

#pipelineView .pipeline-column-header {
    min-height: 38px;
    padding: 5px 8px;
}

#pipelineView .pipeline-column-cards {
    margin-top: 8px;
    padding: 6px;
    min-height: 125px;
}

/* Desktop viewport: approximately 5 stages visible at once. */
@media (min-width: 1051px) {
    #pipelineView .pipeline-board-wrap {
        overflow-x: auto;
    }

    #pipelineView .pipeline-board {
        grid-template-columns: repeat(7, 205px);
        width: max-content;
        min-width: 0;
    }
}

/* SYSTEM 2.3 — ONLY opportunity-card size adjustment */
/* Cards stay compact like the reference and grow only when their content needs it. */

#pipelineView .pipeline-column-cards {
    min-height: 60px;
    padding: 3px 0 0;
    gap: 3px;
}

#pipelineView .pipeline-opportunity-card {
    width: 100%;
    min-height: 48px;
    height: auto;
    padding: 7px 8px;
    margin: 0 0 3px;
    border-radius: 6px;
    background: #FFFFFF;
    border: 1px solid #E1E7EE;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

#pipelineView .pipeline-opportunity-card:last-child {
    margin-bottom: 0;
}

#pipelineView .pipeline-opportunity-title {
    font-size: 11px;
    line-height: 1.25;
    margin-bottom: 3px;
}

#pipelineView .pipeline-opportunity-contact {
    font-size: 10px;
    line-height: 1.25;
    margin-bottom: 4px;
}

#pipelineView .pipeline-opportunity-meta {
    font-size: 9.5px;
    line-height: 1.2;
}

#pipelineView .pipeline-opportunity-product {
    font-size: 9.5px;
    line-height: 1.2;
    margin-top: 3px;
}

/* Empty placeholder uses the same compact card proportion. */
#pipelineView .pipeline-empty {
    min-height: 52px;
    padding: 10px 4px;
    margin-top: 3px;
    border-radius: 6px;
    font-size: 10px;
}

/* SYSTEM 2.4.2 — CREATE OPPORTUNITY API CONNECTION */

#system241CreateOpportunityModal {
    display:none;
    position:fixed;
    inset:0;
    z-index:10000;
    background:rgba(15,23,42,.42);
    align-items:center;
    justify-content:center;
    padding:20px;
}
#system241CreateOpportunityModal.active{display:flex}
.system241-dialog{
    width:min(650px,100%);
    max-height:calc(100vh - 40px);
    overflow-y:auto;
    background:#fff;
    border:1px solid #DCE5EF;
    border-radius:12px;
    box-shadow:0 20px 50px rgba(15,23,42,.18);
}
.system241-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:17px 20px;
    border-bottom:1px solid #E5E7EB;
}
.system241-header h3{margin:0;font-size:18px;color:#0F172A}
.system241-close{
    width:34px;height:34px;border:0;border-radius:7px;
    background:transparent;color:#64748B;font-size:22px;cursor:pointer;
}
.system241-close:hover{background:#F1F5F9}
.system241-body{padding:20px}
.system241-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:14px;
}
.system241-field{display:flex;flex-direction:column;gap:6px}
.system241-field.full{grid-column:1/-1}
.system241-field label{font-size:12px;font-weight:700;color:#334155}
.system241-required{color:#DC2626}
.system241-field input,
.system241-field select,
.system241-field textarea{
    width:100%;
    border:1px solid #D8E1EC;
    border-radius:7px;
    background:#fff;
    color:#0F172A;
    outline:none;
    font:inherit;
}
.system241-field input,.system241-field select{height:40px;padding:0 11px}
.system241-field textarea{min-height:86px;padding:10px 11px;resize:vertical}
.system241-field input:focus,
.system241-field select:focus,
.system241-field textarea:focus{
    border-color:#93C5FD;
    box-shadow:0 0 0 3px rgba(37,99,235,.08);
}
.system241-footer{
    display:flex;
    justify-content:flex-end;
    gap:9px;
    padding:14px 20px;
    border-top:1px solid #E5E7EB;
}
.system241-cancel,.system241-save{
    height:40px;padding:0 16px;border-radius:8px;font-weight:700;cursor:pointer;
}
.system241-cancel{border:1px solid #D8E1EC;background:#fff;color:#475569}
.system241-save{border:0;background:#2563EB;color:#fff}
.system241-save:hover{background:#1D4ED8}
@media(max-width:650px){
    .system241-grid{grid-template-columns:1fr}
    .system241-field.full{grid-column:auto}
}

/* =========================================================
   SYSTEM 2.4.1 FINAL — ONLY TWO REQUESTED UPDATES
   1. Pipeline horizontal scrollbar sits at the lower page area
   2. Create Opportunity popup uses the same font sizing as
      the locked Contacts form
   Existing HTML / JS / API behaviour preserved
========================================================= */

/* 1) Keep the board at the top while placing its horizontal
      scrollbar at the lower edge of the available page area. */
#pipelineView .pipeline-board-wrap {
    min-height: calc(100vh - 330px);
    overflow-x: auto;
    overflow-y: visible;
    padding-bottom: 6px;
}

/* 2) Match the locked Contacts form typography. */
#system241CreateOpportunityModal,
#system241CreateOpportunityModal .system241-dialog,
#system241CreateOpportunityModal input,
#system241CreateOpportunityModal select,
#system241CreateOpportunityModal textarea,
#system241CreateOpportunityModal button {
    font-family: inherit;
}

#system241CreateOpportunityModal .system241-header h3 {
    font-size: 14px;
    font-weight: 800;
}

#system241CreateOpportunityModal .system241-field label {
    margin-bottom: 5px;
    font-size: 10px;
    font-weight: 700;
}

#system241CreateOpportunityModal .system241-field input,
#system241CreateOpportunityModal .system241-field select,
#system241CreateOpportunityModal .system241-field textarea {
    font-size: 11px;
    font-weight: 400;
}

#system241CreateOpportunityModal .system241-footer button {
    font-size: 11px;
    font-weight: 700;
}

/* =========================================================
   SYSTEM 2.4.2 — FINAL MICRO UPDATE
   ONLY:
   1) Separate multiple opportunity cards with a visible gap.
   2) Remove the dashed/dotted container edge above the first
      opportunity card.
   No other Pipeline, CRM, API, or layout changes.
========================================================= */

/* The opportunity area remains a separate white section,
   but its top edge is not shown as a dotted/dashed line. */
#pipelineView .pipeline-column-cards {
    border-top: 0 !important;
}

/* Each real opportunity is its own separate card. */
#pipelineView .pipeline-opportunity-card {
    margin-bottom: 9px !important;
    border-top: 1px solid #E1E7EE !important;
}

/* Clear separation between consecutive opportunities. */
#pipelineView .pipeline-opportunity-card + .pipeline-opportunity-card {
    margin-top: 9px !important;
}

/* Do not leave extra space after the final opportunity. */
#pipelineView .pipeline-opportunity-card:last-child {
    margin-bottom: 0 !important;
}

/* Keep the empty-stage placeholder unchanged/dashed. */
#pipelineView .pipeline-empty {
    border-style: dashed !important;
}

/* FINAL FIX — OPPORTUNITY CARD GAP ONLY */
#pipelineView .pipeline-column-cards{
    display:flex;
    flex-direction:column;
    gap:8px !important;
}
#pipelineView .pipeline-opportunity-card,
#pipelineView .pipeline-opportunity-card:last-child,
#pipelineView .pipeline-opportunity-card + .pipeline-opportunity-card{
    margin:0 !important;
}

/* FINAL MICRO UPDATE — NO DOTTED / DASHED OPPORTUNITY CARDS */
#pipelineView .pipeline-column-cards,
#pipelineView .pipeline-opportunity-card,
#pipelineView .pipeline-empty {
    border-style: solid !important;
}
#pipelineView .pipeline-column-cards { border-color:#DCE5EF !important; }
#pipelineView .pipeline-opportunity-card { border-color:#E1E7EE !important; }
#pipelineView .pipeline-empty { border-color:#E1E7EE !important; }

/* FINAL: no placeholder cards on empty stages.
   Only real opportunity cards have a white background. */
#pipelineView .pipeline-column-cards {
    min-height: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
}
#pipelineView .pipeline-opportunity-card {
    background: #FFFFFF !important;
}

/* =========================================================
   SYSTEM 2.4.2 FINAL — PAGE-BOTTOM HORIZONTAL SCROLLER
   ONLY requested change:
   Move the Pipeline board horizontal scrollbar to the
   bottom area of the main page.
   Existing stage/card/API/design code remains unchanged.
========================================================= */

#pipelineView .pipeline-board-wrap {
    min-height: calc(100vh - 105px) !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    padding-bottom: 6px !important;

    /* FINAL: scrollbar track reaches the same right edge as
       the page's vertical scrollbar. */
    width: calc(100vw - 280px) !important;
    max-width: calc(100vw - 280px) !important;
    box-sizing: border-box !important;
}

/* =========================================================
   SYSTEM 2.5.1 — OPPORTUNITY CARD ACTIONS
   UI ONLY — NO API / DATABASE CHANGES
========================================================= */
#pipelineView .pipeline-opportunity-actions{
    display:flex;
    align-items:center;
    gap:4px;
    margin-top:6px;
    padding-top:5px;
    border-top:1px solid #EEF2F7;
}

#pipelineView .pipeline-opportunity-action{
    width:26px;
    height:22px;
    padding:0;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border:1px solid #D8E1EC;
    border-radius:5px;
    background:#FFFFFF;
    color:#475569;
    font-family:inherit;
    cursor:pointer;
}

#pipelineView .pipeline-opportunity-action svg{
    width:12px;
    height:12px;
    fill:none;
    stroke:currentColor;
    stroke-width:1.8;
    stroke-linecap:round;
    stroke-linejoin:round;
}

#pipelineView .pipeline-opportunity-action:hover{
    background:#EFF6FF;
    border-color:#BFDBFE;
    color:#1E40AF;
}

#pipelineView .pipeline-opportunity-action.danger:hover{
    background:#FEF2F2;
    border-color:#FECACA;
    color:#B91C1C;
}

/* =========================================================
   SYSTEM 2.5.2 — EDIT OPPORTUNITY UI
   Same locked modal language as System 2.4.1.
   No global design changes.
========================================================= */
#system252EditOpportunityModal{
    position:fixed;
    inset:0;
    z-index:10050;
    display:none;
    align-items:center;
    justify-content:center;
    padding:20px;
    background:rgba(15,23,42,.38);
}
#system252EditOpportunityModal.active{display:flex;}
#system252EditOpportunityModal .system241-dialog{
    width:min(680px,100%);
    max-height:calc(100vh - 40px);
    overflow:auto;
    background:#fff;
    border:1px solid #E5E7EB;
    border-radius:10px;
    box-shadow:0 18px 45px rgba(15,23,42,.16);
}
#system252EditOpportunityModal .system241-header,
#system252EditOpportunityModal .system241-body,
#system252EditOpportunityModal .system241-footer{
    box-sizing:border-box;
}
.system252-error{
    display:none;
    margin-bottom:14px;
    padding:9px 11px;
    border:1px solid #FECACA;
    border-radius:7px;
    background:#FEF2F2;
    color:#B91C1C;
    font-size:11px;
    line-height:1.4;
}
#system252Contact{
    background:#F8FAFC !important;
    color:#475569 !important;
    cursor:not-allowed;
}
#system252SaveEditOpportunity:disabled{
    opacity:.6;
    cursor:not-allowed;
}
@media(max-width:650px){
    #system252EditOpportunityModal{padding:10px;}
    #system252EditOpportunityModal .system241-dialog{max-height:calc(100vh - 20px);}
}

#system253StageMoveModal{
    position:fixed; inset:0; z-index:10055; display:none;
    align-items:center; justify-content:center; padding:20px;
    background:rgba(15,23,42,.38);
}
#system253StageMoveModal.active{display:flex;}
.system253-stage-dialog{
    width:min(430px,100%); background:#fff; border:1px solid #E5E7EB;
    border-radius:10px; box-shadow:0 18px 45px rgba(15,23,42,.16); overflow:hidden;
}
.system253-stage-header{
    display:flex; align-items:center; justify-content:space-between; gap:12px;
    padding:16px 18px; border-bottom:1px solid #E5E7EB;
}
.system253-stage-title{font-size:15px;font-weight:700;color:#0F172A;}
.system253-stage-subtitle{margin-top:3px;font-size:10.5px;color:#64748B;max-width:330px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.system253-stage-close{width:30px;height:30px;border:0;border-radius:7px;background:transparent;color:#64748B;font-size:21px;cursor:pointer;}
.system253-stage-close:hover{background:#F1F5F9;}
.system253-stage-body{padding:18px;}
.system253-stage-current{
    display:flex;align-items:center;justify-content:space-between;gap:12px;
    padding:10px 11px;margin-bottom:14px;border:1px solid #E2E8F0;border-radius:7px;background:#F8FAFC;
}
.system253-stage-current span{font-size:10px;font-weight:600;color:#64748B;}
.system253-stage-current strong{font-size:11px;color:#1E40AF;}
.system253-stage-field{display:flex;flex-direction:column;gap:6px;}
.system253-stage-field label{font-size:11px;font-weight:700;color:#334155;}
.system253-stage-field select{
    width:100%;height:38px;padding:0 10px;border:1px solid #D8E1EC;border-radius:7px;
    background:#fff;color:#0F172A;font:inherit;outline:none;
}
.system253-stage-field select:focus{border-color:#93C5FD;box-shadow:0 0 0 3px rgba(37,99,235,.08);}
.system253-stage-message{display:none;margin-top:10px;padding:8px 10px;border-radius:7px;font-size:10.5px;line-height:1.4;}
.system253-stage-message.show{display:block;background:#EFF6FF;border:1px solid #BFDBFE;color:#1E40AF;}
.system253-stage-footer{display:flex;justify-content:flex-end;gap:8px;padding:13px 18px;border-top:1px solid #E5E7EB;}
.system253-stage-cancel,.system253-stage-select{height:38px;padding:0 14px;border-radius:7px;font-family:inherit;font-size:11px;font-weight:700;cursor:pointer;}
.system253-stage-cancel{border:1px solid #D8E1EC;background:#fff;color:#475569;}
.system253-stage-select{border:0;background:#2563EB;color:#fff;}
.system253-stage-select:hover{background:#1D4ED8;}
.system253-stage-select:disabled{opacity:.55;cursor:not-allowed;}
@media(max-width:650px){#system253StageMoveModal{padding:10px;}}

#system254ArchiveModal{position:fixed;inset:0;z-index:99999;display:none;align-items:center;justify-content:center;padding:20px;background:rgba(15,23,42,.42);}
#system254ArchiveModal.active{display:flex;}
#system254ArchiveModal .system254-archive-dialog{width:min(440px,100%);background:#fff;border:1px solid #E2E8F0;border-radius:10px;box-shadow:0 18px 45px rgba(15,23,42,.18);overflow:hidden;}
#system254ArchiveModal .system254-archive-header{display:flex;align-items:center;justify-content:space-between;padding:15px 18px;border-bottom:1px solid #E5E7EB;}
#system254ArchiveModal .system254-archive-title{font-size:14px;font-weight:800;color:#0F172A;}
#system254ArchiveModal .system254-archive-subtitle{margin-top:3px;font-size:10px;color:#64748B;}
#system254ArchiveModal .system254-archive-close{width:28px;height:28px;border:0;background:transparent;color:#64748B;font-size:20px;cursor:pointer;}
#system254ArchiveModal .system254-archive-body{padding:20px 18px 18px;text-align:center;}
#system254ArchiveModal .system254-archive-icon{width:42px;height:42px;margin:0 auto 11px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:#FEF2F2;color:#DC2626;}
#system254ArchiveModal .system254-archive-icon svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;}
#system254ArchiveModal .system254-archive-question{font-size:13px;font-weight:700;color:#0F172A;}
#system254ArchiveModal .system254-archive-message{margin-top:7px;font-size:10px;line-height:1.5;color:#64748B;}
#system254ArchiveModal .system254-archive-footer{display:flex;justify-content:flex-end;gap:8px;padding:13px 18px;border-top:1px solid #E5E7EB;}
#system254ArchiveModal .system254-archive-footer button{height:36px;padding:0 14px;border-radius:7px;font:inherit;font-size:11px;font-weight:700;cursor:pointer;}
#system254ArchiveModal .system254-archive-cancel{border:1px solid #D8E1EC;background:#fff;color:#475569;}
#system254ArchiveModal .system254-archive-confirm{border:0;background:#DC2626;color:#fff;}
#system254ArchiveModal .system254-archive-confirm:hover{background:#B91C1C;}

#system2543RestoreModal{position:fixed;inset:0;z-index:10060;display:none;align-items:center;justify-content:center;padding:20px;background:rgba(15,23,42,.38)}
#system2543RestoreModal.active{display:flex}
.system2543-restore-dialog{width:min(430px,100%);background:#fff;border:1px solid #E5E7EB;border-radius:10px;box-shadow:0 18px 45px rgba(15,23,42,.16);overflow:hidden}
.system2543-restore-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 18px;border-bottom:1px solid #E5E7EB}
.system2543-restore-title{font-size:15px;font-weight:700;color:#0F172A}.system2543-restore-subtitle{margin-top:3px;font-size:10.5px;color:#64748B}
.system2543-restore-close{width:30px;height:30px;border:0;border-radius:7px;background:transparent;color:#64748B;font-size:21px;cursor:pointer}.system2543-restore-close:hover{background:#F1F5F9}
.system2543-restore-body{padding:18px}.system2543-restore-icon{width:40px;height:40px;margin:0 auto 12px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:#EFF6FF;color:#2563EB}
.system2543-restore-icon svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.system2543-restore-question{text-align:center;font-size:13px;font-weight:700;color:#0F172A}.system2543-restore-help{text-align:center;margin:6px auto 16px;max-width:330px;font-size:10.5px;line-height:1.45;color:#64748B}
.system2543-restore-field{display:flex;flex-direction:column;gap:6px}.system2543-restore-field label{font-size:11px;font-weight:700;color:#334155}
.system2543-restore-field input{width:100%;height:38px;padding:0 10px;box-sizing:border-box;border:1px solid #D8E1EC;border-radius:7px;background:#fff;color:#0F172A;font:inherit;outline:none}
.system2543-restore-field input:focus{border-color:#93C5FD;box-shadow:0 0 0 3px rgba(37,99,235,.08)}
.system2543-restore-message{display:none;margin-top:10px;padding:8px 10px;border-radius:7px;font-size:10.5px;line-height:1.4}.system2543-restore-message.show{display:block;background:#EFF6FF;border:1px solid #BFDBFE;color:#1E40AF}
.system2543-restore-footer{display:flex;justify-content:flex-end;gap:8px;padding:13px 18px;border-top:1px solid #E5E7EB}.system2543-restore-footer button{height:38px;padding:0 14px;border-radius:7px;font-family:inherit;font-size:11px;font-weight:700;cursor:pointer}
.system2543-restore-cancel{border:1px solid #D8E1EC;background:#fff;color:#475569}.system2543-restore-confirm{border:0;background:#2563EB;color:#fff}.system2543-restore-confirm:hover{background:#1D4ED8}
@media(max-width:650px){#system2543RestoreModal{padding:10px}}

/* =========================================================
   SYSTEM 2.5.5 — OPPORTUNITY SEARCH & FILTERS
   ADDITIVE ONLY — EXISTING MASTER BRIDGE DESIGN PRESERVED
========================================================= */
#pipelineView .system255-filter-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
}

#pipelineView .system255-search-wrap {
    position: relative;
    width: 230px;
    flex: 0 1 230px;
}

#pipelineView .system255-search-wrap svg {
    position: absolute;
    left: 10px;
    top: 50%;
    width: 15px;
    height: 15px;
    transform: translateY(-50%);
    fill: none;
    stroke: #64748B;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

#pipelineView .system255-search {
    width: 100%;
    height: 36px;
    padding: 0 11px 0 32px;
    border: 1px solid #CBD5E1;
    border-radius: 7px;
    background: #FFFFFF;
    color: #0F172A;
    font: inherit;
    font-size: 12px;
    outline: none;
    box-sizing: border-box;
}

#pipelineView .system255-search::placeholder {
    color: #94A3B8;
}

#pipelineView .system255-search:focus {
    border-color: #93C5FD;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.08);
}

#pipelineView .system255-filter-select {
    min-width: 128px;
    height: 36px;
    font-size: 12px;
}

#pipelineView .system255-clear-button {
    height: 36px;
    padding: 0 12px;
    border: 1px solid #CBD5E1;
    border-radius: 7px;
    background: #FFFFFF;
    color: #475569;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

#pipelineView .system255-clear-button:hover {
    border-color: #93C5FD;
    color: #2563EB;
    background: #F8FAFC;
}

#pipelineView .system255-filter-summary {
    min-height: 18px;
    margin: -8px 0 10px;
    color: #64748B;
    font-size: 11px;
    text-align: right;
}

@media (max-width: 1050px) {
    #pipelineView .system255-filter-bar {
        justify-content: flex-start;
    }

    #pipelineView .system255-filter-summary {
        text-align: left;
    }
}

@media (max-width: 700px) {
    #pipelineView .system255-search-wrap,
    #pipelineView .system255-filter-select {
        width: 100%;
        flex-basis: 100%;
    }

    #pipelineView .system255-clear-button {
        width: 100%;
    }
}

#system256ViewModal{position:fixed;inset:0;z-index:10070;display:none;align-items:center;justify-content:center;padding:20px;background:rgba(15,23,42,.38)}
#system256ViewModal.active{display:flex}
.system256-view-dialog{width:min(720px,100%);max-height:min(760px,calc(100vh - 40px));background:#fff;border:1px solid #E5E7EB;border-radius:10px;box-shadow:0 18px 45px rgba(15,23,42,.16);overflow:hidden;display:flex;flex-direction:column}
.system256-view-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:17px 19px;border-bottom:1px solid #E5E7EB;flex:0 0 auto}
.system256-view-title{font-size:15px;font-weight:700;color:#0F172A}.system256-view-subtitle{margin-top:3px;font-size:10.5px;color:#64748B}
.system256-view-close{width:30px;height:30px;border:0;border-radius:7px;background:transparent;color:#64748B;font-size:21px;cursor:pointer}.system256-view-close:hover{background:#F1F5F9}
.system256-view-body{padding:18px 19px;overflow:auto}.system256-view-loading{text-align:center;padding:35px 10px;color:#64748B;font-size:11px}.system256-view-error{display:none;padding:10px 11px;margin-bottom:14px;border-radius:7px;background:#FEF2F2;border:1px solid #FECACA;color:#B91C1C;font-size:10.5px}.system256-view-error.show{display:block}
.system256-view-content[hidden]{display:none}
.system256-view-hero{display:flex;align-items:center;gap:12px;padding:13px;border:1px solid #E2E8F0;background:#F8FAFC;border-radius:9px;margin-bottom:18px}
.system256-view-hero-icon{width:40px;height:40px;flex:0 0 40px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:#EFF6FF;color:#2563EB}.system256-view-hero-icon svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.system256-view-hero-copy{min-width:0;flex:1}.system256-opportunity-title{font-size:14px;font-weight:700;color:#0F172A;word-break:break-word}.system256-opportunity-contact{margin-top:3px;font-size:10.5px;color:#64748B}
.system256-status-badge{flex:0 0 auto;padding:5px 9px;border-radius:999px;background:#DCFCE7;color:#166534;font-size:10px;font-weight:700;text-transform:capitalize}
.system256-section-title{margin:17px 0 9px;font-size:11px;font-weight:700;color:#334155}
.system256-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.system256-field{min-width:0;padding:10px 11px;border:1px solid #E5E7EB;border-radius:7px;background:#fff}.system256-field span,.system256-contact-box span{display:block;font-size:9.5px;color:#64748B;margin-bottom:4px}.system256-field strong,.system256-contact-box strong{display:block;font-size:11px;color:#0F172A;font-weight:600;word-break:break-word}
.system256-contact-box{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.system256-contact-box>div{padding:10px 11px;border:1px solid #E5E7EB;border-radius:7px;background:#fff}
.system256-notes{min-height:54px;padding:10px 11px;border:1px solid #E5E7EB;border-radius:7px;background:#F8FAFC;color:#475569;font-size:10.5px;line-height:1.5;white-space:pre-wrap;word-break:break-word}
.system256-view-footer{display:flex;justify-content:flex-end;gap:8px;padding:13px 19px;border-top:1px solid #E5E7EB;flex:0 0 auto}.system256-view-footer button{height:37px;padding:0 14px;border-radius:7px;font-family:inherit;font-size:11px;font-weight:700;cursor:pointer}.system256-view-close-button{border:1px solid #D8E1EC;background:#fff;color:#475569}.system256-view-close-button:hover{background:#F8FAFC}
@media(max-width:650px){#system256ViewModal{padding:10px}.system256-view-dialog{max-height:calc(100vh - 20px)}.system256-grid,.system256-contact-box{grid-template-columns:1fr}.system256-view-hero{align-items:flex-start}.system256-status-badge{margin-left:auto}}

/* =========================================================
   SYSTEM 2.5.7 — OPPORTUNITY ACTIVITY HISTORY
   ADDITIVE ONLY — EXISTING MASTER BRIDGE DESIGN PRESERVED
========================================================= */
.system257-section-title{margin:19px 0 9px;font-size:11px;font-weight:700;color:#334155;display:flex;align-items:center;gap:7px}
.system257-count{display:inline-flex;align-items:center;justify-content:center;min-width:19px;height:19px;padding:0 5px;border-radius:999px;background:#EFF6FF;color:#2563EB;font-size:9px;font-weight:700}
.system257-activity-loading{padding:14px 11px;border:1px solid #E5E7EB;border-radius:7px;background:#F8FAFC;color:#64748B;font-size:10.5px;text-align:center}
.system257-activity-error{display:none;padding:9px 10px;margin-bottom:8px;border-radius:7px;background:#FEF2F2;border:1px solid #FECACA;color:#B91C1C;font-size:10px}
.system257-activity-error.show{display:block}
.system257-activity-empty{padding:14px 11px;border:1px dashed #CBD5E1;border-radius:7px;background:#F8FAFC;color:#64748B;font-size:10.5px;text-align:center}
.system257-timeline{position:relative;display:flex;flex-direction:column;gap:8px}
.system257-item{position:relative;display:grid;grid-template-columns:28px minmax(0,1fr);gap:9px}
.system257-dot{width:28px;height:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:#EFF6FF;color:#2563EB;border:1px solid #DBEAFE;box-sizing:border-box}
.system257-dot svg{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.system257-card{min-width:0;padding:9px 10px;border:1px solid #E5E7EB;border-radius:7px;background:#fff}
.system257-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.system257-card-title{font-size:10.5px;font-weight:700;color:#0F172A;word-break:break-word}
.system257-card-date{flex:0 0 auto;font-size:9px;color:#94A3B8;white-space:nowrap}
.system257-card-description{margin-top:4px;color:#64748B;font-size:10px;line-height:1.45;white-space:pre-wrap;word-break:break-word}
@media(max-width:650px){.system257-card-head{display:block}.system257-card-date{display:block;margin-top:3px}.system257-item{grid-template-columns:26px minmax(0,1fr)}.system257-dot{width:26px;height:26px}}
