/* Sơn INFOR distributor dashboard. All selectors are scoped to .sidd-root. */
.sidd-root {
  --sidd-blue: #064a8e;
  --sidd-navy: #09246b;
  --sidd-ink: #17324d;
  --sidd-muted: #5d738a;
  --sidd-line: #d6e2ec;
  --sidd-soft: #f1f7fb;
  --sidd-pale: #e5f1f8;
  --sidd-danger: #a43a36;
  display: block;
  width: 100%;
  min-width: 0;
  color: var(--sidd-ink);
  font-family: var(--f-body, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
}
.sidd-dashboard { display: grid; gap: 18px; min-width: 0; }
.sidd-dashboard *, .sidd-dashboard *::before, .sidd-dashboard *::after { box-sizing: border-box; }
.sidd-dashboard h1, .sidd-dashboard h2, .sidd-dashboard h3, .sidd-dashboard p { margin: 0; }
.sidd-dashboard button, .sidd-dashboard input, .sidd-dashboard select { font: inherit; }
.sidd-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; padding-bottom: 4px; border-bottom: 1px solid var(--sidd-line); }
.sidd-heading { display: grid; gap: 8px; min-width: 0; }
.sidd-kicker { display: block; color: var(--sidd-blue); font-size: 11px; font-weight: 800; letter-spacing: .14em; line-height: 1.35; text-transform: uppercase; }
.sidd-heading h1 { color: var(--sidd-navy); font: 700 clamp(25px, 4vw, 42px)/1.08 var(--f-display, -apple-system, sans-serif); letter-spacing: -.025em; }
.sidd-muted, .sidd-panel-note, .sidd-scope-note { color: var(--sidd-muted); font-size: 13px; line-height: 1.55; }
.sidd-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.sidd-button { appearance: none; min-height: 42px; border: 1px solid var(--sidd-blue); border-radius: 3px; padding: 9px 14px; background: var(--sidd-blue); color: #fff; cursor: pointer; font-weight: 750; line-height: 1.2; }
.sidd-button:hover, .sidd-button:focus-visible { background: var(--sidd-navy); border-color: var(--sidd-navy); }
.sidd-button-light { background: #fff; color: var(--sidd-blue); }
.sidd-button-light:hover, .sidd-button-light:focus-visible { background: var(--sidd-soft); color: var(--sidd-navy); }
.sidd-status { padding: 11px 13px; border: 1px solid #c5dce9; background: var(--sidd-soft); color: var(--sidd-navy); line-height: 1.5; }
.sidd-status[data-kind="error"] { border-color: #ebc4bf; background: #fff7f5; color: var(--sidd-danger); }
.sidd-status[data-kind="ok"] { border-color: #b9dcca; background: #f3fbf7; color: #176b4d; }
.sidd-controls { display: grid; grid-template-columns: minmax(240px, 1.5fr) minmax(280px, 1fr); gap: 12px; align-items: end; padding: 16px; border: 1px solid var(--sidd-line); background: var(--sidd-soft); }
.sidd-owner-field, .sidd-locked-owner { min-width: 0; }
.sidd-locked-owner { display: grid; gap: 4px; min-height: 70px; align-content: center; padding: 0 2px; }
.sidd-locked-owner > span, .sidd-field > span, .sidd-mini-grid span, .sidd-kpi > span, .sidd-highlight > span { color: var(--sidd-muted); font-size: 12px; font-weight: 750; }
.sidd-locked-owner strong { color: var(--sidd-navy); overflow-wrap: anywhere; }
.sidd-locked-owner small { color: var(--sidd-muted); font-size: 12px; line-height: 1.4; }
.sidd-field { display: grid; gap: 6px; min-width: 0; }
.sidd-field input, .sidd-field select { width: 100%; min-width: 0; min-height: 42px; border: 1px solid #abc2d5; border-radius: 3px; padding: 9px 10px; background: #fff; color: var(--sidd-navy); font-size: 16px; }
.sidd-field input:focus, .sidd-field select:focus { border-color: var(--sidd-blue); outline: 2px solid #c6e2f3; outline-offset: 1px; }
.sidd-date-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sidd-content { display: grid; gap: 18px; min-width: 0; }
.sidd-scope-note { padding: 11px 13px; border-left: 3px solid var(--sidd-blue); background: #f8fbfd; }
.sidd-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.sidd-kpi { display: grid; min-width: 0; gap: 6px; padding: 15px; border: 1px solid var(--sidd-line); background: #fff; }
.sidd-kpi b { color: var(--sidd-navy); font: 700 clamp(19px, 2.4vw, 26px)/1.1 var(--f-mono, ui-monospace, monospace); overflow-wrap: anywhere; }
.sidd-kpi small { color: var(--sidd-muted); font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.sidd-panel { display: grid; gap: 13px; min-width: 0; padding: 17px; border: 1px solid var(--sidd-line); background: #fff; }
.sidd-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--sidd-line); }
.sidd-panel-head h2 { margin-top: 4px; color: var(--sidd-navy); font-size: 21px; line-height: 1.25; }
.sidd-panel-note { max-width: 48%; text-align: right; overflow-wrap: anywhere; }
.sidd-table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sidd-table-scroll table { width: 100%; min-width: 590px; border-collapse: collapse; }
.sidd-table-scroll th, .sidd-table-scroll td { padding: 10px 9px; border-bottom: 1px solid var(--sidd-line); text-align: left; vertical-align: top; line-height: 1.45; }
.sidd-table-scroll th { color: var(--sidd-muted); font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.sidd-table-scroll td { color: var(--sidd-ink); font-size: 13px; }
.sidd-table-scroll tbody tr:last-child td { border-bottom: 0; }
.sidd-table-scroll small { color: var(--sidd-muted); }
.sidd-mono { font-family: var(--f-mono, ui-monospace, monospace); overflow-wrap: anywhere; }
.sidd-mini-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sidd-mini-grid > div { display: grid; gap: 5px; padding: 12px; background: var(--sidd-soft); }
.sidd-mini-grid b { color: var(--sidd-navy); font: 700 21px/1.15 var(--f-mono, ui-monospace, monospace); overflow-wrap: anywhere; }
.sidd-highlight { display: grid; gap: 5px; padding: 16px; border-left: 4px solid var(--sidd-blue); background: var(--sidd-pale); }
.sidd-highlight b { color: var(--sidd-navy); font: 700 clamp(22px, 4vw, 32px)/1.1 var(--f-mono, ui-monospace, monospace); overflow-wrap: anywhere; }
.sidd-highlight small { color: var(--sidd-muted); font-size: 12px; }
.sidd-empty { padding: 17px 2px; color: var(--sidd-muted); font-size: 13px; line-height: 1.55; }
.sidd-project-list { display: grid; gap: 0; border-top: 1px solid var(--sidd-line); }
.sidd-project-list article { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--sidd-line); }
.sidd-project-list article > div { display: grid; gap: 3px; min-width: 0; }
.sidd-project-list b { color: var(--sidd-navy); overflow-wrap: anywhere; }
.sidd-project-list small, .sidd-project-list article > span { color: var(--sidd-muted); font-size: 12px; }
.sidd-project-list article > span { flex: 0 0 auto; }
@media (max-width: 760px) {
  .sidd-header { align-items: flex-start; flex-direction: column; }
  .sidd-actions { width: 100%; justify-content: flex-start; }
  .sidd-controls { grid-template-columns: 1fr; }
  .sidd-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .sidd-dashboard { gap: 13px; }
  .sidd-heading h1 { font-size: 27px; }
  .sidd-controls, .sidd-panel { padding: 12px; }
  .sidd-date-fields, .sidd-mini-grid, .sidd-kpis { grid-template-columns: 1fr; }
  .sidd-actions .sidd-button { flex: 1 1 140px; }
  .sidd-panel-head { flex-direction: column; gap: 6px; }
  .sidd-panel-note { max-width: none; text-align: left; }
  .sidd-table-scroll table { min-width: 540px; }
}
@media (max-width: 320px) {
  .sidd-heading h1 { font-size: 24px; }
  .sidd-button { padding-inline: 10px; }
  .sidd-kpi b, .sidd-mini-grid b { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  .sidd-button { transition: none; }
}

/* 3.7.23: Xóa tồn kho luôn nằm ngoài vùng bảng cuộn ngang. */
.sidd-root .sidd-stock-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:10px; min-width:0; }
.sidd-root .sidd-stock-toolbar p { flex:1 1 220px; }
.sidd-root .sidd-button-danger { color:#fff; background:#a43a36; border-color:#a43a36; }
.sidd-root .sidd-button-danger:hover, .sidd-root .sidd-button-danger:focus-visible { background:#822c29; border-color:#822c29; }
.sidd-root .sidd-button:disabled { opacity:.5; cursor:not-allowed; }
.sidd-root .sidd-stock-row-delete { color:#a43a36; border-color:#dcb1ad; margin-top:8px; min-height:44px; }
.sidd-root .sidd-reset-dialog { width:min(480px,calc(100vw - 24px)); max-width:calc(100vw - 24px); max-height:calc(100dvh - 32px); margin:auto; padding:22px; border:1px solid var(--sidd-line); border-radius:14px; background:#fff; color:var(--sidd-ink); overflow:auto; }
.sidd-root .sidd-reset-dialog::backdrop { background:rgba(9,36,65,.5); }
.sidd-root .sidd-reset-dialog form { display:grid; gap:16px; min-width:0; }
.sidd-root .sidd-reset-dialog h2 { color:var(--sidd-navy); font-size:23px; }
.sidd-root .sidd-reset-dialog p { overflow-wrap:anywhere; font-size:14px; line-height:1.55; }
.sidd-root .sidd-reset-dialog select { width:100%; min-width:0; max-width:100%; height:48px; }
.sidd-root .sidd-reset-warning { padding:12px; background:#fff7f5; border-left:3px solid var(--sidd-danger); }
.sidd-root [data-sidd-reset-error] { color:var(--sidd-danger); }
@media(max-width:480px) {
  .sidd-root .sidd-stock-toolbar > .sidd-button { width:100%; min-height:46px; }
  .sidd-root .sidd-reset-dialog { padding:16px; }
  .sidd-root .sidd-reset-dialog .sidd-actions { display:grid; grid-template-columns:1fr 1fr; }
}

/* 3.7.25: chiết khấu cuối năm đọc cùng engine đơn nhập, trình bày riêng từng NPP. */
.sidd-root .sidd-annual-formula { display:grid; gap:8px; padding:14px; background:var(--sidd-soft); border-left:3px solid var(--sidd-blue); line-height:1.55; overflow-wrap:anywhere; }
.sidd-root .sidd-annual-formula b { color:var(--sidd-navy); }
.sidd-root .sidd-annual-formula small, .sidd-root .sidd-annual-card small { color:var(--sidd-muted); line-height:1.5; }
.sidd-root .sidd-annual-list { display:grid; gap:14px; min-width:0; }
.sidd-root .sidd-annual-card { display:grid; gap:12px; border:1px solid var(--sidd-line); padding:14px; min-width:0; }
.sidd-root .sidd-annual-card h3 { color:var(--sidd-navy); font-size:18px; line-height:1.4; overflow-wrap:anywhere; }
.sidd-root .sidd-annual-error { color:var(--sidd-danger); padding:12px; background:#fff7f5; line-height:1.55; overflow-wrap:anywhere; }
@media(max-width:480px) { .sidd-root .sidd-annual-card { padding:10px; } }
