:root {
  --vale-green: #0a6b3b;
  --vale-green-2: #2f8a5f;
  --vale-yellow: #e0a93a;
  --vale-blue: #0072bc;
  --ink: #1b2620;
  --muted: #5e6d65;
  --line: #dde4df;
  --bg: #eceff0;
  --panel: #f8faf9;
  --control-bg: #fcfdfc;
  --control-ink: #1b2620;
  --ghost-bg: #e6efe9;
  --ghost-border: #cbe0d4;
  --danger: #b42318;
  --shadow: 0 8px 24px rgba(20, 40, 30, 0.08);
  --font-page-title: clamp(20px, 2.2vw, 28px);
  --font-report-title: clamp(12px, 1.35vw, 17px);
  --font-task-title: clamp(16px, 1.8vw, 23px);
  --font-section-title: 17px;
  --font-card-title: 14px;
  --font-control: 13.5px;
  --font-label: 11.3px;
  --font-support: 11px;
  --font-kpi: 18px;
}

body[data-theme="night"] {
  --ink: #eef1ef;
  --muted: #aab0ad;
  --line: #3a3d3b;
  --bg: #1f2120;
  --panel: #2b2d2c;
  --control-bg: #333534;
  --control-ink: #eef1ef;
  --ghost-bg: #3a3d3b;
  --ghost-border: #51544f;
  --shadow: 0 12px 28px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.topbar {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  padding-top: max(10px, env(safe-area-inset-top));
  color: #fff;
  background: linear-gradient(90deg, var(--vale-green), #005f35 72%, var(--vale-blue));
  border-bottom: 5px solid var(--vale-yellow);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.sidebar-toggle-btn {
  /* sized by .icon-btn now */
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.brand strong,
.brand span {
  display: block;
  min-width: 0;
}
.brand strong {
  font-size: 15px;
  line-height: 1.15;
}

.brand-mark {
  width: 60px;
  height: 32px;
  flex: 0 0 60px;
  display: grid;
  place-items: center;
  color: var(--vale-green);
  background: #fff;
  border-bottom: 4px solid var(--vale-yellow);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0;
}

.brand span {
  font-size: 11.5px;
  opacity: 0.9;
}

.sync-chip {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 12px;
  font-size: 11.5px;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 67px);
  min-height: calc(100dvh - 67px);
}

.sidebar {
  padding: 20px 14px;
  background: color-mix(in srgb, var(--panel) 78%, var(--bg));
  border-right: 1px solid var(--line);
}

.sidebar-collapsed .shell {
  grid-template-columns: 1fr;
}

.sidebar-collapsed .sidebar {
  display: none;
}

.nav-btn {
  width: 100%;
  min-height: 44px;
  margin-bottom: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: transparent;
  border-radius: 8px;
  text-align: left;
  font-weight: 700;
}

.nav-btn.active {
  color: #fff;
  background: var(--vale-green);
}

.workspace {
  padding: 28px;
  overflow: auto;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.welcome-panel {
  min-height: min(560px, calc(100dvh - 170px));
  display: grid;
  align-content: center;
  gap: 16px;
  padding: 26px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.welcome-panel p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.app-credit {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.section-head.compact {
  margin-bottom: 12px;
}

.view-arrows {
  display: inline-flex;
  gap: 6px;
  margin-top: 8px;
}

.view-arrow {
  width: 32px;
  height: 29px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--vale-green);
  border: 1px solid rgba(0, 122, 61, 0.3);
  border-radius: 7px;
  box-shadow: 0 6px 14px rgba(23, 33, 28, 0.2);
  font-size: 20px;
  line-height: 1;
  font-weight: 900;
}

.view-arrow:hover {
  background: #006834;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--vale-green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: var(--font-page-title);
}

h2 {
  font-size: var(--font-section-title);
}

h3 {
  font-size: var(--font-card-title);
}

.report-view-title {
  font-size: var(--font-report-title);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary,
.ghost,
.danger {
  min-height: 34px;
  padding: 8px 11px;
  border-radius: 7px;
  font-size: var(--font-control);
  font-weight: 750;
}

.primary {
  color: #fff;
  background: var(--vale-green);
}

.ghost {
  color: var(--vale-green);
  background: var(--ghost-bg);
  border: 1px solid var(--ghost-border);
}

.danger {
  color: #fff;
  background: var(--danger);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 11px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.coordinate-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.coordinate-card span,
.muted-text {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.coordinate-card.disabled {
  opacity: 0.68;
}

.lgpd-modal,
.settings-modal,
.app-modal,
.restriction-screen {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(10, 24, 18, 0.72);
  z-index: 40;
}

.restriction-screen {
  z-index: 35;
}

.lgpd-modal.open,
.settings-modal.open,
.app-modal.open,
.restriction-screen:not([hidden]) {
  display: grid;
}

.lgpd-panel,
.settings-panel,
.app-modal-panel,
.restriction-card {
  width: min(960px, 100%);
  max-height: min(88vh, 920px);
  overflow: auto;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.lgpd-panel {
  width: min(740px, 100%);
}

.compact-modal {
  width: min(540px, 100%);
}

.laudo-panel {
  width: min(1040px, 100%);
}

.admin-panel {
  width: min(1160px, 100%);
}

.lgpd-panel p,
.risk-message,
.restriction-card p {
  color: var(--muted);
  line-height: 1.48;
}

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

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

.admin-list {
  display: grid;
  gap: 10px;
}

.admin-message,
.admin-empty {
  padding: 10px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-message strong {
  display: block;
  margin-bottom: 6px;
  color: var(--vale-green);
  font-size: 12px;
}

.admin-message p {
  margin: 0;
  color: var(--ink);
  line-height: 1.4;
}

.settings-section {
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stacked-actions {
  display: grid;
}

.settings-section.wide {
  grid-column: 1 / -1;
}

.settings-section h3 {
  margin-bottom: 12px;
}

.toggle-line {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
}

.toggle-line input {
  width: 22px;
  height: 22px;
}

.settings-form {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.logo-preview-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.logo-preview-row > div {
  min-height: 96px;
  display: grid;
  gap: 8px;
  place-items: center;
  padding: 10px;
  background: var(--bg);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.logo-preview-row img {
  max-width: 180px;
  max-height: 62px;
  display: none;
}

.logo-preview-row .has-logo img {
  display: block;
}

.is-restricted .shell {
  pointer-events: none;
  filter: grayscale(0.35);
}

.is-restricted .topbar,
.is-restricted .settings-modal,
.is-restricted .lgpd-modal,
.is-restricted .restriction-screen {
  pointer-events: auto;
  filter: none;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: var(--font-label);
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  color: var(--control-ink);
  background: var(--control-bg);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 10px;
}

.rac-fieldset {
  grid-column: 1 / -1;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.rac-fieldset legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: var(--font-label);
  font-weight: 900;
}

.rac-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rac-options label {
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 5px 8px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.rac-options input {
  width: 15px;
  height: 15px;
  padding: 0;
}

body[data-theme="night"] input,
body[data-theme="night"] select,
body[data-theme="night"] textarea {
  color: var(--control-ink);
  background: var(--control-bg);
  border-color: var(--ghost-border);
}

body[data-theme="night"] input::placeholder,
body[data-theme="night"] textarea::placeholder {
  color: #91a79b;
}

textarea {
  resize: vertical;
}

.summary-band {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 10px;
  margin: 14px 0;
}

.summary-band > div,
.extracted-note {
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.summary-band span {
  display: block;
  color: var(--muted);
  font-size: var(--font-support);
  font-weight: 800;
}

.summary-band strong {
  display: block;
  margin-top: 4px;
  font-size: var(--font-kpi);
}

.extracted-note {
  line-height: 1.45;
}

.tasks-list,
.archive-list,
.model-list,
.print-list,
.laudo-items {
  display: grid;
  gap: 14px;
}

.task-view-title {
  font-size: var(--font-task-title);
  text-transform: uppercase;
  letter-spacing: 0;
}

.task-view-actions {
  align-items: flex-start;
}

.mini-hub {
  position: relative;
}

.mini-hub-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 18;
  width: min(240px, calc(100vw - 36px));
  display: grid;
  gap: 8px;
  padding: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.mini-hub-menu[hidden] {
  display: none;
}

.mini-hub-menu button {
  width: 100%;
}

.set-analysis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.task-card,
.photo-item,
.archive-card,
.set-card,
.set-suggestion,
.print-row,
.laudo-card,
.model-row,
.model-editor {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.task-card {
  padding: 16px;
}

.task-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.task-title-row > div {
  display: flex;
  gap: 12px;
}

.task-index {
  min-width: 38px;
  height: 30px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--vale-green);
  border-radius: 8px;
  font-weight: 900;
}

.task-media-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.file-capture {
  position: relative;
  display: inline-grid;
  min-width: 112px;
  height: 40px;
  place-items: center;
  color: #fff;
  background: var(--vale-blue);
  border-radius: 8px;
  font-size: 14px;
}

.camera-button {
  border: 0;
  font-weight: 800;
}

.file-capture input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.hidden-input {
  display: none;
}

.media-capture {
  color: var(--vale-green);
  background: var(--ghost-bg);
  border: 1px solid var(--ghost-border);
}

.task-list-footer {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.camera-modal {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(10, 24, 18, 0.72);
  z-index: 20;
}

.camera-modal.open {
  display: grid;
}

.camera-panel {
  width: min(760px, 100%);
  padding: 16px;
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

video {
  width: 100%;
  max-height: 52vh;
  margin: 12px 0;
  background: #0d1510;
  border-radius: 8px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.photo-item {
  padding: 12px;
}

.photo-frame {
  /* Sem aspect-ratio forçado: a moldura se adapta à proporção real da foto.
     Foto horizontal preenche em largura; vertical preenche em altura, sem corte.
     max-height limita pra evitar fotos verticais ocupando metade da tela. */
  max-height: 60vh;
  min-height: 180px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: color-mix(in srgb, var(--panel) 82%, var(--bg));
  border: 1px solid var(--line);
  border-radius: 8px;
}

.photo-frame img {
  display: block;
  max-width: 100%;
  max-height: 60vh;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 0.18s ease;
}

.photo-tools,
.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
}

.checks input {
  width: 18px;
  height: 18px;
}

.models-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(300px, 1.2fr);
  gap: 16px;
}

.model-row,
.archive-card,
.set-card,
.set-suggestion,
.print-row,
.laudo-card {
  padding: 14px;
}

.set-card {
  display: grid;
  gap: 4px;
}

.set-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.set-card strong {
  color: var(--vale-green);
  font-size: 28px;
  line-height: 1;
}

.set-card small {
  color: var(--muted);
  line-height: 1.3;
}

.set-card.attention {
  border-color: var(--vale-yellow);
  box-shadow: 0 0 0 2px rgba(246,195,67,0.22);
}

.set-card.info {
  border-color: var(--vale-blue);
  box-shadow: 0 0 0 2px rgba(0,114,188,0.14);
}

.set-suggestion {
  grid-column: 1 / -1;
}

.set-suggestion p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.print-board {
  display: grid;
  gap: 18px;
}

.print-section {
  display: grid;
  gap: 12px;
}

.print-row {
  width: 100%;
  text-align: left;
}

.print-row strong,
.laudo-card strong {
  display: block;
  margin-bottom: 4px;
}

.print-row span,
.laudo-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.modal-action-grid,
.layout-options {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.print-orientation-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.print-orientation-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.print-orientation-options input {
  width: 18px;
  height: 18px;
}

.layout-option {
  display: grid;
  gap: 4px;
  padding: 13px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
}

.layout-option:hover,
.print-row:hover {
  border-color: var(--vale-green);
  box-shadow: 0 0 0 2px rgba(0,122,61,0.12);
}

.layout-option span {
  color: var(--muted);
  font-size: 13px;
}

.laudo-card {
  display: grid;
  grid-template-columns: minmax(170px, 240px) 1fr;
  gap: 14px;
}

.laudo-card img {
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  background: color-mix(in srgb, var(--panel) 82%, var(--bg));
  border: 1px solid var(--line);
  border-radius: 8px;
}

.laudo-card textarea {
  min-height: 92px;
  margin-top: 10px;
}

.summary-actions-box {
  margin: 16px 0;
}

.model-row {
  text-align: left;
}

.model-row.active {
  border-color: var(--vale-green);
  box-shadow: 0 0 0 2px rgba(0,122,61,0.16);
}

.model-row strong,
.archive-card strong {
  display: block;
  margin-bottom: 4px;
}

.model-row span,
.archive-card span {
  color: var(--muted);
  font-size: 13px;
}

.model-editor {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.pro-panel {
  width: min(1080px, 100%);
}

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

.pro-card {
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.pro-card ol,
.pro-card ul {
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--ink);
  line-height: 1.45;
}

body[data-theme="night"] .topbar {
  background: linear-gradient(90deg, #003d24, #062018 72%, #043d63);
}

body[data-theme="night"] .settings-btn,
body[data-theme="night"] .sync-chip {
  color: #eef7f0;
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.32);
}

body[data-theme="night"] .primary {
  color: #ffffff;
  background: #008d49;
}

body[data-theme="night"] .ghost,
body[data-theme="night"] .layout-option,
body[data-theme="night"] .print-orientation-options label {
  color: #eef7f0;
  background: var(--ghost-bg);
  border-color: var(--ghost-border);
}

body[data-theme="night"] .nav-btn:not(.active) {
  color: #eef7f0;
}

body[data-theme="night"] .nav-btn:disabled {
  color: #91a79b;
  opacity: 0.72;
}

body[data-theme="night"] .eyebrow,
body[data-theme="night"] .admin-message strong,
body[data-theme="night"] .set-card strong,
body[data-theme="night"] .laudo-summary-print strong {
  color: #35c878;
}

body[data-theme="night"] .brand-mark {
  color: #007a3d;
  background: #ffffff;
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: flex;
    gap: 6px;
    padding: 10px 14px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
    scrollbar-width: thin;
  }
  .sidebar::-webkit-scrollbar { height: 4px; }
  .sidebar::-webkit-scrollbar-thumb { background: var(--line); border-radius: 2px; }

  .form-grid,
  .summary-band,
  .models-layout,
  .laudo-card,
  .admin-grid,
  .pro-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .section-head,
  .task-title-row {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace {
    padding: 18px;
  }

  .actions,
  .photo-tools,
  .task-media-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .mini-hub,
  .mini-hub > .primary {
    width: 100%;
  }

  .mini-hub-menu {
    position: static;
    width: 100%;
    margin-top: 8px;
  }

  .file-capture,
  .task-list-footer .primary {
    width: 100%;
  }
}

/* Mobile pack: force touch-first layout even on tablets. */
.shell {
  grid-template-columns: 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  border-right: 0;
  border-bottom: 1px solid var(--line);
}

/* Aba estática, sem pílula/sombra/mudança de tamanho ao clicar — mesmo
   padrão já usado em "Relatórios salvos / Modelos" no Banco Local
   (.archive-tab). Sem preenchimento de fundo: só cor de texto + sublinhado
   indicam a aba ativa, então não há forma alguma pra "virar oval". */
.nav-btn {
  width: auto;
  min-width: max-content;
  margin: 0;
  padding: 10px 4px;
  border-radius: 0;
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.nav-btn:hover {
  color: var(--ink);
}
.nav-btn.active {
  background: transparent;
  color: var(--vale-green);
  border-bottom-color: var(--vale-green);
}
body[data-theme="night"] .nav-btn.active {
  background: transparent;
  color: #d6d8d6;
  border-bottom-color: #d6d8d6;
}

.workspace {
  padding: 18px;
  padding-bottom: max(28px, env(safe-area-inset-bottom));
}

.form-grid,
.summary-band,
.models-layout,
.settings-grid,
.logo-preview-row {
  grid-template-columns: 1fr;
}

.task-card,
.photo-item,
.archive-card,
.model-row,
.model-editor {
  box-shadow: 0 8px 18px rgba(23, 33, 28, 0.08);
}

.file-capture,
.camera-button,
.task-list-footer .primary {
  width: 100%;
}

/* === 0.4.8: topbar icons, brand button, archive tabs, brand-info modal === */
.brand-button {
  display: flex;
  align-items: center;
  gap: 14px;
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.brand-button:hover .brand-mark,
.brand-button:focus-visible .brand-mark {
  outline: 2px solid var(--vale-yellow);
  outline-offset: 2px;
  border-radius: 4px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.22); }
.icon-btn:active { transform: scale(0.96); }
.icon-btn:focus-visible { outline: 2px solid var(--vale-yellow); outline-offset: 2px; }
.icon-btn[aria-expanded="false"] { background: rgba(0, 0, 0, 0.25); }

.archive-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin: 12px 0 16px;
}
.archive-tab {
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 9px 16px;
  font: inherit;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.archive-tab:hover { color: var(--ink); }
.archive-tab.active {
  color: var(--vale-green);
  border-bottom-color: var(--vale-green);
  font-weight: 600;
}
body[data-theme="night"] .archive-tab.active {
  color: #d6d8d6;
  border-bottom-color: #d6d8d6;
}

.archive-subtitle {
  margin: 16px 0 8px;
  font-size: 15px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.section-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.section-subhead .actions { display: flex; gap: 8px; }

/* PRO inside Settings: collapsible details to keep modal compact */
.settings-pro details {
  margin: 6px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
}
.settings-pro details[open] { padding-bottom: 8px; }
.settings-pro summary {
  cursor: pointer;
  padding: 9px 0;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--ink);
}
.settings-pro ol, .settings-pro ul {
  margin: 4px 0 0;
  padding-left: 22px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
}

/* Brand info modal */
.brand-info-panel {
  max-width: 520px;
}
.brand-info-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.brand-info-section h3 {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.brand-info-version {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--vale-green);
}
body[data-theme="night"] .brand-info-version { color: #d6d8d6; }
.brand-info-storage { font-size: 13px; }
.storage-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
}
.storage-row:last-child { border-bottom: 0; }
.storage-row.storage-total {
  padding: 9px 0;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
}
.storage-row.storage-total strong { color: var(--vale-green); }
body[data-theme="night"] .storage-row.storage-total strong { color: #d6d8d6; }
.storage-breakdown { margin-top: 4px; }

/* Admin: section head with right-aligned destructive action */
.admin-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.admin-section-head h3 { margin: 0; }
.admin-section-head .danger {
  padding: 6px 12px;
  font-size: 12.5px;
}

/* === 0.4.9: topbar tight layout for narrow phones === */
@media (max-width: 480px) {
  .topbar { padding: 8px 12px; gap: 10px; }
  .brand-mark { width: 52px; height: 28px; font-size: 12px; flex-basis: 52px; }
  .brand strong { font-size: 13.5px; }
  .brand span { font-size: 10.5px; }
  .icon-btn { width: 34px; height: 34px; }
  .sync-chip { height: 30px; max-width: 130px; font-size: 10.5px; padding: 0 10px; }
}

@media (max-width: 380px) {
  .brand span { display: none; }
  .sync-chip { max-width: 100px; }
}

/* ===== v0.6.0 — Entrada amigável + form otimizado ===== */
.hero-home {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--vale-green) 0%, #08552f 100%);
  color: #f3f8f5;
  padding: 30px 26px 26px;
  box-shadow: var(--shadow);
}
.hero-home::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}
.hero-home .hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #bfe6cf;
  margin: 0 0 10px;
}
.hero-home h1 {
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.12;
  margin: 0 0 10px;
  font-weight: 700;
}
.hero-home p.hero-sub {
  margin: 0 0 22px;
  max-width: 52ch;
  font-size: 14.5px;
  line-height: 1.55;
  color: #d9ece1;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; position: relative; z-index: 1; }
.hero-actions .primary {
  background: #f8faf9;
  color: var(--vale-green);
  font-weight: 700;
}
.hero-actions .ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #f3f8f5;
  border: 1px solid rgba(255, 255, 255, 0.4);
}
.hero-pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.hero-pillar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.hero-pillar .pill-icon {
  font-size: 22px;
  color: var(--vale-green);
  margin-bottom: 6px;
}
.hero-pillar strong { display: block; font-size: 14px; color: var(--ink); margin-bottom: 2px; }
.hero-pillar span { font-size: 12px; color: var(--muted); line-height: 1.4; }
.hero-credit { margin-top: 16px; font-size: 12px; color: var(--muted); text-align: center; }

/* Required trio */
.req-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.req-grid label { font-size: var(--font-label); color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.req-grid .req-badge { color: var(--vale-green); font-weight: 700; }
.combo-wrap { position: relative; }
.combo-hint { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* OM detail chips */
.detail-head { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 10px; }
.detail-head h2 { font-size: 15px; margin: 0; color: var(--ink); }
.chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.detail-chip {
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.05s;
  box-shadow: var(--shadow);
}
.detail-chip:hover { border-color: var(--ghost-border); }
.detail-chip:active { transform: scale(0.99); }
.detail-chip .chip-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted);
}
.detail-chip .chip-value { display: block; margin-top: 4px; font-size: 14px; font-weight: 600; color: var(--ink); word-break: break-word; }
.detail-chip.empty .chip-value { color: var(--muted); font-weight: 400; font-style: italic; }
.detail-chip .chip-label i { color: var(--vale-green); }

/* Generic field popup */
.field-modal, .om-modal {
  position: fixed; inset: 0; display: none; align-items: center; justify-content: center;
  background: rgba(15, 25, 20, 0.55); z-index: 60; padding: 18px;
}
.field-modal[aria-hidden="false"], .om-modal[aria-hidden="false"] { display: flex; }
.field-panel {
  width: 100%; max-width: 380px; background: var(--panel);
  border-radius: 16px; padding: 20px; box-shadow: 0 24px 60px rgba(0,0,0,0.3);
}
.field-panel h3 { margin: 0 0 14px; font-size: 16px; color: var(--ink); }
.field-panel .field-body label { display: flex; flex-direction: column; gap: 6px; font-size: var(--font-label); color: var(--muted); }
.field-panel .rac-options { display: flex; flex-wrap: wrap; gap: 10px; }
.field-panel .rac-options label { flex-direction: row; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); }
.field-panel .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* Executants list */
.exec-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.exec-row { display: flex; gap: 8px; align-items: center; }
.exec-row input { flex: 1; }
.exec-row .exec-remove {
  background: var(--ghost-bg); border: 1px solid var(--ghost-border); color: var(--danger);
  border-radius: 10px; width: 38px; height: 38px; cursor: pointer; flex: 0 0 auto;
}
.exec-empty { font-size: 12px; color: var(--muted); font-style: italic; }

/* Zabbix bank manager */
.zbx-note { font-size: 12px; color: var(--muted); margin: 6px 0; }
.zbx-count { font-size: 12px; color: var(--vale-green); font-weight: 600; }

/* Model paste */
.model-paste { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.model-paste summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--vale-green); }
.model-paste textarea { margin-top: 10px; }
.model-paste .paste-help { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 8px 0; }
.visually-hidden-fields { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
