.sales-data-wrap{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden;border:1px solid var(--border-default,#B6C8BB);border-radius:10px;background:var(--surface-bg,#F3F6F3)}
.business-toolbar{display:flex;align-items:center;gap:10px;padding:12px 14px;border-bottom:1px solid var(--border-default,#B6C8BB);background:#E5EBE6}
.business-search{display:flex;align-items:center;gap:8px;width:min(420px,55%);height:38px;padding:0 11px;border:1px solid var(--border-default,#B6C8BB);border-radius:7px;background:#F3F6F3;color:var(--text-secondary,#536B5B)}
.business-search span{font-size:22px;line-height:1}.business-search input{width:100%;border:0;outline:0;background:transparent;color:var(--text-primary,#20382B);font:inherit;font-size:12px}
.business-filter-label{display:flex;align-items:center;gap:7px;color:var(--text-secondary,#536B5B);font-size:11px}
.business-filter-label select,.business-row select{min-height:32px;padding:5px 8px;border:1px solid var(--border-default,#B6C8BB);border-radius:6px;background:#F3F6F3;color:var(--text-primary,#20382B);font:inherit;font-size:11px}
.business-count{margin-left:auto;color:var(--text-secondary,#536B5B);font-size:11px}.business-table-scroll{flex:1;min-height:0;overflow:auto}
.business-table{width:100%;border-collapse:separate;border-spacing:0;font-size:12px}.business-table th{position:sticky;top:0;z-index:1;padding:11px 10px;text-align:left;white-space:nowrap;background:#E5EBE6;color:#536B5B;font-size:10px;font-weight:700;border-bottom:1px solid #B6C8BB}
.business-table td{padding:10px;border-bottom:1px solid #DCE5DF;color:#294536;vertical-align:middle}.business-table tr:hover td{background:#EFF3F0}
.business-table strong{display:block;color:#20382B;font-size:12px}.business-table small{display:block;margin-top:3px;color:#62766A;font-size:10px;line-height:1.35}
.business-row-status{min-width:130px}.business-row-save{padding:6px 9px;border:0;border-radius:6px;background:#0B6047;color:white;font:inherit;font-size:10px;cursor:pointer}.business-row-save:hover{background:#074A36}
.business-empty{padding:34px;text-align:center;color:#536B5B;font-size:13px}.business-report-grid{display:grid;grid-template-columns:repeat(4,minmax(150px,1fr));gap:12px;padding:18px;overflow:auto}
.business-stat-card,.business-report-card{padding:16px;border:1px solid #B6C8BB;border-radius:9px;background:#F3F6F3;box-shadow:0 1px 2px #20382b0d}.business-stat-card span{display:block;color:#536B5B;font-size:11px}.business-stat-card strong{display:block;margin-top:9px;color:#0B6047;font-size:25px}
.business-report-card{grid-column:span 2}.business-report-card h2{margin:0 0 12px;font-size:14px;color:#20382B}.business-report-card p{display:flex;justify-content:space-between;gap:12px;margin:0;padding:9px 0;border-bottom:1px solid #DCE5DF;color:#536B5B;font-size:12px}.business-report-card p strong{color:#20382B}
.business-loading{padding:25px;color:#536B5B;font-size:12px}
.reports-workspace .business-report-grid{flex:1;min-height:0;align-content:start}
@media(max-width:700px){.business-report-grid{grid-template-columns:repeat(2,minmax(130px,1fr));padding:10px;gap:8px}.business-report-card{grid-column:span 2}.business-toolbar{flex-wrap:wrap}.business-search{width:100%}}

/* Online order desk, modeled on Pancake POS order operations without retail checkout. */
.online-order-workspace{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden;background:#F3F6F3;color:#20382B}
.order-workspace-toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px 14px;border-bottom:1px solid #B6C8BB;background:#E5EBE6}
.order-source-label{display:flex;align-items:center;gap:10px;min-width:210px}.order-source-dot{width:10px;height:10px;flex:none;border-radius:50%;background:#0B6047;box-shadow:0 0 0 4px #0B60471a}.order-source-label strong,.order-source-label small{display:block}.order-source-label strong{font-size:13px;color:#20382B}.order-source-label small{margin-top:3px;color:#536B5B;font-size:10px}
.order-workspace-actions{display:flex;align-items:center;gap:8px}.order-action-button,.order-create-button,.order-bulk-actions button{min-height:34px;padding:7px 11px;border:1px solid #B6C8BB;border-radius:7px;background:#F3F6F3;color:#20382B;font:inherit;font-size:11px;font-weight:650;cursor:pointer}.order-action-button:hover{background:#CADBD0}.order-create-button,.order-bulk-actions button{border-color:#0B6047;background:#0B6047;color:#fff}.order-create-button:hover,.order-bulk-actions button:hover{background:#074A36}.order-bulk-actions{display:flex;align-items:center;gap:6px}.order-bulk-actions span{color:#536B5B;font-size:10px;white-space:nowrap}.order-bulk-actions select{height:34px;max-width:170px;border:1px solid #B6C8BB;border-radius:7px;background:#F3F6F3;color:#20382B;padding:0 8px;font:inherit;font-size:11px}
.order-view-tabs{display:flex;align-items:center;gap:4px;padding:0 14px;border-bottom:1px solid #B6C8BB;background:#F3F6F3}.order-view-tabs button{position:relative;display:inline-flex;align-items:center;gap:8px;min-height:43px;padding:0 12px;border:0;background:transparent;color:#536B5B;font:inherit;font-size:11px;font-weight:650;cursor:pointer}.order-view-tabs button::after{position:absolute;right:8px;bottom:-1px;left:8px;height:2px;background:transparent;content:""}.order-view-tabs button.active{color:#0B6047}.order-view-tabs button.active::after{background:#0B6047}.order-view-tabs button span{min-width:20px;padding:2px 6px;border-radius:10px;background:#DCE5DF;color:#536B5B;font-size:10px;text-align:center}.order-view-tabs button.active span{background:#D8EDE1;color:#0B6047}
.order-filter-toolbar{display:flex;align-items:center;gap:8px;padding:10px 14px;background:#F3F6F3}.order-search{flex:1;width:auto;max-width:420px}.order-filter-toolbar .business-filter-label{white-space:nowrap}.order-filter-toolbar .business-filter-label select{max-width:155px}.order-count{margin-left:auto}
.order-status-rail{display:flex;align-items:center;gap:5px;padding:0 14px 10px;overflow-x:auto;scrollbar-width:thin;background:#F3F6F3}.order-status-rail button{display:inline-flex;align-items:center;gap:6px;flex:none;min-height:30px;padding:5px 9px;border:1px solid #B6C8BB;border-radius:16px;background:#F3F6F3;color:#536B5B;font:inherit;font-size:10px;cursor:pointer}.order-status-rail button:hover{background:#E5EBE6}.order-status-rail button.active{border-color:#0B6047;background:#0B6047;color:#fff}.order-status-rail button span{font-size:9px;opacity:.8}
.order-settlement-strip{display:grid;grid-template-columns:repeat(5,minmax(110px,1fr));gap:8px;padding:0 14px 10px;background:#F3F6F3}.order-settlement-card{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0;padding:8px 10px;border:1px solid #D1DDD4;border-radius:7px;background:#EAF0EB}.order-settlement-card span{overflow:hidden;color:#536B5B;font-size:10px;text-overflow:ellipsis;white-space:nowrap}.order-settlement-card strong{color:#20382B;font-size:11px;white-space:nowrap}.order-settlement-card.emphasis{background:#E3F0E7}.order-settlement-card.emphasis strong{color:#0B6047}
.order-table-scroll{flex:1;min-height:0;overflow:auto;border-top:1px solid #B6C8BB}.order-table{width:100%;min-width:1180px;border-collapse:separate;border-spacing:0;font-size:11px}.order-table th{position:sticky;top:0;z-index:2;padding:10px 9px;border-bottom:1px solid #B6C8BB;background:#E5EBE6;color:#536B5B;text-align:left;font-size:9px;font-weight:750;letter-spacing:.02em;white-space:nowrap}.order-table td{padding:9px;border-bottom:1px solid #DCE5DF;background:#F3F6F3;color:#294536;vertical-align:middle}.order-table tr:hover td{background:#EAF0EB}.order-table tr.order-row-selected td{background:#E3F0E7}.order-select-cell{width:34px;text-align:center}.order-select-cell input{accent-color:#0B6047}.order-open-button{display:block;padding:0;border:0;background:transparent;color:#0B6047;font:inherit;font-weight:750;text-align:left;cursor:pointer}.order-open-button:hover{text-decoration:underline}.order-table strong{display:block;color:#20382B;font-size:11px}.order-table small{display:block;max-width:230px;margin-top:3px;overflow:hidden;color:#62766A;font-size:9px;line-height:1.4;text-overflow:ellipsis;white-space:nowrap}.order-customer-cell{min-width:155px}.order-address-cell{max-width:200px}.order-product-cell{min-width:150px}.order-total-cell{text-align:right;white-space:nowrap}.order-total-cell strong{font-size:12px}.order-cod-cell{color:#536B5B;font-size:9px}.order-source-chip{display:inline-flex;align-items:center;padding:3px 6px;border-radius:5px;background:#E5EBE6;color:#536B5B;font-size:9px;white-space:nowrap}.order-tracking-link{color:#0B6047;font-weight:650}.order-status-select{min-width:122px;max-width:145px;height:30px;padding:4px 7px;border:1px solid #B6C8BB;border-radius:6px;background:#F3F6F3;color:#20382B;font:inherit;font-size:10px}.order-status-select[data-tone="new"]{border-color:#D4B96D;background:#FFF7DB}.order-status-select[data-tone="progress"]{border-color:#8CB99A;background:#E8F2EA}.order-status-select[data-tone="shipping"]{border-color:#9BBAD1;background:#EDF4F8}.order-status-select[data-tone="done"]{border-color:#84B89A;background:#E6F3EA}.order-status-select[data-tone="return"]{border-color:#D6A895;background:#F9EEEA}.order-status-select[data-tone="cancelled"]{border-color:#C9B8B8;background:#F4EEEE}
.order-pagination{display:flex;align-items:center;justify-content:space-between;padding:8px 14px;border-top:1px solid #B6C8BB;color:#536B5B;font-size:10px}.order-pagination button{padding:5px 8px;border:1px solid #B6C8BB;border-radius:5px;background:#F3F6F3;color:#20382B;cursor:pointer}.order-pagination button:disabled{opacity:.45;cursor:default}
.order-detail-dialog{width:min(760px,calc(100vw - 28px));max-width:none;max-height:min(88vh,900px);padding:0;border:1px solid #B6C8BB;border-radius:12px;background:#F3F6F3;color:#20382B;box-shadow:0 24px 80px #071a1240}.order-detail-dialog::backdrop{background:#071a1266}.order-detail-shell{display:flex;max-height:inherit;flex-direction:column}.order-detail-heading{display:flex;align-items:flex-start;justify-content:space-between;padding:18px 20px 14px;border-bottom:1px solid #B6C8BB;background:#E5EBE6}.order-detail-heading .eyebrow{margin:0 0 4px;color:#536B5B;font-size:9px;letter-spacing:1px}.order-detail-heading h2{margin:0;color:#20382B;font-size:19px}.order-detail-heading span{display:block;margin-top:4px;color:#536B5B;font-size:10px}.order-detail-body{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:16px 20px;overflow:auto}.order-detail-card{padding:13px;border:1px solid #D1DDD4;border-radius:8px;background:#fff}.order-detail-card.wide{grid-column:1/-1}.order-detail-card h3{margin:0 0 10px;color:#536B5B;font-size:10px;letter-spacing:.05em;text-transform:uppercase}.order-detail-card p{margin:6px 0;color:#536B5B;font-size:11px;line-height:1.5;overflow-wrap:anywhere}.order-detail-card p strong{color:#20382B}.order-detail-fields{display:grid;grid-template-columns:1fr 1fr;gap:8px}.order-detail-fields label{display:flex;flex-direction:column;gap:4px;color:#536B5B;font-size:10px}.order-detail-fields input,.order-detail-fields select{min-width:0;height:34px;padding:6px 8px;border:1px solid #B6C8BB;border-radius:6px;background:#F3F6F3;color:#20382B;font:inherit;font-size:11px}.order-detail-item{display:flex;justify-content:space-between;gap:12px;padding:7px 0;border-bottom:1px solid #E5EBE6;color:#536B5B;font-size:11px}.order-detail-item strong{color:#20382B}.order-detail-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 20px;border-top:1px solid #B6C8BB;background:#E5EBE6}.order-detail-footer span{color:#536B5B;font-size:10px}
@media(max-width:900px){.order-filter-toolbar{flex-wrap:wrap}.order-search{max-width:none;flex-basis:100%}.order-settlement-strip{grid-template-columns:repeat(2,minmax(110px,1fr))}.order-workspace-toolbar{align-items:flex-start;flex-direction:column}.order-workspace-actions{width:100%;flex-wrap:wrap}}
@media(max-width:600px){.order-view-tabs{padding:0 8px}.order-view-tabs button{padding:0 8px}.order-filter-toolbar{padding:8px}.order-status-rail{padding-right:8px;padding-left:8px}.order-settlement-strip{padding-right:8px;padding-left:8px}.order-detail-body{grid-template-columns:1fr;padding:12px}.order-detail-card.wide{grid-column:auto}.order-detail-footer{align-items:flex-start;flex-direction:column}.order-workspace-actions>*{flex:1}.order-create-button{white-space:normal}}

/* ========================================================
   DAILY SHEET (ESPOCRM CRM PILLAR) & BI DASHBOARD STYLES
   ======================================================== */
.dailysheet-workspace {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
  color: #1e293b;
}

.metrics-bar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-default, #cbd5e1);
  padding: 8px 16px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  z-index: 15;
}

.metric-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  user-select: none;
}

.metric-card:hover {
  border-color: #1e40af;
  background: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.metric-card.active {
  border-color: #1e40af;
  background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(30, 64, 175, 0.2);
}

.metric-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.icon-blue { background: #dbeafe; color: #1e40af; }
.icon-amber { background: #fef3c7; color: #d97706; }
.icon-purple { background: #f3e8ff; color: #7e22ce; }
.icon-green { background: #d1fae5; color: #059669; }
.icon-red { background: #fee2e2; color: #dc2626; }
.icon-emerald { background: #ecfdf5; color: #047857; }

.metric-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.metric-label {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
  white-space: nowrap;
}

.metric-value {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.controls-bar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-default, #cbd5e1);
  padding: 6px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
  min-height: 42px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1 1 auto;
  min-width: 0;
}

.tab-btn {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 29px;
  box-sizing: border-box;
}

.tab-btn:hover {
  background: #f1f5f9;
}

.tab-btn.active {
  background: #1e40af;
  color: #ffffff;
  border-color: #1e40af;
}

.select-input, .date-input, .search-input {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  color: #1e293b;
  outline: none;
  height: 29px;
  box-sizing: border-box;
}

.select-input:focus, .date-input:focus, .search-input:focus {
  border-color: #1e40af;
  box-shadow: 0 0 0 2px rgba(30, 64, 175, 0.15);
}

.search-input {
  width: 170px;
  min-width: 120px;
  max-width: 200px;
  flex: 1 1 140px;
}

.ds-marketer-picker { position: relative; display: inline-flex; }
.ds-marketer-trigger { max-width: 260px; }
.ds-marketer-trigger strong { max-width: 145px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-marketer-chevron { color: #64748b; font-size: 11px; }
.ds-marketer-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 270px;
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .16);
}
.ds-marketer-menu[hidden], .ds-marketer-option[hidden] { display: none; }
.ds-marketer-search { display: flex; align-items: center; gap: 6px; padding: 0 8px; border: 1px solid #cbd5e1; border-radius: 6px; color: #64748b; }
.ds-marketer-search input { width: 100%; height: 30px; border: 0; outline: 0; background: transparent; color: #1e293b; font: 12px var(--ui-font); }
.ds-marketer-options { max-height: 230px; overflow: auto; }
.ds-marketer-option { display: flex; align-items: center; gap: 8px; min-height: 31px; padding: 4px 6px; border-radius: 5px; color: #334155; font-size: 12px; cursor: pointer; }
.ds-marketer-option:hover { background: #f1f5f9; }
.ds-marketer-option input { width: 14px; height: 14px; margin: 0; accent-color: #047857; }
.ds-marketer-empty { padding: 12px 6px; color: #64748b; font-size: 11px; }
.ds-marketer-empty[hidden] { display: none; }
.ds-marketer-menu-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 7px; border-top: 1px solid #e2e8f0; color: #64748b; font-size: 10px; }
.ds-marketer-menu-footer button { border: 0; background: transparent; color: #047857; font: 600 10px var(--ui-font); cursor: pointer; }
.ds-reset-sort { white-space: nowrap; color: #047857; cursor: pointer; }
.ds-reset-sort:hover { background: #ecfdf5; }
.ds-history-controls { display: inline-flex; align-items: center; gap: 4px; }
.ds-history-btn { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; color: #334155; font: 18px/1 Arial, sans-serif; cursor: pointer; box-sizing: border-box; }
.ds-history-btn:hover:not(:disabled) { border-color: #047857; background: #ecfdf5; color: #047857; }
.ds-history-btn:disabled { color: #a8b3c0; background: #f8fafc; cursor: not-allowed; }
.ds-last-call-age { display: inline-block; color: #475569; font-size: 11px; font-weight: 600; white-space: nowrap; }
.ds-last-call-cell{display:grid;gap:2px;min-width:80px}.ds-last-call-cell small{color:#87958b;font-size:9px;white-space:nowrap}

.action-btns {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.btn {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
  height: 29px;
  white-space: nowrap;
  box-sizing: border-box;
}

.btn-primary { background: #1e40af; color: #ffffff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-success { background: #059669; color: #ffffff; }
.btn-success:hover { background: #047857; }
.btn-outline { background: #ffffff; border: 1px solid #cbd5e1; color: #334155; }
.btn-outline:hover { background: #f1f5f9; }

/* Spreadsheet Grid Container */
.sheet-table-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  position: relative;
  background: #ffffff;
}

table.sheet-table {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
  background: #ffffff;
  --ds-stt-width: 36px;
  --ds-action-width: 105px;
}

table.sheet-table thead th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  color: #334155;
  font-weight: 600;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 6px 6px;
  border-bottom: 2px solid #cbd5e1;
  border-right: 1px solid #e2e8f0;
  text-align: left;
  white-space: nowrap;
  z-index: 5;
  user-select: none;
  box-sizing: border-box;
}

/* DailySheet Column Resizer */
.ds-col-resizer {
  position: absolute;
  top: 0;
  right: -4px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  touch-action: none;
}
.ds-col-resizer::after {
  content: '';
  display: block;
  width: 2px;
  height: 100%;
  background: transparent;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
table.sheet-table.admin-resizable .ds-col-resizer {
  display: flex;
}
table.sheet-table.admin-resizable .ds-col-resizer:hover::after,
table.sheet-table.admin-resizable .ds-col-resizer.is-active::after {
  background-color: #059669;
}
table.sheet-table.admin-resizable .ds-col-resizer.is-active::after {
  background-color: #047857;
  width: 3px;
  box-shadow: 0 0 6px rgba(5, 150, 105, 0.6);
}
table.sheet-table:not(.admin-resizable) .ds-col-resizer {
  display: none !important;
  pointer-events: none !important;
}
body.ds-is-resizing, body.ds-is-resizing * {
  user-select: none !important;
  cursor: col-resize !important;
}

table.sheet-table thead .ds-sort-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: inherit;
  text-transform: inherit;
  white-space: inherit;
  cursor: pointer;
}
table.sheet-table thead .ds-sort-button:hover,
table.sheet-table thead .ds-sort-button:focus-visible { color: #047857; }
table.sheet-table thead .ds-sort-button:focus-visible { outline: 2px solid #10b981; outline-offset: 2px; }
table.sheet-table thead .ds-sort-indicator { flex: 0 0 auto; color: #94a3b8; font-size: 11px; line-height: 1; }
table.sheet-table thead th[aria-sort="ascending"] .ds-sort-indicator,
table.sheet-table thead th[aria-sort="descending"] .ds-sort-indicator { color: #047857; font-weight: 800; }

table.sheet-table th.col-stt, table.sheet-table td.col-stt {
  position: sticky;
  left: 0;
  width: var(--ds-stt-width, 36px);
  min-width: var(--ds-stt-width, 36px);
  max-width: var(--ds-stt-width, 36px);
  text-align: center;
  background: #ffffff;
  z-index: 2;
  box-sizing: border-box;
}
table.sheet-table thead th.col-stt { z-index: 6; background: #f8fafc; }

table.sheet-table th.col-action, table.sheet-table td.col-action {
  position: sticky;
  left: var(--ds-stt-width, 36px);
  width: var(--ds-action-width, 105px);
  min-width: var(--ds-action-width, 105px);
  max-width: var(--ds-action-width, 105px);
  text-align: center;
  background: #ffffff;
  z-index: 2;
  box-sizing: border-box;
}
table.sheet-table thead th.col-action { z-index: 6; background: #f8fafc; }

table.sheet-table tbody tr {
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
  transition: background 0.1s;
}
table.sheet-table tbody tr:hover { background: #f1f5f9; }
table.sheet-table tbody tr.row-claimed-me { background: #f0fdf4; }
table.sheet-table tbody tr.row-closed { background: #f8fafc; opacity: 0.85; }

table.sheet-table td {
  padding: 2px 5px;
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  font-size: 11.5px;
  color: #1e293b;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  height: 32px;
}

.cell-input {
  width: 100%;
  height: 24px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 11.5px;
  color: inherit;
  padding: 1px 3px;
  border-radius: 4px;
  outline: none;
  transition: all 0.15s;
  font-family: inherit;
}
.cell-input:hover { border-color: #cbd5e1; background: #ffffff; }
.cell-input:focus { border-color: #1e40af; background: #ffffff; box-shadow: 0 0 0 2px rgba(30, 64, 175, 0.2); }

.cell-select {
  width: 100%;
  height: 24px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 11.5px;
  color: inherit;
  padding: 1px 3px;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  font-weight: 500;
}
.cell-select:hover { border-color: #cbd5e1; background: #ffffff; }
.cell-select:focus { border-color: #1e40af; background: #ffffff; }

/* Status Badges */
.badge-moi { background: #dbeafe !important; color: #1e40af !important; border: 1px solid #bfdbfe; }
.badge-dang-xu-ly { background: #fef3c7 !important; color: #b45309 !important; border: 1px solid #fde68a; }
.badge-khong-nghe { background: #f1f5f9 !important; color: #475569 !important; border: 1px solid #e2e8f0; }
.badge-hen-lai { background: #f3e8ff !important; color: #7e22ce !important; border: 1px solid #e9d5ff; }
.badge-thue-bao { background: #f8fafc !important; color: #64748b !important; border: 1px solid #e2e8f0; }
.badge-sai-so { background: #fee2e2 !important; color: #b91c1c !important; border: 1px solid #fecaca; }
.badge-tu-choi { background: #fecdd3 !important; color: #9f1239 !important; border: 1px solid #fca5a5; }
.badge-da-chot { background: #d1fae5 !important; color: #047857 !important; border: 1px solid #a7f3d0; }
.badge-dang-day-don { background: #e0f2fe !important; color: #0284c7 !important; border: 1px solid #bae6fd; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border-radius: 4px; font-size: 11px; }
.badge-da-day-don { background: #ecfdf5 !important; color: #059669 !important; border: 1px solid #a7f3d0; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border-radius: 4px; font-size: 11px; }
.badge-huy-day { background: #fef2f2 !important; color: #dc2626 !important; border: 1px solid #fecaca; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border-radius: 4px; font-size: 11px; }
.badge-khong-lien-lac { background: #f1f5f9 !important; color: #475569 !important; border: 1px solid #cbd5e1; }
span.badge-khong-lien-lac { font-weight: 600; display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border-radius: 4px; font-size: 11px; }
.btn-cancel-push { padding: 2px 6px; font-size: 10px; font-weight: 600; background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; border-radius: 4px; cursor: pointer; transition: all 0.15s; }
.btn-cancel-push:hover { background: #fecaca; }
.order-conv-button { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; font-size: 11px; font-weight: 600; color: #0B6047; background: #E8F5EE; border: 1px solid #BED8C8; border-radius: 5px; cursor: pointer; margin-top: 3px; transition: all 0.15s; }
.order-conv-button:hover { background: #D1EADE; border-color: #0B6047; }
.crm-product-nav { display: flex; align-items: center; gap: 6px; overflow-x: auto; padding: 6px 10px; background: #fff; border-bottom: 1px solid #e2e8f0; margin-bottom: 6px; border-radius: 7px; }
.crm-product-tab { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border: 1px solid #cbd5e1; border-radius: 6px; background: #f8fafc; color: #334155; font-size: 12px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: all 0.15s; }
.crm-product-tab:hover { background: #f1f5f9; border-color: #94a3b8; }
.crm-product-tab.active { background: #0B6047; color: #fff; border-color: #0B6047; font-weight: 600; }
.crm-product-tab .badge { font-size: 10px; padding: 1px 5px; border-radius: 10px; background: rgba(0,0,0,0.08); }
.crm-product-tab.active .badge { background: rgba(255,255,255,0.25); color: #fff; }

.claim-badge-unassigned { background: #fee2e2; color: #991b1b; font-size: 10px; padding: 2px 6px; border-radius: 10px; font-weight: 600; display: inline-block; }

/* Telco Badges */
.telco-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  letter-spacing: 0.2px;
  line-height: 13px;
  text-transform: uppercase;
  flex-shrink: 0;
  user-select: none;
}
.telco-viettel { background-color: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.telco-vina { background-color: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.telco-mobi { background-color: #ecfeff; color: #0891b2; border: 1px solid #a5f3fc; }
.telco-vnm { background-color: #fff7ed; color: #ea580c; border: 1px solid #fed7aa; }
.telco-itel { background-color: #faf5ff; color: #9333ea; border: 1px solid #e9d5ff; }
.telco-wintel { background-color: #fdf2f8; color: #db2777; border: 1px solid #fbcfe8; }
.telco-other { background-color: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; }

/* Action Buttons on Row */
.btn-claim {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  font-weight: 700;
  font-size: 10px;
  padding: 3px 6px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(217, 119, 6, 0.4);
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.btn-claim:hover { transform: scale(1.02); background: linear-gradient(135deg, #d97706, #b45309); }

.btn-order {
  background: #059669;
  color: #ffffff;
  font-weight: 600;
  font-size: 10px;
  padding: 3px 6px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.btn-order:hover { background: #047857; }
.btn-send-icon{width:24px;height:24px;padding:0;justify-content:center;flex:0 0 auto}

.ds-action-stack{display:flex;align-items:center;justify-content:center;gap:4px;min-width:0}
.btn-ds-delete{display:inline-flex;width:25px;height:25px;flex:0 0 25px;align-items:center;justify-content:center;padding:0;border:1px solid transparent;border-radius:6px;background:transparent;color:#9b5c53;opacity:.8;cursor:pointer}.btn-ds-delete svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round}.btn-ds-delete:hover,.btn-ds-delete:focus-visible{border-color:#efc5bf;background:#fff0ee;color:#ad3329;opacity:1;outline:none}.btn-ds-delete:disabled{opacity:.4;cursor:wait}
.ds-closed-check{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:50%;background:#dcfce7;color:#047857;font-size:15px;font-weight:800;flex:0 0 auto}
.btn-audit-history{display:inline-flex;align-items:center;justify-content:center;flex:none;min-width:25px;min-height:25px;padding:3px 6px;border:1px solid #c8d6cc;border-radius:6px;background:#f3f6f3;color:#0b6047;font:600 11px var(--ui-font,Arial,sans-serif);cursor:pointer}
.btn-audit-history:hover{border-color:#0b6047;background:#e3f0e7}
.audit-card-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}.audit-card-heading h3{margin:0}
.audit-history-dialog{width:min(900px,calc(100vw - 28px));max-width:none;max-height:min(88vh,900px);overflow:hidden}
.audit-history-shell{display:flex;max-height:inherit;flex-direction:column;padding:18px 20px 14px}
.ds-audit-open{white-space:nowrap}.ds-audit-open[hidden],.audit-history-footer button[hidden]{display:none!important}
.audit-history-heading{margin-bottom:10px;padding-bottom:12px;border-bottom:1px solid #dce5df}.audit-history-heading .eyebrow{margin:0 0 4px;color:#62766a;font-size:9px;letter-spacing:1px}.audit-history-heading h2{color:#20382b}.audit-history-description{max-width:690px;margin:6px 0 0;color:#62766a;font-size:11px;line-height:1.5}
.audit-history-toolbar{display:grid;grid-template-columns:170px minmax(180px,1fr) auto;gap:8px;margin:0 0 10px}.audit-history-toolbar[hidden]{display:none}.audit-history-toolbar select,.audit-history-toolbar input{min-width:0;height:36px;padding:0 10px;border:1px solid #ccd9d0;border-radius:7px;background:#fff;color:#20382b;font:500 11px var(--ui-font,Arial,sans-serif)}.audit-history-toolbar input:focus,.audit-history-toolbar select:focus{border-color:#0b6047;outline:2px solid #0b60471a}.audit-history-toolbar button{min-height:36px;padding:0 12px}
.audit-history-list{display:grid;gap:9px;min-height:90px;max-height:66vh;overflow:auto;padding:2px 4px 4px 0}
.audit-history-item{padding:11px 12px;border:1px solid #dce5df;border-radius:8px;background:#fff}
.audit-history-item>header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.audit-history-item>header div{display:grid;gap:3px}.audit-history-item>header strong{color:#0b6047;font-size:12px}.audit-history-item>header span,.audit-history-item>header time{color:#62766a;font-size:10px}.audit-history-item>header time{flex:none;text-align:right}
.audit-history-entity{display:flex;align-items:center;gap:8px;margin:8px 0 0;color:#62766a;font-size:10px}.audit-history-entity>span:first-child{padding:3px 6px;border-radius:999px;background:#e9f2eb;color:#0b6047;font-weight:700}.audit-history-entity strong{color:#20382b;font-size:11px}.audit-history-item>footer{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:10px;padding-top:8px;border-top:1px solid #edf1ed;color:#62766a;font-size:10px}.audit-history-item>footer button{padding:5px 9px;border:1px solid #bbd6c5;border-radius:6px;background:#eff8f1;color:#087451;font:700 10px var(--ui-font,Arial,sans-serif);cursor:pointer}.audit-history-item>footer button:hover{border-color:#087451;background:#e1f3e6}.audit-history-item>footer button:disabled{opacity:.55;cursor:wait}.audit-history-old-version{color:#8b7a50}
.audit-history-item ul{display:grid;gap:7px;margin:10px 0 0;padding:0;list-style:none}.audit-history-item li{display:grid;gap:3px;padding-top:7px;border-top:1px solid #edf1ed;color:#536b5b;font-size:10px}.audit-history-item li>div{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:start;gap:8px}.audit-history-item li>div span{overflow-wrap:anywhere;color:#20382b}.audit-history-item li>div b{color:#84958a}.audit-history-no-fields,.audit-history-empty,.audit-history-error{margin:0;padding:20px;text-align:center;color:#62766a;font-size:11px}.audit-history-error{color:#b91c1c}.audit-history-footer{padding-top:10px;border-top:1px solid #dce5df}
.audit-history-footer{justify-content:space-between}.audit-history-footer span{margin-right:auto;color:#62766a;font-size:10px}
@media(max-width:640px){.audit-history-shell{padding:14px 12px}.audit-history-toolbar{grid-template-columns:1fr 1fr}.audit-history-toolbar input{grid-column:1/-1}.audit-history-item>header{gap:6px}.audit-history-item>header time{max-width:105px}.audit-history-item>footer{align-items:flex-start;flex-direction:column}.audit-history-entity{flex-wrap:wrap}}

.phone-masked { color: #64748b; font-family: monospace; font-weight: 600; letter-spacing: 1px; }
.phone-clean { color: #0f172a; font-family: monospace; font-weight: 600; }

/* Modal Styles */
.modal-overlay {
  border: none;
  padding: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(3px);
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-overlay:not([open]) { display: none; }

.modal-card {
  background: #ffffff;
  border-radius: 12px;
  width: 720px;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}
.modal-header { padding: 16px 20px; border-bottom: 1px solid #e2e8f0; display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 16px; font-weight: 700; color: #1e293b; display: flex; align-items: center; gap: 8px; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 12px 20px; border-top: 1px solid #e2e8f0; background: #f8fafc; display: flex; justify-content: flex-end; gap: 10px; }
.paste-grid-card{width:min(1380px,96vw);max-width:96vw;height:min(88vh,850px);max-height:88vh}.paste-grid-card .modal-header{flex:0 0 auto}.paste-grid-subtitle{margin-top:4px;color:#64748b;font-size:11px}.paste-intake-tabs{display:flex;flex:0 0 auto;gap:6px;padding:8px 18px 0;border-bottom:1px solid #dbe3ed;background:#fff}.paste-intake-tabs button{padding:8px 12px;border:1px solid transparent;border-bottom:0;border-radius:7px 7px 0 0;background:transparent;color:#64748b;font-family:inherit;font-size:11px;font-weight:600;cursor:pointer}.paste-intake-tabs button.active{border-color:#cbd5e1;background:#f8fafc;color:#1e40af}.paste-intake-tabs button[hidden]{display:none}.paste-grid-card .modal-body{display:flex;min-height:0;flex:1;flex-direction:column;gap:10px;padding:14px 18px}.paste-intake-pane:not(.hidden){display:flex;min-height:0;flex:1;flex-direction:column}.paste-intake-pane .external-import-content{height:100%;padding:0}.paste-grid-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px}.paste-grid-toolbar p{margin:0;color:#64748b;font-size:11px;line-height:1.5}.paste-grid-toolbar strong{color:#334155}.paste-grid-toolbar>div{display:flex;flex:0 0 auto;gap:7px}.paste-grid-scroll{flex:1;min-height:180px;overflow:auto;border:1px solid #cbd5e1;border-radius:8px;background:#fff}.paste-grid{width:100%;min-width:1394px;border-collapse:separate;border-spacing:0;table-layout:fixed;font-size:11px}.paste-grid th{position:sticky;top:0;z-index:2;height:34px;padding:7px 8px;border-right:1px solid #dbe3ed;border-bottom:1px solid #cbd5e1;background:#eef3f8;color:#475569;text-align:left;white-space:nowrap}.paste-grid th:first-child{left:0;z-index:3;width:42px;text-align:center}.paste-grid th:nth-child(2){width:160px}.paste-grid th:nth-child(3){width:140px}.paste-grid th:nth-child(4){width:220px}.paste-grid th:nth-child(5){width:170px}.paste-grid th:nth-child(6){width:82px}.paste-grid th:nth-child(7){width:130px}.paste-grid th:nth-child(8){width:180px}.paste-grid th:nth-child(9){width:230px}.paste-grid td{height:36px;padding:0;border-right:1px solid #e2e8f0;border-bottom:1px solid #e2e8f0;background:#fff;cursor:cell}.paste-grid td.paste-grid-selected{background:#dbeafe!important}.paste-grid td.paste-grid-active{position:relative;z-index:1;box-shadow:inset 0 0 0 2px #3157c8}.paste-grid tbody tr:nth-child(even) td{background:#f9fbfd}.paste-grid tbody th{left:0;z-index:1;height:36px;padding:0 5px;border-right:1px solid #e2e8f0;border-bottom:1px solid #e2e8f0;background:#f1f5f9;color:#64748b;text-align:center;font-size:10px;font-weight:600}.paste-grid input{display:block;width:100%;height:35px;padding:6px 8px;border:0;border-radius:0;outline:none;background:transparent;color:#1e293b;font:inherit;font-size:11px}.paste-grid input:focus{position:relative;z-index:1;outline:2px solid #3157c8;outline-offset:-2px;background:#eff6ff}.paste-grid input::placeholder{color:#a0acb9}.paste-grid select{display:block;width:100%;height:35px;padding:5px 7px;border:0;border-radius:0;outline:none;background:transparent;color:#1e293b;font:inherit;font-size:11px}.paste-grid select:focus{position:relative;z-index:1;outline:2px solid #3157c8;outline-offset:-2px;background:#eff6ff}.paste-grid-status{flex:0 0 auto;padding:8px 10px;border:1px solid #dbe3ed;border-radius:6px;background:#f8fafc;color:#64748b;font-size:10px}.paste-grid-card .modal-footer{flex:0 0 auto;justify-content:space-between}.paste-grid-card .modal-footer #pasteCsvActions{display:flex;gap:8px}.paste-grid-card .modal-footer .btn-primary:disabled{opacity:.5;cursor:not-allowed}

/* BI Dashboards & Funnel Styles */
.reports-workspace #reportsContent,
.reports-bi-workspace {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
  min-height: 0 !important;
  overflow: auto !important;
  padding: 0 !important;
  background: #f8fafc !important;
}

.bi-container {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
}
.bi-section-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: .02em;
}
.funnel-wrapper {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  align-items: stretch;
}
.funnel-card {
  flex: 1;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 8px 10px;
  text-align: center;
  position: relative;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.funnel-stage { font-size: 10px; font-weight: 600; color: #64748b; margin-bottom: 3px; }
.funnel-count { font-size: 16px; font-weight: 700; color: #1e40af; margin-bottom: 2px; }
.funnel-percent { font-size: 10px; font-weight: 600; color: #059669; background: #d1fae5; padding: 1px 6px; border-radius: 10px; display: inline-block; margin: 0 auto; }

.bi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.bi-panel {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 10px 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  margin-bottom: 12px;
}

.spinner {
  border: 2px solid #f3f3f3;
  border-top: 2px solid #1e40af;
  border-radius: 50%;
  width: 14px; height: 14px;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

@media(max-width: 1100px) {
  .metrics-bar { grid-template-columns: repeat(3, 1fr); }
  .bi-grid { grid-template-columns: 1fr; }
  .funnel-wrapper { flex-wrap: wrap; }
  .funnel-card { flex-basis: 30%; }
}
@media(max-width: 700px) {
  .metrics-bar { grid-template-columns: repeat(2, 1fr); }
  .funnel-card { flex-basis: 45%; }
}

/* BI Report Modern Enhancements */
.report-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e2e8f0;
}
.report-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.report-tab-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.report-tab-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
}
.report-tab-btn.active {
  background: #1e40af;
  color: #ffffff;
  border-color: #1e40af;
  box-shadow: 0 1px 3px rgba(30, 64, 175, 0.3);
}
.report-time-filter {
  display: flex;
  align-items: center;
  gap: 3px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 2px 4px;
  border-radius: 6px;
}
.report-time-btn {
  background: none;
  border: none;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
}
.report-time-btn.active {
  background: #e2e8f0;
  color: #0f172a;
  font-weight: 700;
}
.report-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.report-kpi-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 8px 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.report-kpi-title {
  font-size: 10.5px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.report-kpi-value {
  font-size: 16.5px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 2px;
}
.report-kpi-sub {
  font-size: 10px;
  color: #64748b;
}
.report-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
}
.badge-green { background: #dcfce7; color: #15803d; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-amber { background: #fef3c7; color: #b45309; }
.badge-purple { background: #f3e8ff; color: #7e22ce; }
.badge-red { background: #fee2e2; color: #b91c1c; }
.progress-container {
  background: #f1f5f9;
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
  margin-top: 4px;
}
.progress-fill {
  height: 100%;
  border-radius: 4px;
}
@media(max-width: 900px) {
  .report-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
.report-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.report-export-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}
.report-export-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.report-table th {
  background: #f8fafc;
  color: #64748b;
  font-weight: 600;
  text-align: left;
  padding: 7px 10px;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}
.report-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}
.report-table tr:hover td {
  background: #f8fafc;
}
.report-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #f1f5f9;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
  margin-top: 8px;
}

/* Donut / Pie Chart (Biểu đồ quạt) */
.donut-chart-card {
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.donut-chart-title {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.donut-chart-body {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 16px;
}
.donut-svg-wrapper {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.donut-svg-wrapper svg {
  transform: rotate(0deg);
  overflow: visible;
}
.donut-svg-wrapper circle {
  transition: stroke-width 0.2s ease, opacity 0.2s ease;
  cursor: pointer;
}
.donut-svg-wrapper circle:hover {
  opacity: 0.85;
  stroke-width: 22px;
}
.donut-center-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}
.donut-center-sub {
  font-size: 9px;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 600;
}
.donut-center-val {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}
.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
  max-height: 150px;
  overflow-y: auto;
  padding-right: 4px;
}
.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #334155;
  padding: 1px 0;
}
.donut-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}
.donut-legend-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.donut-legend-val {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}
.donut-legend-pct {
  font-size: 11px;
  font-weight: 700;
  min-width: 38px;
  text-align: right;
  white-space: nowrap;
}
.donut-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
@media(max-width: 860px) {
  .donut-grid { grid-template-columns: 1fr; }
  .donut-chart-body { flex-direction: column; }
}

/* Monthly Revenue Growth Chart Styles */
.monthly-growth-panel {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.growth-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.growth-stat-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
}
.growth-stat-label {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 3px;
}
.growth-stat-val {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 2px;
}
.growth-stat-sub {
  font-size: 10px;
  color: #64748b;
}
.growth-svg-container {
  width: 100%;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 8px 6px;
  margin-bottom: 10px;
  overflow-x: auto;
}
.growth-svg-container svg {
  width: 100%;
  height: auto;
  min-width: 650px;
  display: block;
}
.growth-bar {
  transition: opacity 0.2s, transform 0.2s;
  cursor: pointer;
}
.growth-bar:hover {
  opacity: 0.75;
}
.growth-bar.bar-current {
  stroke: #032d24;
  stroke-width: 1.5;
}
.status-panel-split {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 14px;
  align-items: center;
}
@media(max-width: 900px) {
  .growth-summary-strip { grid-template-columns: repeat(2, 1fr); }
  .status-panel-split { grid-template-columns: 1fr; }
}

/* Telesales Comparison Bar Chart Styles */
.sales-charts-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
@media(max-width: 860px) {
  .sales-charts-grid { grid-template-columns: 1fr; }
}
.telesale-bar-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.telesale-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #f1f5f9;
}
.telesale-bar-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 6px;
}
.telesale-bar-svg-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #ffffff;
}
.telesale-bar-svg-wrap svg {
  width: 100%;
  height: auto;
  max-height: 240px;
  display: block;
}
.telesale-bar {
  transition: all 0.2s ease;
  cursor: pointer;
}
.telesale-bar:hover {
  opacity: 0.85;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.15));
}
.telesale-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  margin-top: 8px;
}
.telesale-summary-bar span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}





/* Compact online order desk */
.order-workspace-toolbar{min-height:52px;gap:10px;padding:7px 12px}
.order-source-label{gap:8px;min-width:0}
.order-source-label div{display:flex;align-items:baseline;gap:8px;min-width:0}
.order-source-label strong{font-size:12px;white-space:nowrap}
.order-source-label small{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.order-source-dot{width:8px;height:8px;box-shadow:0 0 0 3px #0B60471a}
.order-workspace-actions{gap:6px}
.order-action-button,.order-create-button,.order-bulk-actions button{min-height:31px;padding:5px 9px}
.order-bulk-actions select{height:31px}
.order-view-tabs button{min-height:36px;padding:0 10px}
.order-view-tabs button::after{right:6px;left:6px}
.order-filter-toolbar{gap:7px;padding:7px 12px}
.order-search{flex:1 1 300px;max-width:none;height:34px}
.order-filter-toolbar .business-filter-label{gap:5px;font-size:10px}
.order-filter-toolbar .business-filter-label select{height:32px;min-width:92px;max-width:165px;padding:4px 6px;font-size:10px}
.order-count{flex:0 0 auto;font-size:10px}
.order-status-rail{gap:4px;padding:0 12px 7px}
.order-status-rail button{min-height:27px;padding:4px 8px;font-size:9px}
.order-settlement-strip{gap:6px;padding:0 12px 7px}
.order-settlement-card{gap:6px;padding:6px 8px}
.order-settlement-card span{font-size:9px}
.order-settlement-card strong{font-size:10px}
.order-table{min-width:1080px;table-layout:fixed}
.order-col-select{width:36px}
.order-col-code{width:108px}
.order-col-customer{width:140px}
.order-col-phone{width:90px}
.order-col-address{width:142px}
.order-col-product{width:125px}
.order-col-amount{width:110px}
.order-col-carrier{width:132px}
.order-col-updated{width:95px}
.order-col-status{width:138px}
.order-table th{padding:7px 7px;font-size:8px}
.order-table td{padding:6px 7px}
.order-table strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.order-open-button{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.order-table small{max-width:none}
.order-customer-cell,.order-product-cell{min-width:0}
.order-status-select{width:100%;min-width:0;max-width:none;height:28px;box-sizing:border-box;padding:3px 5px;font-size:9px}
.order-pagination{position:sticky;bottom:0;z-index:3;background:#F3F6F3;padding:6px 12px}
@media(max-width:900px){.order-filter-toolbar{flex-wrap:wrap}.order-search{flex-basis:100%}.order-workspace-toolbar{align-items:flex-start;flex-direction:column}.order-workspace-actions{width:100%;flex-wrap:wrap}.order-settlement-strip{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:700px){.order-source-label div{align-items:flex-start;flex-direction:column;gap:2px}.order-settlement-strip{grid-template-columns:repeat(2,minmax(0,1fr))}.order-filter-toolbar .business-filter-label{flex:1 1 130px}.order-filter-toolbar .business-filter-label select{flex:1;min-width:0;max-width:none}}

/* External order intake */
.external-import-dialog{width:min(1080px,calc(100vw - 28px));max-width:none;max-height:min(92vh,980px);padding:0;border:1px solid #B6C8BB;border-radius:12px;background:#F3F6F3;color:#20382B;box-shadow:0 24px 80px #071a1240}
.external-import-dialog::backdrop{background:#071a1266}
.external-import-shell{display:flex;max-height:inherit;flex-direction:column}
.external-import-heading{display:flex;justify-content:space-between;gap:16px;padding:17px 20px 13px;border-bottom:1px solid #B6C8BB;background:#E5EBE6}
.external-import-heading .eyebrow{margin:0 0 4px;color:#536B5B;font-size:9px;letter-spacing:1px}
.external-import-heading h2{margin:0;color:#20382B;font-size:19px}
.external-import-heading p:last-child{margin:5px 0 0;color:#536B5B;font-size:11px}
.external-import-content{display:flex;min-height:0;flex-direction:column;gap:9px;padding:14px 18px;overflow:auto}
.external-import-controls{display:flex;align-items:end;gap:9px;flex-wrap:wrap}
.external-import-controls label{display:flex;min-width:190px;flex-direction:column;gap:4px;color:#536B5B;font-size:10px;font-weight:650}
.external-import-controls input,.external-import-controls select{height:34px;padding:6px 8px;border:1px solid #B6C8BB;border-radius:6px;background:#fff;color:#20382B;font:inherit;font-size:11px}
.external-import-file{display:flex;min-height:62px;flex-direction:column;justify-content:center;gap:4px;padding:9px 12px;border:1px dashed #8EA997;border-radius:8px;background:#fff;color:#20382B;cursor:pointer}
.external-import-file strong{font-size:11px}.external-import-file span,.external-import-hint{color:#62766A;font-size:10px}.external-import-file input{margin-top:4px;font-size:10px}
.external-import-hint{margin:0;line-height:1.45}
.external-import-feedback{padding:8px 10px;border:1px solid #D1DDD4;border-radius:6px;background:#EAF0EB;color:#536B5B;font-size:10px}
.external-import-summary{display:flex;gap:6px;flex-wrap:wrap}
.external-import-summary span{padding:5px 8px;border:1px solid #D1DDD4;border-radius:12px;background:#fff;color:#536B5B;font-size:9px;font-weight:650}
.external-import-preview{max-height:42vh;overflow:auto;border:1px solid #D1DDD4;border-radius:7px;background:#fff}
.external-import-table{width:100%;border-collapse:collapse;font-size:10px}.external-import-table th{position:sticky;top:0;z-index:1;padding:7px;background:#E5EBE6;color:#536B5B;text-align:left;white-space:nowrap}.external-import-table td{padding:6px 7px;border-top:1px solid #E5EBE6;color:#294536;vertical-align:top}.external-import-table td:nth-child(2){font-weight:700}.external-import-table .external-row-ready{color:#0B6047}.external-import-table .external-row-invalid,.external-import-table .external-row-duplicate,.external-import-table .external-row-contact_review{color:#A64B35}.external-import-table select{max-width:230px;padding:4px;border:1px solid #B6C8BB;border-radius:5px;background:#fff;font:inherit;font-size:9px}
.external-import-footer{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 18px;border-top:1px solid #B6C8BB;background:#E5EBE6}.external-import-footer>div{display:flex;gap:7px}
.ds-shipping-dialog{width:min(480px,calc(100vw - 28px))}.ds-shipping-fields{display:grid;gap:12px;padding:18px 20px}.ds-shipping-fields label{display:flex;flex-direction:column;gap:5px;color:#536B5B;font-size:11px;font-weight:650}.ds-shipping-fields label span{display:inline;color:#7b8d80;font-weight:400}.ds-shipping-fields input{height:38px;padding:7px 9px;border:1px solid #B6C8BB;border-radius:7px;background:#fff;color:#20382B;font:inherit;font-size:12px}.ds-shipping-dialog .external-import-footer{padding:11px 18px}
@media(max-width:700px){.external-import-controls{align-items:stretch;flex-direction:column}.external-import-controls label{min-width:0}.external-import-footer{align-items:stretch;flex-direction:column-reverse}.external-import-footer>div>*{flex:1}.external-import-preview{max-height:48vh}}
