/* Configurações de Séries de Documentos e Impostos */

/* Séries de Documentos */
.series-management {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.series-list-container {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.series-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

.series-list-header h3 {
  margin: 0;
  color: #495057;
  font-size: 0.9rem;
  font-weight: 600;
}

.series-list {
  padding: 0;
}

.series-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #e9ecef;
  transition: background-color 0.2s ease;
}

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

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

.series-info {
  flex: 1;
}

.series-name {
  font-weight: 600;
  color: #212529;
  margin-bottom: 0.25rem;
}

.series-details {
  display: flex;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: #6c757d;
}

.series-status {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.status-badge {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-badge.active {
  background-color: #d4edda;
  color: #155724;
}

.status-badge.inactive {
  background-color: #f8d7da;
  color: #721c24;
}

.status-badge.default {
  background-color: #d1ecf1;
  color: #0c5460;
}

.series-actions {
  display: flex;
  gap: 0.5rem;
}

.series-actions .btn {
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
}

.btn-outline-info {
  color: #17a2b8;
  border-color: #17a2b8;
  background-color: transparent;
}

.btn-outline-info:hover {
  color: #fff;
  background-color: #17a2b8;
  border-color: #17a2b8;
}

/* Formulário de Séries */
.series-form-container {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: visible;
}

.series-form-container #series-form {
  display: flex;
  flex-direction: column;
}

.form-tabs {
  display: flex;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

.form-tab {
  flex: 1;
  padding: 0.6rem 1rem;
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.8rem;
  color: #6c757d;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
}

.form-tab:hover {
  background-color: #e9ecef;
  color: #495057;
}

.form-tab.active {
  color: #007bff;
  border-bottom-color: #007bff;
  background-color: #fff;
}

.form-tab-content {
  display: none;
  padding: 1rem;
}

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

.numbers-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 0.6rem;
  max-width: 550px;
}

.number-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.number-field label {
  font-weight: 600;
  color: #495057;
  font-size: 0.8rem;
}

.number-field input,
.number-field select {
  padding: 0.35rem 0.5rem !important;
  border: 1px solid #ced4da !important;
  border-radius: 4px !important;
  font-size: 0.8rem !important;
  max-width: none !important;
  min-height: auto !important;
}

/* Modo de visualização */
.view-mode,
input.view-mode,
select.view-mode,
textarea.view-mode {
  background-color: #f8f9fa !important;
  cursor: not-allowed;
  opacity: 0.8;
}

[data-theme="dark"] .view-mode,
[data-theme="dark"] input.view-mode,
[data-theme="dark"] select.view-mode,
[data-theme="dark"] textarea.view-mode {
  background-color: #181a20 !important;
  color: #adb5bd !important;
  opacity: 0.7;
}

/* Prefixes Grid Styles */
.prefixes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.prefix-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.prefix-field label {
  font-weight: 500;
  color: #495057;
  font-size: 0.875rem;
}

.prefix-field input {
  padding: 0.5rem;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 0.875rem;
  text-transform: uppercase;
}

.prefix-field input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.prefix-field input::placeholder {
  text-transform: none;
}

.vat-regime-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.help-link {
  color: #007bff;
  text-decoration: none;
  font-size: 0.875rem;
}

.help-link:hover {
  text-decoration: underline;
}

.template-actions {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.5rem;
}

.template-actions a {
  color: #007bff;
  text-decoration: none;
  font-size: 0.875rem;
}

.template-actions a:hover {
  text-decoration: underline;
}

/* Impostos e Taxas */
.taxes-management {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tax-sector-suggestions {
  background: #ecfeff;
  border: 1px solid #a5f3fc;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.25rem;
}

.tax-sector-suggestions-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #0f766e;
  margin-bottom: 0.5rem;
}

.tax-sector-suggestions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tax-sector-suggestion-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #ccfbf1;
  color: #115e59;
  font-size: 0.72rem;
  font-weight: 600;
}

.taxes-list-container {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.taxes-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

.taxes-list-header h3 {
  margin: 0;
  color: #495057;
  font-size: 0.9rem;
  font-weight: 600;
}

.taxes-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.taxes-list {
  padding: 0;
}

.tax-item {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #e9ecef;
  transition: background-color 0.2s ease;
  gap: 0.75rem;
  font-size: 0.8rem;
}

.tax-item.tax-header {
  font-weight: 600;
  color: #495057;
  background-color: #f8f9fa;
  border-bottom: 2px solid #e9ecef;
}

.tax-item.tax-header .tax-info > div {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

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

.tax-checkbox {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
}

.tax-info {
  flex: 1;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr;
  gap: 1rem;
  align-items: center;
  padding-right: 1rem;
}

.tax-title {
  font-weight: 600;
  color: #212529;
}

.tax-type {
  color: #6c757d;
  font-size: 0.8rem;
}

.tax-value {
  font-weight: 500;
  color: #495057;
}

.tax-default {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.tax-default .badge {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

.tax-default .badge.yes {
  background-color: #d4edda;
  color: #155724;
}

.tax-default .badge.no {
  background-color: #f8d7da;
  color: #721c24;
}

.tax-zone {
  color: #6c757d;
  font-size: 0.8rem;
}

.tax-visibility {
  display: flex;
  align-items: center;
  justify-content: center;
}

.tax-visibility-toggle {
  border: none;
  background: transparent;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.tax-visibility-toggle:hover {
  background: rgba(0, 126, 199, 0.08);
}

.tax-visibility i {
  color: #6c757d;
  font-size: 1rem;
}

.tax-visibility-toggle.is-hidden i,
.tax-visibility i.fa-eye-slash {
  color: #dc3545;
}

.tax-visibility-toggle:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.tax-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
}

.tax-action-menu {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tax-action-menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: #6c757d;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
  width: 32px;
  height: 32px;
}

.tax-action-menu-btn:hover {
  background-color: #f8f9fa;
  color: #495057;
}

[data-theme="dark"] .tax-action-menu-btn {
  color: #adb5bd;
}

[data-theme="dark"] .tax-action-menu-btn:hover {
  background-color: #2a2d3a;
  color: #fff;
}

[data-theme="dark"] .tax-sector-suggestions {
  background: rgba(13, 148, 136, 0.12);
  border-color: rgba(45, 212, 191, 0.45);
}

[data-theme="dark"] .tax-sector-suggestions-title {
  color: #5eead4;
}

[data-theme="dark"] .tax-sector-suggestion-badge {
  background: rgba(20, 184, 166, 0.25);
  color: #99f6e4;
}

/* Tax Action Dropdown */
.tax-action-dropdown {
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 180px;
  z-index: 10000 !important;
  position: fixed !important;
}

.tax-action-dropdown .dropdown-header {
  padding: 8px 12px;
  background: #f8f9fa;
  border-bottom: 1px solid #ddd;
  border-radius: 8px 8px 0 0;
  font-weight: 600;
  font-size: 0.9em;
  color: #495057;
}

.tax-action-dropdown .dropdown-content {
  padding: 4px 0;
}

.tax-action-dropdown .dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-size: 0.9em;
  color: #495057;
}

.tax-action-dropdown .dropdown-item:hover {
  background-color: #f8f9fa;
}

.tax-action-dropdown .dropdown-item i {
  width: 16px;
  text-align: center;
  color: #6c757d;
}

.tax-action-dropdown .dropdown-item[data-action="delete"] {
  color: #dc3545;
}

.tax-action-dropdown .dropdown-item[data-action="delete"]:hover {
  background-color: #f8d7da;
  color: #721c24;
}

.tax-action-dropdown .dropdown-item[data-action="delete"] i {
  color: #dc3545;
}

/* Dark mode for tax action dropdown */
[data-theme="dark"] .tax-action-dropdown {
  background: #2a2d3a;
  border-color: #3a3d4a;
}

[data-theme="dark"] .tax-action-dropdown .dropdown-header {
  background: #181a20;
  border-bottom-color: #3a3d4a;
  color: #fff;
}

[data-theme="dark"] .tax-action-dropdown .dropdown-item {
  color: #adb5bd;
}

[data-theme="dark"] .tax-action-dropdown .dropdown-item:hover {
  background-color: #181a20;
  color: #fff;
}

[data-theme="dark"] .tax-action-dropdown .dropdown-item i {
  color: #adb5bd;
}

[data-theme="dark"] .tax-action-dropdown .dropdown-item[data-action="delete"] {
  color: #f8d7da;
}

[data-theme="dark"] .tax-action-dropdown .dropdown-item[data-action="delete"]:hover {
  background-color: #721c24;
  color: #fff;
}

[data-theme="dark"] .tax-action-dropdown .dropdown-item[data-action="delete"] i {
  color: #f8d7da;
}

/* Formulário de Impostos */
.tax-form-container {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  padding: 1rem;
}

.tax-form-container .form-group {
  padding: 0;
}

.tax-form-container .form-group h3 {
  margin-bottom: 0.75rem;
  margin-top: 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e9ecef;
  font-size: 0.85rem;
}

.tax-form-container .form-row {
  margin-bottom: 0.75rem;
  padding: 0;
}

.tax-form-container .form-control {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.tax-form-container .form-control label {
  font-weight: 500;
  color: #495057;
  font-size: 0.8rem;
  margin-bottom: 0.15rem;
}

.tax-form-container .form-help {
  margin-top: 0.25rem;
  font-size: 0.7rem;
  color: #6c757d;
  font-style: italic;
}

.tax-form-container .checkbox-control {
  display: flex;
  align-items: center;
  padding: 0.5rem 0;
}

.tax-form-container .checkbox-control .checkbox-with-help {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.tax-form-container .checkbox-control input[type="checkbox"] {
  margin: 0;
  flex-shrink: 0;
}

.tax-form-container .checkbox-control label {
  margin-bottom: 0;
  cursor: pointer;
  flex: 0 0 auto;
}

.tax-form-container .checkbox-control .tax-help-wrapper {
  margin-left: auto;
  flex-shrink: 0;
}

.tax-form-container .form-actions {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e9ecef;
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

[data-theme="dark"] .tax-form-container .form-group h3 {
  border-bottom-color: #3a3d4a;
  color: #fff;
}

[data-theme="dark"] .tax-form-container .form-control label {
  color: #adb5bd;
}

[data-theme="dark"] .tax-form-container .form-help {
  color: #adb5bd;
}

[data-theme="dark"] .tax-form-container .form-actions {
  border-top-color: #3a3d4a;
}

/* Campos de edição compactos */
.tax-form-container input[type="text"],
.tax-form-container input[type="number"],
.tax-form-container select,
.tax-form-container textarea {
  padding: 0.4rem 0.55rem;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 0.8rem;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  width: 100%;
}

.tax-form-container input[type="text"]:focus,
.tax-form-container input[type="number"]:focus,
.tax-form-container select:focus,
.tax-form-container textarea:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

[data-theme="dark"] .tax-form-container input[type="text"],
[data-theme="dark"] .tax-form-container input[type="number"],
[data-theme="dark"] .tax-form-container select,
[data-theme="dark"] .tax-form-container textarea {
  background: #181a20;
  color: #fff;
  border-color: #3a3d4a;
}

[data-theme="dark"] .tax-form-container input[type="text"]:focus,
[data-theme="dark"] .tax-form-container input[type="number"]:focus,
[data-theme="dark"] .tax-form-container select:focus,
[data-theme="dark"] .tax-form-container textarea:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

/* Wrapper para o botão de ajuda com tooltip */
.tax-help-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 0.75rem;
}

/* Botão de ajuda estilizado */
.help-icon-btn {
  background: #f0f7ff;
  border: 1px solid #b3d9ff;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #007bff;
  font-size: 0.875rem;
  padding: 0;
  transition: all 0.2s ease;
  outline: none;
}

.help-icon-btn:hover,
.help-icon-btn:focus {
  background: #007bff;
  color: #fff;
  border-color: #007bff;
  box-shadow: 0 2px 6px rgba(0, 123, 255, 0.3);
  transform: scale(1.1);
}

.help-icon-btn:active {
  transform: scale(0.95);
}

.help-icon-btn i {
  font-size: 0.75rem;
}

/* Tooltip para ajuda */
.help-tooltip {
  position: absolute;
  bottom: calc(100% + 12px);
  right: 0;
  transform: translateX(0);
  background-color: #1e3a8a;
  color: white;
  padding: 0.875rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  line-height: 1.5;
  max-width: 300px;
  min-width: 250px;
  white-space: normal;
  text-align: left;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15), 0 4px 8px rgba(0, 0, 0, 0.1);
  z-index: 10001;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.help-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 20px;
  transform: translateX(0);
  border: 6px solid transparent;
  border-top-color: #1e3a8a;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.1));
}

.help-tooltip.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(-4px);
  pointer-events: auto;
}

/* Wrapper para o botão de ajuda */
.tax-help-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 0;
}

@media (max-width: 768px) {
  .help-tooltip {
    max-width: 250px;
    min-width: 200px;
    font-size: 0.8rem;
    padding: 0.75rem 0.875rem;
  }
}

.help-tooltip .tooltip-title {
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 0.5rem;
  display: block;
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 0.5rem;
}

.help-tooltip .tooltip-content {
  color: rgba(255, 255, 255, 0.95);
  margin: 0;
  line-height: 1.6;
}

/* Dark mode para help button */
[data-theme="dark"] .help-icon-btn {
  background: #1a2332;
  color: #60a5fa;
  border-color: #2a3d4a;
}

[data-theme="dark"] .help-icon-btn:hover,
[data-theme="dark"] .help-icon-btn:focus {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
}

[data-theme="dark"] .help-tooltip {
  background-color: #1e293b;
  border: 1px solid #334155;
}

[data-theme="dark"] .help-tooltip::after {
  border-top-color: #1e293b;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3));
}

/* Estilos legados para compatibilidade */
.help-icon {
  color: #6c757d;
  margin-left: 0.5rem;
  cursor: help;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.help-icon:hover {
  color: #007bff;
}

/* Alertas */
.alert {
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  border: 1px solid transparent;
  font-size: 0.8rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.alert-info {
  background-color: #d1ecf1;
  border-color: #bee5eb;
  color: #0c5460;
}

.alert i {
  font-size: 1rem;
}

/* Responsividade */
@media (max-width: 768px) {
  .series-list-header,
  .taxes-list-header {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .taxes-actions {
    justify-content: center;
  }

  .tax-info {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .tax-actions {
    min-width: auto;
  }

  .numbers-grid {
    grid-template-columns: 1fr;
  }

  .form-tabs {
    flex-direction: column;
  }

  .form-tab {
    text-align: left;
  }
}

/* Dark mode support */
[data-theme="dark"] .series-list-container,
[data-theme="dark"] .series-form-container,
[data-theme="dark"] .taxes-list-container,
[data-theme="dark"] .tax-form-container {
  background: #2a2d3a !important;
  color: #fff !important;
}

[data-theme="dark"] .series-list-header,
[data-theme="dark"] .taxes-list-header {
  background: #181a20 !important;
  border-bottom-color: #3a3d4a !important;
}

[data-theme="dark"] .series-item,
[data-theme="dark"] .tax-item {
  border-bottom-color: #3a3d4a !important;
}

[data-theme="dark"] .tax-item.tax-header {
  background-color: #181a20 !important;
  border-bottom-color: #3a3d4a !important;
  color: #fff !important;
}

[data-theme="dark"] .tax-item.tax-header .tax-info > div {
  color: #adb5bd !important;
}

[data-theme="dark"] .series-item:hover,
[data-theme="dark"] .tax-item:hover {
  background-color: #181a20 !important;
}

[data-theme="dark"] .form-tabs {
  background: #181a20 !important;
  border-bottom-color: #3a3d4a !important;
}

[data-theme="dark"] .form-tab {
  color: #adb5bd !important;
}

[data-theme="dark"] .form-tab:hover {
  background-color: #2a2d3a !important;
  color: #fff !important;
}

[data-theme="dark"] .form-tab.active {
  color: #60a5fa !important;
  background-color: #2a2d3a !important;
}

[data-theme="dark"] .series-name,
[data-theme="dark"] .tax-title {
  color: #fff !important;
}

[data-theme="dark"] .series-details,
[data-theme="dark"] .tax-type,
[data-theme="dark"] .tax-zone {
  color: #adb5bd !important;
}

[data-theme="dark"] .number-field input {
  background: #181a20 !important;
  color: #fff !important;
  border-color: #3a3d4a !important;
}

[data-theme="dark"] .prefix-field input {
  background: #181a20 !important;
  color: #fff !important;
  border-color: #3a3d4a !important;
}

[data-theme="dark"] .help-icon {
  color: #adb5bd !important;
}

[data-theme="dark"] .help-icon:hover {
  color: #60a5fa !important;
}

/* Financial Settings Styles */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: #495057;
}

.checkbox-label input[type="checkbox"] {
  margin: 0;
  width: auto;
  opacity: 0;
  position: absolute;
  pointer-events: none;
}

.checkmark {
  width: 16px;
  height: 16px;
  border: 2px solid #ced4da;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
  background-color: #007bff;
  border-color: #007bff;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
  content: '✓';
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.form-help {
  font-size: 0.75rem;
  color: #6c757d;
  margin-top: 0.25rem;
  display: block;
}

.alert-info {
  background-color: #d1ecf1;
  border-color: #bee5eb;
  color: #0c5460;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.alert-info i {
  font-size: 1rem;
}

/* ===== Barra de acções do formulário de séries ===== */
.series-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 0.65rem 1rem;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
  position: sticky;
  bottom: 0;
  z-index: 5;
}

.series-form-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 5px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  max-width: none;
  width: auto;
}

.series-form-actions .btn-secondary {
  background: #fff;
  color: #495057;
  border-color: #ced4da;
}

.series-form-actions .btn-secondary:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

.series-form-actions .btn-primary {
  background: #007bff;
  color: #fff;
  border-color: #007bff;
}

.series-form-actions .btn-primary:hover {
  background: #0069d9;
  border-color: #0062cc;
}

/* ===== Checkboxes de opções da série (Inactivo / Escolhida por defeito) ===== */
.series-options-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  max-width: 450px;
}

.series-option-card {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fff;
  user-select: none;
  -webkit-user-select: none;
  flex: 1;
}

.series-option-card:hover {
  border-color: #adb5bd;
  background: #f8f9fa;
}

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

.series-option-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  min-width: 18px;
  border: 2px solid #ced4da;
  border-radius: 4px;
  background: #fff;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.series-option-check i {
  font-size: 0.6rem;
  color: transparent;
  transition: color 0.15s ease;
}

.series-option-card input[type="checkbox"]:checked ~ .series-option-check {
  background: #007bff;
  border-color: #007bff;
}

.series-option-card input[type="checkbox"]:checked ~ .series-option-check i {
  color: #fff;
}

.series-option-card:has(input:checked) {
  border-color: #007bff;
  background: #eff6ff;
}

.series-option-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: #333;
}

/* Dark mode - Series form actions */
[data-theme="dark"] .series-form-actions {
  background: #181a20 !important;
  border-top-color: #3a3d4a !important;
}

[data-theme="dark"] .series-form-actions .btn-secondary {
  background: #2a2d3a !important;
  color: #adb5bd !important;
  border-color: #3a3d4a !important;
}

[data-theme="dark"] .series-form-actions .btn-secondary:hover {
  background: #3a3d4a !important;
}

/* Dark mode - Series option cards */
[data-theme="dark"] .series-option-card {
  background: #2a2d3a !important;
  border-color: #3a3d4a !important;
}

[data-theme="dark"] .series-option-card:hover {
  background: #353840 !important;
  border-color: #4a4d5a !important;
}

[data-theme="dark"] .series-option-check {
  background: #181a20 !important;
  border-color: #4a4d5a !important;
}

[data-theme="dark"] .series-option-card input[type="checkbox"]:checked ~ .series-option-check {
  background: #3b82f6 !important;
  border-color: #3b82f6 !important;
}

[data-theme="dark"] .series-option-card:has(input:checked) {
  border-color: #3b82f6 !important;
  background: #1e3a5f !important;
}

[data-theme="dark"] .series-option-label {
  color: #d1d5db !important;
}

/* Dark mode for financial settings */
[data-theme="dark"] .checkbox-label {
  color: #adb5bd !important;
}

[data-theme="dark"] .checkmark {
  border-color: #3a3d4a !important;
}

[data-theme="dark"] .checkbox-label input[type="checkbox"]:checked + .checkmark {
  background-color: #60a5fa !important;
  border-color: #60a5fa !important;
}

[data-theme="dark"] .form-help {
  color: #adb5bd !important;
}

[data-theme="dark"] .alert-info {
  background-color: #1a2332 !important;
  border-color: #2a3d4a !important;
  color: #60a5fa !important;
}
