:root {
  --bg: #f5f4f1;
  --panel: #fff;
  --line: #d8dde3;
  --text: #2f3033;
  --muted: #777f87;
  --cyan: #44c7cf;
  --green: #62c889;
  --yellow: #f6be4f;
  --orange: #f47a53;
  --blue: #1683ee;
  --sidebar: #fbfbfa;
  --shadow: 0 8px 20px rgba(31, 35, 40, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 172px;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 2;
}

.brand {
  height: 104px;
  padding: 18px 10px;
  border-bottom: 1px solid #cfd3d8;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  color: #fff;
  background: linear-gradient(135deg, #ef6048, #38c0ce);
  display: grid;
  place-items: center;
  font-weight: 800;
}

.brand strong {
  display: block;
  font-size: 13px;
  line-height: 1;
}

.brand span {
  color: var(--muted);
  font-size: 11px;
}

nav {
  padding-top: 18px;
}

.nav-btn {
  width: 100%;
  height: 58px;
  border: 0;
  border-left: 4px solid transparent;
  background: transparent;
  color: #8a8d91;
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  text-align: left;
  text-transform: uppercase;
  font-size: 12px;
}

.nav-btn .icon {
  font-size: 22px;
  color: #b3b3b3;
}

.nav-btn.active {
  color: var(--orange);
  border-left-color: var(--orange);
  background: #fff;
}

.nav-btn.active .icon {
  color: var(--orange);
}

.copyright {
  margin: auto 8px 12px;
  color: #777;
  font-size: 10px;
}

.app {
  margin-left: 172px;
  min-width: 980px;
}

.topbar {
  min-height: 74px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 20px;
}

h1 {
  margin: 0;
  color: #6d6964;
  font-size: 22px;
  font-weight: 400;
}

.issue-filters {
  display: flex;
  gap: 10px;
}

.session-bar {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #4b5563;
}

.session-bar span {
  font-weight: 700;
}

.session-bar small {
  color: var(--muted);
}

select,
input,
textarea {
  min-height: 36px;
  border: 1px solid #cfd5dc;
  border-radius: 4px;
  background: #fff;
  color: #555;
  padding: 7px 10px;
}

select {
  min-width: 148px;
}

.view {
  padding: 14px 14px 36px;
}

.toolbar,
.panel,
.metric-panel {
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 30px;
  padding: 16px;
  margin-bottom: 20px;
}

.toolbar select {
  min-width: 225px;
}

.toolbar .spacer {
  flex: 1;
}

.add-btn,
.primary {
  border: 0;
  border-radius: 4px;
  background: var(--green);
  color: #fff;
  min-height: 36px;
  padding: 0 16px;
  font-weight: 700;
}

.danger {
  background: var(--orange);
}

.ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: #68717b;
  border-radius: 4px;
  min-height: 36px;
  padding: 0 14px;
}

.panel {
  padding: 14px 16px 20px;
  margin-bottom: 20px;
}

.panel-title {
  margin: 2px 0 14px;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
}

.table-tools {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 10px;
}

.table-tools label {
  color: #999;
  font-size: 12px;
  display: grid;
  gap: 3px;
}

.table-tools input {
  min-width: 170px;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
}

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

th,
td {
  border: 1px solid var(--line);
  padding: 10px 8px;
  text-align: center;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

th {
  font-size: 12px;
  text-transform: uppercase;
}

.sort-header {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font: inherit;
  font-weight: 800;
  text-transform: uppercase;
}

.sort-header span {
  min-width: 10px;
  color: #6a727b;
}

.sort-header.active {
  color: #333;
}

.sort-header:hover {
  color: var(--cyan);
}

tbody tr:nth-child(odd) {
  background: #f3f3f3;
}

.left {
  text-align: left;
}

.linkish {
  color: var(--cyan);
  font-weight: 700;
}

a.linkish,
.plain-link {
  text-decoration: none;
}

a.linkish:hover,
.plain-link:hover,
.link-button:hover {
  text-decoration: underline;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--cyan);
  font-weight: 700;
  padding: 0;
  cursor: pointer;
}

.plain-link {
  color: inherit;
}

.small {
  color: var(--muted);
  font-size: 12px;
}

.pager {
  display: flex;
  justify-content: center;
  gap: 0;
  margin: 12px 0;
}

.pager button {
  border: 1px solid var(--line);
  background: #fff;
  min-height: 36px;
  padding: 0 13px;
  color: #68717b;
}

.pager button.active {
  background: var(--blue);
  color: #fff;
}

.dashboard-tabs {
  display: grid;
  grid-template-columns: 1fr 1.55fr 1fr 1fr 1.55fr;
  gap: 30px;
  margin-bottom: 20px;
}

.tab-card {
  min-height: 65px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  box-shadow: var(--shadow);
}

.tab-card.white {
  background: #fff;
  color: #2f3033;
}

.tab-card.cyan {
  background: #51bcd2;
}

.tab-card.green {
  background: var(--green);
}

.tab-card.yellow {
  background: var(--yellow);
}

.tab-card.orange {
  background: var(--orange);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
  text-align: center;
}

.metric h2 {
  margin: 34px 0 20px;
  font-weight: 400;
}

.metric strong {
  font-size: 34px;
  font-weight: 400;
}

.dashboard-lower {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 30px;
}

.pie-wrap {
  display: grid;
  place-items: center;
  min-height: 245px;
}

.pie {
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background: conic-gradient(#9cf184 0 16%, #d4e9fa 16% 100%);
  border: 2px solid #fff;
}

.legend {
  display: flex;
  justify-content: center;
  gap: 14px;
  color: #666;
  font-size: 12px;
}

.swatch {
  display: inline-block;
  width: 40px;
  height: 12px;
  margin-right: 5px;
  vertical-align: -1px;
}

.toggle-pair,
.placement {
  display: inline-flex;
  border: 1px solid #8d8d8d;
  border-radius: 3px;
  overflow: hidden;
}

.toggle-pair button,
.placement button {
  min-width: 28px;
  height: 34px;
  border: 0;
  border-right: 1px solid #777;
  background: #a6a6a6;
  color: #fff;
  font-weight: 700;
}

.placement button {
  min-width: 31px;
  color: #222;
  font-size: 10px;
}

.toggle-pair button:last-child,
.placement button:last-child {
  border-right: 0;
}

.toggle-pair button.on,
.placement button.on {
  background: #fff;
  color: var(--green);
}

.placement button.on {
  background: #6fcf97;
  color: #fff;
}

.prospect-toggle button {
  background: #9a9a9a;
  color: #fff;
}

.prospect-toggle button:disabled {
  opacity: 1;
}

.prospect-toggle .sold-on {
  background: #5fc986;
  color: #fff;
}

.prospect-toggle .declined-on {
  background: #f47b52;
  color: #fff;
}

.inline-select {
  width: 100%;
  min-width: 0;
}

.sales-panel {
  padding-left: 10px;
  padding-right: 10px;
}

.customers-table {
  table-layout: fixed;
  min-width: 1180px;
}

.customers-table th:nth-child(1),
.customers-table td:nth-child(1) {
  width: 230px;
}

.customers-table th:nth-child(2),
.customers-table td:nth-child(2) {
  width: 185px;
}

.customers-table th:nth-child(3),
.customers-table td:nth-child(3) {
  width: 160px;
}

.customers-table th:nth-child(4),
.customers-table td:nth-child(4) {
  width: 320px;
}

.customers-table th:nth-child(5),
.customers-table td:nth-child(5) {
  width: 150px;
}

.customers-table th:nth-child(6),
.customers-table td:nth-child(6) {
  width: 120px;
}

.customers-table th:nth-child(7),
.customers-table td:nth-child(7) {
  width: 56px;
}

.customers-table td {
  padding: 9px 8px;
  line-height: 1.18;
}

.customers-table .inline-select {
  max-width: 100%;
  min-width: 86px;
}

.customers-table td:nth-child(4) {
  overflow-wrap: anywhere;
}

.sales-table {
  min-width: 1680px;
}

.sales-table th:nth-child(1),
.sales-table td:nth-child(1) {
  width: 86px;
}

.sales-table th:nth-child(2),
.sales-table td:nth-child(2) {
  width: 95px;
}

.sales-table th:nth-child(3),
.sales-table td:nth-child(3) {
  width: 210px;
}

.sales-table th:nth-child(4),
.sales-table td:nth-child(4) {
  width: 90px;
}

.sales-table th:nth-child(5),
.sales-table td:nth-child(5) {
  width: 78px;
}

.sales-table th:nth-child(6),
.sales-table td:nth-child(6),
.sales-table th:nth-child(10),
.sales-table td:nth-child(10) {
  width: 86px;
}

.sales-table th:nth-child(7),
.sales-table td:nth-child(7),
.sales-table th:nth-child(8),
.sales-table td:nth-child(8),
.sales-table th:nth-child(9),
.sales-table td:nth-child(9) {
  width: 88px;
}

.sales-table th:nth-child(11),
.sales-table td:nth-child(11) {
  width: 210px;
}

.sales-table th:nth-child(12),
.sales-table td:nth-child(12) {
  width: 130px;
}

.sales-table th:nth-child(13),
.sales-table td:nth-child(13) {
  width: 150px;
}

.sales-table th:nth-child(14),
.sales-table td:nth-child(14) {
  width: 145px;
}

.sales-table th:nth-child(15),
.sales-table td:nth-child(15) {
  width: 58px;
}

.sales-table td {
  padding: 9px 8px;
}

.sales-table .inline-select {
  min-width: 100%;
}

.sales-table td:nth-child(3) {
  line-height: 1.18;
}

.prospects-panel {
  padding-left: 16px;
  padding-right: 16px;
}

.prospects-table {
  table-layout: fixed;
  min-width: 1180px;
}

.prospects-table th:first-child,
.prospects-table td:first-child {
  width: 430px;
}

.prospects-table th:nth-child(2),
.prospects-table td:nth-child(2) {
  width: 110px;
}

.prospects-table th:nth-child(n + 3),
.prospects-table td:nth-child(n + 3) {
  width: 128px;
}

.prospect-customer {
  text-align: center;
  line-height: 1.2;
  padding-left: 18px;
  padding-right: 18px;
}

.prospect-customer .linkish {
  overflow-wrap: anywhere;
}

.prospects-table .inline-select {
  max-width: 80px;
}

.prospects-table .toggle-pair {
  vertical-align: middle;
}

.mini-input {
  width: 48px;
  min-width: 0;
}

.actions button {
  border: 0;
  background: transparent;
  color: var(--cyan);
  font-size: 18px;
  padding: 3px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal[hidden] {
  display: none;
}

.login-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
  padding: 24px;
  display: grid;
  gap: 14px;
}

.login-brand {
  height: auto;
  border: 0;
  padding: 0;
}

.login-card h2 {
  margin: 6px 0 0;
  font-size: 26px;
}

.login-card label {
  display: grid;
  gap: 6px;
  color: #66707a;
  font-size: 12px;
  text-transform: uppercase;
}

.login-card select {
  width: 100%;
}

.login-error {
  min-height: 18px;
  margin: 0;
  color: #c2410c;
  font-weight: 700;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  max-width: 340px;
  border-radius: 6px;
  padding: 12px 14px;
  color: #fff;
  background: #276749;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
  font-weight: 700;
}

.toast.warn {
  background: #a16207;
}

.toast.error {
  background: #b42318;
}

.dialog {
  width: min(860px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
}

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

.dialog footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  justify-content: flex-end;
  gap: 10px;
}

.dialog h2 {
  margin: 0;
  font-size: 20px;
}

.form-grid {
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.form-grid label {
  display: grid;
  gap: 6px;
  color: #66707a;
  font-size: 12px;
  text-transform: uppercase;
}

.form-grid label.wide {
  grid-column: span 3;
}

textarea {
  min-height: 78px;
  resize: vertical;
}

@media (max-width: 1100px) {
  .app {
    min-width: 760px;
  }

  .dashboard-tabs,
  .metrics,
  .dashboard-lower {
    grid-template-columns: 1fr;
  }

  .sidebar {
    width: 145px;
  }

  .app {
    margin-left: 145px;
  }
}
