:root {
  --bg: #f3efe6;
  --bg-2: #e7e1d4;
  --ink: #14201b;
  --muted: #5b6a63;
  --line: rgba(20, 32, 27, 0.12);
  --panel: rgba(255, 252, 246, 0.92);
  --accent: #0f6b4c;
  --accent-2: #c45c26;
  --warn: #9a3412;
  --ok: #0f6b4c;
  --shadow: 0 18px 50px rgba(20, 32, 27, 0.12);
  --radius: 18px;
  --font: "Manrope", system-ui, sans-serif;
  --display: "Newsreader", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #d9eadf 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #f0d8c4 0%, transparent 50%),
    linear-gradient(180deg, #f7f3ea 0%, #ebe4d7 100%);
}

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.1rem 1rem 3rem;
}

.top {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 1rem;
  animation: rise 0.5s ease both;
}

.brand-mark {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.brand h1 {
  margin: 0.15rem 0 0;
  font-family: var(--display);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.05;
}

.tabs {
  display: flex;
  gap: 0.4rem;
  background: rgba(255,255,255,0.55);
  padding: 0.3rem;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.tab, .chip {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  cursor: pointer;
}

.tab.active, .chip.active {
  background: var(--ink);
  color: #f8f4ec;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
  margin-bottom: 1rem;
  animation: rise 0.55s ease 0.05s both;
}

@media (min-width: 720px) {
  .kpis { grid-template-columns: repeat(4, 1fr); }
}

.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  backdrop-filter: blur(8px);
}

.kpi span {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}

.kpi strong {
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 700;
}

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: start;
  animation: rise 0.6s ease 0.08s both;
}

.sidebar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  backdrop-filter: blur(8px);
}

.sidebar-title {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 800;
}

.filters {
  display: grid;
  gap: 0.75rem;
}

.filters label {
  display: grid;
  gap: 0.35rem;
}

.filters label span {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.content {
  min-width: 0;
}

.toolbar {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.search input,
.filters select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 0.85rem 1rem;
  font: inherit;
  color: var(--ink);
}

.filters select {
  background: var(--panel);
  padding: 0.7rem 0.85rem;
}

.search input {
  font-size: 1.05rem;
  font-weight: 600;
  background: var(--panel);
}

@media (min-width: 860px) {
  .layout {
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 1.25rem;
  }

  .sidebar {
    position: sticky;
    top: 1rem;
  }
}

.view { display: none; }
.view.active { display: block; animation: rise 0.35s ease both; }

.list-head {
  display: flex;
  justify-content: space-between;
  margin: 0.2rem 0 0.6rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.lista, .ops-content { display: grid; gap: 0.55rem; }

.person, .op-row {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 16px;
  padding: 0.9rem 1rem;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.person:hover, .op-row:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.person-top, .op-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: start;
}

.person h3, .op-row h3 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
}

.meta {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.badges { display: flex; flex-wrap: wrap; gap: 0.3rem; justify-content: flex-end; }

.badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  background: #e4eee8;
  color: var(--accent);
}

.badge.warn { background: #f3e0d4; color: var(--warn); }
.badge.muted { background: #ece7dc; color: var(--muted); }

.ops-tabs {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
  margin-bottom: 0.7rem;
}

.ops-resumo {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

@media (min-width: 720px) {
  .ops-resumo { grid-template-columns: repeat(4, 1fr); }
}

.ops-block { margin-bottom: 1.2rem; }
.ops-block h2 {
  margin: 0 0 0.55rem;
  font-family: var(--display);
  font-size: 1.25rem;
}

.drawer { position: fixed; inset: 0; pointer-events: none; z-index: 40; }
.drawer.open { pointer-events: auto; }
.drawer-backdrop {
  position: absolute; inset: 0;
  background: rgba(20, 32, 27, 0.35);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.drawer.open .drawer-backdrop { opacity: 1; }

.drawer-panel {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: min(440px, 100%);
  background: #fffcf6;
  border-left: 1px solid var(--line);
  padding: 1.1rem 1rem 2rem;
  overflow: auto;
  transform: translateX(105%);
  transition: transform 0.25s ease;
  box-shadow: var(--shadow);
}
.drawer.open .drawer-panel { transform: translateX(0); }

.drawer-close {
  position: sticky;
  top: 0;
  float: right;
  border: 0;
  background: #ece7dc;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  font-size: 1.3rem;
  cursor: pointer;
}

.ficha h2 {
  margin: 0.4rem 0 0.2rem;
  font-family: var(--display);
  font-size: 1.7rem;
  clear: both;
}

.ficha-grid {
  display: grid;
  gap: 0.45rem;
  margin: 0.9rem 0 1.1rem;
}

.ficha-grid div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0.5rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}

.ficha-grid dt { color: var(--muted); font-weight: 600; }
.ficha-grid dd { margin: 0; font-weight: 700; }

.section-title {
  margin: 1rem 0 0.45rem;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
}

.mini {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.45rem;
  background: #fff;
}

.mini p { margin: 0.15rem 0; font-size: 0.9rem; }
.mini strong { font-weight: 800; }
.empty {
  padding: 1.4rem 1rem;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.hidden { display: none !important; }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.login-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 1.6rem 1.4rem 1.5rem;
  display: grid;
  gap: 0.75rem;
  animation: rise 0.45s ease both;
}

.login-card h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 2rem;
}

.login-sub {
  margin: 0 0 0.4rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.login-card label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
}

.login-card input {
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  background: #fff;
}

.login-btn {
  margin-top: 0.35rem;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 800;
  padding: 0.75rem 1rem;
  cursor: pointer;
}

.login-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.login-error {
  min-height: 1.2em;
  margin: 0;
  color: var(--warn);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  font-weight: 600;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.user-chip {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.logout-btn {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.7);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
}
