* {
  box-sizing: border-box;
}

:root {
  --bg: #07080d;
  --panel: rgba(24, 24, 27, 0.92);
  --panel2: rgba(17, 18, 24, 0.96);
  --line: rgba(255, 255, 255, 0.10);
  --line-red: rgba(255, 53, 61, 0.38);
  --text: #f5f5f6;
  --muted: #a0a3ad;
  --red: #ff3038;
  --red2: #b51d25;
  --red3: #711117;
  --green: #43d18d;
  --yellow: #f4b64b;
  --cyan: #6df3ff;
  --shadow: 0 20px 70px rgba(0, 0, 0, .55);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 6% 90%, rgba(255, 48, 56, .22), transparent 23%),
    radial-gradient(circle at 80% 0%, rgba(255, 48, 56, .10), transparent 25%),
    linear-gradient(135deg, #05060a, #11121a 55%, #06070a);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 230px;
  padding: 18px 12px;
  background: linear-gradient(180deg, rgba(19, 20, 26, .96), rgba(8, 8, 10, .98));
  border-right: 1px solid var(--line);
}

.brand-box {
  height: 150px;
  border: 1px solid var(--line);
  border-radius: 16px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, .025);
}

.brand-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 42px;
  font-weight: 900;
  color: #fff;
  background: radial-gradient(circle at 30% 30%, #ff5e63, #8d1118 65%, #1d080a);
  box-shadow: 0 0 35px rgba(255, 48, 56, .35);
}

.brand-name {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: 2px;
}

.brand-sub {
  color: var(--muted);
  font-size: 13px;
}

.menu {
  margin-top: 24px;
  display: grid;
  gap: 10px;
}

.menu-item {
  padding: 15px 16px;
  border-radius: 12px;
  color: #d8d8dc;
  border: 1px solid transparent;
}

.menu-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(255, 48, 56, .32), rgba(255, 48, 56, .06));
  border-color: rgba(255, 48, 56, .24);
}

.side-footer {
  position: absolute;
  bottom: 18px;
  left: 12px;
  right: 12px;
  color: var(--muted);
  font-size: 12px;
}

.side-footer strong {
  display: block;
  margin-top: 8px;
  color: #fff;
}

.main {
  margin-left: 230px;
  padding: 20px 22px 28px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

h1, h2, p {
  margin: 0;
}

h1 {
  font-size: 24px;
  letter-spacing: 1px;
}

h1 span {
  color: var(--red);
}

.header p,
.panel-title p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.status {
  color: #bdf7d7;
  border: 1px solid rgba(67, 209, 141, .25);
  background: rgba(67, 209, 141, .10);
  padding: 9px 13px;
  border-radius: 999px;
  font-size: 13px;
}

.filters {
  display: grid;
  grid-template-columns: 1fr 1fr 170px 170px 160px 100px;
  gap: 12px;
  align-items: end;
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .025));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.field {
  display: grid;
  gap: 7px;
}

label {
  color: #ced0d8;
  font-size: 12px;
}

input, select {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 8, 13, .75);
  color: #fff;
  padding: 0 10px;
  outline: none;
}

select option {
  color: #111;
}

button {
  height: 38px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  background: linear-gradient(180deg, #ff444b, #a71921);
  box-shadow: 0 12px 26px rgba(255, 48, 56, .22);
}

.btn-secondary {
  background: rgba(255,255,255,.09);
  box-shadow: none;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.kpi {
  min-height: 112px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 17px;
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.075), transparent),
    var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.kpi-icon {
  min-width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 25px;
  color: var(--red);
  background: radial-gradient(circle, rgba(255,48,56,.18), rgba(255,48,56,.04));
  border: 1px solid rgba(255,48,56,.34);
}

.kpi span {
  display: block;
  color: #fff;
  text-transform: uppercase;
  font-size: 12px;
  margin-bottom: 8px;
}

.kpi strong {
  display: block;
  font-size: 31px;
  line-height: 1;
  letter-spacing: 1px;
}

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

.kpi.churn {
  border-color: rgba(255,48,56,.42);
}

.gauge {
  min-width: 74px;
  height: 74px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, #191a20 54%, transparent 55%),
    conic-gradient(var(--red) var(--gauge, 0deg), rgba(255,255,255,.12) 0deg);
}

.gauge-value {
  font-weight: 900;
  font-size: 18px;
}

.grid {
  display: grid;
  grid-template-columns: .9fr 1.5fr;
  gap: 12px;
  margin-top: 14px;
}

.panel {
  border-radius: 14px;
  padding: 14px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.015)),
    var(--panel2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.panel-title {
  margin: 2px 4px 12px;
}

.panel-title h2 {
  font-size: 15px;
  letter-spacing: .4px;
}

.table-box {
  max-height: 310px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.025);
}

.panel-consultor .table-box,
.panel-regional .table-box,
.panel-situacao .table-box {
  max-height: 340px;
}

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

thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: var(--red);
  background: #16171d;
  border-bottom: 1px solid var(--line-red);
  padding: 10px 9px;
  text-align: right;
  white-space: nowrap;
}

thead th:first-child,
td:first-child {
  text-align: left;
}

td {
  padding: 8px 9px;
  border-bottom: 1px solid rgba(255,255,255,.075);
  text-align: right;
  white-space: nowrap;
}

tbody tr:hover td {
  background: rgba(255,48,56,.09);
}

tfoot td {
  position: sticky;
  bottom: 0;
  background: #14151b;
  color: var(--red);
  font-weight: 900;
  border-top: 1px solid var(--line-red);
  padding: 10px 9px;
  text-align: right;
}

tfoot td:first-child {
  text-align: left;
}

.panel-regional,
.panel-situacao {
  min-height: 390px;
}

footer {
  text-align: center;
  color: var(--muted);
  margin-top: 14px;
  font-size: 13px;
}

footer span {
  color: var(--red);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255,255,255,.04);
}

::-webkit-scrollbar-thumb {
  background: rgba(255,48,56,.55);
  border-radius: 999px;
}

@media (max-width: 1300px) {
  .sidebar {
    display: none;
  }

  .main {
    margin-left: 0;
  }

  .filters,
  .kpis,
  .grid {
    grid-template-columns: 1fr 1fr;
  }
}

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