:root {
  --blue: #1c05b8;
  --blue-dark: #110073;
  --ink: #14151f;
  --muted: #687083;
  --line: #dfe4ed;
  --bg: #f4f6fa;
  --panel: #ffffff;
  --green: #2d7d22;
  --red: #e61d1d;
  --yellow: #fff200;
  --soft-blue: #dce9ff;
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 12px;
  --spacing-lg: 16px;
  --spacing-xl: 24px;
  --spacing-2xl: 32px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 2px 8px rgba(12, 18, 33, 0.08);
  --shadow-md: 0 8px 16px rgba(12, 18, 33, 0.12);
  --shadow-lg: 0 16px 32px rgba(12, 18, 33, 0.16);
  --border: #dde6f2;
}

/* Theme variables (light default, overridden by body classes) */
:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --ink: #0f172a;
  --muted: #687083;
  --accent: #1e40af;
  --danger: #e61d1d;
  --success: #2d7d22;
}

/* Light theme */
.theme-light { }

/* Dark theme */
.theme-dark {
  --bg: #071029;
  --panel: #0b1220;
  --ink: #e6eefc;
  --muted: #9aa6b2;
  --accent: #4f46e5;
  --danger: #ef4444;
  --success: #10b981;
}

/* Dark blue night */
.theme-dark-blue {
  --bg: #041226;
  --panel: #071a2b;
  --ink: #e6f0ff;
  --muted: #9fb6d1;
  --accent: #2b6cb0;
  --danger: #ff6b6b;
  --success: #2dd4bf;
}

@media (max-width: 768px) {
  :root {
    --bg: #eef2f8;
  }

  body {
    background: var(--bg);
  }

  .menu-toggle {
    top: 10px;
    left: 10px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(12, 18, 33, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.24);
  }

  .sidebar {
    width: 86vw;
    max-width: 320px;
    padding: 14px 12px 22px;
    gap: 16px;
    box-shadow: 18px 0 40px rgba(15, 23, 42, 0.45);
    border-right: 1px solid rgba(255, 255, 255, 0.14);
    background: linear-gradient(180deg, #1604ad 0%, #0f0285 100%);
  }

  .brand {
    min-height: 54px;
    justify-content: start;
  }

  .brand img {
    width: 138px;
  }

  .nav-item {
    border-radius: 10px;
    padding: 13px 12px;
    font-size: 0.98rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid transparent;
  }

  .nav-item.active,
  .nav-item:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateX(2px);
  }

  main {
    max-width: none;
    padding: 64px 10px 14px;
  }

  .topbar {
    padding: 12px 12px 10px;
    border-radius: 12px;
    margin-bottom: 10px;
    gap: 10px;
    border-color: #d7deea;
    background: #fff;
    border: 2px solid #d4def2;
    box-shadow: 0 10px 24px rgba(16, 24, 40, 0.09);
  }

  .topbar-title {
    width: 100%;
  }

  .topbar-title .eyebrow {
    margin-bottom: 3px;
    font-size: 0.72rem;
    color: #5c6679;
  }

  h1 {
    font-size: 1.54rem;
    line-height: 1.08;
    color: #0f172a;
    font-weight: 900;
    letter-spacing: 0;
  }

  .mobile-status {
    display: block;
    color: #445069;
    font-size: 0.74rem;
  }

  .session-chip {
    width: 100%;
    border-radius: 12px;
    padding: 9px;
    gap: 8px;
    background: #f1f5fb;
    border-color: #d8e0ee;
  }

  .actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .actions button,
  .session-chip .small-btn,
  .compact-actions button,
  .history-actions button,
  .section-title button,
  .primary,
  .secondary,
  .ghost,
  .danger {
    width: 100%;
    min-height: 42px;
    border-radius: 10px;
  }

  .panel {
    border-radius: 12px;
    padding: 12px;
  }

  .field-grid,
  .metric-grid,
  .permissions-box {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  .tip-tools {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    gap: 8px;
  }

  .history-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .history-item small {
    display: block;
    margin-top: 2px;
    font-size: 0.78rem;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

body.auth-locked {
  overflow: hidden;
}

body.auth-locked .sidebar,
body.auth-locked .menu-toggle,
body.auth-locked .menu-backdrop {
  display: none !important;
}

button,
input,
textarea,
select {
  font: inherit;
  font-size: 16px;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 270px;
  padding: 24px 16px;
  background: var(--blue);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 28px;
  z-index: 60;
  transform: translateX(-100%);
  transition: transform 0.22s ease;
}

body.menu-open .sidebar {
  transform: translateX(0);
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-items: center;
  padding: 0 18px 18px;
  background: linear-gradient(135deg, #ffffff 0%, #f0f4f8 100%);
}

body.auth-locked .auth-screen {
  display: grid;
}

.auth-card {
  width: min(420px, 100%);
  border: 1px solid rgba(28, 5, 184, 0.08);
  border-radius: 20px;
  padding: 48px 36px 40px;
  background: #ffffff;
  box-shadow: 0 25px 50px rgba(12, 18, 33, 0.15), 0 0 1px rgba(28, 5, 184, 0.1);
  backdrop-filter: blur(10px);
}

/* Pull the card slightly up so the curved blue header overlaps cleanly */
.auth-card {
  margin-top: -36px;
  border-top: none;
}

body.auth-locked .auth-card {
  color: #0f172a;
}

.auth-card h2 {
  margin: 0 0 8px;
  color: #0f172a;
  font-size: 2rem;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.6px;
}

.auth-card p {
  margin: 0 0 32px;
  color: #687083;
  font-size: 0.9rem;
  line-height: 1.5;
  letter-spacing: 0.2px;
}

.auth-card label {
  color: #334155;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: none;
  display: block;
  margin-bottom: 10px;
  letter-spacing: 0.3px;
}

.auth-card button {
  width: 100%;
  margin-top: 16px;
  min-height: 48px;
  font-weight: 600;
  font-size: 0.95rem;
}

.auth-secondary {
  margin-top: 8px;
}

.pin-field {
  position: relative;
  display: block;
}

.pin-field input {
  padding-right: 52px;
}

.pin-biometric {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 38px !important;
  height: 38px;
  min-height: 38px;
  margin: 0 !important;
  padding: 0;
  transform: translateY(-50%);
  border-radius: 999px;
  color: #1c05b8;
  background: rgba(255, 255, 255, 0.92);
  font-size: 1.25rem;
  line-height: 1;
}

.biometric-wide {
  min-height: 50px;
  color: #1c05b8;
  border: 1px solid #d7dde8;
  background: #ffffff;
}

.biometric-wide::before {
  content: "⌾";
  margin-right: 8px;
}

.auth-brand {
  display: none;
  min-height: 0;
  margin-bottom: 0;
  background: transparent;
}

.auth-brand img {
  width: min(210px, 90%);
  filter: brightness(0) invert(1);
  opacity: 1;
}

.auth-card input {
  min-height: 48px;
  border-radius: 12px;
  border: 1.5px solid #e0e7f1;
  background: #f8fafc;
  color: #0f172a;
  font-size: 0.95rem;
  transition: all 280ms cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.2px;
}

.auth-card input:focus {
  border-color: #1c05b8;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(28, 5, 184, 0.12), inset 0 0 0 1px rgba(28, 5, 184, 0.05);
}

.auth-card input::placeholder {
  color: #9ca3af;
}

.auth-top {
  width: calc(100% + 36px);
  height: 154px;
  margin: 0 -18px;
  background: linear-gradient(90deg, var(--accent), var(--blue-dark));
  border-radius: 0 0 30px 30px;
  position: relative;
  z-index: 6;
}

.auth-logo-tile {
  position: absolute;
  left: 32px;
  bottom: -42px;
  width: 100px;
  height: 100px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  background: var(--panel);
  box-shadow: 0 16px 32px rgba(2, 8, 23, 0.35), 0 0 0 1px rgba(28, 5, 184, 0.08);
  border: 1px solid rgba(28, 5, 184, 0.08);
}

.auth-logo-tile img {
  width: 76px;
  height: auto;
  display: block;
}

.auth-submit {
  min-height: 52px;
  margin-top: 32px !important;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.96rem;
  letter-spacing: 0.3px;
  transition: all 280ms cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 16px rgba(28, 5, 184, 0.2);
}

.auth-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(28, 5, 184, 0.3);
}

.menu-toggle {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 80;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  color: #fff;
  background: var(--ink);
  font-size: 1.2rem;
  line-height: 1;
}

.menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 24, 0.34);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

body.menu-open .menu-backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* Reports carousel for mobile */
.reports-carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 8px 2px;
}
  .reports-carousel {
    padding-bottom: 6px;
  }
  .reports-carousel::-webkit-scrollbar {
    height: 8px;
  }
  .reports-carousel::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 8px;
  }
.reports-carousel .report-card {
  min-width: 280px;
  max-width: 340px;
  flex: 0 0 auto;
  scroll-snap-align: start;
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 6px 18px rgba(12,18,33,0.06);
  padding: 12px;
}

/* Theme variants */
.theme-dark {
  --bg: #0f1724;
  --panel: #111827;
  --ink: #e6eef8;
  --muted: #9aa4b2;
  --line: #1f2937;
}
.theme-dark-blue {
  --bg: #071032;
  --panel: #071634;
  --ink: #dfe9fb;
  --muted: #9db0d6;
  --line: #0b2340;
}

.brand {
  min-height: 120px;
  display: grid;
  place-items: center;
  gap: 12px;
  border-radius: 8px;
}

.brand img {
  width: min(218px, 92%);
  height: auto;
  display: block;
}

.brand .client-brand-logo {
  width: min(184px, 84%);
  padding: 7px 10px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.24);
}

nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  border: 0;
  border-radius: 8px;
  padding: 12px 14px;
  text-align: left;
  color: rgba(255, 255, 255, 0.76);
  background: transparent;
  cursor: pointer;
}

.nav-item.active,
.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

main {
  min-width: 0;
  max-width: 1220px;
  margin: 0 auto;
  padding: 82px 22px 22px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 14px 16px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.mobile-status {
  display: none;
  margin: 6px 0 0;
  color: #5f6b80;
  font-size: 0.78rem;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: clamp(1.9rem, 3vw, 2.7rem);
  letter-spacing: 0;
}

h2 {
  font-size: 1rem;
}

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

.install-mini {
  padding-inline: 12px;
}

.session-chip {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: #f8fafc;
}

.session-chip small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.session-chip strong {
  font-size: 0.88rem;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 11px 14px;
  font-weight: 800;
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.primary {
  color: #fff;
  background: var(--blue);
}

.secondary {
  color: #fff;
  background: var(--ink);
}

.ghost {
  color: var(--ink);
  background: #e8ecf4;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.layout {
  display: grid;
  gap: 16px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 14px 34px rgba(16, 24, 40, 0.06);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

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

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

input,
textarea,
select {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
  outline: none;
  font-size: inherit;
  transition: all 280ms cubic-bezier(0.4, 0, 0.2, 1);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(28, 5, 184, 0.12);
  background: #ffffff;
}

textarea {
  resize: vertical;
  min-height: 110px;
  font-family: inherit;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--spacing-md);
  margin-top: var(--spacing-lg);
}

@media (max-width: 960px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.metric {
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg) var(--spacing-md);
  background: #f8fafc;
  transition: all 280ms cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
}

.metric small {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.metric strong {
  font-size: 1.35rem;
  font-weight: 700;
  display: block;
}

.metric.total {
  /* Default (light theme): keep background but use dark text for readability */
  color: var(--ink);
  border-color: #1c05b8;
  background: linear-gradient(135deg, #1c05b8 0%, #2214d6 100%);
  box-shadow: 0 8px 20px rgba(28, 5, 184, 0.12);
}

.metric.total small {
  color: rgba(15, 23, 42, 0.7);
}

.metric.total strong {
  color: var(--ink);
  text-shadow: none;
}

.theme-dark .metric.total,
.theme-dark-blue .metric.total {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  border-color: #4f46e5;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.25);
  color: #ffffff;
}

.theme-dark .metric.total small,
.theme-dark-blue .metric.total small {
  color: rgba(255, 255, 255, 0.9);
}

.theme-dark .metric.total strong,
.theme-dark-blue .metric.total strong {
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Ensure topbar is blue in light theme for better visual consistency */
.theme-light .topbar {
  background: linear-gradient(180deg, #1c05b8 0%, #2252d4 100%);
  color: #ffffff;
  box-shadow: 0 16px 30px rgba(28, 5, 184, 0.22);
}

.theme-light .topbar .topbar-title .eyebrow,
.theme-light .topbar .topbar-title h1,
.theme-light .topbar .mobile-status {
  color: #ffffff;
}

.theme-light .topbar .session-chip {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.12);
  color: #ffffff;
}

.theme-light .topbar .actions button {
  background: rgba(255,255,255,0.08);
  color: #ffffff;
  border-color: rgba(255,255,255,0.12);
}

/* Fallback: when no dark theme class is present on body, treat as light and force blue header */
body:not(.theme-dark):not(.theme-dark-blue) .topbar {
  background: linear-gradient(180deg, #1c05b8 0%, #2252d4 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 16px 30px rgba(28, 5, 184, 0.22) !important;
}

body:not(.theme-dark):not(.theme-dark-blue) .topbar .topbar-title * {
  color: #ffffff !important;
}

body:not(.theme-dark):not(.theme-dark-blue) .topbar .session-chip {
  background: rgba(255,255,255,0.08) !important;
  border-color: rgba(255,255,255,0.12) !important;
  color: #ffffff !important;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

th {
  color: #fff;
  background: linear-gradient(135deg, var(--ink) 0%, rgba(20, 21, 31, 0.95) 100%);
  font-size: 0.8rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.3px;
}

th {
  border: 1.5px solid var(--line);
  padding: var(--spacing-md) var(--spacing-lg);
}

td {
  border: 1.5px solid var(--line);
  padding: var(--spacing-md);
  text-align: left;
}

td input {
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--spacing-sm);
  box-shadow: none;
  background: #f9fafc;
  transition: all 200ms ease;
}

td input:focus {
  background: #ffffff;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(28, 5, 184, 0.1);
}

.card {
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
}

.section-title h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.3px;
}

.section-title p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.icon-btn {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  color: #fff;
  background: var(--green);
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1.2rem;
  transition: all 280ms cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  cursor: pointer;
}

.icon-btn:hover {
  transform: scale(1.08);
  box-shadow: var(--shadow-md);
}

.icon-btn.danger {
  background: var(--red);
}

.icon-btn.tip {
  background: var(--blue);
}

.compact-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tip-tools {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-md);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
  background: linear-gradient(135deg, #f9fafc 0%, rgba(220, 233, 255, 0.1) 100%);
  box-shadow: var(--shadow-sm);
}

.tip-tools span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.tip-tools strong {
  min-width: 24px;
  text-align: center;
  font-weight: 700;
  color: var(--blue);
}

.small-btn {
  min-height: 38px;
  padding: 8px 10px;
  white-space: nowrap;
}

.btn-delete-row {
  width: 36px !important;
  height: 36px !important;
  padding: 0 !important;
  color: var(--danger) !important;
  font-size: 1rem !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.btn-delete-row:hover {
  background: rgba(230, 29, 29, 0.1) !important;
}

.btn-danger {
  color: var(--danger) !important;
  border-color: rgba(230, 29, 29, 0.2) !important;
}

.btn-danger:hover {
  background: rgba(230, 29, 29, 0.08) !important;
}

.report-meta {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: var(--spacing-md);
}

.report-actions {
  display: flex;
  gap: var(--spacing-md);
  align-items: center;
  margin-top: var(--spacing-lg);
}

.report-link {
  padding: var(--spacing-sm) var(--spacing-md) !important;
  border-radius: var(--radius-sm) !important;
  background: #eef6ff !important;
  color: #1a73e8 !important;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 200ms ease;
}

.report-link:hover {
  background: #d8ebf7 !important;
}

.pago-item {
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
  background: var(--panel);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
  transition: all 280ms cubic-bezier(0.4, 0, 0.2, 1);
}

.pago-item:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--blue);
}

.pago-header {
  flex: 1;
}

.pago-title {
  font-weight: 700;
  color: var(--ink);
  font-size: 0.95rem;
}

.pago-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: var(--spacing-sm);
}

.pago-amounts {
  display: flex;
  gap: var(--spacing-md);
  align-items: center;
}

.amount-badge {
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}

.amount-badge.discount {
  background: #ffe6e6;
  color: #8b0000;
}

.amount-badge.bonus {
  background: #e6ffe6;
  color: #0b5a0b;
}

.amount-badge.total {
  background: #ecffef;
  color: #066a06;
  font-weight: 700;
}

body.theme-dark .amount-badge.discount {
  background: rgba(239, 68, 68, 0.2);
  color: #fecaca;
}

body.theme-dark .amount-badge.bonus {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

body.theme-dark .amount-badge.total {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

/* Toast styling */

.tips-table {
  min-width: 700px;
  table-layout: fixed;
}

.tips-table th:not(:first-child),
.tips-table td:not(:first-child) {
  text-align: right;
}

.tips-table td:first-child {
  width: 170px;
}

.tips-table th:not(:first-child):not(:last-child),
.tips-table td:not(:first-child):not(:last-child) {
  width: 112px;
}

.tips-table input {
  text-align: right;
}

.tips-table td:first-child input {
  text-align: left;
}

.row-total {
  color: var(--blue);
  font-weight: 900;
  white-space: nowrap;
}

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

.history-item {
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--spacing-md);
  align-items: center;
  background: #fbfcff;
  box-shadow: var(--shadow-sm);
  transition: all 280ms cubic-bezier(0.4, 0, 0.2, 1);
}

.history-item:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--blue);
}

.history-item strong {
  display: block;
}

.history-item small {
  color: var(--muted);
}

.history-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

button.danger {
  color: #fff;
  background: var(--red);
  border-color: transparent;
}

.oath-panel {
  border-color: rgba(28, 5, 184, 0.28);
  background: #f8f7ff;
}

.oath-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--ink);
  font-size: 0.93rem;
  font-weight: 700;
  line-height: 1.45;
  text-transform: none;
}

.oath-check input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin-top: 2px;
}

.user-grid {
  margin-bottom: 14px;
}

.role-pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 9px;
  color: #fff;
  background: var(--blue);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.permissions-box {
  margin: var(--spacing-md) 0 var(--spacing-lg);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  background: linear-gradient(135deg, #f9fafc 0%, rgba(220, 233, 255, 0.1) 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--spacing-md);
  box-shadow: var(--shadow-sm);
}

.permissions-box strong {
  grid-column: 1 / -1;
  font-weight: 700;
  color: var(--ink);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.permissions-box label {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: none;
  color: var(--ink);
}

.permissions-box input {
  width: 18px !important;
  height: 18px !important;
  flex: 0 0 auto;
  margin: 0 !important;
  cursor: pointer;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(3px);
  animation: fadeIn 200ms ease;
}

.modal-overlay.hidden {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    backdrop-filter: blur(0px);
  }
  to {
    opacity: 1;
    backdrop-filter: blur(3px);
  }
}

.modal {
  max-width: 520px;
  width: calc(100vw - 48px);
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  background: var(--panel);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(28, 5, 184, 0.1);
  animation: slideUp 280ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal h2 {
  margin: 0 0 var(--spacing-lg);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--ink);
}

.modal p {
  margin: 0 0 var(--spacing-md);
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.drive-panel {
  max-width: 880px;
  margin-bottom: 16px;
}

.drive-panel p {
  color: var(--muted);
  margin-top: 0;
  margin-bottom: 12px;
}

.integration-grid {
  margin-bottom: 14px;
}

.script-box {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.script-box strong {
  display: block;
  padding: 12px 14px;
  background: var(--soft-blue);
}

/* Strong theme overrides to replace remaining hardcoded colors */
body, .app-root {
  background: var(--bg) !important;
  color: var(--ink) !important;
}
.topbar, .panel, .card, .auth-card, .session-chip, .history-item, .permissions-box, .tip-tools, .report-card {
  background: var(--panel) !important;
  color: var(--ink) !important;
  border-color: rgba(255,255,255,0.04) !important;
}
input, textarea, select {
  background: rgba(255,255,255,0.02) !important;
  color: var(--ink) !important;
  border-color: rgba(255,255,255,0.06) !important;
}
button {
  transition: all 280ms cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  padding: var(--spacing-sm) var(--spacing-lg);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

button.primary {
  background: var(--accent) !important;
  color: #fff !important;
  box-shadow: var(--shadow-md);
}

button.primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

button.ghost, .ghost {
  background: transparent !important;
  color: var(--accent) !important;
  border: 1px solid rgba(28, 5, 184, 0.15) !important;
}

button.ghost:hover:not(:disabled), .ghost:hover:not(:disabled) {
  background: rgba(28, 5, 184, 0.06) !important;
}
.metric, .tip-tools, .permissions-box { background: rgba(255,255,255,0.02) !important; }
a { color: var(--accent) !important; }

pre {
  margin: 0;
  padding: 14px;
  overflow: auto;
  color: #eff5ff;
  background: #111827;
}

.toast {
  position: fixed;
  right: var(--spacing-xl);
  bottom: var(--spacing-xl);
  max-width: min(420px, calc(100vw - var(--spacing-2xl)));
  border-radius: var(--radius-md);
  padding: var(--spacing-md) var(--spacing-lg);
  color: #fff;
  background: linear-gradient(135deg, var(--ink) 0%, rgba(20, 21, 31, 0.95) 100%);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(28, 5, 184, 0.15);
  transform: translateY(24px);
  opacity: 0;
  pointer-events: none;
  transition: all 280ms cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 600;
  font-size: 0.95rem;
  z-index: 200;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.toast.error {
  background: linear-gradient(135deg, var(--red) 0%, rgba(230, 29, 29, 0.95) 100%);
}

.toast.success {
  background: linear-gradient(135deg, var(--green) 0%, rgba(45, 125, 34, 0.95) 100%);
}

@media (max-width: 960px) {
  body {
    font-size: 15px;
  }

  .sidebar {
    width: min(88vw, 280px);
    padding: 18px 14px;
  }

  .brand {
    min-height: 64px;
    justify-content: start;
  }

  .brand img {
    width: 132px;
  }

  .topbar,
  .history-item {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .actions {
    justify-content: stretch;
    width: 100%;
  }

  .actions button {
    flex: 1 1 100%;
    width: 100%;
  }

  .field-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  main {
    padding: 74px 14px 16px;
  }

  .panel {
    padding: 12px;
  }

  .session-chip {
    width: 100%;
  }

  .session-chip .small-btn {
    flex: 1 1 160px;
  }

  .table-wrap {
    margin: 0 -2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 560px;
  }

  .tips-table {
    min-width: 600px;
  }

  .history-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 14px;
  }

  main {
    padding: 68px 10px 14px;
  }

  .menu-toggle {
    top: 12px;
    left: 12px;
  }

  h1 {
    font-size: clamp(1.45rem, 7vw, 1.75rem);
  }

  .auth-screen {
    padding: 12px;
  }

  .auth-card {
    width: 100%;
    max-width: 380px;
    padding: 14px;
    border-radius: 14px;
    box-shadow: none;
  }

  .section-title {
    gap: 8px;
  }

  .section-title > div {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .session-chip {
    gap: 8px;
    padding: 8px;
  }

  .session-chip .small-btn,
  .compact-actions button,
  .history-actions button,
  .section-title button,
  .primary,
  .secondary,
  .ghost {
    width: 100%;
  }

  .icon-btn {
    width: 36px;
    height: 36px;
  }

  .tip-tools {
    width: 100%;
    justify-content: space-between;
  }

  .tip-tools .small-btn {
    min-width: 42px;
    text-align: center;
  }

  .toast {
    right: 12px;
    left: 12px;
    bottom: 12px;
    max-width: none;
  }

  table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 8px;
  }

  table thead {
    display: none;
  }

  table tbody,
  table tr,
  table td {
    display: block;
    width: 100%;
  }

  table tr {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
  }

  table td {
    border: 0;
    border-bottom: 1px solid #eef2f7;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    text-align: left;
  }

  table td:last-child {
    border-bottom: 0;
  }

  table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0;
    flex: 0 0 44%;
  }

  table td input {
    width: 56%;
    text-align: right;
    padding: 8px;
  }

  .tips-table td:first-child input,
  table td:first-child input {
    text-align: left;
  }

  .row-total {
    justify-content: space-between;
  }

  .topbar-title .eyebrow {
    display: block;
  }

  .mobile-status {
    margin-top: 4px;
  }
}

/* Ajuste final mobile pro */
@media (max-width: 640px) {
  .sidebar {
    width: 84vw;
    max-width: 300px;
    padding: 12px 10px 18px;
  }

  .brand {
    min-height: 52px;
  }

  .brand img {
    width: 122px;
  }

  nav {
    gap: 6px;
  }

  .nav-item {
    padding: 11px 10px;
    font-size: 0.95rem;
    border-radius: 10px;
  }

  .topbar {
    padding: 10px;
    border-radius: 12px;
  }

  .topbar-title .eyebrow {
    font-size: 0.7rem;
  }

  h1 {
    font-size: 1.38rem;
    line-height: 1.12;
  }

  .session-chip {
    border-radius: 10px;
    padding: 8px;
  }

  .session-chip small {
    font-size: 0.66rem;
  }

  .session-chip strong {
    font-size: 0.95rem;
  }

  .panel {
    padding: 10px;
    border-radius: 12px;
  }

  .section-title h2 {
    font-size: 1rem;
  }

  label {
    font-size: 0.76rem;
  }

  .metric strong {
    font-size: 1.15rem;
  }

  .history-item {
    padding: 10px;
    border-radius: 10px;
    gap: 8px;
  }

  .history-item strong {
    font-size: 1rem;
  }

  .history-item small {
    font-size: 0.78rem;
    line-height: 1.3;
  }
}

/* Final override: force blue header in light (placed at EOF to win over earlier !important rules) */
body:not(.theme-dark):not(.theme-dark-blue) .topbar {
  background: linear-gradient(180deg, #1c05b8 0%, #2252d4 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 16px 30px rgba(28, 5, 184, 0.22) !important;
}

body:not(.theme-dark):not(.theme-dark-blue) .topbar * {
  color: #ffffff !important;
}

body:not(.theme-dark):not(.theme-dark-blue) .topbar .session-chip {
  background: rgba(255,255,255,0.06) !important;
  border-color: rgba(255,255,255,0.12) !important;
  color: #ffffff !important;
}

/* Mobile app shell definitivo */
@media (max-width: 768px) {
  .menu-toggle,
  .menu-backdrop {
    display: none !important;
  }

  body {
    background: #eef2f8;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .sidebar {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    height: 74px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    border-right: 0;
    border-top: 1px solid #d7dfed;
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.12);
    transform: none !important;
    background: #ffffff;
    z-index: 120;
    display: block;
  }

  .sidebar .brand {
    display: none;
  }

  .sidebar nav {
    height: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .sidebar .nav-item {
    text-align: center;
    border-radius: 10px;
    padding: 8px 4px;
    font-size: 0.72rem;
    font-weight: 800;
    color: #5a6781;
    border: 1px solid transparent;
    background: transparent;
    line-height: 1.2;
  }

  .sidebar .nav-item.active {
    color: #ffffff;
    background: #1c05b8;
    border-color: #1c05b8;
  }

  main {
    padding: 10px 10px calc(96px + env(safe-area-inset-bottom));
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .topbar {
    padding: 12px;
    gap: 10px;
    border-radius: 14px;
  }

  h1 {
    font-size: 1.32rem;
    line-height: 1.15;
  }

  .actions,
  .session-chip,
  .field-grid,
  .metric-grid {
    grid-template-columns: 1fr !important;
  }

  .actions button,
  .session-chip .small-btn,
  .primary,
  .ghost,
  .secondary {
    width: 100%;
  }

  .panel {
    border-radius: 14px;
    padding: 11px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  }

  .auth-screen {
    padding: 0 18px 18px;
    background: #f7f9fd;
    width: 100vw;
    height: 100dvh;
    overflow: hidden;
  }

  .auth-card {
    width: calc(100vw - 32px);
    max-width: 420px;
    border-radius: 0;
    padding: 54px 4px 12px;
    box-shadow: none;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  .auth-card input {
    background: #ffffff;
  }

  .table-wrap,
  .panel,
  .topbar,
  .view,
  .layout {
    max-width: 100%;
    overflow-x: hidden;
  }

  table,
  .tips-table {
    min-width: 0;
    max-width: 100%;
  }
}

/* Ally mobile app header */
@media (max-width: 768px) {
  main {
    padding-top: 0;
  }

  .topbar {
    margin: 0 -10px 12px;
    padding: 16px 14px 14px;
    border: 0;
    border-radius: 0 0 22px 22px;
    background: linear-gradient(180deg, #1c05b8 0%, #2252d4 100%);
    color: #ffffff;
    box-shadow: 0 16px 30px rgba(28, 5, 184, 0.22);
    align-items: center;
    text-align: center;
  }

  .topbar-title {
    padding: 6px 0 2px;
    text-align: center;
  }

  .topbar-title .eyebrow,
  .mobile-status {
    color: rgba(255, 255, 255, 0.78);
  }

  .topbar h1 {
    color: #ffffff;
    font-size: 2rem;
    line-height: 1;
    margin: 2px 0 0;
  }

  .session-chip {
    justify-content: center;
    width: 100%;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.24);
    color: #ffffff;
  }

  .session-chip small {
    color: rgba(255, 255, 255, 0.72);
  }

  .session-chip .ghost,
  .topbar .ghost {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.9);
  }

  .topbar .secondary {
    color: #ffffff;
    background: #111827;
  }

  .topbar .actions {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  .topbar .install-mini {
    width: auto;
    min-height: 36px;
    padding: 8px 11px;
    border-radius: 999px;
    font-size: 0.82rem;
  }

  .topbar #clearBtn {
    min-height: 36px;
    border-radius: 999px;
    font-size: 0.88rem;
  }

  .summary-panel {
    margin-top: 2px;
  }

  .summary-panel .section-title h2 {
    font-size: 1.14rem;
  }
}

/* Mobile header centering override */
@media (max-width: 768px) {
  .topbar {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto 12px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .topbar-title {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
  }

  .topbar-title .eyebrow,
  .topbar-title h1,
  .mobile-status {
    width: 100%;
    max-width: 100%;
    text-align: center !important;
  }

  .session-chip,
  .topbar .actions {
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    max-width: 420px;
  }

  .sidebar nav {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 6px !important;
  }

  .sidebar .nav-item {
    flex: 1 1 0 !important;
    max-width: 120px;
    min-width: 0;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
  }
}


/* Theme-safe metric emphasis */
.metric.total,
.metric.metric-income {
  color: #ffffff !important;
}

.metric.total small,
.metric.total strong,
.metric.metric-income small,
.metric.metric-income strong {
  color: #ffffff !important;
}

.metric.metric-income {
  background: linear-gradient(135deg, #16703a 0%, #0f5b2d 100%) !important;
  border-color: #22a05a !important;
  box-shadow: 0 8px 20px rgba(15, 91, 45, 0.24) !important;
}

body:not(.theme-dark):not(.theme-dark-blue) .metric.metric-income {
  background: linear-gradient(135deg, #15803d 0%, #166534 100%) !important;
}

/* Professional login refresh */
.auth-screen {
  grid-template-rows: 150px 1fr;
  align-items: start;
  justify-items: center;
  padding: 0 18px 28px;
  background: linear-gradient(180deg, #dcecff 0%, #f6f9ff 58%, #ffffff 100%) !important;
  overflow-y: auto;
}

.auth-top {
  width: 100%;
  height: 150px;
  margin: 0;
  border-radius: 0 0 26px 26px;
  background: linear-gradient(120deg, #1c05b8 0%, #2252d4 100%) !important;
  box-shadow: 0 18px 40px rgba(28, 5, 184, 0.22);
}

.auth-logo-tile {
  left: 50%;
  bottom: -42px;
  width: 92px;
  height: 92px;
  transform: translateX(-50%);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.20), 0 0 0 1px rgba(28, 5, 184, 0.08);
}

.auth-logo-tile img {
  width: 72px;
}

.auth-logo-combo {
  width: 180px;
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.auth-logo-combo img:first-child {
  width: 64px;
  flex: 0 0 auto;
}

.auth-logo-combo img:last-child {
  width: 78px;
  max-height: 34px;
  object-fit: contain;
  flex: 0 0 auto;
}

.auth-logo-combo span {
  width: 1px;
  height: 44px;
  background: #d9e2f0;
  flex: 0 0 auto;
}

.auth-card {
  width: min(430px, calc(100vw - 36px));
  margin-top: -8px;
  border: 1px solid rgba(30, 64, 175, 0.14) !important;
  border-radius: 18px !important;
  padding: 66px 30px 30px !important;
  background: rgba(255, 255, 255, 0.94) !important;
  box-shadow: 0 22px 45px rgba(15, 23, 42, 0.14), 0 1px 0 rgba(255, 255, 255, 0.9) inset !important;
}

.auth-card h2 {
  text-align: center;
  color: #0f2f62 !important;
  font-size: 1.72rem;
  letter-spacing: 0;
}

.auth-card p {
  text-align: center;
  color: #52637a !important;
  margin-bottom: 24px;
}

.auth-card label {
  color: #1f3d63 !important;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 14px;
}

.auth-card input {
  margin-top: 7px;
  min-height: 50px;
  border: 1px solid #c8d6ea !important;
  border-radius: 12px;
  background: #ffffff !important;
  color: #0f172a !important;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03) inset;
}

.auth-card input:focus {
  border-color: #2252d4 !important;
  box-shadow: 0 0 0 4px rgba(34, 82, 212, 0.13) !important;
}

.auth-submit {
  margin-top: 22px !important;
  border-radius: 12px !important;
  background: linear-gradient(120deg, #1c05b8 0%, #2252d4 100%) !important;
  box-shadow: 0 12px 22px rgba(28, 5, 184, 0.24) !important;
}

@media (max-width: 720px) {
  .auth-screen {
    grid-template-rows: 132px 1fr;
    padding: 0 16px 24px !important;
    overflow-y: auto !important;
  }

  .auth-top {
    height: 132px;
    border-radius: 0 0 24px 24px;
  }

  .auth-logo-tile {
    width: 156px;
    height: 82px;
    bottom: -38px;
  }

  .auth-logo-tile img {
    width: 64px;
  }

  .auth-logo-combo img:first-child {
    width: 56px;
  }

  .auth-logo-combo img:last-child {
    width: 68px;
  }

  .auth-card {
    width: 100% !important;
    max-width: 420px !important;
    margin-top: -2px !important;
    padding: 62px 22px 24px !important;
    border-radius: 18px !important;
  }
}


/* Theme-safe declared total card */
.metric.metric-declared {
  background: linear-gradient(135deg, #1d4ed8 0%, #312e81 100%) !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.22) !important;
}

.metric.metric-declared small,
.metric.metric-declared strong {
  color: #ffffff !important;
  opacity: 1 !important;
}

body.theme-light .metric.metric-declared,
body:not(.theme-dark):not(.theme-dark-blue) .metric.metric-declared {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  border-color: #2563eb !important;
}

body.theme-dark .metric.metric-declared,
body.theme-dark-blue .metric.metric-declared {
  background: linear-gradient(135deg, #4338ca 0%, #2563eb 100%) !important;
  border-color: #60a5fa !important;
}

/* Tenant logo: transparent lockup on the blue sidebar, no tile/background. */
.sidebar .brand .client-brand-logo,
.brand .client-brand-logo {
  display: block;
  width: min(180px, 82%);
  max-width: 180px;
  height: auto;
  max-height: 120px;
  margin: 24px auto 0;
  padding: 0;
  object-fit: contain;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: 0 !important;
}
