/* ==========================================================
   OPERA PIXEL STUDIO — Design System
   Dark mode · Glassmorphism (iOS/Apple) · Game UI · Futurismo leve
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Paleta oficial */
  --mango: #BF9706;
  --mango-soft: rgba(191, 151, 6, 0.16);
  --noturna: #141821;
  --vibranium: #222733;
  --prata: #819196;
  --branco: #ffffff;

  /* Superfícies de vidro */
  --glass-bg: rgba(34, 39, 51, 0.55);
  --glass-bg-strong: rgba(34, 39, 51, 0.75);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-highlight: rgba(255, 255, 255, 0.04);

  /* Status */
  --status-andamento: #4C8DFF;
  --status-entregar: var(--mango);
  --status-atrasado: #E15554;
  --status-entregue: #37B679;
  --status-nao-entregue: #5B6770;
  --status-urgente: #FF3B81;

  /* Tipografia */
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Layout */
  --sidebar-w: 264px;
  --sidebar-w-collapsed: 96px;
  --gap-shell: 35px;
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --radius-pill: 999px;

  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(1200px 800px at 85% -10%, rgba(191, 151, 6, 0.08), transparent 60%),
              radial-gradient(900px 700px at -10% 110%, rgba(76, 141, 255, 0.06), transparent 55%),
              var(--noturna);
  color: var(--branco);
  font-family: var(--font-body);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .display {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
  margin: 0;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; border-radius: var(--radius-md); display: block; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: var(--radius-pill); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Ícones de linha (lucide) ---------- */
.icon {
  stroke: var(--prata);
  stroke-width: 1.6;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.icon-accent { stroke: var(--mango); }
.icon-white { stroke: var(--branco); }

/* ---------- App Shell ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar fixa e retrátil ---------- */
.sidebar {
  position: fixed;
  top: var(--gap-shell);
  left: var(--gap-shell);
  bottom: var(--gap-shell);
  width: var(--sidebar-w);
  padding: 26px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: 35px;
  box-shadow: 0 14px 34px rgba(0,0,0,0.32), inset 0 1px 0 rgba(255,255,255,0.04);
  z-index: 40;
  overflow-x: hidden;
  overflow-y: auto;
  transition: width 0.25s ease;
}

html.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }

.sidebar-top { display: flex; flex-direction: column; gap: 10px; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px;
}

.sidebar-toggle-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--prata);
  opacity: 0.55;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  width: 100%;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.sidebar-toggle-btn:hover { opacity: 1; background: var(--glass-highlight); color: var(--branco); }
.sidebar-toggle-btn .icon { width: 16px; height: 16px; transition: transform 0.25s ease; }
html.sidebar-collapsed .sidebar-toggle-btn .icon { transform: rotate(180deg); }
html.sidebar-collapsed .sidebar-toggle-btn { justify-content: center; }

.sidebar-brand .logo-mark {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: linear-gradient(145deg, var(--mango), #8a6c04);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--noturna);
  box-shadow: 0 6px 18px rgba(191, 151, 6, 0.35);
}

.sidebar-brand .brand-text { line-height: 1.1; }
.sidebar-brand .brand-text strong { font-family: var(--font-display); font-size: 15px; }
.sidebar-brand .brand-text span { font-size: 11px; color: var(--prata); letter-spacing: 0.04em; text-transform: uppercase; }

.nav-group { display: flex; flex-direction: column; gap: 6px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--prata); padding: 8px 12px 4px; white-space: nowrap; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--prata);
  white-space: nowrap;
  border: none;
  width: 100%;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.nav-text, .sidebar-footer .brand-text { transition: opacity 0.15s ease; }

html.sidebar-collapsed .nav-item { justify-content: center; padding: 11px 0; }
html.sidebar-collapsed .nav-text,
html.sidebar-collapsed .nav-label,
html.sidebar-collapsed .sidebar-brand .brand-text,
html.sidebar-collapsed .sidebar-footer .brand-text {
  display: none;
}
html.sidebar-collapsed .sidebar-brand { justify-content: center; padding: 4px 0; }
html.sidebar-collapsed .sidebar-footer { justify-content: center; padding: 14px 8px; }

.nav-item:hover { background: var(--glass-highlight); color: var(--branco); }

.nav-item.active {
  color: var(--branco);
  background: linear-gradient(135deg, var(--mango-soft), rgba(255,255,255,0.02));
  border: 1px solid rgba(191, 151, 6, 0.35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.nav-item.active .icon { stroke: var(--mango); }

.sidebar-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-footer {
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-pixel {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  background: var(--vibranium);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--mango);
}

/* ---------- Conteúdo principal ---------- */
.main-content {
  margin-left: calc(var(--sidebar-w) + var(--gap-shell) + var(--gap-shell));
  flex: 1;
  padding: var(--gap-shell) 40px 60px;
  max-width: 1400px;
  transition: margin-left 0.25s ease;
}

html.sidebar-collapsed .main-content {
  margin-left: calc(var(--sidebar-w-collapsed) + var(--gap-shell) + var(--gap-shell));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
  gap: 20px;
}

.topbar h1 { font-size: 26px; font-weight: 700; }
.topbar .subtitle { color: var(--prata); font-size: 13.5px; margin-top: 4px; }

.search-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  min-width: 280px;
}
.search-pill input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--branco);
  font-family: var(--font-body);
  font-size: 13.5px;
  width: 100%;
}
.search-pill input::placeholder { color: var(--prata); }

/* ---------- Cards de vidro ---------- */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.04);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.glass-card:hover { border-color: rgba(191, 151, 6, 0.28); }

/* ---------- Grids ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
  margin-bottom: 30px;
}

.stat-card { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.stat-card .stat-icon-wrap {
  width: 42px; height: 42px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
}
.stat-card .stat-value { font-family: var(--font-display); font-size: 30px; font-weight: 700; }
.stat-card .stat-label { color: var(--prata); font-size: 13px; }
.stat-card .stat-delta { font-size: 12px; font-weight: 600; }
.stat-delta.up { color: var(--status-entregue); }
.stat-delta.down { color: var(--status-atrasado); }

.stat-card.accent-andamento .stat-icon-wrap .icon { stroke: var(--status-andamento); }
.stat-card.accent-entregar .stat-icon-wrap .icon { stroke: var(--status-entregar); }
.stat-card.accent-atrasado .stat-icon-wrap .icon { stroke: var(--status-atrasado); }
.stat-card.accent-entregue .stat-icon-wrap .icon { stroke: var(--status-entregue); }
.stat-card.accent-nao-entregue .stat-icon-wrap .icon { stroke: var(--status-nao-entregue); }
.stat-card.accent-urgente .stat-icon-wrap .icon { stroke: var(--status-urgente); }

/* ---------- Seções ---------- */
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 34px 0 16px;
}
.section-heading h2 { font-size: 17px; font-weight: 600; }
.section-heading .count-pill {
  font-size: 12px;
  color: var(--prata);
  background: var(--vibranium);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  margin-left: 8px;
}

.pedidos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.pedido-card { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.pedido-card .pedido-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pedido-card .pedido-titulo { font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.pedido-card .pedido-cliente { font-size: 12.5px; color: var(--prata); margin-top: 3px; }

.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge-andamento { color: var(--status-andamento); background: rgba(76,141,255,0.12); border-color: rgba(76,141,255,0.3); }
.badge-entregar { color: var(--status-entregar); background: var(--mango-soft); border-color: rgba(191,151,6,0.35); }
.badge-atrasado { color: var(--status-atrasado); background: rgba(225,85,84,0.12); border-color: rgba(225,85,84,0.32); }
.badge-entregue { color: var(--status-entregue); background: rgba(55,182,121,0.12); border-color: rgba(55,182,121,0.32); }

.progress-track {
  height: 6px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.progress-fill { height: 100%; border-radius: var(--radius-pill); background: linear-gradient(90deg, var(--mango), #e8c34a); }

.pedido-meta { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--prata); }
.pedido-valor { font-family: var(--font-display); font-weight: 700; color: var(--branco); font-size: 15px; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--mango), #a17f05);
  color: var(--noturna);
  box-shadow: 0 8px 20px rgba(191, 151, 6, 0.3);
}
.btn-primary:hover { box-shadow: 0 10px 26px rgba(191, 151, 6, 0.42); }

.btn-ghost {
  background: var(--glass-bg);
  border-color: var(--glass-border);
  color: var(--branco);
}
.btn-ghost:hover { border-color: rgba(191,151,6,0.4); }

.btn-icon {
  width: 38px; height: 38px; padding: 0;
  border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
}

/* ---------- Clientes ---------- */
.clientes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.cliente-card { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.cliente-top { display: flex; align-items: center; gap: 12px; }
.cliente-avatar {
  width: 48px; height: 48px;
  border-radius: var(--radius-pill);
  background: linear-gradient(145deg, var(--vibranium), #1a1e28);
  border: 1px solid var(--glass-border);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; color: var(--mango); font-size: 15px;
}
.cliente-nome { font-weight: 600; font-size: 14.5px; }
.cliente-empresa { font-size: 12.5px; color: var(--prata); }
.cliente-info-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--prata); }
.cliente-status-dot { width: 8px; height: 8px; border-radius: var(--radius-pill); }
.status-dot-ativo { background: var(--status-entregue); }
.status-dot-inativo { background: var(--prata); }

/* ---------- Serviços ---------- */
.servicos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
}
.servico-card { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.servico-icon-wrap {
  width: 46px; height: 46px;
  border-radius: var(--radius-md);
  background: var(--mango-soft);
  border: 1px solid rgba(191,151,6,0.3);
  display: flex; align-items: center; justify-content: center;
}
.servico-icon-wrap .icon { stroke: var(--mango); width: 22px; height: 22px; }
.servico-nome { font-weight: 600; font-size: 15px; }
.servico-categoria { font-size: 11.5px; color: var(--prata); text-transform: uppercase; letter-spacing: 0.05em; }
.servico-desc { font-size: 12.5px; color: var(--prata); line-height: 1.5; }
.servico-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.servico-preco { font-family: var(--font-display); font-weight: 700; }
.servico-prazo { font-size: 11.5px; color: var(--prata); }

/* ---------- Financeiro ---------- */
.finance-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 30px;
}
.finance-card { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.finance-card .finance-label { font-size: 12px; color: var(--prata); }
.finance-card .finance-value { font-family: var(--font-display); font-size: 22px; font-weight: 700; }

.charts-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
  margin-bottom: 30px;
}
.chart-card { padding: 24px; }
.chart-card h3 { font-size: 14.5px; font-weight: 600; margin-bottom: 18px; }

.lancamentos-table { width: 100%; border-collapse: collapse; }
.lancamentos-table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--prata); padding: 10px 14px; border-bottom: 1px solid var(--glass-border);
}
.lancamentos-table td { padding: 13px 14px; font-size: 13.5px; border-bottom: 1px solid rgba(255,255,255,0.04); }
.lancamentos-table tr:last-child td { border-bottom: none; }

/* ---------- Modal simples ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(10,12,16,0.6);
  backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; z-index: 100;
}
.modal-backdrop.open { display: flex; }
.modal-box {
  width: 420px; max-width: 92vw;
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 26px;
  backdrop-filter: blur(28px);
}
.modal-box h3 { margin-bottom: 18px; }
.form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-field label { font-size: 12px; color: var(--prata); }
.form-field input, .form-field select, .form-field textarea {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--branco);
  font-family: var(--font-body);
  font-size: 13.5px;
  outline: none;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--mango); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

/* ---------- Responsivo ---------- */
@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .finance-grid { grid-template-columns: repeat(3, 1fr); }
  .charts-row { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); }
  .main-content { margin-left: 0; padding: 24px; }
  .finance-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Abas (tabs) ---------- */
.tabs-nav {
  display: inline-flex;
  gap: 6px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 6px;
  border-radius: var(--radius-pill);
  margin-bottom: 26px;
}
.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--font-body);
  color: var(--prata);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.tab-btn:hover { color: var(--branco); }
.tab-btn.active {
  color: var(--noturna);
  background: linear-gradient(135deg, var(--mango), #e8c34a);
  box-shadow: 0 6px 16px rgba(191,151,6,0.28);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: tabFadeIn 0.2s ease; }
@keyframes tabFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Ações de card (editar / excluir / visualizar) ---------- */
.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.card-action-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.card-action-btn .icon { width: 15px; height: 15px; }
.card-action-btn:hover { border-color: rgba(191,151,6,0.42); background: var(--mango-soft); }
.card-action-btn:hover .icon { stroke: var(--mango); }
.card-action-btn.danger:hover { border-color: rgba(225,85,84,0.42); background: rgba(225,85,84,0.12); }
.card-action-btn.danger:hover .icon { stroke: var(--status-atrasado); }
a.card-action-btn { text-decoration: none; }

/* ---------- Kanban (Organizador) ---------- */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(230px, 1fr));
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 12px;
}
.kanban-column {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.kanban-column.drag-over {
  border-color: rgba(191,151,6,0.5);
  background: var(--mango-soft);
}
.kanban-column-header { display: flex; align-items: center; gap: 8px; }
.kanban-dot { width: 9px; height: 9px; border-radius: var(--radius-pill); flex-shrink: 0; }
.kanban-column-header h4 { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; flex: 1; }
.kanban-count { font-size: 11px; color: var(--prata); background: var(--vibranium); padding: 2px 9px; border-radius: var(--radius-pill); }

.kanban-cards { display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 60px; }
.kanban-card {
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: grab;
  transition: transform 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging { opacity: 0.35; }
.kanban-card:hover { border-color: rgba(191,151,6,0.3); }
.kanban-card-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 10px;
  background: linear-gradient(160deg, var(--vibranium), #171b24);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.kanban-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kanban-card-media .icon { width: 18px; height: 18px; opacity: 0.4; stroke: var(--prata); }

.kanban-card-titulo { font-size: 13.5px; font-weight: 600; margin-bottom: 6px; line-height: 1.3; }
.kanban-card-meta { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--prata); }

.dot-andamento { background: var(--status-andamento); }
.dot-entregue { background: var(--status-entregue); }
.dot-atrasado { background: var(--status-atrasado); }
.dot-nao_entregue { background: var(--status-nao-entregue); }
.dot-urgente { background: var(--status-urgente); }

/* ---------- Página de detalhe (visualizar) ---------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--prata);
  font-size: 13px;
  margin-bottom: 20px;
}
.back-link:hover { color: var(--branco); }
.detail-hero { padding: 36px; margin-bottom: 22px; }
.detail-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.detail-eyebrow { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--mango); margin-bottom: 6px; }
.detail-title { font-size: 28px; font-weight: 700; }
.detail-subtitle { color: var(--prata); font-size: 14px; margin-top: 8px; line-height: 1.6; }
.detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 18px;
  margin-top: 8px;
  padding-top: 22px;
  border-top: 1px solid var(--glass-border);
}
.detail-meta-item { display: flex; flex-direction: column; gap: 5px; }
.detail-meta-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--prata); }
.detail-meta-value { font-size: 14.5px; font-weight: 600; }
.detail-section { padding: 28px; margin-bottom: 18px; }
.detail-section h3 { font-size: 15px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.detail-section p { color: var(--prata); font-size: 13.5px; line-height: 1.75; white-space: pre-line; }

/* ---------- Modal de confirmação de exclusão ---------- */
.confirm-box { width: 380px; text-align: center; }
.confirm-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-pill);
  background: rgba(225,85,84,0.14);
  border: 1px solid rgba(225,85,84,0.35);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.confirm-icon .icon { stroke: var(--status-atrasado); width: 24px; height: 24px; }
.confirm-box p { color: var(--prata); font-size: 13.5px; margin: 0 0 20px; line-height: 1.6; }
.confirm-box .modal-actions { justify-content: center; }

/* ---------- Formulários maiores (2 colunas) ---------- */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.modal-box.modal-lg { width: 560px; max-width: 94vw; max-height: 86vh; overflow-y: auto; }

/* ---------- Responsivo (adições) ---------- */
@media (max-width: 1180px) {
  .kanban-board { grid-template-columns: repeat(5, minmax(220px, 1fr)); }
}
@media (max-width: 860px) {
  .form-grid-2 { grid-template-columns: 1fr; }
}

/* ---------- Badges extras (status de Projetos) ---------- */
.badge-nao-entregue { color: var(--status-nao-entregue); background: rgba(91,103,112,0.18); border-color: rgba(91,103,112,0.4); }
.badge-urgente { color: var(--status-urgente); background: rgba(255,59,129,0.14); border-color: rgba(255,59,129,0.35); }

/* ---------- Cards de projeto ---------- */
.projeto-card { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.projeto-card .projeto-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.projeto-card .projeto-nome { font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.projeto-card .projeto-cliente { font-size: 12.5px; color: var(--prata); margin-top: 3px; }
.projeto-card .projeto-desc { font-size: 12.5px; color: var(--prata); line-height: 1.55; }
.projeto-card .projeto-datas { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--prata); }

/* ==========================================================
   Padrão unificado de card — Projetos, Clientes e Serviços
   Proporção 3:4, imagem de capa/avatar no topo
   ========================================================== */
.entity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}

.entity-card { padding: 12px; display: flex; flex-direction: column; gap: 12px; }

.card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: linear-gradient(160deg, var(--vibranium), #171b24);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }

.media-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--prata);
}
.media-placeholder .icon { width: 32px; height: 32px; opacity: 0.5; }
.media-placeholder span { font-size: 10.5px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; opacity: 0.7; }

.avatar-placeholder-lg {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 40px;
  color: var(--mango);
}

.card-media-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(20, 24, 33, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
}
.card-media-price {
  position: absolute;
  bottom: 10px;
  left: 10px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(191, 151, 6, 0.88);
  color: var(--noturna);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
}
.card-media-status-dot {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 10px; height: 10px;
  border-radius: var(--radius-pill);
  border: 2px solid rgba(20,24,33,0.7);
}

.card-body { display: flex; flex-direction: column; gap: 6px; }
.card-body .card-title { font-size: 14px; font-weight: 600; line-height: 1.3; }
.card-body .card-subtitle { font-size: 12px; color: var(--prata); }
.card-body .card-meta-row { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--prata); }

/* Upload de imagem nos formulários (capa / avatar) */
.image-upload-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.image-upload-preview {
  width: 100%;
  aspect-ratio: 3 / 4;
  max-width: 160px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: var(--vibranium);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--prata);
}
.image-upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.image-upload-preview .icon { width: 26px; height: 26px; opacity: 0.5; }
.image-upload-field input[type="file"] {
  font-size: 12.5px;
  color: var(--prata);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
}

/* ==========================================================
   Página Início — Bento Grid (carrosséis + cards de gráfico)
   ========================================================== */
.carousel-row {
  display: grid;
  grid-template-columns: minmax(300px, 700px) 1fr;
  gap: 18px;
  align-items: stretch;
  margin-bottom: 30px;
}

.carousel-block { padding: 22px; display: flex; flex-direction: column; gap: 16px; }

.carousel-header { display: flex; align-items: center; justify-content: space-between; }
.carousel-header h2 { font-size: 17px; font-weight: 600; }

.carousel-nav { display: flex; gap: 8px; }
.carousel-btn { width: 34px; height: 34px; }
.carousel-btn .icon { width: 16px; height: 16px; }

.carousel-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track .carousel-card {
  flex: 0 0 calc((100% - 32px) / 3);
  scroll-snap-align: start;
  min-width: 150px;
}

/* Card de gráfico do Bento Grid — se estende até o final da linha */
.chart-bento-card {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.chart-bento-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.chart-bento-header h3 { font-size: 14.5px; font-weight: 600; }

.period-toggle {
  display: inline-flex;
  gap: 4px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 4px;
  border-radius: var(--radius-pill);
}
.period-btn {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 600;
  font-family: var(--font-body);
  color: var(--prata);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.period-btn:hover { color: var(--branco); }
.period-btn.active {
  color: var(--noturna);
  background: linear-gradient(135deg, var(--mango), #e8c34a);
}

.chart-bento-canvas-wrap { flex: 1; min-height: 220px; position: relative; }
.chart-bento-canvas-wrap canvas { width: 100% !important; height: 100% !important; }

@media (max-width: 1180px) {
  .carousel-row { grid-template-columns: 1fr; }
  .carousel-track .carousel-card { flex: 0 0 calc((100% - 32px) / 2); }
}
@media (max-width: 640px) {
  .carousel-track .carousel-card { flex: 0 0 calc(100% - 16px); }
}
