/**
 * LA BRUME LODGES - DESIGN SYSTEM
 * Direction: Sophistication & Trust
 * Inspired by: Stripe, Mercury, Linear
 *
 * Every pixel matters. Intricate minimalism with appropriate personality.
 */

/* ============================================
   1. CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ============================================ */

:root {
  /* === COLOR FOUNDATION: Cool Slate === */

  /* Background layers */
  --bg-base: #f8fafc;
  --bg-surface: #ffffff;
  --bg-elevated: #ffffff;
  --bg-muted: #f1f5f9;
  --bg-subtle: #e2e8f0;

  /* Text hierarchy (4 levels) */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-faint: #94a3b8;

  /* Borders (consistent 0.5px aesthetic) */
  --border-default: rgba(15, 23, 42, 0.08);
  --border-subtle: rgba(15, 23, 42, 0.05);
  --border-emphasis: rgba(15, 23, 42, 0.12);

  /* Accent: Violet (trust, sophistication) */
  --accent-50: #f5f3ff;
  --accent-100: #ede9fe;
  --accent-200: #ddd6fe;
  --accent-500: #8b5cf6;
  --accent-600: #7c3aed;
  --accent-700: #6d28d9;

  /* Semantic colors */
  --success-50: #f0fdf4;
  --success-100: #dcfce7;
  --success-500: #22c55e;
  --success-600: #16a34a;
  --success-text: #15803d;

  --warning-50: #fffbeb;
  --warning-100: #fef3c7;
  --warning-500: #f59e0b;
  --warning-600: #d97706;
  --warning-text: #92400e;

  --error-50: #fef2f2;
  --error-100: #fee2e2;
  --error-500: #ef4444;
  --error-600: #dc2626;
  --error-text: #991b1b;

  --info-50: #eff6ff;
  --info-100: #dbeafe;
  --info-500: #3b82f6;
  --info-600: #2563eb;
  --info-text: #1d4ed8;

  /* === SPACING (4px grid) === */
  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* === TYPOGRAPHY === */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;

  /* Font sizes */
  --text-xs: 11px;
  --text-sm: 12px;
  --text-base: 13px;
  --text-md: 14px;
  --text-lg: 16px;
  --text-xl: 18px;
  --text-2xl: 24px;
  --text-3xl: 32px;

  /* Font weights */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;

  /* Letter spacing */
  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.02em;

  /* === BORDER RADIUS (sharp system) === */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  /* === SHADOWS (subtle, single-layer) === */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 2px 8px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 4px 16px rgba(15, 23, 42, 0.10);

  /* === TRANSITIONS === */
  --transition-fast: 150ms cubic-bezier(0.25, 1, 0.5, 1);
  --transition-base: 200ms cubic-bezier(0.25, 1, 0.5, 1);

  /* === Z-INDEX === */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal-backdrop: 300;
  --z-modal: 400;
  --z-toast: 500;
}

/* === DARK MODE === */
[data-theme="dark"] {
  --bg-base: #0f172a;
  --bg-surface: #1e293b;
  --bg-elevated: #334155;
  --bg-muted: #1e293b;
  --bg-subtle: #334155;

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

  --border-default: rgba(248, 250, 252, 0.10);
  --border-subtle: rgba(248, 250, 252, 0.06);
  --border-emphasis: rgba(248, 250, 252, 0.15);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.5);
}


/* ============================================
   2. BASE RESET & FOUNDATION
   ============================================ */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-base);
  min-height: 100vh;
}


/* ============================================
   3. LAYOUT CONTAINER
   ============================================ */

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--space-4);
}

@media (min-width: 1440px) {
  .container {
    max-width: 1400px;
  }
}


/* ============================================
   4. NAVBAR / HEADER
   ============================================ */

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-surface);
  border: 0.5px solid var(--border-default);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-6);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--text-primary);
  font-weight: var(--font-semibold);
  font-size: var(--text-lg);
  letter-spacing: var(--tracking-tight);
}

.navbar-brand:hover {
  color: var(--accent-600);
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

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

/* Dropdown menu */
.dropdown-menu {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  min-width: 180px;
  background: var(--bg-surface);
  border: 0.5px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2);
  z-index: var(--z-dropdown);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition-fast);
}

.dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  color: var(--text-secondary);
  text-decoration: none;
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}

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

.dropdown-item:active {
  background: var(--bg-subtle);
}

.dropdown-item i {
  font-size: 16px;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.dropdown-item:hover i {
  color: var(--text-secondary);
}

.dropdown-item.text-danger {
  color: var(--error-600);
}

.dropdown-item.text-danger i {
  color: var(--error-500);
}

.dropdown-item.text-danger:hover {
  background: var(--error-50);
  color: var(--error-700);
}

.dropdown-item.text-danger:hover i {
  color: var(--error-600);
}

.dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: var(--space-2) 0;
}


/* ============================================
   4. FILTERS
   ============================================ */

.filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-4);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.filter-group-label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  background: var(--bg-muted);
  border: 0.5px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

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

.filter-pill:has(input:checked) {
  background: var(--accent-50);
  color: var(--accent-700);
  border-color: var(--accent-200);
  font-weight: var(--font-medium);
}

[data-bs-theme="dark"] .filter-pill:has(input:checked) {
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-300);
}

.filter-pill input {
  display: none;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-top: var(--space-4);
  border-top: 0.5px solid var(--border-subtle);
}

.filter-row-label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  white-space: nowrap;
}

.filter-row-inputs {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
}

.filter-row-inputs .form-select {
  width: auto;
  min-width: 130px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
  padding-right: 28px;
}

.filter-row-inputs .form-select:has(option:checked) {
  background-color: var(--bg-muted);
  color: var(--text-primary);
  border-color: transparent;
}

.filter-row-inputs .form-select:hover {
  background-color: var(--bg-subtle);
}

.filter-row-date-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
}

.filter-row-inputs .form-control {
  width: auto;
  min-width: 130px;
}

.filter-row-actions {
  display: flex;
  gap: var(--space-2);
}

.filter-row .btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-sm);
}


/* ============================================
   5. CARDS
   ============================================ */

.card {
  background: var(--bg-surface);
  border: 0.5px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-sm {
  padding: var(--space-4);
}

.card-header {
  padding: var(--space-4);
  border-bottom: 0.5px solid var(--border-subtle);
  background: var(--bg-surface);
}

.card-title {
  font-size: var(--text-md);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.card-body {
  padding: var(--space-4);
}

.card-footer {
  padding: var(--space-3) var(--space-4);
  border-top: 0.5px solid var(--border-subtle);
  background: var(--bg-muted);
}


/* ============================================
   6. KPI CARDS (Dashboard metrics)
   ============================================ */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

@media (max-width: 1024px) {
  .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: 0.5px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  transition: border-color var(--transition-fast);
}

.kpi-card:hover {
  border-color: var(--border-emphasis);
}

.kpi-label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.kpi-value {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  letter-spacing: var(--tracking-tight);
  font-variant-numeric: tabular-nums;
}

.kpi-trend {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-top: var(--space-2);
  font-size: var(--text-sm);
}

.kpi-trend.positive {
  color: var(--success-text);
}

.kpi-trend.negative {
  color: var(--error-text);
}

/* Progress bar in KPI */
.kpi-progress {
  height: 4px;
  background: var(--bg-subtle);
  border-radius: 2px;
  margin-top: var(--space-3);
  overflow: hidden;
}

.kpi-progress-bar {
  height: 100%;
  background: var(--accent-500);
  border-radius: 2px;
  transition: width var(--transition-base);
}


/* ============================================
   7. TABLES
   Design Direction: Utility & Function
   - Borders-only (flat approach)
   - Minimal color (monochrome with functional accents)
   - Monospace for data
   - Tight spacing for density
   ============================================ */

.modern-table-container,
.table-container {
  background: white;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  overflow: hidden;
}

[data-bs-theme="dark"] .modern-table-container,
[data-bs-theme="dark"] .table-container {
  background: var(--color-gray-800);
  border-color: rgba(255, 255, 255, 0.08);
}

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

.modern-table thead,
.table thead {
  background: transparent;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
}

[data-bs-theme="dark"] .modern-table thead,
[data-bs-theme="dark"] .table thead {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.modern-table th,
.table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 500;
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: -0.01em;
}

.modern-table th[data-minwidth],
.table th[data-minwidth] {
  white-space: nowrap;
}

[data-bs-theme="dark"] .modern-table th,
[data-bs-theme="dark"] .table th {
  color: var(--text-muted);
}

.modern-table th.sortable,
.table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color 150ms cubic-bezier(0.25, 1, 0.5, 1);
}

.modern-table th.sortable:hover,
.table th.sortable:hover {
  color: var(--text-primary);
}

.modern-table th.sortable::after,
.table th.sortable::after {
  content: '⇅';
  margin-left: 6px;
  opacity: 0.3;
  font-size: 11px;
}

.modern-table th.sorted-asc::after,
.table th.sorted-asc::after {
  content: '↑';
  opacity: 0.6;
}

.modern-table th.sorted-desc::after,
.table th.sorted-desc::after {
  content: '↓';
  opacity: 0.6;
}

.modern-table tbody tr,
.table tbody tr {
  transition: background 150ms cubic-bezier(0.25, 1, 0.5, 1);
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.05);
}

[data-bs-theme="dark"] .modern-table tbody tr,
[data-bs-theme="dark"] .table tbody tr {
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

.modern-table tbody tr:hover,
.table tbody tr:hover {
  background: rgba(0, 0, 0, 0.02);
}

[data-bs-theme="dark"] .modern-table tbody tr:hover,
[data-bs-theme="dark"] .table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.clickable-row {
  cursor: pointer;
  transition: background 150ms cubic-bezier(0.25, 1, 0.5, 1);
  position: relative;
}

.clickable-row:hover {
  background: var(--bg-muted);
}

.clickable-row::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: transparent;
  transition: background 150ms cubic-bezier(0.25, 1, 0.5, 1);
}

.clickable-row:hover::after {
  background: var(--accent-500);
}

[data-theme="dark"] .clickable-row:hover,
[data-bs-theme="dark"] .clickable-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.modern-table td,
.table td {
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 13px;
  vertical-align: middle;
}

[data-bs-theme="dark"] .modern-table td,
[data-bs-theme="dark"] .table td {
  color: var(--text-primary);
}

/* Monospace for data columns in reservations table */
.modern-table td:nth-child(1), /* ID */
.modern-table td:nth-child(2), /* Data Criacao */
.modern-table td:nth-child(5), /* Check-in */
.modern-table td:nth-child(6), /* Check-out */
.modern-table td:nth-child(9)  /* Valor */
{
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  letter-spacing: -0.01em;
}

/* Alternative class for data cells */
.modern-table td.data-cell,
.table td.data-cell {
  font-family: var(--font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.modern-table tbody tr:last-child,
.table tbody tr:last-child {
  border-bottom: none;
}

/* Action buttons in tables */
.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 150ms cubic-bezier(0.25, 1, 0.5, 1);
  font-size: 16px;
}

.btn-action:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
}

[data-bs-theme="dark"] .btn-action:hover {
  background: rgba(255, 255, 255, 0.04);
}

/* Compact table for dashboard - reduced padding */
.table-compact .modern-table th,
.table-compact .table th,
.table-compact .modern-table td,
.table-compact .table td {
  padding: 8px 12px;
  font-size: 12px;
}

/* Dashboard table container */
.table-dashboard-container {
  background: white;
  border: 0.5px solid var(--border-default);
  border-radius: 8px;
  overflow: hidden;
}

[data-bs-theme="dark"] .table-dashboard-container {
  background: var(--bg-800);
  border-color: rgba(255, 255, 255, 0.08);
}


/* ============================================
   8. BADGES
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px 8px;
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

/* Status badges */
.badge-success {
  background: var(--success-100);
  color: var(--success-text);
}

.badge-warning {
  background: var(--warning-100);
  color: var(--warning-text);
}

.badge-error,
.badge-danger {
  background: var(--error-100);
  color: var(--error-text);
}

.badge-info,
.badge-primary {
  background: var(--info-100);
  color: var(--info-text);
}

.badge-neutral,
.badge-secondary {
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

/* Source badges */
.badge-sheets {
  background: var(--info-100);
  color: var(--info-text);
}

.badge-local {
  background: var(--success-100);
  color: var(--success-text);
}

/* Subtle badges for tables - minimal visual impact */
.badge-subtle {
  background: var(--bg-muted);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
}

.badge-subtle-success {
  background: var(--success-50);
  color: var(--success-600);
}

.badge-subtle-warning {
  background: var(--warning-50);
  color: var(--warning-600);
}

.badge-subtle-error,
.badge-subtle-danger {
  background: var(--error-50);
  color: var(--error-600);
}

.badge-subtle-info,
.badge-subtle-primary {
  background: var(--info-50);
  color: var(--info-600);
}

.badge-subtle-neutral,
.badge-subtle-secondary {
  background: var(--bg-muted);
  color: var(--text-secondary);
}


/* ============================================
   9. BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-family: inherit;
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  line-height: 1;
  border-radius: var(--radius-md);
  border: 0.5px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Primary button */
.btn-primary {
  background: var(--accent-600);
  color: white;
  border-color: var(--accent-600);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-700);
  border-color: var(--accent-700);
}

/* Secondary button */
.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-emphasis);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-muted);
}

/* Ghost button */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-muted);
  color: var(--text-primary);
}

/* Danger button */
.btn-danger {
  background: var(--error-500);
  color: white;
  border-color: var(--error-500);
}

.btn-danger:hover:not(:disabled) {
  background: var(--error-600);
  border-color: var(--error-600);
}

/* Success button */
.btn-success {
  background: var(--success-500);
  color: white;
  border-color: var(--success-500);
}

.btn-success:hover:not(:disabled) {
  background: var(--success-600);
  border-color: var(--success-600);
}

/* Size variants */
.btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-sm);
}

.btn-lg {
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-lg);
}


/* ============================================
   10. FORMS
   ============================================ */

.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.form-control {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  font-family: inherit;
  font-size: var(--text-md);
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 0.5px solid var(--border-emphasis);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.form-control:hover {
  border-color: var(--text-muted);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-500);
  box-shadow: 0 0 0 3px var(--accent-50);
}

.form-control::placeholder {
  color: var(--text-faint);
}

/* Select */
.form-select {
  appearance: none;
  padding-right: var(--space-8);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  background-size: 16px;
}

/* Checkbox group (Tabler-style) */
.form-selectgroup {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-selectgroup-item {
  position: relative;
}

.form-selectgroup-input {
  position: absolute;
  opacity: 0;
}

.form-selectgroup-label {
  display: flex;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-surface);
  border: 0.5px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.form-selectgroup-input:checked + .form-selectgroup-label {
  background: var(--accent-50);
  border-color: var(--accent-500);
  color: var(--accent-700);
}

.form-selectgroup-label:hover {
  border-color: var(--border-emphasis);
}


/* ============================================
   11. TABS
   ============================================ */

.nav-tabs {
  display: flex;
  gap: var(--space-1);
  border-bottom: 0.5px solid var(--border-default);
  margin-bottom: var(--space-4);
}

.nav-tabs .nav-link {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -0.5px;
  transition: all var(--transition-fast);
}

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

.nav-tabs .nav-link.active {
  color: var(--accent-600);
  border-bottom-color: var(--accent-600);
}

.tab-content > .tab-pane {
  display: none;
}

.tab-content > .tab-pane.active {
  display: block;
}


/* ============================================
   12. MODALS
   ============================================ */

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
}

.modal.show {
  opacity: 1;
  visibility: visible;
}

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

.modal-content {
  position: relative;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  background: var(--bg-surface);
  border: 0.5px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateY(16px);
  transition: transform var(--transition-fast);
}

.modal.show .modal-content {
  transform: translateY(0);
}

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

.modal-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin: 0;
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.modal-body {
  padding: var(--space-4);
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-top: 0.5px solid var(--border-subtle);
  background: var(--bg-muted);
}


/* ============================================
   13. TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-surface);
  border: 0.5px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 300px;
  max-width: 400px;
  transform: translateX(120%);
  transition: transform var(--transition-base);
}

.toast.show {
  transform: translateX(0);
}

.toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  color: var(--text-primary);
}

.toast-message {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: 2px;
}

.toast.success {
  border-left: 3px solid var(--success-500);
}

.toast.error {
  border-left: 3px solid var(--error-500);
}

.toast.info {
  border-left: 3px solid var(--info-500);
}


/* ============================================
   14. PAGINATION
   ============================================ */

/* Simplified, minimal pagination for utility-focused interfaces */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-top: 0.5px solid rgba(0, 0, 0, 0.08);
  background: transparent;
}

[data-bs-theme="dark"] .pagination {
  border-top-color: rgba(255, 255, 255, 0.08);
}

.pagination-info {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.pagination-buttons {
  display: flex;
  gap: 4px;
  align-items: center;
}

.pagination-button,
.pagination-btn,
.page-btn,
.page-number {
  padding: 6px 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 150ms cubic-bezier(0.25, 1, 0.5, 1);
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
}

.pagination-button:hover:not(:disabled),
.pagination-btn:hover:not(:disabled),
.page-btn:hover:not(:disabled),
.page-number:hover {
  background: rgba(0, 0, 0, 0.04);
}

[data-bs-theme="dark"] .pagination-button:hover:not(:disabled),
[data-bs-theme="dark"] .pagination-btn:hover:not(:disabled),
[data-bs-theme="dark"] .page-btn:hover:not(:disabled),
[data-bs-theme="dark"] .page-number:hover {
  background: rgba(255, 255, 255, 0.04);
}

.pagination-button:disabled,
.pagination-btn:disabled,
.page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pagination-button.active,
.pagination-btn.active,
.page-number.active {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-primary);
  font-weight: 500;
}

[data-bs-theme="dark"] .pagination-button.active,
[data-bs-theme="dark"] .pagination-btn.active,
[data-bs-theme="dark"] .page-number.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.pagination-ellipsis,
.page-ellipsis {
  padding: 0 8px;
  color: var(--text-muted);
  font-size: 12px;
}


/* ============================================
   15. LOADING STATES
   ============================================ */

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12);
  gap: var(--space-4);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 2px solid var(--bg-subtle);
  border-top-color: var(--accent-500);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-subtle) 25%,
    var(--bg-muted) 50%,
    var(--bg-subtle) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}


/* ============================================
   16. EMPTY STATES
   ============================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12);
  text-align: center;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  color: var(--text-faint);
  margin-bottom: var(--space-4);
}

.empty-state-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.empty-state-description {
  font-size: var(--text-base);
  color: var(--text-muted);
  max-width: 400px;
}


/* ============================================
   17. AVATAR
   ============================================ */

.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--accent-100);
  color: var(--accent-600);
  border-radius: 50%;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
}

.avatar-sm {
  width: 24px;
  height: 24px;
  font-size: var(--text-xs);
}

.avatar-lg {
  width: 40px;
  height: 40px;
  font-size: var(--text-md);
}


/* ============================================
   18. PROGRESS BAR
   ============================================ */

.progress {
  height: 6px;
  background: var(--bg-subtle);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--accent-500);
  border-radius: 3px;
  transition: width var(--transition-base);
}

.progress-bar.bg-success { background: var(--success-500); }
.progress-bar.bg-warning { background: var(--warning-500); }
.progress-bar.bg-error { background: var(--error-500); }


/* ============================================
   19. UTILITIES
   ============================================ */

/* Display */
.d-none { display: none !important; }
.d-flex { display: flex !important; }
.d-block { display: block !important; }
.d-inline-flex { display: inline-flex !important; }

/* Flex */
.flex-row { flex-direction: row !important; }
.flex-column { flex-direction: column !important; }
.align-items-center { align-items: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-end { justify-content: flex-end !important; }
.gap-1 { gap: var(--space-1) !important; }
.gap-2 { gap: var(--space-2) !important; }
.gap-3 { gap: var(--space-3) !important; }
.gap-4 { gap: var(--space-4) !important; }

/* Spacing */
.m-0 { margin: 0 !important; }
.mt-2 { margin-top: var(--space-2) !important; }
.mt-3 { margin-top: var(--space-3) !important; }
.mt-4 { margin-top: var(--space-4) !important; }
.mb-2 { margin-bottom: var(--space-2) !important; }
.mb-3 { margin-bottom: var(--space-3) !important; }
.mb-4 { margin-bottom: var(--space-4) !important; }
.me-2 { margin-right: var(--space-2) !important; }
.ms-2 { margin-left: var(--space-2) !important; }

.p-0 { padding: 0 !important; }
.p-2 { padding: var(--space-2) !important; }
.p-3 { padding: var(--space-3) !important; }
.p-4 { padding: var(--space-4) !important; }
.py-2 { padding-top: var(--space-2) !important; padding-bottom: var(--space-2) !important; }
.py-4 { padding-top: var(--space-4) !important; padding-bottom: var(--space-4) !important; }
.px-3 { padding-left: var(--space-3) !important; padding-right: var(--space-3) !important; }
.px-4 { padding-left: var(--space-4) !important; padding-right: var(--space-4) !important; }

/* Text */
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.text-left { text-align: left !important; }
.text-muted { color: var(--text-muted) !important; }
.text-primary { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-success { color: var(--success-text) !important; }
.text-error { color: var(--error-text) !important; }
.text-accent { color: var(--accent-600) !important; }

.font-mono { font-family: var(--font-mono) !important; }
.font-medium { font-weight: var(--font-medium) !important; }
.font-semibold { font-weight: var(--font-semibold) !important; }

.text-xs { font-size: var(--text-xs) !important; }
.text-sm { font-size: var(--text-sm) !important; }
.text-base { font-size: var(--text-base) !important; }
.text-lg { font-size: var(--text-lg) !important; }
.text-xl { font-size: var(--text-xl) !important; }
.text-2xl { font-size: var(--text-2xl) !important; }

/* Borders */
.border { border: 0.5px solid var(--border-default) !important; }
.border-0 { border: none !important; }
.border-bottom { border-bottom: 0.5px solid var(--border-default) !important; }
.rounded { border-radius: var(--radius-md) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }

/* Background */
.bg-surface { background: var(--bg-surface) !important; }
.bg-muted { background: var(--bg-muted) !important; }
.bg-subtle { background: var(--bg-subtle) !important; }

/* Width */
.w-full { width: 100% !important; }


/* ============================================
   20. RESPONSIVE HELPERS
   ============================================ */

@media (max-width: 768px) {
  .d-md-none { display: none !important; }
  .d-md-block { display: block !important; }
}

@media (min-width: 769px) {
  .d-md-flex { display: flex !important; }
}


/* ============================================
   21. ROW/COL GRID SYSTEM (Bootstrap-compatible)
   ============================================ */

.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 calc(var(--space-2) * -1);
}

.row > [class*="col-"] {
  padding: 0 var(--space-2);
  margin-bottom: var(--space-4);
}

.col-12 { flex: 0 0 100%; max-width: 100%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-4 { flex: 0 0 33.333%; max-width: 33.333%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }

@media (min-width: 768px) {
  .col-md-12 { flex: 0 0 100%; max-width: 100%; }
  .col-md-6 { flex: 0 0 50%; max-width: 50%; }
  .col-md-4 { flex: 0 0 33.333%; max-width: 33.333%; }
  .col-md-3 { flex: 0 0 25%; max-width: 25%; }
}

@media (max-width: 767px) {
  .col-md-3, .col-md-4, .col-md-6 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}


/* ============================================
   22. TABLE RESPONSIVE
   ============================================ */

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}


/* ============================================
   23. ENHANCED NAVBAR COMPONENTS
   ============================================ */

/* Menu Button - More prominent */
.nav-menu-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-muted);
  border: 0.5px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.nav-menu-btn:hover {
  background: var(--bg-subtle);
  border-color: var(--border-emphasis);
  color: var(--text-primary);
  transform: scale(1.02);
}

.nav-menu-btn:active {
  transform: scale(0.98);
}

.nav-menu-btn i {
  font-size: 18px;
}

/* User Button - Structured with better hierarchy */
.user-button {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-surface);
  border: 0.5px solid var(--border-default);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
}

.user-button:hover {
  background: var(--bg-muted);
  border-color: var(--border-emphasis);
  box-shadow: var(--shadow-sm);
}

.user-button:active {
  transform: scale(0.99);
}

.user-button .avatar {
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, var(--accent-500), var(--accent-700));
  color: white;
  font-size: var(--text-sm);
}

.user-button-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.3;
}

.user-button-name {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.user-button-role {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Hide user info on mobile */
@media (max-width: 640px) {
  .user-button-info {
    display: none;
  }

  .user-button {
    padding: var(--space-2);
  }
}


/* ============================================
   24. SEGMENTED TABS (Linear/Apple style)
   ============================================ */

.nav-tabs-segmented {
  display: inline-flex;
  gap: var(--space-1);
  padding: var(--space-1);
  background: var(--bg-muted);
  border-radius: var(--radius-lg);
  border: none;
  margin-bottom: var(--space-4);
}

.nav-tabs-segmented .nav-link {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  border-bottom: none;
  margin-bottom: 0;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav-tabs-segmented .nav-link:hover {
  color: var(--text-secondary);
}

.nav-tabs-segmented .nav-link.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* Responsive segmented tabs */
@media (max-width: 640px) {
  .nav-tabs-segmented {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav-tabs-segmented .nav-link {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
  }
}


/* ============================================
   25. NAVBAR LAYOUT IMPROVEMENTS
   ============================================ */

.navbar-nav {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* Dropdown positioning for new buttons */
.nav-item.dropdown {
  position: relative;
}

.nav-item.dropdown .dropdown-menu {
  top: calc(100% + var(--space-2));
}


/* ============================================
   26. RANKINGS / LEADERBOARD COMPONENT
   ============================================ */

/* Container principal do ranking */
.ranking-container {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: var(--space-6);
  align-items: start;
}

@media (max-width: 768px) {
  .ranking-container {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
}

/* Lista de ranking */
.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Item individual do ranking */
.ranking-item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3) 0;
  border-bottom: 0.5px solid var(--border-subtle);
  transition: background var(--transition-fast);
}

.ranking-item:last-child {
  border-bottom: none;
}

.ranking-item:hover {
  background: var(--bg-muted);
  margin: 0 calc(var(--space-3) * -1);
  padding-left: var(--space-3);
  padding-right: var(--space-3);
  border-radius: var(--radius-md);
}

/* Posição/rank com badge circular */
.ranking-position {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  font-variant-numeric: tabular-nums;
  border-radius: 50%;
  background: var(--bg-muted);
  color: var(--text-secondary);
}

/* Top 3 com destaque */
.ranking-position.gold {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #78350f;
}

.ranking-position.silver {
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  color: #475569;
}

.ranking-position.bronze {
  background: linear-gradient(135deg, #fdba74 0%, #f97316 100%);
  color: #7c2d12;
}

/* Info do item (nome + métricas) */
.ranking-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ranking-name {
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ranking-metrics {
  display: flex;
  gap: var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.ranking-metric {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.ranking-metric i {
  font-size: 14px;
  opacity: 0.7;
}

/* Valor principal à direita */
.ranking-value {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  font-variant-numeric: tabular-nums;
  color: var(--accent-600);
  text-align: right;
  white-space: nowrap;
}

/* Card lateral de destaque (ADR geral) */
.ranking-highlight-card {
  background: var(--bg-surface);
  border: 0.5px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  text-align: center;
  position: sticky;
  top: var(--space-4);
}

.ranking-highlight-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-3);
  background: var(--accent-50);
  border-radius: 50%;
  color: var(--accent-600);
  font-size: 24px;
}

.ranking-highlight-value {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--space-1);
}

.ranking-highlight-label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.ranking-highlight-sublabel {
  font-size: var(--text-xs);
  color: var(--text-faint);
  margin-top: var(--space-2);
}

/* Estatísticas secundárias no card de destaque */
.ranking-highlight-stats {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 0.5px solid var(--border-subtle);
}

.ranking-highlight-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-sm);
}

.ranking-highlight-stat-label {
  color: var(--text-muted);
}

.ranking-highlight-stat-value {
  font-family: var(--font-mono);
  font-weight: var(--font-medium);
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}


/* ============================================
   27. SALES MODULE (Extras)
   ============================================ */

/* Container do formulario Nova Venda (colapsavel) */
.new-sale-form-container {
  background: var(--bg-muted);
  border: 0.5px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

.new-sale-form-header {
  padding-bottom: var(--space-3);
  border-bottom: 0.5px solid var(--border-subtle);
  margin-bottom: var(--space-4);
}

/* Lista de vendas (cards) */
.sales-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Card individual de venda */
.sale-card {
  background: var(--bg-surface);
  border: 0.5px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sale-card:hover {
  border-color: var(--border-emphasis);
  box-shadow: var(--shadow-sm);
}

.sale-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-3);
}

.sale-card-id {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.sale-card-total {
  font-size: var(--text-lg);
}

.sale-card-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.sale-card-client {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-base);
  color: var(--text-primary);
}

.sale-card-client i {
  font-size: 16px;
}

.sale-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.sale-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.sale-card-meta i {
  font-size: 14px;
}

/* Responsive sales cards */
@media (min-width: 768px) {
  .sales-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
  }
}

@media (min-width: 1024px) {
  .sales-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================================
   28. LAUNDRY MODULE (Lavanderia)
   ============================================ */

/* Drop Zone para upload de PDF */
.drop-zone {
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  background: var(--bg-surface);
}

.drop-zone:hover {
  border-color: var(--accent-500);
  background: var(--accent-50);
}

.drop-zone.dragover {
  border-color: var(--accent-600);
  background: var(--accent-100);
}

.drop-zone.has-file {
  border-color: var(--success-500);
  background: var(--success-50);
}

.drop-zone-icon {
  font-size: 48px;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.drop-zone-text {
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin: 0;
}

.drop-zone-filename {
  font-size: var(--text-sm);
  color: var(--text-primary);
  font-weight: var(--font-medium);
  margin-top: var(--space-2);
}

/* Blocos da lavanderia (PDF e ROL) */
.laundry-block {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.laundry-block-title {
  display: flex;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  margin: 0;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  background: var(--bg-muted);
  border-bottom: 1px solid var(--border-default);
}

.laundry-block-footer {
  padding: var(--space-3) var(--space-4);
  background: var(--bg-muted);
  border-top: 1px solid var(--border-default);
  font-size: var(--text-sm);
}

/* Remover borda do container quando dentro do bloco */
.laundry-block .laundry-spreadsheet-container {
  border: none;
  border-radius: 0;
}

/* Container da planilha de lavanderia */
.laundry-spreadsheet-container {
  overflow-x: auto;
  overflow-y: visible;
  max-width: 100%;
  border: 0.5px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  /* Scroll padding para alinhar scrollbar com área dos dias */
  scroll-padding-left: 120px;
  scroll-padding-right: 240px;
}

/* Scrollbar estilizada */
.laundry-spreadsheet-container::-webkit-scrollbar {
  height: 8px;
}

.laundry-spreadsheet-container::-webkit-scrollbar-track {
  background: var(--bg-muted);
  border-radius: 4px;
  margin-left: 120px;
  margin-right: 240px;
}

.laundry-spreadsheet-container::-webkit-scrollbar-thumb {
  background: var(--border-emphasis);
  border-radius: 4px;
}

.laundry-spreadsheet-container::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Tabela da planilha */
.laundry-spreadsheet {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

.laundry-spreadsheet thead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-muted);
}

.laundry-spreadsheet thead th {
  padding: var(--space-2) var(--space-3);
  font-weight: var(--font-semibold);
  text-align: center;
  border-bottom: 1px solid var(--border-default);
  border-right: 0.5px solid var(--border-subtle);
  white-space: nowrap;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--text-muted);
}

.laundry-spreadsheet thead th:last-child {
  border-right: none;
}

/* Header de dia clicável */
.day-header {
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.day-header:hover {
  background: var(--accent-100);
  color: var(--accent-700);
}

/* Header selecionado */
.day-header.selected {
  background: var(--accent-200);
  color: var(--accent-700);
  font-weight: var(--font-semibold);
}

/* Célula de coluna selecionada */
.day-cell.column-selected {
  background: var(--accent-50) !important;
}

.day-cell.column-selected .laundry-input {
  background: var(--accent-50);
  border-color: var(--accent-300);
}

/* Barra de ações de seleção */
.selection-actions {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--accent-50);
  border-bottom: 1px solid var(--accent-200);
  align-items: center;
  flex-wrap: wrap;
}

.selection-actions.hidden {
  display: none;
}

.selection-info {
  font-size: var(--text-sm);
  color: var(--accent-700);
  font-weight: var(--font-medium);
  margin-right: var(--space-2);
}

.block-actions,
.selection-buttons {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.selection-buttons {
  padding-left: var(--space-3);
  border-left: 1px solid var(--neutral-200);
}

/* Coluna fixa (nome do item) */
.sticky-col {
  position: sticky;
  left: 0;
  z-index: 5;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-default);
  min-width: 120px;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
}

.laundry-spreadsheet thead .sticky-col {
  z-index: 11;
  background: var(--bg-muted);
}

.item-name {
  font-weight: var(--font-medium);
  padding: var(--space-2) var(--space-3);
}

.item-name.has-divergence {
  background: var(--warning-50);
  border-left: 3px solid var(--warning-500);
}

.input-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  padding: var(--space-2) var(--space-3);
}

/* Colunas de dias */
.day-col {
  min-width: 36px;
  padding: var(--space-2) var(--space-2);
  text-align: center;
}

.day-cell {
  padding: var(--space-1) var(--space-2);
  text-align: center;
  border-right: 0.5px solid var(--border-subtle);
  border-bottom: 0.5px solid var(--border-subtle);
  background: var(--bg-surface);
}

.day-cell.cell-divergence {
  font-weight: var(--font-semibold);
}

/* Divergência: valor menor que o PDF (vermelho) */
.day-cell.cell-divergence-lower {
  background: var(--error-50);
  color: var(--error-600);
  font-weight: var(--font-semibold);
}

.day-cell.cell-divergence-lower .laundry-input {
  color: var(--error-600);
  font-weight: var(--font-semibold);
}

/* Divergência: valor maior que o PDF (verde) */
.day-cell.cell-divergence-higher {
  background: var(--success-50);
  color: var(--success-600);
  font-weight: var(--font-semibold);
}

.day-cell.cell-divergence-higher .laundry-input {
  color: var(--success-600);
  font-weight: var(--font-semibold);
}

/* Linhas da planilha */
.pdf-row .day-cell {
  color: var(--text-primary);
}

.input-row .day-cell {
  background: var(--bg-muted);
  padding: var(--space-1);
}

/* Input cells */
.input-cell {
  padding: 2px !important;
}

.laundry-input {
  width: 100%;
  min-width: 32px;
  padding: 4px 6px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  text-align: center;
  font-variant-numeric: tabular-nums;
  background: var(--bg-surface);
  transition: all var(--transition-fast);
}

/* Remove botões de incremento/decremento (spinners) */
.laundry-input::-webkit-outer-spin-button,
.laundry-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.laundry-input[type=number] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.laundry-input:focus {
  outline: none;
  border-color: var(--accent-500);
  box-shadow: 0 0 0 2px var(--accent-100);
}

.laundry-input::placeholder {
  color: var(--text-faint);
  font-size: var(--text-xs);
}

/* Placeholder do ROL mostra sugestão do PDF */
.laundry-input-my::placeholder {
  color: var(--accent-400);
  opacity: 0.7;
  font-style: italic;
}

/* Input da linha PDF (destaque para edição) */
.laundry-input-pdf {
  background: linear-gradient(to bottom, #fffbf0 0%, #fff9e6 100%);
  border-color: #f5e6b3;
}

.laundry-input-pdf:focus {
  background: #fffbf0;
  border-color: var(--accent-500);
  box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.15);
}

/* Input da linha Meu (mantém estilo padrão) */
.laundry-input-my {
  /* Herda estilos de .laundry-input */
}

/* Colunas de totais e valores */
.total-cell,
.my-total-cell,
.diff-cell {
  padding: var(--space-2) var(--space-3);
  text-align: right;
  font-weight: var(--font-semibold);
  border-right: 0.5px solid var(--border-subtle);
  border-bottom: 0.5px solid var(--border-subtle);
  min-width: 60px;
  white-space: nowrap;
}

/* Colunas fixas à direita (Total, R$/un, Valor) */
.sticky-right {
  position: sticky;
  z-index: 5;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-default);
  width: 80px;
  min-width: 80px;
  max-width: 80px;
  white-space: nowrap;
  text-align: right;
  padding: var(--space-2) var(--space-3);
  font-variant-numeric: tabular-nums;
  box-shadow: -2px 0 4px rgba(0, 0, 0, 0.05);
}

.sticky-right-1 { right: 0; }
.sticky-right-2 { right: 80px; }
.sticky-right-3 { right: 160px; }

/* Input dentro de colunas sticky-right */
.sticky-right.input-cell {
  padding: 2px;
}

.sticky-right .laundry-input {
  text-align: right;
  width: 100%;
}

.laundry-input-price {
  text-align: right !important;
}

.laundry-spreadsheet thead .sticky-right {
  z-index: 11;
  background: var(--bg-muted);
}

/* Backgrounds das colunas sticky por tipo de linha */
.pdf-row .sticky-right {
  background: var(--bg-surface);
}

.rol-row .sticky-right {
  background: var(--bg-muted);
}

.total-cell {
  background: var(--accent-50) !important;
  color: var(--accent-700);
}

.my-total-cell {
  background: var(--bg-muted);
}

.diff-cell {
  background: var(--bg-surface);
  color: var(--text-muted);
}

.diff-cell.diff-positive {
  background: var(--success-50);
  color: var(--success-700);
}

.diff-cell.diff-negative {
  background: var(--error-50);
  color: var(--error-700);
}

/* Responsivo - Mobile */
@media (max-width: 768px) {
  .laundry-spreadsheet {
    font-size: var(--text-xs);
  }

  .day-col,
  .day-cell {
    min-width: 28px;
    padding: var(--space-1);
    font-size: 11px;
  }

  .laundry-input {
    min-width: 24px;
    padding: 2px 4px;
    font-size: 11px;
  }

  .sticky-col {
    min-width: 80px;
    max-width: 100px;
    font-size: 11px;
  }

  .item-name,
  .input-label {
    padding: var(--space-1) var(--space-2);
  }
}

/* Dark mode ajustes */
:root.dark-mode .laundry-input {
  background: var(--bg-muted);
  color: var(--text-primary);
}

:root.dark-mode .sticky-col,
:root.dark-mode .day-cell,
:root.dark-mode .sticky-right {
  background: var(--bg-surface);
}

:root.dark-mode .input-row .day-cell,
:root.dark-mode .rol-row .sticky-right {
  background: var(--bg-muted);
}

:root.dark-mode .item-name.has-divergence {
  background: rgba(251, 191, 36, 0.1);
}

:root.dark-mode .day-cell.cell-divergence {
  background: rgba(251, 191, 36, 0.15);
}

:root.dark-mode .day-cell.cell-divergence-lower {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

:root.dark-mode .day-cell.cell-divergence-lower .laundry-input {
  color: #fca5a5;
}

:root.dark-mode .day-cell.cell-divergence-higher {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
}

:root.dark-mode .day-cell.cell-divergence-higher .laundry-input {
  color: #86efac;
}

/* Dark mode: seleção de colunas */
:root.dark-mode .day-header:hover {
  background: rgba(139, 92, 246, 0.2);
}

:root.dark-mode .day-header.selected {
  background: rgba(139, 92, 246, 0.3);
  color: #c4b5fd;
}

:root.dark-mode .day-cell.column-selected {
  background: rgba(139, 92, 246, 0.1) !important;
}

:root.dark-mode .day-cell.column-selected .laundry-input {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.3);
}

:root.dark-mode .selection-actions {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.2);
}

:root.dark-mode .selection-info {
  color: #c4b5fd;
}

:root.dark-mode .selection-buttons {
  border-color: rgba(255, 255, 255, 0.15);
}

/* ============================================================================
   MODAL DE DIVERGÊNCIAS
   ============================================================================ */

.divergence-summary {
  padding: var(--space-3);
  background: var(--warning-50);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--warning-500);
}

.divergence-item {
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.divergence-item-header {
  padding: var(--space-3);
  background: var(--neutral-50);
  border-bottom: 1px solid var(--neutral-200);
}

.divergence-table {
  width: 100%;
  font-size: var(--text-sm);
}

.divergence-table th,
.divergence-table td {
  padding: var(--space-2) var(--space-3);
  text-align: center;
  border-bottom: 1px solid var(--neutral-100);
}

.divergence-table th {
  background: var(--neutral-50);
  font-weight: var(--font-medium);
}

.divergence-table tbody tr:hover {
  background: var(--neutral-50);
}

/* Dark mode: divergências */
:root.dark-mode .divergence-summary {
  background: rgba(234, 179, 8, 0.1);
  border-color: var(--warning-500);
}

:root.dark-mode .divergence-item {
  border-color: var(--neutral-700);
}

:root.dark-mode .divergence-item-header {
  background: var(--neutral-800);
  border-color: var(--neutral-700);
}

:root.dark-mode .divergence-table th {
  background: var(--neutral-800);
}

:root.dark-mode .divergence-table td {
  border-color: var(--neutral-800);
}

:root.dark-mode .divergence-table tbody tr:hover {
  background: var(--neutral-800);
}
