:root {
  --primary-color: #007ec7; /* Corporate blue */
  --primary-dark: #005fa3;
  --primary-light: #e6f4fb;
  --primary-700: #0e62a6; /* Deep brand blue */
  --primary-800: #0a3a5f; /* Deep brand blue for dark sections in light mode */
  --secondary-color: #4f46e5;
  --secondary-light: #818cf8;
  --accent-color: #3b82f6;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-light: #94a3b8;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --danger-light: #fee2e2;
  --warning-text: #f59e0b;
  --background-color: #f8fafc;
  --surface-color: #f1f5f9;
  --card-background: #ffffff;
  --border-color: #e2e8f0;
  --sidebar-width: 250px;
  --sidebar-collapsed-width: 80px;
  --topbar-height: 60px;
  --breadcrumb-height: 44px;
  --card-radius: 8px;
  --input-radius: 8px;
  --transition-speed: 0.3s;
  --box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Dark mode theme - Esquema mais claro com cinzentos e azul */
[data-theme="dark"] {
  --primary-color: #3b82f6; /* Azul mais vibrante */
  --primary-dark: #2563eb;
  --primary-light: #1e3a8a; /* Azul escuro para backgrounds */
  --primary-700: #2563eb; /* Azul médio para dark mode */
  --primary-800: #1e3a8a; /* Azul escuro para secções em dark mode */
  --secondary-color: #818cf8;
  --secondary-light: #6366f1;
  --accent-color: #60a5fa;
  --text-primary: #f8fafc; /* Branco suave para texto principal */
  --text-secondary: #cbd5e1; /* Cinzento claro para texto secundário */
  --text-light: #94a3b8; /* Cinzento médio para texto leve */
  --success-color: #22c55e;
  --warning-color: #fbbf24;
  --danger-color: #ef4444;
  --danger-light: #3a3d4a;
  --warning-text: #fbbf24;
  --background-color: #1a1f2e; /* Cinzento azulado mais escuro */
  --surface-color: #2d3748; /* Cinzento médio-escuro para superfícies */
  --card-background: #2d3748; /* Cinzento médio-escuro para cards */
  --border-color: #3d4756; /* Cinzento escuro para bordas */
  --sidebar-width: 250px;
  --sidebar-collapsed-width: 80px;
  --topbar-height: 60px;
  --breadcrumb-height: 44px;
  --card-radius: 8px;
  --input-radius: 8px;
  --transition-speed: 0.3s;
  --box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.15);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.25),
    0 2px 4px -1px rgba(0, 0, 0, 0.18);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.25),
    0 4px 6px -2px rgba(0, 0, 0, 0.18);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--background-color);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  /* Custom scrollbar styling para body quando necessário */
  scrollbar-width: thin !important;
  scrollbar-color: rgba(0, 0, 0, 0.2) transparent !important;
}

/* Custom scrollbar para body/html quando têm scroll */
body::-webkit-scrollbar,
html::-webkit-scrollbar {
  width: 8px !important;
}

body::-webkit-scrollbar-track,
html::-webkit-scrollbar-track {
  background: transparent;
}

body::-webkit-scrollbar-thumb,
html::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.25) !important;
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: background 0.3s ease;
}

body::-webkit-scrollbar-thumb:hover,
html::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.4) !important;
}

body::-webkit-scrollbar-thumb:active,
html::-webkit-scrollbar-thumb:active {
  background: rgba(0, 0, 0, 0.5) !important;
}

/* Dark mode para body scrollbar */
[data-theme="dark"] body {
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent !important;
}

[data-theme="dark"] body::-webkit-scrollbar-thumb,
[data-theme="dark"] html::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25) !important;
}

[data-theme="dark"] body::-webkit-scrollbar-thumb:hover,
[data-theme="dark"] html::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4) !important;
}

[data-theme="dark"] body::-webkit-scrollbar-thumb:active,
[data-theme="dark"] html::-webkit-scrollbar-thumb:active {
  background: rgba(255, 255, 255, 0.5) !important;
}

.dashboard-container {
  display: flex;
  min-height: 100vh;
}

.dashboard-container.sidebar-collapsed {
  grid-template-columns: var(--sidebar-collapsed-width) -1fr;
}

/* ===== SIDEBAR ===== */
/* Sidebar */
.sidebar {
  background: linear-gradient(195deg, #007ec7, #02204e);
  color: white;
  padding: 1rem 0;
  width: var(--sidebar-width);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-speed) ease;
  z-index: 100;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
  /* Custom scrollbar styling */
  scrollbar-width: thin !important;
  scrollbar-color: rgba(255, 255, 255, 0.4) transparent !important;
}

/* Custom scrollbar para Webkit browsers (Chrome, Safari, Edge) */
.sidebar::-webkit-scrollbar {
  width: 8px !important;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
  margin: 8px 0;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.35) !important;
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: background 0.3s ease;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.55) !important;
  background-clip: padding-box;
}

.sidebar::-webkit-scrollbar-thumb:active {
  background: rgba(255, 255, 255, 0.7) !important;
  background-clip: padding-box;
}

.sidebar .logo {
  font-size: 1.2rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  margin-bottom: 1rem;
  color: white;
}

.sidebar .logo i {
  font-size: 1.5rem;
}

.nav-menu {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0 0.75rem;
}

.nav-section {
  margin-top: 1.5rem;
  padding-left: 0.75rem;
}

.nav-section h3 {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05rem;
  margin-bottom: 0.5rem;
  padding-left: 0.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: #b8c2cc;
  text-decoration: none;
  transition: all var(--transition-speed) ease;
  border-radius: var(--card-radius);
  font-size: 0.9rem;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.nav-item i {
  width: 20px;
  text-align: center;
  font-size: 1rem;
}

.main-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  transition: margin-left var(--transition-speed) ease;
  width: calc(100% - var(--sidebar-width));
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 2rem;
  padding-top: calc(var(--topbar-height) + 1rem);
  background-color: var(--background-color);
  min-height: 100vh;
  position: relative;
  z-index: 51; /* Maior que breadcrumb (z-index: 50) */
  /* Custom scrollbar styling */
  scrollbar-width: thin !important;
  scrollbar-color: rgba(0, 0, 0, 0.2) transparent !important;
}

/* Custom scrollbar para Webkit browsers (Chrome, Safari, Edge) - Main Content */
.main-content::-webkit-scrollbar {
  width: 8px !important;
}

.main-content::-webkit-scrollbar-track {
  background: transparent;
  margin: 8px 0;
}

.main-content::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.25) !important;
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: background 0.3s ease;
}

.main-content::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.4) !important;
  background-clip: padding-box;
}

.main-content::-webkit-scrollbar-thumb:active {
  background: rgba(0, 0, 0, 0.5) !important;
  background-clip: padding-box;
}

/* Top Bar */
.top-bar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--topbar-height);
  background: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  box-shadow: var(--box-shadow);
  z-index: 99;
}

.top-bar .search-bar {
  flex: 1;
  max-width: 400px;
  margin-right: 1rem;
}

.top-bar .search-bar input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #e0e0e0;
  border-radius: var(--card-radius);
  font-size: 0.9rem;
  background-color: #f5f5f5;
}

.top-bar .user-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.top-bar .notification-bell {
  position: relative;
  cursor: pointer;
}

.top-bar .notification-bell i {
  font-size: 1.2rem;
  color: #555;
}

.top-bar .badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--primary-color);
  color: white;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 0.75rem;
}

/* --- Top Bar Dropdown Fix --- */
.top-bar .user-profile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.top-bar .dropdown-menu {
  display: none;
  position: absolute;
  background-color: white;
  box-shadow: var(--box-shadow);
  border-radius: var(--card-radius);
  overflow: hidden;
  z-index: 1000;
  right: 0;
  top: 110%;
  min-width: 180px;
  animation: fadeIn 0.2s;
}

.top-bar .user-profile.open .dropdown-menu {
  display: block;
}

.top-bar .dropdown-menu a {
  color: #333;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  display: block;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.top-bar .dropdown-menu a:hover {
  background-color: #f0f0f0;
}

/* Settings specific styles */
.settings-header {
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.settings-header h1 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 0.2rem;
}

.settings-header p {
  color: var(--text-light);
  font-size: 0.8rem;
}

.settings-container {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.25rem;
  height: calc(100vh - var(--topbar-height) - 90px);
  min-height: 400px;
}

.settings-nav {
  position: static;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.settings-tabs {
  list-style-type: none;
  padding: 0;
  background: var(--card-background);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.settings-tabs li a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 1rem;
  color: var(--text-color);
  text-decoration: none;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  font-size: 0.85rem;
  line-height: 1.25;
  white-space: nowrap;
}

.settings-tabs li a:hover {
  background-color: var(--hover-background);
}

.settings-tabs li a.active {
  background-color: var(--hover-background);
  color: var(--primary-color);
  border-left: 3px solid var(--primary-color);
  font-weight: 500;
}

.settings-tabs li a i {
  width: 16px;
  text-align: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.settings-content {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

.settings-content::-webkit-scrollbar {
  width: 6px;
}

.settings-content::-webkit-scrollbar-track {
  background: transparent;
}

.settings-content::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 10px;
}

.settings-content::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .settings-content {
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

[data-theme="dark"] .settings-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .settings-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* =========================================================
 * CONTEÚDO DAS SECÇÕES — tamanhos harmonizados com a nav
 * Nav está a 0.85rem; conteúdo fica entre 0.8rem–0.9rem
 * ========================================================= */
.settings-section {
  display: none;
  background: var(--card-background);
  border-radius: var(--card-radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 0.75rem;
}

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

.section-header {
  margin-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.section-header h2 {
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 0.15rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.section-header h2 i {
  font-size: 0.875rem;
}

.section-header p {
  color: var(--text-light);
  font-size: 0.75rem;
}

/* Form styling */
.form-group {
  margin-bottom: 1rem;
}

.form-group h3 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-color);
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border-color);
  max-width: 600px;
}

/* NOTE: .form-row global styles moved to body[data-page="settings"] scope below
   to avoid affecting other pages (e.g. invoice modal) */

.form-control {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.form-control label {
  font-weight: 500;
  color: var(--text-color);
  font-size: 0.8rem;
}

input,
select,
textarea {
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border-color);
  border-radius: var(--input-radius);
  font-size: 0.8rem;
  font-family: inherit;
  background-color: var(--card-background);
  color: var(--text-primary);
  transition: all 0.2s ease;
  max-width: 320px;
  width: 100%;
}

textarea {
  resize: vertical;
  min-height: 50px;
  max-width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 126, 199, 0.2);
}

input[type="file"] {
  padding: 0.4rem;
  font-size: 0.8rem;
}

input[type="color"] {
  width: 40px;
  height: 32px;
  padding: 0;
  cursor: pointer;
  max-width: 40px;
}

.color-picker-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.color-picker-container span {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* Checkbox styling */
.checkbox-control {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.checkbox-control input[type="checkbox"],
.toggle-switch input {
  max-width: none;
  width: auto;
}

.checkbox-control input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid var(--border-color);
  border-radius: var(--small-radius);
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
}

.checkbox-control input[type="checkbox"]:checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.checkbox-control input[type="checkbox"]:checked::after {
  content: "\2714";
  color: white;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
}

/* Toggle switch styling */
.toggle-control {
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 20px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: var(--primary-color);
}

input:focus + .toggle-slider {
  box-shadow: 0 0 1px var(--primary-color);
}

input:checked + .toggle-slider:before {
  transform: translateX(18px);
}

/* Button styling */
.form-actions {
  display: flex;
  justify-content: flex-start;
  gap: 0.6rem;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border-color);
  max-width: 600px;
}

.btn {
  padding: 0.4rem 1rem;
  border: none;
  border-radius: var(--button-radius);
  font-weight: 500;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  max-width: none;
  width: auto;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: var(--secondary-color);
}

.btn-success {
  background-color: var(--success-color);
  color: white;
}

.btn-success:hover {
  background-color: #1ca64a;
}

.btn-secondary {
  background-color: #e2e8f0;
  color: var(--text-color);
}

.btn-secondary:hover {
  background-color: #cbd5e1;
}

.btn-danger {
  background-color: var(--danger-color);
  color: white;
}

.btn-danger:hover {
  background-color: #dc2626;
}

.btn-danger-outlined {
  background-color: transparent;
  color: var(--danger-color);
  border: 1px solid var(--danger-color);
}

.btn-danger-outlined:hover {
  background-color: rgba(239, 68, 68, 0.1);
}

/* Logo upload styling */
.logo-upload-container {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  max-width: 600px;
}

.logo-preview {
  width: 100px;
  height: 100px;
  border: 1px dashed var(--border-color);
  border-radius: var(--small-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: var(--hover-background);
}

.logo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-lighter);
}

.logo-placeholder i {
  font-size: 1.5rem;
}

.logo-placeholder span {
  font-size: 0.75rem;
  text-align: center;
}

#logo-preview-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.logo-upload-controls {
  flex: 1;
}

.upload-help {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-light);
}

/* Integrations styling - hidden until feature is complete */
.integrations-hidden {
  display: none !important;
}

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

.integration-card {
  display: flex;
  align-items: center;
  padding: 1rem;
  background-color: var(--card-background);
  border-radius: var(--small-radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

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

.integration-logo {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.75rem;
  color: var(--primary-color);
}

.integration-info {
  flex: 1;
}

.integration-info h3 {
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
}

.integration-info p {
  color: var(--text-light);
  font-size: 0.75rem;
  margin-bottom: 0.35rem;
}

.integration-status {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 500;
}

.integration-status.connected {
  background-color: rgba(34, 197, 94, 0.1);
  color: var(--success-color);
}

.integration-status.not-connected {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--danger-color);
}

/* Password strength meter */
.password-strength-meter {
  height: 4px;
  background-color: var(--border-color);
  border-radius: 2px;
  margin: 0.5rem 0;
  overflow: hidden;
}

.strength-bar {
  height: 100%;
  width: 0;
  background-color: var(--danger-color);
  transition: width 0.3s ease, background-color 0.3s ease;
}

.password-strength-text {
  font-size: 0.7rem;
  color: var(--text-light);
}

/* QR code placeholder */
.qr-placeholder {
  width: 120px;
  height: 120px;
  background-color: var(--hover-background);
  border: 1px dashed var(--border-color);
  border-radius: var(--small-radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-lighter);
  gap: 0.5rem;
  padding: 0.75rem;
}

.qr-placeholder i {
  font-size: 1.75rem;
}

.qr-placeholder p {
  font-size: 0.75rem;
  text-align: center;
}

/* Toast notifications */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  min-width: 280px;
  padding: 0.75rem;
  border-radius: var(--small-radius);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow: hidden;
  position: relative;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.toast::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background-color: rgba(255, 255, 255, 0.3);
}

.toast.success {
  background-color: #16a34a;
  color: white;
}

.toast.error {
  background-color: #dc2626;
  color: white;
}

.toast.info {
  background-color: #2563eb;
  color: white;
}

.toast.warning {
  background-color: #d97706;
  color: white;
}

.toast-icon {
  font-size: 1rem;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  font-size: 0.8rem;
  margin-bottom: 0.15rem;
}

.toast-message {
  font-size: 0.75rem;
  opacity: 1;
}

.toast-close {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 1.25rem;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.toast-close:hover {
  opacity: 1;
}

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

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* Loading overlay */
#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(0, 126, 199, 0.2);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
}

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

/* Modal styling */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: transparent; /* Overlay handles the background */
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal.show,
.modal.active {
  display: flex;
}

.modal-content {
  background-color: var(--card-background);
  border-radius: var(--card-radius);
  width: 100%;
  max-width: 500px;
  overflow: hidden;
  animation: modalSlideIn 0.3s ease;
}

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

.modal-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
}

.close-button {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-light);
  transition: color 0.3s ease;
}

.close-button:hover {
  color: var(--danger-color);
}

.modal-body {
  padding: 1rem 1.25rem;
}

.modal-footer {
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  border-top: 1px solid var(--border-color);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hidden {
  display: none !important;
}

/* Responsive styles */
@media (max-width: 1100px) {
  .settings-container {
    grid-template-columns: 1fr;
    height: auto;
    min-height: auto;
  }

  .settings-nav {
    position: static;
    height: auto;
    margin-bottom: 1rem;
  }

  .settings-content {
    overflow-y: visible;
    overflow-x: visible;
    padding-right: 0;
    max-height: none;
  }

  .settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    overflow: visible;
    flex: none;
  }

  .settings-tabs li {
    flex: 1;
    min-width: 150px;
  }

  .settings-tabs li a {
    border-left: none;
    border-bottom: 3px solid transparent;
    text-align: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }

  .settings-tabs li a.active {
    border-left: none;
    border-bottom: 3px solid var(--primary-color);
  }
}

@media (max-width: 768px) {
  .dashboard-container {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    z-index: 1000;
    transform: translateX(-100%);
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .top-bar {
    left: 0;
  }

  .main-content {
    margin-top: calc(var(--topbar-height) + 1rem);
    padding: 1rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .logo-upload-container {
    flex-direction: column;
    align-items: center;
  }

  .settings-header h1 {
    font-size: 1.2rem;
  }

  .settings-tabs li a {
    padding: 0.5rem;
    font-size: 0.75rem;
  }

  .settings-tabs li a i {
    margin-right: 0.35rem;
  }

  .integrations-container {
    grid-template-columns: 1fr;
  }

  .settings-section {
    padding: 0.75rem;
  }
}

@media (max-width: 480px) {
  .top-bar {
    padding: 0 1rem;
  }

  .search-bar {
    display: none;
  }

  .user-profile span {
    display: none;
  }

  .form-actions {
    flex-wrap: wrap;
  }

  .btn {
    width: 100%;
  }
}

.template-preview {
  margin-top: 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 1rem;
}

.template-preview h4 {
  margin: 0 0 1rem 0;
  color: #666;
}

.preview-container {
  background: #f5f5f5;
  padding: 1rem;
  border-radius: 4px;
  min-height: 200px;
  max-height: 400px;
  overflow-y: auto;
  position: relative;
}

.preview-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: white;
}

/* Template selection styles */
#invoice-template {
  margin-bottom: 1rem;
}

.template-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.template-option {
  border: 2px solid #ddd;
  border-radius: 4px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.template-option:hover {
  border-color: var(--primary-color);
}

.template-option.selected {
  border-color: var(--primary-color);
  background-color: rgba(var(--primary-color-rgb), 0.05);
}

.template-option img {
  width: 100%;
  height: auto;
  border-radius: 2px;
  margin-bottom: 0.5rem;
}

.template-option h5 {
  margin: 0;
  color: #333;
}

.template-option p {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: #666;
}

/* ===========================================
   COMPREHENSIVE DARK MODE FIXES
   =========================================== */

/* Table Dark Mode Fixes */
[data-theme="dark"] table {
  background-color: var(--card-background);
  color: var(--text-primary);
}

[data-theme="dark"] table th {
  background-color: var(--background-color);
  color: var(--text-primary);
  border-color: var(--border-color);
}

[data-theme="dark"] table td {
  background-color: var(--card-background);
  color: var(--text-primary);
  border-color: var(--border-color);
}

[data-theme="dark"] table tr:hover {
  background-color: var(--background-color);
}

[data-theme="dark"] table tr:nth-child(even) {
  background-color: var(--background-color);
}

[data-theme="dark"] table tr:nth-child(odd) {
  background-color: var(--card-background);
}

/* Invoice Table Specific Dark Mode */
[data-theme="dark"] .items-table th {
  background-color: var(--background-color);
  color: var(--text-primary);
}

[data-theme="dark"] .items-table td {
  background-color: var(--card-background);
  color: var(--text-primary);
}

[data-theme="dark"] .items-table tr:hover {
  background-color: var(--background-color);
}

[data-theme="dark"] .items-table input {
  background-color: var(--card-background);
  color: var(--text-primary);
  border-color: var(--border-color);
}

[data-theme="dark"] .remove-item-btn {
  background-color: var(--background-color);
  color: #e55353;
}

[data-theme="dark"] .remove-item-btn:hover {
  background-color: var(--border-color);
}

/* Global Dark Mode Base */
[data-theme="dark"] body {
  background-color: var(--background-color);
  color: var(--text-primary);
}

[data-theme="dark"] .main-content {
  background-color: var(--background-color);
  color: var(--text-primary);
  scrollbar-color: rgba(96, 165, 250, 0.4) transparent !important;
}

/* Custom scrollbar para modo escuro - Main Content - igual ao sidebar */
[data-theme="dark"] .main-content::-webkit-scrollbar-thumb {
  background: rgba(96, 165, 250, 0.35) !important;
}

[data-theme="dark"] .main-content::-webkit-scrollbar-thumb:hover {
  background: rgba(96, 165, 250, 0.55) !important;
}

[data-theme="dark"] .main-content::-webkit-scrollbar-thumb:active {
  background: rgba(96, 165, 250, 0.7) !important;
}

/* Fix Top Bar Dark Mode */
[data-theme="dark"] .top-bar {
  background: var(--card-background);
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .top-bar .search-bar input {
  background-color: var(--background-color);
  color: var(--text-primary);
  border-color: var(--border-color);
}

[data-theme="dark"] .top-bar .dropdown-menu {
  background-color: var(--card-background);
  border-color: var(--border-color);
}

[data-theme="dark"] .top-bar .dropdown-menu a {
  color: var(--text-primary);
}

[data-theme="dark"] .top-bar .dropdown-menu a:hover {
  background-color: var(--background-color);
}

/* Mobile-specific fixes for dropdown menu text contrast */
@media (max-width: 768px) {
  /* Ensure text is visible in light mode */
  .top-bar .dropdown-menu {
    background-color: #ffffff !important;
  }

  .top-bar .dropdown-menu a {
    color: #1f2937 !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
  }

  .top-bar .dropdown-menu a span {
    color: #1f2937 !important;
    display: inline !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  .top-bar .dropdown-menu a i {
    color: #4b5563 !important;
  }

  /* Ensure text is visible in dark mode */
  [data-theme="dark"] .top-bar .dropdown-menu {
    background: #23262f !important;
    border-color: #2a2d3a !important;
  }

  [data-theme="dark"] .top-bar .dropdown-menu a {
    color: #f9fafb !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
  }

  [data-theme="dark"] .top-bar .dropdown-menu a span {
    color: #f9fafb !important;
    display: inline !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  [data-theme="dark"] .top-bar .dropdown-menu a i {
    color: #d1d5db !important;
  }
}

/* Fix Forms Dark Mode */
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background-color: var(--card-background) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2) !important;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: var(--text-secondary) !important;
}

/* Fix Modal Dark Mode */
[data-theme="dark"] .modal-content {
  background-color: var(--card-background) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .modal-header {
  border-bottom-color: var(--border-color) !important;
}

[data-theme="dark"] .modal-footer {
  border-top-color: var(--border-color) !important;
}

/* Fix Cards Dark Mode */
[data-theme="dark"] .card,
[data-theme="dark"] .metric-card,
[data-theme="dark"] .chart-card,
[data-theme="dark"] .action-card {
  background: var(--card-background) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

/* Fix Tables Dark Mode */
[data-theme="dark"] .table,
[data-theme="dark"] .data-table,
[data-theme="dark"] .recent-transactions {
  background: var(--card-background) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .table th,
[data-theme="dark"] .table td,
[data-theme="dark"] .data-table th,
[data-theme="dark"] .data-table td {
  background: var(--card-background) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

/* Fix Dropdown Menus Dark Mode */
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .action-dropdown {
  background: var(--card-background) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}

/* Quick Actions Grid Dark Mode */
[data-theme="dark"] .quick-actions-grid {
  background: transparent;
}

[data-theme="dark"] .quick-actions-grid .action-card {
  background: var(--card-background) !important;
  border: 1px solid var(--border-color);
  box-shadow: var(--box-shadow);
}

[data-theme="dark"] .quick-actions-grid .action-card:hover {
  background: var(--background-color) !important;
  transform: translateY(-4px);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .quick-actions-grid .action-card h4 {
  color: var(--text-primary) !important;
}

[data-theme="dark"] .quick-actions-grid .action-card p {
  color: var(--text-secondary) !important;
}

/* Chart Cards Dark Mode - Force Override */
[data-theme="dark"] .chart-card {
  background: var(--card-background) !important;
  border: 1px solid var(--border-color);
}

[data-theme="dark"] .chart-card h3 {
  color: var(--text-primary) !important;
}

[data-theme="dark"] .chart-card .chart-actions button {
  background: var(--background-color) !important;
  color: var(--text-secondary) !important;
  border-color: var(--border-color) !important;
}

[data-theme="dark"] .chart-card .chart-actions button.active {
  background: var(--primary-color) !important;
  color: white !important;
}

/* Metric Cards Dark Mode - Force Override */
[data-theme="dark"] .metric-card {
  background: var(--card-background) !important;
  border: 1px solid var(--border-color);
}

[data-theme="dark"] .metric-card .metric-value {
  color: var(--text-primary) !important;
}

[data-theme="dark"] .metric-card .metric-label {
  color: var(--text-secondary) !important;
}

/* Recent Transactions Dark Mode - Force Override */
[data-theme="dark"] .recent-transactions {
  background: var(--card-background) !important;
  border: 1px solid var(--border-color);
}

[data-theme="dark"] .recent-transactions h3 {
  color: var(--text-primary) !important;
}

/* Modal Dark Mode - Fix Overlay Opacity */
[data-theme="dark"] .modal {
  background: rgba(
    0,
    0,
    0,
    0.2
  ) !important; /* Reduced opacity for better visibility behind modal */
}

[data-theme="dark"] .modal-content {
  background: var(--card-background) !important;
  border: 1px solid var(--border-color);
}

/* Invoice Preview Dark Mode */
[data-theme="dark"] .invoice-preview-container {
  background: var(--card-background) !important;
}

[data-theme="dark"] .invoice-preview-content {
  background: var(--card-background) !important;
  color: var(--text-primary) !important;
}

/* Button Dark Mode - Fix White Backgrounds */
[data-theme="dark"] .btn.secondary,
[data-theme="dark"] .btn.secondary-btn {
  background: var(--background-color) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

[data-theme="dark"] .btn.secondary:hover,
[data-theme="dark"] .btn.secondary-btn:hover {
  background: var(--border-color) !important;
}

/* Invoice Preview Dark Mode - Force Override */
[data-theme="dark"] .invoice-preview,
[data-theme="dark"] .invoice-preview-container,
[data-theme="dark"] .invoice-preview-content,
[data-theme="dark"] .invoice-preview-header {
  background: var(--card-background) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .invoice-preview .action-buttons {
  background: var(--card-background) !important;
}

[data-theme="dark"] .invoice-preview .action-buttons button {
  background: var(--background-color) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

[data-theme="dark"] .invoice-preview .action-buttons button.primary {
  background: var(--primary-color) !important;
  color: white !important;
}

/* Send Invoice Modal Dark Mode */
[data-theme="dark"] .send-invoice-modal,
[data-theme="dark"] .modal-send-invoice {
  background: var(--card-background) !important;
}

[data-theme="dark"] .send-invoice-modal input,
[data-theme="dark"] .send-invoice-modal textarea {
  background: var(--background-color) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

[data-theme="dark"] .send-invoice-modal button[type="submit"] {
  background: var(--primary-color) !important;
  color: white !important;
}

[data-theme="dark"] .send-invoice-modal button[type="button"] {
  background: var(--background-color) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

/* Force Override Any Remaining White Backgrounds */
[data-theme="dark"] .card,
[data-theme="dark"] .card-content,
[data-theme="dark"] .card-body {
  background: var(--card-background) !important;
}

[data-theme="dark"] .card,
[data-theme="dark"] .card-content,
[data-theme="dark"] .card-body {
  background: var(--card-background) !important;
}

/* Ensure Text Colors Are Proper */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
  color: var(--text-primary) !important;
}

[data-theme="dark"] p,
[data-theme="dark"] span,
[data-theme="dark"] div {
  color: var(--text-primary) !important;
}

[data-theme="dark"] .dropdown-item {
  color: var(--text-primary) !important;
}

[data-theme="dark"] .dropdown-item:hover {
  background-color: var(--primary-color) !important;
  color: white !important;
}

/* Fix Buttons Dark Mode */
[data-theme="dark"] .btn-secondary {
  background-color: var(--card-background) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

[data-theme="dark"] .btn-secondary:hover {
  background-color: var(--primary-color) !important;
  color: white !important;
}

/* Fix Settings Specific Elements */
[data-theme="dark"] .settings-tabs {
  background: var(--card-background);
}

[data-theme="dark"] .settings-section {
  background: var(--card-background);
}

[data-theme="dark"] .integration-card {
  background: var(--card-background);
  border-color: var(--border-color);
}

/* Fix Loading Overlay Dark Mode */
[data-theme="dark"] #loading-overlay {
  background-color: rgba(24, 26, 32, 0.8);
}

/* Fix Toast Dark Mode */
[data-theme="dark"] .toast {
  background-color: var(--card-background);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

/* Fix Sidebar Dark Mode */
[data-theme="dark"] .sidebar {
  background: linear-gradient(
    195deg,
    #10131a 80%,
    rgba(38, 99, 235, 0.55) 100%
  );
  scrollbar-color: rgba(96, 165, 250, 0.4) transparent !important;
}

/* Custom scrollbar para modo escuro */
[data-theme="dark"] .sidebar::-webkit-scrollbar-thumb {
  background: rgba(96, 165, 250, 0.35) !important;
}

[data-theme="dark"] .sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(96, 165, 250, 0.55) !important;
}

[data-theme="dark"] .sidebar::-webkit-scrollbar-thumb:active {
  background: rgba(96, 165, 250, 0.7) !important;
}

/* Fix Status Elements */
[data-theme="dark"] .status.pending {
  background-color: rgba(251, 191, 36, 0.2);
  color: var(--warning-color);
}

[data-theme="dark"] .status.orange {
  background-color: rgba(234, 88, 12, 0.2);
  color: #f97316;
}

/* Complete Dark Mode Status Styles for Invoice Payment Status */
[data-theme="dark"] .status.blue {
  background-color: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

[data-theme="dark"] .status.green {
  background-color: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

[data-theme="dark"] .status.red {
  background-color: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

[data-theme="dark"] .status.gray {
  background-color: rgba(156, 163, 175, 0.2);
  color: #9ca3af;
}

/* Dark Mode Status Badge Improvements */
[data-theme="dark"] .status {
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 500;
}

[data-theme="dark"] .status i {
  margin-right: 4px;
  opacity: 0.9;
}

/* Dark Mode Payment Info Text */
[data-theme="dark"] .payment-info-small {
  color: #9ca3af !important;
}

[data-theme="dark"] .payment-row {
  color: #d1d5db !important;
}

[data-theme="dark"] .progress-bar-small {
  background: rgba(156, 163, 175, 0.2) !important;
}

[data-theme="dark"] .progress-fill {
  background: #60a5fa !important;
}

/* =========================================================
 * TIPOGRAFIA GLOBAL DO PAINEL DE CONTEÚDO
 * Garante que QUALQUER elemento dinâmico dentro de
 * .settings-content herda tamanhos coerentes com a nav.
 * ========================================================= */
.settings-content {
  font-size: 0.8rem;
  line-height: 1.45;
}

.settings-content h3 {
  font-size: 0.85rem;
}

.settings-content h4 {
  font-size: 0.8rem;
}

.settings-content p {
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

.settings-content small,
.settings-content .text-muted,
.settings-content .help-text {
  font-size: 0.7rem;
}

/* Tabelas dinâmicas (impostos, séries, etc.) */
.settings-content table {
  font-size: 0.8rem;
  width: 100%;
  border-collapse: collapse;
}

.settings-content table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.45rem 0.6rem;
  font-weight: 600;
}

.settings-content table td {
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
}

/* Badges / status labels */
.settings-content .badge,
.settings-content .status-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
}

/* Tabs dentro do conteúdo (ex: séries de documentos) */
.settings-content .nav-tabs,
.settings-content .tab-nav {
  font-size: 0.8rem;
}

.settings-content .nav-tabs a,
.settings-content .tab-nav a,
.settings-content .nav-tabs button,
.settings-content .tab-nav button {
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
}

/* =========================================================
 * NOTIFICAÇÕES — grid de opções com checkboxes estilizados
 * ========================================================= */
.notification-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  max-width: 650px;
}

.notification-option {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--card-background);
  user-select: none;
  -webkit-user-select: none;
}

.notification-option:hover {
  border-color: var(--primary-color);
  background: var(--primary-light, rgba(0, 126, 199, 0.04));
}

.notification-option input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.notification-option-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  transition: all 0.2s ease;
  color: transparent;
  font-size: 0.65rem;
}

.notification-option
  input[type="checkbox"]:checked
  ~ .notification-option-check {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

.notification-option:has(input:checked) {
  border-color: var(--primary-color);
  background: var(--primary-light, rgba(0, 126, 199, 0.04));
}

.notification-option-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.notification-option-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-color);
  line-height: 1.3;
}

.notification-option-desc {
  font-size: 0.7rem;
  color: var(--text-light);
  line-height: 1.3;
}

.notification-option
  input[type="checkbox"]:focus-visible
  ~ .notification-option-check {
  box-shadow: 0 0 0 3px rgba(0, 126, 199, 0.25);
}

[data-theme="dark"] .notification-option {
  background: var(--card-background);
  border-color: var(--border-color);
}

[data-theme="dark"] .notification-option:hover,
[data-theme="dark"] .notification-option:has(input:checked) {
  background: rgba(37, 99, 235, 0.08);
  border-color: var(--primary-color);
}

[data-theme="dark"] .notification-option-title {
  color: #e5e7eb;
}

[data-theme="dark"] .notification-option-desc {
  color: #9ca3af;
}

@media (max-width: 550px) {
  .notification-options-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
 * OVERRIDE: Anular regras globais de mobile-optimizations.css
 * ========================================================= */
body[data-page="settings"]
  .form-group
  input:not([type="checkbox"]):not([type="radio"]),
body[data-page="settings"] .form-group select,
body[data-page="settings"] .form-group textarea {
  padding: 0.4rem 0.55rem !important;
  font-size: 0.8rem !important;
  min-height: auto !important;
  border-width: 1px !important;
  border-radius: var(--small-radius, 6px) !important;
  max-width: 320px;
  width: 100%;
  font-weight: normal !important;
}

body[data-page="settings"] .form-group textarea {
  max-width: 100% !important;
  min-height: 50px !important;
}

body[data-page="settings"]
  .form-group
  input:not([type="checkbox"]):not([type="radio"]):focus,
body[data-page="settings"] .form-group select:focus,
body[data-page="settings"] .form-group textarea:focus {
  box-shadow: 0 0 0 3px rgba(0, 126, 199, 0.2) !important;
  transform: none !important;
}

body[data-page="settings"] .form-group label {
  font-size: 0.8rem !important;
  font-weight: 500 !important;
  margin-bottom: 0.2rem !important;
}

body[data-page="settings"] .form-group label::after {
  display: none !important;
}

body[data-page="settings"] .form-row {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
  gap: 0.75rem !important;
  margin-bottom: 0.75rem !important;
  max-width: 600px;
}

body[data-page="settings"] .form-group {
  margin-bottom: 1rem !important;
}

body[data-page="settings"] .step-footer .btn,
body[data-page="settings"] .form-actions .btn {
  min-height: auto !important;
  padding: 0.4rem 1rem !important;
  font-size: 0.8rem !important;
  font-weight: 500 !important;
}

body[data-page="settings"] input[type="color"] {
  max-width: 40px !important;
  min-height: auto !important;
  padding: 0 !important;
}

body[data-page="settings"] .checkbox-control input[type="checkbox"],
body[data-page="settings"] .toggle-switch input {
  max-width: none !important;
  width: auto !important;
  min-height: auto !important;
}
