/* Compact operational lists, based on the supplied OA reference. */
#view .card:has(table){border:1px solid #e5e8ef;border-radius:8px;background:#fff;box-shadow:0 2px 8px rgba(34,49,79,.035);overflow:hidden}
#view .card:has(>.filter),#view .card.filter{border:1px solid #e5e8ef;border-radius:8px;box-shadow:none}
#view .filter{padding:13px 18px;gap:12px 20px;background:#fff;border-radius:8px}
#view .filter label{gap:9px;color:#4c5c78;font-size:12px}
#view .filter .input,#view .task-filter .input{height:34px;border:1px solid #dce3ef;border-radius:5px;background:#fff;font-size:12px;box-shadow:none}
#view .filter .input:focus,#view .task-filter .input:focus{border-color:#6585fa;outline:2px solid #6585fa20;outline-offset:1px}
#view .table-actions{padding:16px 18px 10px;align-items:center;gap:12px;flex-wrap:wrap}
#view .table-actions .btn,#view .filter .btn,#view .task-filter .btn{min-height:32px;border-radius:5px;border-color:#d8dfec;box-shadow:none;font-size:12px}
#view .table-actions .btn.primary,#view .filter .btn.primary,#view .task-filter .btn.primary{background:#5d80ff;border-color:#5d80ff;color:#fff}
#view .table-actions .btn.primary:hover,#view .filter .btn.primary:hover,#view .task-filter .btn.primary:hover{background:#496eec;border-color:#496eec}
#view .tablewrap{margin:0 12px 10px;width:auto;border:0}
#view table{border-collapse:collapse;font-size:12px;color:#3d4f6d}
#view table thead th{background:#f8f9fb!important;color:#3d5277!important;font-weight:600;border-top:0;border-bottom:1px solid #e9edf4!important;border-left:0;border-right:0;line-height:1.45;vertical-align:middle}
#view table tbody td{border-bottom:1px solid #edf0f6!important;border-left:0;border-right:0;background:#fff;vertical-align:middle;line-height:1.5}
#view table tbody tr:last-child td{border-bottom:0!important}
#view table tbody tr:hover td{background:#f5f8ff!important}
#view table tbody tr:has(input[type=checkbox]:checked) td{background:#eef3ff!important}
#view table th,#view table td{padding-top:10px!important;padding-bottom:10px!important}
#view table .link{color:#5479ed;font-size:12px;font-weight:400;padding:3px 4px;border-radius:3px}
#view table .link:hover{background:#edf2ff;color:#345fdd}
#view table input[type=checkbox]{width:14px;height:14px;accent-color:#5d80ff;vertical-align:middle;cursor:pointer}
#view table button:focus-visible,#view .table-actions button:focus-visible{outline:2px solid #5d80ff;outline-offset:2px}
#view table .tag{font-size:11px;padding:3px 7px;border-radius:4px;line-height:1.35;white-space:nowrap}
#view table .empty{padding:30px 12px!important;color:#8995a7;text-align:center}
@media(max-width:700px){#view .filter{padding:12px;gap:10px}#view .filter label{flex-wrap:wrap}#view .table-actions{padding:12px}#view .tablewrap{margin:0 8px 8px}}
/* Channel-linked orders use a wide, right-aligned detail panel. */
.drawerback:has(.channel-linked-orders) .drawer{width:72vw!important;max-width:calc(100vw - 24px)!important}
.channel-linked-orders .tablewrap{overflow-x:auto}
.channel-linked-orders table{width:100%;font-size:12px}
.channel-linked-orders th,.channel-linked-orders td{padding:12px 10px;vertical-align:middle;line-height:1.5}
.channel-linked-orders th{height:46px;color:#3d5277;background:#f8f9fb}
.channel-linked-orders td:nth-child(1),.channel-linked-orders td:nth-child(5),.channel-linked-orders td:nth-child(6),.channel-linked-orders td:nth-child(7),.channel-linked-orders td:last-child{white-space:nowrap;font-variant-numeric:tabular-nums}
@media(max-width:900px){.drawerback:has(.channel-linked-orders) .drawer{width:calc(100vw - 16px)!important;max-width:calc(100vw - 16px)!important}}
/* Shared customer/lead detail navigation matches order-category tabs. */
#dbody .unified-detail-tabs{display:flex;align-items:center;gap:24px!important;flex-wrap:wrap;margin:12px 0!important;padding:0 5px!important;border-bottom:1px solid #e5eaf3!important}
#dbody .unified-detail-tabs button{background:transparent!important;border:0!important;border-bottom:2px solid transparent!important;border-radius:0!important;padding:10px 4px!important;font-size:13px!important;font-weight:400!important;line-height:20px!important;color:#70819a!important;box-shadow:none!important;margin:0!important}
#dbody .unified-detail-tabs button.active{background:transparent!important;color:#4772e8!important;border-bottom-color:#4772e8!important;font-weight:600!important}
#dbody .unified-detail-tabs button:hover{color:#4772e8!important}
#dbody .unified-detail-tabs button:focus-visible{outline:2px solid #5d80ff;outline-offset:2px}

/* Customer history follows the lead stage layout, with two service stages. */
#dbody .customer-trajectory .lead-map-grid{grid-template-columns:repeat(6,minmax(175px,1fr));min-width:1100px;gap:10px}
#dbody .customer-trajectory .lead-phase{min-height:360px}
#dbody .customer-trajectory .lead-phase-body{padding:14px 3px;gap:10px}
#dbody .customer-trajectory .lead-milestone{padding:11px 12px}
#dbody .customer-trajectory .lead-map-head{margin:4px 0 14px;flex-wrap:wrap;gap:10px}

#view .order-search-panel{display:block;padding:12px 14px!important}
#view .order-quick-search{display:flex;align-items:center;border:1px solid #dce4ef;border-radius:9px;padding:5px;background:#fff;margin-bottom:12px;max-width:1050px}
#view .order-quick-search label{flex:1;font-size:0;margin:0;display:block}
#view .order-quick-search .input{width:100%;border:0;background:transparent;height:36px;font-size:14px;padding:0 14px}
#view .order-quick-search .btn{height:36px;min-width:84px;border-radius:6px}
#view .order-filter-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
#view .order-filter-row>label{display:flex;gap:7px;align-items:center;margin:0;font-size:12px;white-space:nowrap}
#view .order-filter-row .input{width:115px;height:32px;font-size:12px;border-radius:6px;background:#f8faff}
#view .order-filter-row .order-date-filter>span{display:flex;align-items:center;gap:5px}
#view .order-date-filter input{width:114px;height:32px;border:1px solid #dce4ef;border-radius:6px;padding:3px;color:#425471;font-size:11px}
#view .order-inline-totals{display:flex;gap:22px;margin-left:auto;padding-left:14px;border-left:1px solid #e5eaf2}
#view .order-inline-totals small{display:block;font-size:11px;color:#8390a4;margin-bottom:3px}
#view .order-inline-totals b{font-size:17px;color:#26466e;white-space:nowrap;font-variant-numeric:tabular-nums}
#view .order-advanced-fields:not([hidden]){display:flex;flex-wrap:wrap;gap:18px;padding-top:12px;margin-top:12px;border-top:1px solid #edf0f5}
#view .order-advanced-fields label{display:flex;align-items:center;gap:8px;font-size:12px}
#view .order-advanced-fields .input{width:155px;height:32px}
@media(max-width:900px){#view .order-inline-totals{margin-left:0}#view .order-filter-row{gap:10px}}

#view .order-search-toolbar{display:flex;align-items:center;gap:18px;flex-wrap:nowrap}
#view .order-search-toolbar .order-quick-search{flex:1;min-width:200px;margin:0;max-width:none}
#view .order-search-toolbar>.link{white-space:nowrap;flex:none;font-size:13px}
#view .order-search-toolbar .order-inline-totals{margin-left:0;gap:22px;flex:none}
#view .order-search-toolbar .order-inline-totals>div{display:flex;align-items:center;gap:9px}
#view .order-search-toolbar .order-inline-totals small{margin:0;white-space:nowrap;font-size:12px}
#view .order-advanced-fields .order-date-filter>span{display:flex;align-items:center;gap:5px}
#view .order-advanced-fields .order-date-filter input{height:32px;border:1px solid #dce4ef;border-radius:6px;padding:3px;color:#425471;font-size:12px}
@media(max-width:900px){#view .order-search-toolbar{gap:10px}#view .order-search-toolbar .order-inline-totals{gap:12px;padding-left:10px}#view .order-search-toolbar .order-inline-totals>div{display:block}#view .order-search-toolbar .order-inline-totals b{font-size:14px}}
@media(max-width:600px){#view .order-search-toolbar{flex-wrap:wrap}#view .order-search-toolbar .order-quick-search{flex-basis:100%}}

#view .order-search-toolbar .order-quick-search{flex:0 1 34%;max-width:520px;min-width:260px}
#view .order-search-toolbar .order-inline-totals{margin-left:auto}
@media(max-width:900px){#view .order-search-toolbar .order-quick-search{flex:1;min-width:200px}}
@media(max-width:600px){#view .order-search-toolbar .order-quick-search{flex-basis:100%;max-width:none;min-width:0}}

#view .order-shell .grouped-table td:nth-child(4),#view .order-shell .grouped-table td:nth-child(7){font-size:11px!important;font-family:inherit;line-height:1.5;font-variant-numeric:tabular-nums}

#view .order-shell .grouped-table .project-box-node{height:auto;min-height:0;min-width:0;border:0;background:transparent;padding:0;display:inline-flex;align-items:center;line-height:15px;border-radius:0}
#view .order-shell .grouped-table td:nth-child(8)>.tag,#view .order-shell .grouped-table .project-box-node>.tag{font-size:10px!important;line-height:15px!important;padding:2px 5px!important;height:19px;box-sizing:border-box;border-radius:4px}
#view .order-shell .grouped-table .project-box-node.unstarted>.tag{border:1px dashed #c9d0da;padding:1px 4px!important;background:#f1f3f5;color:#8491a2}
#view .order-shell .grouped-table .project-box-node:not(:first-child):before{top:9px}
#view .order-shell .grouped-table .project-current-state{display:block;color:#8b9ab0;font-size:10px;line-height:1.4;margin-top:4px;text-align:center}

#view .customer-list-consistent .customer-channel-path{max-width:220px;white-space:normal;line-height:1.6;overflow-wrap:anywhere}
#view .customer-list-consistent .customer-consumption{font-variant-numeric:tabular-nums;white-space:nowrap;color:#2c476d}

.customer-demo-notice{padding:8px 16px;background:#fff8eb;color:#917247;font-size:11px;border-bottom:1px solid #f0e4cc}

/* New lead: four compact rows, preserving the established detail layout. */
.drawerback:has(#lead-new-form) .drawer{width:900px!important;max-width:calc(100vw - 32px)!important}
#lead-new-form.lead-create-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px 22px;align-items:start}
#lead-new-form.lead-create-grid>label{display:flex;flex-direction:column;gap:7px;font-size:12px;margin:0;min-width:0}
#lead-new-form.lead-create-grid .input{width:100%;box-sizing:border-box;min-height:36px;font-size:13px}
#lead-new-form .lead-create-tags,#lead-new-form .lead-create-note{grid-column:1/-1}
#lead-new-form .lead-create-note textarea{resize:vertical;min-height:64px}
#lead-new-form .lead-create-hint{grid-column:1/-1;margin:0;padding-top:12px;border-top:1px solid #e5eaf1;color:#7b8797;font-size:12px;line-height:1.6}
@media(max-width:650px){#lead-new-form.lead-create-grid{grid-template-columns:1fr}#lead-new-form .lead-create-note{grid-column:auto}}
/* Keep lead tags in one row; overflow belongs to the table scroll container. */
.lead-fields-table td:last-child{white-space:nowrap!important;max-width:none!important}
.lead-fields-table td:last-child .lead-color-tag{vertical-align:middle;margin-right:4px}
.lead-shell .tablewrap{overflow-x:auto;scrollbar-width:auto;scrollbar-color:#a7b9d4 #eef2f7}
.lead-shell .tablewrap::-webkit-scrollbar{height:9px}
.lead-shell .tablewrap::-webkit-scrollbar-thumb{background:#a7b9d4;border-radius:5px}
.lead-shell .tablewrap::-webkit-scrollbar-track{background:#eef2f7}
