/* ==========================================================================
   FAGUNDES CONSTRUÇÃO E MINERAÇÃO — RDO DE TOPOGRAFIA
   Identidade Visual Oficial:
     - Azul Marinho Institucional : #002976
     - Azul Real Corporativo      : #00379E
     - Azul Destaque Técnico      : #0068BB
     - Azul Gelo Suave            : #E5F0FB
     - Cinza Metálico Fagundes    : #9B9B9B / #98989A
     - Cinza Prata / Bordas       : #D1D2D4
     - Grafite / Texto            : #172B3A
   ========================================================================== */

:root {
  --fag-navy: #002976;
  --fag-navy-deep: #001D54;
  --fag-blue: #00379E;
  --fag-blue-hover: #0047C2;
  --fag-blue-mid: #0068BB;
  --fag-blue-tint: #E5F0FB;
  --fag-blue-soft: #F2F7FD;
  --fag-gray: #9B9B9B;
  --fag-gray-dark: #6D747E;
  --fag-silver: #D1D2D4;
  --fag-border: #D9DFE8;
  --fag-bg: #F0F3F7;
  --fag-surface: #FFFFFF;
  --fag-ink: #172B3A;
  --fag-muted: #58697A;

  --ok: #0E7A5F;
  --ok-bg: #E6F6F1;
  --ok-border: #A7DFD0;
  --warn: #B45309;
  --warn-bg: #FEF5E6;
  --warn-border: #F7D49A;
  --danger: #B91C1C;
  --danger-bg: #FDECEC;
  --danger-border: #F6B8B8;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 2px 6px rgba(0, 41, 118, 0.06);
  --shadow-md: 0 8px 24px rgba(0, 41, 118, 0.09);
  --shadow-lg: 0 14px 36px rgba(0, 41, 118, 0.14);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", "PT Sans", "Roboto", -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--fag-ink);
  background-color: var(--fag-bg);
  background-image:
    radial-gradient(circle at 12% 18%, rgba(0, 55, 158, 0.045) 0%, transparent 45%),
    radial-gradient(circle at 88% 82%, rgba(155, 155, 155, 0.08) 0%, transparent 45%),
    linear-gradient(rgba(0, 41, 118, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 41, 118, 0.025) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: "Consolas", "Cascadia Code", "Courier New", monospace;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   TOP BAR & SHELL
   ========================================================================== */
.app-shell {
  max-width: 1040px;
  margin: 0 auto;
  padding: 20px 18px 64px;
}

.top-utility {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--fag-muted);
}

.top-utility__left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.top-utility__right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.save-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--fag-surface);
  border: 1px solid var(--fag-border);
  font-size: 12px;
  color: var(--fag-muted);
}

.save-pill__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--fag-border);
  background: var(--fag-surface);
  color: var(--fag-navy);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.btn-ghost:hover {
  border-color: var(--fag-blue);
  background: var(--fag-blue-soft);
}

.btn-ghost.active {
  background: var(--fag-navy);
  border-color: var(--fag-navy);
  color: #FFFFFF;
}

/* ==========================================================================
   HERO HEADER — IDENTIDADE FAGUNDES + ELEMENTOS TOPOGRÁFICOS
   ========================================================================== */
.hero-header {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: linear-gradient(118deg, var(--fag-navy-deep) 0%, var(--fag-navy) 46%, var(--fag-blue) 100%);
  color: #FFFFFF;
  box-shadow: var(--shadow-lg);
  border-bottom: 5px solid var(--fag-gray);
  margin-bottom: 18px;
}

.hero-bg-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 26px 30px 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 235px;
  gap: 20px;
  align-items: center;
}

.hero-brand-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.hero-logo {
  height: 44px;
  width: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
}

.hero-divider {
  width: 1.5px;
  height: 30px;
  background: rgba(209, 210, 212, 0.45);
}

.hero-dept {
  font-size: 11.5px;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  font-weight: 700;
  color: #CFE2FA;
}

.hero-title {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.3px;
  line-height: 1.15;
}

.hero-subtitle {
  margin: 6px 0 0;
  font-size: 13.5px;
  color: #DCE9FA;
  max-width: 610px;
}

.hero-slogan {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
  font-style: italic;
  color: rgba(229, 240, 251, 0.82);
}

.hero-reticle-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 13px 15px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 22px rgba(0, 29, 84, 0.26);
  color: var(--fag-navy);
  text-align: center;
}

.hero-reticle-box__label {
  font-size: 10px;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--fag-navy);
  margin-top: 4px;
}

.hero-reticle-box__datum {
  font-size: 11px;
  color: var(--fag-blue);
  font-weight: 700;
  margin-top: 2px;
}

/* Telemetry bar inside Hero */
.hero-telemetry {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: rgba(255, 255, 255, 0.14);
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.telemetry-item {
  background: rgba(0, 24, 72, 0.52);
  padding: 10px 16px;
}

.telemetry-item__label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: #BCD6F7;
  font-weight: 700;
}

.telemetry-item__value {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: #FFFFFF;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   STEPPER NAVIGATION
   ========================================================================== */
.stepper-card {
  background: var(--fag-surface);
  border: 1px solid var(--fag-border);
  border-radius: var(--radius-md);
  padding: 14px 18px 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}

.stepper-progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--fag-muted);
  margin-bottom: 8px;
}

.stepper-progress-track {
  height: 6px;
  background: #E4EAF2;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 14px;
}

.stepper-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--fag-navy), var(--fag-blue-mid));
  border-radius: 999px;
  transition: width 0.25s ease;
}

.stepper-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.step-pill {
  flex: 1 1 128px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1.5px solid var(--fag-border);
  background: #F8FAFC;
  color: var(--fag-muted);
  cursor: pointer;
  text-align: left;
  transition: all 0.16s ease;
}

.step-pill:hover {
  border-color: var(--fag-blue-mid);
  background: var(--fag-blue-soft);
}

.step-pill.is-active {
  border-color: var(--fag-blue);
  background: var(--fag-blue-tint);
  color: var(--fag-navy);
  box-shadow: 0 2px 8px rgba(0, 55, 158, 0.12);
}

.step-pill.is-done {
  border-color: var(--ok-border);
  background: var(--ok-bg);
  color: #0B5C47;
}

.step-pill.is-conditional {
  border-style: dashed;
  border-color: var(--warn-border);
  background: var(--warn-bg);
  color: #8A3F06;
}

.step-pill.is-conditional.is-active {
  border-style: solid;
  border-color: var(--warn);
}

.step-pill__num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 800;
  background: var(--fag-silver);
  color: var(--fag-ink);
  flex-shrink: 0;
}

.step-pill.is-active .step-pill__num {
  background: var(--fag-blue);
  color: #FFFFFF;
}

.step-pill.is-done .step-pill__num {
  background: var(--ok);
  color: #FFFFFF;
}

.step-pill.is-conditional .step-pill__num {
  background: var(--warn);
  color: #FFFFFF;
}

.step-pill__text {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

/* ==========================================================================
   FORM SECTIONS & CARDS
   ========================================================================== */
.form-section {
  display: none;
  animation: fadeSlide 0.2s ease;
}

.form-section.is-visible,
body.view-all .form-section:not(.is-hidden-branch) {
  display: block;
}

.form-section.is-hidden-branch {
  display: none !important;
}

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-card {
  background: var(--fag-surface);
  border: 1px solid var(--fag-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 18px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 22px;
  background: linear-gradient(90deg, var(--fag-navy) 0%, var(--fag-blue) 100%);
  color: #FFFFFF;
  border-bottom: 3px solid var(--fag-gray);
}

.section-header.is-warning {
  background: linear-gradient(90deg, #8A2C00 0%, #B45309 100%);
  border-bottom-color: #F7D49A;
}

.section-header.is-danger {
  background: linear-gradient(90deg, #7F1D1D 0%, #B91C1C 100%);
  border-bottom-color: #F6B8B8;
}

.section-header__left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.section-header__icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.section-header__title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: 0.35px;
  line-height: 1.25;
  text-transform: uppercase;
}

.section-header__desc {
  margin: 4px 0 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: #DCE9FA;
}

.section-badge {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  white-space: nowrap;
  flex-shrink: 0;
}

.section-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

/* ==========================================================================
   FIELDS, INPUTS & VALIDATION
   ========================================================================== */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid #E5EAF1;
  background: #FCFDFE;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.field-group:focus-within {
  border-color: var(--fag-blue-mid);
  box-shadow: 0 0 0 3px rgba(0, 104, 187, 0.1);
}

.field-group.is-highlighted {
  border-color: var(--warn);
  background: var(--warn-bg);
}

.field-group.is-alert {
  border-color: var(--danger);
  background: var(--danger-bg);
}

.field-group.has-error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.12);
}

.field-group.is-cond-hidden,
.is-cond-hidden {
  display: none !important;
}

.field-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--fag-navy);
  letter-spacing: 0.25px;
  text-transform: uppercase;
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.req-star {
  color: var(--danger);
  font-weight: 900;
}

.field-help {
  margin: 0;
  font-size: 12px;
  color: var(--fag-muted);
}

.field-error-msg {
  display: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--danger);
}

.field-group.has-error .field-error-msg {
  display: block;
}

input[type="text"],
input[type="date"],
input[type="search"],
textarea,
select {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  color: var(--fag-ink);
  background: #FFFFFF;
  border: 1.5px solid var(--fag-silver);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea {
  min-height: 88px;
  resize: vertical;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--fag-blue);
  box-shadow: 0 0 0 3px rgba(0, 55, 158, 0.12);
}

/* ==========================================================================
   DATE INFO STRIP
   ========================================================================== */
.date-rule-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 15px;
  border-radius: 10px;
  background: var(--fag-blue-soft);
  border: 1px solid #C6DCF7;
}

.date-rule-box__info {
  font-size: 12.5px;
  color: var(--fag-navy);
}

.date-rule-box__controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toggle-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--fag-navy);
  cursor: pointer;
}

/* ==========================================================================
   CHOICE CARDS (RADIO & CHECKBOX)
   ========================================================================== */
.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.choice-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.choice-grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.choice-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 9px;
  border: 1.5px solid var(--fag-border);
  background: #FFFFFF;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.choice-card:hover {
  border-color: var(--fag-blue-mid);
  background: var(--fag-blue-soft);
}

.choice-card input {
  width: 17px;
  height: 17px;
  accent-color: var(--fag-blue);
  flex-shrink: 0;
  margin: 0;
  cursor: pointer;
}

.choice-card__body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.choice-card__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--fag-ink);
  line-height: 1.25;
}

.choice-card__sub {
  font-size: 11.5px;
  color: var(--fag-muted);
}

.choice-card__icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--fag-blue-soft);
  color: var(--fag-blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.choice-card.is-selected {
  border-color: var(--fag-blue);
  background: var(--fag-blue-tint);
  box-shadow: 0 2px 8px rgba(0, 55, 158, 0.11);
}

.choice-card.is-selected .choice-card__title {
  color: var(--fag-navy);
}

.choice-card.is-selected.tone-ok {
  border-color: var(--ok);
  background: var(--ok-bg);
}

.choice-card.is-selected.tone-warn {
  border-color: var(--warn);
  background: var(--warn-bg);
}

.choice-card.is-selected.tone-danger {
  border-color: var(--danger);
  background: var(--danger-bg);
}

/* ==========================================================================
   FRENTES DE SERVIÇO — BUSCA, CATEGORIAS E CHIPS SELECIONADOS
   ========================================================================== */
.frentes-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.frentes-search-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.frentes-search-wrap {
  position: relative;
  flex: 1 1 260px;
}

.frentes-search-wrap svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--fag-muted);
  pointer-events: none;
}

.frentes-search-wrap input {
  padding-left: 36px;
}

.frentes-cats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.cat-pill {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--fag-border);
  background: #FFFFFF;
  color: var(--fag-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s ease;
}

.cat-pill:hover {
  border-color: var(--fag-blue);
  color: var(--fag-navy);
}

.cat-pill.is-active {
  background: var(--fag-navy);
  border-color: var(--fag-navy);
  color: #FFFFFF;
}

.selected-chips-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--fag-blue-soft);
  border: 1px dashed #B5D0F3;
  min-height: 40px;
}

.selected-chips-bar__empty {
  font-size: 12px;
  color: var(--fag-muted);
  font-style: italic;
}

.sel-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--fag-blue);
  color: #FFFFFF;
  font-size: 11.5px;
  font-weight: 700;
}

.sel-chip button {
  border: none;
  background: rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sel-chip button:hover {
  background: rgba(255, 255, 255, 0.4);
}

.frentes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: 310px;
  overflow-y: auto;
  padding: 4px 2px;
}

.frente-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--fag-border);
  background: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
  color: var(--fag-ink);
  cursor: pointer;
  transition: all 0.13s ease;
}

.frente-item:hover {
  border-color: var(--fag-blue-mid);
  background: var(--fag-blue-soft);
}

.frente-item.is-selected {
  border-color: var(--fag-blue);
  background: var(--fag-blue-tint);
  color: var(--fag-navy);
}

.frente-item input {
  width: 15px;
  height: 15px;
  accent-color: var(--fag-blue);
  margin: 0;
  flex-shrink: 0;
}

.outro-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1.5px dashed var(--fag-silver);
  background: #FFFFFF;
}

.outro-box label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--fag-navy);
  white-space: nowrap;
  cursor: pointer;
}

.outro-box input[type="text"] {
  padding: 7px 10px;
  font-size: 13px;
}

/* ==========================================================================
   AUTO SUMMARY BOX & ALERTS
   ========================================================================== */
.auto-summary-box {
  border-radius: 10px;
  background: linear-gradient(135deg, #F5F9FF 0%, #EAF2FC 100%);
  border: 1px solid #C0D7F5;
  padding: 13px 16px;
}

.auto-summary-box__title {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--fag-navy);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.auto-summary-box__text {
  margin: 0;
  font-size: 13px;
  color: var(--fag-ink);
  white-space: pre-line;
}

.callout {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 15px;
  border-radius: 10px;
  font-size: 13px;
}

.callout--info {
  background: var(--fag-blue-soft);
  border: 1px solid #BCD6F7;
  color: var(--fag-navy);
}

.callout--warn {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  color: #7C3504;
}

.callout--danger {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: #7F1D1D;
}

/* ==========================================================================
   UPLOAD ZONE & PHOTOS
   ========================================================================== */
.upload-dropzone {
  border: 2px dashed #A9C4EA;
  border-radius: 12px;
  background: #F6FAFF;
  padding: 22px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.16s ease;
}

.upload-dropzone:hover,
.upload-dropzone.is-dragover {
  border-color: var(--fag-blue);
  background: var(--fag-blue-tint);
}

.upload-dropzone__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--fag-navy);
  margin: 6px 0 2px;
}

.upload-dropzone__sub {
  font-size: 12px;
  color: var(--fag-muted);
}

.attachments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.att-card {
  border: 1px solid var(--fag-border);
  border-radius: 9px;
  overflow: hidden;
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
}

.att-card__thumb {
  height: 108px;
  background: #EEF2F7;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.att-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.att-card__meta {
  padding: 8px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.att-card__name {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--fag-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.att-card__size {
  font-size: 10.5px;
  color: var(--fag-muted);
}

.att-card__del {
  border: none;
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: 6px;
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

/* ==========================================================================
   SIGNATURE PAD & CONFIRMATION
   ========================================================================== */
.confirm-box {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 2px solid var(--fag-blue);
  background: var(--fag-blue-soft);
  cursor: pointer;
}

.confirm-box input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--fag-blue);
  flex-shrink: 0;
}

.confirm-box span {
  font-size: 13px;
  font-weight: 800;
  color: var(--fag-navy);
}

.sig-wrap {
  border: 1.5px solid var(--fag-silver);
  border-radius: 10px;
  background: #FFFFFF;
  overflow: hidden;
}

.sig-canvas {
  width: 100%;
  height: 130px;
  display: block;
  touch-action: none;
  cursor: crosshair;
}

.sig-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 12px;
  background: #F6F8FB;
  border-top: 1px solid #E5EAF1;
  font-size: 12px;
  color: var(--fag-muted);
}

/* ==========================================================================
   GOOGLE DRIVE CARD, ÁRVORE DE PASTAS FAGUNDES & NAMING ASSISTANT
   ========================================================================== */
.acc-card {
  border-radius: 12px;
  border: 1.5px solid #B5D0F3;
  background: linear-gradient(135deg, #F6FAFF 0%, #E9F2FD 100%);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.acc-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.drive-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #FFFFFF;
  border: 1px solid #BCD6F7;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--fag-navy);
}

.drive-badge__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fag-gray);
}

.drive-badge.is-connected .drive-badge__dot {
  background: var(--ok);
}

.drive-tree-box {
  background: #0F1E3A;
  color: #E5F0FB;
  border-radius: 9px;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.65;
  border-left: 4px solid var(--fag-gray);
  overflow-x: auto;
}

.drive-tree-box strong {
  color: #FFFFFF;
}

.drive-tree-box .tree-hl {
  color: #7CC4FF;
  font-weight: 700;
}

.drive-config-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.drive-config-row input {
  flex: 1 1 320px;
  font-size: 12.5px;
  padding: 9px 11px;
}

.drive-result-box {
  display: none;
  padding: 12px 15px;
  border-radius: 9px;
  background: var(--ok-bg);
  border: 1.5px solid var(--ok-border);
  color: #0B5C47;
  font-size: 13px;
}

.drive-result-box.is-show {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drive-result-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.drive-setup-details {
  border: 1px solid #C8DCF5;
  border-radius: 9px;
  background: #FFFFFF;
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--fag-ink);
}

.drive-setup-details summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--fag-navy);
  user-select: none;
}

.drive-setup-details ol {
  margin: 10px 0 10px 18px;
  padding: 0;
  line-height: 1.6;
}

.acc-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 9px;
  background: var(--fag-navy);
  color: #FFFFFF;
  font-size: 12.5px;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 12px rgba(0, 41, 118, 0.22);
  transition: background 0.16s ease, transform 0.14s ease;
}

.acc-btn:hover {
  background: var(--fag-blue);
  transform: translateY(-1px);
}

.naming-examples {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.naming-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  background: #FFFFFF;
  border: 1px solid #C8DCF5;
}

.naming-chip code {
  font-size: 12px;
  font-weight: 700;
  color: var(--fag-navy);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   ACTION BAR & BUTTONS
   ========================================================================== */
.nav-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 20px;
  background: var(--fag-surface);
  border: 1px solid var(--fag-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 9px;
  border: 1.5px solid transparent;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--fag-navy), var(--fag-blue));
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(0, 55, 158, 0.24);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--fag-blue), var(--fag-blue-mid));
  transform: translateY(-1px);
}

.btn-success {
  background: var(--ok);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(14, 122, 95, 0.22);
}

.btn-success:hover {
  background: #0B654E;
}

.btn-secondary {
  background: #FFFFFF;
  border-color: var(--fag-silver);
  color: var(--fag-navy);
}

.btn-secondary:hover {
  border-color: var(--fag-blue);
  background: var(--fag-blue-soft);
}

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

.export-actions-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

/* ==========================================================================
   MODAL (HISTÓRICO DE RDOs) & TOAST
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 20, 60, 0.55);
  backdrop-filter: blur(3px);
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal-backdrop.is-open {
  display: flex;
}

.modal-panel {
  width: 100%;
  max-width: 780px;
  max-height: 84vh;
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--fag-navy);
  color: #FFFFFF;
}

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px solid var(--fag-border);
  border-radius: 10px;
  background: #FAFCFF;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 120;
  padding: 12px 18px;
  border-radius: 10px;
  background: var(--fag-navy);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--fag-gray);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: all 0.22s ease;
}

.toast.is-show {
  opacity: 1;
  transform: translateY(0);
}

/* Barra de progresso de envio em 2 fases + status de reconexão offline */
.upload-progress-card {
  display: none;
  margin-top: 12px;
  padding: 13px 15px;
  border-radius: 10px;
  background: #F4F8FE;
  border: 1.5px solid #B5D0F3;
  text-align: left;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.upload-progress-card.is-show { display: block; }
.upload-progress-card.is-offline {
  background: var(--warn-bg);
  border-color: var(--warn);
  color: #7C3504;
}
.upload-progress-card.is-done {
  background: var(--ok-bg);
  border-color: var(--ok-border);
  color: #0B5C47;
}
.upload-progress-track {
  height: 8px;
  background: #DDE6F2;
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0 6px;
}
.upload-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--fag-navy), var(--fag-blue-mid));
  transition: width 0.25s ease;
}
.upload-progress-card.is-done .upload-progress-bar { background: var(--ok); }
.upload-progress-card.is-offline .upload-progress-bar { background: var(--warn); }

/* ==========================================================================
   PRINT / PDF CORPORATIVO FAGUNDES (A4)
   ========================================================================== */
#printSheet {
  display: none;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 12mm 12mm 14mm 12mm;
  }

  body {
    background: #FFFFFF !important;
    background-image: none !important;
    color: #111827 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .app-shell, .modal-backdrop, .toast {
    display: none !important;
  }

  #printSheet {
    display: block !important;
    font-family: "Segoe UI", "Roboto", Arial, sans-serif;
    font-size: 10pt;
    color: #172B3A;
  }

  .p-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid #002976;
    padding-bottom: 10px;
    margin-bottom: 12px;
  }

  .p-header__brand {
    display: flex;
    align-items: center;
    gap: 14px;
  }

  .p-header__logo {
    height: 46px;
    width: auto;
  }

  .p-header__title {
    font-size: 15pt;
    font-weight: 800;
    color: #002976;
    margin: 0;
  }

  .p-header__sub {
    font-size: 8.5pt;
    color: #58697A;
    margin: 2px 0 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .p-header__meta {
    text-align: right;
    font-size: 8.5pt;
    line-height: 1.45;
  }

  .p-meta-grid {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
  }

  .p-meta-grid th, .p-meta-grid td {
    border: 1px solid #C8D3E1;
    padding: 5px 8px;
    text-align: left;
    font-size: 9pt;
    vertical-align: top;
  }

  .p-meta-grid th {
    background: #EDF3FB;
    color: #002976;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 7.8pt;
    width: 19%;
  }

  .p-section {
    margin-bottom: 10px;
    page-break-inside: avoid;
  }

  .p-section__bar {
    background: #002976;
    color: #FFFFFF;
    font-weight: 800;
    font-size: 9pt;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 5px 10px;
    border-left: 5px solid #9B9B9B;
  }

  .p-section__bar.is-warn {
    background: #B45309;
    border-left-color: #F7D49A;
  }

  .p-section__bar.is-danger {
    background: #B91C1C;
    border-left-color: #F6B8B8;
  }

  .p-section__box {
    border: 1px solid #C8D3E1;
    border-top: none;
    padding: 8px 10px;
    font-size: 9pt;
  }

  .p-section__box.is-handoff {
    border: 1.5px solid #B91C1C;
    border-top: none;
    background: #FEF2F2;
    padding: 8px 10px;
    font-size: 9.2pt;
  }

  .p-handoff-text {
    font-weight: 700;
    color: #172B3A;
    font-size: 9.5pt;
    line-height: 1.45;
  }

  .p-row {
    margin-bottom: 6px;
  }

  .p-row:last-child {
    margin-bottom: 0;
  }

  .p-row__label {
    font-size: 7.8pt;
    font-weight: 800;
    color: #00379E;
    text-transform: uppercase;
    display: block;
    margin-bottom: 2px;
  }

  .p-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }

  .p-chip {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    background: #E5F0FB;
    border: 1px solid #B5D0F3;
    color: #002976;
    font-size: 8pt;
    font-weight: 700;
  }

  .p-photos {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 6px;
  }

  .p-photo-card {
    border: 1px solid #D1D2D4;
    padding: 4px;
    text-align: center;
  }

  .p-photo-card img {
    width: 100%;
    height: 115px;
    object-fit: cover;
    display: block;
  }

  .p-photo-card span {
    display: block;
    font-size: 7.5pt;
    margin-top: 3px;
    color: #444;
    word-break: break-all;
  }

  .p-sign-block {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top: 14px;
    page-break-inside: avoid;
  }

  .p-sign-box {
    border: 1px solid #C8D3E1;
    padding: 8px 12px;
    text-align: center;
  }

  .p-sign-box img {
    max-height: 54px;
    display: block;
    margin: 4px auto;
  }

  .p-sign-line {
    border-top: 1px solid #172B3A;
    margin-top: 8px;
    padding-top: 4px;
    font-size: 8.5pt;
    font-weight: 700;
  }

  .p-footer {
    margin-top: 12px;
    padding-top: 6px;
    border-top: 1px solid #D1D2D4;
    display: flex;
    justify-content: space-between;
    font-size: 7.5pt;
    color: #6D747E;
  }
}

/* ==========================================================================
   DESTAQUE EM VERMELHO — SERVIÇOS PENDENTES & PRÓXIMO TURNO (NA ORDEM NORMAL)
   ========================================================================== */
.handoff-highlight-card {
  background: #FEF2F2;
  border: 1.5px solid #FCA5A5;
  border-left: 5px solid #B91C1C;
  border-radius: var(--radius-md);
  padding: 14px 14px 12px;
  margin-bottom: 16px;
}

.handoff-title-red {
  color: #B91C1C !important;
  font-weight: 800 !important;
  letter-spacing: 0.2px;
}

.handoff-field {
  background: #FFFFFF;
  border: 1.5px solid #FECACA;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}

.handoff-field textarea {
  border-color: #FCA5A5;
  background: #FFFDFD;
  font-weight: 600;
  color: #172B3A;
}

.handoff-field textarea:focus {
  border-color: #B91C1C;
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.14);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 820px) {
  .hero-content {
    grid-template-columns: 1fr;
  }
  .hero-reticle-box {
    display: none;
  }
  .hero-telemetry {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 15px 16px;
  }
  .section-header__left {
    width: 100%;
  }
  .section-badge {
    align-self: flex-start;
    margin-left: 46px;
  }
  .date-rule-box__info {
    overflow-wrap: anywhere;
  }
  .grid-2, .grid-3, .choice-grid--3, .choice-grid--4, .frentes-grid, .naming-examples, .export-actions-grid {
    grid-template-columns: 1fr;
  }
  .choice-grid--2 {
    grid-template-columns: 1fr;
  }
}


/* ==========================================================================
   TELA DE LOADING / SPLASH FULL-SCREEN COM ARTE OFICIAL APROVADA (SEM FLASH)
   ========================================================================== */
body.pwa-loading .app-shell,
body.pwa-loading .pwa-bottom-nav {
  opacity: 0 !important;
  visibility: hidden !important;
}

.pwa-splash {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: 0 24px calc(32px + env(safe-area-inset-bottom, 0px));
  background-color: #001A4D;
  background-image: url('./icons/splash_fagundes.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.pwa-splash.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.pwa-splash__loader {
  position: relative;
  z-index: 2;
  width: 72%;
  max-width: 280px;
}

.pwa-splash__version {
  position: relative;
  z-index: 2;
  margin-top: 14px;
  font-family: 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2.4px;
  color: rgba(220, 233, 250, 0.88);
  text-transform: uppercase;
  text-shadow: 0 1px 6px rgba(0, 12, 42, 0.55);
}

.pwa-splash__track {
  height: 4px;
  background: rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  overflow: hidden;
}

.pwa-splash__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #7CC4FF, #FFFFFF);
  border-radius: 999px;
  animation: splashFill 1.5s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes splashFill {
  0% { width: 10%; }
  65% { width: 78%; }
  100% { width: 100%; }
}

/* ==========================================================================
   PWA APP SHELL — MENU INICIAL, BARRA INFERIOR E SAFE AREAS (ANDROID / iOS)
   ========================================================================== */
body {
  padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
}

.pwa-view { display: none; }
.pwa-view.is-active { display: block; animation: fadeSlide 0.2s ease; }

.pwa-home-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: linear-gradient(125deg, var(--fag-navy-deep) 0%, var(--fag-navy) 52%, var(--fag-blue) 100%);
  color: #FFFFFF;
  padding: 22px 22px 18px;
  border-bottom: 4px solid var(--fag-gray);
  box-shadow: var(--shadow-lg);
  margin-bottom: 16px;
}

.pwa-home-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.pwa-net-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
}

.pwa-net-pill__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34D399;
}

.pwa-net-pill.is-offline .pwa-net-pill__dot {
  background: #FBBF24;
}

.pwa-cta-card {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(135deg, var(--fag-navy) 0%, var(--fag-blue) 100%);
  color: #FFFFFF;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 41, 118, 0.25);
  margin-bottom: 14px;
  transition: transform 0.14s ease;
}

.pwa-cta-card:active { transform: scale(0.99); }

.pwa-cta-card--secondary {
  background: #FFFFFF;
  color: var(--fag-navy);
  border: 2px solid var(--fag-blue);
  box-shadow: var(--shadow-sm);
}

.pwa-cta-card--secondary .pwa-cta-card__icon {
  background: var(--fag-blue-tint);
  color: var(--fag-blue);
}

.pwa-cta-card--drive {
  background: linear-gradient(135deg, #F4F8FE 0%, #E7F1FC 100%);
  color: var(--fag-navy);
  border: 1.5px solid #B5D0F3;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}

.pwa-cta-card--drive .pwa-cta-card__icon {
  background: var(--fag-navy);
  color: #FFFFFF;
}

.pwa-type-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  vertical-align: middle;
  margin-right: 6px;
}

.pwa-type-badge--rdo {
  background: var(--fag-blue-tint);
  color: var(--fag-navy);
}

.pwa-type-badge--qf {
  background: #E6F7EE;
  color: #0B6B3A;
}

#btnOpenQuickFilesWeb,
#btnQfBackToRdoWeb {
  display: none !important;
}

.pwa-cta-card__icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pwa-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.pwa-menu-tile {
  background: #FFFFFF;
  border: 1.5px solid var(--fag-border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.pwa-menu-tile:hover {
  border-color: var(--fag-blue);
  background: var(--fag-blue-soft);
}

.pwa-menu-tile__title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--fag-navy);
}

.pwa-menu-tile__sub {
  font-size: 12px;
  color: var(--fag-muted);
}

.pwa-install-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--fag-blue-tint);
  border: 1.5px solid #B5D0F3;
  margin-bottom: 16px;
}

.pwa-list-card {
  background: #FFFFFF;
  border: 1px solid var(--fag-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}

.pwa-qr-share-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 13px 16px;
  margin-top: 12px;
  margin-bottom: 6px;
  border-radius: var(--radius-md);
  border: 1.5px dashed #93B8E8;
  background: #FFFFFF;
  color: var(--fag-navy);
  cursor: pointer;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.pwa-qr-share-btn:hover {
  background: var(--fag-blue-soft);
  border-color: var(--fag-blue);
}

.pwa-qr-share-btn:active {
  transform: scale(0.99);
}

.pwa-qr-share-btn__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--fag-blue-tint);
  color: var(--fag-navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pwa-qr-frame {
  display: inline-block;
  padding: 12px;
  background: #FFFFFF;
  border: 2px solid #C6DCF7;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0, 41, 118, 0.1);
}

.pwa-qr-frame img {
  display: block;
  width: 224px;
  height: 224px;
  max-width: 100%;
  height: auto;
}

.pwa-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  background: #FFFFFF;
  border-top: 1.5px solid var(--fag-border);
  box-shadow: 0 -4px 18px rgba(0, 41, 118, 0.08);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
}

.pwa-nav-btn {
  border: none;
  background: transparent;
  color: var(--fag-muted);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 4px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  position: relative;
}

.pwa-nav-btn.is-active {
  color: var(--fag-blue);
  background: var(--fag-blue-soft);
}

.pwa-nav-badge {
  position: absolute;
  top: 2px;
  right: calc(50% - 22px);
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--warn);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 800;
  display: none;
  align-items: center;
  justify-content: center;
}

.pwa-nav-badge.is-show { display: inline-flex; }

.field-success-card {
  display: none;
  background: #FFFFFF;
  border: 2px solid var(--ok);
  border-radius: var(--radius-lg);
  padding: 26px 20px;
  text-align: center;
  box-shadow: var(--shadow-md);
  margin-bottom: 18px;
}
.field-success-card.is-show { display: block; animation: fadeSlide 0.25s ease; }
.field-success-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--ok-bg); color: var(--ok);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.field-success-actions {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px;
}

@media print {
  .pwa-bottom-nav, #pwaViewHome, #pwaViewSent, #iosInstallModal, #shareQrModal { display: none !important; }
  body { padding-bottom: 0 !important; }
}
