/* ==========================================================================
   Sobra Real CSS Stylesheet
   Design System: Premium Dark Mode, Glassmorphism, Modern Transitions
   ========================================================================== */

/* --- Custom Variables & Tokens --- */
:root {
  --font-title: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Color Palette */
  --bg-main: #0a0d14;
  --bg-card: rgba(20, 24, 33, 0.65);
  --bg-card-hover: rgba(28, 34, 46, 0.8);
  --border-color: rgba(255, 255, 255, 0.06);
  --border-color-hover: rgba(255, 255, 255, 0.12);
  
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  /* Action Accents */
  --color-cyan: #06b6d4;
  --color-cyan-hover: #0891b2;
  --color-cyan-soft: rgba(6, 182, 212, 0.1);
  
  --color-green: #10b981;
  --color-green-hover: #059669;
  --color-green-soft: rgba(16, 185, 129, 0.1);
  
  --color-purple: #8b5cf6;
  --color-purple-hover: #7c3aed;
  --color-purple-soft: rgba(139, 92, 246, 0.1);
  
  --color-orange: #f97316;
  --color-orange-hover: #ea580c;
  --color-orange-soft: rgba(249, 115, 22, 0.1);
  
  --color-red: #ef4444;
  --color-red-hover: #dc2626;
  --color-red-soft: rgba(239, 68, 68, 0.1);

  --glass-blur: blur(12px);
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --shadow-main: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --shadow-glow: 0 0 20px rgba(6, 182, 212, 0.15);
}

/* --- Resets & Global Styles --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: "";
  position: absolute;
  top: -10%;
  left: -10%;
  width: 50%;
  height: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
}

body::after {
  content: "";
  position: absolute;
  bottom: -10%;
  right: -10%;
  width: 50%;
  height: 50%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.08) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
}

/* --- Common UI Utilities --- */
.text-cyan { color: var(--color-cyan) !important; }
.text-green { color: var(--color-green) !important; }
.text-purple { color: var(--color-purple) !important; }
.text-orange { color: var(--color-orange) !important; }
.text-red { color: var(--color-red) !important; }

.font-bold { font-weight: 700; }
.animate-pulse { animation: pulse 2s infinite; }
.hidden { display: none !important; }

.glass {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-main);
}

/* --- Google Login Screen Overlay --- */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: radial-gradient(circle at center, #111827 0%, #030712 100%);
}

.login-card {
  max-width: 480px;
  width: 100%;
  padding: 40px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  margin-bottom: 35px;
}

.logo-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--color-cyan) 0%, var(--color-purple) 100%);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 20px;
  box-shadow: 0 0 30px rgba(6, 182, 212, 0.3);
}

.logo-icon i {
  font-size: 28px;
  color: #fff;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.2));
}

.brand h1 {
  font-family: var(--font-title);
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.brand h1 span {
  color: var(--color-cyan);
}

.brand p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.login-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background-color: #ffffff;
  color: #1f2937;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 28px;
  cursor: pointer;
  transition: var(--transition-smooth);
  width: 100%;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.google-btn:hover {
  background-color: #f9fafb;
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

.google-svg {
  flex-shrink: 0;
}

.secure-text {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* --- Google Mock Account Picker --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background-color: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

.google-picker-card {
  background-color: #ffffff;
  color: #1f2937;
  width: 100%;
  max-width: 400px;
  border-radius: 8px;
  box-shadow: 0 24px 38px 3px rgba(0,0,0,0.14), 0 9px 46px 8px rgba(0,0,0,0.12), 0 11px 15px -7px rgba(0,0,0,0.2);
  padding: 36px 30px;
  font-family: Roboto, Arial, sans-serif;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.picker-header {
  text-align: center;
  margin-bottom: 24px;
}

.picker-header svg {
  margin-bottom: 12px;
}

.picker-header h2 {
  font-size: 22px;
  font-weight: 400;
  color: #202124;
  margin-bottom: 4px;
}

.picker-header p {
  font-size: 14px;
  color: #5f6368;
}

.account-list {
  list-style: none;
  border-top: 1px solid #dadce0;
  border-bottom: 1px solid #dadce0;
  margin-bottom: 16px;
  max-height: 260px;
  overflow-y: auto;
}

.account-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  cursor: pointer;
  border-bottom: 1px solid #f1f3f4;
  transition: background-color 0.15s;
}

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

.account-item:hover {
  background-color: #f8f9fa;
}

.account-item img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

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

.account-info .name {
  font-size: 14px;
  font-weight: 500;
  color: #3c4043;
}

.account-info .email {
  font-size: 12px;
  color: #5f6368;
}

.custom-account .avatar-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #f1f3f4;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5f6368;
  font-size: 14px;
}

.picker-footer {
  font-size: 11px;
  color: #70757a;
  line-height: 1.5;
}

/* --- Custom Account Modal --- */
.custom-account-card {
  max-width: 360px;
  padding: 24px;
  background: #1f2937 !important;
  color: #f3f4f6;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  border-radius: 12px;
}

.custom-account-card h3 {
  font-family: var(--font-title);
  margin-bottom: 16px;
  font-size: 18px;
}

/* --- Main Layout Structure --- */
.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 0 20px;
  max-width: 1440px;
  margin: 0 auto;
}

/* Header & Profile Styles */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding: 16px 28px;
  border-radius: var(--radius-md);
  margin-bottom: 25px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-title);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.logo i {
  font-size: 20px;
  background: linear-gradient(135deg, var(--color-cyan) 0%, var(--color-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 50px;
}

#user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--color-cyan);
  object-fit: cover;
}

.user-meta {
  display: flex;
  flex-direction: column;
}

.user-name-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.user-status {
  font-size: 10px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.user-status i {
  font-size: 6px;
}

.logout-btn-header {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-red);
  border: 1px solid rgba(239, 68, 68, 0.2);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.logout-btn-header:hover {
  background: var(--color-red);
  color: #fff;
  transform: scale(1.05);
}

/* Action Bar Styles */
.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  gap: 15px;
  flex-wrap: wrap;
}

.quick-actions {
  display: flex;
  gap: 15px;
}

.system-actions {
  display: flex;
  gap: 10px;
}

/* Button Component Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-small {
  padding: 8px 14px;
  font-size: 12px;
}

.btn-primary {
  background-color: var(--color-cyan);
  color: #fff;
}

.btn-primary:hover {
  background-color: var(--color-cyan-hover);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
  transform: translateY(-1px);
}

.btn-success {
  background-color: var(--color-green);
  color: #fff;
}

.btn-success:hover {
  background-color: var(--color-green-hover);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
  background-color: var(--color-red);
  color: #fff;
}

.btn-danger:hover {
  background-color: var(--color-red-hover);
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.btn-icon {
  width: 42px;
  height: 42px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon span {
  display: none;
}

@media (min-width: 640px) {
  .btn-icon {
    width: auto;
    padding: 12px 18px;
  }
  .btn-icon span {
    display: inline;
  }
}

/* Filter & Picker Layout */
.filter-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  margin-bottom: 25px;
  gap: 20px;
  flex-wrap: wrap;
}

.filter-tabs {
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.2);
  padding: 4px;
  border-radius: 8px;
  flex-wrap: wrap;
}

.filter-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.filter-tab:hover {
  color: #fff;
}

.filter-tab.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-cyan);
  font-weight: 600;
}

.custom-date-container {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.date-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-input-group label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.date-input-group input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: 6px;
  padding: 6px 12px;
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
}

.date-input-group input:focus {
  border-color: var(--color-cyan);
}

/* KPI Cards Layout */
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 25px;
}

@media (min-width: 640px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.kpi-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.kpi-card:hover {
  transform: translateY(-3px);
  background: var(--bg-card-hover);
  border-color: var(--border-color-hover);
}

.kpi-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
}

.border-cyan::after { background: var(--color-cyan); }
.border-green::after { background: var(--color-green); }
.border-purple::after { background: var(--color-purple); }
.border-orange::after { background: var(--color-orange); }

.border-cyan:hover { box-shadow: 0 10px 20px -10px rgba(6, 182, 212, 0.15); }
.border-green:hover { box-shadow: 0 10px 20px -10px rgba(16, 185, 129, 0.15); }
.border-purple:hover { box-shadow: 0 10px 20px -10px rgba(139, 92, 246, 0.15); }
.border-orange:hover { box-shadow: 0 10px 20px -10px rgba(249, 115, 22, 0.15); }

.kpi-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 22px;
  flex-shrink: 0;
}

.bg-cyan-soft { background: var(--color-cyan-soft); }
.bg-green-soft { background: var(--color-green-soft); }
.bg-purple-soft { background: var(--color-purple-soft); }
.bg-orange-soft { background: var(--color-orange-soft); }

.kpi-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.kpi-info h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 6px;
}

.kpi-value {
  font-family: var(--font-title);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 6px;
}

.kpi-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

.kpi-sub-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.kpi-sub-stats span strong {
  color: var(--text-primary);
}

.kpi-sub-stats .divider {
  color: rgba(255, 255, 255, 0.1);
  font-weight: 300;
}

/* Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 25px;
}

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

.chart-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.chart-header {
  margin-bottom: 20px;
}

.chart-header h3 {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
}

.chart-container {
  position: relative;
  height: 300px;
  width: 100%;
}

/* Table / History Section */
.history-section {
  padding: 24px;
  margin-bottom: 40px;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.history-header h2 {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.history-filters {
  display: flex;
  gap: 8px;
}

.history-filter-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.history-filter-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.history-filter-btn.active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}

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

.history-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.history-table th {
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.history-table td {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  vertical-align: middle;
}

.history-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.01);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 50px;
}

.badge-recarga {
  background-color: var(--color-cyan-soft);
  color: var(--color-cyan);
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.badge-ganho {
  background-color: var(--color-green-soft);
  color: var(--color-green);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-despesa {
  background-color: var(--color-red-soft);
  color: var(--color-red);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-delete-item {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 15px;
  transition: var(--transition-smooth);
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.btn-delete-item:hover {
  background: var(--color-red-soft);
  color: var(--color-red);
}

.no-data-alert {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 50px 20px;
  color: var(--text-muted);
  text-align: center;
  gap: 12px;
}

.no-data-alert i {
  font-size: 38px;
}

.no-data-alert p {
  font-size: 14px;
}

/* Modais de Formulário */
.modal-card {
  width: 100%;
  max-width: 580px;
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 15px;
}

.modal-header h2 {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.modal-close:hover {
  color: #fff;
  transform: rotate(90deg);
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

@media (min-width: 640px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
}

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

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: var(--transition-smooth);
}

.form-group input:focus {
  border-color: var(--color-cyan);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.15);
  background: rgba(0, 0, 0, 0.4);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.optional {
  font-size: 11px;
  color: var(--text-muted);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 10px;
}

/* JSON Database Import Modal Content Styles */
.modal-body-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-body-content p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.warning-alert {
  background: var(--color-orange-soft);
  border: 1px solid rgba(249, 115, 22, 0.2);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: #ffedd5;
  font-size: 13px;
  line-height: 1.5;
}

.warning-alert i {
  color: var(--color-orange);
  font-size: 16px;
  margin-top: 2px;
}

.file-upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 30px;
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  position: relative;
  transition: var(--transition-smooth);
}

.file-upload-area:hover {
  border-color: var(--color-cyan);
  background: rgba(6, 182, 212, 0.02);
}

.file-upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--color-cyan);
  font-weight: 600;
  font-size: 14px;
  pointer-events: none;
}

.file-upload-label i {
  font-size: 32px;
}

.selected-file-text {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 10px;
  word-break: break-all;
  max-width: 100%;
}

/* Footer Section */
.app-footer {
  text-align: center;
  padding: 30px 0;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-version {
  font-size: 11px;
}

/* --- Toast Notification Component --- */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 2000;
  background: #111827;
  border: 1px solid rgba(255,255,255,0.08);
  border-left: 4px solid var(--color-cyan);
  border-radius: 6px;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 380px;
}

.toast.success {
  border-left-color: var(--color-green);
}
.toast.success i {
  color: var(--color-green);
}
.toast.error {
  border-left-color: var(--color-red);
}
.toast.error i {
  color: var(--color-red);
}
.toast.info {
  border-left-color: var(--color-cyan);
}
.toast.info i {
  color: var(--color-cyan);
}

/* --- Keyframe Animations --- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

/* Custom Scrollbar for modern look */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   Seção de Sincronização & Integrações (Estilos Adicionais)
   ========================================================================== */

.btn-sync {
  background-color: var(--color-purple);
  color: #fff;
}

.btn-sync:hover {
  background-color: var(--color-purple-hover);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
  transform: translateY(-1px);
}

.modal-large {
  max-width: 800px;
  width: 95%;
}

.modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
  gap: 10px;
}

.modal-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-title);
  font-size: 15px;
  font-weight: 600;
  padding: 12px 20px;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.modal-tab:hover {
  color: var(--text-primary);
  border-bottom-color: rgba(255, 255, 255, 0.2);
}

.modal-tab.active {
  color: var(--color-purple);
  border-bottom-color: var(--color-purple);
}

.modal-tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.modal-tab-content.active {
  display: block;
}

.tab-desc {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 20px;
  line-height: 1.5;
}

.sync-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

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

.sync-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.sync-card h3 {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sync-help {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.sync-textarea {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: monospace;
  font-size: 12px;
  padding: 10px;
  min-height: 120px;
  resize: vertical;
  outline: none;
  transition: var(--transition-smooth);
}

.sync-textarea:focus {
  border-color: var(--color-purple);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.15);
}

.btn-full {
  width: 100%;
  justify-content: center;
}

.bg-black {
  background-color: #000 !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.bg-black:hover {
  background-color: #111 !important;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.1) !important;
}

.center-align {
  align-items: center;
  justify-content: center;
  text-align: center;
}

.sync-status-box {
  padding: 15px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 10px 0;
}

.status-indicator {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-indicator.offline {
  color: var(--color-red);
}

.status-indicator.offline i {
  font-size: 8px;
}

.status-indicator.online {
  color: var(--color-green);
}

.status-indicator.online i {
  font-size: 8px;
  animation: pulse 1.5s infinite;
}

.status-indicator.syncing {
  color: var(--color-purple);
}

.status-indicator.syncing i {
  animation: spin 1s infinite linear;
}

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

.charger-network-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.network-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-color);
  padding: 10px 15px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.btn-small {
  padding: 6px 12px;
  font-size: 11px;
}

/* ==========================================================================
   Mobile Bottom Navigation & Responsividade UX (App Mode)
   ========================================================================== */

.bottom-nav {
  display: none;
}

/* Modal Bottom Sheet */
.bottom-sheet {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--border-color);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  box-shadow: var(--shadow-main);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  padding: 20px 20px 40px;
  z-index: 1000;
  animation: slideUpSheet 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bottom-sheet-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 25px;
  position: relative;
}

.drag-handle {
  width: 40px;
  height: 5px;
  background-color: var(--text-muted);
  border-radius: 10px;
  margin-bottom: 15px;
}

.bottom-sheet-header h2 {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.bottom-sheet-header .modal-close {
  position: absolute;
  right: 0;
  top: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.mobile-launch-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.launch-card-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 25px 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-primary);
  font-family: var(--font-title);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.launch-card-btn i {
  font-size: 24px;
}

.launch-card-btn:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.05);
}

.border-cyan { border-color: rgba(6, 182, 212, 0.3) !important; }
.border-green { border-color: rgba(16, 185, 129, 0.3) !important; }
.border-red { border-color: rgba(239, 68, 68, 0.3) !important; }
.border-purple { border-color: rgba(139, 92, 246, 0.3) !important; }

@keyframes slideUpSheet {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* Breakpoint Responsivo para Mobile (App Mode) */
@media (max-width: 768px) {
  body {
    padding-bottom: 80px; /* Margem para a bottom-nav */
  }

  .app-main {
    padding: 15px 10px;
  }

  /* Ocultar cabeçalhos redundantes e botões rápidos do topo */
  .action-bar {
    display: none;
  }

  .header-right {
    display: none; /* No mobile, o botão de sair ou perfil fica reduzido */
  }
  
  .app-header {
    padding: 15px;
    justify-content: center; /* Centralizar logo */
  }

  /* Bottom Navigation */
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: rgba(10, 13, 20, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    justify-content: space-around;
    align-items: center;
    z-index: 998;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .bottom-nav-item {
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-secondary);
    font-size: 10px;
    font-family: var(--font-body);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
    width: 60px;
    height: 100%;
  }

  .bottom-nav-item i {
    font-size: 18px;
  }

  .bottom-nav-item.active {
    color: var(--color-purple);
  }

  /* Botão Lançar Central Especial */
  .launch-plus-btn {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--color-purple) 0%, var(--color-cyan) 100%);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-size: 18px;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
    margin-top: -15px;
    transition: var(--transition-smooth);
  }

  .bottom-nav-item:active .launch-plus-btn {
    transform: scale(0.9);
  }

  /* KPIs mais densas e legíveis no celular */
  .metrics-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .kpi-card {
    padding: 15px;
  }

  .kpi-value {
    font-size: 20px;
  }

  .kpi-subtitle {
    font-size: 11px;
  }

  /* Ocultar gráficos no mobile por padrão ou deixá-los em coluna simples */
  .charts-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .chart-card {
    padding: 15px;
    min-height: 250px;
  }

  /* Tabelas Adaptadas com Scroll Rígido no Celular */
  .history-section {
    padding: 15px 10px;
  }
  
  .history-table th, .history-table td {
    padding: 10px 8px;
    font-size: 12px;
  }
  
  .badge {
    padding: 2px 6px;
    font-size: 10px;
  }

  /* Seções Ocultáveis para Controle de Abas Mobile */
  .app-main > section {
    display: none;
  }

  /* Mostrar apenas a ativa */
  .app-main > section.mobile-visible {
    display: block !important;
  }
  
  /* Filtros fixos */
  .filter-section.mobile-visible {
    display: flex !important;
  }

  .app-footer {
    padding: 20px 15px 10px;
    font-size: 11px;
  }
}
