/* Krypton (nacional): ajustes ao design partilhado */

body.theme-light {
  --accent: #ED1C24;
  --accent-h: #F04049;
  --accent-dim: rgba(237, 28, 36, 0.08);
  --accent-glow: rgba(237, 28, 36, 0.18);
  --border-a: rgba(237, 28, 36, 0.24);
  --accent-text: #C4161D;
  --on-accent: #ffffff;
}
body.theme-dark {
  --accent: #ED1C24;
  --accent-h: #F04049;
  --accent-dim: rgba(237, 28, 36, 0.10);
  --accent-glow: rgba(237, 28, 36, 0.20);
  --border-a: rgba(237, 28, 36, 0.26);
  --accent-text: #F3666C;
  --on-accent: #ffffff;
}

body:is(.theme-light, .theme-dark) .btn-accent,
body:is(.theme-light, .theme-dark) .am-btn-save,
body:is(.theme-light, .theme-dark) .bio-btn,
body:is(.theme-light, .theme-dark) .user-dot-avatar {
  color: #ffffff !important;
}
body:is(.theme-light, .theme-dark) #support-help-fab svg {
  stroke: #ffffff !important;
}

body:is(.theme-light, .theme-dark) input[type="checkbox"]:checked {
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l5 5L20 7'/%3E%3C/svg%3E") no-repeat center / 12px;
}

body:is(.theme-light, .theme-dark) #support-help-fab {
  box-shadow: 0 6px 20px rgba(237, 28, 36, 0.40) !important;
}
body:is(.theme-light, .theme-dark) #support-help-fab:hover {
  box-shadow: 0 8px 24px rgba(237, 28, 36, 0.50) !important;
}
body:is(.theme-light, .theme-dark) .toggle.on {
  background: rgba(237, 28, 36, 0.28) !important;
  border-color: var(--accent) !important;
}

/* ── Fase C: estrutura ── */

body:is(.theme-light, .theme-dark) .client-admin-grid {
  background: none !important; border: none !important; padding: 0 !important;
}

/* ── Fase D: secções nacionais ── */

/* ── Grelha de documentos ── */
body:is(.theme-light, .theme-dark) .proj-docs-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(clamp(140px, 13vw, 200px), 1fr)) !important;
  gap: clamp(10px, 1vw, 16px) !important;
  background: none !important; border: none !important;
}
body:is(.theme-light, .theme-dark) .doc-card {
  background: var(--surface) !important;
  border: var(--line-w) solid var(--line) !important; border-radius: 8px !important;
  box-shadow: none !important; padding: clamp(14px, 1.4vw, 20px) !important;
  transition: border-color 0.15s, box-shadow 0.15s;
}
body:is(.theme-light, .theme-dark) .doc-card:hover {
  border-color: var(--text-3) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08) !important;
}
body:is(.theme-light, .theme-dark) .doc-card svg { color: var(--accent) !important; stroke: var(--accent) !important; }
body:is(.theme-light, .theme-dark) .doc-card .doc-card-label,
body:is(.theme-light, .theme-dark) .doc-card span {
  font-family: var(--font-body) !important; font-weight: 700 !important;
  color: var(--text) !important; letter-spacing: 0.2px;
}

body:is(.theme-light, .theme-dark) .doc-page-kicker {
  font-family: var(--font-body) !important; font-weight: 700 !important;
  font-size: 11px !important; letter-spacing: 1.5px !important; text-transform: uppercase;
  color: var(--accent-text) !important;
}
body:is(.theme-light, .theme-dark) .doc-page-title {
  font-family: var(--font-display) !important; font-weight: 700 !important;
  font-size: clamp(26px, 2vw + 8px, 40px) !important; letter-spacing: -0.4px !important;
  text-transform: uppercase; color: var(--text) !important;
}
body:is(.theme-light, .theme-dark) .doc-page-title span { color: var(--accent) !important; }
body:is(.theme-light, .theme-dark) .doc-page-subtitle {
  font-family: var(--font-body) !important; color: var(--text-2) !important;
}
body:is(.theme-light, .theme-dark) .doc-page-add-panel {
  background: var(--surface) !important; border: var(--line-w) solid var(--line) !important; border-radius: 12px !important;
}
body:is(.theme-light, .theme-dark) .packet-doc-item {
  background: var(--surface) !important; border: var(--line-w) solid var(--line) !important; border-radius: 8px !important;
}
body:is(.theme-light, .theme-dark) .packet-doc-item.is-checked {
  background: var(--surface) !important;
  border-color: var(--accent) !important;
  background-image: none !important;
}

/* ── Secções de produção ── */
body:is(.theme-light, .theme-dark) .prod-section-card {
  background: var(--surface) !important; border: var(--line-w) solid var(--line) !important;
  border-radius: 12px !important; box-shadow: none !important;
  padding: clamp(16px, 1.6vw, 24px) !important; margin: 0 0 clamp(14px, 1.4vw, 20px) !important;
}
body:is(.theme-light, .theme-dark) .prod-section-card-hdr {
  background: none !important; border: none !important;
  padding: 0 0 clamp(10px, 1vw, 16px) !important;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
body:is(.theme-light, .theme-dark) .prod-section-card-title {
  font-family: var(--font-display) !important; font-weight: 700 !important;
  font-size: clamp(17px, 1.2vw + 4px, 24px) !important;
  text-transform: uppercase; color: var(--text) !important; letter-spacing: -0.2px;
}
body:is(.theme-light, .theme-dark) .prod-section-card-body {
  background: none !important; border: none !important; padding: 0 !important;
}
body:is(.theme-light, .theme-dark) .prod-inline-panel,
body:is(.theme-light, .theme-dark) .prod-section-card-editor {
  background: var(--bg-2) !important; border: var(--line-w) solid var(--line) !important; border-radius: 10px !important;
}
body:is(.theme-light, .theme-dark) .prod-tabs { background: none !important; border: none !important; gap: clamp(14px, 1.5vw, 24px) !important; display: flex; flex-wrap: wrap; }
body:is(.theme-light, .theme-dark) .prod-tabs .prod-tab,
body:is(.theme-light, .theme-dark) .prod-tabs button {
  background: none !important; border: none !important; border-radius: 0 !important;
  box-shadow: none !important;
  font-family: var(--font-body) !important; font-weight: 700 !important;
  text-transform: uppercase; letter-spacing: 0.5px; font-size: 12px !important;
  color: var(--text-3) !important; padding: 0 0 4px !important; cursor: pointer;
}
body:is(.theme-light, .theme-dark) .prod-tabs .prod-tab.active,
body:is(.theme-light, .theme-dark) .prod-tabs button.active {
  color: var(--text) !important;
  border-bottom: 3px solid var(--accent) !important;
}
body:is(.theme-light, .theme-dark) .proj-nav-bar { background: none !important; border: none !important; }
body:is(.theme-light, .theme-dark) .proj-section-back-name {
  font-family: var(--font-body) !important; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-2) !important;
}

body.theme-light .proj-detail-hero.has-project-image { background-image: none !important; }

body:is(.theme-light, .theme-dark) .filt.on,
body:is(.theme-light, .theme-dark) .filter-row .filt.on {
  text-shadow: 0 4px 16px rgba(237, 28, 36, 0.35) !important;
}

/* ── Página de documento do pacote ── */
body:is(.theme-light, .theme-dark) #sec-project-detail #wrap-packet-doc {
  display: none !important;
}

/* ── Páginas de secção ── */
body:is(.theme-light, .theme-dark) #sec-project-detail.section-mode .prod-section-card.section-active {
  background: none !important; border: none !important; box-shadow: none !important;
  padding: 0 !important;
}
body:is(.theme-light, .theme-dark) #sec-project-detail.section-mode .prod-section-card-hdr {
  background: none !important;
  box-shadow: none !important;
  border: none !important; border-bottom: none !important;
  padding: 0 0 clamp(14px, 1.4vw, 22px) !important;
  position: static !important;
}
body:is(.theme-light, .theme-dark) #sec-project-detail.section-mode .prod-section-card-title {
  color: var(--text) !important; text-shadow: none !important;
  font-family: var(--font-display) !important; font-weight: 700 !important;
  font-size: clamp(24px, 1.6vw + 8px, 34px) !important;
  text-transform: uppercase; letter-spacing: -0.3px;
}
body:is(.theme-light, .theme-dark) #sec-project-detail.section-mode .prod-section-card-hdr .btn,
body:is(.theme-light, .theme-dark) #sec-project-detail.section-mode .prod-section-card-hdr .btn-outline,
body:is(.theme-light, .theme-dark) #sec-project-detail.section-mode .prod-section-card-hdr .btn-sm {
  background: none !important; border: none !important; box-shadow: none !important;
  font-family: var(--font-body) !important; font-weight: 700 !important;
  text-transform: uppercase; letter-spacing: 0.5px; font-size: 12px !important;
  color: var(--text-3) !important; padding: 0 !important; cursor: pointer;
}
body:is(.theme-light, .theme-dark) #sec-project-detail.section-mode .prod-section-card-hdr .btn:hover,
body:is(.theme-light, .theme-dark) #sec-project-detail.section-mode .prod-section-card-hdr .btn-outline:hover {
  color: var(--text) !important; background: none !important; border: none !important;
}
body:is(.theme-light, .theme-dark) #sec-project-detail.section-mode .prod-section-card-hdr .btn-accent {
  background: var(--accent) !important; color: #fff !important; border: none !important;
  border-radius: var(--r-pill) !important; padding: 9px 20px !important;
}
body:is(.theme-light, .theme-dark) #sec-project-detail.section-mode .prod-section-hdr-actions { gap: clamp(14px, 1.4vw, 22px) !important; }

body:is(.theme-light, .theme-dark) .prod-inline-panel,
body:is(.theme-light, .theme-dark) .prod-section-card-editor {
  background: var(--bg-2) !important; border: var(--line-w) solid var(--line) !important;
  border-radius: 12px !important; padding: clamp(14px, 1.4vw, 22px) !important;
}
body:is(.theme-light, .theme-dark) .prod-inline-panel input:not([type="checkbox"]):not([type="radio"]),
body:is(.theme-light, .theme-dark) .prod-inline-panel select,
body:is(.theme-light, .theme-dark) .prod-inline-panel textarea,
body:is(.theme-light, .theme-dark) .prod-section-card-editor input:not([type="checkbox"]):not([type="radio"]),
body:is(.theme-light, .theme-dark) .prod-section-card-editor select,
body:is(.theme-light, .theme-dark) .prod-section-card-editor textarea {
  background: var(--surface) !important; border: none !important;
  border-radius: var(--r-pill) !important;
  box-shadow: inset 0 0 0 1px var(--field-ring) !important;
  padding: 10px 16px !important;
  font-family: var(--font-body) !important; font-size: 13px !important;
  color: var(--text) !important;
}
body:is(.theme-light, .theme-dark) .prod-inline-panel textarea,
body:is(.theme-light, .theme-dark) .prod-section-card-editor textarea { border-radius: 14px !important; }
body:is(.theme-light, .theme-dark) .prod-inline-panel input:focus,
body:is(.theme-light, .theme-dark) .prod-inline-panel select:focus,
body:is(.theme-light, .theme-dark) .prod-section-card-editor input:focus,
body:is(.theme-light, .theme-dark) .prod-section-card-editor select:focus {
  box-shadow: inset 0 0 0 1.5px var(--accent) !important; outline: none !important;
}
body:is(.theme-light, .theme-dark) .prod-inline-panel label,
body:is(.theme-light, .theme-dark) .prod-section-card-editor label,
body:is(.theme-light, .theme-dark) .crew-editor-lbl {
  font-family: var(--font-body) !important; font-weight: 700 !important;
  font-size: 11px !important; letter-spacing: 1px !important; text-transform: uppercase;
  color: var(--text-3) !important;
}

/* ── Polimento nacional ── */
body:is(.theme-light, .theme-dark) .prod-inline-panel-title {
  font-family: var(--font-body) !important; font-weight: 700 !important;
  font-size: 11px !important; letter-spacing: 1.5px !important; text-transform: uppercase;
  color: var(--text-3) !important;
  padding-bottom: 12px !important; border-bottom: var(--line-w) solid var(--line) !important;
  margin-bottom: 18px !important;
}
body:is(.theme-light, .theme-dark) .prod-inline-panel-title span { color: var(--accent-text) !important; }
