* {
  box-sizing: border-box;
}

:root {
  --bg: #eef3fb;
  --bg-2: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --soft: #f8fafc;
  --brand: #0f172a;
  --brand-2: #2563eb;
  --brand-3: #0ea5e9;
  --green: #16a34a;
  --red: #dc2626;
  --orange: #ea580c;
  --sidebar-width: 248px;
  --sidebar-collapsed: 74px;
  --radius: 22px;
  --shadow: 0 18px 45px rgba(15, 23, 42, .08);
  --shadow-soft: 0 10px 24px rgba(15, 23, 42, .055);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 8%, rgba(37, 99, 235, .12), transparent 30%),
    radial-gradient(circle at 90% 10%, rgba(14, 165, 233, .10), transparent 32%),
    linear-gradient(180deg, #f7faff 0%, var(--bg) 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.panel-open {
  overflow: hidden;
}

body.panel-open .floating-panel-shell {
  pointer-events: auto;
}

button,
input,
select {
  font-family: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, .985) 0%, rgba(17, 24, 39, .995) 65%, #020617 100%);
  color: #fff;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  z-index: 40;
  transition: width .22s ease, transform .22s ease;
  box-shadow: 12px 0 32px rgba(15, 23, 42, .18);
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 8%, rgba(37, 99, 235, .28), transparent 30%),
    radial-gradient(circle at 85% 35%, rgba(14, 165, 233, .16), transparent 32%);
  pointer-events: none;
}

.sidebar > * {
  position: relative;
  z-index: 1;
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  padding: 2px 4px 8px;
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 950;
  letter-spacing: .08em;
  background: linear-gradient(135deg, var(--brand-2), var(--brand-3));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.24), 0 14px 28px rgba(37,99,235,.25);
  flex-shrink: 0;
}

.brand-text {
  min-width: 0;
}

.brand h1 {
  margin: 0;
  font-size: 16px;
  line-height: 1;
  letter-spacing: -.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand h1 span {
  display: block;
  margin-top: 2px;
  color: #bfdbfe;
  text-transform: lowercase;
  font-weight: 600;
  letter-spacing: -.02em;
}

.brand p {
  margin: 4px 0 0;
  font-size: 11px;
  color: rgba(255,255,255,.68);
}

.sidebar-close,
.sidebar-toggle {
  border: 0;
  background: rgba(255,255,255,.08);
  color: #fff;
  cursor: pointer;
}

.sidebar-close {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: none;
  font-size: 24px;
  line-height: 1;
}

.sidebar-scroll {
  overflow: auto;
  padding-right: 2px;
  scrollbar-width: thin;
  padding-top: 2px;
}

.menu-section {
  margin-bottom: 14px;
}

.menu-label {
  display: block;
  margin: 0 0 8px;
  padding: 0 8px;
  font-size: 9px;
  font-weight: 900;
  color: rgba(255,255,255,.48);
  letter-spacing: .11em;
  text-transform: uppercase;
}

.menu {
  display: grid;
  gap: 6px;
}

.nav-group {
  display: grid;
  gap: 6px;
}


.submenu-caret {
  width: 20px;
  height: 20px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.075);
  color: rgba(255,255,255,.72);
  font-size: 13px;
  transition: transform .18s ease, background .18s ease;
}

.nav-with-submenu[aria-expanded="true"] .submenu-caret {
  transform: rotate(180deg);
  background: rgba(96,165,250,.18);
}

.operation-submenu {
  display: none;
  gap: 6px;
  margin-left: 14px;
  padding: 2px 0 4px 10px;
  border-left: 1px solid rgba(148,163,184,.18);
}

.operation-submenu.open {
  display: grid;
}

.nav,
.op-nav {
  width: 100%;
  border: 1px solid transparent;
  background: rgba(255,255,255,.055);
  color: rgba(255,255,255,.92);
  border-radius: 15px;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
  text-align: left;
}

.nav {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 9px;
  min-height: 54px;
}

.nav.nav-with-submenu {
  grid-template-columns: 36px minmax(0, 1fr) 20px;
}

.nav-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.075);
  font-weight: 900;
  font-size: 15px;
}

.nav-text-wrap {
  min-width: 0;
}

.nav-text {
  display: block;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.15;
}

.nav em,
.op-nav em {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.35;
  font-style: normal;
  color: rgba(255,255,255,.56);
}

.nav:hover,
.op-nav:hover,
.nav.active,
.op-nav.active {
  transform: translateX(1px);
  background: rgba(37, 99, 235, .20);
  border-color: rgba(96, 165, 250, .30);
}

.nav.active .nav-icon {
  background: linear-gradient(135deg, rgba(37,99,235,.96), rgba(14,165,233,.96));
  box-shadow: 0 10px 24px rgba(37,99,235,.22);
}

.op-nav {
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,.038);
}

.op-nav-title {
  display: block;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.15;
}


.nav-text-wrap,
.op-nav {
  min-width: 0;
}

.nav em {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.op-nav em {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sidebar-scroll::-webkit-scrollbar {
  width: 6px;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(148,163,184,.24);
  border-radius: 999px;
}

.side-card {
  margin-top: 6px;
  background: rgba(255,255,255,.075);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 20px;
  padding: 14px;
  font-size: 13px;
  line-height: 1.7;
  color: rgba(255,255,255,.88);
}

.side-card b {
  color: #dbeafe;
}

.side-card small {
  display: block;
  margin-bottom: 6px;
  color: rgba(255,255,255,.56);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 900;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .42);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
  z-index: 35;
}

.main-content {
  margin-left: var(--sidebar-width);
  padding: 20px;
  transition: margin-left .22s ease;
}

.topbar {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 13px 16px;
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(226,232,240,.9);
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
  position: static;
  top: auto;
  z-index: auto;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.sidebar-toggle {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  padding: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #111827, #334155);
  box-shadow: 0 10px 22px rgba(15,23,42,.16);
}

.sidebar-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  background: #fff;
  border-radius: 999px;
  margin: 2px 0;
}

.topbar-title {
  font-size: 18px;
  font-weight: 950;
  letter-spacing: -.035em;
}

.topbar-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.topbar-chip,
.record-count {
  padding: 9px 13px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}


.home-view {
  display: grid;
  gap: 18px;
}

.home-stats {
  margin-top: 0;
}

.hero-banner {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 20px;
  padding: 24px;
  border-radius: 30px;
  background:
    radial-gradient(circle at 8% 20%, rgba(59,130,246,.30), transparent 25%),
    radial-gradient(circle at 90% 20%, rgba(14,165,233,.25), transparent 30%),
    linear-gradient(135deg, #0f172a 0%, #172554 54%, #0c4a6e 100%);
  color: #fff;
  box-shadow: 0 24px 55px rgba(15, 23, 42, .20);
  overflow: hidden;
  position: relative;
}

.hero-banner::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -74px;
  bottom: -90px;
  border-radius: 999px;
  background: rgba(255,255,255,.10);
}

.hero-copy,
.hero-metrics {
  position: relative;
  z-index: 1;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  color: #bfdbfe;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.hero-copy h2 {
  margin: 14px 0 8px;
  max-width: 720px;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.02;
  letter-spacing: -.06em;
}

.hero-copy p {
  margin: 0;
  max-width: 660px;
  color: rgba(255,255,255,.76);
  font-size: 14px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-btn {
  border: 0;
  border-radius: 15px;
  padding: 12px 15px;
  background: #fff;
  color: #0f172a;
  font-size: 13px;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 16px 34px rgba(15,23,42,.20);
}

.hero-btn.ghost {
  background: rgba(255,255,255,.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: none;
}

.hero-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.hero-metric {
  min-height: 96px;
  padding: 16px;
  border-radius: 22px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(10px);
}

.hero-metric span {
  display: block;
  color: rgba(255,255,255,.64);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.hero-metric strong {
  display: block;
  margin-top: 10px;
  color: #fff;
  font-size: clamp(18px, 2.2vw, 25px);
  line-height: 1.15;
  letter-spacing: -.045em;
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: fadeUp .2s ease both;
}

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

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 16px;
}

.page-head h2 {
  margin: 0 0 6px;
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: -.05em;
}

.page-head p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.cards {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.stats-compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(226,232,240,.95);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
}

.stat {
  min-height: 108px;
  display: flex;
  align-items: flex-start;
  gap: 13px;
  overflow: hidden;
  position: relative;
}

.stat::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -34px;
  width: 92px;
  height: 92px;
  border-radius: 999px;
  background: rgba(37,99,235,.06);
}

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 950;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}

.stat-bob .stat-icon { background: #ecfeff; color: #0891b2; }
.stat-profit .stat-icon { background: #ecfdf5; color: #15803d; }
.stat-status .stat-icon { background: #eef2ff; color: #4f46e5; }
.stat-withdraw .stat-icon { background: #fff7ed; color: #ea580c; }

.card small,
.section-title small,
.hint,
.muted,
.final-preview-line,
.operation-heading p,
.row-note {
  color: var(--muted);
}

.card small,
label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .075em;
  font-weight: 900;
}

.card h3 {
  margin: 9px 0 0;
  font-size: clamp(20px, 2.2vw, 25px);
  line-height: 1.15;
  letter-spacing: -.05em;
}

.grid {
  display: grid;
  gap: 16px;
  align-items: start;
}

.panel-grid,
.cash-grid {
  grid-template-columns: 400px minmax(0, 1fr);
}

.panel-grid-clean {
  grid-template-columns: 1fr;
}

.records-card-wide {
  min-height: 520px;
  padding: 20px;
}

.floating-op-button {
  position: fixed;
  right: 30px;
  bottom: 30px;
  width: 68px;
  height: 68px;
  border: 0;
  border-radius: 999px;
  display: none;
  place-items: center;
  background: linear-gradient(135deg, var(--brand-2), var(--brand-3));
  color: #fff;
  font-size: 38px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 20px 40px rgba(37,99,235,.30);
  z-index: 70;
}

.floating-op-button.show {
  display: grid;
}

.floating-op-button:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 24px 44px rgba(37,99,235,.36);
}


.floating-panel[hidden],
.floating-panel-overlay[hidden] {
  display: none !important;
}

.floating-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.48);
  backdrop-filter: blur(5px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
  z-index: 200;
}

.floating-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(1240px, calc(100vw - 48px));
  max-height: none;
  transform: translate(-50%, -46%) scale(.96);
  opacity: 0;
  transition: transform .22s ease, opacity .18s ease;
  z-index: 220;
}

.floating-panel.open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.floating-panel-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.floating-panel-shell {
  max-height: none;
  overflow: visible;
  padding: 18px;
  border-radius: 28px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid rgba(226,232,240,.92);
  box-shadow: 0 30px 70px rgba(15,23,42,.24);
}

.floating-panel-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.floating-panel-top p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.floating-panel-close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #e2e8f0;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  flex-shrink: 0;
}


.floating-panel #opForm {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(310px, .9fr) minmax(260px, .72fr);
  gap: 12px;
  align-items: stretch;
}

.floating-panel #normalFields,
.floating-panel #specialFields {
  grid-column: 1;
  grid-row: 1 / span 3;
}

.floating-panel #opForm > .form-block {
  grid-column: 2;
  grid-row: 1;
}

.floating-panel #opForm > .final-preview {
  grid-column: 2;
  grid-row: 2 / span 2;
  min-height: auto;
}

.floating-panel #opForm > .more-options {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: stretch;
}

.floating-panel #opForm > .primary {
  grid-column: 3;
  grid-row: 3;
  justify-self: stretch;
  width: 100%;
  min-width: 0;
  align-self: end;
}

.floating-panel #normalFields,
.floating-panel #specialFields {
  display: grid;
  gap: 10px;
  align-content: start;
}

.floating-panel input,
.floating-panel select {
  min-height: 44px;
}

.floating-panel .result,
.floating-panel .final-preview,
.floating-panel .more-options {
  padding: 12px;
}

.floating-panel .receipt-upload-tile {
  min-height: 64px;
}

.floating-panel #specialFields.hide,
.floating-panel #normalFields.hide {
  display: none !important;
}

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

.section-title h2,
.section-title h3,
.operation-heading h3 {
  margin: 0 0 4px;
  letter-spacing: -.04em;
}

.operation-heading {
  margin-bottom: 14px;
}

.operation-badge,
.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 7px 10px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .055em;
}

.operation-badge {
  margin-bottom: 10px;
}

.form-card form {
  display: grid;
  gap: 12px;
}

label {
  display: block;
  margin: 0 0 6px;
  color: var(--muted);
}

input,
select {
  width: 100%;
  min-height: 46px;
  padding: 12px 13px;
  border: 1px solid #d7dee8;
  background: #fbfdff;
  border-radius: 15px;
  font-size: 14px;
  font-weight: 750;
  color: var(--text);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

input:focus,
select:focus {
  border-color: var(--brand-2);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

.form-row {
  display: grid;
  gap: 12px;
}

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

.primary,
.page-head button,
.receipt-mini button,
.danger {
  border: 0;
  border-radius: 15px;
  padding: 12px 15px;
  font-size: 13px;
  font-weight: 950;
  cursor: pointer;
  transition: transform .16s ease, filter .16s ease, background .16s ease;
}

.primary,
.page-head button,
.receipt-mini button {
  background: linear-gradient(135deg, #111827, #1f2937);
  color: #fff;
}

.primary:hover,
.page-head button:hover,
.receipt-mini button:hover,
.hero-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.primary.full {
  width: 100%;
}

.danger {
  background: #fef2f2;
  color: var(--red);
  padding: 10px 12px;
}

.danger:hover {
  background: #fee2e2;
}

.result {
  background: #eff6ff;
  color: #1e40af;
  padding: 13px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 17px;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.5;
}

.result.ready {
  background: #ecfdf5;
  border-color: #86efac;
  color: #065f46;
}

.final-preview {
  padding: 14px;
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 17px;
}

.final-preview.ready {
  background: #ecfdf5;
  border-color: #bbf7d0;
}

.final-preview-title {
  font-weight: 950;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 8px;
}

.final-preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.final-preview-grid div {
  background: rgba(255,255,255,.84);
  border: 1px solid rgba(148,163,184,.24);
  border-radius: 13px;
  padding: 10px;
}

.final-preview-grid small {
  display: block;
  margin-bottom: 4px;
  color: #64748b;
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
}

.final-preview-grid b {
  display: block;
  font-size: 14px;
  line-height: 1.25;
  color: #065f46;
}

.more-options {
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fbfdff;
  padding: 0 14px 14px;
}

.more-options summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 0;
  font-size: 13px;
  font-weight: 950;
  color: var(--text);
}

.more-options summary::-webkit-details-marker {
  display: none;
}

.more-options[open] summary {
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}

.receipts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.receipt-upload-tile {
  position: relative;
  min-height: 78px;
  border-radius: 20px;
  border: 1px dashed #94a3b8;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
  overflow: hidden;
}

.receipt-upload-tile:hover {
  transform: translateY(-1px);
  border-color: #60a5fa;
  box-shadow: 0 10px 24px rgba(37,99,235,.08);
}

.receipt-upload-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.receipt-upload-icon {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #eff6ff;
  font-size: 18px;
  flex-shrink: 0;
}

.receipt-upload-currency {
  font-size: 22px;
  font-weight: 950;
  letter-spacing: -.03em;
  color: var(--text);
}

.receipt-upload-check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #16a34a;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  opacity: 0;
  transform: scale(.8);
  transition: opacity .16s ease, transform .16s ease;
}

.receipt-upload-tile.has-file {
  border-style: solid;
  border-color: #16a34a;
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
  box-shadow: 0 10px 26px rgba(22,163,74,.08);
}

.receipt-upload-tile.has-file .receipt-upload-check {
  opacity: 1;
  transform: scale(1);
}

.receipt-upload-tile.currency-brl .receipt-upload-currency {
  color: #166534;
}

.receipt-upload-tile.currency-bob .receipt-upload-currency {
  color: #1d4ed8;
}

.fileinput,
.receipt-mini input[type="file"] {
  background: #fff;
  border: 1px dashed #94a3b8;
  font-size: 12px;
}

.hint {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.35;
  text-transform: none;
  font-weight: 650;
}

.records-card {
  min-width: 0;
}

.record-list {
  display: grid;
  gap: 16px;
}

.record-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(226,232,240,.9);
  border-radius: 22px;
  background: linear-gradient(180deg, #fff 0%, #fbfdff 100%);
  box-shadow: 0 10px 24px rgba(15,23,42,.05);
}

.record-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.record-date {
  display: block;
  margin-top: 7px;
  font-size: 12px;
  font-weight: 850;
  color: #334155;
}

.record-details {
  display: grid;
  gap: 8px;
}

.record-note {
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 13px;
  background: #f8fafc;
  border: 1px solid #edf2f7;
  font-size: 12px;
  font-weight: 750;
  color: #475569;
}

.record-side {
  display: grid;
  gap: 12px;
  align-content: start;
  padding-left: 16px;
  border-left: 1px solid #edf2f7;
}

.record-label {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 950;
}

.profit-chip,
.cash-chip {
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #15803d;
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.cash-chip {
  background: #eff6ff;
  color: #1d4ed8;
}

.op-main {
  font-weight: 850;
  color: var(--text);
  line-height: 1.45;
}

.op-send {
  margin-top: 8px;
  padding: 10px 11px;
  border-radius: 14px;
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
}

.op-send small {
  display: block;
  color: #047857;
  margin-bottom: 3px;
}

.op-send strong {
  display: block;
  font-size: 16px;
  color: #065f46;
}

.calc-preview-title {
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #047857;
  margin-bottom: 4px;
}

.calc-preview-main {
  font-size: 18px;
  line-height: 1.3;
  color: #0f172a;
}

.calc-preview-main strong {
  color: #065f46;
  font-size: 20px;
}

.calc-preview-muted {
  margin-top: 5px;
  font-size: 12px;
  color: #64748b;
  font-weight: 850;
}

.receipt-links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.receipt-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0;
  padding: 8px 12px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
  font-weight: 950;
}

.receipt-link:hover {
  transform: translateY(-1px);
}

.receipt-link-icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #eff6ff;
  font-size: 14px;
}

.receipt-link-brl {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.receipt-link-bob {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.receipt-box {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.receipt-status {
  min-height: 28px;
}

.receipt-mini {
  display: grid;
  gap: 8px;
}

.receipt-mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.receipt-mini-tile {
  position: relative;
  min-height: 62px;
  border-radius: 16px;
  border: 1px dashed #94a3b8;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  overflow: hidden;
}

.receipt-mini-tile:hover {
  border-color: #60a5fa;
}

.receipt-mini-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.receipt-mini-icon {
  width: 30px;
  height: 30px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: #eff6ff;
  font-size: 15px;
}

.receipt-mini-currency {
  font-size: 18px;
  font-weight: 950;
  letter-spacing: -.03em;
}

.receipt-mini-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #16a34a;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  opacity: 0;
  transform: scale(.8);
  transition: opacity .16s ease, transform .16s ease;
}

.receipt-mini-tile.has-file {
  border-style: solid;
  border-color: #16a34a;
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
}

.receipt-mini-tile.has-file .receipt-mini-check {
  opacity: 1;
  transform: scale(1);
}

.receipt-mini-tile.currency-brl .receipt-mini-currency {
  color: #166534;
}

.receipt-mini-tile.currency-bob .receipt-mini-currency {
  color: #1d4ed8;
}

.receipt-mini button {
  min-height: 42px;
  padding: 10px 12px;
  font-size: 12px;
  border-radius: 12px;
  background: #0f172a;
  color: #fff;
  border: 0;
}


.page-head p {
  max-width: 780px;
}

.records-card .table-title {
  align-items: center;
  margin-bottom: 18px;
}

.transaction-record .record-main {
  min-width: 0;
}

.transaction-record .record-note {
  margin-top: 12px;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 26px;
  border: 1px dashed #cbd5e1;
  border-radius: 18px;
  background: #f8fafc;
  font-weight: 750;
}

.hide {
  display: none !important;
}

.report-block {
  margin-bottom: 16px;
}

.narrow {
  max-width: 780px;
}


/* Configurações profissionais */
.config-page-head {
  margin-bottom: 16px;
}

.config-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #15803d;
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.config-status-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

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

.config-kpi-card {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  min-height: 138px;
}

.config-kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: linear-gradient(135deg, #eff6ff, #e0f2fe);
  color: #1d4ed8;
  font-weight: 950;
}

.config-kpi-card h3 {
  margin: 6px 0 6px;
  font-size: clamp(20px, 2vw, 26px);
}

.config-kpi-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 700;
}

.config-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, .75fr);
  gap: 16px;
  align-items: start;
}

.config-form-card {
  padding: 22px;
}

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

.config-form-section {
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.config-form-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.config-form-title span {
  font-size: 15px;
  font-weight: 950;
  color: var(--text);
}

.config-form-title small {
  max-width: 330px;
  color: var(--muted);
  text-align: right;
  line-height: 1.35;
  font-weight: 700;
}


.profit-rate-section {
  border-color: #bbf7d0;
  background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
}

.config-lock-info {
  min-height: 96px;
  padding: 14px;
  border-radius: 16px;
  background: #0f172a;
  color: #fff;
  display: grid;
  align-content: center;
  gap: 6px;
}

.config-lock-info span {
  font-size: 13px;
  font-weight: 950;
}

.config-lock-info p {
  margin: 0;
  color: rgba(255,255,255,.72);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 700;
}

.config-preview-box {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid #bfdbfe;
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
}

.config-preview-title {
  margin-bottom: 10px;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
}

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

.config-preview-grid > div {
  padding: 13px;
  border-radius: 16px;
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(191,219,254,.7);
}

.config-preview-grid small {
  display: block;
  margin-bottom: 5px;
  color: #64748b;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.config-preview-grid strong {
  color: #0f172a;
  font-size: 14px;
  line-height: 1.35;
}

.config-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.config-actions button {
  min-width: 210px;
}

.config-actions span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.config-side-column {
  display: grid;
  gap: 16px;
}

.config-guide-card {
  padding: 18px;
}

.config-guide-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.config-guide-head > span {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: #f1f5f9;
  color: #1d4ed8;
  font-weight: 950;
}

.config-guide-head h3 {
  margin: 0 0 4px;
  font-size: 17px;
  letter-spacing: -.03em;
}

.config-guide-head small {
  color: var(--muted);
  font-weight: 700;
}

.config-guide-card ul {
  margin: 0;
  padding-left: 18px;
  color: #475569;
  line-height: 1.65;
  font-size: 13px;
  font-weight: 700;
}

.config-guide-card li + li {
  margin-top: 8px;
}

.check-list {
  list-style: none;
  padding-left: 0 !important;
}

.check-list li {
  position: relative;
  padding-left: 24px;
}

.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  width: 17px;
  height: 17px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #dcfce7;
  color: #15803d;
  font-size: 11px;
  font-weight: 950;
}

.movement-opening {
  background: #eef2ff;
  color: #3730a3;
}

.movement-withdrawal {
  background: #fff7ed;
  color: var(--orange);
}

.movement-reinforcement {
  background: #ecfdf5;
  color: #047857;
}

.tablewrap {
  overflow: auto;
}

table {
  width: 100%;
  min-width: 790px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #94a3b8;
  text-align: left;
  background: #f8fafc;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid #edf2f7;
  vertical-align: top;
}

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

.profit {
  color: #15803d;
  font-weight: 950;
  white-space: nowrap;
}

#toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  background: #111827;
  color: white;
  padding: 14px 18px;
  border-radius: 15px;
  display: none;
  box-shadow: 0 16px 34px rgba(15, 23, 42, .24);
  max-width: min(420px, calc(100vw - 28px));
}

.app-shell.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed);
}

.app-shell.sidebar-collapsed .main-content {
  margin-left: var(--sidebar-collapsed);
}

.app-shell.sidebar-collapsed .brand-text,
.app-shell.sidebar-collapsed .menu-label,
.app-shell.sidebar-collapsed .nav-text-wrap,
.app-shell.sidebar-collapsed .operation-submenu,
.app-shell.sidebar-collapsed .submenu-caret {
  display: none;
}

.app-shell.sidebar-collapsed .menu {
  gap: 8px;
}

.app-shell.sidebar-collapsed .nav,
.app-shell.sidebar-collapsed .nav-with-submenu {
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 8px;
  min-height: auto;
}

.app-shell.sidebar-collapsed .nav-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.app-shell.sidebar-collapsed .sidebar-top {
  justify-content: center;
}

.app-shell.sidebar-collapsed .brand {
  justify-content: center;
}

.app-shell.sidebar-collapsed .sidebar-scroll {
  overflow: visible;
}


@media (min-width: 761px) and (max-width: 1180px) {
  .floating-panel {
    width: min(980px, calc(100vw - 36px));
  }

  .floating-panel #opForm {
    grid-template-columns: minmax(320px, 1fr) minmax(300px, .9fr);
  }

  .floating-panel #normalFields,
  .floating-panel #specialFields {
    grid-column: 1;
    grid-row: 1 / span 3;
  }

  .floating-panel #opForm > .form-block,
  .floating-panel #opForm > .final-preview,
  .floating-panel #opForm > .more-options {
    grid-column: 2;
    grid-row: auto;
  }

  .floating-panel #opForm > .primary {
    grid-column: 1 / -1;
    grid-row: auto;
  }
}

@media (max-width: 1280px) {
  .hero-banner {
    grid-template-columns: 1fr;
  }

  .panel-grid,
  .cash-grid {
    grid-template-columns: 1fr;
  }

  .record-card {
    grid-template-columns: minmax(0, 1fr) 280px;
  }
}

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

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

  .record-card {
    grid-template-columns: 1fr;
  }

  .record-side {
    padding-left: 0;
    border-left: 0;
    padding-top: 12px;
    border-top: 1px solid #edf2f7;
  }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    width: min(84vw, 280px);
    padding: 14px 10px;
  }

  .main-content,
  .app-shell.sidebar-collapsed .main-content {
    margin-left: 0;
  }

  .app-shell.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .app-shell.sidebar-open .sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar-close {
    display: inline-grid;
    place-items: center;
  }

  .topbar {
    position: static;
    top: auto;
  }

  .topbar-right {
    display: none;
  }
}

@media (max-width: 760px) {
  .main-content {
    padding: 12px;
  }

  .topbar,
  .page-head,
  .record-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-banner {
    padding: 18px;
    border-radius: 24px;
  }

  .floating-op-button {
    right: 18px;
    bottom: 18px;
  }

  .floating-panel {
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    height: auto;
    max-height: none;
    display: flex;
    transform: translateY(14px) scale(.98);
    touch-action: auto;
  }

  .floating-panel.open {
    transform: translateY(0) scale(1);
  }

  .floating-panel-shell {
    width: 100%;
    height: 100%;
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    border-radius: 22px;
    padding: 14px 14px 92px;
  }

  .floating-panel #opForm {
    grid-template-columns: 1fr;
  }

  .floating-panel #normalFields,
  .floating-panel #specialFields,
  .floating-panel #opForm > .form-block,
  .floating-panel #opForm > .final-preview,
  .floating-panel #opForm > .more-options,
  .floating-panel #opForm > .primary {
    grid-column: 1;
    grid-row: auto;
  }

  .floating-panel #opForm > .primary {
    width: 100%;
    min-width: 0;
  }

  .hero-metrics,
  .stats-compact,
  .form-row.two,
  .receipts-grid,
  .receipt-upload-grid,
  .final-preview-grid,
  .receipt-mini,
  .receipt-mini-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions,
  .hero-btn,
  .page-head button {
    width: 100%;
  }

  .card,
  .result,
  .more-options,
  .topbar,
  .record-card {
    border-radius: 18px;
  }

  .card {
    padding: 15px;
  }

  .stat {
    min-height: auto;
  }

  table {
    min-width: 680px;
  }
}


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

  .config-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .config-dashboard,
  .config-preview-grid {
    grid-template-columns: 1fr;
  }

  .config-page-head {
    align-items: flex-start;
  }

  .config-status-pill,
  .config-actions,
  .config-actions button {
    width: 100%;
  }

  .config-form-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .config-form-title small {
    max-width: none;
    text-align: left;
  }

  .config-form-card,
  .config-guide-card {
    padding: 15px;
  }
}


/* Correção definitiva do scroll do modal no mobile */
@media (max-width: 760px) {
  html.panel-open,
  body.panel-open {
    height: 100%;
  }

  body.panel-open {
    overflow: hidden;
  }

  .floating-panel {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    padding: 10px;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    align-items: flex-start;
    justify-content: flex-start;
    transform: translateY(14px) scale(.98);
  }

  .floating-panel.open {
    transform: translateY(0) scale(1);
  }

  .floating-panel-shell {
    width: 100%;
    height: auto;
    min-height: auto;
    max-height: none;
    overflow: visible;
    padding: 14px 14px 98px;
    margin: 0;
  }

  .floating-panel-top {
    position: sticky;
    top: 0;
    z-index: 5;
    background: linear-gradient(180deg, #ffffff 0%, rgba(255,255,255,.96) 100%);
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
  }

  .floating-panel #opForm {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .floating-panel #normalFields,
  .floating-panel #specialFields,
  .floating-panel #opForm > .form-block,
  .floating-panel #opForm > .final-preview,
  .floating-panel #opForm > .more-options,
  .floating-panel #opForm > .primary {
    grid-column: 1 !important;
    grid-row: auto !important;
  }

  .floating-panel #opForm > .primary {
    position: sticky;
    bottom: 8px;
    z-index: 6;
    box-shadow: 0 14px 28px rgba(37,99,235,.22);
  }
}

@media print {
  body {
    background: #fff;
  }

  .sidebar,
  .sidebar-overlay,
  .topbar,
  .hero-banner,
  form,
  #toast,
  .primary,
  .page-head button,
  .hero-btn,
  .danger,
  .record-count {
    display: none !important;
  }

  .main-content,
  .app-shell.sidebar-collapsed .main-content {
    margin-left: 0;
    padding: 0;
  }

  .card,
  .record-card {
    box-shadow: none;
    background: #fff;
  }
}

/* Relatórios independentes por modalidade */
.report-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin: 24px 0 14px;
}

.report-section-head h3 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.report-section-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.mode-report-list {
  display: grid;
  gap: 16px;
}

.mode-report-title {
  align-items: center;
}

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

.mode-report-summary > div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fafc;
}

.mode-report-summary small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 4px;
}

.mode-report-summary strong {
  display: block;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
}

#specialCurrencyHint {
  display: block;
  margin-top: 7px;
}

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

@media (max-width: 560px) {
  .mode-report-summary {
    grid-template-columns: 1fr;
  }

  .report-section-head {
    display: block;
  }
}

/* Cadastro simples de clientes para custódia */
.customer-fields {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f8fafc;
  padding: 12px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.customer-fields.hide {
  display: none !important;
}

.customer-fields-head {
  display: grid;
  gap: 3px;
}

.customer-fields-head strong {
  font-size: 14px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.customer-fields-head small {
  color: var(--muted);
  font-weight: 750;
  font-size: 12px;
}

.floating-panel #opForm.has-customer-fields #specialFields {
  grid-row: 1 / span 4;
}

.floating-panel #opForm.has-customer-fields > #customerFields {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.floating-panel #opForm.has-customer-fields > .operation-note-block {
  grid-column: 2;
  grid-row: 3;
}

.floating-panel #opForm.has-customer-fields > .final-preview {
  grid-column: 3;
  grid-row: 1 / span 2;
}

.floating-panel #opForm.has-customer-fields > .more-options {
  grid-column: 3;
  grid-row: 3;
}

.floating-panel #opForm.has-customer-fields > .primary {
  grid-column: 3;
  grid-row: 4;
}

.customer-kpis {
  margin-bottom: 16px;
}

.customer-list {
  display: grid;
  gap: 16px;
}

.customer-card {
  display: grid;
  gap: 14px;
}

.customer-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.customer-card-head h3 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -0.03em;
}

.customer-card-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}

.customer-card-head small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-weight: 750;
}

.customer-summary {
  margin-bottom: 0;
}

.customer-tablewrap {
  box-shadow: none;
  padding: 0;
  overflow-x: auto;
}

.customer-record-note b {
  color: var(--text);
}

.customer-empty {
  padding: 18px;
  text-align: center;
}

@media (max-width: 1180px) {
  .floating-panel #opForm.has-customer-fields {
    grid-template-columns: 1fr 1fr;
  }

  .floating-panel #opForm.has-customer-fields #specialFields {
    grid-column: 1;
    grid-row: auto;
  }

  .floating-panel #opForm.has-customer-fields > #customerFields,
  .floating-panel #opForm.has-customer-fields > .operation-note-block,
  .floating-panel #opForm.has-customer-fields > .final-preview,
  .floating-panel #opForm.has-customer-fields > .more-options,
  .floating-panel #opForm.has-customer-fields > .primary {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 900px) {
  .floating-panel #opForm.has-customer-fields > #customerFields,
  .floating-panel #opForm > #customerFields {
    grid-column: 1 !important;
    grid-row: auto !important;
  }

  .customer-card-head {
    display: block;
  }

  .customer-card-head .record-count {
    margin-top: 10px;
  }
}


/* ============================================================
   AJUSTE RESPONSIVO E USABILIDADE - 2026-05-17
   Corrige modal cortando campos, tablet quebrado e inputs pequenos.
   ============================================================ */
html,
body {
  width: 100%;
  overflow-x: hidden;
}

button,
input,
select,
summary {
  touch-action: manipulation;
}

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

.view,
.card,
.record-card,
.config-layout,
.config-dashboard,
.customer-card,
.mode-report-card {
  min-width: 0;
}

/* O painel de operação agora sempre cabe na tela e rola por dentro. */
.floating-panel {
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow: hidden;
}

.floating-panel-shell {
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.floating-panel #opForm > *,
.form-row > *,
.config-preview-grid > *,
.mode-report-summary > *,
.customer-summary > * {
  min-width: 0;
}

.floating-panel .primary,
.config-actions .primary,
#cashForm .primary {
  min-height: 48px;
}

.tablewrap,
.customer-tablewrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#toast {
  z-index: 500;
}

@media (max-width: 1180px) {
  .floating-panel {
    width: min(980px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
  }

  .floating-panel-shell {
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
  }
}

@media (max-width: 900px) {
  .stats-compact,
  .config-dashboard,
  .hero-metrics,
  .mode-report-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .floating-panel,
  .floating-panel #opForm,
  .floating-panel #opForm.has-customer-fields {
    grid-template-columns: 1fr !important;
  }

  .floating-panel #normalFields,
  .floating-panel #specialFields,
  .floating-panel #customerFields,
  .floating-panel #opForm > .form-block,
  .floating-panel #opForm > .operation-note-block,
  .floating-panel #opForm > .final-preview,
  .floating-panel #opForm > .more-options,
  .floating-panel #opForm > .primary {
    grid-column: 1 !important;
    grid-row: auto !important;
  }

  .customer-card-head,
  .page-head {
    gap: 10px;
  }
}

@media (max-width: 760px) {
  body {
    background: #f3f6fb;
  }

  .main-content {
    padding: 10px;
  }

  .topbar {
    padding: 12px;
    gap: 10px;
  }

  .topbar-left {
    width: 100%;
  }

  .topbar-title {
    font-size: 17px;
  }

  .topbar-subtitle {
    font-size: 11px;
    line-height: 1.35;
  }

  input,
  select {
    font-size: 16px; /* evita zoom automático em celular */
    min-height: 48px;
  }

  .card,
  .config-form-card,
  .config-guide-card,
  .records-card-wide {
    padding: 14px;
  }

  .stats-compact,
  .config-dashboard,
  .hero-metrics,
  .mode-report-summary,
  .form-row.two,
  .config-preview-grid {
    grid-template-columns: 1fr !important;
  }

  .hero-banner {
    padding: 16px;
  }

  .hero-copy h2 {
    font-size: 25px;
  }

  .floating-op-button {
    right: 14px;
    bottom: 14px;
    width: 62px;
    height: 62px;
  }

  .floating-panel {
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    padding: 8px;
    overflow: hidden;
  }

  .floating-panel-shell {
    width: 100%;
    height: 100%;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding: 12px 12px 92px;
    border-radius: 20px;
  }

  .floating-panel-top {
    position: sticky;
    top: 0;
    z-index: 8;
  }

  .floating-panel #opForm {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .floating-panel #opForm > .primary {
    position: sticky;
    bottom: 8px;
    z-index: 9;
  }

  .record-card,
  .cash-record,
  .transaction-record {
    grid-template-columns: 1fr !important;
  }

  .record-side {
    width: 100%;
  }

  .receipt-mini,
  .receipt-mini-grid,
  .receipt-upload-grid {
    grid-template-columns: 1fr !important;
  }

  table {
    min-width: 640px;
  }
}

@media (max-width: 420px) {
  .main-content {
    padding: 8px;
  }

  .brand h1 {
    font-size: 14px;
  }

  .hero-copy h2,
  .page-head h2 {
    font-size: 22px;
  }

  .floating-panel {
    padding: 6px;
  }

  .floating-panel-shell {
    padding: 10px 10px 88px;
  }

  .section-title,
  .record-head,
  .customer-card-head {
    display: block;
  }

  .record-count {
    display: inline-flex;
    margin-top: 8px;
  }
}
