/* ==========================================================================
   CLINICA DRA. TÃ‰RSIA â€” GESTÃƒO FINANCEIRA & CLÃNICA (SCORE CONSULTORIA)
   Design System & Executive Aesthetics (Light & Dark Theme)
   ========================================================================== */

:root {
  /* Brand Green Palette (Score Consultoria) */
  --color-primary: #059669;
  --color-primary-hover: #047857;
  --color-primary-light: #ecfdf5;
  --color-primary-subtle: rgba(5, 150, 105, 0.1);
  --color-primary-glow: rgba(16, 185, 129, 0.25);
  
  --color-emerald: #10b981;
  --color-teal: #0d9488;
  --color-rose: #f43f5e;
  --color-rose-subtle: rgba(244, 63, 94, 0.1);
  --color-amber: #f59e0b;
  --color-blue: #0284c7;

  /* Surfaces & Backgrounds (Light Theme) */
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-muted: #f1f5f9;
  --bg-hover: #f8fafc;

  /* Borders & Dividers */
  --border-subtle: #e2e8f0;
  --border-medium: #cbd5e1;
  --border-focus: #10b981;

  /* Text & Typography */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);

  /* Layout dimensions */
  --sidebar-width: 270px;
  --sidebar-collapsed-width: 80px;
  --header-height: 72px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

/* Dark Theme Overrides */
html.dark {
  --bg-main: #0b0f19;
  --bg-surface: #111827;
  --bg-surface-elevated: #1f2937;
  --bg-sidebar: #0e1422;
  --bg-muted: #1e293b;
  --bg-hover: #1e293d;

  --border-subtle: #1e293b;
  --border-medium: #334155;
  --border-focus: #34d399;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --color-primary-light: rgba(16, 185, 129, 0.12);
  --color-primary-subtle: rgba(16, 185, 129, 0.15);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 12px rgba(0, 0, 0, 0.5);
}

/* Base Resets */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* App Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* ==========================================================================
   SIDEBAR
   ========================================================================== */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 40;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-header {
  height: var(--header-height);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-badge-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ffffff;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
  flex-shrink: 0;
}

.brand-badge-icon svg {
  width: 20px;
  height: 20px;
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--color-primary);
}

.brand-subtitle {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.sidebar-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  transition: all 0.2s;
}

.sidebar-toggle-btn:hover {
  background-color: var(--bg-muted);
  color: var(--text-primary);
}

.sidebar-nav {
  flex: 1;
  padding: 24px 14px;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 0 12px 10px 12px;
  text-transform: uppercase;
}

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

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.nav-link:hover {
  background-color: var(--bg-muted);
  color: var(--text-primary);
}

.nav-link.active {
  background-color: var(--color-primary-subtle);
  color: var(--color-primary);
  font-weight: 800;
  border-left: 4px solid var(--color-primary);
  border-top-left-radius: 2px;
  border-bottom-left-radius: 2px;
}

.nav-icon-wrapper {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-tag {
  margin-left: auto;
  font-size: 0.65rem;
  font-weight: 700;
  background-color: var(--color-primary);
  color: #ffffff;
  padding: 2px 6px;
  border-radius: 20px;
}

.pulse-indicator {
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-subtle);
  background-color: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.partner-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.partner-icon {
  width: 32px;
  height: 32px;
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.partner-details {
  display: flex;
  flex-direction: column;
}

.partner-name {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--color-primary);
}

.partner-desc {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.theme-toggle-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  background-color: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.theme-toggle-btn:hover {
  background-color: var(--bg-muted);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

/* ==========================================================================
   MAIN CONTENT & HEADER
   ========================================================================== */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.top-header {
  height: var(--header-height);
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(8px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-menu-trigger {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 4px;
}

.title-group {
  display: flex;
  flex-direction: column;
}

.title-with-pill {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-title {
  font-size: 1.28rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.page-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.data-source-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--color-primary-light);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 30px;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--color-primary);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.status-dot.success {
  background-color: #10b981;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  border: none;
}

.btn-action svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #047857, #059669);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}

.btn-outline {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.btn-outline:hover {
  background: var(--bg-muted);
  border-color: var(--border-medium);
}

/* ==========================================================================
   DASHBOARD TOOLBAR (Organized Control Bar)
   ========================================================================== */
.dashboard-toolbar {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 12px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-xs);
}

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

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

.file-icon-badge {
  color: var(--color-primary);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.file-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  overflow: hidden;
}

.file-label {
  font-weight: 800;
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.file-name {
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-reset-demo {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}

.btn-reset-demo:hover {
  background: var(--bg-hover);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-reset-demo svg {
  width: 13px;
  height: 13px;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.filter-hint-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.period-controls {
  display: flex;
  align-items: center;
  background: var(--bg-muted);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  gap: 4px;
}

.period-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.period-btn.active {
  background: var(--bg-surface);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

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

.select-icon {
  position: absolute;
  left: 10px;
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.custom-select {
  padding: 7px 12px 7px 32px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.custom-select:focus {
  border-color: var(--border-focus);
}

/* ==========================================================================
   KPI CARDS (Strict Balanced 4-Grid System)
   ========================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 26px;
}

@media (max-width: 1200px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 20px 22px;
  box-shadow: var(--shadow-xs);
  transition: all 0.22s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 154px;
}

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

.kpi-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.kpi-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.kpi-icon-box {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
}

.icon-emerald { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.icon-rose { background: rgba(244, 63, 94, 0.12); color: #f43f5e; }
.icon-teal { background: rgba(13, 148, 136, 0.12); color: #0d9488; }
.icon-primary { background: var(--color-primary-light); color: var(--color-primary); }

.kpi-value {
  font-size: 1.65rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.text-emerald { color: #10b981; }
.text-rose { color: #f43f5e; }
.text-teal { color: #0d9488; }
.text-primary { color: var(--color-primary); }

.kpi-footer {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 6px;
}

.kpi-delta.positive {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.kpi-delta.neutral {
  background: var(--bg-muted);
  color: var(--text-secondary);
}

.kpi-period-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.kpi-badge-pill {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  background: var(--bg-muted);
  color: var(--text-secondary);
  padding: 3px 9px;
  border-radius: 20px;
}

.kpi-badge-pill.badge-primary {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

/* ==========================================================================
   CONTENT LAYOUT (Main Column & Side Column)
   ========================================================================== */
.content-container {
  padding: 28px 32px;
  flex: 1;
}

.tab-view {
  display: none;
}

.tab-view.active {
  display: block;
  animation: fadeIn 0.25s ease-in-out;
}

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

.finance-grid-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
}

.finance-main-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.finance-side-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.dashboard-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.card-header-flex {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.card-title {
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  text-transform: uppercase;
}

.card-title .highlight-text {
  color: var(--color-primary);
}

.card-subtitle {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.card-body {
  padding: 22px 24px;
}

.card-body.no-padding {
  padding: 0;
}

.chart-wrapper {
  width: 100%;
  height: 310px;
  position: relative;
}

.pie-chart-wrapper {
  width: 100%;
  height: 230px;
  position: relative;
  margin-bottom: 16px;
}

.chart-legend-custom {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.76rem;
  font-weight: 600;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-secondary);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-emerald { background-color: #10b981; }
.dot-rose { background-color: #f43f5e; }
.dot-primary { background-color: var(--color-primary); }

.btn-subtle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-subtle:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

/* ==========================================================================
   DRE TABLE
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.dre-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.86rem;
}

.dre-table th {
  background: var(--bg-muted);
  padding: 12px 20px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}

.dre-table td {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-weight: 500;
}

.dre-table tr:hover td {
  background: var(--bg-hover);
}

.dre-row-header {
  background-color: var(--bg-muted);
  font-weight: 800 !important;
}

.dre-row-header td {
  font-weight: 800;
  font-size: 0.9rem;
}

.dre-row-total {
  background-color: var(--color-primary-light);
  font-weight: 900;
}

.dre-row-total td {
  font-weight: 900;
  font-size: 0.95rem;
  color: var(--color-primary);
}

.dre-row-sub td.col-desc {
  padding-left: 36px;
  position: relative;
  color: var(--text-secondary);
}

.dre-row-sub td.col-desc::before {
  content: '\21B3';
  position: absolute;
  left: 20px;
  color: var(--text-muted);
}

.dre-toggle-icon {
  display: inline-block;
  width: 16px;
  margin-right: 6px;
  color: var(--color-primary);
  font-weight: 800;
  cursor: pointer;
}

.val-positive { color: #10b981; font-weight: 700; }
.val-negative { color: #f43f5e; font-weight: 700; }
.text-right { text-align: right; }
.text-center { text-align: center; }

.av-pill {
  display: inline-block;
  padding: 2px 7px;
  background: var(--bg-muted);
  border-radius: 5px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.dre-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
  text-transform: uppercase;
}

.tag-revenue { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.tag-cost { background: rgba(244, 63, 94, 0.12); color: #f43f5e; }
.tag-expense { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.tag-result { background: var(--color-primary-light); color: var(--color-primary); }

/* ==========================================================================
   EXPENSE CATEGORIES LIST & UPLOAD WIDGET
   ========================================================================== */
.expense-categories-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.expense-cat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
}

.cat-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cat-indicator {
  width: 9px;
  height: 9px;
  border-radius: 3px;
}

.cat-name {
  font-weight: 600;
  color: var(--text-primary);
}

.cat-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cat-val {
  font-weight: 700;
  color: var(--text-primary);
}

.cat-pct {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Upload Drop Zone */
.drop-zone {
  border: 2px dashed var(--border-medium);
  background: var(--bg-muted);
  border-radius: var(--radius-lg);
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.drop-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: grid;
  place-items: center;
  margin-bottom: 2px;
}

.drop-text-primary {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-primary);
}

.drop-text-secondary {
  font-size: 0.75rem;
  color: var(--text-muted);
}

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

.upload-help-text {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.upload-help-text svg {
  width: 15px;
  height: 15px;
  color: var(--color-primary);
  flex-shrink: 0;
  margin-top: 1px;
}

/* ==========================================================================
   OTHER VIEWS (Medical, 4medic, Users)
   ========================================================================== */
.tab-header-hero {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 22px 28px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-xs);
}

.hero-title {
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  padding: 7px 14px;
  border-radius: 30px;
  font-size: 0.78rem;
  font-weight: 800;
}

.medical-grid-layout,
.api-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 24px;
}

.api-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-row {
  display: flex;
  gap: 14px;
}

.flex-1 { flex: 1; }

.form-group label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.form-control {
  padding: 9px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  color: var(--text-primary);
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-control:focus {
  border-color: var(--border-focus);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.badge-tag {
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--bg-muted);
  color: var(--text-secondary);
  padding: 4px 9px;
  border-radius: 20px;
}

.patients-stream-list {
  display: flex;
  flex-direction: column;
}

.patient-stream-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.2s;
}

.patient-stream-item:hover {
  background: var(--bg-hover);
}

.patient-info-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.patient-avatar-mini {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 800;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
}

.patient-meta-name {
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--text-primary);
}

.patient-meta-proc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.patient-value-box {
  text-align: right;
}

.patient-price {
  font-weight: 800;
  font-size: 0.9rem;
  color: #10b981;
}

.patient-channel {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px;
}

.user-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 22px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
}

.user-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 1.05rem;
}

.avatar-emerald { background: linear-gradient(135deg, #059669, #10b981); color: #ffffff; }
.avatar-primary { background: linear-gradient(135deg, #0284c7, #38bdf8); color: #ffffff; }
.avatar-teal { background: linear-gradient(135deg, #0d9488, #2dd4bf); color: #ffffff; }

.user-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 20px;
}

.role-admin { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.role-consultant { background: rgba(2, 132, 199, 0.15); color: #0284c7; }
.role-reception { background: rgba(13, 148, 136, 0.15); color: #0d9488; }

.user-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
}

.user-email {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.user-permissions-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 18px;
  flex: 1;
}

.perm-tag {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.perm-tag svg {
  width: 14px;
  height: 14px;
  color: #10b981;
}

.user-footer {
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* ==========================================================================
   MODAL & TOAST
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  place-items: center;
  z-index: 100;
  padding: 20px;
}

.modal-overlay.active {
  display: grid;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-icon-badge {
  width: 38px;
  height: 38px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 800;
}

.modal-subtitle {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
}

.modal-body {
  padding: 22px;
}

.modal-info-alert {
  background: var(--color-primary-light);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 0.8rem;
  color: var(--color-primary);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.4;
}

.modal-drop-zone {
  padding: 36px 20px;
}

.upload-progress-box {
  margin-top: 16px;
}

.progress-bar-track {
  width: 100%;
  height: 7px;
  background: var(--bg-muted);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #059669, #10b981);
  transition: width 0.3s ease;
}

.progress-status-text {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 8px;
  text-align: center;
}

.modal-footer {
  padding: 14px 22px;
  background: var(--bg-muted);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 150;
}

.toast {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  box-shadow: var(--shadow-lg);
  font-size: 0.84rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 300px;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Footer */
.app-footer {
  padding: 18px 32px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg-surface);
}

/* ==========================================================================
   RESPONSIVENESS
   ========================================================================== */
@media (max-width: 1200px) {
  .finance-grid-layout,
  .medical-grid-layout,
  .api-dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: -100%;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .sidebar.mobile-open {
    left: 0;
  }
  .mobile-menu-trigger {
    display: block;
  }
  .top-header {
    padding: 0 16px;
  }
  .content-container {
    padding: 16px;
  }
  .dashboard-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .toolbar-right {
    justify-content: space-between;
  }
}


/* ==========================================================================
   BANK ACCOUNTS BAR & BADGES
   ========================================================================== */
.bank-accounts-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 12px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: var(--shadow-xs);
}

.bank-bar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.bank-bar-title svg {
  width: 16px;
  height: 16px;
  color: var(--color-primary);
}

.bank-badges-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.bank-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}

.bank-name {
  color: var(--text-secondary);
  font-weight: 600;
}

.bank-amount {
  font-weight: 800;
  color: var(--text-primary);
}

.bank-badge.badge-total {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
}

.bank-badge.badge-total .bank-name {
  color: var(--color-primary);
  font-weight: 800;
}

/* ==========================================================================
   VIEW MODE TOGGLE (Simples vs Detalhada)
   ========================================================================== */
.view-mode-toggle {
  display: flex;
  align-items: center;
  background: var(--bg-muted);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  gap: 4px;
}

.mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-btn svg {
  width: 15px;
  height: 15px;
}

.mode-btn.active {
  background: var(--bg-surface);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   SIMPLIFIED WATERFALL / FUNIL DO DINHEIRO
   ========================================================================== */
.waterfall-explanation {
  margin-bottom: 18px;
}

.waterfall-intro {
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: var(--bg-muted);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
}

.waterfall-intro svg {
  width: 18px;
  height: 18px;
  color: var(--color-primary);
  flex-shrink: 0;
}

.waterfall-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.waterfall-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  transition: all 0.2s ease;
  gap: 16px;
}

.waterfall-step:hover {
  transform: translateX(4px);
  border-color: var(--border-medium);
}

.step-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.step-positive .step-icon {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.step-negative .step-icon {
  background: rgba(244, 63, 94, 0.15);
  color: #f43f5e;
}

.step-highlight .step-icon {
  background: rgba(13, 148, 136, 0.15);
  color: #0d9488;
}

.step-total .step-icon {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.step-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.step-label {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-primary);
}

.step-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.step-val {
  font-size: 1.15rem;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.step-total {
  border-width: 2px;
  border-color: var(--border-medium);
}

.bg-positive-soft {
  background: rgba(16, 185, 129, 0.07);
  border-color: rgba(16, 185, 129, 0.3);
}

.bg-negative-soft {
  background: rgba(244, 63, 94, 0.07);
  border-color: rgba(244, 63, 94, 0.3);
}

/* DRE Toolbar inside detailed view */
.dre-table-toolbar {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: var(--bg-muted);
}

.badge-env {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 768px) {
  .form-row-2 {
    grid-template-columns: 1fr;
  }
  .waterfall-step {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .step-val {
    text-align: left;
  }
}


/* ==========================================================================
   MULTI-LEVEL DRILL-DOWN DRE STYLING
   ========================================================================== */
.dre-clickable-row {
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}

.dre-clickable-row:hover td {
  background: var(--bg-hover) !important;
}

.subcount-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  background: var(--bg-muted);
  color: var(--text-muted);
  padding: 2px 7px;
  border-radius: 12px;
  margin-left: 8px;
}

.dre-clickable-sub {
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}

.dre-clickable-sub:hover td {
  background: var(--bg-hover) !important;
}

.col-desc.level-2 {
  padding-left: 36px;
  position: relative;
}

.col-desc.level-2::before {
  content: '\21B3';
  position: absolute;
  left: 20px;
  color: var(--text-muted);
  font-weight: bold;
}

.sub-toggle-icon {
  display: inline-block;
  width: 14px;
  font-size: 0.7rem;
  margin-right: 4px;
  color: var(--color-primary);
  font-weight: 900;
}

.tx-pill {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(2, 132, 199, 0.1);
  color: #0284c7;
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: 8px;
}

/* Level 3: Individual Transactions */
.dre-row-tx {
  background: var(--bg-muted);
  font-size: 0.78rem;
}

.dre-row-tx td {
  padding: 8px 20px;
  border-bottom: 1px dashed var(--border-subtle);
}

.dre-row-tx:hover td {
  background: var(--color-primary-light) !important;
}

.col-desc.level-3 {
  padding-left: 56px;
}

.tx-item-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tx-bullet {
  color: var(--color-primary);
  font-weight: 900;
}

.tx-desc {
  font-weight: 700;
  color: var(--text-primary);
}

.tx-client {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.tx-method-badge {
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-secondary);
}

.tx-unit-badge {
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  padding: 2px 6px;
  border-radius: 4px;
}

.tag-sub {
  background: var(--bg-muted);
  color: var(--text-muted);
}

.tag-tx {
  background: rgba(2, 132, 199, 0.12);
  color: #0284c7;
}

.dre-row-tx-empty td {
  padding: 10px 20px 10px 56px;
  font-size: 0.76rem;
  background: var(--bg-muted);
}

/* Intermediate Highlights */
.bg-total-bruto {
  background: rgba(13, 148, 136, 0.08) !important;
  border-top: 1px solid var(--border-medium);
  border-bottom: 1px solid var(--border-medium);
}

.bg-total-clinica {
  background: rgba(16, 185, 129, 0.12) !important;
  border-top: 2px solid #10b981;
  border-bottom: 2px solid #10b981;
}

.bg-total-liquido {
  background: var(--color-primary-light) !important;
  border-top: 2px solid var(--border-medium);
}

.pill-highlight {
  background: rgba(13, 148, 136, 0.18);
  color: #0d9488;
  font-weight: 800;
}

.pill-emerald {
  background: rgba(16, 185, 129, 0.2);
  color: #059669;
  font-weight: 800;
}

/* Prominent Clinica Card in Waterfall */
.step-clinica-destaque {
  background: rgba(16, 185, 129, 0.1) !important;
  border: 2px solid #10b981 !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.12);
}

.step-clinica-destaque .step-icon {
  background: #10b981;
  color: #ffffff;
}

.card-clinica-destaque {
  border: 2px solid rgba(16, 185, 129, 0.4);
  background: linear-gradient(180deg, var(--bg-surface) 0%, rgba(16, 185, 129, 0.04) 100%);
}

.card-prolabore {
  border: 1px solid rgba(139, 92, 246, 0.3);
  background: linear-gradient(180deg, var(--bg-surface) 0%, rgba(139, 92, 246, 0.03) 100%);
}

.hint-click-text {
  font-size: 0.74rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.hint-click-text svg {
  width: 14px;
  height: 14px;
  color: var(--color-primary);
}

@media (max-width: 900px) {
  .dre-table-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}




/* ==========================================================================
   SIDEBAR COLLAPSED STATE (Recolhida / Expandida)
   ========================================================================== */
body.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-width, 80px) !important;
}

body.sidebar-collapsed .main-wrapper {
  margin-left: var(--sidebar-collapsed-width, 80px) !important;
}

body.sidebar-collapsed .brand-info,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-tag,
body.sidebar-collapsed .pulse-indicator,
body.sidebar-collapsed .nav-section-title,
body.sidebar-collapsed .partner-details,
body.sidebar-collapsed #themeText {
  display: none !important;
}

body.sidebar-collapsed .brand-logo-container {
  justify-content: center;
  width: 100%;
}

body.sidebar-collapsed .sidebar-header {
  padding: 18px 14px;
  justify-content: center;
  position: relative;
}

/* Quando expandida: botão na extremidade direita do cabeçalho */
.sidebar-toggle-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  z-index: 20;
}

/* Quando recolhida: botão flutuante exatamente sobre a linha divisória da borda direita */
body.sidebar-collapsed .sidebar-toggle-btn {
  position: absolute;
  top: 20px;
  right: -16px; /* Centralizado exatamente em cima da borda divisória */
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  opacity: 1;
}

body.sidebar-collapsed .sidebar-toggle-btn:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  transform: scale(1.1);
}

body.sidebar-collapsed .nav-item {
  padding: 0 6px;
}

body.sidebar-collapsed .nav-link {
  justify-content: center;
  padding: 12px 0;
  border-radius: var(--radius-md);
}

body.sidebar-collapsed .nav-icon-wrapper {
  margin: 0;
}

body.sidebar-collapsed .partner-badge {
  padding: 10px;
  justify-content: center;
}

body.sidebar-collapsed .partner-icon {
  margin: 0;
}

body.sidebar-collapsed .theme-toggle-btn {
  padding: 10px 0;
  justify-content: center;
}

/* Transições suaves */
.sidebar, .main-wrapper {
  transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1), margin-left 0.28s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Ensure file input is completely hidden */
.file-input-hidden {
  display: none !important;
}

/* Mode Buttons and Pill Filters styling */
.view-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-muted);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.mode-btn, .btn-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.mode-btn:hover, .btn-filter-pill:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.mode-btn.active, .btn-filter-pill.active {
  background: var(--bg-surface-elevated);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

html.dark .mode-btn.active, html.dark .btn-filter-pill.active {
  background: #1e293b;
  color: #10b981;
}

.grid-2-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 1024px) {
  .grid-2-col {
    grid-template-columns: 1fr;
  }
}
/* ==========================================================================
   ENHANCED UPLOAD CARD & DROPZONE STYLING
   ========================================================================== */
.upload-inline-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.upload-dropzone {
  border: 2px dashed rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.03);
  border-radius: var(--radius-lg);
  padding: 34px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  min-height: 220px;
}

.upload-dropzone:hover, .upload-dropzone.drag-over {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.08);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -4px rgba(16, 185, 129, 0.15);
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.dropzone-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  display: grid;
  place-items: center;
  margin-bottom: 6px;
  transition: transform 0.25s ease;
}

.dropzone-icon svg {
  width: 26px;
  height: 26px;
}

.upload-dropzone:hover .dropzone-icon {
  transform: scale(1.1);
  background: rgba(16, 185, 129, 0.2);
}

.dropzone-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin: 0;
}

.dropzone-subtitle {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  margin: 0;
}

.upload-help-text {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.upload-help-text svg {
  width: 16px;
  height: 16px;
  color: #10b981;
  flex-shrink: 0;
  margin-top: 2px;
}