.application-details .fl-fieldset {
  border: 1.5px solid var(--border-light-mode);
  border-radius: 10px;
  padding: 0 14px 14px 14px;
  margin: 0 0 1.125rem 0;
  background: var(--background-color-main-light);
  transition: border-color 0.2s;
}

.application-details .fl-fieldset:focus-within {
  border-color: var(--primary-color);
}

.application-details .fl-legend {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-color);
  padding: 0 6px;
  margin-left: 6px;
  letter-spacing: 0.02em;
}

.application-details .fl-input {
  width: 100%;
  border: none;
  outline: none;
  padding: 6px 2px 0 2px;
  font-size: 0.9rem;
  color: var(--text-primary, #1f2937);
  background: transparent;
  box-sizing: border-box;
}

.application-details .fl-input::placeholder {
  color: var(--text-thowine-light);
  font-size: 0.875rem;
}

.application-details .fl-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 6px;
}

.application-details .fl-toggle-hint {
  font-size: 0.8125rem;
  color: var(--text-thowine-light);
  line-height: 1.4;
}

.application-details .app-details-header {
  position: static;
  z-index: 50;
  background: var(--background-color-main-light);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: none;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.application-details .app-details-header .header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

html.dark-theme .application-details .app-details-header {
  background-color: var(--background-dark-mode-menu-lateral);
}

html.dark-theme .application-details .app-details-header .header-left {
  background-color: var(--background-dark-mode-menu-lateral);
}

.application-details .app-details-header .btn-back {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border-light-mode);
  background: transparent;
  color: var(--text-thowine-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background 0.15s,
    color 0.15s;
}

html.dark-theme .application-details .app-details-header .btn-back {
  border: 1px solid var(--border-dark-mode);
}
.application-details .header-info {
  min-width: 0;
}

.application-details .header-checklist-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary, #111827);
  margin: 0 0 4px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
html.dark-theme .application-details .header-checklist-name {
  color: var(--text-thowine-dark);
}

.application-details .header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.application-details .header-code {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-thowine-light);
  background: var(--primary-color);
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  color: var(--text-thowine-light-white);
}

html.dark-theme .application-details .header-code {
  background-color: var(--primary-color);
  color: var(--primary-color-contrast);
}

.application-details .status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.application-details .status-badge.pending {
  background: #fef3c7;
  color: #92400e;
}

.application-details .status-badge.in_progress {
  background: #dbeafe;
  color: #1e40af;
}

.application-details .status-badge.completed {
  background: #d1fae5;
  color: #065f46;
}
.application-details .status-badge.cancelled {
  background: #fee2e2;
  color: #991b1b;
}

.application-details .status-badge.overdue {
  background: #fce7f3;
  color: #9d174d;
}

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

.application-details .progress-mini {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  min-width: 90px;
}

.application-details .progress-mini-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary-color);
}

.application-details .progress-mini-bar {
  width: 90px;
  height: 6px;
  background: var(--border-light-mode);
  border-radius: 99px;
  overflow: hidden;
}

.application-details .progress-mini-fill {
  height: 100%;
  background: var(--primary-color);
  border-radius: 99px;
  transition: width 0.4s ease;
}

.application-details .app-info-bar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 10px 24px;
  background: var(--background-color-main-light);
  border-bottom: 1px solid var(--border-light-mode);
  flex-wrap: wrap;
  margin-top: 6px;
}
html.dark-theme .application-details .app-info-bar {
  background-color: var(--background-main-dark-mode);
  color: var(--text-thowine-dark);
  border-bottom: 1px solid var(--background-main-dark-mode);
}

.application-details .info-bar-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.83rem;
  color: var(--text-thowine-light);
}

.application-details .info-bar-item i {
  color: var(--primary-color);
  font-size: 0.85rem;
  width: 14px;
  text-align: center;
}

.application-details .app-details-main {
  max-width: 100%;
  margin: 0;
  padding: 24px;
  background-color: var(--background-color-main-light);
}
html.dark-theme .application-details .app-details-main {
  background-color: var(--background-dark-mode-menu-lateral);
}

.application-details .fields-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 60px 24px;
  color: var(--text-thowine-light);
  font-size: 0.95rem;
}

.application-details .fields-loading i {
  font-size: 1.25rem;
  color: var(--primary-color);
}

.application-details .fields-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 60px 24px;
  color: var(--text-thowine-light);
  text-align: center;
}

.application-details .fields-empty i {
  font-size: 2.5rem;
  opacity: 0.3;
}

.application-details .sections-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.application-details .fill-section {
  background: var(--background-color-main-light);
  border: 1px solid var(--border-light-mode);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin-bottom: 16px;
}
html.dark-theme .application-details .fill-section {
  border-color: var(--border-dark-mode);
  background-color: var(--background-main-dark-mode);
}

.application-details .fill-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--background-main);
  border-bottom: 1px solid var(--border-light-mode);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary, #111827);
  cursor: pointer;
  user-select: none;
}

html.dark-theme .application-details .fill-section-header {
  background-color: var(--background-main-dark-mode);
  color: var(--text-thowine-dark);
  border-color: var(--border-dark-mode);
}

.application-details .fill-section-header i {
  color: var(--primary-color);
  font-size: 1rem;
}

.application-details .section-field-count {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-thowine-light);
  background: var(--border-light-mode);
  padding: 2px 8px;
  border-radius: 20px;
}

html.dark-theme .application-details .section-field-count {
  background-color: var(--background-dark-mode-menu-lateral);
  color: var(--text-thowine-dark);
}

.application-details .fill-section-name-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.application-details .fill-section-description {
  font-size: 0.78rem;
  color: var(--text-thowine-light);
}

html.dark-theme .application-details .fill-section-description {
  color: var(--text-thowine-dark);
}

.application-details .fill-subsection {
  margin: 3px 16px 12px 16px;
  border-radius: 8px;
  border-left: 3px solid var(--primary-color);
}

html.dark-theme .application-details .fill-subsection {
  border-color: var(--border-dark-mode);
  border-left-color: var(--primary-color);
}

.application-details .fill-subsection .fill-section-header {
  background: var(--backgroud-container-child, #f8fafc);
  font-size: 0.85rem;
}

html.dark-theme .application-details .fill-subsection .fill-section-header {
  background-color: var(--background-dark-mode-menu-lateral);
}

.application-details .fill-section-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  max-height: 5000px;
  opacity: 1;
  transition:
    max-height 0.35s ease,
    opacity 0.2s ease;
}

.application-details .fill-section.collapsed .fill-section-body {
  max-height: 0;
  opacity: 0;
}

.application-details .fill-section.collapsed .fill-section-header {
  border-bottom: none;
}

.application-details .btn-section-toggle {
  background: none;
  border: none;
  padding: 0 0 0 8px;
  cursor: pointer;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.application-details .fill-section.collapsed .btn-section-toggle {
  transform: rotate(180deg);
}

.application-details .fill-field {
  position: relative;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-light-mode);
  transition: background 0.15s;
}

.application-details .fill-field:last-child {
  border-bottom: none;
}

.application-details .fill-field.answered {
  background: #fafffe;
}

.application-details .fill-field.answered::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #10b981;
  border-radius: 0 2px 2px 0;
}

.application-details .fill-field.required:not(.answered)::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  /*background: var(--primary-color);*/
  border-radius: 0 2px 2px 0;
}

.application-details .fill-field-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary, #111827);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 8px;
}
html.dark-theme .application-details .fill-field-label {
  color: var(--text-thowine-dark);
}

.application-details .required-star {
  color: #ef4444;
  font-size: 0.85rem;
}

.application-details .fill-field-hint {
  font-size: 0.78rem;
  color: var(--text-thowine-light);
  margin-bottom: 8px;
  padding-left: 8px;
}

.application-details .fill-field-input {
  padding-left: 8px;
  width: 100%;
  box-sizing: border-box;
}

.application-details .field-answered-badge {
  position: absolute;
  top: 18px;
  right: 16px;
  color: #10b981;
  font-size: 1rem;
}

.application-details .repeatable-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary-color);
  background: color-mix(in srgb, var(--primary-color) 10%, transparent);
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: 8px;
}

html.dark-theme .application-details .repeatable-select-wrapper {
  border-bottom-color: var(--primary-color);
}

.application-details .cs-open .cs-dropdown {
  max-height: 380px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) transparent;
}

.application-details .cs-open .cs-dropdown::-webkit-scrollbar {
  width: 5px;
}

.application-details .cs-open .cs-dropdown::-webkit-scrollbar-thumb {
  background-color: var(--primary-color);
  border-radius: 4px;
}

.application-details .repeatable-instance-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: var(--background-color-main-light);
  border-top: 1px solid var(--border-light-mode);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-thowine-dark);
  letter-spacing: 0.05em;
}

html.dark-theme .application-details .repeatable-instance-header {
  background-color: var(--background-dark-mode-menu-lateral);
}

.application-details .field-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border-light-mode);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-thowine-black-light);
  background: var(--background-main);
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
  box-sizing: border-box;
  font-family: inherit;
}

.application-details .field-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}

html.dark-theme .application-details .field-input {
  background-color: var(--background-dark-mode-menu-lateral);
  color: var(--text-thowine-dark);
  border-color: var(--border-dark-mode);
}

.application-details .field-textarea {
  min-height: 100px;
  resize: vertical;
}

.application-details .field-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
  cursor: pointer;
}

/* ─── Sim/Não ────────────────────────────────────────────── */
.application-details .yes-no-group {
  display: flex;
  gap: 10px;
}

.application-details .yes-no-btn {
  flex: 1;
  padding: 10px 16px;
  border: 2px solid var(--border-light-mode);
  border-radius: 8px;
  background: var(--background-color-main-light);
  color: var(--text-thowine-light);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s;
}

.application-details .yes-no-btn.selected.yes {
  background: #d1fae5;
  border-color: #10b981;
  color: #065f46;
}

.application-details .yes-no-btn.selected.no {
  background: #fee2e2;
  border-color: #ef4444;
  color: #991b1b;
}

.application-details .yesno-subfield {
  margin-top: 8px;
  flex-direction: column;
  gap: 6px;
}

.application-details .yesno-text-field-wrap {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 4px;
}

.application-details .yesno-subfield--text .scanner-input-wrapper {
  width: 100%;
}

.application-details .yesno-subfield--text .yesno-text-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border-light-mode);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-thowine-black-light);
  background: var(--background-main);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
  font-family: inherit;
  min-height: 100px;
  resize: vertical;
}

.application-details .yesno-subfield--text .yesno-text-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}

html.dark-theme .application-details .yesno-subfield--text .yesno-text-input {
  background-color: var(--background-dark-mode-menu-lateral);
  color: var(--text-thowine-dark);
  border-color: var(--border-dark-mode);
}

.application-details .yesno-char-counter {
  font-size: 11px;
  color: #9ca3af;
  align-self: flex-start;
}

.application-details .yesno-subfield--media .media-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.application-details .multiple-choice-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.application-details .choice-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1.5px solid var(--border-light-mode);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-primary, #374151);
  transition: all 0.15s;
  user-select: none;
}

.application-details .choice-option:hover {
  border-color: var(--primary-color);
  background: rgba(249, 115, 22, 0.04);
}

.application-details .choice-option.selected {
  background: rgba(249, 115, 22, 0.08);
  border-color: var(--primary-color);
  color: var(--primary-color);
  font-weight: 600;
}

.application-details .choice-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary-color);
  flex-shrink: 0;
}

.application-details .scale-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.application-details .btn-qty-step {
  width: 38px;
  height: 38px;
  background-color: var(--background-color-main-light);
  border: 1.5px solid var(--border-light-mode);
  border-radius: 5px;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.application-details .scale-btn {
  width: 60px !important;
  height: 60px !important;
  border: 1.5px solid var(--border-light-mode);
  border-radius: 5px;
  background: var(--background-color-main-light);
  color: var(--text-primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.application-details .scale-btn.selected {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--background-color-main-light);
}

.application-details .file-field,
.application-details .gps-field,
.application-details .scanner-field,
.application-details .signature-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.application-details .media-field {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.application-details .media-field .media-images-preview,
.application-details .media-field .media-preview-text {
  width: 100%;
  display: flex;
  justify-content: center;
}

.application-details .field-media-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1.5px solid var(--border-light-mode);
  border-radius: 8px;
  background: var(--background-color-main-light);
  color: var(--text-primary, #374151);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.application-details .media-btn-group {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.application-details .media-preview-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  width: 100%;
}

.application-details .media-preview-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--primary-color);
  border-radius: 5px;
  overflow: hidden;
  position: relative;
  flex: 0 0 90px;
  width: 90px;
}

.application-details .media-preview-block--photos {
  cursor: pointer;
}

.application-details .media-preview-count {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary-color);
  padding: 2px 6px;
  background: var(--background-color-main-light);
  width: 100%;
  text-align: center;
}

html.dark-theme .application-details .media-preview-count {
  background: var(--background-main-dark-mode);
}

/* Lightbox */
.photo-lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-lightbox {
  background-color: #2a2a2a;
  border-radius: 10px;
  padding: 16px;
  width: min(680px, 90vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  border: 1px solid var(--border-dark-mode);
}

html.dark-theme .photo-lightbox {
  background-color: var(--background-main-dark-mode);
}

.lightbox-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 1;
}

.lightbox-thumbs-nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

.lightbox-thumbs-arrow {
  background: none;
  border: none;
  color: var(--primary-color);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 6px;
  flex-shrink: 0;
  line-height: 1;
  transition: opacity 0.15s;
}

.lightbox-thumbs-arrow:hover {
  opacity: 0.65;
}

.lightbox-thumbs {
  display: flex;
  flex-direction: row;
  gap: 8px;
  flex: 1;
  overflow-x: hidden;
  padding-bottom: 4px;
}

.lightbox-thumb-wrapper {
  position: relative;
  flex-shrink: 0;
}

.lightbox-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 5px;
  cursor: pointer;
  border: 2px solid transparent;
  display: block;
  opacity: 0.55;
  transition:
    opacity 0.15s,
    border-color 0.15s;
}

.lightbox-thumb.active,
.lightbox-thumb:hover {
  border-color: var(--primary-color);
  opacity: 1;
}

.lightbox-thumb-delete {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: rgba(220, 38, 38, 0.9);
  color: #fff;
  font-size: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.15s;
}

.lightbox-thumb-wrapper:hover .lightbox-thumb-delete {
  opacity: 1;
}

.lightbox-main {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-main-img {
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
  border-radius: 5px;
}

.application-details .media-preview-img {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 3px;
  cursor: pointer;
  display: block;
}

.application-details .media-preview-video {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 3px;
  display: block;
}

.application-details .media-preview-audio {
  border-radius: 5px;
  width: 260px;
  min-width: 200px;
  display: block;
}

/* Áudio e arquivo saem do tamanho fixo de 90px */
.application-details .media-preview-block--audio {
  flex: 0 0 auto;
  width: auto;
  padding: 6px;
  overflow: visible;
}

.application-details .media-preview-block.media-preview-file {
  flex: 0 0 auto;
  width: auto;
}

.application-details .media-preview-file {
  padding: 8px 12px;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-primary, #374151);
  flex-direction: row;
}

/* Botão X para remover blocos de preview */
.application-details .media-preview-delete {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(220, 38, 38, 0.85);
  color: #fff;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  z-index: 2;
  transition: background 0.15s;
}

.application-details .media-preview-delete:hover {
  background: rgba(220, 38, 38, 1);
}

.application-details .media-preview-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #10b981;
  background: #d1fae5;
  padding: 5px 12px;
  border-radius: 6px;
  align-self: flex-start;
}

.application-details .btn-gps-delete {
  background: none;
  border: none;
  color: #10b981;
  cursor: pointer;
  padding: 0 0 0 4px;
  font-size: 0.75rem;
  line-height: 1;
  opacity: 0.7;
  transition:
    opacity 0.15s,
    color 0.15s;
}

.application-details .btn-gps-delete:hover {
  opacity: 1;
  color: #dc2626;
}

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

.application-details .scanner-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.application-details .scanner-input-wrapper .field-input {
  padding-right: 46px;
}

.application-details .scanner-camera-btn {
  position: absolute;
  right: 6px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-thowine-light);
  padding: 6px 8px;
  border-radius: 6px;
  transition:
    color 0.15s,
    background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.application-details .signature-preview {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.application-details .signature-img {
  max-width: 300px;
  max-height: 120px;
  border: 1.5px solid var(--border-light-mode);
  border-radius: 8px;
  background: var(--background-color-main-light);
  padding: 8px;
  object-fit: contain;
}

.application-details .app-details-footer {
  position: static;
  background: var(--background-color-main-light);
  border-top: 1px solid var(--border-light-mode);
  padding: 14px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  overflow: hidden;
}

html.dark-theme .application-details .app-details-footer {
  background-color: var(--background-dark-mode-menu-lateral);
  border-top: 1px solid var(--background-main-dark-mode);
}

.application-details .footer-required-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #92400e;
  background: #fef3c7;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #fde68a;
}

html.dark-theme .application-details .footer-required-warning {
  background-color: var(--background-main-dark-mode);
  color: var(--text-thowine-dark);
  border-color: var(--border-dark-mode);
}

.application-details .footer-required-warning i {
  color: #f59e0b;
  font-size: 0.9rem;
}

.application-details .footer-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
html.dark-theme .application-details .footer-actions {
  background-color: var(--background-dark-mode-menu-lateral);
}

.application-details .repeatable-qty-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.application-details .repeatable-qty-card {
  background: var(--background-color-main-light);
  border-radius: 16px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.application-details .repeatable-qty-card .modal-header {
  background: var(--primary-color);
  padding: 1.1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: none;
}

.application-details .repeatable-qty-card .modal-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--background-color-main-light);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.application-details .repeatable-qty-card .modal-header .modal-close {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 7px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-thowine-light-white);
  font-size: 0.9rem;
}

.application-details .repeatable-qty-card .modal-body {
  padding: 1.5rem 1.5rem 0.5rem;
}

.application-details .repeatable-qty-card .modal-footer {
  padding: 1rem 1.5rem 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: none;
}

.application-details .repeatable-qty-desc {
  font-size: 0.875rem;
  color: var(--text-thowine-light);
  margin: 0 0 1.25rem 0;
  line-height: 1.5;
}

.application-details.fl-fieldset-qty {
  padding-bottom: 12px;
}

.application-details .fl-qty-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 6px;
}

.application-details .fl-qty-input {
  width: 60px;
  height: 38px;
  border: 1.5px solid var(--border-light-mode);
  border-radius: 5px;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  background-color: var(--background-color-main-light);
  color: var(--text-primary);
  outline: none;
}

.application-details .fl-qty-input:focus {
  border-color: var(--primary-color);
}

.application-details.fl-qty-input::-webkit-outer-spin-button,
.application-details .fl-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.application-details .fl-qty-input[type="number"] {
  -moz-appearance: textfield;
}

.application-details .repeatable-qty-limit {
  font-size: 0.78rem;
  color: var(--text-thowine-light);
  margin: 8px 0 0 0;
  min-height: 18px;
}

.application-details .permission-overlay,
.application-details .camera-overlay,
.application-details .signature-overlay,
.application-details .gps-overlay,
.application-details .audio-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.application-details .permission-card {
  background: var(--background-color-main-light);
  border-radius: 16px;
  padding: 32px 28px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.application-details .permission-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(249, 115, 22, 0.1);
  color: var(--primary-color);
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.application-details .permission-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary, #111827);
  margin: 0 0 8px 0;
}

.application-details .permission-description {
  font-size: 0.88rem;
  color: var(--text-thowine-light);
  margin: 0 0 24px 0;
  line-height: 1.5;
}

.application-details .permission-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.application-details .camera-container {
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  width: 100%;
  max-width: 560px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  position: relative;
}

.application-details .camera-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.08);
}

.application-details .camera-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--background-color-main-light);
}

.application-details .camera-photo-count {
  margin-left: auto;
  margin-right: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--background-color-main-light);
  opacity: 0.85;
}

.application-details .camera-close {
  background: transparent;
  border: none;
  color: var(--background-color-main-light);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px 8px;
  opacity: 0.7;
}

.application-details .camera-close:hover {
  opacity: 1;
}

.application-details .camera-preview {
  width: 100%;
  display: block;
  max-height: 400px;
  object-fit: cover;
  background: #111;
}

.application-details .scanner-aim {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 72%;
  height: 2px;
  pointer-events: none;
}

.application-details .scanner-aim-line {
  width: 100%;
  height: 2px;
  background: var(--primary-color);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(249, 115, 22, 0.8);
  animation: scan-line 2s ease-in-out infinite;
}

@keyframes scan-line {
  0%,
  100% {
    opacity: 1;
    transform: scaleX(1);
  }
  50% {
    opacity: 0.5;
    transform: scaleX(0.85);
  }
}

.application-details .camera-footer {
  display: flex;
  justify-content: center;
  padding: 18px;
  background: rgba(255, 255, 255, 0.08);
}

.application-details .camera-capture {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: var(--primary-color);
  color: var(--background-color-main-light);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s;
}
.application-details .camera-capture:hover {
  transform: scale(1.05);
}

.application-details .signature-container {
  background: var(--background-color-main-light);
  border-radius: 16px;
  overflow: hidden;
  width: 100%;
  max-width: 640px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.application-details .signature-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light-mode);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary, #111827);

  background-color: var(--primary-color);
}

html.dark-theme .application-details .signature-header {
  color: var(--text-thowine-light-white);
}

.application-details .signature-canvas {
  display: block;
  width: 100%;
  height: 220px;
  cursor: crosshair;
  background: var(--background-color-main-light);
  border-bottom: 1px solid var(--border-light-mode);
}

html.dark-theme .application-details .signature-canvas {
  background-color: var(--background-dark-mode-menu-lateral);
  color: var(--primary-color-contrast);
}

.application-details .signature-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  background-color: var(--background-color-main-light);
}

html.dark-theme .application-details .signature-footer {
  background-color: var(--background-main-dark-mode);
  color: var(--text-thowine-light-white) !important;
}

.application-details .gps-container {
  background: var(--background-color-main-light);
  border-radius: 16px;
  overflow: hidden;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.application-details .gps-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light-mode);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary, #111827);
}

.application-details .gps-body {
  padding: 28px 20px;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.application-details .gps-status,
.application-details .gps-result {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--text-thowine-light);
}

.application-details .gps-result {
  color: #065f46;
  background: #d1fae5;
  padding: 12px 16px;
  border-radius: 10px;
  width: 100%;
}

.application-details .gps-result i {
  font-size: 1.3rem;
  color: #10b981;
  flex-shrink: 0;
}

.application-details .gps-accuracy-text {
  font-size: 0.78rem;
  color: #6b7280;
  margin-top: 2px;
}

.application-details .gps-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 20px;
  border-top: 1px solid var(--border-light-mode);
}

.application-details .audio-container {
  background: var(--background-color-main-light);
  border-radius: 16px;
  overflow: hidden;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.application-details .audio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light-mode);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary, #111827);
}

.application-details .audio-body {
  padding: 32px 20px;
  display: flex;
  justify-content: center;
}

.application-details .audio-visualizer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.application-details .audio-mic-icon {
  font-size: 2rem;
  color: var(--text-thowine-light);
  transition:
    color 0.2s,
    transform 0.2s;
}

.application-details .audio-mic-icon.recording {
  color: #ef4444;
  animation: pulse-mic 1s ease-in-out infinite;
}

@keyframes pulse-mic {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
}

.application-details .audio-time {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary, #111827);
  font-variant-numeric: tabular-nums;
}

.application-details .audio-status {
  font-size: 0.82rem;
  color: var(--text-thowine-light);
}

.application-details .audio-footer {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 14px 20px;
  border-top: 1px solid var(--border-light-mode);
  flex-wrap: wrap;
}

.application-details .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition:
    opacity 0.15s,
    transform 0.1s;
  font-family: inherit;
  width: 100px;
}

.application-details .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.application-details .btn:not(:disabled):active {
  transform: scale(0.97);
}

.application-details .btn-primary {
  background: var(--primary-color);
  color: var(--text-thowine-black-light);
  font-weight: 700;
}
html.dark-theme .application-details .btn-primary {
  color: var(--text-thowine-black-light);
  font-weight: 700;
}

.application-details .btn-secondary {
}

html.dark-theme .application-details .btn-secondary {
  color: var(--text-thowine-dark);
  border: none;
  font-weight: 700;
  background: var(--background-main-dark-mode);
}

.application-details .btn-danger {
  background: #ef4444;
  color: var(--background-color-main-light);
}

.application-details .btn-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  color: var(--text-thowine-light);
  font-size: 0.9rem;
  transition:
    background 0.15s,
    color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── Responsivo ─────────────────────────────────────────── */
@media (max-width: 640px) {
  .app-details-main {
    padding: 16px;
    padding-bottom: 140px;
  }

  .app-details-header {
    padding: 12px 16px;
  }
  .app-info-bar {
    padding: 8px 16px;
    gap: 16px;
  }

  .app-details-footer {
    left: 0;
    padding: 12px 16px;
  }

  .progress-mini {
    min-width: 70px;
  }
  .yes-no-group {
    flex-direction: column;
  }

  .footer-actions {
    justify-content: stretch;
  }
  .footer-actions .btn {
    flex: 1;
  }

  .repeatable-qty-card {
    padding: 24px 20px;
  }
}

.application-details .qty-selector-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.application-details .fill-field {
  position: relative;
  padding-right: 50px;
}
html.dark-theme .application-details .fill-field {
  background-color: var(--background-main-dark-mode);
  border-color: var(--border-dark-mode);
}

.application-details .btn-trigger-plano {
  position: absolute;
  right: 10px;
  top: 15px;
  background: transparent;
  border: 1px solid #ff6b00;
  color: #ff6b00;
  border-radius: 6px;
  width: 35px;
  height: 35px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 5;
}

.application-details .btn-trigger-plano.has-plan {
  background: #ff6b00;
  color: var(--text-thowine-light);
  box-shadow: 0 0 8px rgba(255, 107, 0, 0.4);
}

.application-details .voice-visualizer {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100px;
  margin: 20px 0;
  position: relative;
}

.application-details .pulse-ring {
  width: 60px;
  height: 60px;
  background: var(--primary-color);
  border-radius: 50%;
  position: relative;
  animation: pulse-animation 1.5s infinite;
}

@keyframes pulse-animation {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7);
  }
  70% {
    box-shadow: 0 0 0 25px rgba(0, 123, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
  }
}

/* ─── Estilos para OCR / Scanner de Documentos ────────────────────── */

.application-details .ocr-guide-mask {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 80px; /* Espaço para o footer da câmera */
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none; /* Não interfere no clique */
}

.application-details .ocr-guide-frame {
  width: 80%;
  height: 40%;
  border: 2px solid #fff;
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5); /* Escurece o fundo fora da moldura */
  position: relative;
}

/* Cantos destacados da moldura */
.application-details .ocr-guide-frame::before,
.application-details .ocr-guide-frame::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border: 4px solid var(--primary-color, #007bff);
}

.application-details .ocr-guide-frame::before {
  top: -4px;
  left: -4px;
  border-right: 0;
  border-bottom: 0;
}

.application-details .ocr-guide-frame::after {
  bottom: -4px;
  right: -4px;
  border-left: 0;
  border-top: 0;
}

/* Linha de leitura (efeito de scanner) */
.application-details .ocr-guide-frame::inline-block {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary-color);
  box-shadow: 0 0 8px var(--primary-color);
  animation: scan-line 2s linear infinite;
}

@keyframes scan-line {
  0% {
    top: 0%;
  }
  100% {
    top: 100%;
  }
}

.application-details #voice-overlay .permission-card {
  max-width: 350px;
  text-align: center;
}

.application-details #voice-transcript {
  font-style: italic;
  color: #666;
  min-height: 50px;
}

.application-details .ocr-realtime-results {
  background: rgba(0, 0, 0, 0.75);
  color: var(--background-color-main-light);
  padding: 20px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.application-details .ocr-status-tag {
  font-size: 0.85rem;
  margin-bottom: 8px;
  color: #fbbf24;
  font-weight: 500;
}

.application-details .ocr-live-text {
  font-size: 1.1rem;
  font-weight: 600;
  min-height: 1.6em;
  word-wrap: break-word;
}

.application-details #ocr-overlay .camera-footer {
  padding: 15px;
  background: var(--background-color-main-light);
  display: flex;
  justify-content: center;
}

.application-details #btn-ocr-confirm {
  width: 100%;
  height: 52px;
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
}

.application-details #btn-ocr-confirm:disabled {
  opacity: 0.5;
  background-color: #9ca3af;
  cursor: not-allowed;
}
