/* Sales Dashboard 4.1 */
.sd-wrap{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;color:#1a1a1a;margin:0 0 2rem;}
.sd-topbar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;margin-bottom:1.25rem;}
.sd-topbar-left{display:flex;align-items:center;gap:10px;}
.sd-title{font-size:1.3rem;font-weight:600;margin:0;color:#111;}
.sd-live-badge{font-size:11px;padding:3px 9px;border-radius:20px;background:#d4edda;color:#155724;font-weight:500;}
.sd-topbar-right{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.sd-api-status{font-size:12px;color:#666;}
.sd-api-status.connected{color:#28a745;}
.sd-api-status.error{color:#dc3545;}
.sd-select{font-size:13px;padding:5px 10px;border:1px solid #ddd;border-radius:6px;background:#fff;color:#333;cursor:pointer;}
.sd-btn-sm{font-size:12px;padding:5px 10px;border:1px solid #ddd;border-radius:6px;background:#fff;color:#333;cursor:pointer;white-space:nowrap;}
.sd-btn-sm:hover{background:#f5f5f5;}
.sd-filter-bar{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:14px;align-items:center;}
.sd-search-wrap{position:relative;flex:1;min-width:220px;}
.sd-search-input{width:100%;box-sizing:border-box;font-size:13px;padding:7px 12px;border:1px solid #ddd;border-radius:6px;background:#fff;color:#333;}
.sd-search-input:focus{outline:none;border-color:#2271b1;box-shadow:0 0 0 2px rgba(34,113,177,.12);}
.sd-search-results{position:absolute;top:calc(100% + 4px);left:0;right:0;background:#fff;border:1px solid #ddd;border-radius:8px;box-shadow:0 6px 20px rgba(0,0,0,.12);max-height:320px;overflow-y:auto;z-index:50;}
.sd-search-item{padding:9px 14px;cursor:pointer;border-bottom:1px solid #f5f5f5;}
.sd-search-item:hover{background:#f0f6fb;}
.sd-search-item-name{font-size:13px;font-weight:500;color:#222;}
.sd-search-item-meta{font-size:11px;color:#888;margin-top:2px;}
.sd-search-empty{padding:14px;font-size:12px;color:#999;text-align:center;}
.sd-error{background:#fce4e4;border:1px solid #f5aca6;border-radius:8px;padding:12px 16px;font-size:14px;color:#a94442;margin-bottom:1rem;}

/* Hero */
.sd-event-hero{display:flex;gap:0;background:linear-gradient(135deg,#0f0c29,#302b63,#24243e);border-radius:12px;overflow:hidden;margin-bottom:14px;min-height:180px;}
.sd-hero-poster-col{width:140px;flex-shrink:0;position:relative;}
.sd-hero-poster{width:140px;height:100%;min-height:180px;object-fit:cover;display:block;}
.sd-hero-poster-placeholder{width:140px;min-height:180px;background:rgba(255,255,255,.05);display:flex;align-items:center;justify-content:center;font-size:40px;}
.sd-hero-info-col{flex:1;padding:18px 20px;display:flex;flex-direction:column;justify-content:space-between;}
.sd-hero-name{font-size:20px;font-weight:700;color:#fff;margin-bottom:4px;line-height:1.3;}
.sd-hero-meta{font-size:13px;color:rgba(255,255,255,.65);margin-bottom:12px;line-height:1.6;}
.sd-hero-stats{display:flex;gap:20px;flex-wrap:wrap;margin-bottom:14px;}
.sd-hero-stat{text-align:center;}
.sd-hero-stat-val{font-size:22px;font-weight:700;color:#fff;line-height:1.1;}
.sd-hero-stat-label{font-size:10px;color:rgba(255,255,255,.5);text-transform:uppercase;letter-spacing:.06em;}
.sd-hero-divider{width:1px;background:rgba(255,255,255,.15);align-self:stretch;}
.sd-hero-actions{display:flex;gap:8px;flex-wrap:wrap;}
.sd-buy-btn{display:inline-flex;align-items:center;gap:6px;padding:8px 16px;background:linear-gradient(135deg,#667eea,#764ba2);color:#fff;border-radius:8px;font-size:13px;font-weight:600;text-decoration:none;transition:opacity .15s;}
.sd-buy-btn:hover{opacity:.85;color:#fff;}
.sd-hero-pct-bar{height:4px;background:rgba(255,255,255,.15);border-radius:2px;margin-top:8px;overflow:hidden;}
.sd-hero-pct-fill{height:100%;border-radius:2px;background:linear-gradient(90deg,#43e97b,#38f9d7);}

/* Section label */
.sd-section-label{font-size:11px;font-weight:500;color:#999;text-transform:uppercase;letter-spacing:.06em;margin:14px 0 6px;}

/* KPIs */
.sd-kpi-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;margin-bottom:14px;}
.sd-kpi{background:#f7f8fa;border:1px solid #eee;border-radius:10px;padding:14px 16px;}
.sd-kpi-label{font-size:11px;color:#888;margin-bottom:4px;text-transform:uppercase;letter-spacing:.04em;}
.sd-kpi-val{font-size:24px;font-weight:600;color:#111;line-height:1.2;}
.sd-kpi-grid-views .sd-kpi{background:#f0f6fb;border-color:#d0e6f5;}
.sd-kpi-grid-views .sd-kpi-val{color:#2271b1;}

/* Charts */
.sd-charts-row{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:14px;}
.sd-chart-card{background:#fff;border:1px solid #eee;border-radius:10px;padding:14px 16px;}
.sd-chart-title{font-size:13px;font-weight:500;color:#555;margin-bottom:8px;}
.sd-legend{display:flex;gap:12px;flex-wrap:wrap;margin-bottom:8px;font-size:11px;color:#666;}
.sd-legend span{display:flex;align-items:center;gap:4px;}
.sd-leg-sq{width:9px;height:9px;border-radius:2px;flex-shrink:0;}

/* Tables */
.sd-table-card{background:#fff;border:1px solid #eee;border-radius:10px;overflow:hidden;margin-bottom:14px;}
.sd-table-header{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid #eee;flex-wrap:wrap;gap:6px;}
.sd-table-title{font-size:13px;font-weight:500;color:#555;}
.sd-table-note{font-size:11px;color:#999;}
.sd-table{width:100%;border-collapse:collapse;font-size:13px;}
.sd-table thead th{padding:8px 14px;text-align:left;font-size:11px;font-weight:500;color:#888;text-transform:uppercase;letter-spacing:.04em;border-bottom:1px solid #eee;background:#fafafa;white-space:nowrap;}
.sd-table tbody td{padding:10px 14px;color:#333;border-bottom:1px solid #f5f5f5;vertical-align:middle;}
.sd-table tbody tr:last-child td{border-bottom:none;}
.sd-table tbody tr:hover td{background:#fafafa;}
.sd-loading-row{text-align:center;color:#999;padding:24px !important;}
.sd-row-grand td{font-weight:600;background:#f7f8fa;border-top:2px solid #e0e0e0 !important;}

/* Summary bars */
.sd-summary-bar{display:flex;gap:20px;padding:8px 16px;background:#f0f6fb;border-bottom:1px solid #d0e6f5;font-size:13px;flex-wrap:wrap;}
.sd-summary-bar strong{color:#2271b1;font-weight:600;}

/* Pills */
.sd-pill{font-size:11px;padding:3px 9px;border-radius:20px;font-weight:500;white-space:nowrap;display:inline-block;}
.sd-pill-green{background:#d4edda;color:#155724;}
.sd-pill-red{background:#fce4e4;color:#a94442;}
.sd-pill-amber{background:#fff3cd;color:#856404;}
.sd-pill-blue{background:#cce5ff;color:#004085;}
.sd-pill-gray{background:#e9ecef;color:#495057;}

/* Capacity bar */
.sd-cap-bar-wrap{background:#f0f0f0;border-radius:4px;overflow:hidden;height:8px;}
.sd-cap-bar{height:100%;border-radius:4px;background:#2271b1;transition:width .4s;}
.sd-cap-bar.high{background:#28a745;}
.sd-cap-bar.warn{background:#ffc107;}
.sd-cap-bar.low{background:#dc3545;}

/* Expandable rows */
.sd-evt-expandable{cursor:pointer;}
.sd-evt-expandable:hover td{background:#f5f9fc !important;}
.sd-evt-chevron{display:inline-block;font-size:10px;color:#2271b1;width:12px;}
.sd-evt-date-multi{font-size:11px;color:#2271b1;background:#eaf3fb;padding:1px 6px;border-radius:10px;display:inline-block;margin-top:2px;}
.sd-evt-detail-row td{background:#fafbfc;padding:0 !important;}
.sd-subtable{width:100%;border-collapse:collapse;font-size:12px;}
.sd-subtable thead th{padding:5px 14px 5px 36px;text-align:left;font-size:10px;font-weight:500;color:#999;text-transform:uppercase;background:#f0f3f6;border-bottom:1px solid #e5e5e5;}
.sd-subtable tbody td{padding:7px 14px 7px 36px;color:#444;border-bottom:1px solid #eee;}
.sd-subtable tbody tr:last-child td{border-bottom:none;}

/* Skeleton */
.sd-skeleton{min-height:80px;background:linear-gradient(90deg,#f0f0f0 25%,#e0e0e0 50%,#f0f0f0 75%);background-size:200% 100%;animation:sd-shimmer 1.4s infinite;border:none !important;}
@keyframes sd-shimmer{0%{background-position:200% 0}100%{background-position:-200% 0}}

@media(max-width:640px){.sd-charts-row{grid-template-columns:1fr;}.sd-topbar{flex-direction:column;align-items:flex-start;}.sd-kpi-grid{grid-template-columns:repeat(2,1fr);}.sd-filter-bar{flex-direction:column;}.sd-event-hero{flex-direction:column;}.sd-hero-poster-col{width:100%;}.sd-hero-poster{width:100%;height:200px;min-height:200px;}}
