/* ==========================================================================
   RDO — Sistema de Registro de Obras — Design System (vanilla CSS)
   Industrial + moderno. Primária #1976D2, fundo #f0f2f5.
   ========================================================================== */

:root {
  --primary: #1976D2;
  --primary-dark: #115293;
  --primary-hover: #1565C0;
  --primary-light: #E3F2FD;
  --primary-soft: #D6E9FB;

  --bg: #f0f2f5;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --border: #d9dee5;
  --border-strong: #c3cad4;

  --text: #1f2937;
  --text-muted: #6b7280;
  --text-light: #9aa3ae;

  --success: #16a34a;
  --success-bg: #dcfce7;
  --success-dark: #15803d;
  --error: #dc2626;
  --error-bg: #fee2e2;
  --error-dark: #b91c1c;
  --warning: #b45309;
  --warning-bg: #fef3c7;
  --info: #1976D2;
  --info-bg: #e3f2fd;
  --dark: #374151;
  --dark-bg: #e5e7eb;

  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow: 0 2px 8px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.16);

  --sidebar-w: 240px;
  --topbar-h: 58px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 { margin: 0 0 0.5em; font-weight: 600; line-height: 1.25; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }

p { margin: 0 0 1em; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; }

hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }

.mono { font-family: var(--mono); }
.muted { color: var(--text-muted); }
.nowrap { white-space: nowrap; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font: inherit;
  font-weight: 500;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-symbol { display: inline-flex; width: 18px; height: 18px; align-items: center; justify-content: center; flex: 0 0 18px; font-size: 16px; line-height: 1; font-weight: 700; }

.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }

.btn-danger { background: var(--error); border-color: var(--error); color: #fff; }
.btn-danger:hover { background: var(--error-dark); border-color: var(--error-dark); color: #fff; }

.btn-outline-danger { color: var(--error); border-color: var(--error); background: transparent; }
.btn-outline-danger:hover { background: var(--error-bg); color: var(--error-dark); }

.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: var(--success-dark); border-color: var(--success-dark); color: #fff; }

.btn-sm { padding: 4px 10px; font-size: 12.5px; border-radius: 5px; }
.btn-block { width: 100%; }
.btn-link {
  background: none; border: none; color: var(--primary); cursor: pointer; padding: 0;
  font-size: 13.5px; font-weight: 500;
}
.btn-link:hover { color: var(--primary-dark); text-decoration: underline; }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form-group { margin-bottom: 14px; }
.form-group label,
.field > label,
.field label[for] {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.form-group label .req { color: var(--error); }

.field { margin-bottom: 13px; }
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="date"],
.field input[type="number"],
.field input[type="search"],
.field input[type="url"],
.field select,
.field textarea,
.field input:not([type]) {
  width: 100%;
  padding: 8px 10px;
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.15);
}
.field textarea { min-height: 84px; resize: vertical; }
.field input[readonly] { background: var(--surface-2); color: var(--text-muted); }

.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.checkbox-line,
.radio-line { display: flex; align-items: center; gap: 7px; font-size: 13.5px; }
.checkbox-line input { width: auto; }

.form-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 14px; }
.col-1 { grid-column: span 1; } .col-2 { grid-column: span 2; }
.col-3 { grid-column: span 3; } .col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; } .col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }

/* --------------------------------------------------------------------------
   Layout: sidebar + topbar + main
   -------------------------------------------------------------------------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  top: 0; bottom: 0; left: 0;
  width: var(--sidebar-w);
  z-index: 40;
  background: #16283c;
  display: flex;
  flex-direction: column;
  transition: transform 0.22s ease;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar-brand img { width: 32px; height: 32px; }
.sidebar-brand span { color: #fff; font-weight: 600; font-size: 14.5px; line-height: 1.2; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  margin-bottom: 2px;
  border-radius: var(--radius-sm);
  color: #c7d2de;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-nav a .nav-icon { width: 18px; height: 18px; flex: 0 0 auto; opacity: 0.9; }
.sidebar-nav a:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.sidebar-nav a.active {
  background: var(--primary);
  color: #fff;
}
.sidebar-footer { padding: 12px 16px; border-top: 1px solid rgba(255, 255, 255, 0.08); font-size: 12px; color: #7b8ba0; }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 35;
}

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  z-index: 30;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
}
.hamburger {
  display: none;
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.hamburger svg { width: 20px; height: 20px; }

.topbar-title { font-weight: 600; font-size: 15px; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar-user { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.topbar-user b { font-size: 13.5px; font-weight: 600; }
.topbar-user span { font-size: 12px; color: var(--text-muted); }

.content { flex: 1; margin-left: var(--sidebar-w); padding: calc(var(--topbar-h) + 22px) 24px 40px; min-width: 0; }
.content > main { width: 100%; max-width: 1400px; margin: 0 auto; }

.page-header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.page-header h1 { margin: 0; font-size: 20px; }
.page-header .page-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.page-sub { color: var(--text-muted); font-size: 13px; margin-top: 2px; }

/* --------------------------------------------------------------------------
   Cards / panels
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
}
.card-header h3 { margin: 0; font-size: 14px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.card-body { padding: 18px; }
.card-body.flush { padding: 0; }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.stat-card .stat-value { font-size: 28px; font-weight: 700; line-height: 1.1; color: var(--text); }
.stat-card .stat-label { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.03em; }
.stat-card.stat-success { border-left-color: var(--success); }
.stat-card.stat-warning { border-left-color: var(--warning); }
.stat-card.stat-info { border-left-color: var(--info); }

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-strong);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  white-space: nowrap;
}
.table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr:hover { background: #fafbfc; }
.table .row-actions { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
.table .row-actions .btn-sm { white-space: nowrap; }

.empty {
  text-align: center;
  padding: 42px 18px;
  color: var(--text-muted);
}
.empty svg { width: 44px; height: 44px; opacity: 0.35; margin-bottom: 10px; }

.pagination { display: flex; align-items: center; gap: 10px; padding: 12px; justify-content: flex-end; border-top: 1px solid var(--border); }
.pagination-info { font-size: 12.5px; color: var(--text-muted); }

/* Lista de RDOs: tabela no desktop e cartões próprios no mobile */
.rdo-mobile-list { display: none; }
.rdo-filter-panel > summary { display: none; }
.rdo-mobile-card { overflow: hidden; border-bottom: 1px solid var(--border); background: var(--surface); }
.rdo-mobile-card:last-child { border-bottom: 0; }
.rdo-mobile-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 14px 14px 9px; }
.rdo-mobile-card-head > div { display: flex; flex-direction: column; gap: 2px; }
.rdo-mobile-card-head strong { color: var(--primary-dark); font-size: 14px; }
.rdo-mobile-card-head span { color: var(--text-muted); font-size: 11.5px; }
.rdo-mobile-project { display: flex; flex-direction: column; gap: 3px; margin: 0 10px; padding: 10px; border-radius: 9px; color: var(--text); text-decoration: none; background: var(--surface-2); }
.rdo-mobile-project:hover { color: var(--text); background: var(--primary-light); }
.rdo-mobile-project:focus-visible { outline: 3px solid rgba(11,105,179,.28); }
.rdo-mobile-project-code { color: var(--primary); font-size: 10.5px; font-weight: 800; letter-spacing: .04em; }
.rdo-mobile-project strong { font-size: 13.5px; line-height: 1.3; }
.rdo-mobile-project small { color: var(--text-muted); font-size: 11px; }
.rdo-mobile-actions { display: flex; flex-wrap: wrap; gap: 7px; padding: 10px 10px 13px; }
.rdo-mobile-actions .btn { justify-content: center; min-height: 38px; }
.rdo-mobile-open { flex: 1 0 100%; gap: 7px; }
.rdo-mobile-open svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* --------------------------------------------------------------------------
   Badges
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.badge-success { background: var(--success-bg); color: var(--success-dark); }
.badge-error   { background: var(--error-bg); color: var(--error-dark); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info    { background: var(--info-bg); color: var(--info); }
.badge-muted   { background: var(--dark-bg); color: var(--dark); }
.badge-dark    { background: var(--dark-bg); color: var(--dark); }

/* --------------------------------------------------------------------------
   Alerts / toasts
   -------------------------------------------------------------------------- */
.alert {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 13.5px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.alert-success { background: var(--success-bg); border: 1px solid #bbf7d0; color: var(--success-dark); }
.alert-error   { background: var(--error-bg); border: 1px solid #fecaca; color: var(--error-dark); }

.toast-stack {
  position: fixed;
  top: calc(var(--topbar-h) + 14px);
  right: 18px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
}
.toast {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  animation: toast-in 0.25s ease;
}
.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--error); }
.toast-info { border-left: 4px solid var(--info); }
.toast-content { flex: 1; }
.toast-close { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 15px; padding: 0 2px; line-height: 1; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, 0.55);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 5vh 16px;
  overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  animation: modal-in 0.2s ease;
}
.modal.modal-lg { max-width: 760px; }
.modal.modal-sm { max-width: 420px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { margin: 0; font-size: 16px; }
.modal-close { background: none; border: none; font-size: 22px; line-height: 1; color: var(--text-muted); cursor: pointer; }
.modal-body { padding: 20px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: translateY(0); } }

/* --------------------------------------------------------------------------
   Toolbar / filters
   -------------------------------------------------------------------------- */
.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.toolbar .field { margin-bottom: 0; min-width: 150px; }
.toolbar .field.field-query { flex: 1; min-width: 200px; }

/* --------------------------------------------------------------------------
   Editor (RDO)
   -------------------------------------------------------------------------- */
.editor-section { margin-bottom: 20px; }
.editor-toolbar {
  position: sticky;
  top: calc(var(--topbar-h) + 8px);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px;
  margin-bottom: 16px;
  background: rgba(245, 247, 250, 0.96);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(6px);
}
.editor-toolbar #duplicate-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rdo-editor-shell { width: 100%; }
.rdo-editor-shell { max-width: 1180px; margin: 0 auto; padding-right: 74px; }
.editor-utilities {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  justify-content: space-between; margin: 0 0 14px; padding: 11px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface);
}
.editor-page-header { align-items: center; margin-bottom: 14px; padding: 18px 20px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: linear-gradient(135deg,#fff 35%,var(--primary-light)); box-shadow: var(--shadow-sm); }
.editor-heading { display: flex; align-items: center; gap: 14px; min-width: 0; }
.editor-heading-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 48px; width: 48px; height: 48px; border-radius: 15px; background: var(--primary); color: #fff; font-size: 22px; box-shadow: 0 8px 18px rgba(25,118,210,.22); }
.editor-heading-kicker { margin-bottom: 2px; color: var(--primary-dark); font-size: 10.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.editor-page-header h1 { margin: 0 0 5px; }
.editor-page-header .page-sub { display: flex; gap: 8px 14px; flex-wrap: wrap; }
.editor-page-header .page-actions { align-items: center; }
.editor-status-pill { display: inline-flex; align-items: center; min-height: 30px; padding: 5px 10px; border: 1px solid #bfdbfe; border-radius: 999px; background: #eff6ff; color: #1d4ed8; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; }
.editor-status-pill.status-finalizado { border-color: #bbf7d0; background: #f0fdf4; color: #15803d; }
.editor-preview-btn { min-height: 38px; }
.editor-utilities-copy { display: flex; flex-direction: column; gap: 2px; }
.editor-utilities-copy b { font-size: 12.5px; }
.editor-utilities-copy span { color: var(--text-muted); font-size: 11.5px; }
.editor-utilities-actions { display: flex; align-items: center; gap: 9px; }
.duplicate-menu { position: relative; }
.duplicate-menu > summary { list-style: none; cursor: pointer; }
.duplicate-menu > summary::-webkit-details-marker { display: none; }
.duplicate-popover { position: absolute; z-index: 50; top: calc(100% + 9px); right: 0; width: min(330px,calc(100vw - 34px)); padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-lg); }
.duplicate-popover > b { display: block; font-size: 14px; }
.duplicate-popover > p { margin: 4px 0 12px; color: var(--text-muted); font-size: 11.5px; }
.duplicate-option { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 9px; cursor: pointer; }
.duplicate-option:hover { border-color: var(--primary); background: var(--primary-light); }
.duplicate-option input { flex: 0 0 auto; }
.duplicate-option span { display: flex; flex-direction: column; gap: 1px; }
.duplicate-option b { font-size: 12.5px; }
.duplicate-option small { color: var(--text-muted); font-size: 10.5px; }
.duplicate-popover > .btn { width: 100%; justify-content: center; margin-top: 6px; }
.editor-action-dock {
  position: fixed; right: 18px; top: 50%; z-index: 45;
  display: flex; flex-direction: column; gap: 12px;
  transform: translateY(-50%);
}
.action-orb {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; padding: 0; border: 0; border-radius: 50%;
  color: #fff; background: #334155; box-shadow: 0 8px 20px rgba(15,23,42,.2);
  text-decoration: none; cursor: pointer; font-size: 22px; font-weight: 800;
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.action-orb:hover, .action-orb:focus-visible { color: #fff; transform: scale(1.08); box-shadow: 0 11px 26px rgba(15,23,42,.28); outline: 3px solid rgba(25,118,210,.2); }
.action-orb svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.action-orb:disabled { opacity: .55; cursor: wait; }
.action-orb.is-disabled { opacity: .42; pointer-events: none; }
.action-orb::after {
  content: attr(data-label); position: absolute; right: 62px; top: 50%;
  transform: translateY(-50%) translateX(5px); padding: 6px 9px;
  border-radius: 7px; background: #0f172a; color: #fff; font-size: 12px;
  font-weight: 700; white-space: nowrap; opacity: 0; pointer-events: none; transition: .16s ease;
}
.action-orb:hover::after, .action-orb:focus-visible::after { opacity: 1; transform: translateY(-50%) translateX(0); }
.action-save { background: var(--primary); }
.action-finalize { background: var(--success); }
.action-view { background: #7c3aed; }
.action-powerpoint { background: #d24726; }
.action-back { background: #475569; }
.action-reopen { background: #d97706; }

.rdo-stepper {
  position: relative; margin-bottom: 18px; padding: 16px 18px 13px;
  overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.stepper-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: #e2e8f0; }
.stepper-progress span { display: block; width: 14.285%; height: 100%; background: linear-gradient(90deg,var(--primary),#60a5fa); transition: width .25s ease; }
.stepper-items { display: grid; grid-template-columns: repeat(7,minmax(72px,1fr)); gap: 6px; }
.stepper-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 5px; border: 0; background: transparent; color: var(--text-muted); cursor: pointer; }
.stepper-item span { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: #e2e8f0; color: #475569; font-weight: 800; }
.stepper-item b { font-size: 11px; line-height: 1.2; text-align: center; }
.stepper-item.is-active { color: var(--primary-dark); }
.stepper-item.is-active span { color: #fff; background: var(--primary); box-shadow: 0 0 0 5px var(--primary-light); }
.stepper-item.is-complete span { color: #fff; background: var(--success); }
.rdo-editor-shell.steps-ready .editor-section { display: none; }
.rdo-editor-shell.steps-ready .editor-section.is-active { display: block; animation: step-in .2s ease; }
@keyframes step-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.editor-section .card { border-radius: var(--radius-lg); box-shadow: 0 6px 20px rgba(15,23,42,.06); }
.editor-section .card-header { background: linear-gradient(135deg,#fff,var(--surface-2)); }
.editor-section .card-body { padding: 22px; }
.editor-section input, .editor-section select, .editor-section textarea { min-height: 42px; border-radius: 9px; }
.editor-section textarea { min-height: 92px; }
.step-navigation { display: grid; grid-template-columns: minmax(130px,160px) 1fr minmax(170px,220px); align-items: center; gap: 12px; margin: 4px 0 36px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.step-navigation .btn { justify-content: center; min-height: 44px; }
.step-navigation .step-next { white-space: nowrap; }
.step-navigation-status { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.step-navigation-status b { font-size: 14px; }
.step-navigation-status span { color: var(--text-muted); font-size: 12px; }
.editor-section > .card-header { background: var(--surface-2); }
.editor-section .section-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.repeatable-row {
  display: grid;
  grid-template-columns: 90px 1fr 38px;
  gap: 8px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  margin-bottom: 8px;
}
.repeatable-row.equipment-row { grid-template-columns: 70px 1fr 150px 90px 1fr 38px; }
.repeatable-row.activity-row { grid-template-columns: 1fr 1.4fr 1fr 150px 1fr 38px; }
.repeatable-row .field { margin: 0; }
.repeatable-row .field label { display: block; margin-bottom: 5px; }
.repeatable-row input,
.repeatable-row select { width: 100%; }

.row-remove {
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--error);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
}
.row-remove:hover { background: var(--error-bg); border-color: var(--error); }
.add-row-btn { margin-top: 6px; }
.catalog-actions, .field-inline { display: flex; align-items: center; gap: 8px; }
.field-inline { margin-bottom: 8px; }
.field-inline select { flex: 1; min-width: 0; }
.btn-icon { width: 34px; min-width: 34px; padding-left: 0; padding-right: 0; font-size: 18px; font-weight: 700; }
.catalog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.catalog-card .card-header { align-items: flex-start; }
.catalog-card .card-header p { margin: 4px 0 0; }
.catalog-list { list-style: none; padding: 0; margin: 0; }
.catalog-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.catalog-list li:last-child { border-bottom: 0; }

/* Management pages: catalogs, projects, companies and users */
.management-page { width: min(100%, 1380px); margin: 0 auto; }
.management-hero { align-items: center; margin-bottom: 16px; padding: 2px 2px 0; }
.management-hero h1 { font-size: clamp(21px, 2vw, 28px); letter-spacing: -.025em; }
.management-eyebrow { display: block; margin-bottom: 4px; color: var(--primary-dark); font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.management-list-card { overflow: hidden; border-color: #d6dde7; box-shadow: 0 8px 24px rgba(15, 23, 42, .055); }
.management-toolbar { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, #fff, #fafcff); }
#catalogs-page > .management-toolbar { margin-bottom: 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.management-search { display: flex; align-items: center; flex: 1; min-width: 180px; max-width: 680px; gap: 9px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 9px; background: #fff; color: var(--text-muted); }
.management-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(25, 118, 210, .12); }
.management-search > span { font-size: 22px; transform: rotate(-18deg); }
.management-search input { width: 100%; min-height: 42px; padding: 8px 0; border: 0; outline: 0; background: transparent; font: inherit; color: var(--text); }
.management-count { margin-left: auto; padding: 5px 9px; border-radius: 999px; background: var(--primary-light); color: var(--primary-dark); font-size: 12px; font-weight: 700; white-space: nowrap; }
.management-list-card .table th { padding: 12px 16px; background: #f6f8fb; }
.management-list-card .table td { padding: 14px 16px; }
.management-list-card .table tbody tr { transition: background .15s ease, box-shadow .15s ease; }
.management-list-card .table tbody tr:hover { background: #f8fbff; }
.management-list-card .table tbody tr[hidden] { display: none !important; }
.catalog-card { overflow: hidden; border-color: #d6dde7; box-shadow: 0 7px 20px rgba(15, 23, 42, .05); }
.catalog-card .card-header { min-height: 76px; background: linear-gradient(135deg, #fff, #f7fbff); }
.catalog-card .card-body { max-height: 360px; overflow-y: auto; }
.catalog-list li > span:first-child { min-width: 0; overflow-wrap: anywhere; font-weight: 500; }

@media (max-width: 768px) {
  .management-page { width: 100%; }
  .management-hero { align-items: stretch; margin-bottom: 12px; }
  .management-hero .page-actions { width: auto; margin-left: auto; }
  .management-hero .page-actions .btn { min-height: 42px; }
  .management-toolbar { padding: 10px; flex-wrap: wrap; gap: 8px; }
  .management-search { flex-basis: 100%; max-width: none; }
  .management-count { margin-left: 0; }
  .management-list-card { border-radius: 12px; overflow: visible; background: transparent; box-shadow: none; border: 0; }
  .management-list-card .table-wrap { overflow: visible; }
  .management-list-card .table,
  .management-list-card .table tbody,
  .management-list-card .table tr,
  .management-list-card .table td { display: block; width: 100%; }
  .management-list-card .table thead { display: none; }
  .management-list-card .table tbody { display: grid; gap: 10px; padding: 10px 0 0; }
  .management-list-card .table tbody tr { padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); }
  .management-list-card .table td { display: grid; grid-template-columns: minmax(86px, 34%) minmax(0, 1fr); align-items: start; gap: 10px; padding: 7px 0; border-bottom: 1px dashed #e1e6ed; overflow-wrap: anywhere; }
  .management-list-card .table td::before { content: attr(data-label); color: var(--text-muted); font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
  .management-list-card .table td:last-child { display: block; padding: 12px 0 0; border-bottom: 0; }
  .management-list-card .table td:last-child::before { display: none; }
  .management-list-card .row-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 8px; }
  .management-list-card .row-actions .btn { min-height: 40px; }
  .catalog-grid { grid-template-columns: 1fr; gap: 12px; }
  .catalog-card .card-header { min-height: auto; gap: 10px; }
  .catalog-card .card-header .btn { min-height: 38px; }
}

@media (max-width: 480px) {
  .management-hero { display: grid; grid-template-columns: 1fr; }
  .management-hero .page-actions { width: 100%; margin: 2px 0 0; }
  .management-hero .page-actions .btn { width: 100%; }
  .management-list-card .table td { grid-template-columns: 82px minmax(0, 1fr); }
  .catalog-card .card-header { flex-direction: column; align-items: stretch; }
  .catalog-card .card-header .btn { width: 100%; }
  .catalog-list li { align-items: flex-start; }
}

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 26px 18px;
  text-align: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  margin-bottom: 16px;
}
.upload-zone strong { color: var(--text); }
.upload-zone svg { width: 34px; height: 34px; opacity: 0.4; margin-bottom: 6px; }
.upload-zone.dragover { border-color: var(--primary); background: var(--primary-light); }
.upload-zone.is-uploading { pointer-events: none; border-color: var(--primary); background: var(--primary-light); opacity: .72; }
.upload-zone.is-uploading::after { content: 'Enviando fotografias…'; display: block; margin-top: 8px; color: var(--primary-dark); font-size: 12px; font-weight: 800; }
.photo-url-import { margin: -2px 0 18px; }
.photo-url-row { display: flex; gap: 8px; }
.photo-url-row input { flex: 1; min-width: 0; }

@media (max-width: 560px) {
  .photo-url-row { flex-direction: column; }
  .photo-url-row .btn { width: 100%; }
}

/* Photo grid */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.photo-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.photo-card.is-cover { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.35); }
.photo-card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #e5e7eb; cursor: grab; }
.photo-card img:active { cursor: grabbing; }
.photo-card .photo-caption { padding: 7px 8px; }
.photo-card .photo-caption input {
  width: 100%;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 12.5px;
  padding: 4px 6px;
  color: var(--text);
  background: transparent;
}
.photo-card .photo-caption input:hover { border-color: var(--border); }
.photo-card .photo-caption input:focus { border-color: var(--primary); background: var(--surface); outline: none; }
.photo-card .photo-tools {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
}
.photo-card .photo-tools button,
.photo-card .photo-tools a {
  width: 26px; height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 0;
  background: rgba(15, 23, 42, 0.65);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
}
.photo-card .photo-tools button:hover,
.photo-card .photo-tools a:hover { background: rgba(15, 23, 42, 0.9); }
.photo-card .photo-tools .photo-cover-active { background: var(--primary); }
.photo-cover-mark {
  position: absolute;
  left: 6px; bottom: 6px;
  background: var(--primary);
  color: #fff;
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* --------------------------------------------------------------------------
   Auth (páginas públicas)
   -------------------------------------------------------------------------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px 16px;
  background: linear-gradient(160deg, #16283c 0%, #1d3a53 42%, var(--bg) 100%);
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 30px 28px;
}
.auth-brand { text-align: center; margin-bottom: 20px; }
.auth-brand img { width: 46px; height: 46px; }
.auth-brand h1 { font-size: 19px; margin: 10px 0 2px; }
.auth-brand p { color: var(--text-muted); font-size: 13px; margin: 0; }
.auth-footer { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-muted); }
.auth-alert-error {
  background: var(--error-bg);
  border: 1px solid #fecaca;
  color: var(--error-dark);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 14px;
}
.auth-success {
  background: var(--success-bg);
  border: 1px solid #bbf7d0;
  color: var(--success-dark);
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 14px;
}

/* --------------------------------------------------------------------------
   Detalhe / preview RDO
   -------------------------------------------------------------------------- */
.rdo-header-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 18px;
}
.rdo-view-page { max-width: 1180px; margin: 0 auto; }
.rdo-view-header { padding: 18px 20px; background: linear-gradient(135deg, #fff, var(--primary-light)); border: 1px solid var(--border); border-radius: var(--radius); }
.rdo-view-page > .card { overflow: hidden; }
.rdo-view-page .card-header { background: var(--surface-2); }
.rdo-detail { display: flex; flex-direction: column; padding: 10px 12px; border-left: 3px solid var(--primary-soft); background: var(--surface-2); border-radius: var(--radius-sm); }
.rdo-detail dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); font-weight: 600; }
.rdo-detail dd { margin: 4px 0 0; font-size: 13.5px; text-align: left; word-break: break-word; font-weight: 600; }

.obs-text { white-space: pre-wrap; font-size: 13.5px; }

.export-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.export-actions .btn { min-width: 170px; }
.export-models { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-bottom:14px; }
.export-model-card { display:flex; flex-direction:column; gap:7px; padding:15px; border:1px solid var(--border); border-radius:var(--radius); background:var(--surface); }
.export-model-card strong { font-size:15px; }
.export-model-card span { min-height:36px; color:var(--text-muted); font-size:12.5px; }
.export-model-card .btn { align-self:flex-start; }
.export-model-premium { border-color:var(--primary); background:var(--primary-light); }
.export-format-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 14px; }
.export-format-card { display: grid; grid-template-columns: 54px 1fr auto; align-items: center; gap: 14px; min-height: 112px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.export-format-card h2 { margin: 0 0 4px; font-size: 17px; }
.export-format-card p { margin: 0; color: var(--text-muted); font-size: 12.5px; }
.export-format-icon { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 14px; background: var(--primary-light); color: var(--primary-dark); font-size: 14px; font-weight: 900; }
.export-format-link { color: inherit; text-decoration: none; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.export-format-link:hover { color: inherit; transform: translateY(-2px); border-color: var(--primary); box-shadow: var(--shadow); }
.export-format-link > span { color: var(--primary); font-size: 24px; }
.export-format-pdf { grid-template-columns: 54px 1fr; }
.export-format-options { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.export-format-options .btn { justify-content: center; }
.form-section-title { margin:8px 0 0; padding-bottom:8px; border-bottom:1px solid var(--border); color:var(--primary-dark); }
.company-asset-status { display:block; min-height:30px; margin-bottom:7px; padding:7px 9px; border-radius:6px; font-size:11.5px; overflow-wrap:anywhere; }
.company-asset-status.is-saved { background:#e8f5e9; color:#23743a; border:1px solid #b9dfc2; }
.company-asset-status.is-empty { background:var(--bg); color:var(--text-muted); border:1px solid var(--border); }

/* Lista de recentes (dashboard) */
.recent-list { list-style: none; margin: 0; padding: 0; }
.recent-list li { border-bottom: 1px solid var(--border); }
.recent-list li:last-child { border-bottom: 0; }
.recent-report-link { position: relative; display: block; padding: 14px 48px 14px 16px; color: var(--text); text-decoration: none; transition: background .16s ease, box-shadow .16s ease; }
.recent-report-link:hover { color: var(--text); background: #f7fbff; }
.recent-report-link:focus-visible { z-index: 1; outline: 3px solid rgba(11,105,179,.28); outline-offset: -3px; }
.recent-report-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
.recent-report-top strong { color: var(--primary-dark); font-size: 12px; letter-spacing: .035em; }
.recent-list .recent-title { display: flex; align-items: baseline; gap: 7px; min-width: 0; font-weight: 700; font-size: 14px; line-height: 1.32; }
.recent-project-code { flex: 0 0 auto; color: var(--primary); font-size: 11px; font-weight: 800; }
.recent-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 7px; color: var(--text-muted); font-size: 11.5px; }
.recent-meta span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.recent-meta svg { flex: 0 0 auto; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.recent-open { position: absolute; top: 50%; right: 15px; display: inline-flex; align-items: center; gap: 4px; color: var(--primary); font-size: 12px; font-weight: 700; transform: translateY(-50%); }
.recent-open svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.summary-strip { display: flex; gap: 18px; flex-wrap: wrap; background: var(--primary-light); border: 1px solid var(--primary-soft); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 18px; }
.summary-strip .ss-item { font-size: 13px; }
.summary-strip .ss-item b { display: block; color: var(--text); }

/* Seletores legíveis de empresas e obras no cadastro de usuários */
.field-help { margin: 3px 0 9px; color: var(--text-muted); font-size: 12px; }
.access-guidance { margin: 2px 0 0; }
.access-search { margin-bottom: 8px; }
.access-selector {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  max-height: 190px;
  padding: 9px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.access-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--surface);
  cursor: pointer;
}
.access-option:hover { border-color: var(--primary); }
.access-option input { flex: 0 0 auto; margin-top: 2px; }
.access-option span { min-width: 0; overflow-wrap: anywhere; }
.access-option-legacy { color: var(--text-muted); }
.access-empty { margin-top: 7px; font-size: 12px; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-overlay { display: block; }
  .hamburger { display: inline-flex; }
  .content { margin-left: 0; padding: calc(var(--topbar-h) + 16px) 16px 36px; }
  .repeatable-row.equipment-row,
  .repeatable-row.activity-row { grid-template-columns: repeat(2, minmax(0, 1fr)) 38px; }
  .repeatable-row.equipment-row .eq-note { grid-column: 1 / -1; }
  .rdo-editor-shell { padding-right: 0; }
  .export-format-grid { grid-template-columns: 1fr 1fr; }
  .export-format-pdf { grid-column: 1 / -1; }
}
@media (max-width: 768px) {
  .catalog-grid { grid-template-columns: 1fr; }
  .field-inline { align-items: stretch; flex-direction: column; }
  h1 { font-size: 19px; }
  .page-header .page-actions { margin-left: 0; justify-content: flex-start; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .topbar-user span { display: none; }
  .form-grid { grid-template-columns: 1fr 1fr; gap: 0 10px; }
  .form-grid > [class*="col-"] { grid-column: span 1; }
  .form-grid > .col-8, .form-grid > .col-12 { grid-column: 1 / -1; }
  .repeatable-row, .repeatable-row.equipment-row, .repeatable-row.activity-row { grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px; }
  .repeatable-row .field { grid-column: auto; }
  .repeatable-row .row-remove { grid-column: 2; grid-row: 1; justify-self: end; }
  .repeatable-row .field:nth-child(2) { grid-column: 1 / -1; }
  .repeatable-row.equipment-row .eq-note, .repeatable-row.activity-row .field { grid-column: 1 / -1; }
  .editor-action-dock { left: 50%; right: auto; top: auto; bottom: 12px; flex-direction: row; transform: translateX(-50%); padding: 7px; border: 1px solid rgba(255,255,255,.7); border-radius: 999px; background: rgba(255,255,255,.92); box-shadow: 0 12px 34px rgba(15,23,42,.22); backdrop-filter: blur(10px); }
  .action-orb { width: 46px; height: 46px; font-size: 19px; }
  .action-orb::after { display: none; }
  .stepper-items { display: flex; overflow-x: auto; justify-content: flex-start; padding-bottom: 4px; scrollbar-width: thin; }
  .stepper-item { flex: 0 0 82px; }
  .step-navigation { margin-bottom: 86px; }
  .editor-page-header { align-items: flex-start; padding: 15px; }
  .editor-page-header .page-actions { width: auto; margin-left: auto; }
  .editor-utilities-copy { display: none; }
  .editor-utilities { justify-content: flex-end; }
  .modal { max-width: 100%; }
  .rdo-header-grid { grid-template-columns: 1fr 1fr; }
  .rdo-detail dd { text-align: left; }
  .rdo-view-page .table-wrap { overflow: visible; padding: 10px; }
  .rdo-view-page .table, .rdo-view-page .table tbody, .rdo-view-page .table tr, .rdo-view-page .table td { display: block; width: 100%; }
  .rdo-view-page .table thead { display: none; }
  .rdo-view-page .table tr { margin-bottom: 10px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
  .rdo-view-page .table td { display: grid; grid-template-columns: minmax(90px, 38%) 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--border); }
  .rdo-view-page .table td:last-child { border-bottom: 0; }
  .rdo-view-page .table td::before { content: attr(data-label); color: var(--text-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
  #rdo-list-page { min-width: 0; }
  #rdo-list-page > .card { overflow: hidden; }
  #rdo-list-page .rdo-desktop-list { display: none; }
  #rdo-list-page .rdo-mobile-list { display: block; }
  #rdo-list-page .rdo-filter-panel > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; cursor: pointer; border-bottom: 1px solid var(--border); color: var(--primary-dark); font-size: 13px; font-weight: 750; list-style: none; }
  #rdo-list-page .rdo-filter-panel > summary::-webkit-details-marker { display: none; }
  #rdo-list-page .rdo-filter-panel > summary::after { content: '⌄'; flex: 0 0 auto; font-size: 18px; transition: transform .16s ease; }
  #rdo-list-page .rdo-filter-panel[open] > summary::after { transform: rotate(180deg); }
  #rdo-list-page .rdo-filter-panel > summary small { margin-left: auto; color: var(--text-muted); font-size: 10px; font-weight: 500; }
  #rdo-list-page .rdo-filter-body { padding: 12px; }
  #rdo-list-page .pagination { justify-content: center; flex-wrap: wrap; }
  #rdo-list-page .pagination-info { flex: 1 0 100%; text-align: center; }
}
@media (min-width: 769px) {
  #rdo-list-page .rdo-filter-panel:not([open]) > .rdo-filter-body { display: block; }
}
@media (max-width: 480px) {
  .stat-cards { grid-template-columns: 1fr; }
  #dashboard-page .page-header { gap: 10px; margin-bottom: 12px; }
  #dashboard-page .page-header h1 { margin-bottom: 2px; }
  #dashboard-page .page-sub { font-size: 12px; }
  #dashboard-page .page-actions { gap: 8px; }
  #dashboard-page .page-actions .btn { min-height: 38px; padding: 8px 10px; font-size: 12px; }
  #dashboard-page .stat-cards {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
  }
  #dashboard-page .stat-card {
    grid-column: span 2;
    min-width: 0;
    min-height: 70px;
    padding: 10px 10px 9px;
    border-left-width: 3px;
    border-radius: 9px;
  }
  #dashboard-page .stat-card:nth-child(n+4) { grid-column: span 3; }
  #dashboard-page .stat-card .stat-value { font-size: 22px; line-height: 1; }
  #dashboard-page .stat-card .stat-label {
    margin-top: 6px;
    font-size: 9px;
    line-height: 1.2;
    letter-spacing: .015em;
    overflow-wrap: anywhere;
  }
  #dashboard-page > .card { border-radius: 12px; }
  #dashboard-page > .card .card-header { padding: 11px 13px; }
  #dashboard-page .recent-report-link { min-height: 132px; padding: 13px 14px 48px; }
  #dashboard-page .recent-report-top { align-items: flex-start; }
  #dashboard-page .recent-report-top .badge { max-width: 54%; white-space: normal; text-align: center; line-height: 1.15; }
  #dashboard-page .recent-list .recent-title { display: block; font-size: 13.5px; }
  #dashboard-page .recent-project-code { display: block; margin-bottom: 2px; }
  #dashboard-page .recent-meta { display: grid; grid-template-columns: 1fr; gap: 4px; margin-top: 7px; }
  #dashboard-page .recent-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #dashboard-page .recent-open { left: 14px; right: 14px; top: auto; bottom: 10px; justify-content: center; min-height: 32px; border-radius: 8px; background: #eaf4fc; transform: none; }
  .content { padding-left: 12px; padding-right: 12px; }
  .toolbar .field { min-width: 100%; }
  #rdo-list-page .page-header { gap: 10px; margin-bottom: 12px; }
  #rdo-list-page .page-header .page-actions { margin-top: 0; }
  #rdo-list-page .toolbar { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
  #rdo-list-page .toolbar .field { min-width: 0; grid-column: 1 / -1; }
  #rdo-list-page .toolbar .field:nth-child(3) { grid-column: 1; }
  #rdo-list-page .toolbar .field:nth-child(4) { grid-column: 2; }
  #rdo-list-page .toolbar label { margin-bottom: 4px; font-size: 11px; }
  #rdo-list-page .toolbar input,#rdo-list-page .toolbar select { min-width: 0; }
  #rdo-list-page .rdo-filter-panel > summary small { display: none; }
  #rdo-list-page .rdo-mobile-card-head .badge { max-width: 48%; white-space: normal; text-align: center; line-height: 1.15; }
  #rdo-list-page .rdo-mobile-actions .btn:not(.rdo-mobile-open) { flex: 1; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid > [class*="col-"] { grid-column: 1 / -1; }
  .card-header { padding: 12px; align-items: flex-start; }
  .card-body { padding: 12px; }
  .catalog-actions { flex-wrap: wrap; justify-content: flex-end; }
  .page-header .page-actions { width: 100%; }
  .page-header .page-actions .btn { flex: 1; text-align: center; }
  .rdo-header-grid { grid-template-columns: 1fr; }
  .access-selector { grid-template-columns: 1fr; }
  .export-models { grid-template-columns:1fr; }
  .export-format-grid { grid-template-columns: 1fr; }
  .export-format-pdf { grid-column: auto; }
  .step-navigation { grid-template-columns: 1fr 1fr; }
  .step-navigation-status { grid-column: 1 / -1; grid-row: 1; }
  .step-back { grid-column: 1; }
  .step-next { grid-column: 2; }
  .editor-section .card-body { padding: 15px; }
  .editor-utilities { padding: 9px; }
  .editor-heading-icon { width: 42px; height: 42px; flex-basis: 42px; border-radius: 13px; }
  .editor-page-header .page-actions { width: 100%; margin-top: 10px; }
  .editor-page-header .page-actions > * { flex: 1; justify-content: center; }
  .editor-utilities-actions { width: 100%; justify-content: stretch; }
  .editor-utilities-actions > * { flex: 1; }
  .editor-utilities-actions .btn { width: 100%; justify-content: center; }
  .duplicate-popover { position: fixed; left: 12px; right: 12px; top: auto; bottom: 80px; width: auto; }
}
/* PWA e login persistente */
.checkbox-line label small{display:block;margin-top:3px;color:var(--muted,#64748b);font-weight:400;line-height:1.35}
.btn-install{display:flex;align-items:center;justify-content:center;gap:8px;margin-top:12px;background:#eef6fc;border-color:#b9d7ee;color:#0b4f87}
.btn-install[hidden],.topbar-install[hidden],.pwa-help[hidden]{display:none!important}
.btn-install svg,.topbar-install svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.pwa-help{margin:9px 0 0;color:var(--muted,#64748b);font-size:.82rem;text-align:center}
.topbar-install{display:inline-flex;align-items:center;gap:6px}
@media (max-width:640px){.topbar-install span{display:none}.topbar-install{width:38px;height:38px;justify-content:center;padding:0}}
