:root {
  --ink: #1f2933;
  --muted: #667085;
  --line: #d7dee8;
  --soft: #f4f7fb;
  --panel: #ffffff;
  --blue: #2563eb;
  --green: #0f6fb8;
  --red: #1d4ed8;
  --amber: #0369a1;
  --shadow: 0 12px 30px rgba(23, 37, 84, 0.08);
  --tint-blue: #e1efff;
  --tint-green: #e4f3ff;
  --tint-amber: #dff4ff;
  --tint-violet: #e8efff;
  --tint-cyan: #dcf7ff;
  --tint-rose: #eaf5ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: #eef3f8;
  color: var(--ink);
  font-family: "Prompt", "Segoe UI", Tahoma, Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  padding: 0 14px;
}

button:hover {
  border-color: #9aa8bc;
}

.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 32px 22px;
  background: #fbfdff;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  font-weight: 600;
}

.header-note {
  margin-top: 6px;
  color: #334155;
  font-size: 13px;
  font-weight: 400;
}

.header-credit {
  margin-top: 3px;
  color: #0f6fb8;
  font-size: 12px;
  font-weight: 500;
}

.header-credit + h1 {
  display: none;
}

h2 {
  font-size: 17px;
}

.upload {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

main {
  padding: 22px 32px 32px;
}

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) repeat(4, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

label span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfdff;
  color: var(--ink);
  padding: 0 10px;
}

.summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.alex-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.alex-report-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  background: var(--tint-violet);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.alex-report-head p:last-child {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.summary div,
.panel,
.alex-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.summary div {
  position: relative;
  overflow: hidden;
  padding: 18px 18px;
}

.summary div::before,
.panel::before,
.alex-card::before {
  content: "";
  display: block;
  height: 4px;
}

.summary div:nth-child(1) {
  background: var(--tint-blue);
  border-color: #b9d2f2;
}

.summary div:nth-child(1)::before {
  background: #3f7fd0;
}

.summary div:nth-child(2) {
  background: var(--tint-green);
  border-color: #b5d8f5;
}

.summary div:nth-child(2)::before {
  background: #0f75bc;
}

.summary div:nth-child(3) {
  background: #e7f1ff;
  border-color: #bfd4f3;
}

.summary div:nth-child(3)::before {
  background: #5b91dc;
}

.summary div:nth-child(4) {
  background: #e3f5ff;
  border-color: #b5ddf4;
}

.summary div:nth-child(4)::before {
  background: #1686c7;
}

.summary div:nth-child(5) {
  background: var(--tint-amber);
  border-color: #adddf3;
}

.summary div:nth-child(5)::before {
  background: #0277bd;
}

.summary span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.summary strong {
  display: block;
  margin-top: 8px;
  font-size: 32px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.alex-card {
  overflow: hidden;
  padding: 16px;
}

.alex-card:nth-child(2) {
  background: #e7f1ff;
  border-color: #bfd4f3;
}

.alex-card:nth-child(2)::before {
  margin: -16px -16px 12px;
  background: #5b91dc;
}

.alex-card:nth-child(3) {
  background: #e3f5ff;
  border-color: #b5ddf4;
}

.alex-card:nth-child(3)::before {
  margin: -16px -16px 12px;
  background: #1686c7;
}

.alex-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.alex-card-head p {
  color: var(--muted);
  font-size: 12px;
}

.alex-card dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.alex-card dl div {
  min-width: 0;
  padding: 12px;
  border: 1px solid #e7ecf3;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.68);
}

.alex-card dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.alex-card dd {
  margin: 6px 0 0;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.workspace {
  display: grid;
  grid-template-columns: repeat(2, minmax(390px, 1fr));
  gap: 16px;
  align-items: start;
}

.salesperson-panel {
  grid-column: 1 / -1;
}

.panel {
  position: relative;
  overflow: hidden;
}

.panel::before {
  background: #d8e2ef;
}

.quotation-panel {
  background: var(--tint-cyan);
  border-color: #a9dcdc;
}

.quotation-panel::before {
  background: #0284c7;
}

.chart-panel:nth-child(1) {
  background: #eaf3ff;
  border-color: #bfd4f3;
}

.chart-panel:nth-child(1)::before {
  background: #3f7fd0;
}

.chart-panel:nth-child(2) {
  background: #e0f5ff;
  border-color: #adddf3;
}

.chart-panel:nth-child(2)::before {
  background: #0277bd;
}

.salesperson-panel {
  background: #eaf5ff;
  border-color: #bdd7f3;
}

.salesperson-panel::before {
  background: #1d70b8;
}

.detail-panel {
  background: #edf3f8;
  border-color: #cbd8e6;
}

.detail-panel::before {
  background: #64748b;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.62);
  border-bottom: 1px solid var(--line);
}

.panel-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.segment {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.chart-panel .segment {
  display: none;
}

.segment button {
  border: 0;
  border-radius: 0;
  background: #fff;
}

.segment button.active {
  background: #e8f0ff;
  color: var(--blue);
  font-weight: 500;
}

.bars {
  display: grid;
  gap: 13px;
  padding: 16px;
}

.bar-row {
  display: grid;
  grid-template-columns: 56px 1fr minmax(280px, 360px);
  gap: 14px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid rgba(215, 222, 232, 0.78);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.bar-label {
  color: #334155;
  font-size: 16px;
  font-weight: 600;
}

.bar-track {
  display: grid;
  gap: 5px;
}

.bar {
  position: relative;
  height: 18px;
  overflow: hidden;
  border-radius: 5px;
  background: #e9eef5;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.bar .y2025 {
  background: #1d4ed8;
}

.bar .y2026 {
  background: #06b6d4;
}

.bar .target {
  background: #f59e0b;
}

.bar-value {
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.bar-value span {
  display: block;
  white-space: nowrap;
}

.bar-value .value-2025 {
  color: #1e40af;
}

.bar-value .value-2026 {
  color: #0e7490;
}

.bar-value .value-target {
  color: #b45309;
}

.bar-value .value-year-diff.positive,
.bar-value .value-target-diff.positive {
  color: #15803d;
}

.bar-value .value-year-diff.negative,
.bar-value .value-target-diff.negative {
  color: #dc2626;
}

#sourceInfo {
  display: none;
}

.table-wrap {
  width: 100%;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  max-width: 300px;
  padding: 10px 12px;
  border-bottom: 1px solid #e7ecf3;
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef4fb;
  color: #526071;
  font-size: 12px;
  font-weight: 500;
}

tbody tr:nth-child(even) {
  background: rgba(238, 246, 255, 0.68);
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: #dcecff;
}

.num {
  text-align: right;
  white-space: nowrap;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.positive {
  color: var(--green);
}

.negative {
  color: var(--red);
}

.neutral {
  color: var(--muted);
}

#salespersonRows tr:nth-child(odd) {
  background: #ffffff;
}

#salespersonRows tr:nth-child(even) {
  background: #e8f2ff;
}

#salespersonRows tr:hover {
  background: #d4e8ff;
}

#salespersonRows .accounting.positive {
  color: #15803d;
}

#salespersonRows .accounting.negative {
  color: #dc2626;
}

#salespersonRows .accounting.neutral {
  color: #64748b;
}

.detail-panel {
  margin-top: 16px;
}

.quotation-panel {
  margin-top: 16px;
}

.quotation-table-wrap table {
  min-width: 640px;
  font-size: 18px;
}

#quotationRows td:nth-child(1) {
  min-width: 180px;
  font-size: 20px;
  font-weight: 500;
  color: #0f3f86;
}

.quotation-panel .panel-head h2 {
  font-size: 24px;
}

.quotation-panel .panel-head p {
  font-size: 16px;
}

.quotation-panel th {
  font-size: 15px;
}

.quotation-panel td {
  font-size: 15px;
}

.quotation-panel .num {
  font-size: 20px;
  font-weight: 500;
  color: #0f3f86;
}

#quotationRows tr:nth-child(odd) {
  background: #ffffff;
}

#quotationRows tr:nth-child(even) {
  background: #dff2f4;
}

#quotationRows tr:hover {
  background: #ccebed;
}

.drive-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid #c9d7ea;
  border-radius: 6px;
  color: var(--blue);
  background: #f8fbff;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.drive-link:hover {
  border-color: var(--blue);
  background: #eef6ff;
}

#detailRows td:nth-child(4),
#detailRows td:nth-child(5) {
  min-width: 220px;
}

#detailRows tr:nth-child(odd) {
  background: #ffffff;
}

#detailRows tr:nth-child(even) {
  background: #e8f2ff;
}

#detailRows tr:hover {
  background: #d4e8ff;
}

.status-cell {
  font-weight: 600;
}

.status-cell.status-success {
  color: #15803d;
}

.status-cell.status-new {
  color: #dc2626;
}

.status-cell.status-partial {
  color: #b45309;
}

dialog {
  width: min(820px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.25);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.35);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

#closeDialog {
  width: 36px;
  padding: 0;
  font-size: 22px;
}

.dialog-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.field {
  min-width: 0;
}

.field span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.field strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
  font-weight: 400;
}

.field.wide {
  grid-column: 1 / -1;
}

.field.wide strong {
  line-height: 1.55;
  white-space: pre-line;
}

@media (max-width: 1080px) {
  .filters,
  .workspace {
    grid-template-columns: 1fr;
  }

  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .topbar,
  .alex-report-head,
  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar,
  main {
    padding-left: 16px;
    padding-right: 16px;
  }

  .filters,
  .summary,
  .alex-summary,
  .alex-card dl,
  .dialog-body {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 20px;
  }

  .summary strong {
    font-size: 28px;
  }

  .bar-row {
    grid-template-columns: 48px 1fr;
  }

  .bar-value {
    grid-column: 2;
    font-size: 14px;
    text-align: left;
  }
}
