/* =========================================================
   SWC PMO · projects.css — Módulo Projetos
   Toolbar (filtros + search), tabela, badges, modal, drawer.
========================================================= */

/* ── Container e toolbar ──────────────────────────── */
.pmo-projects {
  display: flex; flex-direction: column; gap: 16px;
}

.pmo-projects__toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px 14px;
}
.pmo-projects__filters { display: flex; gap: 8px; flex-wrap: wrap; }
.pmo-projects__search {
  flex: 1; min-width: 220px; max-width: 360px;
  background: #0f172a; border: 1px solid #161b27; color: #e5e7eb;
  padding: 8px 12px; border-radius: 10px; font-size: 13px;
  font-family: inherit;
}
.pmo-projects__search:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(214, 168, 79, .15); }

.pmo-chip {
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .08);
  color: var(--muted);
  padding: 6px 12px; border-radius: 99px;
  font-size: 12px; font-weight: 700;
  cursor: pointer; transition: all .15s;
}
.pmo-chip:hover { color: #e5e7eb; border-color: rgba(255, 255, 255, .18); }
.pmo-chip.active {
  background: color-mix(in srgb, var(--c, #fbbf24) 16%, transparent);
  color: var(--c, #fbbf24);
  border-color: color-mix(in srgb, var(--c, #fbbf24) 35%, transparent);
}

/* ── Tabela de projetos ───────────────────────────── */
.pmo-projects__list {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 4px;
  overflow: hidden;
}

.pmo-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.pmo-table th {
  text-align: left; padding: 12px 14px; font-size: 11px;
  color: var(--muted); border-bottom: 1px solid var(--border);
  text-transform: uppercase; letter-spacing: .05em; font-weight: 800;
  background: rgba(255, 255, 255, .015);
}
.pmo-table td {
  padding: 12px 14px; border-bottom: 1px solid rgba(255, 255, 255, .03);
  font-size: 13.5px; color: #e5e7eb; vertical-align: middle;
}
.pmo-table tr:last-child td { border-bottom: 0; }
.pmo-table tr.pmo-row { cursor: pointer; transition: background .12s; }
.pmo-table tr.pmo-row:hover { background: rgba(214, 168, 79, .045); }
.pmo-table code { background: rgba(255, 255, 255, .06); padding: 2px 7px; border-radius: 5px; font-size: 12px; color: #fbbf24; font-family: 'JetBrains Mono', ui-monospace, monospace; }
.pmo-table .muted { color: var(--muted); font-size: 11.5px; }

.pmo-badge {
  display: inline-block;
  padding: 3px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 800; letter-spacing: .02em;
  background: color-mix(in srgb, var(--c, #8892a4) 14%, transparent);
  color: var(--c, #cbd5e1);
  border: 1px solid color-mix(in srgb, var(--c, #8892a4) 32%, transparent);
  white-space: nowrap;
}

.pmo-progress {
  width: 100%; max-width: 120px;
  height: 6px; background: rgba(255, 255, 255, .06);
  border-radius: 99px; overflow: hidden;
  display: inline-block; vertical-align: middle;
}
.pmo-progress.small { max-width: 100%; height: 4px; margin-top: 4px; }
.pmo-progress i {
  display: block; height: 100%; border-radius: 99px;
  background: var(--gold); transition: width .4s;
}
.pmo-progress__lbl {
  display: inline-block; margin-left: 6px;
  font-size: 11.5px; color: var(--muted); font-weight: 700;
  vertical-align: middle;
}

.pmo-row__actions { text-align: right; white-space: nowrap; }
.pmo-row__actions button {
  background: rgba(255, 255, 255, .04); color: var(--muted);
  border: 1px solid rgba(255, 255, 255, .08);
  width: 28px; height: 28px; border-radius: 6px; padding: 0;
  font-size: 12px; cursor: pointer; margin-left: 4px;
  transition: all .15s;
}
.pmo-row__actions button:hover { background: rgba(214, 168, 79, .12); color: var(--gold); border-color: rgba(214, 168, 79, .3); }

/* ── Modal CRUD ───────────────────────────────────── */
.pmo-modal {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(5, 8, 22, .75); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: pmoFadeIn .15s ease-out;
}
.pmo-modal__box {
  width: min(680px, 100%);
  max-height: calc(100vh - 40px);
  background: linear-gradient(180deg, #0f172a, #08132c);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.pmo-modal__box header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.pmo-modal__box header h3 { margin: 0; font-size: 17px; font-weight: 900; }
.pmo-modal__close {
  background: rgba(255, 255, 255, .05); color: var(--muted);
  border: 1px solid rgba(255, 255, 255, .08);
  width: 30px; height: 30px; border-radius: 8px; padding: 0;
  cursor: pointer; font-size: 18px; line-height: 1;
}
.pmo-modal__close:hover { background: rgba(239, 68, 68, .15); color: #f87171; }

.pmo-form {
  display: flex; flex-direction: column; gap: 14px;
  padding: 20px 22px; overflow-y: auto;
}
.pmo-form__grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
.pmo-form__cell, .pmo-form__row { display: flex; flex-direction: column; gap: 6px; }
.pmo-form__row { grid-column: 1 / -1; }
.pmo-form__cell span, .pmo-form__row span {
  font-size: 11.5px; font-weight: 700; color: var(--muted);
  letter-spacing: .03em;
}
.pmo-form__cell input, .pmo-form__cell select, .pmo-form__row textarea {
  background: #0f172a; border: 1px solid #161b27; color: #e5e7eb;
  padding: 9px 11px; border-radius: 9px; font-size: 13px;
  font-family: inherit; resize: vertical;
}
.pmo-form__cell input:focus, .pmo-form__cell select:focus, .pmo-form__row textarea:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(214, 168, 79, .12);
}
.pmo-form footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 22px; border-top: 1px solid rgba(255, 255, 255, .05);
  background: rgba(255, 255, 255, .015);
  flex-wrap: wrap; gap: 10px;
}
.pmo-form__actions { display: flex; gap: 8px; }
.pmo-form__msg {
  min-height: 16px; font-size: 12.5px; color: #f87171;
  padding: 0 22px 8px;
}

/* ── Drawer detalhes ──────────────────────────────── */
.pmo-drawer {
  position: fixed; inset: 0; z-index: 8500;
  background: rgba(5, 8, 22, .55); backdrop-filter: blur(3px);
  animation: pmoFadeIn .18s ease-out;
}
.pmo-drawer__box {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(480px, 100%);
  background: linear-gradient(180deg, #0f172a, #08132c);
  border-left: 1px solid rgba(255, 255, 255, .08);
  display: flex; flex-direction: column;
  animation: pmoSlideIn .25s ease-out;
}
.pmo-drawer__box header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  gap: 12px;
}
.pmo-drawer__eyebrow {
  font-size: 11px; color: var(--muted);
  letter-spacing: .04em; margin-bottom: 6px;
}
.pmo-drawer__box h2 {
  margin: 0 0 12px; font-size: 19px; font-weight: 900; line-height: 1.25;
}
.pmo-drawer__tags { display: flex; gap: 6px; flex-wrap: wrap; }
.pmo-drawer__close {
  background: rgba(255, 255, 255, .05); color: var(--muted);
  border: 1px solid rgba(255, 255, 255, .08);
  width: 32px; height: 32px; border-radius: 9px; padding: 0;
  cursor: pointer; font-size: 18px; line-height: 1; flex-shrink: 0;
}
.pmo-drawer__close:hover { background: rgba(239, 68, 68, .15); color: #f87171; }

.pmo-drawer__body {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  padding: 20px 24px;
}
.pmo-drawer__cell {
  display: flex; flex-direction: column;
  background: rgba(255, 255, 255, .025);
  padding: 12px 14px; border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .04);
}
.pmo-drawer__cell span {
  font-size: 10.5px; font-weight: 800; color: var(--muted);
  letter-spacing: .06em; text-transform: uppercase; margin-bottom: 4px;
}
.pmo-drawer__cell strong { font-size: 14px; color: #e5e7eb; font-weight: 700; }
.pmo-drawer__cell small { color: var(--muted); font-size: 11px; margin-top: 2px; display: block; }

.pmo-drawer__desc {
  padding: 0 24px 18px;
}
.pmo-drawer__desc h4 { margin: 0 0 6px; color: var(--muted); font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.pmo-drawer__desc p  { margin: 0; color: #cbd5e1; font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; }

.pmo-drawer__box footer {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 14px 24px;
  border-top: 1px solid rgba(255, 255, 255, .06);
  margin-top: auto;
}

@keyframes pmoFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pmoSlideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* =========================================================
   Sprint 2 — extensões: tabs no modal, seções no drawer,
   tag-mini, pills, checklist e cards de hand-over.
========================================================= */

/* ── Modal largo ──────────────────────────────────── */
.pmo-modal__box--lg { width: min(880px, 100%); }
.pmo-modal__box header small.muted { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ── Tabs ─────────────────────────────────────────── */
.pmo-tabs {
  display: flex; gap: 4px; padding: 0 22px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  overflow-x: auto; flex-shrink: 0;
}
.pmo-tab {
  background: transparent; color: var(--muted);
  border: 0; border-bottom: 2px solid transparent;
  padding: 11px 14px; font-size: 12.5px; font-weight: 700;
  cursor: pointer; font-family: inherit; white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.pmo-tab:hover { color: #e5e7eb; }
.pmo-tab.active { color: var(--gold); border-bottom-color: var(--gold); }

.pmo-tab-panel { display: none; padding: 18px 22px; }
.pmo-tab-panel.active { display: block; }

.pmo-form--tabbed { padding: 0; }
.pmo-form--tabbed > .pmo-form__msg { padding: 8px 22px 0; }
.pmo-form--tabbed > footer { padding: 14px 22px; }

/* Seções dentro de tabs */
.pmo-form__sec {
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .04);
}
.pmo-form__sec:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.pmo-form__sec h4 {
  margin: 0 0 10px; font-size: 12px;
  color: var(--muted); font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase;
}
.pmo-form__check {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px; font-size: 13px; color: #cbd5e1;
  cursor: pointer;
}
.pmo-form__check input { accent-color: var(--gold); width: 16px; height: 16px; }

/* ── Tag mini (no chip-like row, unidade negócio, tipo cliente) ── */
.pmo-tag-mini {
  display: inline-block;
  padding: 2px 8px; border-radius: 99px;
  font-size: 10.5px; font-weight: 700;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .08);
  color: #cbd5e1; letter-spacing: .02em;
}

/* ── Pill (status binário tipo aprovado/pendente) ── */
.pmo-pill {
  display: inline-block;
  padding: 3px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 800;
}
.pmo-pill.ok   { background: rgba(16, 185, 129, .14); color: #34d399; border: 1px solid rgba(16, 185, 129, .3); }
.pmo-pill.warn { background: rgba(251, 191, 36, .14); color: #fbbf24; border: 1px solid rgba(251, 191, 36, .3); }

/* ── Drawer wide e seções ─────────────────────────── */
.pmo-drawer__box--wide { width: min(620px, 100%); }
.pmo-drawer__sections {
  display: flex; flex-direction: column; gap: 16px;
  padding: 18px 24px;
  overflow-y: auto; flex: 1;
}
.pmo-drawer__section {
  background: rgba(255, 255, 255, .02);
  border: 1px solid rgba(255, 255, 255, .04);
  border-radius: 12px; padding: 14px 16px;
}
.pmo-drawer__section h4 {
  margin: 0 0 10px; font-size: 11.5px;
  color: var(--muted); font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase;
}
.pmo-drawer__section-hd {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; gap: 10px;
}
.pmo-drawer__section-hd h4 { margin: 0; }
.pmo-drawer__grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.pmo-drawer__longtext {
  color: #cbd5e1; font-size: 13px; line-height: 1.55;
  white-space: pre-wrap; word-break: break-word;
}
.pmo-drawer__cell {
  display: flex; flex-direction: column;
  background: rgba(255, 255, 255, .02);
  padding: 10px 12px; border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .04);
}
.pmo-drawer__cell span {
  font-size: 10px; font-weight: 800; color: var(--muted);
  letter-spacing: .06em; text-transform: uppercase; margin-bottom: 3px;
}
.pmo-drawer__cell strong { font-size: 13.5px; color: #e5e7eb; font-weight: 700; }
.pmo-drawer__cell strong small { color: var(--muted); font-size: 11px; font-weight: 600; margin-left: 6px; }

/* ── Hand-over cards ──────────────────────────────── */
.pmo-handover-list { display: flex; flex-direction: column; gap: 10px; }
.pmo-handover-empty {
  padding: 14px; text-align: center;
  color: var(--muted); font-size: 13px;
  border: 1px dashed rgba(255, 255, 255, .08);
  border-radius: 10px;
  background: rgba(255, 255, 255, .015);
}
.pmo-handover-empty p { margin: 0; line-height: 1.5; }

.pmo-handover-card {
  background: rgba(255, 255, 255, .025);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 12px; padding: 12px 14px;
  cursor: pointer; transition: border-color .15s;
}
.pmo-handover-card:hover { border-color: rgba(214, 168, 79, .3); }
.pmo-handover-card__hd {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 8px; flex-wrap: wrap;
}
.pmo-handover-card__hd small.muted { font-size: 11px; }
.pmo-handover-card__actions { display: flex; gap: 5px; flex-wrap: wrap; }
.pmo-handover-card__bd { display: flex; flex-direction: column; gap: 4px; }
.pmo-handover-card__row { font-size: 12.5px; color: #e5e7eb; }
.pmo-handover-card__row strong { color: var(--muted); font-weight: 700; font-size: 11.5px; }
.pmo-handover-card__obs {
  margin-top: 6px; padding: 8px 10px;
  background: rgba(0, 0, 0, .15); border-radius: 8px;
  font-size: 12px; color: #cbd5e1; line-height: 1.5;
  border-left: 2px solid rgba(214, 168, 79, .3);
  white-space: pre-wrap;
}
.pmo-handover-card__check {
  display: flex; align-items: center; gap: 10px;
  margin-top: 8px; padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, .04);
}
.pmo-handover-card__check .pmo-progress { flex: 1; max-width: none; }
.pmo-handover-card__check small { font-size: 11px; }

/* ── Checklist no modal ───────────────────────────── */
.pmo-checklist {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 6px; margin-top: 4px;
}
.pmo-checklist__item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 9px 11px; border-radius: 9px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .05);
  cursor: pointer; transition: background .12s;
}
.pmo-checklist__item:hover { background: rgba(214, 168, 79, .06); }
.pmo-checklist__item input { accent-color: var(--gold); margin-top: 2px; width: 14px; height: 14px; }
.pmo-checklist__item span { font-size: 12.5px; color: #cbd5e1; line-height: 1.45; }

/* ── small button ─────────────────────────────────── */
.swm-btn.small {
  padding: 5px 10px; font-size: 11.5px;
  border-radius: 7px;
}

/* ── Responsive (sprint 2 extras) ─────────────────── */
@media (max-width: 760px) {
  .pmo-drawer__grid    { grid-template-columns: 1fr; }
  .pmo-checklist       { grid-template-columns: 1fr; }
  .pmo-tabs            { padding: 0 14px; }
  .pmo-tab-panel       { padding: 14px; }
}


/* ── Responsivo ───────────────────────────────────── */
@media (max-width: 760px) {
  .pmo-form__grid     { grid-template-columns: 1fr; }
  .pmo-drawer__body   { grid-template-columns: 1fr; }
  .pmo-projects__toolbar { flex-direction: column; align-items: stretch; }
  .pmo-projects__search  { max-width: none; }
  .pmo-table { font-size: 12.5px; }
  .pmo-table th, .pmo-table td { padding: 9px 10px; }
}

/* =========================================================
   Origem do registro (CRM vs Manual) — banners + locks
========================================================= */
.pmo-origem-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  margin: 0 0 12px;
  background: rgba(96, 165, 250, .08);
  border: 1px solid rgba(96, 165, 250, .25);
  border-left: 4px solid #60a5fa;
  border-radius: 10px;
  font-size: 12.5px;
  color: #cbd5e1;
}
.pmo-origem-banner__ico {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(96, 165, 250, .15);
  color: #60a5fa;
  border-radius: 8px;
  font-size: 16px;
  flex-shrink: 0;
}
.pmo-origem-banner strong { color: #f1f5f9; font-weight: 800; }
.pmo-origem-banner small  { color: #8892a4; font-size: 12px; line-height: 1.5; display: block; margin-top: 2px; }
.pmo-origem-banner em     { color: #f1f5f9; font-style: italic; }

/* Badge de origem na tabela */
.pmo-badge--origem {
  font-size: 10.5px;
  padding: 2px 8px;
  letter-spacing: .04em;
  background: rgba(255, 255, 255, .03);
}

/* Banner no modal */
.pmo-modal__lockbanner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin: 0 20px 12px;
  background: rgba(52, 211, 153, .06);
  border: 1px solid rgba(52, 211, 153, .25);
  border-left: 4px solid #34d399;
  border-radius: 8px;
  font-size: 12.5px;
}
.pmo-modal__lockbanner--manual {
  background: rgba(251, 191, 36, .06);
  border-color: rgba(251, 191, 36, .25);
  border-left-color: #fbbf24;
}
.pmo-modal__lockbanner > span {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .04);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
  color: #34d399;
  flex-shrink: 0;
}
.pmo-modal__lockbanner--manual > span { color: #fbbf24; }
.pmo-modal__lockbanner strong { color: #f1f5f9; }
.pmo-modal__lockbanner small  { color: #8892a4; display: block; margin-top: 2px; line-height: 1.5; }

/* Lock visual nas tabs restritas quando form vem do CRM */
.pmo-form--from-crm .pmo-tab-panel[data-restricted="1"] {
  position: relative;
}
.pmo-form--from-crm .pmo-tab-panel[data-restricted="1"]::before {
  content: "🔒 Somente leitura — vem do CRM";
  display: block;
  padding: 6px 10px;
  margin: 0 0 10px;
  background: rgba(52, 211, 153, .08);
  border: 1px dashed rgba(52, 211, 153, .35);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  color: #34d399;
  text-align: center;
}
.pmo-form--from-crm .pmo-tab-panel[data-restricted="1"] input,
.pmo-form--from-crm .pmo-tab-panel[data-restricted="1"] select,
.pmo-form--from-crm .pmo-tab-panel[data-restricted="1"] textarea {
  pointer-events: none;
  opacity: .55;
  background: rgba(0, 0, 0, .15);
}
.pmo-form--from-crm .pmo-tab-panel[data-restricted="1"] label {
  cursor: not-allowed;
}

