* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sidebar: 220px;
  --bg: #061522;
  --sidebar-bg: #04111d;
  --header-bg: #05131f;
  --panel: #081f34;
  --panel-2: #071a2c;
  --border: #19435f;
  --border-soft: #143953;
  --text: #eef6ff;
  --muted: #829caf;
  --blue: #4398ff;
  --green: #2fdcb0;
  --purple: #9b6cff;
}

html, body { min-height: 100%; }

body {
  background: #020b12;
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: auto;
}

button, select, input { font: inherit; }

.desktop-shell {
  min-width: 1360px;
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(1140px, 1fr);
  background: linear-gradient(180deg, #061522 0%, #071a2a 100%);
}

.sidebar {
  min-height: 100vh;
  background: linear-gradient(180deg, #04111d, #051725);
  border-right: 1px solid #17374f;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 72px;
  padding: 0 4px 8px;
}

.sidebar-logo {
  display: block;
  width: 168px;
  height: 56px;
  max-width: 100%;
  object-fit: cover;
  object-position: center 53%;
  filter: invert(1) hue-rotate(180deg) saturate(1.12) brightness(1.08);
}

.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2fa8ff, #765dff 58%, #d14fff);
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 0 18px rgba(67, 152, 255, 0.25);
}

.menu {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

a.menu-item {
  text-decoration: none;
}

.menu-item {
  height: 42px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 12px;
  color: #89a3b8;
  font-size: 12px;
  cursor: pointer;
}

.menu-item:hover { background: #08243b; color: white; }

.menu-item.active {
  color: white;
  background: linear-gradient(90deg, #0b3155, #0a2947);
  border: 1px solid #174d75;
}

.menu-icon { width: 18px; text-align: center; }

.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid #15364f;
  padding-top: 15px;
}

.partner-info { display: flex; align-items: center; gap: 10px; padding: 8px; }

.partner-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6aaeff, #7b67ff);
  color: #061522;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  flex-shrink: 0;
}

.partner-name { font-size: 11px; font-weight: 700; }
.partner-email { margin-top: 2px; font-size: 9px; color: #6e899e; }

.main { min-width: 1140px; min-height: 100vh; }

.topbar {
  height: 62px;
  background: var(--header-bg);
  border-bottom: 1px solid #17384e;
  padding: 0 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-title { font-size: 13px; font-weight: 700; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--muted);
  font-size: 12px;
}

.topbar-link {
  height: auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
}

.topbar-link:hover { border-color: transparent; color: white; }

.content { padding: 24px 26px 36px; width: 100%; }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.page-title { font-size: 27px; line-height: 1; font-weight: 800; letter-spacing: -0.7px; }
.page-subtitle { margin-top: 7px; color: var(--muted); font-size: 11px; }

.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

select, input, button {
  height: 38px;
  border: 1px solid #24516d;
  border-radius: 8px;
  background: #081d31;
  color: var(--text);
  padding: 0 11px;
  font-size: 11px;
  outline: none;
}

select:hover, input:hover, button:hover { border-color: #3478a3; }
button { cursor: pointer; font-weight: 700; }
.primary-button { background: #0b2c49; }

.kpi-row {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

.kpi-card {
  min-width: 0;
  height: 116px;
  border-radius: 11px;
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
}

.kpi-card::after {
  content: "";
  position: absolute;
  width: 125px;
  height: 125px;
  right: -46px;
  bottom: -78px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.035);
}

.kpi-card.active-offers {
  border: 1px solid #2664a0;
  background: linear-gradient(135deg, #0b3154, #0a2238 70%, #071a2c);
}
.kpi-card.distributions {
  border: 1px solid #197f6e;
  background: linear-gradient(135deg, #0a4044, #092a38 70%, #071a2c);
}
.kpi-card.redirections {
  border: 1px solid #7149aa;
  background: linear-gradient(135deg, #29255a, #242041 70%, #251937);
}

.kpi-heading { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; }

.kpi-icon {
  width: 27px;
  height: 27px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.075);
}

.kpi-value { margin-top: 9px; font-size: 28px; line-height: 1; font-weight: 800; letter-spacing: -0.7px; }
.kpi-meta { margin-top: 7px; font-size: 9px; color: var(--muted); }
.kpi-meta strong { color: #dbe8f1; }

.panel {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  overflow: hidden;
}

.panel-header {
  min-height: 60px;
  padding: 12px 14px;
  border-bottom: 1px solid #173b55;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.panel-title { font-size: 13px; font-weight: 800; }
.panel-subtitle { margin-top: 3px; font-size: 9px; color: var(--muted); }

.chart-area { height: 290px; position: relative; padding: 20px 18px 10px; }

.chart-grid {
  position: absolute;
  left: 58px;
  right: 22px;
  top: 28px;
  bottom: 46px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.chart-grid div { height: 1px; background: #19415d; }

.chart-svg {
  position: absolute;
  left: 58px;
  top: 28px;
  width: calc(100% - 80px);
  height: 215px;
}

.chart-labels {
  position: absolute;
  left: 58px;
  right: 22px;
  bottom: 17px;
  display: flex;
  justify-content: space-between;
  color: #7892a8;
  font-size: 9px;
}

.legend {
  padding-bottom: 12px;
  display: flex;
  justify-content: center;
  gap: 18px;
  color: var(--muted);
  font-size: 9px;
}
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; }
.legend-green { background: var(--green); }
.legend-purple { background: var(--purple); }
.legend-gray { background: #708697; }

.table-controls { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.search { width: 190px; }
.table-wrapper { overflow-x: auto; }

table { width: 100%; min-width: 850px; border-collapse: collapse; font-size: 10px; }

thead {
  background: #071829;
  color: #7f99ad;
  font-size: 8px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

th, td { padding: 10px 12px; border-bottom: 1px solid var(--border-soft); text-align: left; }
th.number, td.number { text-align: right; }
tbody tr:hover { background: #0a2840; }

.brand-cell { display: flex; align-items: center; gap: 9px; font-weight: 700; }

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: white;
  color: #13223a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 800;
  flex-shrink: 0;
  overflow: hidden;
}

.brand-logo.is-image {
  padding: 3px;
}

.brand-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.offer-name { font-weight: 600; }

.code-pill {
  min-width: 59px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 800;
}

.generic {
  color: #7bbaff;
  background: rgba(67, 152, 255, 0.12);
  border: 1px solid rgba(67, 152, 255, 0.3);
}
.unique {
  color: #c5a2ff;
  background: rgba(155, 108, 255, 0.14);
  border: 1px solid rgba(155, 108, 255, 0.32);
}

.number-bar { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.bar-track { width: 78px; height: 5px; overflow: hidden; border-radius: 999px; background: #103650; }
.bar { height: 100%; border-radius: 999px; }
.bar.green { background: var(--green); }
.bar.purple { background: var(--purple); }

.table-footer {
  padding: 9px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #6f899d;
  font-size: 8px;
}

.pager {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pager button {
  height: 26px;
  min-width: 26px;
  padding: 0 8px;
  font-size: 9px;
}

.pager button:disabled {
  opacity: 0.4;
  cursor: default;
}

.dash-error {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 11px;
  border: 1px solid #8a3a3a;
  background: #2a1218;
  color: #ffd0d0;
  font-size: 12px;
}

.account-card { padding: 16px 14px 18px; font-size: 12px; color: var(--muted); }
.account-card strong { color: var(--text); }
.account-card p { margin-top: 8px; }

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #020b12;
  padding: 24px;
}

.login-card {
  width: 380px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  padding: 22px;
}

.login-card h1 { font-size: 22px; letter-spacing: -0.4px; }
.login-card p { margin-top: 6px; color: var(--muted); font-size: 12px; }
.login-card label { display: block; margin-top: 14px; font-size: 11px; color: var(--muted); }
.login-card input { width: 100%; margin-top: 6px; }
.login-card button { width: 100%; margin-top: 16px; }
.login-error { margin-top: 10px; color: #ffb4b4; font-size: 12px; }
.login-forgot { margin-top: 14px; text-align: center; }
.login-forgot a { color: inherit; }

[hidden] { display: none !important; }

