:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #e11d48;
  --primary-hover: #be123c;
  --primary-soft: #ffe4e6;
  --secondary: #4f46e5;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --sidebar-bg: #1e1b4b;
  --sidebar-text: #e0e7ff;
  --radius: 12px;
  --shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

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

.hidden {
  display: none !important;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Botoes e Formularios */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.65rem 1.15rem;
  border-radius: 9px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 40px;
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  min-height: 36px;
}

.btn-xs {
  padding: 0.25rem 0.65rem;
  font-size: 0.78rem;
  min-height: 30px;
}

.btn-block {
  width: 100%;
}

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

.btn-secondary {
  background: var(--surface-alt);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: #e2e8f0;
}

.btn-outline {
  background: transparent;
  color: inherit;
  border-color: var(--border);
}
.btn-outline:hover {
  background: rgba(15, 23, 42, 0.05);
}

.btn-danger-outline {
  background: transparent;
  color: var(--danger);
  border-color: #fecaca;
}
.btn-danger-outline:hover {
  background: #fef2f2;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.35rem;
  margin-top: 0.75rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.92rem;
  background: #fff;
  color: var(--text);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: 2px solid var(--primary);
  border-color: transparent;
}

.input-sm {
  padding: 0.42rem 0.7rem;
  font-size: 0.85rem;
}

.form-help,
.muted-small {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-bottom: 1rem;
}
.alert-danger {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.alert-info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* Landing Page */
.landing-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.brand-badge {
  font-size: 1.7rem;
  background: var(--primary-soft);
  width: 44px;
  height: 44px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-title {
  display: block;
  font-size: 1.05rem;
  color: var(--text);
}
.brand-sub {
  font-size: 0.8rem;
  color: var(--muted);
}
.landing-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
}
.landing-nav a:not(.btn) {
  color: #334155;
}
.hero {
  padding: 4.5rem 0;
  background: linear-gradient(135deg, #fff1f2 0%, #ffffff 55%, #f5f3ff 100%);
  border-bottom: 1px solid var(--border);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.5rem;
  align-items: center;
}
.pill {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-hover);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.hero h1 {
  font-size: 2.5rem;
  line-height: 1.15;
  margin-bottom: 1rem;
  color: #0f172a;
}
.hero p {
  font-size: 1.08rem;
  color: #475569;
  margin-bottom: 1.5rem;
}
.hero-actions {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
}
.hero-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.6rem;
  box-shadow: var(--shadow);
}
.hero-card-badge {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  margin-bottom: 1rem;
}
.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.feature-list li {
  display: flex;
  gap: 0.8rem;
}
.feature-list p {
  font-size: 0.86rem;
  margin: 0.15rem 0 0;
}
.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}
.dot-rose { background: #e11d48; }
.dot-purple { background: #7c3aed; }
.dot-amber { background: #d97706; }

.section { padding: 4rem 0; }
.section-muted { background: #f1f5f9; }
.section-title { font-size: 1.65rem; margin-bottom: 1.75rem; text-align: center; }
.cards-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}
.info-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.info-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.info-card h3 { margin-bottom: 0.5rem; }
.info-card p { color: var(--muted); font-size: 0.92rem; }
.location-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  background: #fff;
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid var(--border);
}
.location-line { margin-top: 0.45rem; color: #334155; }
.landing-footer {
  padding: 1.75rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-link { color: var(--muted); }

/* Telas de Autenticacao (Portaria, Login, 2FA) */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: linear-gradient(135deg, #1e1b4b 0%, #31102f 100%);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
.auth-card-wide { max-width: 500px; }
.auth-header {
  text-align: center;
  margin-bottom: 1.25rem;
}
.auth-icon {
  display: inline-flex;
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.auth-header h1 { font-size: 1.4rem; margin-bottom: 0.25rem; }
.auth-header p { font-size: 0.88rem; color: var(--muted); }
.auth-form button { margin-top: 1.2rem; }
.auth-footer {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.85rem;
}
.qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.qr-img { width: 190px; height: 190px; border-radius: 8px; }
.qr-manual {
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}
.qr-manual code {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.08em;
}
.input-code {
  font-size: 1.35rem;
  text-align: center;
  letter-spacing: 0.25em;
  font-weight: 700;
}
.recovery-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  background: #f1f5f9;
  padding: 1rem;
  border-radius: 10px;
  margin: 1rem 0;
}
.recovery-code {
  background: #fff;
  padding: 0.45rem;
  border-radius: 6px;
  text-align: center;
  font-weight: 700;
  border: 1px solid var(--border);
}

/* Layout do Painel Principal */
.app-body {
  display: grid;
  grid-template-columns: 260px 1fr;
  height: 100vh;
  overflow: hidden;
}
.sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 1rem;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.sidebar-brand strong { display: block; font-size: 0.98rem; color: #fff; }
.sidebar-brand span { font-size: 0.76rem; opacity: 0.75; }
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 1rem;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.8rem;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--sidebar-text);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.08); }
.nav-item.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}
.sidebar-boards {
  margin-top: 1.4rem;
  flex: 1;
  overflow-y: auto;
}
.sidebar-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  opacity: 0.75;
  margin-bottom: 0.5rem;
}
.btn-icon {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
}
.boards-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.board-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.7rem;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.86rem;
  color: var(--sidebar-text);
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}
.board-item:hover { background: rgba(255, 255, 255, 0.08); }
.board-item.active {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-weight: 600;
}
.board-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}
.sidebar-footer {
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.user-chip { display: flex; align-items: center; gap: 0.55rem; }
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}
.user-meta strong { display: block; font-size: 0.82rem; color: #fff; }
.user-meta span { font-size: 0.7rem; opacity: 0.7; }

/* Area Principal */
.main-area {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.topbar-left h1 { font-size: 1.25rem; }
.topbar-sub { font-size: 0.82rem; color: var(--muted); }
.topbar-Controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.topbar-Controls .form-input,
.topbar-Controls .form-select {
  width: auto;
  min-width: 170px;
}

.tab-panel {
  display: none;
  flex: 1;
  overflow: auto;
}
.tab-panel.active {
  display: flex;
  flex-direction: column;
}

/* Kanban Board */
.board-toolbar {
  padding: 0.75rem 1.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}
.board-folder-pill {
  font-size: 0.83rem;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.board-actions { display: flex; gap: 0.5rem; }

.kanban-board {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.4rem;
  overflow-x: auto;
  flex: 1;
}
.kanban-col {
  width: 310px;
  min-width: 310px;
  max-height: calc(100vh - 165px);
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
}
.kanban-col-header {
  padding: 0.75rem 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
.col-count {
  background: #e2e8f0;
  color: #475569;
  font-size: 0.75rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  margin-left: 0.4rem;
}
.kanban-cards {
  padding: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  overflow-y: auto;
  min-height: 60px;
}
.kanban-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.75rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.kanban-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
}
.kanban-card.done { opacity: 0.65; }
.card-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.45rem;
}
.label-chip {
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
}
.card-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.45rem;
  color: #0f172a;
}
.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.badge-prio {
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.7rem;
}
.prio-URGENTE { background: #fef2f2; color: #dc2626; }
.prio-ALTA { background: #fff7ed; color: #ea580c; }
.prio-NORMAL { background: #eff6ff; color: #2563eb; }
.prio-BAIXA { background: #f1f5f9; color: #64748b; }

.badge-due {
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: #f1f5f9;
}
.badge-due.overdue {
  background: #fef2f2;
  color: #dc2626;
  font-weight: 700;
}
.col-footer {
  padding: 0.55rem 0.65rem;
  border-top: 1px solid rgba(15, 23, 42, 0.05);
}

/* Explorador de Arquivos */
.files-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  flex: 1;
  overflow: hidden;
}
.folders-pane {
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 1rem;
  overflow-y: auto;
}
.files-pane {
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.pane-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}
.folder-tree {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.folder-node {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.86rem;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  color: var(--text);
}
.folder-node:hover { background: var(--surface-alt); }
.folder-node.active {
  background: var(--primary-soft);
  color: var(--primary-hover);
  font-weight: 600;
}
.dropzone-bar {
  border: 2px dashed #cbd5e1;
  background: #fff;
  border-radius: 12px;
  padding: 1.1rem;
  text-align: center;
  font-size: 0.86rem;
  color: var(--muted);
}
.dropzone-bar.dragover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-hover);
}
.files-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.files-table th,
.files-table td {
  padding: 0.7rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.86rem;
}
.files-table th {
  background: #f8fafc;
  font-size: 0.78rem;
  text-transform: uppercase;
  color: var(--muted);
}

/* Painel Prazos, Atividades e Equipe */
.panel-pad { padding: 1.4rem; }
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.25rem;
}
.card-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.stat-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
}
.stat-box strong { display: block; font-size: 1.5rem; }
.stat-box span { font-size: 0.82rem; color: var(--muted); }

.activity-feed,
.deadlines-list,
.users-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.85rem;
}
.feed-item,
.user-row {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.88rem;
}

/* Modais */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 50;
}
.modal-dialog {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}
.modal-lg { max-width: 860px; }
.modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.modal-title-input {
  font-size: 1.15rem;
  font-weight: 700;
  border: 1px solid transparent;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  width: 100%;
}
.modal-title-input:focus {
  border-color: var(--primary);
  outline: none;
}
.btn-close {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--muted);
}
.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
}
.modal-grid {
  display: grid;
  grid-template-columns: 1.55fr 0.95fr;
  gap: 1.5rem;
}
.modal-section {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.inline-add {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.checklist-box,
.attachments-box,
.comments-box {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.5rem;
}
.check-row,
.attach-row,
.comment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  background: #f8fafc;
  border-radius: 7px;
  font-size: 0.86rem;
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
}
.labels-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}
.label-toggle {
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  opacity: 0.4;
  border: 2px solid transparent;
}
.label-toggle.selected {
  opacity: 1;
  border-color: #0f172a;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.2rem;
}

@media (max-width: 900px) {
  .hero-grid,
  .app-body,
  .files-layout,
  .modal-grid {
    grid-template-columns: 1fr;
  }
  .app-body { height: auto; overflow: visible; }
}
