/* ==========================================================================
   Galbyte Studio — design system
   Paleta: indigo (ação) + slate (neutros). Tipografia: Inter + JetBrains Mono.
   ========================================================================== */

:root {
  /* Brand — indigo */
  --indigo-50: #eef2ff;
  --indigo-100: #e0e7ff;
  --indigo-200: #c7d2fe;
  --indigo-300: #a5b4fc;
  --indigo-400: #818cf8;
  --indigo-500: #6366f1;
  --indigo-600: #4f46e5;
  --indigo-700: #4338ca;
  --indigo-800: #3730a3;
  --indigo-900: #312e81;
  --indigo-950: #1e1b4b;

  /* Neutros — slate */
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --slate-950: #020617;

  /* Semânticos */
  --emerald-50: #ecfdf5;
  --emerald-100: #d1fae5;
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --emerald-700: #047857;
  --amber-50: #fffbeb;
  --amber-100: #fef3c7;
  --amber-200: #fde68a;
  --amber-700: #b45309;
  --rose-50: #fff1f2;
  --rose-200: #fecdd3;
  --rose-600: #e11d48;
  --rose-700: #be123c;

  /* Superfícies e texto */
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-muted: var(--slate-50);
  --text: #09090b;
  --text-soft: var(--slate-600);
  --text-muted: var(--slate-500);
  --text-faint: var(--slate-400);
  --border: var(--slate-200);
  --border-soft: rgba(226, 232, 240, 0.8);
  --ring: rgba(79, 70, 229, 0.18);

  /* Raio e sombra */
  --radius-sm: 0.75rem;
  --radius-md: 1rem;
  --radius-lg: 1.25rem;
  --radius-xl: 1.5rem;
  --radius-2xl: 1.75rem;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 10px 24px -20px rgba(15, 23, 42, 0.35);
  --shadow-md: 0 2px 4px rgba(15, 23, 42, 0.04), 0 18px 40px -26px rgba(30, 27, 75, 0.4);
  --shadow-lg: 0 24px 60px -32px rgba(30, 27, 75, 0.42), 0 2px 6px rgba(15, 23, 42, 0.05);
  --shadow-xl: 0 40px 90px -40px rgba(2, 6, 23, 0.55);

  /* Tipografia */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Layout */
  --header-h: 4rem;
  --page-max: 75rem;
  --board-max: 90rem;
}

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

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

body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

body.has-overlay {
  overflow: hidden;
}

h1, h2, h3, h4, h5, h6, p, figure {
  margin: 0;
}

h1, h2, h3, h4 {
  letter-spacing: -0.02em;
  line-height: 1.2;
}

img, svg {
  max-width: 100%;
}

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

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

a {
  color: var(--indigo-700);
  text-decoration: none;
}

a:hover {
  color: var(--indigo-600);
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

::selection {
  background: var(--indigo-600);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--indigo-600);
  outline-offset: 2px;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--slate-300);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--slate-400);
}

/* --------------------------------------------------------------------------
   Base / utilidades
   -------------------------------------------------------------------------- */
.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

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

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 500;
  transform: translateY(-200%);
  background: var(--indigo-600);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.625rem 1rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  transition: transform 0.18s ease;
}
.skip-link:focus {
  transform: translateY(0);
  color: #fff;
}

.mono {
  font-family: var(--font-mono);
}

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

.truncate {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hide-sm {
  display: none;
}

@media (min-width: 640px) {
  .hide-sm {
    display: inline-flex;
  }
}

.icon {
  width: 1.125rem;
  height: 1.125rem;
  flex: none;
  stroke-width: 2;
}

.icon-sm {
  width: 0.875rem;
  height: 0.875rem;
}

.icon-lg {
  width: 1.375rem;
  height: 1.375rem;
}

/* --------------------------------------------------------------------------
   Marca
   -------------------------------------------------------------------------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: inherit;
  min-width: 0;
}

.brand:hover {
  color: inherit;
}

.brand-mark {
  width: 2.25rem;
  height: 2.25rem;
  flex: none;
  border-radius: 0.625rem;
  transition: transform 0.25s ease;
}

.brand:hover .brand-mark {
  transform: rotate(-6deg) scale(1.05);
}

.brand-word {
  font-weight: 800;
  font-size: 1.1875rem;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text);
  white-space: nowrap;
}

.brand-word span {
  color: var(--indigo-600);
}

.brand-seal {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--indigo-200);
  background: var(--indigo-50);
  color: var(--indigo-700);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.5;
}

.brand-seal--dark {
  border-color: rgba(129, 140, 248, 0.35);
  background: rgba(99, 102, 241, 0.14);
  color: var(--indigo-200);
}

/* --------------------------------------------------------------------------
   Botões
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  padding: 0.625rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease,
    box-shadow 0.16s ease, transform 0.16s ease;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

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

.btn-primary {
  background: var(--indigo-600);
  color: #fff;
  box-shadow: 0 1px 2px rgba(79, 70, 229, 0.2), 0 10px 24px -14px rgba(79, 70, 229, 0.7);
}
.btn-primary:hover {
  background: var(--indigo-700);
  color: #fff;
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-dark {
  background: var(--slate-900);
  color: #fff;
  box-shadow: var(--shadow-xs);
}
.btn-dark:hover {
  background: var(--slate-800);
  color: #fff;
  transform: translateY(-1px);
}

.btn-soft {
  background: var(--indigo-50);
  color: var(--indigo-700);
  border-color: var(--indigo-200);
}
.btn-soft:hover {
  background: var(--indigo-100);
  color: var(--indigo-800);
}

.btn-outline {
  background: var(--surface);
  color: var(--slate-700);
  border-color: var(--slate-300);
}
.btn-outline:hover {
  background: var(--slate-100);
  color: var(--slate-900);
}

.btn-ghost {
  background: transparent;
  color: var(--slate-600);
}
.btn-ghost:hover {
  background: rgba(99, 102, 241, 0.08);
  color: var(--indigo-700);
}

.btn-danger {
  background: var(--rose-600);
  color: #fff;
}
.btn-danger:hover {
  background: var(--rose-700);
  color: #fff;
}

.btn-danger-soft {
  background: var(--rose-50);
  color: var(--rose-700);
  border-color: var(--rose-200);
}
.btn-danger-soft:hover {
  background: #ffe4e6;
  color: var(--rose-700);
}

.btn-sm {
  min-height: 2.25rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  border-radius: 0.625rem;
}

.btn-block {
  width: 100%;
}

.btn[data-loading="true"] {
  pointer-events: none;
  opacity: 0.75;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-sm);
  color: var(--slate-500);
  transition: background-color 0.16s ease, color 0.16s ease;
  flex: none;
}

.icon-btn:hover {
  background: var(--slate-100);
  color: var(--slate-900);
}

.icon-btn.is-danger:hover {
  background: var(--rose-50);
  color: var(--rose-600);
}

.icon-btn.is-active {
  background: var(--indigo-50);
  color: var(--indigo-700);
}

.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 2.25rem;
  padding: 0.375rem 0.625rem;
  border-radius: 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--slate-500);
  transition: background-color 0.16s ease, color 0.16s ease;
  white-space: nowrap;
}

.text-btn:hover {
  background: var(--rose-50);
  color: var(--rose-600);
}

.text-btn .icon {
  width: 0.875rem;
  height: 0.875rem;
}

/* --------------------------------------------------------------------------
   Badges / chips
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3125rem;
  padding: 0.1875rem 0.625rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.45;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge .icon {
  width: 0.75rem;
  height: 0.75rem;
}

.badge-white {
  background: rgba(255, 255, 255, 0.96);
  color: var(--indigo-950);
  box-shadow: var(--shadow-xs);
}

.badge-indigo {
  background: var(--indigo-600);
  color: #fff;
  box-shadow: var(--shadow-xs);
}

.badge-emerald {
  background: var(--emerald-600);
  color: #fff;
  box-shadow: var(--shadow-xs);
}

.badge-slate {
  background: var(--slate-100);
  border-color: var(--slate-200);
  color: var(--slate-600);
}

.badge-amber {
  background: var(--amber-50);
  border-color: var(--amber-200);
  color: var(--amber-700);
}

.badge-rose {
  background: var(--rose-50);
  border-color: var(--rose-200);
  color: var(--rose-700);
}

.badge-indigo-soft {
  background: var(--indigo-50);
  border-color: var(--indigo-200);
  color: var(--indigo-700);
}

.code-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 0.4375rem;
  background: var(--indigo-50);
  border: 1px solid var(--indigo-200);
  color: var(--indigo-700);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.code-chip--dark {
  background: rgba(30, 27, 75, 0.9);
  border-color: rgba(67, 56, 202, 0.7);
  color: var(--indigo-200);
}

.dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--indigo-600);
  flex: none;
}

/* --------------------------------------------------------------------------
   Formulários
   -------------------------------------------------------------------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate-500);
}

.label .optional {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--slate-400);
}

.input,
.textarea {
  width: 100%;
  min-height: 2.625rem;
  padding: 0.625rem 0.875rem;
  background: var(--surface);
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

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

.input::placeholder,
.textarea::placeholder {
  color: var(--slate-400);
}

.input:hover,
.textarea:hover {
  border-color: var(--slate-400);
}

.input:focus,
.textarea:focus {
  outline: none;
  border-color: var(--indigo-600);
  box-shadow: 0 0 0 3px var(--ring);
}

.input[aria-invalid="true"],
.textarea[aria-invalid="true"] {
  border-color: var(--rose-600);
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.12);
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap .input {
  padding-right: 2.75rem;
}

.input-affix {
  position: absolute;
  right: 0.375rem;
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  color: var(--slate-400);
}

.input-affix:hover {
  background: var(--slate-100);
  color: var(--slate-700);
}

.field-hint {
  font-size: 0.75rem;
  color: var(--slate-500);
  line-height: 1.45;
}

.form-error {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.6875rem 0.875rem;
  border-radius: var(--radius-sm);
  background: var(--rose-50);
  border: 1px solid var(--rose-200);
  color: var(--rose-700);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.45;
}

.form-error .icon {
  width: 1rem;
  height: 1rem;
  margin-top: 0.0625rem;
}

.form-error[hidden] {
  display: none;
}

.form-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.form-row .input {
  flex: 1 1 auto;
  min-width: 0;
}

/* --------------------------------------------------------------------------
   Header do app (dashboard)
   -------------------------------------------------------------------------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.app-header-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 1rem;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.app-header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dev-email {
  display: none;
  max-width: 15rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.5rem;
  color: var(--slate-500);
  font-size: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 900px) {
  .dev-email {
    display: block;
  }
}

@media (min-width: 640px) {
  .app-header-inner {
    padding: 0 1.5rem;
  }
}

/* --------------------------------------------------------------------------
   Dashboard
   -------------------------------------------------------------------------- */
.page-main {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 1.75rem 1rem 3.5rem;
  flex: 1;
}

@media (min-width: 640px) {
  .page-main {
    padding: 2.5rem 1.5rem 4rem;
  }
}

.page-head {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.page-head h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--slate-950);
}

.page-head p {
  margin-top: 0.375rem;
  font-size: 0.875rem;
  color: var(--slate-500);
  max-width: 42rem;
  line-height: 1.55;
}

.page-head-aside {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  align-self: flex-start;
  padding: 0.5rem 0.875rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--slate-500);
  white-space: nowrap;
}

@media (min-width: 640px) {
  .page-head {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
  .page-head-aside {
    align-self: auto;
  }
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 720px) {
  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
  }
}

@media (min-width: 1080px) {
  .projects-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.project-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.project-card:hover {
  border-color: var(--indigo-200);
  box-shadow: 0 24px 50px -32px rgba(30, 27, 75, 0.45);
  transform: translateY(-2px);
}

.project-thumb {
  position: relative;
  display: block;
  height: 11rem;
  background: linear-gradient(135deg, var(--slate-100), var(--indigo-50));
  border-bottom: 1px solid var(--slate-100);
  overflow: hidden;
  color: inherit;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 0.35s ease;
}

.project-card:hover .project-thumb img {
  transform: scale(1.02);
}

.project-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(2, 6, 23, 0.52), rgba(2, 6, 23, 0.05) 45%, transparent 70%);
  pointer-events: none;
}

.thumb-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--indigo-400);
}

.thumb-placeholder svg {
  width: 3rem;
  height: 3rem;
  opacity: 0.7;
}

.thumb-badges {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.thumb-code {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.625rem;
  border-radius: 0.5rem;
  background: rgba(30, 27, 75, 0.92);
  color: var(--indigo-200);
  border: 1px solid rgba(67, 56, 202, 0.7);
  backdrop-filter: blur(6px);
}

.project-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem;
  flex: 1;
}

.project-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.project-title-row h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--slate-950);
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.project-title-row h3 a {
  color: inherit;
}

.project-title-row h3 a:hover {
  color: var(--indigo-600);
}

.project-client {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--slate-500);
  min-width: 0;
}

.project-client .icon {
  width: 0.875rem;
  height: 0.875rem;
  color: var(--slate-400);
}

.project-client span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-meta {
  margin-top: 0.375rem;
  font-size: 0.6875rem;
  color: var(--slate-400);
}

.project-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.875rem;
  border-top: 1px solid var(--slate-100);
}

.project-footer .btn {
  flex: 1;
  min-width: 0;
}

.project-footer .btn-soft {
  flex: 0 0 auto;
}

.status-badge {
  flex: none;
}
.status-draft {
  background: var(--slate-100);
  border-color: var(--slate-200);
  color: var(--slate-600);
}
.status-invited {
  background: var(--amber-50);
  border-color: var(--amber-200);
  color: var(--amber-700);
}
.status-in_review {
  background: var(--indigo-50);
  border-color: var(--indigo-200);
  color: var(--indigo-700);
}
.status-approved {
  background: var(--emerald-50);
  border-color: var(--emerald-100);
  color: var(--emerald-700);
}

/* --------------------------------------------------------------------------
   Estados: vazio, erro, skeleton, spinner
   -------------------------------------------------------------------------- */
.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--surface);
  border: 2px dashed var(--indigo-200);
  border-radius: var(--radius-2xl);
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: var(--radius-md);
  background: var(--indigo-50);
  color: var(--indigo-600);
  margin-bottom: 1rem;
}

.empty-icon .icon {
  width: 1.75rem;
  height: 1.75rem;
}

.empty-state h2 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--slate-950);
}

.empty-state p {
  margin-top: 0.375rem;
  max-width: 28rem;
  font-size: 0.875rem;
  color: var(--slate-500);
  line-height: 1.6;
}

.empty-state kbd {
  display: inline-block;
  padding: 0.125rem 0.375rem;
  border: 1px solid var(--slate-200);
  border-radius: 0.3125rem;
  background: var(--slate-100);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
}

.empty-state .btn {
  margin-top: 1.25rem;
}

.error-panel {
  width: 100%;
  max-width: 32rem;
  margin: 2rem auto;
  padding: 2rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.error-panel .empty-icon {
  background: var(--rose-50);
  color: var(--rose-600);
  margin-inline: auto;
}

.error-panel h2 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--slate-950);
}

.error-panel p {
  margin-top: 0.375rem;
  color: var(--slate-500);
  font-size: 0.875rem;
  line-height: 1.6;
}

.error-panel .btn {
  margin-top: 1.25rem;
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--slate-100);
  border-radius: 0.5rem;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

.skeleton-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.skeleton-card .skeleton-thumb {
  height: 11rem;
  border-radius: 0;
}

.skeleton-card .skeleton-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.skeleton-line {
  height: 0.75rem;
}

.w-35 { width: 35%; }
.w-45 { width: 45%; }
.w-55 { width: 55%; }
.w-60 { width: 60%; }
.w-70 { width: 70%; }
.w-80 { width: 80%; }
.w-90 { width: 90%; }

.skeleton-thin {
  height: 0.5rem;
}

.skeleton-small {
  height: 0.7rem;
  margin-top: 0.5rem;
}

.skeleton-bar {
  height: 2.75rem;
  border-radius: 0;
}

.skeleton-canvas {
  height: 16rem;
  border-radius: 0;
}

.auth-note--spaced {
  margin-top: 0.75rem;
}

.spinner {
  display: inline-block;
  width: 1.125rem;
  height: 1.125rem;
  border: 2px solid rgba(79, 70, 229, 0.2);
  border-top-color: var(--indigo-600);
  border-radius: 999px;
  animation: spin 0.7s linear infinite;
  flex: none;
}

.spinner--light {
  border-color: rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.boot {
  flex: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem;
}

.boot-mark {
  width: 3.5rem;
  height: 3.5rem;
  animation: bootFloat 2.4s ease-in-out infinite;
}

.boot-word {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--slate-950);
}

.boot-word span {
  color: var(--indigo-600);
}

.boot-text {
  font-size: 0.8125rem;
  color: var(--slate-500);
}

@keyframes bootFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.nojs {
  max-width: 30rem;
  margin: 4rem auto;
  padding: 2rem;
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-xl);
  text-align: center;
  font-family: var(--font-sans);
}

/* --------------------------------------------------------------------------
   Autenticação (dev login + setup + OTP cliente)
   -------------------------------------------------------------------------- */
.auth-shell {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem 3rem;
  overflow: hidden;
  background:
    radial-gradient(52rem 30rem at 12% -8%, rgba(99, 102, 241, 0.16), transparent 62%),
    radial-gradient(46rem 28rem at 92% 6%, rgba(79, 70, 229, 0.12), transparent 58%),
    var(--bg);
}

.auth-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(79, 70, 229, 0.12) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(60% 55% at 50% 40%, #000 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(60% 55% at 50% 40%, #000 20%, transparent 100%);
  opacity: 0.5;
  pointer-events: none;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 26rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--radius-2xl);
  box-shadow: 0 30px 70px -36px rgba(30, 27, 75, 0.4), 0 1px 2px rgba(15, 23, 42, 0.04);
}

@media (min-width: 420px) {
  .auth-card {
    padding: 2rem;
  }
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.auth-brand .brand-mark {
  width: 2.5rem;
  height: 2.5rem;
}

.auth-brand .brand-word {
  font-size: 1.25rem;
}

.auth-return {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--slate-400);
  min-height: 2.5rem;
  padding: 0 0.5rem;
  border-radius: 0.5rem;
}

.auth-return:hover {
  color: var(--slate-700);
  background: var(--slate-100);
}

.auth-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  background: var(--indigo-50);
  border: 1px solid var(--indigo-100);
  color: var(--indigo-700);
  font-size: 0.6875rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--slate-950);
  letter-spacing: -0.025em;
}

.auth-sub {
  margin-top: 0.375rem;
  font-size: 0.875rem;
  color: var(--slate-500);
  line-height: 1.6;
}

.auth-form {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-footer {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--slate-400);
  line-height: 1.6;
}

.auth-switch {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--slate-100);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  text-align: center;
}

.auth-switch .btn-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 2.5rem;
  padding: 0 0.5rem;
  color: var(--slate-500);
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: 0.5rem;
}

.auth-switch .btn-link:hover {
  color: var(--indigo-700);
  background: var(--indigo-50);
}

.auth-note {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 0.875rem;
  border-radius: var(--radius-sm);
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  color: var(--slate-500);
  font-size: 0.75rem;
  line-height: 1.5;
}

.auth-note .icon {
  width: 1rem;
  height: 1rem;
  margin-top: 0.0625rem;
  color: var(--slate-400);
}

.auth-note--amber {
  background: var(--amber-50);
  border-color: var(--amber-200);
  color: var(--amber-700);
}

.auth-note--amber .icon {
  color: var(--amber-700);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--slate-400);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--slate-200);
}

/* OTP */
.otp-block {
  padding: 1rem;
  background: var(--slate-50);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  margin-top: 1.5rem;
}

.otp-label {
  font-size: 0.6875rem;
  color: var(--slate-500);
}

.otp-project {
  margin-top: 0.125rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--slate-900);
  overflow-wrap: anywhere;
}

.otp-email {
  margin-top: 0.125rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--indigo-600);
  overflow-wrap: anywhere;
}

.otp-row {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin: 1.5rem 0;
}

.otp-input {
  flex: 1 1 0;
  min-width: 0;
  height: 3.5rem;
  border: 2px solid var(--slate-200);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--slate-950);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  padding: 0;
}

.otp-input:hover {
  border-color: var(--slate-300);
}

.otp-input:focus {
  outline: none;
  border-color: var(--indigo-600);
  box-shadow: 0 0 0 3px var(--ring);
}

.otp-input[aria-invalid="true"] {
  border-color: var(--rose-600);
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.12);
}

.otp-dash {
  flex: none;
  color: var(--slate-300);
  font-weight: 700;
  font-size: 0.875rem;
}

@media (min-width: 400px) {
  .otp-row {
    gap: 0.5rem;
  }
  .otp-input {
    height: 3.75rem;
  }
}

.auth-invite-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
}

.auth-invite-state .empty-icon {
  margin-bottom: 0.25rem;
}

.auth-invite-state h3 {
  font-size: 1rem;
  color: var(--slate-950);
}

.auth-invite-state p {
  font-size: 0.8125rem;
  color: var(--slate-500);
  line-height: 1.55;
}

/* --------------------------------------------------------------------------
   Board
   -------------------------------------------------------------------------- */
.board-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.board-header-row {
  max-width: var(--board-max);
  margin: 0 auto;
  min-height: var(--header-h);
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.board-head-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1 1 auto;
}

.board-divider {
  display: none;
  width: 1px;
  height: 1.375rem;
  background: var(--slate-200);
  flex: none;
}

@media (min-width: 640px) {
  .board-divider {
    display: block;
  }
}

.board-head-info {
  min-width: 0;
}

.board-title-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.board-title-line h1 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--slate-950);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

@media (min-width: 640px) {
  .board-title-line h1 {
    font-size: 1rem;
  }
}

.board-title-line .code-chip {
  display: none;
}

@media (min-width: 640px) {
  .board-title-line .code-chip {
    display: inline-flex;
  }
}

.board-client {
  font-size: 0.6875rem;
  color: var(--slate-500);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 16rem;
}

@media (min-width: 900px) {
  .board-client {
    max-width: 26rem;
  }
}

.board-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: none;
}

.board-actions .btn-label {
  display: none;
}

.board-actions .btn {
  padding: 0.5rem;
  min-width: 2.5rem;
  min-height: 2.5rem;
}

@media (min-width: 640px) {
  .board-actions .btn-label {
    display: inline;
  }
  .board-actions .btn {
    padding: 0.5rem 0.875rem;
  }
}

.board-toolbar {
  background: var(--indigo-950);
  color: #fff;
}

.board-toolbar-inner {
  max-width: var(--board-max);
  margin: 0 auto;
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

@media (min-width: 640px) {
  .board-toolbar-inner {
    padding: 0.625rem 1.5rem;
  }
}

.board-hint {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  font-size: 0.75rem;
  color: var(--indigo-100);
  line-height: 1.5;
  max-width: 54rem;
}

.board-hint strong {
  color: #fff;
  font-weight: 600;
}

.board-hint .hint-dot {
  display: inline-grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  margin-top: 0.0625rem;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.3);
  color: var(--indigo-300);
  font-weight: 700;
  font-size: 0.6875rem;
}

.board-hint kbd {
  display: inline-block;
  padding: 0.0625rem 0.3125rem;
  background: var(--indigo-900);
  border: 1px solid var(--indigo-700);
  border-radius: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
}

.tool-switch {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: none;
}

.tool-switch-label {
  display: none;
  font-size: 0.6875rem;
  color: var(--indigo-300);
}

@media (min-width: 768px) {
  .tool-switch-label {
    display: inline;
  }
}

.tool-group {
  display: inline-flex;
  padding: 0.125rem;
  gap: 0.125rem;
  border-radius: 0.5rem;
  background: rgba(49, 46, 129, 0.9);
  border: 1px solid var(--indigo-800);
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 2rem;
  padding: 0.25rem 0.625rem;
  border-radius: 0.375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--indigo-300);
  transition: background-color 0.16s ease, color 0.16s ease;
  white-space: nowrap;
}

.tool-btn .icon {
  width: 0.875rem;
  height: 0.875rem;
}

.tool-btn:hover {
  color: #fff;
}

.tool-btn.is-active {
  background: var(--indigo-600);
  color: #fff;
  box-shadow: var(--shadow-xs);
}

.board-main {
  width: 100%;
  max-width: var(--board-max);
  margin: 0 auto;
  padding: 1.5rem 0.75rem 4rem;
  flex: 1;
}

@media (min-width: 640px) {
  .board-main {
    padding: 2rem 1.5rem 4.5rem;
  }
}

.screens-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

@media (min-width: 1280px) {
  .screens-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
  }
}

.screen-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.screen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--slate-100);
}

.screen-title {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
}

.status-dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 999px;
  flex: none;
}

.status-dot.is-open {
  background: var(--indigo-600);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.14);
}

.status-dot.is-done {
  background: var(--emerald-500);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.14);
}

.screen-title h2 {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--slate-950);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 640px) {
  .screen-title h2 {
    font-size: 0.9375rem;
  }
}

.screen-tools {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  flex: none;
}

.screen-tools .icon-btn {
  width: 2.25rem;
  height: 2.25rem;
}

@media (min-width: 640px) {
  .screen-tools .icon-btn {
    width: 2.5rem;
    height: 2.5rem;
  }
}

.canvas {
  position: relative;
  background: var(--slate-100);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  cursor: crosshair;
}

.screen-canvas img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  -webkit-user-drag: none;
}

.stroke-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.pin-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.map-pin {
  position: absolute;
  width: 2rem;
  height: 2rem;
  transform: translate(-50%, -50%);
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  border: 2px solid #fff;
  background: var(--indigo-600);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  box-shadow: 0 6px 16px -6px rgba(30, 27, 75, 0.65);
  pointer-events: auto;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  animation: pinPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 3;
}

.map-pin:hover,
.map-pin:focus-visible {
  transform: translate(-50%, -50%) scale(1.12);
  z-index: 4;
}

.map-pin .icon {
  width: 0.8125rem;
  height: 0.8125rem;
  stroke-width: 3;
}

.map-pin.is-resolved {
  background: var(--emerald-600);
  opacity: 0.88;
}

.map-pin:not(.is-resolved) {
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.22), 0 6px 16px -6px rgba(30, 27, 75, 0.65);
}

@keyframes pinPop {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

@media (pointer: coarse) {
  .map-pin {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 0.75rem;
  }
}

.screen-canvas[data-tool="draw"] {
  cursor: crosshair;
  touch-action: none;
}

.screen-canvas[data-tool="draw"] .map-pin {
  pointer-events: none;
}

.screen-canvas[data-tool="pin"] {
  cursor: crosshair;
}

.canvas-hint {
  position: absolute;
  bottom: 0.75rem;
  left: 0.75rem;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
  background: rgba(30, 27, 75, 0.92);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  backdrop-filter: blur(6px);
}

.canvas-hint .icon {
  width: 0.875rem;
  height: 0.875rem;
  color: var(--indigo-300);
}

.canvas:hover .canvas-hint {
  opacity: 1;
  transform: translateY(0);
}

/* Anotações */
.screen-notes {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .screen-notes {
    padding: 1.25rem;
  }
}

.notes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.notes-title {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate-400);
}

.notes-progress {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--indigo-600);
  white-space: nowrap;
}

.notes-empty {
  padding: 1rem;
  border-radius: var(--radius-md);
  background: var(--slate-50);
  border: 1px solid var(--slate-100);
  text-align: center;
  font-size: 0.75rem;
  color: var(--slate-400);
  line-height: 1.55;
}

.notes-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.note-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--indigo-100);
  background: rgba(238, 242, 255, 0.45);
  transition: box-shadow 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.note-row.is-resolved {
  background: rgba(248, 250, 252, 0.85);
  border-color: var(--border-soft);
}

.note-row.is-highlight {
  border-color: var(--indigo-600);
  box-shadow: 0 0 0 2px var(--indigo-600);
  background: var(--indigo-50);
}

.note-row.is-highlight.is-resolved {
  background: var(--indigo-50);
}

.note-main {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
  flex: 1 1 auto;
}

.note-index {
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
  margin-top: 0.0625rem;
  border-radius: 999px;
  background: var(--indigo-600);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
}

.note-index.is-done {
  background: var(--emerald-600);
}

.note-copy {
  min-width: 0;
  flex: 1;
}

.note-text {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--slate-900);
  font-weight: 500;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.note-row.is-resolved .note-text {
  color: var(--slate-400);
  font-weight: 400;
  text-decoration: line-through;
  text-decoration-color: rgba(148, 163, 184, 0.7);
}

.note-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.4375rem;
}

.author-chip {
  padding: 0.0625rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  white-space: nowrap;
}

.author-chip.is-client {
  background: var(--indigo-100);
  color: var(--indigo-800);
}

.author-chip.is-dev {
  background: var(--slate-200);
  color: var(--slate-700);
}

.note-state {
  font-size: 0.6875rem;
  color: var(--slate-400);
}

.note-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: none;
}

.note-resolve {
  display: inline-flex;
  align-items: center;
  gap: 0.3125rem;
  min-height: 2rem;
  padding: 0.25rem 0.625rem;
  border-radius: 0.625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  background: var(--indigo-600);
  color: #fff;
  transition: background-color 0.16s ease;
  white-space: nowrap;
}

.note-resolve:hover {
  background: var(--indigo-700);
}

.note-resolve.is-reopen {
  background: #fff;
  border: 1px solid var(--slate-200);
  color: var(--slate-600);
}

.note-resolve.is-reopen:hover {
  background: var(--slate-100);
  color: var(--slate-900);
}

.note-resolve .icon {
  width: 0.8125rem;
  height: 0.8125rem;
}

.note-delete {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  color: var(--slate-400);
}

.note-delete:hover {
  color: var(--rose-600);
  background: var(--rose-50);
}

.note-delete .icon {
  width: 0.875rem;
  height: 0.875rem;
}

@media (max-width: 520px) {
  .note-row {
    flex-direction: column;
  }
  .note-actions {
    align-self: flex-end;
  }
}

/* --------------------------------------------------------------------------
   Overlays / modais
   -------------------------------------------------------------------------- */
.overlay-root {
  position: relative;
  z-index: 100;
}

.modal-backdrop,
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(2, 6, 23, 0.58);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  overflow-y: auto;
  animation: fadeIn 0.18s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal {
  width: 100%;
  max-width: 28rem;
  max-height: calc(100dvh - 2rem);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: modalIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal--sm {
  max-width: 24rem;
}

.modal--lg {
  max-width: 34rem;
}

.modal--xl {
  max-width: 42rem;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--slate-100);
}

.modal-head-main {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  min-width: 0;
}

.modal-icon {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  flex: none;
  border-radius: 0.625rem;
  background: var(--indigo-50);
  color: var(--indigo-600);
}

.modal-icon .icon {
  width: 1rem;
  height: 1rem;
}

.modal-icon.is-amber {
  background: var(--amber-50);
  color: var(--amber-700);
}

.modal-icon.is-rose {
  background: var(--rose-50);
  color: var(--rose-600);
}

.modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--slate-950);
  letter-spacing: -0.015em;
}

.modal-sub {
  margin-top: 0.1875rem;
  font-size: 0.75rem;
  color: var(--slate-500);
  line-height: 1.5;
}

.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--slate-100);
  background: linear-gradient(to bottom, rgba(248, 250, 252, 0.4), rgba(248, 250, 252, 0.9));
}

.modal-foot .btn {
  min-height: 2.5rem;
}

.modal-foot--flush {
  margin: 0 -1.25rem -1.25rem;
  padding-inline: 1.25rem;
}

.modal-note {
  font-size: 0.75rem;
  color: var(--slate-500);
  line-height: 1.55;
}

.modal-close {
  flex: none;
}

@media (max-width: 640px) {
  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }
  .modal {
    max-width: none;
    max-height: 92dvh;
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
    border-bottom: 0;
    animation: sheetIn 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  }
  @keyframes sheetIn {
    from {
      transform: translateY(24px);
      opacity: 0.6;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }
  .modal-foot {
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  }
}

/* Aviso âmbar de e-mail não configurado */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.875rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  line-height: 1.5;
  border: 1px solid transparent;
}

.alert .icon {
  width: 1.0625rem;
  height: 1.0625rem;
  margin-top: 0.0625rem;
  flex: none;
}

.alert-amber {
  background: var(--amber-50);
  border-color: var(--amber-200);
  color: var(--amber-700);
}

.alert-rose {
  background: var(--rose-50);
  border-color: var(--rose-200);
  color: var(--rose-700);
}

.alert-slate {
  background: var(--slate-50);
  border-color: var(--slate-200);
  color: var(--slate-600);
}

.alert strong {
  font-weight: 700;
}

.alert-title {
  font-weight: 700;
  margin-bottom: 0.125rem;
}

/* Prévia do e-mail */
.mail-preview {
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--slate-200);
  background: var(--slate-50);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mail-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.mail-preview-body {
  padding: 0.875rem;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.mail-preview-body p {
  font-size: 0.75rem;
  color: var(--slate-500);
  line-height: 1.55;
}

.mail-preview-body strong {
  color: var(--slate-900);
}

.code-display {
  padding: 0.875rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--indigo-950);
  text-align: center;
}

.code-display-label {
  font-size: 0.625rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--indigo-300);
  margin-bottom: 0.25rem;
}

.code-display-value {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #fff;
}

.code-display-value.is-masked {
  color: var(--indigo-400);
  letter-spacing: 0.3em;
}

.invite-actions {
  display: flex;
  gap: 0.5rem;
}

.invite-actions .btn {
  flex: 1;
  min-width: 0;
  font-size: 0.75rem;
}

.invite-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.invite-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: #fff;
}

.invite-item-main {
  min-width: 0;
}

.invite-email {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--slate-800);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invite-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.25rem;
  font-size: 0.6875rem;
  color: var(--slate-400);
}

.invite-item-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: none;
}

.invite-item-actions .icon-btn {
  width: 2.25rem;
  height: 2.25rem;
}

.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate-400);
}

/* Dropzone */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 1.5rem 1rem;
  border: 2px dashed var(--indigo-200);
  border-radius: var(--radius-md);
  background: rgba(238, 242, 255, 0.4);
  color: var(--slate-800);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease;
  min-height: 8rem;
}

.dropzone:hover,
.dropzone.is-dragging {
  border-color: var(--indigo-500);
  background: var(--indigo-50);
}

.dropzone .icon {
  width: 2rem;
  height: 2rem;
  color: var(--indigo-600);
  margin-bottom: 0.25rem;
}

.dropzone-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--slate-800);
}

.dropzone-hint {
  font-size: 0.75rem;
  color: var(--slate-500);
  line-height: 1.5;
}

.dropzone kbd {
  display: inline-block;
  padding: 0.0625rem 0.3125rem;
  border: 1px solid var(--slate-200);
  border-radius: 0.25rem;
  background: #fff;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
}

.preview-box {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--slate-100);
}

.preview-box img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 14rem;
  object-fit: contain;
  background: var(--slate-100);
}

.preview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #fff;
  border-top: 1px solid var(--slate-100);
  font-size: 0.6875rem;
  color: var(--slate-500);
}

.preview-meta .truncate {
  max-width: 70%;
}

.link-btn {
  color: var(--indigo-600);
  font-weight: 600;
  font-size: 0.6875rem;
  min-height: 2rem;
  padding: 0 0.375rem;
  border-radius: 0.375rem;
}

.link-btn:hover {
  background: var(--indigo-50);
}

.progress {
  height: 0.375rem;
  width: 100%;
  background: var(--slate-200);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--indigo-500), var(--indigo-600));
  border-radius: 999px;
  transition: width 0.18s ease;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--slate-500);
}

/* Modal novo pin */
.pin-form-badge {
  display: inline-grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: var(--indigo-600);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  flex: none;
}

.pin-coord {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--slate-400);
}

/* --------------------------------------------------------------------------
   Toasts
   -------------------------------------------------------------------------- */
.toast-region {
  position: fixed;
  right: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  pointer-events: none;
  width: calc(100% - 2rem);
  max-width: 24rem;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--indigo-950);
  color: #fff;
  border: 1px solid var(--indigo-800);
  box-shadow: var(--shadow-xl);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.45;
  pointer-events: auto;
  animation: toastIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 100%;
}

.toast .icon {
  width: 1rem;
  height: 1rem;
  margin-top: 0.0625rem;
  color: var(--indigo-400);
  flex: none;
}

.toast.is-error {
  background: #2a0a12;
  border-color: rgba(225, 29, 72, 0.45);
}
.toast.is-error .icon {
  color: #fb7185;
}

.toast.is-success .icon {
  color: #34d399;
}

.toast.is-leaving {
  animation: toastOut 0.18s ease forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(6px);
  }
}

@media (max-width: 480px) {
  .toast-region {
    right: 0.75rem;
    left: 0.75rem;
    bottom: calc(0.75rem + env(safe-area-inset-bottom));
    width: auto;
    max-width: none;
    align-items: stretch;
  }
}

/* --------------------------------------------------------------------------
   Lightbox
   -------------------------------------------------------------------------- */
.lightbox {
  flex-direction: column;
  padding: 0;
  background: rgba(2, 6, 23, 0.96);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow: hidden;
  z-index: 130;
}

.lightbox-head {
  height: 3.5rem;
  flex: none;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--slate-800);
  color: #fff;
}

.lightbox-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.lightbox-title h2 {
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lightbox-badge {
  flex: none;
  padding: 0.125rem 0.625rem;
  border-radius: 0.375rem;
  background: var(--indigo-600);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
}

.lightbox-close {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 2.25rem;
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  background: var(--slate-800);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  flex: none;
}

.lightbox-close:hover {
  background: var(--slate-700);
  color: #fff;
}

.lightbox-close .icon {
  width: 0.875rem;
  height: 0.875rem;
}

.lightbox-body {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.25rem;
}

@media (min-width: 768px) {
  .lightbox-body {
    align-items: center;
    padding: 1.5rem;
  }
}

.lightbox-stage {
  position: relative;
  width: 100%;
  max-width: 72rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--slate-700);
  background: var(--slate-900);
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.8);
}

.lightbox-stage img {
  display: block;
  width: 100%;
  height: auto;
}

.lightbox-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 3;
}

.lightbox-pin-btn {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 2px solid #fff;
  background: var(--indigo-600);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s ease;
}

.lightbox-pin-btn:hover,
.lightbox-pin-btn:focus-visible {
  transform: scale(1.1);
}

.lightbox-pin.is-resolved .lightbox-pin-btn {
  background: var(--emerald-600);
}

.lightbox-tip {
  position: absolute;
  top: calc(100% + 0.375rem);
  left: 50%;
  transform: translateX(-50%);
  width: 13rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(2, 6, 23, 0.96);
  border: 1px solid var(--slate-700);
  color: #fff;
  font-size: 0.75rem;
  line-height: 1.45;
  text-align: left;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  pointer-events: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  z-index: 4;
}

.lightbox-pin.tip-right .lightbox-tip {
  left: auto;
  right: 0;
  transform: none;
}

.lightbox-pin:hover .lightbox-tip,
.lightbox-pin:focus-within .lightbox-tip {
  opacity: 1;
  visibility: visible;
}

@media (min-width: 768px) and (hover: hover) {
  .lightbox-tip {
    opacity: 1;
    visibility: visible;
  }
}

/* --------------------------------------------------------------------------
   Responsivo fino
   -------------------------------------------------------------------------- */
@media (max-width: 380px) {
  .brand-seal {
    display: none;
  }
  .auth-card {
    padding: 1.25rem;
  }
  .otp-input {
    height: 3rem;
    font-size: 1.0625rem;
  }
  .otp-row {
    gap: 0.25rem;
  }
}

/* --------------------------------------------------------------------------
   Movimento reduzido
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  html {
    scroll-behavior: auto;
  }
}
