.sales-dashboard{--panel-radius:12px;display:grid;gap:10px}
.dashboard-heading{align-items:flex-end;margin-bottom:0}
.dashboard-heading h1{font-size:32px;letter-spacing:-.03em}
.dashboard-heading .subtitle{margin:5px 0 0}
.dashboard-heading-meta{display:flex;align-items:center;gap:14px}
.dashboard-today{color:var(--muted);font-size:14px}
.dashboard-toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:0;padding:8px 11px;border:1px solid var(--line);border-radius:var(--panel-radius);background:white}
.period-tabs{display:flex;align-items:center;gap:4px;flex:none}
.period-tabs a{padding:7px 12px;border-radius:7px;color:var(--muted);font-size:13px;font-weight:600}
.period-tabs a:hover{background:#f4f7fa;text-decoration:none}
.period-tabs a[aria-current=page]{background:#eaf3fc;color:var(--blue)}
.dashboard-date-filter{display:flex;align-items:flex-end;gap:9px;margin:0}
.dashboard-date-filter label{min-width:120px}
.dashboard-date-filter label span{display:block;margin:0 0 3px;color:var(--muted);font-size:11px}
.dashboard-date-filter input,.dashboard-date-filter select{padding:7px 8px;font-size:12px}
.dashboard-date-filter button{padding:7px 12px}
.dashboard-range{color:var(--muted);font-size:13px;white-space:nowrap}
.sales-metrics{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px;margin:0}
.sales-metric{min-width:0;padding:12px 14px;border:1px solid var(--line);border-radius:var(--panel-radius);background:white;box-shadow:0 1px 2px rgba(18,43,66,.025)}
.sales-metric-top{display:flex;align-items:center;justify-content:space-between;gap:8px;color:var(--muted);font-size:14px;font-weight:600}
.metric-icon{display:grid;place-items:center;flex:none;width:34px;height:34px;border-radius:9px;background:#edf4fa;color:var(--blue);font-size:12px;font-weight:750}
.tone-violet .metric-icon{background:#f2efff;color:#6652bd}
.tone-green .metric-icon{background:#eaf6ef;color:#29784b}
.tone-orange .metric-icon{background:#fff3e7;color:#a95b17}
.tone-red .metric-icon{background:#fff0ee;color:#b54f45}
.sales-metric>strong{display:block;margin:9px 0 4px;font-size:clamp(24px,2vw,30px);font-weight:700;letter-spacing:-.035em;line-height:1.2;white-space:nowrap}
.sales-metric.metric-revenue>strong{font-size:clamp(20px,1.7vw,25px)}
.sales-metric>strong small{color:var(--muted);font-size:12px;font-weight:600;letter-spacing:0}
.metric-hint{display:block;min-height:18px;color:#8290a0;font-size:12px;line-height:1.4}
.dashboard-panels{display:grid;gap:10px;margin:0;min-height:0}
.dashboard-panels-primary{grid-template-columns:minmax(0,1.7fr) minmax(280px,1fr);height:clamp(205px,27vh,270px)}
.dashboard-panels-secondary{grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);height:clamp(175px,22vh,225px)}
.dashboard-panel{min-width:0;min-height:0;overflow:hidden;padding:18px 20px;border:1px solid var(--line);border-radius:var(--panel-radius);background:white;box-shadow:0 1px 2px rgba(18,43,66,.025)}
.panel-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:16px}
.panel-heading h2{margin:0;font-size:20px;letter-spacing:-.01em}
.panel-heading p{margin:5px 0 0;color:var(--muted);font-size:13px}
.panel-heading .eyebrow{margin-bottom:4px;font-size:11px}
.revenue-panel{display:flex;flex-direction:column}
.revenue-panel .panel-heading{align-items:flex-start}
.revenue-summary{display:grid;justify-items:end;gap:5px;max-width:55%;text-align:right}
.revenue-total{display:flex;align-items:baseline;gap:5px;white-space:nowrap}
.revenue-total strong{font-size:19px;letter-spacing:-.03em}
.revenue-total span{color:var(--muted);font-size:10px;font-weight:700}
.receivables-note{margin:0;color:var(--muted);font-size:10px;line-height:1.4}
.receivables-note strong{color:#a15b24}
.revenue-chart{display:flex;align-items:stretch;gap:4px;height:clamp(145px,19vh,180px);margin-top:auto;padding:44px 4px 0;border:1px solid #e8eef4;border-radius:10px 10px 0 0;border-bottom:1px solid #dce5ed;background:linear-gradient(180deg,#f8fbfd 0%,#fff 100%);background-image:repeating-linear-gradient(to bottom,transparent 0,transparent 30px,#edf2f6 31px,#edf2f6 32px)}
.revenue-bar-item{position:relative;display:flex;flex:1;align-items:flex-end;justify-content:center;min-width:2px;height:100%}
.revenue-bar-item:focus-visible{z-index:3;outline:2px solid #155da0;outline-offset:2px}
.revenue-bar{position:relative;display:block;width:min(70%,24px);height:var(--bar-height);min-height:3px;border-radius:5px 5px 1px 1px;background:linear-gradient(180deg,#5ca9e8,#2875b9);transition:filter .15s ease,transform .15s ease}
.revenue-bar-item:hover .revenue-bar,.revenue-bar-item:focus-visible .revenue-bar{filter:saturate(1.2);transform:scaleX(1.15)}
.revenue-bar::after{position:absolute;z-index:2;bottom:calc(100% + 8px);left:50%;padding:7px 9px;border:1px solid #d7e2ec;border-radius:7px;background:#17344d;color:white;content:attr(data-tooltip);font-size:11px;font-weight:650;line-height:1.3;white-space:nowrap;box-shadow:0 5px 16px rgba(18,43,66,.2);opacity:0;pointer-events:none;transform:translate(-50%,3px);transition:opacity .12s ease,transform .12s ease;visibility:hidden}
.revenue-bar-item:hover .revenue-bar::after,.revenue-bar-item:focus-visible .revenue-bar::after{opacity:1;transform:translate(-50%,0);visibility:visible}
.revenue-bar-item:first-child .revenue-bar::after{left:0;transform:translate(0,3px)}
.revenue-bar-item:first-child:hover .revenue-bar::after,.revenue-bar-item:first-child:focus-visible .revenue-bar::after{transform:translate(0,0)}
.revenue-bar-item:last-child .revenue-bar::after{right:0;left:auto;transform:translate(0,3px)}
.revenue-bar-item:last-child:hover .revenue-bar::after,.revenue-bar-item:last-child:focus-visible .revenue-bar::after{transform:translate(0,0)}
.revenue-axis-label{position:absolute;top:calc(100% + 5px);left:50%;color:#738398;font-size:9px;transform:translateX(-50%);white-space:nowrap}
.chart-legend{display:flex;justify-content:space-between;gap:10px;margin-top:22px;color:var(--muted);font-size:10px}
.chart-legend span:first-child{display:flex;align-items:center;gap:6px}
.chart-legend i{width:8px;height:8px;border-radius:2px;background:#3788ca}
.source-panel{display:flex;flex-direction:column;overflow-y:auto}
.pipeline-table-wrap{max-height:150px}
.target-progress{margin:0 0 8px;padding-bottom:7px;border-bottom:1px solid #edf0f3}
.target-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:5px;font-size:11px}
.target-create{position:relative}
.target-create summary{color:var(--blue);font-size:10px;font-weight:700;cursor:pointer;list-style:none;white-space:nowrap}
.target-create summary::-webkit-details-marker{display:none}
.target-create-form{position:fixed;z-index:100;top:50%;left:50%;display:grid;gap:7px;width:min(360px,88vw);max-height:min(72vh,560px);overflow:auto;padding:14px;border:1px solid var(--line);border-radius:10px;background:white;box-shadow:0 16px 48px rgba(18,43,66,.24);transform:translate(-50%,-50%)}
.target-create-form label{display:grid;gap:3px;color:#51657a;font-size:10px}
.target-create-form input,.target-create-form select{width:100%;min-width:0;padding:6px 7px;font-size:12px}
.target-create-form small{color:var(--muted);font-size:9px}
.target-create-form button{justify-self:end;padding:6px 9px;font-size:11px}
.target-form-errors,.target-create-form .errorlist{margin:0;color:#a34b43;font-size:10px}
.target-create-amount{display:grid;grid-template-columns:1fr 72px;gap:7px}
.target-row{margin:5px 0}
.target-label{display:flex;justify-content:space-between;gap:8px;margin-bottom:3px;font-size:9px}
.target-label span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.target-label b{color:#61748a;font-weight:650}
.target-label strong{flex:none;font-size:9px}
.target-track{height:5px;overflow:hidden;border-radius:6px;background:#edf1f5}
.target-track span{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#4db48a,#21845e)}
.target-empty{margin:6px 0;color:var(--muted);font-size:10px}
.target-progress{max-height:105px;overflow-y:auto}
.source-row{margin:4px 0 8px}
.source-label{display:flex;justify-content:space-between;gap:10px;margin-bottom:5px;font-size:11px}
.source-label span{overflow:hidden;color:#526479;text-overflow:ellipsis;white-space:nowrap}
.source-label strong{flex:none;font-size:10px}
.source-track,.pipeline-track{height:7px;overflow:hidden;border-radius:8px;background:#edf1f5}
.source-track span,.pipeline-track span{display:block;height:100%;min-width:3px;border-radius:inherit;background:linear-gradient(90deg,#63a7dc,#2878b9)}
.source-row:nth-of-type(3n) .source-track span{background:#40a884}
.source-row:nth-of-type(4n) .source-track span{background:#8b79cf}
.conversion-summary{display:flex;align-items:center;gap:11px;margin-top:6px;padding:7px 0;border-top:1px solid #edf0f3}
.conversion-ring{position:relative;display:grid;place-items:center;flex:none;width:48px;height:48px;border-radius:50%;background:conic-gradient(#36a17a var(--conversion-rate),#e9eff2 0)}
.conversion-ring::before{position:absolute;width:37px;height:37px;border-radius:50%;background:white;content:""}
.conversion-ring strong{z-index:1;font-size:10px}
.conversion-summary>div:last-child{display:grid;gap:3px}
.conversion-summary>div:last-child strong{font-size:11px}
.conversion-summary>div:last-child span{color:var(--muted);font-size:9px}
.panel-link{display:inline-flex;align-items:center;gap:4px;color:var(--blue);font-size:13px;font-weight:650;white-space:nowrap}
.source-panel>.panel-link{margin-top:auto;padding-top:12px}
.dashboard-empty{padding:12px;color:var(--muted);font-size:12px;text-align:center}
.finance-locked{display:grid;align-content:center;min-height:170px;gap:7px;color:var(--muted);font-size:12px}
.finance-locked strong{color:var(--ink)}
.pipeline-panel .panel-heading{align-items:center}
.pipeline-table-wrap,.dashboard-table-wrap{min-height:0;overflow:auto}
.pipeline-table,.orders-table{width:100%;border-collapse:collapse;white-space:nowrap}
.pipeline-table th,.orders-table th{padding:9px 8px;background:#f7f9fb;color:#78879a;font-size:9px}
.pipeline-table td,.orders-table td{padding:10px 8px;font-size:11px}
.pipeline-table th:first-child,.pipeline-table td:first-child{padding-left:10px}
.number-cell{text-align:right}
.stage-marker{display:inline-block;width:7px;height:7px;margin-right:8px;border-radius:50%;background:#488eca}
.pipeline-table tbody tr:nth-child(2n) .stage-marker{background:#63aa8c}
.pipeline-table tbody tr:nth-child(3n) .stage-marker{background:#9a87d5}
.pipeline-track{width:70px;height:6px}
.task-view-tabs{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 14px}
.task-view-tabs a{padding:6px 10px;border:1px solid var(--line);border-radius:7px;background:#fff;color:var(--muted);font-size:12px;font-weight:600}
.task-view-tabs a:hover{background:#f4f7fa;text-decoration:none}
.task-view-tabs a[aria-current=page]{border-color:#c6ddf0;background:#eaf3fc;color:var(--blue)}
.task-tabs{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.task-tabs section{min-width:0}
.task-tabs h3{display:flex;align-items:center;gap:7px;margin:0 0 5px;font-size:11px}
.task-status-dot{width:7px;height:7px;border-radius:50%;background:#5195ca}
.task-status-dot.is-overdue{background:#cf655c}
.dashboard-task-list,.dashboard-activity-list{list-style:none;margin:0;padding:0}
.dashboard-task-list{max-height:145px;overflow:auto}
.dashboard-task-list li{display:flex;align-items:flex-start;justify-content:space-between;gap:7px;padding:7px 0;border-bottom:1px solid #edf0f3}
.dashboard-task-list li:last-child{border-bottom:0}
.dashboard-task-list li>div{min-width:0}
.dashboard-task-list a{display:block;overflow:hidden;color:var(--ink);font-size:11px;font-weight:600;text-overflow:ellipsis;white-space:nowrap}
.dashboard-task-list small{display:block;margin-top:3px;color:var(--muted);font-size:9px}
.priority-tag{flex:none;border-radius:5px;background:#f0f3f6;padding:3px 5px;color:#68788a;font-size:8px}
.priority-urgent,.priority-high{background:#fff0ed;color:#ad4e42}
.task-empty{color:var(--muted);font-size:10px}
.order-status{display:inline-block;border-radius:12px;background:#edf4fa;padding:3px 7px;color:#3f6787;font-size:9px}
.status-completed,.status-closed,.status-delivered{background:#eaf6ef;color:#34764b}
.status-cancelled{background:#fff0ee;color:#a34b43}
.dashboard-activity-list li{display:flex;align-items:center;gap:10px;padding:9px 0;border-bottom:1px solid #edf0f3}
.dashboard-activity-list li:last-child{border-bottom:0}
.dashboard-activity-list .activity-icon{flex:none}
.dashboard-activity-list li>div{min-width:0}
.dashboard-activity-list strong{display:block;overflow:hidden;font-size:11px;text-overflow:ellipsis;white-space:nowrap}
.dashboard-activity-list small{display:block;margin-top:3px;color:var(--muted);font-size:9px}
.dashboard-activity-list small a{color:var(--blue)}
.dashboard-table-wrap{max-height:145px}
.dashboard-activity-list{max-height:155px;overflow:auto}
@media(max-width:1450px) and (min-width:901px){
  .sales-dashboard{gap:12px}
  .dashboard-heading h1{font-size:34px}
  .dashboard-heading .subtitle{margin-top:6px;font-size:15px}
  .dashboard-toolbar{gap:14px;padding:11px 14px}
  .period-tabs a{padding:8px 12px;font-size:13px}
  .dashboard-date-filter{gap:9px}
  .dashboard-date-filter label{min-width:112px}
  .dashboard-date-filter input,.dashboard-date-filter select{padding:8px 9px;font-size:13px}
  .dashboard-date-filter button{padding:8px 12px}
  .sales-metrics{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
  .sales-metric{padding:16px 18px}
  .sales-metric-top{font-size:15px}
  .metric-icon{width:38px;height:38px;font-size:13px}
  .sales-metric>strong{margin:10px 0 5px;font-size:29px}
  .sales-metric.metric-revenue>strong{font-size:25px}
  .metric-hint{min-height:20px;font-size:12px}
  .dashboard-panels{gap:12px}
  .dashboard-panels-primary{height:clamp(255px,30vh,320px)}
  .dashboard-panels-secondary{height:clamp(225px,26vh,280px)}
  .dashboard-panel{padding:18px 20px}
  .panel-heading{gap:12px;margin-bottom:14px}
  .panel-heading h2{font-size:20px}
  .panel-heading p{font-size:12px}
  .panel-heading .eyebrow{font-size:11px}
  .revenue-chart{height:clamp(125px,16vh,175px)}
  .chart-legend{margin-top:24px;font-size:11px}
  .pipeline-table-wrap{max-height:165px}
  .pipeline-table th,.orders-table th{font-size:10px}
  .pipeline-table td,.orders-table td{padding:9px 8px;font-size:12px}
  .dashboard-task-list{max-height:160px}
  .dashboard-task-list li{padding:8px 0}
  .dashboard-task-list a{font-size:13px}
  .dashboard-task-list small{font-size:11px}
  .dashboard-table-wrap{max-height:165px}
  .dashboard-activity-list{max-height:165px}
  .dashboard-activity-list strong{font-size:13px}
  .dashboard-activity-list small{font-size:11px}
  .target-progress{max-height:150px}
}
@media(max-width:1050px){
  .sales-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
  .dashboard-toolbar{align-items:flex-start;flex-wrap:wrap}
  .dashboard-range{margin-left:auto}
  .dashboard-panels-primary,.dashboard-panels-secondary{height:auto}
  .dashboard-panel{min-height:250px}
}
@media(max-width:900px){
  .dashboard-panels-primary,.dashboard-panels-secondary{grid-template-columns:1fr}
  .dashboard-panels-primary,.dashboard-panels-secondary{height:auto}
  .dashboard-date-filter{flex-wrap:wrap}
  .dashboard-panel{max-height:360px}
}
@media(max-width:700px){
  .sales-dashboard{gap:9px}
  .dashboard-heading-meta{width:100%;justify-content:space-between}
  .dashboard-heading h1{font-size:28px}
  .dashboard-toolbar{display:grid;grid-template-columns:1fr}
  .period-tabs{overflow:auto}
  .period-tabs a{padding:7px 10px;white-space:nowrap}
  .dashboard-date-filter{display:grid;grid-template-columns:1fr 1fr}
  .dashboard-date-filter label{min-width:0}
  .dashboard-date-filter label:nth-child(3){grid-column:1}
  .dashboard-date-filter button{grid-column:2;grid-row:2}
  .dashboard-range{margin:0}
  .sales-metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
  .sales-metric{padding:13px}
  .sales-metric>strong{font-size:21px}
  .dashboard-panel{padding:15px}
  .revenue-summary{max-width:60%}
  .revenue-total strong{font-size:15px}
  .receivables-note{font-size:9px}
  .revenue-chart{height:155px}
  .task-tabs{grid-template-columns:1fr}
  .revenue-chart{height:150px}
}
