:root {
  --bg: #eef4fb;
  --surface: #ffffff;
  --ink: #14213d;
  --muted: #62708a;
  --line: #d9e3f1;
  --primary: #1f6ed4;
  --primary-strong: #0e4fa8;
  --navy: #071d49;
  --navy-2: #0b367a;
  --accent: #159c8a;
  --danger: #b42318;
  --shadow: 0 22px 56px rgba(18, 38, 71, .16);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(223, 233, 247, .9), rgba(247, 250, 254, .95)),
    #eef4fb;
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button {
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  min-height: 46px;
  padding: 0 16px;
  font-weight: 750;
  cursor: pointer;
}

button:active {
  transform: translateY(1px);
}

.shell {
  width: min(100%, 1280px);
  margin: 0 auto;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.login-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(340px, .92fr) minmax(380px, 1.08fr);
  align-items: stretch;
  padding: clamp(18px, 3vw, 34px);
}

.login-brand-panel,
.login-form-panel {
  min-height: calc(100vh - clamp(36px, 6vw, 68px));
}

.login-brand-panel {
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: center;
  gap: 34px;
  padding: clamp(34px, 5vw, 78px);
  border-radius: 18px 0 0 18px;
  background:
    radial-gradient(circle at 14% 12%, rgba(60, 139, 255, .34), transparent 28%),
    linear-gradient(148deg, #1f69d7 0%, #0c347b 42%, #041940 100%);
  color: #fff;
  box-shadow: var(--shadow);
}

.login-brand-panel::after {
  content: "";
  position: absolute;
  right: -76px;
  top: -10%;
  width: 148px;
  height: 120%;
  border-left: 10px solid rgba(255, 255, 255, .9);
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
}

.brand-rings,
.brand-dots {
  position: absolute;
  pointer-events: none;
}

.brand-rings {
  right: 12%;
  top: -70px;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 50%;
}

.brand-rings::before,
.brand-rings::after {
  content: "";
  position: absolute;
  inset: 24px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: inherit;
}

.brand-rings::after {
  inset: 50px;
}

.brand-dots {
  right: 42px;
  bottom: 60px;
  width: 118px;
  height: 118px;
  opacity: .28;
  background-image: radial-gradient(rgba(255, 255, 255, .8) 1px, transparent 1px);
  background-size: 14px 14px;
}

.brand-lockup {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
}

.mark {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(145deg, #49a0ff, #175ac6);
  color: #fff;
  font-size: 54px;
  line-height: 1;
  font-weight: 850;
  box-shadow: 0 18px 34px rgba(3, 15, 45, .24);
}

.brand-lockup h1 {
  font-size: clamp(34px, 4vw, 46px);
  line-height: 1;
  letter-spacing: 0;
}

.brand-lockup p {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #b9d8ff;
  font-size: 22px;
}

.brand-lockup p::before,
.brand-lockup p::after {
  content: "";
  width: 50px;
  height: 1px;
  background: rgba(130, 184, 255, .44);
}

.brand-copy {
  position: relative;
  z-index: 1;
  width: min(100%, 350px);
  margin: 0 auto;
  color: rgba(255, 255, 255, .92);
  text-align: center;
  font-size: 20px;
  line-height: 1.45;
}

.benefits {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 26px;
  width: min(100%, 390px);
  margin: 6px auto 0;
}

.benefit {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}

.benefit-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(163, 203, 255, .34);
  border-radius: 8px;
  background: rgba(255, 255, 255, .10);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}

.benefit svg,
.form-badge svg,
.company-icon svg,
.input-wrap svg,
.login-submit svg,
.ghost-icon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.benefit strong,
.benefit span {
  display: block;
}

.benefit strong {
  margin-bottom: 5px;
  font-size: 18px;
}

.benefit span {
  color: rgba(255, 255, 255, .82);
  font-size: 15px;
}

.login-form-panel {
  display: grid;
  place-items: center;
  padding: clamp(28px, 5vw, 70px);
  border-radius: 0 18px 18px 0;
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow);
}

.login-form-wrap {
  width: min(100%, 470px);
}

.form-badge {
  width: 100px;
  height: 100px;
  display: grid;
  place-items: center;
  margin: 0 auto 26px;
  border: 1px solid #e2ebf7;
  border-radius: 50%;
  color: var(--primary);
  background: linear-gradient(145deg, #f3f8ff, #e5effb);
  box-shadow: 0 16px 30px rgba(22, 77, 143, .14);
}

.form-badge svg {
  width: 48px;
  height: 48px;
}

.login-heading {
  margin-bottom: 24px;
  text-align: center;
}

.login-heading h2 {
  font-size: clamp(30px, 3vw, 38px);
  line-height: 1.05;
}

.login-heading p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 18px;
}

.company-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 104px;
  margin-bottom: 24px;
  padding: 17px;
  border: 1px solid #e0e9f6;
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  background: linear-gradient(135deg, #edf5ff, #f8fbff);
}

.company-card.is-empty {
  border-left-color: #96a8c2;
}

.company-card.is-disabled {
  border-left-color: var(--danger);
  background: linear-gradient(135deg, #fff3f1, #fffafa);
}

.company-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--primary);
  background: #dbeaff;
}

.company-card strong,
.company-card span,
.company-card small {
  display: block;
  min-width: 0;
}

.company-card strong {
  overflow-wrap: anywhere;
  font-size: 18px;
  line-height: 1.2;
}

.company-card span,
.company-card small {
  margin-top: 6px;
  color: #3d4a61;
  font-size: 14px;
}

.login-form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: #3d4a61;
  font-size: 14px;
  font-weight: 700;
}

.input-wrap {
  position: relative;
  display: grid;
  align-items: center;
}

.input-wrap > svg {
  position: absolute;
  left: 16px;
  color: #52617b;
}

input,
select {
  width: 100%;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.input-wrap input {
  padding-left: 52px;
}

.input-wrap input:focus,
select:focus {
  border-color: #72a8ef;
  box-shadow: 0 0 0 3px rgba(31, 110, 212, .12);
}

.ghost-icon {
  position: absolute;
  right: 8px;
  width: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 8px;
  background: transparent;
  color: #52617b;
}

.ghost-icon:hover {
  background: #eef4fb;
}

.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.remember {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
  color: #3d4a61;
  font-size: 15px;
}

.remember input {
  width: 20px;
  min-height: 20px;
  accent-color: var(--primary);
}

.login-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 58px;
  margin-top: 2px;
  background: linear-gradient(135deg, #2676dc, #1656bd);
  box-shadow: 0 14px 26px rgba(24, 92, 190, .24);
  font-size: 17px;
}

.login-submit:disabled {
  cursor: wait;
  opacity: .72;
  box-shadow: none;
}

.login-submit:focus-visible,
.ghost-icon:focus-visible,
.remember input:focus-visible {
  outline: 3px solid #f6b349;
  outline-offset: 3px;
}

.message {
  min-height: 20px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 650;
}

.message.ok {
  color: #0f766e;
}

.login-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 24px;
  color: #52617b;
  font-size: 14px;
}

.login-footer i {
  width: 1px;
  height: 18px;
  background: #cfd8e6;
}

.app-view {
  min-height: 100vh;
  padding: 24px 18px 92px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding: 14px 16px;
  border: 1px solid rgba(217, 227, 241, .88);
  border-radius: 8px;
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 16px 38px rgba(18, 38, 71, .10);
}

.topbar-title {
  min-width: 0;
}

.topbar-title h2 {
  color: #0b1736;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
}

.session-context-badge {
  margin-left: auto;
  display: grid;
  gap: 2px;
  max-width: 380px;
  padding: 8px 14px;
  border: 1px solid #d5e1f1;
  border-radius: 10px;
  background: #f4f8fe;
  color: #0d3264;
  text-align: left;
}

.session-context-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #1f6fd1 !important;
  font-size: 11px !important;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.session-context-label i {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #17a862;
  box-shadow: 0 0 0 3px rgba(23, 168, 98, .13);
}

.session-context-badge strong,
.session-context-badge span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-context-badge span { font-size: 12px; color: #506784; }

.topbar-date {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 26px;
  margin-bottom: 6px;
  color: #52617b;
  font-size: 13px;
  font-weight: 800;
  text-transform: capitalize;
}

.topbar-date svg,
.logout-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.logout-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 104px;
  min-height: 42px;
  border: 1px solid #d6e1ef;
  border-radius: 8px;
  background: #fff;
  color: #0e4fa8;
  box-shadow: 0 10px 22px rgba(18, 38, 71, .08);
}

h3 {
  font-size: 16px;
  margin-bottom: 14px;
}

.brand p,
.eyebrow {
  color: var(--muted);
}

.icon-button {
  min-height: 38px;
  background: #eaf2f9;
  color: var(--primary-strong);
}

.section {
  display: none;
}

.section.active {
  display: grid;
  gap: 14px;
}

#configSection,
.nav-item[data-target="configSection"] {
  display: none !important;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.card,
.panel,
.filters {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.card {
  min-height: 132px;
  padding: 22px;
}

.metric-card {
  position: relative;
  container-type: inline-size;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  overflow: hidden;
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 18px 0 0 18px;
  background: var(--primary);
}

.metric-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  color: #2563eb;
  background: linear-gradient(135deg, #e7f0ff, #f5f9ff);
}

.metric-icon svg {
  width: 42px;
  height: 42px;
  fill: currentColor;
}

.metric-body {
  min-width: 0;
}

.card span,
.metric-label {
  display: block;
  color: #3f4c63;
  font-size: 13px;
  font-weight: 700;
}

.card strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(24px, 4.4vw, 31px);
  line-height: 1.1;
  color: #0b1736;
}

#dashboardSection .metric-card strong {
  font-size: clamp(20px, 6cqi, 31px);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}

#dashboardSection .metric-trend { flex-wrap: wrap; }

.metric-trend {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metric-trend i {
  font-style: normal;
}

.metric-trend em {
  color: #7b8799;
  font-style: normal;
  font-weight: 700;
}

.metric-trend.positive {
  color: #20a65a;
}

.metric-trend.negative {
  color: #e04747;
}

.metric-trend.neutral {
  color: #68758a;
}

.tone-green::before {
  background: #18a957;
}

.tone-green .metric-icon {
  color: #18a957;
}

.tone-green .metric-icon {
  background: linear-gradient(135deg, #dcf9e8, #f4fff8);
}

.tone-purple::before {
  background: #8b4be8;
}

.tone-purple .metric-icon {
  color: #8b4be8;
}

.tone-purple .metric-icon {
  background: linear-gradient(135deg, #f0e7ff, #fbf8ff);
}

.tone-orange::before {
  background: #f59e0b;
}

.tone-orange .metric-icon {
  color: #f59e0b;
}

.tone-orange .metric-icon {
  background: linear-gradient(135deg, #fff0d6, #fffaf0);
}

.tone-teal::before {
  background: #16a9b7;
}

.tone-teal .metric-icon {
  color: #16a9b7;
}

.tone-teal .metric-icon {
  background: linear-gradient(135deg, #defaff, #f5feff);
}

.panel {
  padding: 18px;
  overflow: hidden;
}

.dashboard-period-filter {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.dashboard-period-filter label { flex: 0 0 auto; font-weight: 750; }
.dashboard-period-filter select {
  width: min(100%, 320px);
  min-height: 44px;
  min-width: 190px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: #1a2a44;
  padding: 0 13px;
  font-weight: 750;
}

@media (max-width: 600px) {
  .dashboard-period-filter { align-items: stretch; flex-direction: column; }
  .dashboard-period-filter select { width: 100%; }
}

.dashboard-chart-panel {
  padding: 20px;
}

.chart-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.chart-heading h3 {
  margin-bottom: 4px;
}

.chart-heading p {
  color: var(--muted);
  font-size: 13px;
}

.chart-heading select {
  min-height: 44px;
  min-width: 178px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: #1a2a44;
  padding: 0 13px;
  font-weight: 750;
}

.chart-wrap {
  width: 100%;
  min-height: 420px;
  overflow: hidden;
}

.chart-wrap canvas {
  display: block;
  width: 100%;
  height: 420px;
  min-width: 0;
}

.dashboard-message {
  padding: 14px 16px;
  border: 1px solid #cfe0f6;
  border-radius: 16px;
  background: #f4f8ff;
  color: #34527f;
  font-weight: 700;
}

.seller-sales-panel {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.seller-sales-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.seller-sales-heading h3 {
  margin-bottom: 4px;
}

.seller-sales-heading p {
  color: var(--muted);
  font-size: 13px;
}

.seller-sales-list {
  display: grid;
  gap: 12px;
}

.seller-row {
  display: grid;
  grid-template-columns: 34px 48px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e6eef8;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
}

.seller-rank {
  color: #8a98ad;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.seller-avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: linear-gradient(135deg, #e7f0ff, #f7fbff);
  color: #2563eb;
  font-size: 15px;
  font-weight: 900;
}

.seller-info {
  min-width: 0;
}

.seller-line,
.seller-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.seller-line strong {
  min-width: 0;
  overflow: hidden;
  color: #0b1736;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seller-line span {
  color: #2563eb;
  font-size: 14px;
  font-weight: 900;
}

.seller-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.seller-meta b {
  color: #0b1736;
  font-size: 14px;
}

.seller-bar {
  height: 8px;
  margin-top: 10px;
  border-radius: 999px;
  background: #edf3fb;
  overflow: hidden;
}

.seller-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #4da3ff);
}

.seller-empty {
  display: grid;
  place-items: center;
  min-height: 120px;
  border: 1px dashed #cfdced;
  border-radius: 16px;
  color: var(--muted);
  font-weight: 750;
  text-align: center;
}

.dashboard-skeleton {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.dashboard-skeleton span {
  min-height: 132px;
  border-radius: 18px;
  background: linear-gradient(90deg, #edf3fb, #ffffff, #edf3fb);
  background-size: 240% 100%;
  box-shadow: var(--shadow);
  animation: shimmer 1.2s ease-in-out infinite;
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

canvas {
  width: 100%;
  max-width: 100%;
}

.rank-list {
  display: grid;
  gap: 10px;
}

.rank-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  font-size: 14px;
}

.rank-row .bar {
  grid-column: 1 / -1;
  height: 7px;
  border-radius: 999px;
  background: #e6edf5;
  overflow: hidden;
}

.rank-row .bar i {
  display: block;
  height: 100%;
  background: var(--accent);
}

.filters {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.reports-section {
  gap: 18px;
}

.report-filter-card {
  gap: 22px;
  padding: clamp(18px, 2.3vw, 28px);
  border-radius: 8px;
  border-color: #dce6f4;
  box-shadow: 0 24px 54px rgba(18, 38, 71, .12);
}

.filter-heading,
.results-heading,
.modal-header,
.report-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.report-card-heading {
  align-items: flex-start;
}

.report-heading-left {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-width: 0;
}

.report-heading-left > div {
  min-width: 0;
}

.report-heading-icon,
.current-company-icon {
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #1f6ed4;
  background: #eaf2ff;
}

.report-heading-icon {
  width: 52px;
  height: 52px;
}

.report-heading-icon svg,
.current-company-icon svg,
.report-info-box svg,
.action-button svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.report-heading-icon svg {
  width: 28px;
  height: 28px;
}

.filter-heading h3,
.results-heading h3,
.modal-header h3 {
  margin-bottom: 0;
}

.report-card-heading h3 {
  color: #0b1736;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.filter-subtitle {
  margin-top: 6px;
  color: #64748b;
  font-size: 14px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.secure-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #e8f6f2;
  color: #087469;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.current-company-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: min(100%, 340px);
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid #dbe7f4;
  border-radius: 8px;
  background: #f8fbff;
}

.current-company-icon {
  width: 42px;
  height: 42px;
  color: #0f766e;
  background: #e6f6f2;
}

.current-company-icon svg {
  width: 23px;
  height: 23px;
}

.current-company-card span,
.current-company-card small {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.current-company-card strong {
  display: block;
  min-width: 0;
  margin-top: 2px;
  overflow: hidden;
  color: #0b1736;
  font-size: 14px;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.current-company-card small {
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-filter-box {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid #dfe8f5;
  border-radius: 8px;
  background: #f8fbff;
}

.report-filter-grid {
  display: grid;
  grid-template-columns: minmax(300px, 1.6fr) repeat(2, minmax(160px, .75fr));
  gap: 14px;
}

.report-filter-card label {
  display: grid;
  gap: 8px;
  min-width: 0;
  color: #1f2f49;
  font-size: 14px;
  font-weight: 800;
}

.client-filter-field {
  grid-column: 1 / -1;
}

.statement-email-field {
  grid-column: 1 / -1;
}

.field-icon {
  position: relative;
  display: grid;
  align-items: center;
  min-width: 0;
}

.field-icon > svg {
  position: absolute;
  left: 15px;
  z-index: 1;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #52617b;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.field-icon input,
.field-icon select {
  padding-left: 48px;
  width: 100%;
  min-width: 0;
  min-height: 52px;
  border: 1px solid #d8e3f2;
  border-radius: 8px;
  background: #fff;
  color: #071d49;
  font-weight: 750;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.field-icon input:focus,
.field-icon select:focus {
  border-color: #7ea8e7;
  box-shadow: 0 0 0 4px rgba(31, 110, 212, .12);
}

.client-picker {
  grid-template-columns: minmax(0, 1fr) 42px 48px;
}

.client-picker input {
  grid-column: 1 / -1;
  padding-right: 94px;
  cursor: default;
}

.mini-action,
.search-action {
  position: absolute;
  z-index: 2;
  min-height: 38px;
  width: 38px;
  padding: 0;
  border-radius: 8px;
  background: transparent;
  color: #52617b;
}

.mini-action {
  right: 52px;
  font-size: 0;
  line-height: 1;
}

.mini-action::before {
  content: "\00d7";
  font-size: 22px;
  line-height: 1;
}

.search-action {
  right: 8px;
  display: grid;
  place-items: center;
  background: #eaf2f9;
  color: var(--primary-strong);
}

.search-action svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.report-info-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #cfe4fb;
  border-radius: 8px;
  background: #eef7ff;
  color: #34527f;
  font-size: 13px;
  font-weight: 750;
}

.report-info-box svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
}

.report-actions {
  display: grid;
  grid-template-columns: repeat(6, minmax(112px, 1fr));
  gap: 10px;
  align-items: stretch;
}

.report-actions button,
.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 46px;
  padding: 0 12px;
  border-radius: 8px;
  white-space: nowrap;
}

.action-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.action-button span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.secondary-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--primary-strong);
}

.mail-button {
  background: #e8f6f2;
  color: #087469;
}

.send-pdf-button {
  border-color: #b9e4d9;
  background: #e7f7f3;
  color: #067a67;
}

.pdf-button {
  border-color: #f4c7c3;
  background: #fff7f6;
  color: #b42318;
}

.excel-button {
  color: #16794c;
}

.print-button,
.clear-button {
  color: #334155;
}

.statement-button {
  min-width: 124px;
}

.primary-button {
  min-width: 148px;
  background: linear-gradient(135deg, #2676dc, #1656bd);
  box-shadow: 0 14px 26px rgba(31, 110, 212, .22);
}

.primary-button.is-loading {
  opacity: .78;
  cursor: progress;
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.summary-card {
  min-height: 88px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(18, 38, 71, .08);
}

.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.summary-card strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.report-results-panel {
  padding: 0;
}

.results-heading {
  padding: 15px 15px 0;
}

.filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.report-table-wrap {
  margin: 15px;
  max-height: min(64vh, 620px);
  background: #fff;
}

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

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef4fb;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

tbody tr:nth-child(even) {
  background: #f9fbfe;
}

tbody tr:hover {
  background: #edf5ff;
}

.numeric-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.mobile-result-cards {
  display: none;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 12px;
  min-height: 240px;
  padding: 28px 18px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
  font-size: 16px;
}

.empty-illustration {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #edf5ff;
  color: var(--primary);
  font-size: 30px;
  font-weight: 800;
}

.empty-illustration svg {
  width: 54px;
  height: 54px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.modal-open {
  overflow: hidden;
}

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

.client-modal {
  width: min(940px, 100%);
  max-height: min(82vh, 720px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
  border: 1px solid #d8e3f2;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(8, 25, 56, .28);
}

.email-modal {
  width: min(760px, 100%);
  max-height: min(86vh, 720px);
  overflow: auto;
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid #d8e3f2;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(8, 25, 56, .28);
}

.email-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

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

textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  color: var(--ink);
  background: #fff;
  outline: none;
  font: inherit;
}

textarea:focus {
  border-color: #72a8ef;
  box-shadow: 0 0 0 3px rgba(31, 110, 212, .12);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.modal-actions svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.modal-search {
  margin-bottom: 0;
}

.client-list {
  min-height: 220px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 8px;
}

.client-option {
  min-height: 74px;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 126px;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}

.client-option:hover {
  border-color: #9bc0ef;
  background: #f4f8ff;
}

.client-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 8px;
  background: #eef4fb;
  color: var(--primary-strong);
  font-size: 13px;
  font-weight: 800;
}

.client-main {
  min-width: 0;
}

.client-main strong,
.client-main small {
  display: block;
  overflow-wrap: anywhere;
}

.client-main small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.client-balance {
  color: var(--ink);
  font-weight: 850;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.client-empty {
  display: grid;
  place-items: center;
  min-height: 180px;
  color: var(--muted);
  font-weight: 700;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  width: min(calc(100% - 24px), 520px);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow);
}

.nav-item {
  min-height: 42px;
  background: transparent;
  color: var(--muted);
}

.nav-item.active {
  background: var(--primary);
  color: #fff;
}

.config-section {
  gap: 16px;
}

.mobile-db-card {
  display: grid;
  gap: 22px;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}

.mobile-db-header {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}

.mobile-db-icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  color: #2563eb;
  background: linear-gradient(135deg, #e7f0ff, #f7fbff);
}

.mobile-db-icon svg {
  width: 42px;
  height: 42px;
  fill: currentColor;
}

.mobile-db-header h3 {
  margin: 2px 0 6px;
  font-size: 25px;
}

.mobile-db-header span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.mobile-db-status {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff7dd;
  color: #986a00;
  font-size: 13px;
  white-space: nowrap;
}

.mobile-db-status.connected {
  background: #e5f8ed;
  color: #087c3b;
}

.mobile-db-status.disconnected {
  background: #fff1f0;
  color: #b42318;
}

.mobile-db-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.password-field {
  position: relative;
  display: grid;
  align-items: center;
}

.password-field input {
  padding-right: 58px;
}

.password-field .mini-action {
  right: 8px;
  width: 44px;
  min-height: 36px;
  border-radius: 10px;
  background: #eaf2f9;
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 850;
}

.mobile-db-message {
  grid-column: 1 / -1;
}

.mobile-db-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.mobile-db-actions button {
  min-width: 160px;
}

@media (max-width: 900px) {
  .login-view {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .login-brand-panel,
  .login-form-panel {
    min-height: auto;
    border-radius: 0;
    box-shadow: none;
  }

  .login-brand-panel {
    padding: 28px 20px 34px;
  }

  .login-brand-panel::after,
  .brand-copy,
  .benefits {
    display: none;
  }

  .mark {
    width: 72px;
    height: 72px;
    font-size: 42px;
  }

  .brand-lockup h1 {
    font-size: 32px;
  }

  .brand-lockup p {
    font-size: 18px;
  }

  .login-form-panel {
    padding: 26px 18px 32px;
  }

  .form-badge {
    display: none;
  }
}

@media (min-width: 700px) {
  .cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1060px) {
  .cards,
  .dashboard-skeleton {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .chart-wrap {
    min-height: 360px;
  }

  .chart-wrap canvas {
    height: 360px;
  }
}

@media (max-width: 820px) {
  .report-filter-grid,
  .report-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-type-field,
  .client-filter-field,
  .statement-email-field {
    grid-column: 1 / -1;
  }

  .report-card-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .current-company-card {
    width: 100%;
  }

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

  .summary-card:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .company-card {
    grid-template-columns: 48px minmax(0, 1fr);
    min-height: 92px;
    padding: 14px;
  }

  .company-icon {
    width: 48px;
    height: 48px;
  }

  .filter-row,
  .cards,
  .dashboard-skeleton {
    grid-template-columns: 1fr;
  }

  .metric-card {
    grid-template-columns: 64px minmax(0, 1fr);
    min-height: 118px;
    padding: 18px;
  }

  .metric-icon {
    width: 60px;
    height: 60px;
    border-radius: 18px;
  }

  .metric-icon svg {
    width: 34px;
    height: 34px;
  }

  .chart-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .chart-heading select {
    width: 100%;
  }

  .chart-wrap {
    min-height: 320px;
  }

  .chart-wrap canvas {
    height: 320px;
    min-width: 0;
  }

  .seller-row {
    grid-template-columns: 30px 42px minmax(0, 1fr);
    padding: 10px;
  }

  .seller-avatar {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    font-size: 13px;
  }

  .seller-line,
  .seller-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .seller-line strong {
    white-space: normal;
  }

  .filter-heading,
  .results-heading,
  .modal-header {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    align-items: center;
  }

  .logout-button {
    min-width: 96px;
  }

  .report-filter-card {
    padding: 16px;
  }

  .report-heading-left {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .report-heading-icon {
    width: 44px;
    height: 44px;
  }

  .report-card-heading h3 {
    font-size: 21px;
  }

  .report-filter-box {
    padding: 12px;
  }

  .secure-chip {
    align-self: flex-start;
  }

  .report-filter-grid,
  .report-summary {
    grid-template-columns: 1fr;
  }

  .report-actions button {
    width: 100%;
  }

  .report-actions {
    grid-template-columns: 1fr;
  }

  .email-form-grid {
    grid-template-columns: 1fr;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .modal-actions button {
    width: 100%;
  }

  .mobile-db-header,
  .mobile-db-form {
    grid-template-columns: 1fr;
  }

  .mobile-db-icon {
    width: 62px;
    height: 62px;
  }

  .mobile-db-status {
    justify-self: start;
  }

  .mobile-db-actions {
    flex-direction: column;
  }

  .mobile-db-actions button {
    width: 100%;
  }

  .report-table-wrap {
    margin: 12px;
    max-height: none;
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .desktop-table {
    display: none;
  }

  .mobile-result-cards {
    display: grid;
    gap: 10px;
  }

  .mobile-report-card {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 24px rgba(18, 38, 71, .08);
  }

  .mobile-report-card > strong {
    overflow-wrap: anywhere;
    font-size: 15px;
  }

  .mobile-report-card dl {
    display: grid;
    gap: 8px;
    margin: 0;
  }

  .mobile-report-card div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid #edf2f8;
  }

  .mobile-report-card dt,
  .mobile-report-card dd {
    margin: 0;
    font-size: 13px;
  }

  .mobile-report-card dt {
    color: var(--muted);
    font-weight: 750;
  }

  .mobile-report-card dd {
    color: var(--ink);
    font-weight: 850;
    text-align: right;
    font-variant-numeric: tabular-nums;
  }

  .client-modal {
    max-height: 92vh;
    padding: 14px;
  }

  .client-option {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .client-code {
    justify-content: flex-start;
    width: fit-content;
    padding: 0 10px;
  }

  .client-balance {
    text-align: left;
  }
}
