/* Layout simples — fundo branco, tipografia sistema, poucos acentos */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-subtle: #f3f4f6;
  --text: #1a1a1a;
  --muted: #5c5c5c;
  --border: #e5e7eb;
  --gray-ink: #171717;
  --gray-deep: #374151;
  --gray-mid: #4b5563;
  --gray-soft: #f3f4f6;
  --gray-border: #e5e7eb;
  --accent: #1f2937;
  --accent-contrast: #ffffff;
  --success-bg: #ecfdf3;
  --success-border: #16a34a;
  --error-bg: #fef2f2;
  --error-border: #dc2626;
  --warn: #b45309;
  --ok: #15803d;
  --info-bg: #eff6ff;
  --info-border: #3b82f6;
  --warn-bg: #fffbeb;
  --warn-border: #f59e0b;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 48px rgba(15, 23, 42, 0.12);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

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

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

a {
  color: var(--gray-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--accent);
  opacity: 1;
}

/* Ícones inline (stroke = currentColor) */
.icon {
  display: inline-block;
  flex-shrink: 0;
  vertical-align: middle;
  color: var(--gray-deep);
}

a .icon,
.sidebar-nav a .icon {
  color: inherit;
}

.sidebar-nav a:hover .icon {
  color: var(--gray-deep);
}

.btn .icon {
  width: 1.125rem;
  height: 1.125rem;
}

.btn-primary .icon {
  color: var(--accent-contrast);
}

.icon--lg {
  width: 22px;
  height: 22px;
}

/* Chave de licença + copiar (área cliente) */
.license-key-row {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  max-width: 100%;
}

.license-key-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.license-key-copy {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}

.copy-feedback {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--gray-deep);
  line-height: 1.2;
  white-space: nowrap;
}

.copy-feedback[hidden] {
  display: none !important;
}

.btn-icon-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem;
  margin: 0;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  line-height: 0;
  flex-shrink: 0;
}

.btn-icon-copy:hover {
  background: var(--gray-soft);
  color: var(--gray-deep);
}

.btn-icon-copy:focus-visible {
  outline: 2px solid var(--gray-mid);
  outline-offset: 1px;
}

.btn-icon-copy .icon,
.btn-icon-copy svg {
  width: 1rem;
  height: 1rem;
}

/* ——— Barra superior (site público) ——— */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.875rem 1.5rem;
  background: linear-gradient(180deg, #ffffff 0%, var(--gray-soft) 100%);
  border-bottom: 1px solid var(--gray-border);
  box-shadow: var(--shadow-sm);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
}

.brand .icon {
  color: var(--gray-mid);
}

.brand:hover {
  opacity: 1;
  text-decoration: none;
  color: var(--gray-deep);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 0.35rem 1rem;
  flex-wrap: wrap;
}

.topnav a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9375rem;
  color: var(--gray-deep);
  text-decoration: none;
}

.topnav a:hover {
  text-decoration: underline;
  color: var(--accent);
}

.main-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
}

.page-shell {
  min-height: 100vh;
}

/* ——— Hero / início ——— */
.hero {
  background: var(--bg);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow-md);
}

.hero h1 {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.lead {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  max-width: 36em;
}

.lead-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

.lead-row .icon {
  margin-top: 0.15rem;
  color: var(--gray-mid);
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

/* ——— Botões ——— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9375rem;
  font-family: inherit;
  text-decoration: none;
  line-height: 1.25;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.btn:hover {
  opacity: 1;
  text-decoration: none;
  box-shadow: var(--shadow-xs);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--gray-ink);
  color: var(--accent-contrast);
  border-color: var(--gray-ink);
}

.btn-primary:hover {
  background: var(--gray-deep);
  border-color: var(--gray-deep);
}

.btn-secondary {
  background: var(--bg);
  color: var(--gray-deep);
  border-color: var(--gray-border);
}

/* Página download — instalador */
.download-lead {
  font-size: 0.9375rem;
  color: var(--gray-deep);
  margin: 0 0 1rem;
  line-height: 1.5;
}

.download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0;
}

.btn-secondary:hover {
  background: var(--gray-soft);
  border-color: var(--gray-mid);
  color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.8125rem;
}

/* ——— Atalho início (canto superior esquerdo, layouts site + app) ——— */
.site-corner-home {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 200;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  color: var(--gray-deep);
  background: var(--bg);
  border: 1px solid var(--gray-border);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.site-corner-home:hover {
  color: var(--accent);
  border-color: var(--gray-mid);
  box-shadow: var(--shadow-md);
}

.site-corner-home:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.site-corner-home .icon {
  width: 1.35rem;
  height: 1.35rem;
}

/* ——— Centrado (login, download, estados) ——— */
.site-center {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1.25rem;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(55, 65, 81, 0.08), transparent),
    linear-gradient(165deg, #f3f4f6 0%, #ffffff 45%, #f9fafb 100%);
}

.site-shell {
  width: 100%;
  max-width: 440px;
}

.site-panel {
  width: 100%;
}

.login-card {
  position: relative;
  padding-top: 2.75rem;
}

.login-card__installer {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  z-index: 1;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  text-align: center;
  margin-bottom: 1.25rem;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--gray-deep);
  text-decoration: none;
}

.site-brand .icon {
  color: var(--gray-mid);
}

.site-brand:hover {
  text-decoration: underline;
  color: var(--accent);
}

/* ——— Cartões ——— */
.card {
  background: var(--bg);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.65rem;
  border-top: 4px solid var(--gray-mid);
  box-shadow: var(--shadow-md);
}

.card-narrow {
  max-width: 400px;
  margin: 0 auto;
}

.card h1 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--text);
}

.card h1 .icon {
  color: var(--gray-mid);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.stack label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.875rem;
  color: var(--text);
}

/* Checkboxes em linha dentro de .stack (outros formulários) */
.stack label.inline {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  width: fit-content;
}

.stack label.inline input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
  accent-color: var(--gray-ink);
  cursor: pointer;
}

/* ——— Formulários ——— */
.form-stack {
  gap: 1.25rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-deep);
  letter-spacing: 0.01em;
}

.form-label-hint {
  font-weight: 400;
}

.input-block {
  width: 100%;
  min-width: 0;
}

/* Campo senha + botão olho (login, alterar senha, etc.) */
.password-field {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}

.password-field .input {
  padding-right: 2.75rem;
  width: 100%;
}

.btn-password-toggle {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--gray-mid);
  cursor: pointer;
  line-height: 0;
}

.btn-password-toggle:hover {
  color: var(--gray-deep);
  background: rgba(15, 23, 42, 0.06);
}

.btn-password-toggle:focus-visible {
  outline: 2px solid var(--info-border);
  outline-offset: 2px;
}

.btn-password-toggle .icon {
  width: 1.25rem;
  height: 1.25rem;
}

.input {
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #fafafa;
  color: var(--text);
  font-size: 0.9375rem;
  font-family: inherit;
  line-height: 1.45;
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.05);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.input:hover {
  border-color: #b8c0cc;
  background: #fff;
}

.input:focus {
  outline: none;
  border-color: var(--gray-deep);
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04), 0 0 0 3px rgba(55, 65, 81, 0.12);
}

.input::placeholder {
  color: #9ca3af;
}

textarea.input {
  min-height: 5.5rem;
  resize: vertical;
}

.select-wrap {
  position: relative;
}

.select-wrap::after {
  content: "";
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-35%) rotate(45deg);
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--gray-mid);
  border-bottom: 2px solid var(--gray-mid);
  pointer-events: none;
}

.input-select {
  appearance: none;
  padding-right: 2.25rem;
  cursor: pointer;
  background-color: #fafafa;
}

.input-select:focus {
  background-color: #fff;
}

select.input {
  cursor: pointer;
}

/* Upload de ficheiro */
.file-field__label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  padding: 0.75rem 1rem;
  border: 1px dashed #c4cdd8;
  border-radius: 10px;
  background: linear-gradient(180deg, #fafbfc 0%, #f4f5f7 100%);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.file-field__label:hover {
  border-color: var(--gray-mid);
  background: #fff;
  box-shadow: var(--shadow-xs);
}

.file-field__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.file-field {
  position: relative;
}

.file-field__input:focus + .file-field__btn,
.file-field__label:focus-within .file-field__btn {
  outline: 2px solid var(--gray-deep);
  outline-offset: 2px;
}

.file-field__btn {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.95rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--gray-border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  flex-shrink: 0;
}

.file-field__text {
  font-size: 0.875rem;
  color: var(--muted);
  word-break: break-word;
}

/* Grupo de checkboxes */
.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.check-tile {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border: 1px solid var(--gray-border);
  border-radius: 10px;
  background: #fafafa;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}

.check-tile:hover {
  border-color: #c5cdd8;
  background: #fff;
}

.check-tile:has(input:checked) {
  border-color: var(--gray-deep);
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--gray-deep);
}

.check-tile input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  accent-color: var(--gray-ink);
  cursor: pointer;
}

.form-actions {
  margin-top: 0.25rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--gray-border);
}

.form-actions .btn-primary {
  min-width: 8rem;
  padding: 0.6rem 1.35rem;
}

.input-tiny {
  width: 4.5rem;
}

.inline {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.inline-form {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  flex-wrap: wrap;
}

.max-w {
  max-width: 560px;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.8125rem;
}

.mono {
  font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
  font-size: 0.8125rem;
}

/* ——— Alertas ——— */
.alert {
  position: relative;
  padding: 0.85rem 1rem 0.85rem 2.75rem;
  border-radius: var(--radius-lg);
  margin-bottom: 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.45;
  border: 1px solid var(--border);
  border-left: 4px solid var(--gray-mid);
  box-shadow: var(--shadow-xs);
}

.alert:last-child {
  margin-bottom: 1rem;
}

.alert::before {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.35rem;
  height: 1.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
}

.alert-success {
  background: var(--success-bg);
  border-color: #bbf7d0;
  border-left-color: var(--success-border);
  color: #14532d;
}

.alert-success::before {
  content: "✓";
  background: #dcfce7;
  color: var(--success-border);
}

.alert-error {
  background: var(--error-bg);
  border-color: #fecaca;
  border-left-color: var(--error-border);
  color: #991b1b;
}

.alert-error::before {
  content: "!";
  background: #fee2e2;
  color: var(--error-border);
}

.alert-info {
  background: var(--info-bg);
  border-color: #bfdbfe;
  border-left-color: var(--info-border);
  color: #1e40af;
}

.alert-info::before {
  content: "i";
  font-style: italic;
  background: #dbeafe;
  color: var(--info-border);
}

.alert-warn {
  background: var(--warn-bg);
  border-color: #fde68a;
  border-left-color: var(--warn-border);
  color: #92400e;
}

.alert-warn::before {
  content: "‼";
  font-size: 0.65rem;
  background: #fef3c7;
  color: var(--warn-border);
}

.flash-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 0.25rem;
}

.flash-stack:empty {
  display: none;
}

.admin-body .form-panel {
  border-top: 1px solid var(--gray-border);
  box-shadow: none;
}

/* ——— Admin / cliente (sidebar) ——— */
.admin-shell {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

.sidebar {
  width: 212px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #ffffff 0%, var(--gray-soft) 100%);
  border-right: 1px solid var(--gray-border);
  display: flex;
  flex-direction: column;
  padding: 1rem 0;
  box-shadow: 2px 0 12px rgba(15, 23, 42, 0.04);
}

.sidebar-brand {
  font-weight: 600;
  padding: 0 1rem 0.75rem;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-deep);
  border-bottom: 1px solid var(--gray-border);
  margin-bottom: 0.35rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9375rem;
  border-left: 3px solid transparent;
}

.sidebar-nav a .icon {
  color: var(--gray-mid);
}

.sidebar-nav a:hover {
  background: var(--bg);
  text-decoration: none;
  border-left-color: var(--gray-deep);
}

.sidebar-nav a:hover .icon {
  color: var(--gray-deep);
}

.sidebar-nav button.sidebar-nav__action {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  padding: 0.5rem 1rem;
  border: none;
  border-left: 3px solid transparent;
  background: transparent;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--text);
  cursor: pointer;
}

.sidebar-nav button.sidebar-nav__action .icon {
  color: var(--gray-mid);
}

.sidebar-nav button.sidebar-nav__action:hover {
  background: var(--bg);
  border-left-color: var(--gray-deep);
}

.sidebar-nav button.sidebar-nav__action:hover .icon {
  color: var(--gray-deep);
}

.sidebar-foot {
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  border-top: 1px solid var(--gray-border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: auto;
  background: rgba(255, 255, 255, 0.6);
}

.sidebar-foot a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  color: var(--gray-deep);
  text-decoration: none;
}

.sidebar-foot a:hover {
  text-decoration: underline;
}

.admin-content {
  flex: 1;
  padding: 0;
  overflow: auto;
  min-width: 0;
  background: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 100%);
}

.admin-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 2.5rem;
}

.admin-body {
  background: var(--bg);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  min-height: 200px;
}

.admin-body > h1:first-child,
.admin-body > .page-head:first-child {
  margin-top: 0;
}

.admin-content h1 {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 1rem;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1rem 1.15rem;
  background: var(--gray-soft);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.page-head h1 {
  margin: 0;
  font-size: 1.2rem;
}

.page-head-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

/* ——— Modal ——— */
.modal-dialog {
  border: none;
  padding: 0;
  border-radius: var(--radius-xl);
  max-width: 440px;
  width: calc(100% - 2rem);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.modal-dialog__inner {
  padding: 0;
  max-height: min(85vh, 560px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.modal-dialog__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  margin: 0;
  background: linear-gradient(180deg, var(--gray-soft) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--gray-border);
}

.modal-dialog__head h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.modal-dialog__body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-dialog__body > .modal-dialog__hint + .modal-cat-list {
  margin-top: -0.25rem;
}

.modal-dialog__footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--gray-border);
  background: var(--gray-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
}

.modal-cat-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.04);
}

.modal-cat-list li {
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9375rem;
}

.modal-cat-list li:last-child {
  border-bottom: none;
}

.modal-cat-list li:not(.muted):hover {
  background: var(--gray-soft);
}

.modal-dialog__hint {
  margin: 0;
  font-size: 0.8125rem;
  padding: 0.65rem 0.75rem;
  background: var(--info-bg);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  color: #1e40af;
}

.modal-dialog__form-title {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 0.65rem;
}

.modal-dialog--linux {
  max-width: min(32rem, 100vw - 2rem);
}

.modal-steps {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text);
}

.modal-steps li {
  margin-bottom: 0.7rem;
}

.modal-steps li:last-child {
  margin-bottom: 0;
}

.modal-steps code {
  font-size: 0.86em;
  word-break: break-word;
}

/* ——— Dashboard ——— */
.grid-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  background: var(--bg);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  border-left: 4px solid var(--gray-mid);
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

a.stat-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

.stat-card:hover {
  box-shadow: var(--shadow-sm);
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 0.25rem;
  color: var(--gray-deep);
}

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

.panel {
  background: var(--bg);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem;
  border-top: 3px solid var(--gray-mid);
  box-shadow: var(--shadow-xs);
}

.panel h2 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0 0 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--gray-border);
  color: var(--gray-deep);
}

/* ——— Caixas utilitárias ——— */
.surface {
  background: var(--bg);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.box-pad {
  padding: 1.25rem 1.5rem;
}

.form-panel {
  background: var(--bg);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--gray-mid);
}

.form-panel > h1:first-child {
  margin-top: 0;
  margin-bottom: 1.35rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--gray-border);
}

/* ——— Tabelas ——— */
.table-wrap {
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg);
  box-shadow: var(--shadow-xs);
}

.table-wrap .table {
  margin: 0;
}

.panel .table-wrap {
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.04);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table th,
.table td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table th {
  color: var(--gray-deep);
  font-weight: 600;
  font-size: 0.8125rem;
  background: linear-gradient(180deg, var(--gray-soft) 0%, #e5e7eb 100%);
}

.table tbody tr {
  transition: background 0.1s ease;
}

.table tbody tr:hover {
  background: #fafafa;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table a {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius);
  background: var(--gray-soft);
  border: 1px solid var(--gray-border);
  color: var(--gray-deep);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
}

.table a:hover {
  background: var(--bg);
  border-color: var(--gray-mid);
  color: var(--gray-ink);
}

.table-col-actions {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

.table-actions-cell {
  text-align: right;
  vertical-align: middle;
}

.table-actions-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 0.35rem;
  white-space: nowrap;
}

.table-actions-sep {
  color: var(--gray-mid);
  font-size: 0.8125rem;
  font-weight: 400;
  user-select: none;
  flex-shrink: 0;
}

.form-inline-delete {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
}

.form-inline-delete button {
  margin: 0;
}

.btn-danger {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.btn-danger:hover {
  background: #fee2e2;
  border-color: #f87171;
  color: #7f1d1d;
  box-shadow: var(--shadow-xs);
}

/* ——— Páginas de estado (licença) / painel site ——— */
.status-sheet {
  text-align: center;
  padding: 0.25rem 0 0.5rem;
}

.status-sheet .status-page {
  padding-top: 0.5rem;
}

.status-page {
  text-align: center;
  padding: 0.5rem 0 1rem;
}

.status-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  font-size: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--muted);
}

.status-ok .status-icon {
  color: var(--ok);
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.status-warn .status-icon {
  color: var(--warn);
  border-color: #fde68a;
  background: #fffbeb;
}

.status-bad .status-icon {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fef2f2;
}

.status-page h1 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.status-page > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

.status-dl {
  text-align: left;
  max-width: 380px;
  margin: 1rem auto;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1rem;
  font-size: 0.875rem;
}

.status-dl dt {
  color: var(--muted);
  margin: 0;
}

.status-dl dd {
  margin: 0;
}

.changelog {
  max-width: 420px;
  margin: 1rem auto;
  text-align: left;
}

.changelog summary {
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--muted);
}

.changelog pre {
  white-space: pre-wrap;
  background: var(--bg-subtle);
  padding: 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 0.8125rem;
  margin: 0.5rem 0 0;
}

.status-actions,
.inline-actions {
  margin-top: 1.25rem;
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ——— Documentação API (Swagger) ——— */
.api-docs-wrap {
  background: var(--bg);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow-sm);
}

.api-docs-wrap > h1:first-child {
  margin-top: 0;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--gray-border);
  font-size: 1.35rem;
}

.api-docs-wrap #swagger-ui {
  min-height: 480px;
}

/* ——— Boas-vindas cliente ——— */
.welcome-panel {
  border-radius: var(--radius-lg);
  margin-bottom: 0.5rem;
}

.welcome-panel h1 {
  margin-top: 0;
}

.content-foot {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-border);
}

/* ——— Cartão reforçado (login / estados) ——— */
.card--elevated {
  box-shadow: var(--shadow-lg);
}

/* ——— Secção dashboard título ——— */
.dashboard-title {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 1.15rem;
  padding-bottom: 0.65rem;
  border-bottom: 2px solid var(--gray-border);
}

@media (max-width: 720px) {
  .admin-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 0.5rem 0;
  }

  .sidebar-brand {
    width: 100%;
    padding: 0.5rem 1rem 0;
  }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    flex: 1;
    padding: 0 0.5rem;
  }

  .sidebar-nav a {
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: 0.5rem 0.65rem;
  }

  .sidebar-nav a:hover {
    border-left-color: transparent;
    border-bottom-color: var(--gray-deep);
  }

  .sidebar-foot {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border);
  }
}
