:root {
  --bg: #eef3f8;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --sidebar: #0f172a;
  --sidebar-soft: #1e293b;
  --shadow: 0 20px 55px rgba(15, 23, 42, .10);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-size: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top left, #dbeafe 0, transparent 34%), var(--bg);
}

button,
input {
  font: inherit;
}

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

a {
  color: inherit;
}

.hidden {
  display: none !important;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
}

.auth-shell {
  width: min(460px, 100%);
}

.auth-card {
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, .70);
  border-radius: 30px;
  box-shadow: var(--shadow);
  padding: 32px;
}

.auth-brand,
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), #06b6d4);
  color: #fff;
  font-size: 20px;
  font-weight: 950;
  box-shadow: 0 12px 30px rgba(37, 99, 235, .25);
}

.auth-brand strong,
.brand strong {
  display: block;
  font-size: 16px;
  line-height: 1.1;
}

.auth-brand span,
.brand span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.auth-card h1 {
  margin: 28px 0 8px;
  font-size: 26px;
  letter-spacing: -.04em;
}

.auth-subtitle,
.muted-text {
  color: var(--muted);
  line-height: 1.45;
}

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.auth-form input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #f8fafc;
  color: var(--text);
  padding: 15px 16px;
  outline: none;
  transition: .2s ease;
}

.auth-form input:focus {
  background: #fff;
  border-color: rgba(37, 99, 235, .55);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .10);
}

.auth-footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
}

.auth-footer a {
  color: var(--primary);
  font-weight: 900;
  text-decoration: none;
}

.setup-alert code {
  background: rgba(15, 23, 42, .08);
  padding: 2px 6px;
  border-radius: 7px;
}

.app-page {
  min-height: 100vh;
  overflow-x: hidden;
}

.app-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns .22s ease;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
  background: linear-gradient(180deg, var(--sidebar), #111827);
  color: #fff;
  z-index: 30;
  transition: width .22s ease, padding .22s ease, transform .22s ease;
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.compact-brand .brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 15px;
}

.compact-brand span {
  color: #94a3b8;
}

.nav-menu {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 12px 12px;
  color: #cbd5e1;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: .18s ease;
}

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

.nav-link span {
  width: 26px;
  text-align: center;
  font-size: 16px;
}

.nav-link b {
  font-size: 14px;
}

.menu-badge {
  margin-left: auto;
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-style: normal;
  font-weight: 950;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .10);
}

.user-mini {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.avatar,
.operator-badge {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, .13);
  color: #fff;
  font-weight: 950;
}

.user-mini strong {
  display: block;
  max-width: 170px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
}

.user-mini span {
  display: block;
  color: #94a3b8;
  font-size: 12px;
}

.logout-link {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 42px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .10);
  color: #fff;
  font-weight: 900;
  text-decoration: none;
}

.main-area {
  min-width: 0;
  padding: 22px;
}

.topbar-app {
  display: flex;
  align-items: center;
  gap: 15px;
  min-height: 60px;
  margin-bottom: 18px;
}

.topbar-app h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -.035em;
}

.top-actions {
  margin-left: auto;
}

.top-actions .operator-badge {
  background: var(--sidebar);
  font-size: 12px;
}

.icon-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(15, 23, 42, .05);
}

.only-mobile {
  display: none;
}

.only-desktop {
  display: grid;
}

.collapse-btn {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-color: rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .10);
  color: #fff;
  box-shadow: none;
  font-size: 20px;
  line-height: 1;
}

.collapse-btn:hover {
  background: rgba(255, 255, 255, .16);
}

.setup-alert {
  margin-bottom: 18px;
  padding: 15px 18px;
  border-radius: 18px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  line-height: 1.45;
}

.page-section {
  display: none;
}

.page-section.active {
  display: block;
}

.hero-card,
.card,
.result-card {
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  align-items: center;
  gap: 18px;
  padding: 22px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.eyebrow.light {
  color: #bfdbfe;
}

.hero-card h2,
.card h2,
.result-card h2 {
  margin: 0;
  letter-spacing: -.04em;
}

.hero-card h2 {
  max-width: 780px;
  font-size: clamp(23px, 3vw, 34px);
  line-height: 1.02;
}

.hero-text {
  max-width: 720px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.hero-mini {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 132px;
  border-radius: 24px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #06b6d4);
}

.mini-number {
  display: block;
  font-size: 40px;
  font-weight: 950;
  line-height: .95;
}

.hero-mini span:last-child {
  font-size: 13px;
  font-weight: 800;
  opacity: .92;
}

.grid-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  align-items: start;
}

.left-col,
.right-col {
  display: grid;
  gap: 18px;
}

.card,
.result-card {
  padding: 20px;
}

.card-header,
.result-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.card-header.small {
  margin-bottom: 12px;
}

.card-header h3,
.card h3 {
  margin: 0;
}

.icon-circle {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #eff6ff;
  color: var(--primary);
  font-size: 20px;
  font-weight: 950;
}

.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 10px;
  min-height: 250px;
  border: 2px dashed #bfdbfe;
  border-radius: 24px;
  padding: 32px 22px;
  background: linear-gradient(180deg, #f8fbff, #f8fafc);
  cursor: pointer;
  transition: .2s ease;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--primary);
  background: #eff6ff;
}

.drop-icon {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: #dbeafe;
  font-size: 28px;
}

.dropzone h3 {
  margin: 4px 0 0;
  font-size: 20px;
}

.dropzone p {
  max-width: 460px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  border: 0;
  border-radius: 15px;
  padding: 0 18px;
  font-weight: 950;
  cursor: pointer;
  transition: .18s ease;
  text-decoration: none;
}

.btn.full {
  width: 100%;
}

.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #06b6d4);
  box-shadow: 0 14px 30px rgba(37, 99, 235, .25);
}

.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 35px rgba(37, 99, 235, .30);
}

.btn.secondary {
  color: var(--text);
  background: #f1f5f9;
  border: 1px solid var(--border);
}

.btn:disabled {
  opacity: .7;
  cursor: not-allowed;
  transform: none !important;
}

.file-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid var(--border);
  color: #334155;
}

.file-preview span {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  font-weight: 800;
  line-height: 1.45;
}

.status.info {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.status.success {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.status.error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.result-card {
  color: #fff;
  background: linear-gradient(145deg, #0f172a, #1e3a8a);
}

.badge,
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
  white-space: nowrap;
}

.badge {
  padding: 8px 12px;
  background: #334155;
  color: #fff;
}

.badge.approved,
.pill.approved {
  background: #d1fae5;
  color: #047857;
}

.badge.fraud,
.pill.fraud {
  background: #fee2e2;
  color: #b91c1c;
}

.badge.duplicate,
.pill.duplicate {
  background: #ffedd5;
  color: #c2410c;
}

.badge.review,
.pill.review {
  background: #fef3c7;
  color: #92400e;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.result-item {
  min-width: 0;
  padding: 13px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .10);
}

.result-item.wide {
  grid-column: 1 / -1;
}

.result-item span {
  display: block;
  margin-bottom: 6px;
  color: #bfdbfe;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.result-item strong {
  display: block;
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.copy-btn {
  flex: 0 0 auto;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, .13);
  color: #fff;
  padding: 9px 12px;
  font-weight: 900;
  cursor: pointer;
}

.reason-box {
  margin-top: 15px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(239, 68, 68, .20);
  border: 1px solid rgba(248, 113, 113, .35);
  color: #fee2e2;
  line-height: 1.45;
}

.info-card {
  background: linear-gradient(135deg, var(--primary), #06b6d4);
  color: #fff;
}

.info-card h3 {
  margin-bottom: 18px;
}

.steps {
  display: grid;
  gap: 14px;
}

.steps div {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.steps b {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  background: rgba(255, 255, 255, .18);
}

.steps span {
  color: #f8fafc;
  font-size: 14px;
  line-height: 1.35;
}

.warning-card {
  background: #fff7ed;
  border-color: #fed7aa;
}

.warning-card h3,
.warning-card p {
  color: #9a3412;
}

.warning-card p {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.45;
}

.link-btn {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 950;
  cursor: pointer;
}

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

.recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: #f8fafc;
}

.recent-item:hover {
  border-color: var(--border);
}

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

.recent-left strong {
  display: block;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-left span:not(.dot) {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.dot.approved {
  background: var(--success);
}

.dot.fraud {
  background: var(--danger);
}

.dot.duplicate {
  background: var(--warning);
}

.dot.review {
  background: #fbbf24;
}

.pill {
  padding: 6px 8px;
}

.empty,
.empty-cell {
  color: var(--muted);
  text-align: center;
}

.empty {
  margin: 12px 0;
  font-size: 13px;
}

.logs-card {
  margin-top: 0;
}

.table-wrap {
  overflow: auto;
  max-width: 100%;
  margin: 0 -8px;
  padding: 0 8px;
}

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

th {
  padding: 11px 10px;
  background: #f8fafc;
  color: #64748b;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .12em;
  text-align: left;
  text-transform: uppercase;
}

td {
  padding: 12px 10px;
  border-top: 1px solid #edf1f7;
  color: #334155;
  font-size: 12px;
  vertical-align: middle;
}

td strong {
  font-weight: 950;
}

.mono {
  color: #64748b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
}

.empty-cell {
  padding: 26px !important;
}

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

.mini-btn {
  min-height: 34px;
  border: 0;
  border-radius: 11px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
}

.mini-btn.success {
  color: #047857;
  background: #d1fae5;
}

.mini-btn.danger {
  color: #b91c1c;
  background: #fee2e2;
}

.loading-spin {
  width: 18px;
  height: 18px;
  display: inline-block;
  margin-right: 8px;
  vertical-align: -4px;
  border: 3px solid rgba(255, 255, 255, .40);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

.overlay {
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (min-width: 901px) {
  .app-shell.sidebar-collapsed {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .app-shell.sidebar-collapsed .sidebar {
    padding: 18px 10px;
  }

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

  .app-shell.sidebar-collapsed .brand-text,
  .app-shell.sidebar-collapsed .collapse-btn,
  .app-shell.sidebar-collapsed .nav-link b,
  .app-shell.sidebar-collapsed .sidebar-footer .user-mini div,
  .app-shell.sidebar-collapsed .logout-link,
  .app-shell.sidebar-collapsed .menu-badge {
    display: none;
  }

  .app-shell.sidebar-collapsed .nav-link {
    justify-content: center;
    padding: 12px 8px;
  }

  .app-shell.sidebar-collapsed .nav-link span {
    width: auto;
    font-size: 17px;
  }

  .app-shell.sidebar-collapsed .sidebar-footer {
    align-items: center;
  }
}

@media (max-width: 1120px) {
  .grid-main {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 900px) {
  .app-shell {
    display: block;
  }

  .main-area {
    padding: 18px;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(310px, 86vw);
    transform: translateX(-104%);
    transition: .22s ease;
  }

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

  .app-shell.sidebar-open .overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .48);
    z-index: 20;
  }

  .only-mobile {
    display: grid;
  }

  .only-desktop {
    display: none;
  }

  .hero-card {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .hero-mini {
    min-height: 124px;
  }

  .right-col {
    grid-template-columns: 1fr;
  }

  .card,
  .result-card {
    padding: 20px;
    border-radius: 22px;
  }

  .dropzone {
    min-height: 250px;
    padding: 28px 16px;
  }

  .result-grid {
    grid-template-columns: 1fr;
  }

  .result-item.wide {
    grid-column: auto;
  }

  .topbar-app h1 {
    font-size: 24px;
  }
}

@media (max-width: 560px) {
  .auth-card {
    padding: 20px;
    border-radius: 24px;
  }

  .auth-card h1 {
    font-size: 26px;
  }

  .main-area {
    padding: 14px;
  }

  .topbar-app {
    gap: 10px;
  }

  .top-actions {
    display: none;
  }

  .hero-card h2 {
    font-size: 24px;
  }

  .file-preview,
  .row-between,
  .card-header,
  .result-top {
    align-items: flex-start;
  }

  .file-preview,
  .row-between {
    flex-direction: column;
  }

  .dropzone h3 {
    font-size: 18px;
  }

  .dropzone p,
  .hero-text,
  .steps span {
    font-size: 13px;
  }

  table {
    min-width: 780px;
  }
}

/* Cadastro de pagamentos */
.compact-hero {
  grid-template-columns: minmax(0, 1fr) 190px;
}

.filters-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(160px, .7fr) minmax(190px, .9fr);
  gap: 12px;
  margin-bottom: 16px;
}

.filters-grid label {
  display: grid;
  gap: 7px;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
}

.filters-grid input,
.filters-grid select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f8fafc;
  color: var(--text);
  padding: 0 13px;
  outline: none;
}

.filters-grid input:focus,
.filters-grid select:focus {
  background: #fff;
  border-color: rgba(37, 99, 235, .55);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .10);
}

.payment-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin: 4px 0 16px;
}

.payment-group-card {
  display: grid;
  gap: 5px;
  padding: 14px;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid var(--border);
}

.payment-group-card span {
  color: var(--primary);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .10em;
  text-transform: uppercase;
}

.payment-group-card strong {
  font-size: 14px;
  line-height: 1.2;
}

.payment-group-card small,
.payment-group-card em,
.subline {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.35;
}

.payments-table {
  min-width: 1080px;
}

.app-shell.sidebar-collapsed .collapse-btn {
  display: grid;
  position: absolute;
  top: 18px;
  right: -13px;
  width: 28px;
  height: 28px;
  font-size: 16px;
  background: #fff;
  color: var(--sidebar);
  border-color: rgba(15, 23, 42, .10);
}

.app-shell.sidebar-collapsed .collapse-btn::before {
  content: '›';
}

.app-shell.sidebar-collapsed .collapse-btn {
  color: transparent;
}

.app-shell.sidebar-collapsed .collapse-btn::before {
  color: var(--sidebar);
}

@media (max-width: 900px) {
  .compact-hero,
  .filters-grid {
    grid-template-columns: 1fr;
  }

  .payment-groups {
    grid-template-columns: 1fr;
  }
}


/* Relatórios de comprovantes */
.report-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.summary-card {
  display: grid;
  gap: 4px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: #f8fafc;
}

.summary-card.wide {
  grid-column: span 2;
}

.summary-card span {
  color: var(--primary);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .10em;
  text-transform: uppercase;
}

.summary-card strong {
  font-size: 24px;
  line-height: 1;
  letter-spacing: -.04em;
}

.summary-card small {
  color: var(--muted);
  font-size: 11px;
}

.report-filters {
  grid-template-columns: minmax(220px, 1.5fr) minmax(150px, .7fr) minmax(140px, .6fr) minmax(140px, .6fr);
}

.receipt-report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 14px;
}

.receipt-report-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .06);
}

.receipt-preview-wrap {
  min-height: 170px;
  border-radius: 18px;
  overflow: hidden;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.receipt-thumb {
  width: 100%;
  height: 100%;
  min-height: 170px;
  display: block;
  object-fit: cover;
}

.receipt-file-preview {
  height: 100%;
  min-height: 170px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 14px;
  text-align: center;
  color: #dc2626;
  background: linear-gradient(180deg, #fff, #f8fafc);
}

.receipt-file-preview span {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: #fee2e2;
  font-weight: 950;
}

.receipt-file-preview small {
  max-width: 100%;
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.receipt-file-preview.muted {
  color: var(--muted);
}

.receipt-file-preview.muted span {
  background: #e2e8f0;
}

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

.receipt-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.receipt-title-row strong {
  min-width: 0;
  font-size: 15px;
  line-height: 1.2;
}

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

.receipt-info-grid div {
  min-width: 0;
  padding: 9px;
  border-radius: 13px;
  background: #f8fafc;
}

.receipt-info-grid div.wide {
  grid-column: 1 / -1;
}

.receipt-info-grid span {
  display: block;
  margin-bottom: 3px;
  color: #64748b;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.receipt-info-grid b {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #334155;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.receipt-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.receipt-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
}

.receipt-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .68);
  backdrop-filter: blur(8px);
}

.receipt-modal-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(980px, 100%);
  height: min(90vh, 820px);
  padding: 18px;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .30);
}

.receipt-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.receipt-modal-header h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -.03em;
}

.receipt-modal-header .muted-text {
  margin: 5px 0 0;
  font-size: 12px;
}

.receipt-modal-body {
  min-height: 0;
  margin-top: 14px;
  overflow: auto;
  border-radius: 18px;
  background: #0f172a;
}

.receipt-modal-image {
  display: block;
  max-width: 100%;
  min-height: 100%;
  margin: 0 auto;
}

.receipt-modal-frame {
  width: 100%;
  height: 100%;
  min-height: 650px;
  border: 0;
  background: #fff;
}

body.modal-open {
  overflow: hidden;
}

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

  .summary-card.wide {
    grid-column: auto;
  }

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

  .receipt-preview-wrap,
  .receipt-thumb,
  .receipt-file-preview {
    min-height: 220px;
  }

  .receipt-modal-panel {
    height: 92vh;
    padding: 14px;
    border-radius: 22px;
  }
}
