:root {
  --background: #f7f9fb;
  --surface: rgba(255, 255, 255, 0.84);
  --surface-strong: #ffffff;
  --surface-muted: #f2f4f6;
  --text: #1c2233;
  --text-soft: #667085;
  --text-faint: #a2a8b8;
  --primary: #131b2e;
  --primary-strong: #0d1426;
  --accent: #a2c9f6;
  --accent-deep: #2f6faf;
  --line: rgba(118, 119, 125, 0.28);
  --line-strong: rgba(47, 111, 175, 0.7);
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
  --radius: 1.25rem;
  --radius-soft: 1rem;
  --font-display: "Segoe UI Variable Display", "Manrope", "Trebuchet MS", sans-serif;
  --font-body: "Segoe UI Variable Text", "Inter", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-body);
  background:
    radial-gradient(circle at top left, rgba(162, 201, 246, 0.2), transparent 32%),
    radial-gradient(circle at bottom right, rgba(19, 27, 46, 0.09), transparent 28%),
    linear-gradient(180deg, #f8fafc 0%, #f5f7fb 100%);
}

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

.page-shell {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: visible;
}

.background-orb {
  position: fixed;
  z-index: 0;
  border-radius: 999px;
  filter: blur(90px);
  opacity: 0.22;
  pointer-events: none;
}

.background-orb--left {
  left: -7rem;
  bottom: -5rem;
  width: 16rem;
  height: 16rem;
  background: rgba(19, 27, 46, 0.18);
}

.background-orb--right {
  top: -5rem;
  right: -7rem;
  width: 19rem;
  height: 19rem;
  background: rgba(162, 201, 246, 0.34);
}

/* ─── Login ─────────────────────────────────────────── */

.login-layout {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  align-content: center;
  gap: 1.75rem;
  width: min(100%, 27rem);
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

.brand-block {
  text-align: center;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 3.6rem;
  height: 3.6rem;
  margin-bottom: 1rem;
  border-radius: 1rem;
  background: linear-gradient(180deg, #1c2539 0%, #10182d 100%);
  box-shadow: 0 12px 28px rgba(19, 27, 46, 0.16);
}

.brand-mark__icon {
  width: 1.9rem;
  height: 1.9rem;
}

.brand-mark__icon rect {
  fill: transparent;
}

.brand-mark__icon path {
  fill: var(--accent);
}

.brand-block h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 7vw, 2.5rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.brand-block p {
  margin: 0.5rem 0 0;
  color: var(--text-soft);
  font-size: 0.82rem;
}

.login-card {
  position: relative;
  border-radius: var(--radius);
  background: var(--surface);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.login-card__accent {
  height: 0.2rem;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, var(--accent-deep), var(--primary));
}

.login-card__content {
  padding: 1.5rem 1.3rem 1.35rem;
}

.login-form {
  display: grid;
  gap: 1.35rem;
}

/* ─── Fields ─────────────────────────────────────────── */

.field {
  display: grid;
  gap: 0.4rem;
}

.field__label {
  color: rgba(69, 70, 77, 0.72);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.field__control {
  position: relative;
  display: block;
}

.field__control input,
.field__control select,
.field__control textarea {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 0.72rem 2rem 0.68rem 0;
  background: transparent;
  color: var(--text);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field__control textarea {
  resize: vertical;
  line-height: 1.45;
}

.field__control input::placeholder,
.field__control textarea::placeholder {
  color: var(--text-faint);
}

.field__control input:focus,
.field__control select:focus,
.field__control textarea:focus {
  outline: none;
  border-bottom-color: var(--line-strong);
  box-shadow: inset 0 -1px 0 var(--line-strong);
}

.field__control svg {
  position: absolute;
  right: 0;
  bottom: 0.7rem;
  width: 1rem;
  height: 1rem;
  fill: #c0c5d2;
  transition: fill 160ms ease;
}

.field__control:focus-within svg {
  fill: var(--accent-deep);
}

/* ─── Toggle ─────────────────────────────────────────── */

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  width: fit-content;
  color: var(--text-soft);
  font-size: 0.88rem;
  cursor: pointer;
}

.toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle__track {
  position: relative;
  width: 2.45rem;
  height: 1.35rem;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #e4e7ec;
  transition: background-color 160ms ease;
}

.toggle__track::after {
  content: "";
  position: absolute;
  top: 0.15rem;
  left: 0.16rem;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.14);
  transition: transform 160ms ease;
}

.toggle input:checked + .toggle__track {
  background: rgba(47, 111, 175, 0.34);
}

.toggle input:checked + .toggle__track::after {
  transform: translateX(1.08rem);
}

.toggle input:focus-visible + .toggle__track {
  outline: 2px solid rgba(47, 111, 175, 0.3);
  outline-offset: 2px;
}

/* ─── Buttons ─────────────────────────────────────────── */

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  border: 0;
  border-radius: 0.8rem;
  padding: 0.95rem 1.1rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
  color: #ffffff;
  font-weight: 500;
  letter-spacing: 0.005em;
  box-shadow: 0 14px 32px rgba(19, 27, 46, 0.18);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(19, 27, 46, 0.2);
  filter: brightness(1.04);
}

.primary-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  filter: grayscale(0.35);
  box-shadow: none;
}

.primary-button:disabled:hover {
  transform: none;
  box-shadow: none;
  filter: grayscale(0.35);
}

.primary-button:active {
  transform: translateY(0);
}

.primary-button:focus-visible {
  outline: 2px solid rgba(47, 111, 175, 0.4);
  outline-offset: 3px;
}

.primary-button svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.8rem 1rem;
  border: 0;
  border-radius: 0.85rem;
  background: rgba(242, 244, 246, 0.96);
  color: var(--primary);
  font-weight: 500;
}

.success-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.8rem 1rem;
  border: 0;
  border-radius: 0.85rem;
  background: linear-gradient(135deg, #27ae60 0%, #1e8449 100%);
  color: #ffffff;
  font-weight: 500;
  box-shadow: 0 8px 20px rgba(30, 132, 73, 0.22);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.success-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.success-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: none;
}

.success-button:disabled:hover {
  transform: none;
  filter: none;
}

.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.8rem 1rem;
  border: 0;
  border-radius: 0.85rem;
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  color: #ffffff;
  font-weight: 500;
  box-shadow: 0 8px 20px rgba(192, 57, 43, 0.22);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.danger-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.danger-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: none;
}

.danger-button:disabled:hover {
  transform: none;
  filter: none;
}

.secondary-button:disabled {
  opacity: 0.45;
}

/* ─── Form message ─────────────────────────────────────── */

.form-message {
  min-height: 1rem;
  margin: -0.35rem 0 0;
  color: #c0392b;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
}

.form-message--block {
  margin: 1rem 0;
}

.form-message[data-state="success"] {
  color: var(--accent-deep);
}

.form-message[data-state="loading"] {
  color: var(--text-soft);
}

/* ─── Login footer ─────────────────────────────────────── */

.login-footer {
  text-align: center;
}

.login-footer__dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.login-footer__dots span {
  width: 0.2rem;
  height: 0.2rem;
  border-radius: 50%;
  background: rgba(47, 111, 175, 0.35);
}

.login-footer__version {
  margin: 0;
  color: rgba(102, 112, 133, 0.6);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.login-footer__copy {
  margin: 1rem 0 0;
  color: rgba(102, 112, 133, 0.42);
  font-size: 0.62rem;
}

/* ─── Accessibility ─────────────────────────────────────── */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ─── Menu ─────────────────────────────────────────────── */

.menu-layout {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem 1rem;
}

.menu-shell {
  width: min(100%, 24rem);
  display: grid;
  gap: 1.6rem;
}

.menu-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0.95rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.05);
}

.menu-topbar__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.menu-icon-button {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
}

.menu-icon-button svg,
.menu-avatar svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: currentColor;
}

.menu-topbar__name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.menu-avatar {
  display: inline-grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #7becc1 0%, #79d9eb 100%);
  color: var(--primary);
}

.menu-heading {
  text-align: center;
  padding-top: 0.2rem;
}

.menu-heading__eyebrow {
  margin: 0 0 0.6rem;
  color: var(--accent-deep);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.menu-heading h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 7vw, 2.25rem);
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.menu-heading__subtitle {
  margin: 0.45rem 0 0;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.menu-card {
  padding: 0.65rem;
  border-radius: 1.9rem;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(20px);
  box-shadow: 0 28px 72px rgba(19, 27, 46, 0.08);
}

.menu-list {
  display: grid;
  gap: 0.52rem;
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 1.15rem 1rem;
  border: 0;
  border-radius: 1.2rem;
  background: rgba(242, 244, 246, 0.92);
  color: var(--primary);
  text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  transition: transform 160ms ease, background-color 160ms ease;
}

.menu-item:hover {
  transform: translateY(-1px);
  background: rgba(236, 238, 240, 0.96);
}

.menu-item__lead {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.menu-item__icon {
  display: inline-grid;
  place-items: center;
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 0.85rem;
  background: var(--primary);
  color: #ffffff;
  flex: 0 0 auto;
}

.menu-item__icon svg,
.menu-item__arrow svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: currentColor;
}

.menu-item__text {
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.015em;
}

.menu-item__arrow {
  color: #7c8598;
}

.menu-list .menu-item {
  padding: 0.82rem 0.9rem;
}

.menu-list .menu-item__lead {
  gap: 0.75rem;
}

.menu-list .menu-item__icon {
  width: 2.45rem;
  height: 2.45rem;
}

.menu-list .menu-item__text {
  font-size: 0.98rem;
}

.menu-item--accent {
  background: linear-gradient(135deg, #a2c9f6 0%, #b8d8fb 100%);
  color: #062516;
}

.menu-item--accent:hover {
  background: linear-gradient(135deg, #8fbdf2 0%, #a2c9f6 100%);
}

.menu-item__icon--accent {
  background: rgba(6, 37, 22, 0.86);
  color: #a2c9f6;
}

/* ─── Clients layout (used by all content pages) ──────── */

.clients-layout {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 1rem 0.9rem 1.25rem;
}

.clients-shell {
  width: min(100%, 56rem);
  margin: 0 auto;
  display: grid;
  gap: 1rem;
  padding-top: 6.5rem;
}

.clients-topbar {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 20;
  width: min(100vw, 56rem);
  transform: translateX(-50%);
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 0 0 1.25rem 1.25rem;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
}

.clients-topbar__copy {
  min-width: 0;
}

.clients-topbar__copy--with-action {
  position: relative;
  width: 100%;
}

.clients-topbar__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-right: 8rem;
}

.clients-topbar__menu {
  position: absolute;
  top: 50%;
  right: 0;
  flex: 0 0 auto;
  transform: translateY(-50%);
}

.clients-header__broker {
  margin: 0 0 0.4rem;
  color: rgba(102, 112, 133, 0.86);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.clients-page-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 5vw, 1.7rem);
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.clients-card {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border-radius: 1.75rem;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(20px);
  box-shadow: 0 28px 72px rgba(19, 27, 46, 0.08);
}

.clients-card--flat {
  padding: 0;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
}

.clients-card--snug {
  gap: 0.25rem;
}

.clients-search {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
  border-radius: 1.4rem;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(20px);
  box-shadow: 0 22px 54px rgba(19, 27, 46, 0.07);
}

.clients-grid-card {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
  border-radius: 1.4rem;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(20px);
  box-shadow: 0 22px 54px rgba(19, 27, 46, 0.07);
  min-width: 0;
  overflow: hidden;
}

.clients-grid-card > * {
  min-width: 0;
}

.estoque-fullpanel {
  padding: 0.75rem 0.9rem 1.25rem;
  min-width: 0;
  overflow: hidden;
}

.estoque-fullpanel > * {
  min-width: 0;
}

.clients-grid-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.clients-grid-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: -0.03em;
}

.clients-grid-header p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.8rem;
}

.clients-grid-table {
  overflow: hidden;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.8);
}

.clients-grid-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.9rem;
  align-items: center;
  width: 100%;
  padding: 0.92rem 1rem;
}

.clients-grid-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clients-grid-row__content {
  display: grid;
  gap: 0.18rem;
}

.clients-grid-row__title {
  font-size: 0.94rem;
  font-weight: 600;
}

.clients-grid-row__subtitle {
  color: var(--text-soft);
  font-size: 0.8rem;
}

.clients-grid-row--head {
  color: rgba(69, 70, 77, 0.84);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(236, 238, 240, 0.85);
}

.clients-grid-row--body {
  border: 0;
  border-top: 1px solid rgba(198, 198, 205, 0.24);
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: 0.94rem;
  transition: background-color 160ms ease, transform 160ms ease;
}

.clients-grid-row--body:hover {
  background: rgba(162, 201, 246, 0.16);
}

.clients-grid-row--body.is-selected {
  background: rgba(162, 201, 246, 0.26);
}

.clients-grid-empty {
  padding: 1.2rem 1rem;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.clients-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.clients-pagination span {
  color: var(--text-soft);
  font-size: 0.82rem;
  text-align: center;
}

/* ─── Actions toggle (dropdown menu) ───────────────────── */

.clients-actions__toggle {
  min-width: 8rem;
  justify-content: space-between;
}

.clients-actions__toggle--icon {
  min-width: 0;
  width: auto;
  height: 2.75rem;
  padding: 0 0.85rem 0 1rem;
  border-radius: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border-color: rgba(47, 111, 175, 0.28);
  background: var(--accent-deep);
  color: #ffffff;
}

.clients-actions__toggle--icon:hover {
  background: var(--accent-deep);
}

.clients-actions__toggle-text {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.clients-actions__toggle svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
  transition: transform 160ms ease;
}

.clients-actions__toggle--icon svg {
  width: 1.45rem;
  height: 1.45rem;
}

.clients-actions__toggle.is-open svg {
  transform: rotate(180deg);
}

.clients-actions__panel {
  padding: 0.35rem;
  border-radius: 1.25rem;
  background: rgba(242, 244, 246, 0.66);
}

.clients-actions__panel--top {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  width: min(88vw, 21rem);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.14);
}

.clients-actions__grid {
  display: grid;
  gap: 0.7rem;
}

.clients-action-button {
  text-align: left;
}

.clients-action-button.is-disabled,
.clients-action-button:disabled {
  opacity: 0.5;
}

/* ─── Details table ─────────────────────────────────────── */

.details-shell {
  width: min(100%, 62rem);
}

.details-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 5vw, 1.7rem);
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.consulta-resultado {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.details-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1rem 1.2rem;
}

.details-field {
  display: grid;
  gap: 0.35rem;
  padding: 0.95rem 1rem;
  border-radius: 1rem;
  background: rgba(248, 250, 252, 0.96);
  border: 1px solid rgba(198, 198, 205, 0.22);
}

.details-field__label {
  color: rgba(69, 70, 77, 0.72);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.details-field__value {
  min-height: 1.3rem;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.4;
  word-break: break-word;
}

.details-table {
  overflow: hidden;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.8);
}

.details-table__row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 0.9rem;
  width: 100%;
  padding: 0.95rem 1rem;
  align-items: start;
}

.details-table__row span {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.details-table__row--head {
  color: rgba(69, 70, 77, 0.84);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(236, 238, 240, 0.85);
}

.details-table__row--body {
  border-top: 1px solid rgba(198, 198, 205, 0.24);
  font-size: 0.94rem;
}

.details-table__row--total {
  background: rgba(162, 201, 246, 0.22);
  color: var(--primary);
  font-weight: 800;
}

.details-table__empty {
  padding: 1.2rem 1rem;
  color: var(--text-soft);
  font-size: 0.9rem;
}

/* ─── Period selector ──────────────────────────────────── */

.period-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.period-bar__label {
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.period-bar__buttons {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.period-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.1rem;
  padding: 0 0.85rem;
  border: 1px solid rgba(118, 119, 125, 0.2);
  border-radius: 0.65rem;
  background: rgba(242, 244, 246, 0.85);
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.period-btn:hover {
  background: rgba(162, 201, 246, 0.18);
  color: var(--accent-deep);
}

.period-btn.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.period-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.period-nav__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid rgba(118, 119, 125, 0.2);
  border-radius: 0.65rem;
  background: rgba(242, 244, 246, 0.85);
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 600;
}

.period-nav__btn svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.period-nav__label {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  min-width: 9rem;
}

/* ─── Period filter card ──────────────────────────────────── */

.filter-card {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border-radius: 1.4rem;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(20px);
  box-shadow: 0 22px 54px rgba(19, 27, 46, 0.07);
}

.filter-card__row {
  display: flex;
  flex-wrap: nowrap;
  align-items: end;
  gap: 0.75rem;
}

.filter-card__field {
  flex: 1 1 9rem;
  min-width: 0;
}

.filter-card__actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.filter-card__apply {
  min-height: 2.6rem;
  padding: 0.6rem 1.1rem;
  border-radius: 0.8rem;
  font-size: 0.88rem;
}

/* ─── Charts ─────────────────────────────────────────────── */

.chart-wrap {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-soft);
  padding: 1rem 1rem 0.75rem;
  overflow: hidden;
}

.chart-title {
  margin: 0 0 0.6rem;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-soft);
  text-transform: uppercase;
}

.chart-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
}

/* ─── Stats cards ────────────────────────────────────────── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.7rem;
}

.stat-card {
  display: grid;
  gap: 0.25rem;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  background: rgba(248, 250, 252, 0.96);
  border: 1px solid rgba(198, 198, 205, 0.22);
}

.stat-card__label {
  color: rgba(69, 70, 77, 0.72);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stat-card__value {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  word-break: break-all;
}

.stat-card__sub {
  color: var(--text-soft);
  font-size: 0.75rem;
}

.stat-card--accent {
  background: rgba(162, 201, 246, 0.18);
  border-color: rgba(47, 111, 175, 0.18);
}

.stat-card--accent .stat-card__value {
  color: var(--accent-deep);
}

/* ─── Data grid (multi-column report table) ──────────────── */

.data-grid-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.data-grid {
  overflow: hidden;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.8);
}

.data-grid__row {
  display: grid;
  gap: 0.7rem;
  align-items: center;
  padding: 0.85rem 1rem;
}

.data-grid__row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.35;
}

.data-grid--sticky-col {
  display: grid;
  overflow: visible;
  background: transparent;
  border-radius: 0;
}

.data-grid--sticky-col .data-grid__row {
  display: contents;
}

.data-grid--sticky-col .data-grid__row > span {
  padding: 0.6rem 0.75rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.35;
}

.data-grid--sticky-col .data-grid__row--head > span {
  background: rgb(236, 238, 240);
  color: rgba(69, 70, 77, 0.84);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.data-grid--sticky-col .data-grid__row--body > span {
  background: var(--surface-strong);
  border-top: 1px solid rgba(198, 198, 205, 0.24);
  font-size: 0.9rem;
}

.data-grid--sticky-col .data-grid__row--body:hover > span {
  background: rgba(162, 201, 246, 0.12);
}

.data-grid--sticky-col .data-grid__row--total > span {
  background: rgb(214, 229, 246);
  font-weight: 700;
  color: var(--primary);
  border-top: 1px solid rgba(162, 201, 246, 0.3);
  font-size: 0.9rem;
}

.data-grid--sticky-col .data-grid__row > span:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  border-right: 1px solid rgba(198, 198, 205, 0.5);
}

.data-grid--sticky-col .data-grid__row--total.is-grand > span {
  border-top: 2px solid rgba(99, 163, 235, 0.5);
}

.data-grid--lined .data-grid__row {
  gap: 0;
  padding: 0;
}

.data-grid--lined .data-grid__row span {
  padding: 0.6rem 0.75rem;
  border-right: 1px solid rgba(198, 198, 205, 0.28);
}

.data-grid--lined .data-grid__row span:last-child {
  border-right: none;
}

.data-grid__row--head {
  color: rgba(69, 70, 77, 0.84);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(236, 238, 240, 0.85);
}

.data-grid__row--body {
  border-top: 1px solid rgba(198, 198, 205, 0.24);
  font-size: 0.9rem;
}

.data-grid__row--body:hover {
  background: rgba(162, 201, 246, 0.1);
}

.data-grid__row--body.is-selected {
  background: rgba(99, 163, 235, 0.18);
  outline: 1px solid rgba(99, 163, 235, 0.4);
}

.menu-item:disabled,
.menu-item[disabled] {
  opacity: 0.38;
  pointer-events: none;
  cursor: default;
}

.data-grid__row--body.is-clickable {
  cursor: pointer;
  transition: background-color 140ms ease;
}

.data-grid__row--total {
  background: rgba(162, 201, 246, 0.18);
  font-weight: 700;
  color: var(--primary);
}

.data-grid__cell--sticky {
  position: sticky;
  left: 0;
  z-index: 1;
}

.data-grid__row--head .data-grid__cell--sticky {
  background: rgb(236, 238, 240);
}

.data-grid__row--body .data-grid__cell--sticky {
  background: var(--surface-strong);
}

.data-grid__row--total .data-grid__cell--sticky {
  background: rgb(214, 229, 246);
}

.data-grid__row--group {
  background: rgba(162, 201, 246, 0.08);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  padding: 0.3rem 0.75rem;
  grid-column: 1 / -1;
  border-top: 1px solid rgba(162, 201, 246, 0.3);
}

.data-grid__cell--right {
  text-align: right;
  white-space: nowrap;
  overflow: visible;
}

.data-grid__cell--center {
  text-align: center;
}

.data-grid--wide {
  min-width: 52rem;
}

.data-grid-scroll > .data-grid {
  min-width: 90rem;
}

.data-grid--wide .data-grid__row span {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.data-grid--wide .data-grid__cell--right {
  white-space: nowrap;
}

.data-grid__empty {
  padding: 1.5rem 1rem;
  color: var(--text-soft);
  font-size: 0.9rem;
  text-align: center;
}

.grid-delete-btn {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 0.6rem;
  background: rgba(231, 76, 60, 0.12);
  color: #c0392b;
  flex: 0 0 auto;
  transition: background-color 140ms ease;
}

.grid-delete-btn:hover {
  background: rgba(231, 76, 60, 0.22);
}

.grid-delete-btn svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: currentColor;
}

/* ─── Tabs ─────────────────────────────────────────────────── */

.tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  border-radius: 0.85rem;
  background: rgba(236, 238, 240, 0.8);
  padding: 0.3rem;
}

.tab-btn {
  flex: 1 1 auto;
  min-width: 5rem;
  padding: 0.55rem 0.85rem;
  border: 0;
  border-radius: 0.6rem;
  background: transparent;
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 140ms ease, color 140ms ease;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.is-active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: contents;
}

/* ─── Badge / status ──────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge--pending {
  background: rgba(255, 193, 7, 0.18);
  color: #a07b00;
}

.badge--approved {
  background: rgba(39, 174, 96, 0.15);
  color: #1a6b3c;
}

.badge--rejected {
  background: rgba(231, 76, 60, 0.14);
  color: #a93226;
}

/* ─── Discount card ────────────────────────────────────────── */

.discount-item {
  display: grid;
  gap: 0.7rem;
  padding: 1rem;
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(198, 198, 205, 0.24);
}

.discount-item__header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.75rem;
}

.discount-item__store {
  font-size: 0.94rem;
  font-weight: 600;
}

.discount-item__date {
  color: var(--text-soft);
  font-size: 0.8rem;
}

.discount-item__values {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem 0.75rem;
  align-items: center;
}

.discount-item__actions {
  display: flex;
  gap: 0.5rem;
}

.action-btn {
  flex: 1;
  min-height: 2.4rem;
  padding: 0.5rem 0.75rem;
  border: 0;
  border-radius: 0.75rem;
  font-size: 0.84rem;
  font-weight: 600;
  transition: filter 120ms ease, transform 120ms ease;
}

.action-btn:active {
  transform: scale(0.97);
}

.action-btn--approve {
  background: rgba(39, 174, 96, 0.18);
  color: #1a6b3c;
}

.action-btn--approve:hover {
  filter: brightness(0.92);
}

.action-btn--reject {
  background: rgba(231, 76, 60, 0.14);
  color: #a93226;
}

.action-btn--reject:hover {
  filter: brightness(0.92);
}

/* ─── Authorization code display ──────────────────────────── */

.auth-code-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.85rem 1rem;
  border-radius: 0.85rem;
  background: rgba(162, 201, 246, 0.15);
  border: 1px solid rgba(47, 111, 175, 0.22);
}

.auth-code-display__label {
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.auth-code-display__value {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 0.3em;
  color: var(--accent-deep);
  font-family: var(--font-display);
}

/* ─── Store select in filter ───────────────────────────────── */

.store-select-wrap {
  position: relative;
}

.store-select-wrap select {
  padding-right: 2.2rem;
  appearance: none;
  background-color: transparent;
  cursor: pointer;
}

.store-select-wrap::after {
  content: "";
  position: absolute;
  right: 0.5rem;
  bottom: 0.88rem;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--text-faint);
  border-bottom: 2px solid var(--text-faint);
  transform: rotate(45deg);
  pointer-events: none;
}

/* ─── 2-col Sticky Grid ─────────────────────────────────── */

.data-grid--sticky-2col { display: grid; overflow: visible; background: transparent; border-radius: 0; }
.data-grid--sticky-2col .data-grid__row { display: contents; }
.data-grid--sticky-2col .data-grid__row > span { padding: 0.6rem 0.75rem; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; line-height:1.35; }
.data-grid--sticky-2col .data-grid__row--head > span { background: rgb(236,238,240); color: rgba(69,70,77,0.84); font-size:0.72rem; font-weight:700; text-transform:uppercase; letter-spacing:0.04em; }
.data-grid--sticky-2col .data-grid__row--body > span { background: var(--surface-strong); border-top:1px solid rgba(198,198,205,0.24); font-size:0.9rem; }
.data-grid--sticky-2col .data-grid__row--body.is-clickable > span { cursor: pointer; }
.data-grid--sticky-2col .data-grid__row--body:hover > span { background: rgba(162,201,246,0.12); }
.data-grid--sticky-2col .data-grid__row--body.is-selected > span { background: rgba(162,201,246,0.28); }
.data-grid--sticky-2col .data-grid__row--total > span { background: rgb(214,229,246); font-weight:700; color:var(--primary); border-top:1px solid rgba(162,201,246,0.3); font-size:0.9rem; }
.data-grid--sticky-2col .data-grid__row > span:nth-child(1) { position:sticky; left:0; z-index:20; }
.data-grid--sticky-2col .data-grid__row > span:nth-child(2) { position:sticky; left:5rem; z-index:19; border-right:1px solid rgba(198,198,205,0.5); }
/* Sticky columns must have opaque backgrounds in all states so scrolled content cannot bleed through */
.data-grid--sticky-2col .data-grid__row--head > span:nth-child(1),
.data-grid--sticky-2col .data-grid__row--head > span:nth-child(2) { background: rgb(236,238,240); }
.data-grid--sticky-2col .data-grid__row--body > span:nth-child(1),
.data-grid--sticky-2col .data-grid__row--body > span:nth-child(2) { background: #fff; }
.data-grid--sticky-2col .data-grid__row--body:hover > span:nth-child(1),
.data-grid--sticky-2col .data-grid__row--body:hover > span:nth-child(2) { background: rgb(244,249,254); }
.data-grid--sticky-2col .data-grid__row--body.is-selected > span:nth-child(1),
.data-grid--sticky-2col .data-grid__row--body.is-selected > span:nth-child(2) { background: rgb(229,240,252); }
.data-grid--sticky-2col .data-grid__row--total > span:nth-child(1),
.data-grid--sticky-2col .data-grid__row--total > span:nth-child(2) { background: rgb(214,229,246); }

/* ─── Selectable native table rows ─────────────────────────── */
#grid-container tbody tr.is-clickable { cursor: pointer; transition: background-color 140ms ease; }
#grid-container tbody tr.is-clickable:hover td { background: rgba(162, 201, 246, 0.12) !important; }
#grid-container tbody tr.is-selected td { background: rgba(99, 163, 235, 0.18) !important; }

/* ─── Searchable Select ─────────────────────────────────── */

.store-select-wrap .searchable-select__input {
  padding-right: 2.2rem;
  background-color: transparent;
  cursor: pointer;
}

.searchable-select__list {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  right: 0;
  background: var(--surface-strong);
  border: 1px solid rgba(198,198,205,0.5);
  border-radius: 0.5rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.14);
  max-height: 14rem;
  overflow-y: auto;
  z-index: 200;
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
}

.searchable-select__item {
  padding: 0.65rem 0.75rem;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--text);
}

.searchable-select__item + .searchable-select__item {
  border-top: 1px solid rgba(198,198,205,0.15);
}

.searchable-select__item:hover,
.searchable-select__item:active {
  background: rgba(162,201,246,0.2);
}

.searchable-select__item.is-selected {
  font-weight: 600;
  color: var(--primary);
}

/* ─── Responsive ────────────────────────────────────────── */

@media (min-width: 640px) {
  .login-layout {
    width: min(100%, 31rem);
    gap: 2rem;
    padding: 2.5rem 1.5rem;
  }

  .brand-mark {
    width: 4rem;
    height: 4rem;
    margin-bottom: 1.15rem;
  }

  .login-card__content {
    padding: 1.85rem 1.65rem 1.55rem;
  }

  .menu-shell {
    width: min(100%, 25rem);
  }

  .clients-shell {
    width: min(100%, 34rem);
    padding-top: 6.5rem;
  }

  .details-shell {
    width: min(100%, 42rem);
  }

  .clients-card {
    padding: 1.2rem;
  }
}

@media (min-width: 920px) {
  .login-layout {
    width: min(100%, 64rem);
    grid-template-columns: minmax(19rem, 23rem);
    justify-content: center;
    gap: 1.8rem;
    padding-inline: clamp(2rem, 9vw, 5rem);
  }

  .brand-block {
    text-align: center;
    margin-top: 0.5rem;
  }

  .login-card {
    max-width: 23rem;
  }

  .login-footer {
    max-width: 23rem;
  }

  .menu-shell {
    width: min(100%, 26rem);
  }

  .clients-shell {
    width: min(100%, 60rem);
    padding-top: 6.5rem;
  }

  .details-shell {
    width: min(100%, 64rem);
  }

  .clients-search,
  .clients-grid-card {
    padding: 1.15rem;
  }
}

@media (max-width: 639px) {
  .clients-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .clients-topbar__title-row {
    align-items: center;
    padding-right: 7.25rem;
  }

  .clients-actions__toggle--icon {
    height: 2.5rem;
    padding: 0 0.75rem 0 0.85rem;
  }

  .clients-actions__toggle-text {
    font-size: 0.76rem;
  }

  .clients-actions__toggle--icon svg {
    width: 1.3rem;
    height: 1.3rem;
  }

  .clients-actions__panel--top {
    left: auto;
    right: 0;
    width: min(88vw, 21rem);
  }

  .clients-grid-header {
    align-items: start;
    flex-direction: column;
  }

  .details-fields {
    grid-template-columns: 1fr;
  }

  .details-table__row {
    grid-template-columns: 1fr;
  }

  .discount-item__values {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .clients-pagination {
    flex-wrap: wrap;
  }
}
