/* ============================================================
   ContentFlow Design System: main.css
   Dark mode default, light mode toggle
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=JetBrains+Mono:wght@400;500&display=swap');

/* ============================================================
   CSS Custom Properties
   ============================================================ */

:root {
  /* Dark mode palette (default) */
  --bg-primary:  #0D0F12;
  --bg-secondary: #0A0C0F;
  --surface:     #161A1F;
  --surface-2:   #1E242C;
  --surface-3:   #252D38;
  --border:      #252A32;
  --border-light: #2E3540;

  /* Text */
  --text-primary:   #F0F4F8;
  /* contraste mínimo 4,5:1 sobre surface e surface-2 (antes muted tinha 2,1:1) */
  --text-secondary: #A3B0C2;
  --text-muted:     #8792A3;
  --text-inverse:   #0D0F12;

  /* Accent colors */
  --accent:        #4F9CF9;
  --accent-hover:  #3B8AF5;
  --accent-dim:    rgba(79, 156, 249, 0.12);
  --accent-glow:   rgba(79, 156, 249, 0.25);

  /* Status colors */
  --success:       #22C55E;
  --success-dim:   rgba(34, 197, 94, 0.12);
  --warning:       #F59E0B;
  --warning-dim:   rgba(245, 158, 11, 0.12);
  --error:         #F87171; /* texto 5,6:1 sobre surface-2 (antes 4,1:1) */
  --error-dim:     rgba(239, 68, 68, 0.12);
  --info:          #06B6D4;
  --info-dim:      rgba(6, 182, 212, 0.12);

  /* Purple for special states */
  --purple:        #C084FC;
  --purple-dim:    rgba(168, 85, 247, 0.12);

  /* Fundo de botão com texto branco (4,7:1 ou mais; o --accent claro dava 2,8:1) */
  --accent-solid:  #2563EB;
  --accent-solid-hover: #1D4ED8;
  --success-solid: #15803D;
  --error-solid:   #DC2626;

  /* Layout */
  --sidebar-width: 220px;
  --header-height: 0px;

  /* Typography */
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body:    'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Border radius */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 2px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 20px rgba(79, 156, 249, 0.2);

  /* Transitions */
  --transition: 150ms ease;
  --transition-slow: 300ms ease;
}

/* Light mode */
[data-theme="light"] {
  --bg-primary:   #F8F9FC;
  --bg-secondary: #EEF1F6;
  --surface:      #FFFFFF;
  --surface-2:    #F4F6FA;
  --surface-3:    #EBEEf4;
  --border:       #E2E8F0;
  --border-light: #EBF0F7;

  --text-primary:   #0F172A;
  --text-secondary: #475569;
  --text-muted:     #5B6B7F;
  --text-inverse:   #F8F9FC;

  /* Status mais escuros no tema claro: texto com 4,5:1 ou mais sobre branco (antes 2,1 a 2,8:1) */
  --accent:        #1D6FD8;
  --accent-hover:  #1A5FBA;
  --success:       #15803D;
  --warning:       #B45309;
  --error:         #DC2626;
  --info:          #0E7490;
  --purple:        #7E22CE;
  --accent-solid:  #1D6FD8;
  --accent-solid-hover: #1A5FBA;

  --accent-dim:  rgba(79, 156, 249, 0.08);
  --success-dim: rgba(34, 197, 94, 0.08);
  --warning-dim: rgba(245, 158, 11, 0.08);
  --error-dim:   rgba(239, 68, 68, 0.08);

  --shadow-sm:  0 1px 2px rgba(0,0,0,0.06);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.12);
}

/* ============================================================
   Reset & Base
   ============================================================ */

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

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

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

input, textarea, select, button {
  font-family: inherit;
  font-size: inherit;
}

ul, ol {
  list-style: none;
}

/* ============================================================
   Typography
   ============================================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; font-family: var(--font-body); font-weight: 600; }
h5 { font-size: 0.875rem; font-family: var(--font-body); font-weight: 600; }

.text-display {
  font-family: var(--font-display);
  font-size: 2.5rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.text-lg   { font-size: 1.067rem; }
.text-sm   { font-size: 0.9rem; }
.text-xs   { font-size: 0.833rem; }
.text-mono { font-family: var(--font-mono); }

.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-accent    { color: var(--accent); }
.text-success   { color: var(--success); }
.text-warning   { color: var(--warning); }
.text-error     { color: var(--error); }

.font-normal  { font-weight: 400; }
.font-medium  { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold    { font-weight: 700; }

code, pre {
  font-family: var(--font-mono);
  font-size: 0.933rem;
}

code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--accent);
}

pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  overflow-x: auto;
}

/* ============================================================
   Layout: App Shell
   ============================================================ */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}

.main-content {
  flex: 1;
  min-width: 0; /* sem isso o kanban e títulos longos alargam a página inteira */
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  background: var(--bg-primary);
}

.page-content {
  padding: var(--space-8);
  max-width: 1400px;
}

.page-wide { max-width: none; overflow-x: auto; }

.page-header {
  margin-bottom: var(--space-6);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.page-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--text-primary);
}

.page-subtitle {
  color: var(--text-secondary);
  margin-top: var(--space-1);
  font-size: 0.875rem;
}

/* ============================================================
   Sidebar
   ============================================================ */

.sidebar-logo {
  padding: var(--space-5) var(--space-5) var(--space-4);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.sidebar-logo .logo-mark {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--accent) 0%, #7C3AED 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-logo .logo-mark svg {
  width: 16px;
  height: 16px;
}

.sidebar-logo .logo-text {
  font-family: var(--font-display);
  font-size: 1.125rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.sidebar-workspace {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
}

.workspace-selector {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  transition: all var(--transition);
  font-size: 0.933rem;
  font-weight: 500;
}

.workspace-selector:hover {
  border-color: var(--accent);
  background: var(--surface-3);
}

.workspace-selector .ws-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
}

.ws-dropdown { position: relative; }

.ws-chevron { transition: transform var(--transition); }
.ws-chevron.open { transform: rotate(180deg); }

.ws-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  z-index: 9999;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.ws-menu-footer { border-top: 1px solid var(--border); padding: 4px; }

.ws-check { margin-left: auto; flex-shrink: 0; }

.nav-section-spaced { margin-top: var(--space-2); }

.app-version {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.05em;
  user-select: none;
  padding: 2px 0;
}

.ws-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.867rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.ws-item:hover {
  background: var(--surface-3);
  color: var(--text-primary);
}
.ws-item.active {
  color: var(--accent);
  font-weight: 500;
}
.ws-item .ws-item-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: background 0.1s;
}
.ws-item.active .ws-item-dot {
  background: var(--accent);
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-4) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.nav-section-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: var(--space-3) var(--space-3) var(--space-2);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  color: var(--text-primary);
  background: var(--surface-2);
}

.nav-item.active {
  color: var(--accent);
  background: var(--accent-dim);
}

.nav-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.75;
}

.nav-item.active svg {
  opacity: 1;
}

.nav-badge {
  margin-left: auto;
  background: var(--accent-solid);
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
}

.nav-badge.info {
  background: var(--accent-dim);
  color: var(--accent);
}

.sidebar-footer {
  padding: var(--space-4);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.user-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--purple) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.833rem;
  font-weight: 700;
  flex-shrink: 0;
}

.user-info .user-name {
  font-size: 0.933rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.2;
}

.user-info .user-role {
  font-size: 0.833rem;
  color: var(--text-muted);
}

.sidebar-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

/* ============================================================
   Cards
   ============================================================ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: border-color var(--transition);
}

.card:hover {
  border-color: var(--border-light);
}

.card-sm {
  padding: var(--space-4);
  border-radius: var(--radius-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Metric Cards */
.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transition: all var(--transition);
}

.metric-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

.metric-label {
  font-size: 0.867rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.metric-value {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
  color: var(--text-primary);
}

.metric-delta {
  font-size: 0.867rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.metric-delta.up   { color: var(--success); }
.metric-delta.down { color: var(--error); }

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* Primary */
.btn-primary {
  background: var(--accent-solid);
  color: white;
  border-color: var(--accent-solid);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-solid-hover);
  border-color: var(--accent-solid-hover);
  box-shadow: 0 0 12px rgba(79, 156, 249, 0.35);
}

/* Secondary */
.btn-secondary {
  background: var(--surface-2);
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: var(--border-light);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) {
  color: var(--text-primary);
  background: var(--surface-2);
}

/* Success */
.btn-success {
  background: var(--success-solid);
  color: white;
  border-color: var(--success-solid);
}
.btn-success:hover:not(:disabled) {
  filter: brightness(1.1);
}

/* Danger */
.btn-danger {
  background: var(--error-dim);
  color: var(--error);
  border-color: var(--error);
}
.btn-danger:hover:not(:disabled) {
  background: var(--error-solid);
  color: white;
}

/* Warning */
.btn-warning {
  background: var(--warning-dim);
  color: var(--warning);
  border-color: var(--warning);
}
.btn-warning:hover:not(:disabled) {
  background: var(--warning);
  color: var(--text-inverse);
}

/* Sizes */
.btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: 0.867rem;
}

.btn-xs {
  padding: 3px 8px;
  font-size: 0.8rem;
  gap: 3px;
}

.btn-lg {
  padding: var(--space-3) var(--space-6);
  font-size: 1rem;
}

.btn-icon {
  padding: var(--space-2);
  width: 34px;
  height: 34px;
}

/* ============================================================
   Badges
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-sugerida      { background: var(--surface-3); color: var(--text-secondary); }
.badge-ajuste        { background: var(--warning-dim); color: var(--warning); }
.badge-aprovada      { background: var(--success-dim); color: var(--success); }
.badge-em_producao   { background: var(--accent-dim); color: var(--accent); }
.badge-publicado     { background: var(--success-dim); color: var(--success); }
.badge-publicada     { background: var(--purple-dim, rgba(139,92,246,0.15)); color: var(--purple, #8b5cf6); }
.badge-rejeitada     { background: var(--error-dim); color: var(--error); }
.badge-gerando       { background: var(--accent-dim); color: var(--accent); }
.badge-rascunho      { background: var(--surface-3); color: var(--text-secondary); }
.badge-falhou        { background: var(--error-dim); color: var(--error); }
.badge-em_revisao    { background: var(--info-dim); color: var(--info); }
.badge-ajuste_solicitado { background: var(--warning-dim); color: var(--warning); }
.badge-aprovado      { background: var(--success-dim); color: var(--success); }

.pauta-card-action-btn {
  font-size: 0.8rem;
  padding: 2px 8px;
}

.drawer-footer-em-producao {
  align-items: center;
}

.drawer-muted-hint {
  margin: 0;
  font-size: 0.867rem;
  color: var(--text-muted);
  flex: 1 1 200px;
}

/* Intent badges */
.badge-informacional { background: var(--info-dim); color: var(--info); }
.badge-transacional  { background: var(--success-dim); color: var(--success); }
.badge-comercial     { background: var(--warning-dim); color: var(--warning); }
.badge-navegacional  { background: var(--purple-dim); color: var(--purple); }

/* ============================================================
   Forms
   ============================================================ */

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-label-required::after {
  content: ' *';
  color: var(--error);
}

.form-input,
.form-textarea,
.form-select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  color: var(--text-primary);
  font-size: 1rem;
  transition: all var(--transition);
  width: 100%;
  outline: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  background: var(--surface);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%238B9BB0' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: var(--space-8);
}

.form-input-narrow {
  max-width: 6rem;
  width: auto;
}

.form-hint {
  font-size: 0.867rem;
  color: var(--text-muted);
}

.form-error {
  font-size: 0.867rem;
  color: var(--error);
}

.input-group {
  display: flex;
  gap: var(--space-3);
  align-items: flex-end;
}

.input-group .form-input {
  flex: 1;
}

/* ============================================================
   Grid
   ============================================================ */

.grid {
  display: grid;
  gap: var(--space-4);
}

.grid-1 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* ============================================================
   Flex utilities
   ============================================================ */

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.ml-auto { margin-left: auto; }

/* ============================================================
   Tabs
   ============================================================ */

.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-6);
}

.tab-item {
  padding: var(--space-3) var(--space-5);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.tab-item:hover {
  color: var(--text-primary);
}

.tab-item.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ============================================================
   Divider
   ============================================================ */

.divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-4) 0;
}

/* ============================================================
   Empty state
   ============================================================ */

.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-8);
  color: var(--text-secondary);
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  background: var(--surface-2);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
  color: var(--text-muted);
}

.empty-state-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

/* ============================================================
   Alerts / Toasts
   ============================================================ */

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  border: 1px solid transparent;
}

.alert-success { background: var(--success-dim); color: var(--success); border-color: rgba(34,197,94,0.2); }
.alert-error   { background: var(--error-dim); color: var(--error); border-color: rgba(239,68,68,0.2); }
.alert-warning { background: var(--warning-dim); color: var(--warning); border-color: rgba(245,158,11,0.2); }
.alert-info    { background: var(--accent-dim); color: var(--accent); border-color: rgba(79,156,249,0.2); }

.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}

.toast {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  max-width: 380px;
  font-size: 0.875rem;
}

.toast-icon { flex-shrink: 0; font-size: 1rem; }
.toast-message { flex: 1; }
.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  padding: 0;
  line-height: 1;
}

.toast.success { border-color: var(--success); }
.toast.error   { border-color: var(--error); }
.toast.warning { border-color: var(--warning); }

/* ============================================================
   Login page
   ============================================================ */

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-primary);
  background-image: radial-gradient(ellipse at 20% 50%, rgba(79,156,249,0.05) 0%, transparent 60%),
                    radial-gradient(ellipse at 80% 20%, rgba(168,85,247,0.05) 0%, transparent 60%);
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-10);
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}

.login-brand {
  text-align: center;
  margin-bottom: var(--space-8);
}

.login-brand .brand-mark {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent) 0%, #7C3AED 100%);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
}

.login-brand .brand-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text-primary);
}

.login-brand .brand-tagline {
  font-size: 0.933rem;
  color: var(--text-muted);
  margin-top: var(--space-1);
}

/* ============================================================
   Misc utilities
   ============================================================ */

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.min-w-0 { min-width: 0; }
.show-mobile { display: none; }

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

.rounded-full { border-radius: var(--radius-full); }

.p-0 { padding: 0; }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

.w-full  { width: 100%; }
.h-full  { height: 100%; }

.cursor-pointer { cursor: pointer; }
.select-none    { user-select: none; }

/* Scrollbar */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

[x-cloak] { display: none !important; }

.pre-wrap { white-space: pre-wrap; word-break: break-word; }

.spinner-xs { width: 12px; height: 12px; border-width: 2px; display: inline-block; }
.spinner-lg { width: 36px; height: 36px; border-width: 3px; }

/* Pill de status pequeno ao lado de títulos */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}
.pill-success { background: var(--success-dim); color: var(--success); }
.pill-warning { background: var(--warning-dim); color: var(--warning); }
.pill-error   { background: var(--error-dim); color: var(--error); }

/* Checkbox com texto explicativo */
.form-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: 0.875rem;
  color: var(--text-primary);
  cursor: pointer;
  margin-bottom: var(--space-4);
}
.form-check input { margin-top: 3px; flex-shrink: 0; }
.form-check .form-hint { display: block; margin-top: 2px; }

/* Linha de carregamento e vazio dentro de listas */
.list-loading {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  color: var(--text-muted);
  font-size: 0.875rem;
}
.empty-inline {
  padding: var(--space-8) var(--space-5);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Loading spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* Priority bar */
.priority-bar {
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--surface-3);
  overflow: hidden;
}

.priority-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--accent);
  transition: width var(--transition-slow);
}

.priority-fill.high   { background: var(--success); }
.priority-fill.medium { background: var(--warning); }
.priority-fill.low    { background: var(--text-muted); }
