:root {
  --bg: #f9f9ff;
  --panel: #ffffff;
  --ink: #181c22;
  --text: #202327;
  --muted: #64748b;
  --accent: #005ab4;
  --brand: var(--accent);
  --accent-2: #d6e3ff;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --success: #16a34a;
  --error: #ba1a1a;
  --shadow: var(--shadow-md);
  --btn-radius: 8px;
  --ease-apple: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 150ms;
  --dur-med: 300ms;
  --dur-slow: 500ms;
  --sidebar-bg: #f8fafc;
  --sidebar-text: #5f7292;
  --sidebar-active-bg: #eff6ff;
  --sidebar-active-text: #1d4ed8;
  --sidebar-active-border: transparent;
  --btn-grad-start: #4f6ef7;
  --btn-grad-end: #005ab4;
  --btn-shadow: 0 4px 14px -4px rgba(79, 110, 247, 0.45);
  --desktop-ui-scale: 0.8;
}

/* Utilities */
.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }


* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Poppins', 'Segoe UI', Tahoma, sans-serif;
    color: var(--ink);
    background: radial-gradient(140% 90% at -10% 120%, transparent 58%, rgba(127, 154, 255, 0.14) 58.2%, transparent 58.8%),
    radial-gradient(135% 95% at 112% -8%, transparent 56%, rgba(127, 154, 255, 0.12) 56.2%, transparent 56.8%),
    linear-gradient(to right, rgba(127, 154, 255, 0.12) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(127, 154, 255, 0.12) 1px, transparent 1px),
    linear-gradient(180deg, #f7f9ff 0%, #f4f6fc 100%);
    background-size: auto, auto, 280px 100%, 100% 110px, 100% 100%;
    animation: page-enter var(--dur-slow) var(--ease-apple) both;
    overflow: hidden;
}

@media (min-width: 1280px) {
  html {
    zoom: var(--desktop-ui-scale);
  }

  body {
    min-height: calc(100vh / var(--desktop-ui-scale));
  }

  .app {
    height: calc(100vh / var(--desktop-ui-scale));
    min-height: calc(100vh / var(--desktop-ui-scale));
  }
}

.app {
  height: 100vh;
  display: flex;
  overflow: hidden;
}

.sidebar {
  width: 280px;
  background: var(--sidebar-bg);
  border-right: 1px solid #eef3f9;
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 40;
}

.sidebar img {
    max-width: 100%;
    height: auto;
    max-height: 52px;
    padding: 0 10px 10px;
    object-fit: contain;
    margin-bottom: 20px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  border: none;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  background: transparent;
  color: var(--sidebar-text);
  padding: 14px 18px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 14px;
  transition: all var(--dur-fast) var(--ease-apple);
}

.nav-item i {
  width: 22px;
  height: 22px;
  stroke-width: 2px;
}

.nav-subitem {
  padding-left: 14px;
  font-size: 0.95rem;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-group-label {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 14px 18px 8px;
  color: #51627d;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.nav-group-label i {
  width: 22px;
  height: 22px;
  stroke-width: 2px;
}

.nav-group.is-active .nav-group-label {
  color: #1d4ed8;
}

.nav-group-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-left: 34px;
  padding-left: 12px;
  border-left: 1px solid rgba(148, 163, 184, 0.35);
}

.nav-report-item {
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 700;
}

.nav-report-item i {
  width: 18px;
  height: 18px;
}

.nav-item.nav-report-item-dre {
  background: rgba(249, 115, 22, 0.09);
  color: #b45309;
}

.nav-item.nav-report-item-dre:hover {
  background: rgba(249, 115, 22, 0.16);
  color: #9a3412;
}

.nav-item.nav-report-item-dre.active {
  background: linear-gradient(135deg, #fdba74 0%, #ee7f31 100%);
  color: #ffffff;
  box-shadow: 0 10px 24px -16px rgba(249, 115, 22, 0.9);
}

.nav-item.nav-report-item-caixa {
  background: rgba(14, 165, 233, 0.1);
  color: #0369a1;
}

.nav-item.nav-report-item-caixa:hover {
  background: rgba(14, 165, 233, 0.17);
  color: #075985;
}

.nav-item.nav-report-item-caixa.active {
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
  color: #ffffff;
  box-shadow: 0 10px 24px -16px rgba(2, 132, 199, 0.95);
}

.nav-item:hover {
  background: rgba(37, 99, 235, 0.04);
  color: var(--accent);
}

.nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  font-weight: 700;
}

.sidebar-card {
  margin-top: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 16px;
  box-shadow: var(--shadow);
  animation: fade-up var(--dur-med) var(--ease-apple) 80ms both;
}

.sidebar-card h4 {
  margin: 0 0 6px;
  font-size: 0.95rem;
}

.sidebar-card p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---- Logout Button ---- */
.logout-btn {
  width: 100%;
  height: 54px;
  background: #377edc;
  color: #ffffff;
  border: none;
  border-radius: 16px;
  font-size: 1rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  letter-spacing: 0.05em;
}

.logout-btn:hover {
  background: #5a8ccf;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -8px rgba(110, 160, 226, 0.6);
}

.logout-btn:active {
  transform: translateY(0);
}

.logout-btn svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.5px;
}

.content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 32px 32px;
  overflow-y: auto;
  align-items: stretch;
}

/* ---- Classification Header & Toolbar (Restored) ---- */
.classification-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  animation: fade-up var(--dur-med) var(--ease-apple) 50ms both;
}

.classification-header h2 {
  font-size: 2.4rem;
  font-weight: 800;
  color: #0d1b3e;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.classification-header p {
  color: #64748b;
  font-size: 1.05rem;
  margin-bottom: 16px;
  font-weight: 500;
}

.header-chips {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.classification-toolbar {
  display: flex;
  width: 100%;
  align-items: flex-end;
  gap: 18px;
  background: rgba(255, 255, 255, 0.7);
  padding: 24px;
  border-radius: 28px;
  margin-bottom: 32px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.02), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
  backdrop-filter: blur(12px);
  animation: fade-up var(--dur-med) var(--ease-apple) 100ms both;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.filter-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  padding-left: 4px;
}

.ds-select-pill, .ds-input-pill {
  display: block;
  height: 48px;
  background: #ffffff;
  border: 1px solid #e1e8f2;
  border-radius: 12px;
  padding: 0 16px;
  font-size: 0.9rem;
  font-family: inherit;
  color: #1e293b;
  width: 100%;
  transition: all 0.2s ease;
  appearance: none;
}

.ds-select-pill {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  background-size: 14px;
  padding-right: 44px;
}

.ds-select-pill:focus, .ds-input-pill:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.search-field {
  flex: 1.4;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrapper i {
  position: absolute;
  right: 18px;
  color: #94a3b8;
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.ds-input-pill.has-icon {
  padding-right: 50px;
}

.ds-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
}

.topbar {
  margin-bottom: 18px;
  animation: fade-up var(--dur-med) var(--ease-apple) 40ms both;
}

.topbar-shell {
  min-height: 78px;
  background: linear-gradient(180deg, #2a3244 0%, #273043 100%);
  border-radius: 18px;
  border: 1px solid #303b52;
  box-shadow: 0 16px 36px -28px rgba(17, 24, 39, 0.7);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
}

.topbar-title svg {
  width: 22px;
  height: 22px;
  color: #83edc9;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-tab {
  border: none;
  background: transparent;
  color: #ffffff;
  padding: 11px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  transition:
    background-color var(--dur-fast) var(--ease-apple),
    color var(--dur-fast) var(--ease-apple),
    transform var(--dur-fast) var(--ease-apple);
}

.topbar-tab:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: var(--feedback-hover-lift);
}

.topbar-tab:active {
  transform: var(--feedback-press-lift);
}

.topbar-tab.active {
  background: #fff;
  color: #1f2a44;
}

.context-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  animation: fade-up var(--dur-med) var(--ease-apple) 55ms both;
}

.context-bar-left {
  flex: 1;
}

.context-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.context-bar h1 {
  margin: 0 0 2px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

#pageSubtitle {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  display: none;
}

.context-bar p {
  margin: 0;
  color: var(--muted);
}

.context-bar-right .ds-chip {
  font-size: 11.5px;
  color: var(--muted);
  background: transparent;
  border: none;
  padding: 0;
  white-space: nowrap;
}

/* Old toolbar styles removed */

.classification-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.classification-summary-card {
  min-height: 172px;
  border-radius: 20px;
  border: 1px solid #d8e1ef;
  background: #ffffff;
  box-shadow: 0 12px 30px -24px rgba(15, 23, 42, 0.28), 0 2px 10px rgba(15, 23, 42, 0.05);
  padding: 26px 26px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.classification-summary-card.is-primary {
  background: linear-gradient(180deg, #edf4ff 0%, #f4f8ff 100%);
  border-color: #cfe0ff;
}

.classification-summary-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.classification-summary-icon i {
  width: 21px;
  height: 21px;
}

.classification-summary-icon.is-primary {
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
}

.classification-summary-icon.is-success {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

.classification-summary-icon.is-warning {
  background: rgba(249, 115, 22, 0.1);
  color: #f97316;
}

.classification-summary-icon.is-info {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}

.classification-summary-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.classification-summary-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #51627d;
}

.classification-summary-value {
  margin: 0;
  font-size: 1.95rem;
  line-height: 1.1;
  font-weight: 800;
  color: #182033;
  letter-spacing: -0.03em;
}

.classification-summary-period {
  font-size: 1.9rem;
}

.classification-summary-meta {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 500;
}

.classification-summary-meta.is-primary {
  color: #2563eb;
}

.classification-summary-meta.is-success {
  color: #12a76a;
}

.classification-summary-meta.is-warning {
  color: #f97316;
}

.classification-summary-meta.is-neutral {
  color: #94a3b8;
}

.classification-composition-card {
  margin-bottom: 22px;
  border-radius: 22px;
  border: 1px solid #d8e1ef;
  background: #ffffff;
  box-shadow: 0 12px 30px -24px rgba(15, 23, 42, 0.28), 0 2px 10px rgba(15, 23, 42, 0.05);
  padding: 28px 34px 30px;
}

.classification-composition-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.classification-composition-title-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

.classification-composition-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #0f6bdc;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.classification-composition-icon i {
  width: 18px;
  height: 18px;
}

.classification-composition-header h3 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
  color: #24324a;
}

.classification-composition-link {
  border: none;
  background: transparent;
  color: #0f6bdc;
  font: inherit;
  font-size: 0.98rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  padding: 0;
}

.classification-composition-list {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.classification-composition-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.classification-composition-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
}

.classification-composition-name {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
  color: #52637f;
}

.classification-composition-value {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
}

.classification-composition-track {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: #eef3f9;
  overflow: hidden;
}

.classification-composition-bar {
  height: 100%;
  border-radius: 999px 0 0 999px;
  background: linear-gradient(90deg, #0f6bdc 0%, #2a7be1 100%);
}

.classification-composition-bar.is-secondary {
  background: linear-gradient(90deg, #5a75a3 0%, #7088b0 100%);
}

.classification-composition-bar.is-muted {
  background: linear-gradient(90deg, #95a4bb 0%, #a9b6c9 100%);
}

.classification-composition-empty {
  margin: 0;
  color: #94a3b8;
  font-size: 0.95rem;
}

.classification-composition-modal-card {
  width: min(780px, 94vw);
  padding: 22px 22px 24px;
}

.classification-composition-modal-summary {
  margin-bottom: 24px;
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid #d8e5f5;
  background: linear-gradient(180deg, #f8fbff 0%, #f2f7fd 100%);
}

.classification-composition-modal-summary-label {
  margin: 0 0 10px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6f85a7;
}

.classification-composition-modal-summary-total {
  margin: 0 0 6px;
  font-size: 1.9rem;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #182033;
}

.classification-composition-modal-summary-meta {
  margin: 0;
  font-size: 0.92rem;
  color: #64748b;
}

.classification-composition-modal-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.classification-composition-item.is-modal {
  gap: 12px;
}

.classification-composition-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.classification-composition-rank {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #eff6ff;
  color: #0f6bdc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.btn {
  font-family: inherit;
  font-size: 0.8rem;
  border: none;
  border-radius: var(--btn-radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 4px 14px -4px rgba(79, 110, 247, 0.45);
  font-weight: 600;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition:
    transform 200ms var(--ease-apple),
    box-shadow 200ms var(--ease-apple),
    background 200ms var(--ease-apple);
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 60%);
  pointer-events: none;
  border-radius: inherit;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px -6px rgba(79, 110, 247, 0.55);
}

.btn:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 2px 8px -2px rgba(79, 110, 247, 0.4);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.btn-mini {
  font-size: 0.72rem;
  padding: 6px 10px;
}

.btn svg {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px -4px rgba(79, 110, 247, 0.45);
}

.btn.secondary {
  background: #475569;
  color: #fff;
  box-shadow: 0 4px 14px -4px rgba(71, 85, 105, 0.4);
}

.btn.secondary:hover {
  box-shadow: 0 8px 22px -6px rgba(71, 85, 105, 0.5);
  background: #334155;
}

.btn.danger {
  background: #dc2626;
  color: #fff;
  box-shadow: 0 4px 14px -4px rgba(220, 38, 38, 0.45);
}

.btn.danger:hover {
  box-shadow: 0 8px 22px -6px rgba(220, 38, 38, 0.55);
  background: #b91c1c;
}

/* Uiverse-inspired animated button */
.uiverse-btn {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--btn-radius);
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 8px -2px rgba(26, 115, 232, 0.4);
  transition: all 200ms var(--ease-apple);
}

.uiverse-btn:hover {
  background: #1565c0;
  box-shadow: 0 6px 16px -4px rgba(26, 115, 232, 0.45);
  transform: translateY(-1px);
}

.uiverse-btn:active {
  transform: translateY(0) scale(0.98);
}

.uiverse-btn svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

.cssbuttons-io-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 10px 10px;
  line-height: 1;
  white-space: nowrap;
  letter-spacing: 0;
  color: #fff;
  background: linear-gradient(0deg, var(--btn-grad-start) 0%, var(--btn-grad-end) 100%);
  border: none;
  box-shadow: var(--btn-shadow);
  border-radius: var(--btn-radius);
  cursor: pointer;
  transition:
    transform var(--dur-fast) var(--ease-apple),
    box-shadow var(--dur-fast) var(--ease-apple),
    filter var(--dur-fast) var(--ease-apple);
}

.receipt-upload-btn {
  background: #f1f5f9 !important; /* Light Gray/Slate */
  color: #475569 !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: none !important;
}

.receipt-upload-btn:hover {
  background: #e2e8f0 !important;
  color: #1e293b !important;
}

.receipt-upload-btn i {
  color: #64748b;
}

.receipt-download-btn {
  background: linear-gradient(0deg, var(--btn-grad-start) 0%, var(--btn-grad-end) 100%);
}

.cssbuttons-io-button:hover {
  transform: var(--feedback-hover-lift);
  filter: brightness(1.02);
}

.cssbuttons-io-button:active {
  transform: var(--feedback-press-lift);
}

.cssbuttons-io-button svg {
  margin-right: 8px;
}

.page {
  display: block;
  width: 100%;
  animation: fade-up var(--dur-med) var(--ease-apple) both;
}

.page.hidden {
  display: none;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

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

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.home-intro {
  margin-bottom: 30px;
}

.home-hero {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background:
    linear-gradient(140deg, rgba(79, 110, 247, 0.08), rgba(79, 110, 247, 0) 45%),
    #ffffff;
  padding: 30px;
  box-shadow: var(--shadow-sm);
}

.home-eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  font-weight: 700;
}

.home-hero h2 {
  margin: 0 0 12px;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 700;
  color: var(--text);
}

.home-hero-copy {
  margin: 0;
  max-width: 68ch;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.home-hero-tags {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.home-hero-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid #c9d6ff;
  background: #f4f7ff;
  color: #2f4fb5;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 10px;
}

.home-metrics {
  margin-bottom: 24px;
  align-items: stretch;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.home-metric-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  min-height: 170px;
  position: relative;
  overflow: hidden;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.2s var(--ease-apple),
    box-shadow 0.2s var(--ease-apple);
}

.home-metric-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 70px;
  height: 70px;
  border-bottom-left-radius: 100%;
  background: linear-gradient(160deg, rgba(79, 110, 247, 0.12), rgba(79, 110, 247, 0));
  pointer-events: none;
}

.home-metric-card h3 {
  font-size: 13px;
  letter-spacing: 0.01em;
  color: var(--muted);
  font-weight: 600;
}

.home-metric-value {
  margin: 0;
  font-size: 42px;
  line-height: 1;
  font-weight: 800;
  color: var(--text);
}

.home-metric-note {
  margin: 0;
  font-size: 0.8rem;
  color: #6b7280;
  max-width: 30ch;
}

.config-admin-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 0.9rem;
}

.checkbox-row input {
  width: 16px;
  height: 16px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition:
    transform var(--dur-med) var(--ease-apple),
    box-shadow var(--dur-med) var(--ease-apple);
  animation: fade-up var(--dur-med) var(--ease-apple) both;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card h3 {
  margin: 0;
  font-size: 1.15rem;
}

.muted {
  color: var(--muted);
  font-size: 0.85rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 0;
  font-size: 0.75rem;
  font-weight: 700;
  width: 100%;
}

.tag.success {
  background: #e3fbe6;
  color: #1f7a3f;
}

.tag.error {
  background: #feecec;
  color: #b42318;
}

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

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 18px;
  width: 100%;
  box-shadow: var(--shadow);
  animation: fade-up var(--dur-med) var(--ease-apple) 50ms both;
}

.panel-full-width {
  margin-left: -32px;
  margin-right: -32px;
  width: calc(100% + 64px);
  border-left: none;
  border-right: none;
  border-radius: 0;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 0 18px; /* Restored horizontal padding for the header */
}

.panel-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

#page-caixa .panel-header {
  justify-content: flex-start;
  flex-wrap: wrap;
}

#page-caixa .panel-header h2 {
  margin-right: auto;
}

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

.home-failures-panel {
  border-radius: 16px;
  border-color: #dbe3f7;
}

.home-failures-header {
  align-items: flex-start;
  justify-content: flex-start;
  flex-wrap: wrap;
  column-gap: 14px;
  margin-bottom: 12px;
}

.home-failures-subtitle {
  margin: 2px 0 0;
  font-size: 0.82rem;
  color: #6b7280;
}

.home-failures-table thead th {
  background: #f8faff;
}

.status {
  color: var(--muted);
  font-size: 0.9rem;
}

.status[data-type="success"] { color: var(--success); }
.status[data-type="error"] { color: var(--error); }

.table-wrap {
  overflow-x: auto;
  width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 100%; /* Allow tables to shrink if container is smaller */
}

.months-table {
  min-width: 100%;
}

.dre-wrap {
  margin-top: 8px;
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.dre-table {
  min-width: 100%;
}

.dre-table td {
  padding: 10px 10px;
}

.caixa-table {
  min-width: 100%;
}

.caixa-total-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 14px;
  padding: 14px 18px;
  border: 1px solid #d7e4f5;
  border-radius: 14px;
  background: linear-gradient(135deg, #f8fbff 0%, #eef5ff 100%);
}

.caixa-total-label {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5b6b82;
}

.caixa-total-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: #2f4f7f;
  white-space: nowrap;
}

.caixa-total-value.is-negative {
  color: #b91c1c;
}

.caixa-total-value.is-positive {
  color: #0f766e;
}

#caixaRows .month-empty {
  text-align: left;
}

.caixa-header {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.caixa-group-row td {
  background: #f4f6fb;
  font-weight: 800;
  text-transform: uppercase;
}

.caixa-summary-row {
  cursor: pointer;
}

.caixa-summary-row td {
  background: #fff;
  transition: background-color var(--dur-fast) var(--ease-apple);
}

.caixa-summary-row:hover td,
.caixa-summary-row.is-expanded td {
  background: #f8fbff;
}

.caixa-summary-row:focus-visible td {
  outline: 2px solid #c9d7ff;
  outline-offset: -2px;
}

.caixa-summary-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.caixa-expand-indicator {
  display: inline-flex;
  width: 16px;
  justify-content: center;
  color: #4f6ef7;
  font-size: 0.85rem;
  transition: transform var(--dur-fast) var(--ease-apple);
}

.caixa-summary-row.is-expanded .caixa-expand-indicator {
  transform: rotate(90deg);
}

.caixa-detail-row td {
  background: #fcfdff;
}

.caixa-detail-row td:first-child {
  padding-left: 42px;
}

.caixa-branch-icon {
  display: inline-block;
  width: 16px;
  margin-right: 8px;
  color: #6b7280;
  font-weight: 700;
}

.caixa-detail-row .classification-category-select {
  min-width: 110px;
}

.dre-main-header td {
  background: #f9fafc;
  font-weight: 800;
  text-transform: uppercase;
}

.dre-group-header td {
  background: #f4f6fb;
  font-weight: 800;
  text-transform: uppercase;
}

.dre-account-row td:first-child {
  padding-left: 22px;
}

.dre-account-row {
  cursor: pointer;
}

.dre-account-row td {
  transition: background-color var(--dur-fast) var(--ease-apple);
}

.dre-account-row:hover td {
  background: #fafcff;
}

.dre-subtotal-row td {
  font-weight: 700;
  background: #fcfcff;
}

.dre-total-row td {
  font-weight: 800;
  background: #eef2ff;
}

thead th {
  text-align: left;
  font-weight: 700;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  font-size: 0.92rem;
}

tbody tr {
  animation: row-in var(--dur-med) var(--ease-apple) both;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--btn-radius);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge.success {
  background: #e3fbe6;
  color: #1f7a3f;
}

.status-badge.error {
  background: #feecec;
  color: #b42318;
}

.month-actions {
  white-space: nowrap;
}

.month-actions .btn.primary {
  background: linear-gradient(0deg, #3d5df0 0%, var(--accent) 100%);
  color: #fff;
  box-shadow: 0 10px 20px -12px rgba(79, 110, 247, 0.9);
}

.month-actions .btn.danger {
  background: linear-gradient(0deg, #dc2626 0%, #ef4444 100%);
  color: #fff;
  box-shadow: 0 10px 20px -12px rgba(220, 38, 38, 0.9);
}

.month-empty {
  text-align: center;
  color: var(--muted);
  padding: 18px 10px;
}

.neg { color: #b42318; font-weight: 700; font-size: 0.70rem; white-space: nowrap; }
.pos { color: #027a48; font-weight: 700; font-size: 0.70rem; white-space: nowrap; }
.dre-empty-amount { color: var(--muted); font-weight: 700; font-size: 0.70rem; white-space: nowrap; }

select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 30px;
  border: 1px solid var(--border);
  background: #fff;
}

.classification-table-panel {
  padding: 0;
  border-radius: 22px;
  overflow: hidden;
  border-color: #d8e1ef;
  box-shadow: 0 14px 34px -26px rgba(15, 23, 42, 0.28), 0 2px 10px rgba(15, 23, 42, 0.05);
}

.classification-table-header {
  padding: 22px 26px;
  margin: 0;
}

.classification-table-header h2 {
  font-size: 1.18rem;
  color: #334155;
}

.classification-table-actions .btn.secondary {
  background: #ffffff;
  color: #52637f;
  border: 1px solid #cfdae9;
  box-shadow: none;
}

.classification-table-actions .btn.secondary:hover {
  background: #f8fbff;
  color: #334155;
}

.classification-table-shell {
  border-top: 1px solid #e4ebf5;
  background: #ffffff;
}

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

.classification-table {
  width: 100%;
  min-width: 100%;
  border-collapse: collapse;
}

.classification-table thead th {
  padding: 18px 18px;
  background: #f9fbff;
  border-bottom: 1px solid #dde5f1;
  font-size: 0.76rem;
  font-weight: 700;
  color: #6b7d99;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.classification-table tbody td {
  padding: 20px 18px;
  border-bottom: 1px solid #edf2f8;
  vertical-align: middle;
  color: #42526b;
}

.classification-table tbody tr:hover {
  background: #fcfdff;
}

.classification-table tbody tr.is-selected {
  background: #f3f8ff;
}

.classification-table th:nth-child(1),
.classification-table td:nth-child(1) {
  width: 5%;
  text-align: center;
}

.classification-table th:nth-child(2),
.classification-table td:nth-child(2) {
  width: 11%;
}

.classification-table th:nth-child(3),
.classification-table td:nth-child(3) {
  width: 13%;
}

.classification-table th:nth-child(4),
.classification-table td:nth-child(4) {
  width: 14%;
}

.classification-table th:nth-child(5),
.classification-table td:nth-child(5) {
  width: 25%;
}

.classification-table th:nth-child(6),
.classification-table td:nth-child(6) {
  width: 13%;
}

.classification-table th:nth-child(7),
.classification-table td:nth-child(7) {
  width: 13%;
}

.classification-table th:nth-child(8),
.classification-table td:nth-child(8) {
  width: 7%;
}

.classification-checkbox-col {
  text-align: center;
}

.classification-check {
  appearance: none;
  width: 24px;
  height: 24px;
  margin: 0;
  border-radius: 7px;
  border: 1.5px solid #c8d4e3;
  background: #ffffff;
  cursor: pointer;
  position: relative;
  transition:
    border-color var(--dur-fast) var(--ease-apple),
    background-color var(--dur-fast) var(--ease-apple),
    box-shadow var(--dur-fast) var(--ease-apple);
}

.classification-check:checked {
  background: #0f6bdc;
  border-color: #0f6bdc;
  box-shadow: 0 10px 20px -16px rgba(15, 107, 220, 0.8);
}

.classification-check:checked::after {
  content: '';
  position: absolute;
  left: 7px;
  top: 3px;
  width: 6px;
  height: 11px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.classification-cell-date {
  font-size: 0.98rem;
  font-weight: 500;
  color: #52637f;
}

.classification-month-input {
  width: 100%;
  min-width: 118px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px dashed #c8d4e3;
  background: #ffffff;
  color: #50627e;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 600;
}

.classification-month-input.is-divergent {
  border-color: #f6ad55;
  background: #fff7ed;
}

.classification-amount {
  font-size: 0.98rem;
  font-weight: 700;
  white-space: nowrap;
}

.classification-amount.is-negative {
  color: #c62828;
}

.classification-amount.is-positive {
  color: #12a76a;
}

.classification-description {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.classification-description-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  color: #24324a;
}

.classification-description-meta {
  margin: 0;
  font-size: 0.84rem;
  color: #94a3b8;
}

.classification-category-select {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid #dfe7f2;
  padding: 0 38px 0 14px;
  background: #f3f6fb;
  color: #52637f;
  font-weight: 600;
}

.classification-category-select.is-empty {
  border-color: #fdba74;
  background: #fff7ed;
  color: #9a3412;
}

.classification-complement-input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 0;
  border: none;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #64748b;
  font-size: 0.98rem;
  font-style: italic;
}

.classification-complement-input::placeholder {
  color: #94a3b8;
}

.classification-complement-input:focus {
  outline: none;
  border-bottom-color: #c7d3e3;
}

.receipt {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.receipt-input-hidden {
  display: none;
}

.receipt-upload-btn,
.receipt-download-btn {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  justify-content: center;
  font-size: 0.74rem;
  padding: 0 12px;
  border-radius: 999px;
}

.receipt-upload-btn {
  box-shadow: none;
}

.receipt-download-btn {
  text-decoration: none;
  box-shadow: none;
}

.receipt-upload-btn svg,
.receipt-download-btn svg {
  width: 13px;
  height: 13px;
  margin-right: 6px;
}

.receipt-upload-btn span,
.receipt-download-btn span {
  white-space: nowrap;
}

.receipt-hidden {
  display: none;
}

.classification-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.classification-table th, 
.classification-table td {
  padding: 16px 12px;
}

/* Colunas específicas para equilíbrio visual */
/* Colunas responsivas - sem table-layout: fixed para evitar encavalamento */
.classification-table th:nth-child(1), .classification-table td:nth-child(1) { white-space: nowrap; width: 1%; } /* Data */
.classification-table th:nth-child(2), .classification-table td:nth-child(2) { white-space: nowrap; width: 1%; } /* Competência */
.classification-table th:nth-child(3), .classification-table td:nth-child(3) { width: auto; } /* Descrição */
.classification-table th:nth-child(4), .classification-table td:nth-child(4) { white-space: nowrap; text-align: right; width: 1%; } /* Valor */
.classification-table th:nth-child(5), .classification-table td:nth-child(5) { white-space: nowrap; width: 220px; } /* Categoria (Aumentado) */
.classification-table th:nth-child(6), .classification-table td:nth-child(6) { width: 150px; } /* Complemento (Diminuído) */
.classification-table th:nth-child(7), .classification-table td:nth-child(7) { white-space: nowrap; width: 1%; } /* Tipo Fiscal */
.classification-table th:nth-child(8), .classification-table td:nth-child(8) { white-space: nowrap; width: 1%; } /* Anexo */

.classification-category-select.is-fiscal {
  padding: 0 30px 0 12px;
  font-size: 0.85rem;
}

.classification-table-empty {
  text-align: center;
  color: #94a3b8;
  padding: 28px 18px;
}

.classification-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 26px;
  background: #fbfcfe;
}

.classification-table-count {
  margin: 0;
  color: #64748b;
  font-size: 0.95rem;
}

.classification-pagination {
  display: flex;
  align-items: center;
  gap: 10px;
}

.classification-pagination-btn {
  min-width: 46px;
  height: 46px;
  border-radius: 10px;
  border: 1px solid #d4dfed;
  background: #ffffff;
  color: #64748b;
  font: inherit;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background-color var(--dur-fast) var(--ease-apple),
    color var(--dur-fast) var(--ease-apple),
    border-color var(--dur-fast) var(--ease-apple),
    transform var(--dur-fast) var(--ease-apple);
}

.classification-pagination-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: #b8cae0;
  color: #334155;
}

.classification-pagination-btn.is-active {
  background: #0f6bdc;
  border-color: #0f6bdc;
  color: #ffffff;
  box-shadow: 0 14px 24px -18px rgba(15, 107, 220, 0.8);
}

.classification-pagination-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.receipt-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  transition:
    color var(--dur-fast) var(--ease-apple),
    opacity var(--dur-fast) var(--ease-apple);
}

.receipt-link:hover {
  color: #2f4fb5;
  opacity: 0.9;
}

.empty-state {
  padding: 24px;
  background: var(--panel);
  border: 1px dashed var(--border);
  border-radius: 0;
  animation: fade-up var(--dur-med) var(--ease-apple) both;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: grid;
  place-items: center;
  z-index: 11000;
  padding: 16px;
}

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

.modal-card {
  width: min(900px, 96vw);
  max-height: 86vh;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 12px;
  padding: 16px;
}

.modal-card-preview {
  width: min(1100px, 98vw);
  max-height: 92vh;
}

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

.modal-header h3 {
  margin: 0;
  font-size: 1rem;
}

.modal-close {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  cursor: pointer;
}

.dre-modal-table {
  min-width: 700px;
}

.dre-modal-table tfoot th {
  padding: 10px;
  border-top: 1px solid var(--border);
}

.receipt-preview-frame {
  width: 100%;
  height: min(74vh, 900px);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.receipt-preview-image {
  display: block;
  max-width: 100%;
  max-height: min(74vh, 900px);
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.loader-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.55);
  z-index: 9999;
}

.loader-overlay.is-hidden {
  display: none;
}

/* From Uiverse.io by alexruix */
.loader {
  width: 80px;
  height: 50px;
  position: relative;
}

.loader-text {
  position: absolute;
  top: 0;
  padding: 0;
  margin: 0;
  color: #b6d0ff;
  animation: text_713 3.5s ease both infinite;
  font-size: 0.8rem;
  letter-spacing: 1px;
}

.load {
  background-color: #3b82f6;
  border-radius: 50px;
  display: block;
  height: 16px;
  width: 16px;
  bottom: 0;
  position: absolute;
  transform: translateX(64px);
  animation: loading_713 3.5s ease both infinite;
}

.load::before {
  position: absolute;
  content: "";
  width: 100%;
  height: 100%;
  background-color: #93c5fd;
  border-radius: inherit;
  animation: loading2_713 3.5s ease both infinite;
}

@keyframes text_713 {
  0% {
    letter-spacing: 1px;
    transform: translateX(0px);
  }

  40% {
    letter-spacing: 2px;
    transform: translateX(26px);
  }

  80% {
    letter-spacing: 1px;
    transform: translateX(32px);
  }

  90% {
    letter-spacing: 2px;
    transform: translateX(0px);
  }

  100% {
    letter-spacing: 1px;
    transform: translateX(0px);
  }
}

@keyframes loading_713 {
  0% {
    width: 16px;
    transform: translateX(0px);
  }

  40% {
    width: 100%;
    transform: translateX(0px);
  }

  80% {
    width: 16px;
    transform: translateX(64px);
  }

  90% {
    width: 100%;
    transform: translateX(0px);
  }

  100% {
    width: 16px;
    transform: translateX(0px);
  }
}

@keyframes loading2_713 {
  0% {
    transform: translateX(0px);
    width: 16px;
  }

  40% {
    transform: translateX(0%);
    width: 80%;
  }

  80% {
    width: 100%;
    transform: translateX(0px);
  }

  90% {
    width: 80%;
    transform: translateX(15px);
  }

  100% {
    transform: translateX(0px);
    width: 16px;
  }
}

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

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes row-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

button:focus-visible,
select:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: none;
  box-shadow: var(--feedback-ring);
  transition: box-shadow var(--dur-fast) var(--ease-apple);
}

.field select:hover,
.field input:hover,
.classification-field select:hover,
.classification-period-range input:hover,
.classification-category-select:hover,
.classification-month-input:hover,
.classification-complement-input:hover {
  border-color: #ccd7fb;
}

.field select:active,
.field input:active,
.classification-field select:active,
.classification-period-range input:active,
.classification-category-select:active,
.classification-month-input:active {
  transform: translateY(0.5px);
}

.nav-item:active {
  transform: var(--feedback-press-lift);
}

/* Estilos melhorados para Formuários em Modais (Global) */
.modal-overlay .modal-card {
  display: flex;
  flex-direction: column;
  max-width: min(480px,0  );
  max-height: 90vh;
  border-radius: 20px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

.modal-overlay .modal-header {
  padding: 24px 32px;
  background: #fff;
  border-bottom: 1px solid #f1f5f9;
}

.modal-overlay .modal-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
}

.modal-overlay .modal-content {
  padding: 0 32px 32px;
  overflow-y: auto;
  flex: 1;
}

.modal-overlay .field {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-overlay .field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  margin-left: 4px;
}

.modal-overlay .ds-input-pill,
.modal-overlay .ds-select-pill {
  border-color: #cbd5e1;
}

.modal-overlay .ds-input-pill:focus,
.modal-overlay .ds-select-pill:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.modal-overlay .modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 24px 32px;
  background: #fff;
  border-top: 1px solid #f1f5f9;
}

.modal-overlay .modal-actions .btn {
  height: 48px;
  padding: 0 24px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-overlay .modal-actions .btn.secondary {
  background: #f1f5f9;
  color: #475569;
  border: none;
}

.modal-overlay .modal-actions .btn.secondary:hover {
  background: #e2e8f0;
}

.modal-overlay .modal-actions .btn.primary {
  background: #2563eb; /* Blue primary */
  color: #fff;
  border: none;
}

.modal-overlay .modal-actions .btn.primary:hover {
  background: #1d4ed8;
}

/* Utilitários para modais específicos */
.modal-instruction {
  margin: 0 0 16px;
  font-size: 0.9rem;
  color: #64748b;
  line-height: 1.5;
}

.modal-instruction.success {
  color: #10b981;
  font-weight: 600;
}

.share-checkboxes-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
  max-height: 220px;
  padding: 4px;
  overflow-y: auto;
}

.share-result-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}

.share-result-row .ds-input-pill {
  flex: 1;
  background: #f8fafc;
  cursor: text;
}

#shareExpiresInfo {
  margin: 0 0 16px;
  padding: 12px;
  background: #f1f5f9;
  border-radius: 8px;
  font-size: 0.82rem;
  color: #475569;
}
#shareExpiresInfo:empty { display: none; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .app {
    height: auto;
    flex-direction: column;
    overflow: visible;
  }

  .sidebar {
    position: static;
    top: auto;
    height: auto;
    overflow: visible;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
  }

  .nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .sidebar-card {
    display: none;
  }

  .content {
    height: auto;
    overflow: visible;
    padding: 20px;
  }

  .topbar {
    margin-bottom: 14px;
  }

  .topbar-shell {
    min-height: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .panel-full-width {
    margin-left: -20px;
    margin-right: -20px;
    width: calc(100% + 40px);
  }

  .topbar-nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .topbar-tab {
    white-space: nowrap;
  }

  .nav-group-items {
    margin-left: 24px;
    padding-left: 10px;
  }

  .context-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .classificacao-toolbar {
    padding: 18px;
    border-radius: 18px;
  }

  .classification-toolbar-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

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

  .classification-composition-card {
    padding: 22px 18px 24px;
  }

  .classification-composition-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .classification-period-range {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .classification-range-separator {
    display: none;
  }

  .classification-type-toggle {
    width: 100%;
    flex-wrap: wrap;
  }

  .classification-type-option {
    flex: 1 1 120px;
  }

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

  .classification-filter-btn {
    flex: 1;
    min-height: 62px;
  }

  .classification-table-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .classification-table-actions {
    width: 100%;
  }

  .classification-table-actions .btn {
    flex: 1 1 220px;
  }

  .classification-table-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .home-metrics {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }

  .home-hero {
    padding: 18px;
  }

  .home-hero h2 {
    font-size: 1.2rem;
  }

  .home-metric-value {
    font-size: 1.9rem;
  }

  .home-failures-header {
    flex-direction: column;
    gap: 6px;
  }
}

@media (max-width: 720px) {
  .classification-summary-grid {
    grid-template-columns: 1fr;
  }

  .classification-summary-card {
    min-height: auto;
    padding: 20px 18px;
  }

  .classification-composition-modal-summary-total {
    font-size: 1.55rem;
  }

  .classification-composition-meta {
    width: 100%;
  }

  .classification-composition-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .classification-summary-value,
  .classification-summary-period {
    font-size: 1.6rem;
  }

  .classification-table-header,
  .classification-table-footer {
    padding-left: 18px;
    padding-right: 18px;
  }

  .classification-pagination {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .classification-pagination-btn {
    min-width: 42px;
    height: 42px;
  }
}

/* Lucide adjustments */
[data-lucide] {
  display: inline-block;
  vertical-align: middle;
}

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