﻿/* Estilos da app Krypton */
/* ║ __  __ _ _         ____        _       ║ */
/* ║|  \/  (_) | __ ___| __ )  ___ | |_ ___ ║ */
/* ║| |\/| | | |/ /|_  /  _ \ / _ \| __/ __|║ */
/* ║| |  | | |   <  / /| |_) | (_) | |_\__ \║ */
/* ║|_|  |_|_|_|\_\/___|____/ \___/ \__|___/║ */
/* ╚════════════════════════════════════════╝ */
/* ╔════════════════════════════════════════╗ */
/* ║    This website was made by MikzBots   ║ */
/* ║         https://mikzbots.xyz/          ║ */
/* ╚════════════════════════════════════════╝ */

/* ── TOKENS DE DESIGN ── */
:root {
  --bg:      oklch(14% 0.005 35);
  --bg-1:    oklch(18% 0.005 35);
  --bg-2:    oklch(22% 0.004 35);
  --bg-3:    oklch(26% 0.004 35);
  --bg-4:    oklch(31% 0.003 35);
  --bg-5:    oklch(36% 0.003 35);

  --text:    #ede9e3;
  --text-2:  oklch(55% 0.008 40);
  --text-3:  oklch(43% 0.007 40);

  --line:    rgba(255,255,255,0.11);
  --line-2:  rgba(255,255,255,0.04);

  --accent:       #ED1C24;
  --accent-h:     #F04049;
  --accent-dim:   rgba(237,28,36,0.09);
  --accent-glow:  rgba(237,28,36,0.18);
  --border-a:     rgba(237,28,36,0.22);

  --green:     #22c55e;
  --green-dim: rgba(34,197,94,0.10);
  --amber:     #f59e0b;
  --amber-dim: rgba(245,158,11,0.10);
  --red-s:     #ef4444;
  --red-dim:   rgba(239,68,68,0.10);

  --r:    2px;
  --r-md: 4px;
  --r-lg: 6px;
  --r-sm: 2px;
  --r-pill: 9999px;

  --sidebar-w:        220px;
  --sidebar-w-mobile: 52px;

  --black:  var(--bg);
  --black2: var(--bg-2);
  --black3: var(--bg-3);
  --black4: var(--bg-4);
  --white:  var(--text);
  --grey:   var(--text-2);
  --grey2:  var(--text-3);
  --border: var(--line);
}

/* ── TEMA CLARO ── */
body.theme-light {
  --bg:    oklch(92% 0.007 75);
  --bg-1:  oklch(96% 0.004 78);
  --bg-2:  oklch(99% 0.001 80);
  --bg-3:  oklch(89% 0.009 72);
  --bg-4:  oklch(85% 0.010 68);
  --bg-5:  oklch(81% 0.011 64);
  --text:  oklch(14% 0.007 30);
  --text-2: oklch(40% 0.009 38);
  --text-3: oklch(54% 0.008 38);
  --line:  rgba(0,0,0,0.12);
  --line-2: rgba(0,0,0,0.06);
  --border-a: rgba(237,28,36,0.22);
  --black:  var(--bg);
  --black2: var(--bg-2);
  --black3: var(--bg-3);
  --black4: var(--bg-4);
  --white:  var(--text);
  --grey:   var(--text-2);
  --grey2:  var(--text-3);
  --border: var(--line);
}

body.theme-light .topbar  { background: var(--bg); border-bottom: var(--line-w) solid var(--line); }
body.theme-light .modal   { background: #ffffff; border-color: rgba(0,0,0,0.10); }
body.theme-light .am-input { background: var(--bg-3); color: var(--text); border-color: var(--line); }
body.theme-light .am-input::placeholder { color: var(--text-3); }
body.theme-light .proj-row { border-color: var(--line); }
body.theme-light .proj-row:hover { background: var(--bg-3); }
body.theme-light .proj-home-card { background: #fff; }
body.theme-light .proj-home-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.08); }
body.theme-light .access-card { background: var(--bg-2); border-color: var(--line); }
body.theme-light .doc-card { background: var(--bg-2); }
body.theme-light .prof-card, body.theme-light .sett-card { background: var(--bg-2); }
body.theme-light .ui-toast { background: #ffffff; }
body.theme-light .search { background: var(--bg-3); color: var(--text); }
body.theme-light #login-overlay { background: var(--bg); }
body.theme-light #login-box { background: #ffffff; border-color: rgba(0,0,0,0.08); }
body.theme-light .packet-doc-item { background: var(--bg-3); }
body.theme-light .packet-col { background: var(--bg-3); }
body.theme-light .place-card, body.theme-light .explore-card { background: var(--bg-2); }
body.theme-light .bio-section { background: var(--bg-2); }
body.theme-light .team-card { background: var(--bg-3); }
body.theme-light .proj-ctx-menu { background: var(--bg-2); }
body.theme-light .support-chat-panel { background: var(--bg-1); border-color: rgba(0,0,0,0.12); }
body.theme-light .support-chat-head { background: var(--bg-2); }
body.theme-light .support-chat-input,
body.theme-light .support-compose-input { background: var(--bg-2); border-color: rgba(0,0,0,0.12); }
body.theme-light .support-msg { background: var(--bg-3); border-color: rgba(0,0,0,0.08); }

/* ── REPOSIÇÃO E BASE ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', 'Barlow', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.auth-locked .shell {
  pointer-events: none;
  user-select: none;
  filter: blur(2px);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
textarea, input, select { font-family: inherit; }

::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }

/* ── ESTRUTURA ── */
.shell { display: flex; height: 100vh; height: 100dvh; }

/* ── CARREGAMENTO ── */
.loading-screen {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 40px;
  transition: opacity 0.6s;
}
.loading-screen.hide { opacity: 0; pointer-events: none; }

.loading-wordmark {
  display: flex; align-items: center; justify-content: center;
  user-select: none;
}
.loading-wordmark img { height: 52px; width: auto; }
.logo-light { display: none; }
body.theme-light .logo-dark { display: none; }
body.theme-light .logo-light { display: block; }

.loading-bar {
  width: 60px; height: 1px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.loading-bar-fill {
  height: 100%; width: 45%;
  background: var(--accent);
  animation: loadPulse 1.4s ease-in-out infinite;
}
@keyframes loadPulse {
  0%   { transform: translateX(-120%); }
  100% { transform: translateX(350%); }
}

.spinner {
  width: 24px; height: 24px;
  border: var(--line-w) solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { display: none; }

/* ── BOTÃO DE TEMA DA BARRA LATERAL ── */
#sidebar-theme-btn {
  width: 28px; height: 28px; flex-shrink: 0;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-3);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative;
  margin-left: auto;
  transition: color 0.15s, background 0.15s;
}
#sidebar-theme-btn:hover { color: var(--text); background: rgba(255,255,255,0.1); }
#sidebar-theme-btn .theme-icon {
  position: absolute; width: 14px; height: 14px;
  transition: opacity 0.2s, transform 0.2s;
}
#sidebar-theme-btn[data-mode='dark'] .theme-icon-moon { opacity: 0; transform: scale(0.5); }
#sidebar-theme-btn[data-mode='dark'] .theme-icon-sun { opacity: 1; transform: scale(1); }
#sidebar-theme-btn[data-mode='light'] .theme-icon-moon { opacity: 1; transform: scale(1); }
#sidebar-theme-btn[data-mode='light'] .theme-icon-sun { opacity: 0; transform: scale(0.5); }
body.theme-light #sidebar-theme-btn { color: #999; }
body.theme-light #sidebar-theme-btn:hover { color: var(--accent); background: rgba(0,0,0,0.06); }

/* ── BARRA LATERAL ── */
.sidebar {
  width: var(--sidebar-w);
  background: oklch(10% 0.007 35);
  border-right: 1px solid oklch(20% 0.006 35);
  display: flex; flex-direction: column;
  padding: 0 0 20px;
  position: fixed; height: 100vh; height: 100dvh;
  z-index: 400; overflow: hidden;
  box-shadow: 2px 0 12px rgba(0,0,0,0.4);
}

.sidebar::before {
  content: '';
  display: block;
  height: 2px;
  background: var(--accent);
  flex-shrink: 0;
}

.ki-logo-img {
  display: flex; align-items: center;
  height: 52px;
  padding: 0 16px;
  text-decoration: none;
  transition: opacity 0.2s;
  flex-shrink: 0;
  border-bottom: 1px solid var(--line-2);
}
.ki-logo-img:hover { opacity: 0.7; }
.sidebar-logo { height: 26px; width: auto; }

.nav-items {
  display: flex; flex-direction: column;
  gap: 1px; flex: 1;
  overflow-y: auto; overflow-x: hidden;
  padding: 12px 8px 0;
}

.nav-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; height: 36px; padding: 0 10px;
  border-radius: var(--r);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  color: oklch(48% 0.007 40); position: relative;
  white-space: nowrap; flex-shrink: 0;
}
.nav-btn:hover {
  background: oklch(22% 0.005 35);
  color: var(--text-2);
}
.nav-btn.active {
  background: rgba(237,28,36,0.12);
  color: var(--accent);
}
.nav-btn.active::before {
  content: '';
  position: absolute; left: 0; top: 50%;
  transform: translateY(-50%);
  width: 2px; height: 18px;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
}
.nav-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-tooltip { display: none; }

.badge {
  position: absolute; top: 8px; right: 8px;
  width: 5px; height: 5px;
  background: var(--accent); border-radius: 50%;
  box-shadow: 0 0 0 2px var(--bg);
}

.sidebar-bottom {
  margin-top: auto; padding: 10px 8px 4px;
  border-top: 1px solid oklch(16% 0.007 35);
  display: flex; flex-direction: column; gap: 2px;
  flex-shrink: 0;
  background: oklch(9% 0.008 35);
}

.user-dot {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r);
  cursor: pointer; transition: background 0.12s;
}
.user-dot:hover { background: oklch(22% 0.005 35); }
.user-dot.active { background: rgba(237,28,36,0.12); }

.user-dot-avatar {
  width: 26px; height: 26px; border-radius: var(--r);
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900; font-size: 11px; color: #fff;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}
.nav-username {
  font-size: 12px; font-weight: 500;
  color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── CONTEÚDO PRINCIPAL ── */
.main {
  margin-left: var(--sidebar-w); flex: 1;
  overflow-y: auto; height: 100vh; height: 100dvh;
}

.section { display: none; padding: 40px 52px; min-height: 100vh; }
.section.active {
  display: block;
  animation: fadeIn 0.22s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── BARRA SUPERIOR ── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: var(--line-w) solid var(--line);
}

.page-title {
  font-family: 'Bebas Neue', 'Barlow Condensed', sans-serif;
  font-size: 38px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--text);
  line-height: 1;
}
.page-title span { color: var(--accent); }

.topbar-right {
  display: flex; gap: 8px; align-items: center;
  padding-right: 54px;
}

.search {
  background: var(--bg-2);
  border: var(--line-w) solid var(--line);
  border-radius: var(--r);
  padding: 7px 14px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px; width: 220px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.search::placeholder { color: var(--text-3); }

/* ── BOTÕES ── */
.btn {
  padding: 7px 16px;
  border-radius: var(--r);
  border: none; cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px; font-weight: 500;
  transition: background 0.12s, color 0.12s, border-color 0.12s, opacity 0.12s, transform 0.06s;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.btn:active { transform: scale(0.96); }

.btn-accent {
  background: var(--accent); color: #fff;
  border-radius: var(--r-pill); padding: 8px 20px;
  font-weight: 600; letter-spacing: 0.2px;
}
.btn-accent:hover { opacity: 0.88; }

.btn-outline {
  background: transparent; color: var(--text-2);
  border: var(--line-w) solid var(--line);
}
.btn-outline:hover { border-color: var(--text); color: var(--text); }
.btn-sm { padding: 5px 12px; font-size: 12px; }

.btn.scope-switch-krypton     { border-color: rgba(237,28,36,0.35); color: #F48A8F; }
.btn.scope-switch-krypton:hover { border-color: #ED1C24; color: #ED1C24; }
.btn.scope-switch-international { border-color: rgba(242,193,24,0.35); color: #F7DB7A; }
.btn.scope-switch-international:hover { border-color: #F2C118; color: #F2C118; }

/* ── ETIQUETAS E SEPARADORES ── */
.section-subtitle {
  font-family: 'DM Mono', monospace;
  font-size: 10px; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 18px; margin-top: 8px;
  display: flex; align-items: center; gap: 14px;
}
.section-subtitle::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.divider {
  font-family: 'DM Mono', monospace;
  font-size: 10px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--text-3);
  margin-bottom: 18px; margin-top: 40px;
  display: flex; align-items: center; gap: 12px;
}
.divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.divider-top { margin-top: 28px; }

/* ── TAGS E ESTADOS ── */
.tag {
  font-family: 'DM Mono', monospace;
  font-size: 10px; font-weight: 400;
  padding: 3px 8px; border-radius: var(--r-pill);
  letter-spacing: 0.5px; display: inline-block;
}
.tag-a { background: var(--accent-dim); color: var(--accent); }
.tag-w { background: rgba(255,255,255,0.06); color: var(--text-2); }
.tag-g { background: var(--green-dim); color: var(--green); }
.tag-r { background: var(--red-dim); color: var(--red-s); }

/* ── CHIPS DE FILTRO E ÂMBITO ── */
.filter-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.scope-filter-row { display: flex; gap: 8px; margin-bottom: 12px; }

.filt {
  padding: 5px 14px; border-radius: var(--r-pill);
  border: 1px solid rgba(255,255,255,0.09);
  background: transparent; color: var(--text-3);
  font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: background 0.12s, color 0.12s, border-color 0.12s, opacity 0.12s, transform 0.12s, box-shadow 0.12s;
}
.filt.on { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }
.filt:not(.on):hover { border-color: rgba(255,255,255,0.2); color: var(--text-2); }

.scope-chip {
  padding: 5px 14px; border-radius: var(--r-pill);
  border: 1px solid rgba(255,255,255,0.09);
  background: transparent; color: var(--text-3);
  font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: background 0.12s, color 0.12s, border-color 0.12s, opacity 0.12s, transform 0.12s, box-shadow 0.12s;
}
.scope-chip:hover { border-color: rgba(255,255,255,0.2); color: var(--text-2); }
.scope-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }

/* ── BANNER PRINCIPAL ── */
.hero-banner {
  padding: 28px 0 24px;
  margin-bottom: 24px;
  position: relative;
  border-bottom: var(--line-w) solid var(--line);
}

.hero-banner::before {
  content: '';
  display: block; width: 24px; height: 2px;
  background: var(--accent); margin-bottom: 24px;
}

.hero-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 10px; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--text-2);
  margin-bottom: 16px;
}

.hero-logo-big {
  margin-bottom: 20px;
  line-height: 1;
}
.hero-logo-big img { height: clamp(48px, 7vw, 72px); width: auto; }

.hero-banner p {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px; color: var(--text-2);
  line-height: 1.7; max-width: 480px; margin-bottom: 28px;
}
.hero-actions { display: flex; gap: 10px; }

/* ── CARTÕES DE PROJETOS (INÍCIO) ── */
.inprog-grid, .proj-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin-bottom: 24px;
}
.proj-grid { grid-template-columns: repeat(4, 1fr); }

.proj-home-card {
  background: var(--bg-2); border: none;
  border-radius: var(--r-md); overflow: hidden; cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.proj-home-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.45), 0 0 0 1px var(--border-a);
}
.proj-home-card-done { opacity: 0.75; }
.proj-home-card-done:hover { opacity: 1; }

.phc-cover {
  height: 160px; position: relative;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; background: var(--bg-3);
  background-size: cover; background-position: center;
}
.phc-cover-done { filter: grayscale(0.4); }
.phc-logo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.phc-initials {
  font-family: 'Bebas Neue', 'Barlow Condensed', sans-serif;
  font-size: 52px; font-weight: 900; letter-spacing: -1px;
  opacity: 0.25; text-transform: uppercase; user-select: none;
}
.phc-initials-done { color: var(--text-3) !important; }
.phc-live-dot {
  position: absolute; top: 10px; right: 10px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 2px rgba(237,28,36,0.25);
}
.phc-done-badge {
  position: absolute; top: 8px; right: 8px;
  background: var(--green); color: #fff;
  font-size: 10px; font-weight: 700;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.phc-body { padding: 10px 12px 12px; }
.phc-client {
  font-family: 'DM Mono', monospace;
  font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.phc-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800; font-size: 15px; line-height: 1.2;
  letter-spacing: -0.1px; margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.phc-dir { font-size: 11px; color: var(--text-2); margin-bottom: 8px; }
.phc-progress { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.phc-bar { flex: 1; height: 2px; background: var(--line); border-radius: 1px; overflow: hidden; }
.phc-fill { height: 100%; background: var(--accent); border-radius: 1px; }
.phc-pct { font-size: 9px; font-family: 'DM Mono', monospace; color: var(--text-3); flex-shrink: 0; }
.phc-edited { font-size: 9px; font-family: 'DM Mono', monospace; color: var(--text-3); margin-top: 5px; opacity: 0.6; }

.proj-grid { background: none; border: none; }
.status { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-2); }
.dot { width: 5px; height: 5px; border-radius: 50%; }
.dot-live { background: var(--green); }
.dot-prod { background: var(--accent); }
.dot-plan { background: var(--text-3); }

/* ── SEPARADORES DO ARQUIVO ── */
.archive-tabs {
  display: flex; gap: 0; margin-bottom: 16px;
  border-bottom: var(--line-w) solid var(--line);
}
.archive-tab {
  padding: 8px 20px; font-size: 12px; font-weight: 600;
  letter-spacing: 0.5px; text-transform: uppercase;
  background: transparent; border: none; border-bottom: 2px solid transparent;
  color: var(--text-3); cursor: pointer; margin-bottom: -1px;
  transition: color 0.12s, border-color 0.12s;
}
.archive-tab:hover { color: var(--text); }
.archive-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── CARTÕES DO LIXO ── */
.trash-note { font-size: 13px; color: var(--text-2); margin-bottom: 18px; }
.trash-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: var(--bg-2);
  border: var(--line-w) solid var(--line); border-radius: var(--r);
  margin-bottom: 1px;
}
.trash-card:hover { border-color: var(--line); }
.proj-card-logo {
  width: 36px; height: 36px; border-radius: var(--r);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900; font-size: 14px; color: #fff;
}
.proj-card-body { flex: 1; min-width: 0; }
.proj-card-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700; font-size: 15px; letter-spacing: 0.3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.proj-card-meta { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.trash-card-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ── FAIXA DE CLIENTES ── */
.clients-strip { margin-top: 28px; padding-top: 20px; border-top: var(--line-w) solid var(--line); }
.clients-label {
  font-family: 'DM Mono', monospace;
  font-size: 9px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--text-3); margin-bottom: 12px;
}
.clients-row { display: flex; flex-wrap: wrap; gap: 6px; }
.client-chip {
  padding: 4px 12px; border-radius: var(--r-pill);
  border: var(--line-w) solid var(--line);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px; color: var(--text-2);
  transition: background 0.12s, color 0.12s, border-color 0.12s, opacity 0.12s, transform 0.12s, box-shadow 0.12s; cursor: pointer;
}
.client-chip:hover { border-color: var(--border-a); color: var(--accent); background: var(--accent-dim); }

/* ── LISTA DE PROJETOS ── */
.proj-list { display: flex; flex-direction: column; gap: 0; }

.proj-row {
  background: transparent; border: none;
  border-bottom: var(--line-w) solid var(--line);
  padding: 13px 8px;
  display: flex; align-items: center; gap: 14px;
  cursor: pointer; transition: background 0.1s;
}
.proj-list .proj-row:first-child { border-top: var(--line-w) solid var(--line); }
.proj-row:hover { background: var(--bg-2); }

.proj-row-icon {
  width: 36px; height: 36px; border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0; background: var(--accent-dim);
}
.proj-row-logo { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r); }
.proj-row-info { flex: 1; }
.proj-row-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800; font-size: 16px; letter-spacing: -0.2px; margin-bottom: 1px;
}
.proj-row-meta { font-size: 11px; color: var(--text-2); }
.proj-row-right { display: flex; align-items: center; gap: 12px; }

/* ── MENUS DE TRÊS PONTOS ── */
.proj-dots-btn {
  background: none; border: none;
  color: var(--text-2); cursor: pointer;
  padding: 4px; border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; opacity: 0; transition: opacity 0.12s, background 0.12s;
}
.proj-row:hover .proj-dots-btn,
.proj-card:hover .proj-dots-card,
.inprog-card:hover .proj-dots-card { opacity: 1; }
.proj-dots-btn:hover { background: var(--bg-4); color: var(--text); }
.proj-dots-card { position: absolute; top: 8px; right: 8px; z-index: 2; }
.proj-home-card .proj-dots-btn { position: absolute; top: 8px; right: 8px; z-index: 2; }

.proj-ctx-menu {
  position: fixed; z-index: 1000;
  background: var(--bg-3); border: var(--line-w) solid var(--line);
  border-radius: var(--r-md); padding: 4px;
  min-width: 160px; box-shadow: 0 12px 32px rgba(0,0,0,0.7);
  display: none;
}
.proj-ctx-menu.open { display: block; }
.proj-ctx-item {
  display: block; width: 100%; background: none; border: none;
  color: var(--text); font-family: 'DM Sans', sans-serif;
  font-size: 13px; text-align: left;
  padding: 8px 12px; border-radius: var(--r);
  cursor: pointer; transition: background 0.1s;
}
.proj-ctx-item:hover { background: var(--bg-4); }
.proj-ctx-danger { color: var(--red-s); }
.proj-ctx-danger:hover { background: var(--red-dim); }

/* ── BARRAS DE PROGRESSO ── */
.pbar-wrap { width: 76px; }
.pbar-pct {
  font-family: 'DM Mono', monospace;
  font-size: 10px; color: var(--text-2); text-align: right; margin-bottom: 4px;
}
.pbar { height: 1px; background: var(--bg-4); overflow: hidden; }
.pfill { height: 100%; background: var(--accent); }

/* ── EXPLORE LISBON ── */
.explore-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-bottom: 24px; background: var(--line); border: var(--line-w) solid var(--line); }
.explore-card {
  background: var(--bg-2); overflow: hidden; cursor: pointer;
  transition: background 0.12s; height: 150px;
  position: relative; display: flex; align-items: flex-end;
}
.explore-card:hover { background: var(--bg-3); }
.explore-bg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 48px; }
.explore-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.88) 40%, transparent); }
.explore-content { position: relative; padding: 14px 16px; width: 100%; }
.explore-tag { font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent); margin-bottom: 3px; }
.explore-name { font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 17px; letter-spacing: 0.3px; }
.explore-sub { font-size: 11px; color: rgba(255,255,255,0.45); margin-top: 2px; }

/* ── GESTÃO DE CLIENTES ── */
/* ── CARTÕES DE CLIENTES ── */
#clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  padding-top: 4px;
}
.client-card {
  background: var(--bg-1); border: var(--line-w) solid var(--border); border-radius: 10px;
  overflow: hidden; display: flex; flex-direction: column;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.client-card:hover { border-color: var(--border-a); box-shadow: 0 4px 16px rgba(0,0,0,0.15); }
.client-card-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 14px 12px; position: relative;
}
.client-card-avatar {
  width: 44px; height: 44px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Bebas Neue', 'BebasNeueBold', sans-serif;
  font-size: 18px; letter-spacing: 1px;
}
.client-card-header-info { flex: 1; min-width: 0; }
.client-card-name {
  font-family: 'Bebas Neue', 'BebasNeueBold', sans-serif;
  font-size: 17px; letter-spacing: 0.5px; color: var(--text-0);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.client-card-edit-btn {
  background: transparent; border: var(--line-w) solid var(--border); border-radius: 6px;
  padding: 5px 7px; cursor: pointer; color: var(--text-2); flex-shrink: 0;
  transition: background 0.12s, color 0.12s, border-color 0.12s, opacity 0.12s, transform 0.12s, box-shadow 0.12s;
}
.client-card-edit-btn:hover { border-color: var(--accent); color: var(--accent); }
.client-card-body {
  padding: 10px 14px 8px; display: flex; flex-direction: column; gap: 5px; flex: 1;
}
.client-card-row {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--text-2);
}
.client-card-row svg { flex-shrink: 0; opacity: 0.6; }
.client-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px 12px; margin-top: auto;
  border-top: var(--line-w) solid var(--border);
}
.client-card-projects {
  font-size: 11px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.5px;
}
.client-card-delete-btn {
  font-size: 11px; background: transparent; border: none; cursor: pointer;
  color: var(--text-3); padding: 0; transition: color 0.12s;
}
.client-card-delete-btn:hover { color: var(--red-s); }
.client-card-inactive { opacity: 0.55; }
.client-card-inactive:hover { opacity: 0.8; }
.client-card-new {
  border-style: dashed; background: transparent; min-height: 160px;
  justify-content: center; align-items: center; gap: 10px;
  cursor: pointer; color: var(--text-3); font-size: 14px;
  transition: border-color 0.15s, color 0.15s;
}
.client-card-new:hover { border-color: var(--accent); color: var(--accent); }
.client-empty-state {
  padding: 40px; text-align: center; color: var(--text-2);
  font-size: 14px; grid-column: 1/-1;
}
.cm-portal-box {
  border: var(--line-w) solid var(--border); border-radius: 6px;
  margin: 6px 0 4px; overflow: hidden;
}
.cm-portal-header {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; background: var(--bg-1);
  font-size: 12px; font-weight: 600; color: var(--text-1);
  border-bottom: var(--line-w) solid var(--border);
}
.cm-portal-body { padding: 10px 12px; }
.cm-portal-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.cm-portal-lbl { color: var(--text-2); min-width: 70px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.3px; }
.cm-portal-val { font-family: 'DM Mono', monospace; color: var(--text-0); }
.cm-portal-actions { padding: 8px 12px; border-top: var(--line-w) solid var(--border); display: flex; gap: 8px; }
.cm-portal-icon-btns { display: flex; gap: 4px; align-items: center; }
.cm-portal-icon-btn {
  background: transparent; border: var(--line-w) solid var(--border); border-radius: 6px;
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-2); transition: background 0.12s, color 0.12s, border-color 0.12s, opacity 0.12s, transform 0.12s, box-shadow 0.12s; flex-shrink: 0;
}
.cm-portal-icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.cm-portal-icon-btn.cm-portal-icon-danger:hover { border-color: var(--red-s); color: var(--red-s); }

/* ── Grelha de cartões de secção ── */
.prod-sections-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin-top: 6px;
}
#sec-project-detail:not(.section-mode) .prod-sections-grid #wrap-scripts,
#sec-project-detail:not(.section-mode) .prod-sections-grid #wrap-callsheet,
#sec-project-detail:not(.section-mode) .prod-sections-grid #wrap-cronograma {
  grid-column: 1 / -1;
  width: fit-content; min-width: 420px; max-width: 100%;
}
#sec-project-detail:not(.section-mode) .prod-sections-grid #wrap-shooting {
  grid-column: 1 / -1; width: fit-content; max-width: 100%;
}
#sec-project-detail:not(.section-mode) .prod-sections-grid #wrap-decors {
  grid-column: 1 / -1; width: fit-content; max-width: 100%;
}
#sec-project-detail.section-mode .prod-sections-grid {
  display: contents;
}

/* ── DETALHE DO PROJETO ── */
/* ── Navegação do projeto ── */
.proj-nav-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.proj-section-back { display: none; }
.proj-section-back-name {
  font-family: 'Bebas Neue', 'BebasNeueBold', sans-serif;
  font-size: 18px; letter-spacing: 1px; color: var(--text-1);
}

/* ── Cartões de secção com dados ── */
#sec-project-detail:not(.section-mode) .prod-section-card { display: none; }
#sec-project-detail:not(.section-mode) .prod-section-card.has-data { display: block; }
#sec-project-detail:not(.section-mode) #wrap-packet-doc { display: none !important; }
#sec-project-detail:not(.section-mode) #wrap-logos { display: none !important; }

#sec-project-detail:not(.section-mode) .prod-section-card-hdr .btn { display: none !important; }
#sec-project-detail:not(.section-mode) .prod-section-card-editor,
#sec-project-detail:not(.section-mode) .prod-add-panel { display: none !important; }

#sec-project-detail:not(.section-mode) .prod-section-card-hdr {
  background: var(--bg-2) !important;
  color: var(--text-2) !important;
  cursor: default !important;
  padding: 6px 14px !important;
}
#sec-project-detail:not(.section-mode) .prod-section-card-title {
  font-size: 11px !important;
  letter-spacing: 1.5px !important;
  color: var(--text-3) !important;
  font-family: 'DM Mono', monospace !important;
  font-weight: 400 !important;
}

/* ── Modo de secção ── */
#sec-project-detail.section-mode #proj-main-nav { display: none !important; }
#sec-project-detail.section-mode #proj-section-back { display: flex !important; }
#sec-project-detail.section-mode .proj-detail-cover,
#sec-project-detail.section-mode .proj-detail-hero,
#sec-project-detail.section-mode .proj-detail-info,
#sec-project-detail.section-mode .divider.divider-top:not(.section-mode-keep),
#sec-project-detail.section-mode #custom-docs-divider,
#sec-project-detail.section-mode #proj-docs-grid,
#sec-project-detail.section-mode .packet-wrap,
#sec-project-detail.section-mode .packet-empty { display: none !important; }
#sec-project-detail.section-mode .prod-section-card:not(.section-active) { display: none !important; }
#sec-project-detail.section-mode .prod-section-card.section-active { display: block !important; }
#sec-project-detail.section-mode .prod-section-card.section-active .prod-section-card-hdr .btn { display: flex !important; }
#sec-project-detail.section-mode .sec-inline-edit { display: none !important; }

.proj-detail-cover {
  width: 100%; overflow: hidden;
  background-size: cover; background-position: left center;
  max-height: 0;
  transition: max-height 0.3s cubic-bezier(0.4,0,0.2,1);
}
.proj-detail-cover.has-cover { max-height: 220px; margin-bottom: 0; }

.proj-detail-hero {
  background: var(--bg-2); border: var(--line-w) solid var(--line);
  padding: 18px 22px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
  background-size: cover; background-position: left center;
  position: relative;
}
.proj-detail-hero.has-project-image { border-color: transparent; }
.proj-detail-hero.has-project-image::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to right, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0.45) 50%, rgba(0,0,0,0.25) 100%);
  pointer-events: none; z-index: 0;
}
.proj-detail-hero.has-project-image .proj-detail-hero-inner,
.proj-detail-hero.has-project-image .proj-detail-hero-actions { position: relative; z-index: 1; }
.proj-detail-hero.has-project-image .proj-detail-title { color: #fff; }
.proj-detail-hero.has-project-image .proj-detail-meta { color: rgba(255,255,255,0.65); }
body.theme-light .proj-detail-hero.has-project-image::after { display: none; }
body.theme-light .proj-detail-hero.has-project-image .proj-detail-title { color: var(--text); }
body.theme-light .proj-detail-hero.has-project-image .proj-detail-meta { color: var(--text-2); }
.proj-detail-hero.has-project-image .proj-detail-initials {
  background: rgba(0,0,0,0.3); border-color: rgba(255,255,255,0.2);
}
.proj-detail-hero.has-project-image .proj-gear-btn {
  border-color: rgba(255,255,255,0.3); color: rgba(255,255,255,0.7);
  background: rgba(0,0,0,0.2);
}
.proj-detail-hero.has-project-image .proj-gear-btn:hover {
  border-color: #fff; color: #fff; background: rgba(0,0,0,0.4);
}
.proj-detail-hero-inner { display: flex; align-items: center; gap: 14px; }
.proj-detail-initials {
  width: 48px; height: 48px; border-radius: var(--r);
  background: var(--accent-dim); border: 1px solid var(--border-a);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900; font-size: 18px; color: var(--accent); flex-shrink: 0;
}
.proj-detail-initials.has-image { padding: 0; background: var(--bg-3); border-color: var(--line); overflow: hidden; }
.proj-detail-initials.has-image img { width: 100%; height: 100%; object-fit: cover; }
.proj-detail-title {
  font-family: 'Bebas Neue', 'Barlow Condensed', sans-serif;
  font-size: 28px; letter-spacing: 2px; text-transform: uppercase;
}
.proj-detail-meta { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.proj-detail-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.proj-detail-info {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; margin-bottom: 8px;
  background: var(--line); border: var(--line-w) solid var(--line);
}
.proj-detail-info-item { background: var(--bg); padding: 14px 16px; }
.proj-detail-info-lbl {
  font-family: 'DM Mono', monospace;
  font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 5px;
}
.proj-detail-info-val {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700; font-size: 15px; letter-spacing: 0.3px;
}

/* ── GRELHA DE DOCUMENTOS ── */
.proj-docs-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 1px; background: var(--line); border: var(--line-w) solid var(--line);
}
.doc-card {
  background: var(--bg); padding: 14px 12px;
  cursor: pointer; transition: background 0.12s;
  display: flex; flex-direction: column; gap: 8px; position: relative;
}
.doc-card:hover { background: var(--bg-2); }
.doc-card.done { background: var(--bg-2); }

.doc-delete-btn {
  position: absolute; top: 8px; left: 8px;
  width: 18px; height: 18px; border-radius: var(--r-pill);
  border: 1px solid transparent; background: transparent;
  color: var(--text-3); display: none; align-items: center; justify-content: center;
  cursor: pointer; padding: 0; transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.doc-delete-btn svg { width: 10px; height: 10px; }
.doc-delete-btn:hover { border-color: #c0392b; color: #c0392b; background: rgba(192,57,43,0.08); }
.doc-card:hover .doc-delete-btn { display: inline-flex; }

.doc-check {
  position: absolute; top: 8px; right: 8px;
  width: 18px; height: 18px; border-radius: var(--r-pill);
  border: var(--line-w) solid var(--line); background: transparent;
  color: transparent; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s, opacity 0.15s, transform 0.15s, box-shadow 0.15s;
}
.doc-check svg { width: 10px; height: 10px; }
.doc-check:hover { border-color: var(--accent); color: var(--accent); }
.doc-check.on { border-color: var(--accent); background: var(--accent-dim); color: var(--accent); }

.doc-icon {
  width: 28px; height: 28px; background: var(--accent-dim);
  display: flex; align-items: center; justify-content: center;
}
.doc-name { font-family: 'DM Sans', sans-serif; font-weight: 600; font-size: 12px; color: var(--text); line-height: 1.3; }
.doc-source {
  font-family: 'DM Mono', monospace;
  font-size: 9px; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text-3);
}

/* ── PACOTE ── */
.packet-empty { color: var(--text-2); font-size: 13px; margin-bottom: 10px; }
.hidden-file-input { display: none; }
.packet-wrap {
  display: none; background: var(--bg-2);
  border: var(--line-w) solid var(--line); padding: 14px;
}
.packet-meta { color: var(--text-2); font-size: 12px; margin-bottom: 10px; }
.packet-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1px; margin-bottom: 12px; background: var(--line); }
.packet-col { background: var(--bg-3); border: none; padding: 10px; }
.packet-col-title {
  font-family: 'DM Mono', monospace; font-size: 9px;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 8px;
}
.packet-block { white-space: pre-wrap; font-size: 12px; line-height: 1.5; color: var(--text); max-height: 200px; overflow: auto; }
.packet-script-item { border: var(--line-w) solid var(--line); padding: 8px; margin-bottom: 8px; background: rgba(255,255,255,0.02); }
.packet-script-item:last-child { margin-bottom: 0; }
.packet-script-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.packet-script-name { font-family: 'Barlow Condensed', sans-serif; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--text); }
.packet-script-version { font-size: 11px; color: var(--accent); }
.packet-images-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 4px; }
.packet-image { border: var(--line-w) solid var(--line); background: var(--bg-3); overflow: hidden; }
.packet-image img { width: 100%; height: 100px; object-fit: cover; display: block; }
.packet-image-meta { padding: 5px 8px; font-family: 'DM Mono', monospace; font-size: 9px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.8px; }

/* ── PÁGINA DE DOCUMENTO ── */
.doc-page-topbar { margin-bottom: 10px; }
.doc-page-hero {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; padding: 0 0 20px;
  border-bottom: var(--line-w) solid var(--line); margin-bottom: 20px;
}
.doc-page-kicker { font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 2px; text-transform: uppercase; color: var(--text-3); margin-bottom: 4px; }
.doc-page-title { font-family: 'Bebas Neue', 'Barlow Condensed', sans-serif; font-size: 26px; letter-spacing: 2px; text-transform: uppercase; color: var(--text); line-height: 1; }
.doc-page-title span { color: var(--accent); }
.doc-page-subtitle { margin-top: 5px; font-size: 12px; color: var(--text-2); }
.doc-page-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; align-items: center; }
#project-doc-page-check-btn.on { border-color: var(--accent); background: var(--accent-dim); color: var(--accent); }
.doc-page-add-panel { padding: 12px; border: var(--line-w) solid var(--line); background: var(--bg-2); margin-bottom: 10px; }

/* ── ITENS DO PACOTE ── */
.packet-doc-list { max-height: 70vh; overflow-y: auto; border: var(--line-w) solid var(--line); background: var(--bg-3); padding: 6px; margin-bottom: 0; display: flex; flex-direction: column; gap: 4px; }
.packet-doc-list-page { min-height: 300px; }
.packet-doc-empty { padding: 10px; color: var(--text-2); font-size: 12px; text-align: center; }

.packet-doc-item {
  display: grid; grid-template-columns: 120px minmax(0,1fr) auto;
  align-items: start; gap: 8px; padding: 10px;
  border: 1px solid rgba(255,255,255,0.07);
  background: var(--bg-2); position: relative;
  transition: border-color 0.12s, opacity 0.12s;
}
.packet-doc-item.is-checked { border-color: rgba(255,255,255,0.20); background: linear-gradient(145deg, var(--accent-dim), rgba(255,255,255,0.01)); }
.packet-doc-item-editable { cursor: grab; }
.packet-doc-item-editable.is-dragging { opacity: 0.5; border-style: dashed; }
.packet-doc-item.is-drop-target { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-dim); }
.packet-doc-item-readonly { grid-template-columns: 120px minmax(0,1fr); align-items: center; }
.packet-doc-item--shooting { background-size: cover; background-position: center; min-height: 115px; display: block; position: relative; overflow: hidden; }
.packet-doc-item--shooting .packet-doc-item-content--overlay { position: absolute; bottom: 0; left: 0; right: 0; padding: 8px 10px; background: linear-gradient(to top, rgba(0,0,0,0.82), transparent); color: #fff; }
.packet-doc-item--shooting .packet-doc-item-name { color: #fff !important; font-size: 12px; }
.packet-doc-item--shooting .packet-doc-item-note { color: rgba(255,255,255,0.7) !important; font-size: 11px; }
.packet-doc-item--shooting.is-checked { filter: brightness(0.55); }
.packet-doc-list-page .packet-doc-item--shooting { grid-column: auto; }

.packet-doc-script-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 0 16px; }
.script-tab-btn {
  padding: 5px 14px; border-radius: var(--r-pill);
  border: var(--line-w) solid var(--line); background: transparent;
  color: var(--text-2); font-family: 'DM Sans', sans-serif;
  font-size: 12px; cursor: pointer; transition: background 0.12s, color 0.12s, border-color 0.12s, opacity 0.12s, transform 0.12s, box-shadow 0.12s;
}
.script-tab-btn:hover { background: var(--bg-4); color: var(--text); }
.script-tab-btn.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

.packet-doc-item-badge {
  position: absolute; top: 7px; left: 7px; z-index: 2;
  padding: 2px 6px; border-radius: var(--r-pill);
  font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 0.5px;
  border: var(--line-w) solid var(--line); background: rgba(0,0,0,0.55); color: var(--text-3);
  backdrop-filter: blur(2px);
}
.packet-doc-item-badge.on { border-color: var(--accent); color: var(--accent); }

.packet-doc-thumb-wrap { display: flex; flex-direction: column; gap: 4px; }
.packet-doc-thumb { width: 100%; height: 88px; object-fit: cover; border: var(--line-w) solid var(--line); background: var(--bg-2); }
.packet-doc-thumb-empty { display: flex; align-items: center; justify-content: center; font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text-3); background: rgba(255,255,255,0.02); }
.packet-doc-thumb-actions { display: flex; gap: 4px; flex-wrap: wrap; }

.packet-doc-item-content { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.packet-doc-item-check {
  width: 24px; height: 24px; border: var(--line-w) solid var(--line);
  background: transparent; color: var(--text-3); font-size: 13px;
  line-height: 1; cursor: pointer; align-self: flex-start; transition: background 0.12s, color 0.12s, border-color 0.12s, opacity 0.12s, transform 0.12s, box-shadow 0.12s;
}
.packet-doc-item-check:hover { border-color: var(--accent); color: var(--accent); }
.packet-doc-item-check.on { border-color: var(--accent); background: var(--accent-dim); color: var(--accent); }

.packet-doc-item-name { font-family: 'Barlow Condensed', sans-serif; font-size: 14px; font-weight: 700; letter-spacing: -0.1px; color: var(--text); }
.packet-doc-item-note { font-family: 'DM Sans', sans-serif; font-size: 12px; line-height: 1.55; color: var(--text-2); white-space: pre-wrap; }
.packet-doc-name-input { font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500; }
.packet-doc-note-input { min-height: 60px; resize: vertical; font-size: 12px; line-height: 1.5; }
.packet-doc-item-controls { display: flex; flex-direction: column; gap: 4px; align-self: stretch; }
.packet-doc-mini-btn {
  border: var(--line-w) solid var(--line); background: transparent; color: var(--text-2);
  font-family: 'DM Sans', sans-serif; font-size: 10px; font-weight: 500;
  padding: 4px 6px; cursor: pointer; transition: background 0.12s, color 0.12s, border-color 0.12s, opacity 0.12s, transform 0.12s, box-shadow 0.12s;
}
.packet-doc-mini-btn.drag-handle { cursor: grab; }
.packet-doc-mini-btn.drag-handle:active { cursor: grabbing; }
.packet-doc-mini-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.packet-doc-mini-btn.danger:hover { border-color: var(--red-s); color: var(--red-s); background: var(--red-dim); }

.packet-doc-new-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto; gap: 8px; align-items: end; }
.packet-doc-add-btn-wrap { display: flex; align-items: flex-end; padding-bottom: 1px; }

/* ── VARIANTES DE CARTÃO ── */
.card-script-content { white-space: pre-wrap; overflow-y: auto; max-height: 180px; font-size: 12px; line-height: 1.6; color: var(--text-2); margin-top: 4px; }
.card-event-date { font-size: 14px; font-weight: 600; }
.card-event-meta { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.card-map-link { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--accent); text-decoration: none; margin-top: 6px; }
.card-map-link:hover { text-decoration: underline; }

/* ── FORMULÁRIOS E CAMPOS ── */
.am-section { margin-bottom: 22px; }
.am-section-title {
  font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 2px;
  color: var(--text-2); margin-bottom: 10px; padding-bottom: 8px;
  border-bottom: var(--line-w) solid var(--line); text-transform: uppercase;
}
.am-row { display: flex; gap: 12px; margin-bottom: 12px; }
.am-field { flex: 1; }
.am-field label {
  display: block; font-family: 'DM Sans', sans-serif;
  font-weight: 500; font-size: 11px; color: var(--text-2); margin-bottom: 5px;
}

.am-input {
  width: 100%; background: var(--bg-2);
  border: 1px solid rgba(255,255,255,0.12); padding: 10px 14px;
  color: var(--text); font-family: 'DM Sans', sans-serif;
  font-size: 13px; outline: none;
  transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
}
.am-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
  background: var(--bg-3);
}
.am-input::placeholder { color: var(--text-3); font-size: 13px; }
.am-input[type="color"] { padding: 4px 8px; height: 40px; cursor: pointer; }
textarea.am-input { resize: vertical; min-height: 80px; line-height: 1.6; }
select.am-input { cursor: pointer; }

.form-attach-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.form-attach-name { font-size: 11px; color: var(--text-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── BOTÕES DOS MODAIS ── */
.am-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.am-footer-left { justify-content: flex-start; flex-wrap: wrap; }

.am-btn {
  padding: 10px 22px; border: none; cursor: pointer;
  font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500;
  transition: background 0.12s, color 0.12s, border-color 0.12s, opacity 0.12s, transform 0.12s, box-shadow 0.12s;
}
.am-btn:active { transform: scale(0.96); }
.am-btn-cancel {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.14);
  color: var(--text-2);
}
.am-btn-cancel:hover { border-color: rgba(255,255,255,0.3); color: var(--text); }
.am-btn-save {
  background: var(--accent); color: #fff;
  border-radius: var(--r-pill); padding: 10px 28px;
  font-weight: 700; letter-spacing: 0.3px;
}
.am-btn-save:hover { opacity: 0.88; }
.am-btn-danger { background: transparent; border: 1px solid rgba(239,68,68,0.35); color: var(--red-s); }
.am-btn-danger:hover { background: var(--red-dim); border-color: var(--red-s); }
.am-btn-trash { background: transparent; border: 1px solid rgba(239,68,68,0.2); color: #ef8080; margin-right: auto; }
.am-btn-trash:hover { background: var(--red-dim); border-color: var(--red-s); color: var(--red-s); }

/* ── CAIXA DE SELEÇÃO ── */
.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--text); font-family: 'DM Sans', sans-serif; }
.checkbox-label input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); }

/* ── MODAIS ── */
#shot-preview-overlay {
  position: fixed; inset: 0; z-index: 8000;
  background: rgba(0,0,0,0.92); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.shot-preview-box {
  position: relative; max-width: 860px; width: 100%;
  background: var(--bg-1); border-radius: var(--r-md);
  overflow: hidden; box-shadow: 0 24px 80px rgba(0,0,0,0.8);
}
.shot-preview-close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  background: rgba(0,0,0,0.6); border: none; color: #fff;
  width: 32px; height: 32px; border-radius: 50%; font-size: 14px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.shot-preview-close:hover { background: var(--accent); }
.shot-preview-img {
  width: 100%; max-height: 70vh;
  object-fit: contain; display: block;
  background: var(--bg-3);
}
.shot-preview-empty {
  width: 100%; height: 320px;
  background: var(--bg-3);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 80px; color: var(--accent); opacity: 0.1;
}
.shot-preview-meta {
  padding: 16px 20px 8px;
  display: flex; align-items: baseline; gap: 12px;
}
.shot-preview-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 36px; color: var(--accent); line-height: 1; flex-shrink: 0;
}
.shot-preview-label {
  font-size: 15px; color: var(--text-1); line-height: 1.5;
}
.shot-preview-actions {
  padding: 8px 20px 16px;
  display: flex; gap: 8px;
}
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(6px);
  z-index: 500;
  align-items: flex-start; justify-content: center;
  padding: 52px 20px; overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.access-modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.85); backdrop-filter: blur(6px); z-index: 500; align-items: flex-start; justify-content: center; padding: 44px 20px; overflow-y: auto; }
.access-modal-overlay.open { display: flex; }

.modal {
  background: var(--bg-3);
  border: 1px solid rgba(255,255,255,0.12);
  border-top: 2px solid var(--accent);
  width: 100%; max-width: 540px; padding: 32px 36px;
  animation: modalIn 0.22s cubic-bezier(0.16,1,0.3,1);
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}
.modal-lg { max-width: 700px; }
.modal-xl { max-width: 860px; }

/* ── Modal de novo projeto ── */
.np-modal { padding: 0; overflow: hidden; }
.np-header { padding: 28px 32px 20px; border-bottom: var(--line-w) solid var(--line); }
.np-header .modal-title { margin-bottom: 4px; }
.np-sub { font-family: 'DM Sans', sans-serif; font-size: 12px; color: var(--text-3); margin: 0; }
.np-body { padding: 24px 32px; display: flex; flex-direction: column; gap: 16px; }
.np-title-field input { font-size: 15px; font-weight: 500; }
.np-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.np-client-wrap { display: flex; gap: 6px; align-items: stretch; }
.np-client-wrap select { flex: 1; }
.np-add-client-btn { width: 36px; flex-shrink: 0; border: 1px solid rgba(255,255,255,0.12); background: var(--bg-2); color: var(--text-2); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: border-color 0.15s, color 0.15s; }
.np-add-client-btn:hover { border-color: var(--accent); color: var(--accent); }
.np-logo-row { display: flex; align-items: center; gap: 10px; padding-top: 4px; border-top: var(--line-w) solid var(--line); }
.np-logo-btn { display: flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid rgba(255,255,255,0.1); background: transparent; color: var(--text-3); cursor: pointer; font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 1px; text-transform: uppercase; transition: border-color 0.15s, color 0.15s; flex-shrink: 0; }
.np-logo-btn:hover { border-color: var(--text-3); color: var(--text); }
.np-logo-name { font-family: 'DM Mono', monospace; font-size: 9px; color: var(--text-3); letter-spacing: 0.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-modal .am-footer { padding: 16px 32px 24px; border-top: var(--line-w) solid var(--line); margin-top: 0; }
body.theme-light .np-add-client-btn { border-color: rgba(0,0,0,0.14); background: var(--bg-2); }
body.theme-light .np-logo-btn { border-color: rgba(0,0,0,0.14); }
@media (max-width: 600px) { .np-row-2 { grid-template-columns: 1fr; } .np-header, .np-body, .np-modal .am-footer { padding-left: 20px; padding-right: 20px; } }
.access-modal {
  background: var(--bg-3);
  border: 1px solid rgba(255,255,255,0.12);
  border-top: 2px solid var(--accent);
  width: 100%; max-width: 640px; padding: 32px 36px; position: relative;
  animation: modalIn 0.22s cubic-bezier(0.16,1,0.3,1);
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}

.modal-title {
  font-family: 'Bebas Neue', 'Barlow Condensed', sans-serif;
  font-size: 24px; letter-spacing: 2px;
  margin-bottom: 22px; color: var(--text);
}
.modal-title span { color: var(--accent); }
.access-modal-title {
  font-family: 'Bebas Neue', 'Barlow Condensed', sans-serif;
  font-size: 24px; letter-spacing: 2px; margin-bottom: 22px; color: var(--text);
}
.access-modal-title span { color: var(--accent); }

/* ── GESTÃO DE ACESSOS ── */
.access-list {
  display: flex; flex-direction: column;
  border: var(--line-w) solid var(--line);
  margin-top: 8px; overflow: hidden;
}

.access-row {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 18px;
  background: var(--bg-2);
  border-bottom: var(--line-w) solid var(--line);
  border-left: 3px solid transparent;
  transition: background 0.12s, border-left-color 0.12s;
  position: relative;
}
.access-row:last-child { border-bottom: none; }
.access-row:hover { background: var(--bg-3); }
.access-row.is-inactive { opacity: 0.46; filter: saturate(0.3); }
.access-row.is-super-admin { border-left-color: #c9920a; }

.access-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Barlow Condensed', sans-serif; font-weight: 900; font-size: 14px;
  color: #fff; flex-shrink: 0; letter-spacing: 0.5px;
}
.access-row.is-super-admin .access-avatar {
  box-shadow: 0 0 0 2px #c9920a;
}

.access-identity { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.access-name {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 800;
  font-size: 17px; letter-spacing: 0.2px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.access-username {
  font-family: 'DM Mono', monospace; font-size: 11px;
  color: var(--text-3); white-space: nowrap;
}
.access-crown {
  font-size: 12px; line-height: 1; flex-shrink: 0;
  color: #c9920a;
}

.access-role-badge {
  font-family: 'DM Mono', monospace; font-size: 9px;
  letter-spacing: 0.8px; text-transform: uppercase;
  padding: 3px 8px; border-radius: var(--r-pill);
  border: 1px solid; white-space: nowrap; flex-shrink: 0;
}
.access-role-badge.role-admin    { background: rgba(237,28,36,0.10);   color: var(--accent);   border-color: rgba(237,28,36,0.25); }
.access-role-badge.role-producer { background: rgba(245,158,11,0.10); color: var(--amber);    border-color: rgba(245,158,11,0.28); }
.access-role-badge.role-client   { background: rgba(100,160,255,0.09);color: #7eb3ff;         border-color: rgba(100,160,255,0.22); }
.access-role-badge.role-default  { background: rgba(255,255,255,0.05);color: var(--text-2);   border-color: var(--line); }

.access-meta { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.access-scope {
  font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--text-3); white-space: nowrap;
}

.access-filter-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin: 8px 0; flex-wrap: wrap;
}
.access-status-chips, .access-scope-chips { display: flex; gap: 6px; flex-wrap: wrap; }

.access-status-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--bg-3);
}
.access-status-dot.active   { background: var(--green); }
.access-status-dot.inactive { background: var(--red-s); }
.access-status-dot.archived { background: var(--text-3); }

.access-row.is-archived { opacity: 0.48; filter: saturate(0.2); }

.access-empty {
  padding: 32px; text-align: center; color: var(--text-3);
  font-size: 13px; letter-spacing: 0.5px;
}

.access-icon-btns { display: flex; align-items: center; gap: 2px; }
.access-icon-btn {
  width: 34px; height: 34px; border: 1px solid transparent;
  background: transparent; color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border-radius: var(--r-md);
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.access-icon-btn:hover { background: var(--bg-4); color: var(--text); border-color: var(--line); }
.access-icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.access-icon-btn.btn-edit:hover       { color: var(--accent); border-color: var(--border-a); background: var(--accent-dim); }
.access-icon-btn.btn-power:hover      { color: var(--amber);  border-color: rgba(245,158,11,0.28); background: var(--amber-dim); }
.access-icon-btn.btn-power.reactivate:hover { color: var(--green); border-color: rgba(34,197,94,0.28); background: var(--green-dim); }
.access-icon-btn.btn-delete:hover     { color: var(--red-s);  border-color: rgba(239,68,68,0.28); background: var(--red-dim); }
.access-icon-btn svg { width: 15px; height: 15px; pointer-events: none; }

.perm-chip {
  font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 0.5px;
  padding: 2px 7px; border-radius: var(--r-pill);
  background: rgba(255,255,255,0.04); color: var(--text-2); border: var(--line-w) solid var(--line);
}
.perm-chip.on { background: var(--accent-dim); color: var(--accent); border-color: var(--border-a); }

.access-btn {
  flex: 1; padding: 7px; border: var(--line-w) solid var(--line);
  background: transparent; color: var(--text-2);
  font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: background 0.12s, color 0.12s, border-color 0.12s, opacity 0.12s, transform 0.12s, box-shadow 0.12s;
}
.access-btn:hover { border-color: var(--accent); color: var(--accent); }
.access-btn.danger:hover { border-color: var(--red-s); color: var(--red-s); }

/* ── EDITOR DE ROLES ── */
/* ── GESTOR DE ROLES ── */
.roles-manager {
  margin-top: 10px;
  border: var(--line-w) solid var(--line);
  border-top: 2px solid var(--accent);
  overflow: hidden;
}
.roles-manager-grid {
  display: grid;
  grid-template-columns: 240px minmax(0,1fr);
}
.roles-manager-grid.editor-hidden {
  grid-template-columns: 1fr;
}

.roles-list-pane {
  background: var(--bg-2);
  border-right: var(--line-w) solid var(--line);
  padding: 14px 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.roles-list-header {
  display: flex; align-items: center; justify-content: space-between;
}
.role-new-btn {
  width: 28px; height: 28px; border-radius: var(--r);
  border: var(--line-w) solid var(--line); background: transparent;
  color: var(--text-3); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.role-new-btn:hover { background: var(--accent-dim); color: var(--accent); border-color: var(--border-a); }
.role-new-btn svg { width: 14px; height: 14px; }

.role-template-list {
  display: flex; flex-direction: column; gap: 2px;
  max-height: 480px; overflow-y: auto;
}
.role-template-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; border: 1px solid transparent;
  background: transparent; color: var(--text-2);
  font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  text-align: left; width: 100%; border-radius: var(--r);
}
.role-template-item:hover { background: var(--bg-3); color: var(--text); }
.role-template-item.active { background: var(--accent-dim); color: var(--accent); border-color: var(--border-a); }
.role-template-badge {
  font-family: 'DM Mono', monospace; font-size: 8px;
  letter-spacing: 1px; text-transform: uppercase;
  padding: 2px 5px; border-radius: var(--r-pill); flex-shrink: 0;
}
.role-template-badge.system { background: rgba(255,255,255,0.06); color: var(--text-3); }
.role-template-badge.custom { background: var(--accent-dim); color: var(--accent); }
.role-template-empty {
  padding: 24px 12px; text-align: center;
  font-size: 11px; color: var(--text-3);
  font-family: 'DM Mono', monospace; letter-spacing: 1px;
  border: 1px dashed rgba(255,255,255,0.06);
}

.roles-editor-pane { background: var(--bg-3); padding: 24px 28px; }
.role-editor-title {
  font-family: 'Bebas Neue', 'Barlow Condensed', sans-serif;
  font-size: 22px; letter-spacing: 2px; margin-bottom: 20px; color: var(--text);
}
.role-editor-title span { color: var(--accent); }

.role-perm-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.role-select-all-btn {
  font-family: 'DM Mono', monospace; font-size: 9px;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-3); background: transparent; border: none;
  cursor: pointer; padding: 2px 0;
  transition: color 0.12s;
}
.role-select-all-btn:hover { color: var(--accent); }
.role-select-all-btn.is-deselect { color: var(--red-s); }

.role-perm-grid { display: flex; flex-direction: column; gap: 4px; }

.role-perm-group { border: var(--line-w) solid var(--line); border-radius: var(--r); overflow: hidden; }
.role-perm-group[open] { border-color: rgba(237,28,36,0.15); }

.role-perm-group-label {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px;
  font-family: 'DM Mono', monospace;
  font-size: 9px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--text-2); cursor: pointer;
  list-style: none; user-select: none;
  background: var(--bg-2);
  transition: background 0.1s, color 0.1s;
}
.role-perm-group[open] .role-perm-group-label { color: var(--accent); background: var(--accent-dim); }
button.role-perm-group-label { width: 100%; border: 0; border-radius: 0; text-align: left; }
.role-perm-group:not([open]) .role-perm-group-items { display: none; }
.role-perm-chevron { width: 13px; height: 13px; flex-shrink: 0; transition: transform 0.18s; }
.role-perm-group[open] .role-perm-chevron { transform: rotate(180deg); }

.role-perm-group-items {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1px;
  background: var(--line); border-top: var(--line-w) solid var(--line);
}
.role-perm-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 12px; background: var(--bg-3);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px; color: var(--text-2); cursor: pointer; user-select: none;
  transition: background 0.1s, color 0.1s;
}
.role-perm-item:hover { background: var(--bg-2); color: var(--text); }
.role-perm-item:has(input:checked) { color: var(--text); background: rgba(237,28,36,0.04); }
.role-perm-item input {
  accent-color: var(--accent);
  width: 14px; height: 14px; flex-shrink: 0; cursor: pointer;
}

.role-editor-actions {
  margin-top: 20px; padding-top: 16px; border-top: var(--line-w) solid var(--line);
  display: flex; gap: 10px; justify-content: flex-end;
}
body.theme-light .role-perm-group { border-color: rgba(0,0,0,0.08); }
body.theme-light .role-perm-group-label { background: var(--bg-2); }
body.theme-light .role-perm-group[open] .role-perm-group-label { background: var(--accent-dim); }
body.theme-light .role-perm-item { background: #fff; }
body.theme-light .role-perm-item:hover { background: var(--bg-3); }

/* ── INTERRUPTORES DE SECÇÃO ── */
.section-toggles { display: flex; flex-direction: column; gap: 8px; }
.toggle-row { display: flex; align-items: center; gap: 12px; }
.toggle-label { font-size: 13px; font-weight: 500; }
.proj-perm-list { display: flex; flex-direction: column; gap: 4px; }
.proj-perm-row { background: var(--bg-3); border: var(--line-w) solid var(--line); overflow: hidden; }
.proj-perm-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; cursor: pointer; transition: background 0.12s; }
.proj-perm-header:hover { background: rgba(255,255,255,0.03); }
.proj-perm-name { display: flex; align-items: center; gap: 10px; font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 13px; letter-spacing: 0.5px; }
.proj-perm-docs { display: none; padding: 10px 14px; border-top: var(--line-w) solid var(--line); }
.proj-perm-row.open .proj-perm-docs { display: block; }
.proj-perm-row.open > .proj-perm-header > svg { transform: rotate(180deg); }
.doc-check-grid { display: flex; flex-wrap: wrap; gap: 5px; }
.doc-chip { padding: 3px 10px; border-radius: var(--r-pill); border: var(--line-w) solid var(--line); background: transparent; color: var(--text-3); font-family: 'DM Sans', sans-serif; font-size: 11px; font-weight: 500; cursor: pointer; transition: background 0.12s, color 0.12s, border-color 0.12s, opacity 0.12s, transform 0.12s, box-shadow 0.12s; }
.doc-chip.selected, .doc-chip:hover { background: var(--accent-dim); color: var(--accent); border-color: var(--border-a); }

/* ── INTERRUPTOR ── */
.toggle { width: 36px; height: 18px; border-radius: var(--r-pill); background: var(--bg-4); border: var(--line-w) solid var(--line); cursor: pointer; position: relative; transition: background 0.18s, color 0.18s, border-color 0.18s, opacity 0.18s, transform 0.18s, box-shadow 0.18s; flex-shrink: 0; }
.toggle.on { background: rgba(237,28,36,0.18); border-color: var(--border-a); }
.toggle::after { content: ''; position: absolute; width: 12px; height: 12px; border-radius: 50%; background: var(--text-3); top: 2px; left: 2px; transition: background 0.18s, color 0.18s, border-color 0.18s, opacity 0.18s, transform 0.18s, box-shadow 0.18s; }
.toggle.on::after { left: 20px; background: var(--accent); }

/* ── PERFIL ── */
.profile-layout { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
.prof-card {
  background: var(--bg-2); border: var(--line-w) solid var(--line);
  border-top: 2px solid var(--accent);
  padding: 28px; text-align: center;
}
.prof-av {
  width: 64px; height: 64px; background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Bebas Neue', 'Barlow Condensed', sans-serif;
  font-size: 24px; color: oklch(97% 0.003 85);
  margin: 0 auto 14px;
}
.prof-name { font-family: 'Bebas Neue', 'Barlow Condensed', sans-serif; font-size: 24px; letter-spacing: 2px; margin-bottom: 2px; }
.prof-role { font-size: 11px; color: var(--text-2); margin-bottom: 20px; font-family: 'DM Mono', monospace; letter-spacing: 1px; text-transform: uppercase; }
.prof-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); margin-bottom: 22px; }
.pstat { background: var(--bg-3); padding: 12px 6px; text-align: center; }
.pstat-val { font-family: 'Bebas Neue', 'Barlow Condensed', sans-serif; font-size: 22px; color: var(--accent); }
.pstat-label { font-family: 'DM Mono', monospace; font-size: 9px; color: var(--text-3); margin-top: 2px; letter-spacing: 1px; text-transform: uppercase; }
.info-row { text-align: left; margin-bottom: 14px; }
.info-lbl { font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-3); margin-bottom: 3px; }
.info-val { font-size: 13px; font-family: 'DM Sans', sans-serif; }
.prof-right { display: flex; flex-direction: column; gap: 14px; }
.sett-card { background: var(--bg-2); border: var(--line-w) solid var(--line); overflow: hidden; }
.sett-hdr { padding: 14px 20px; border-bottom: var(--line-w) solid var(--line); font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 2px; text-transform: uppercase; color: var(--text-2); }
.sett-row { padding: 16px 20px; border-bottom: 1px solid var(--line-2); display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.sett-row:last-child { border-bottom: none; }
.sett-row-lbl { font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 500; color: var(--text); }
.sett-row-desc { font-family: 'DM Sans', sans-serif; font-size: 12px; color: var(--text-3); margin-top: 2px; }
#profile-scope-switch-btn { min-width: 0; white-space: nowrap; flex-shrink: 0; border-radius: var(--r-pill); padding: 9px 20px; font-weight: 600; font-size: 13px; }
.cp-fields { padding: 16px 20px 8px; display: flex; flex-direction: column; gap: 10px; }
.cp-footer { padding: 10px 20px 16px; display: flex; justify-content: flex-end; }
.sett-locked-msg { padding: 16px 20px; font-size: 13px; color: var(--text-3); margin: 0; }

/* ── PÁGINA DE BIO ── */
.bio-hero { background: transparent; padding: 40px 0 48px; margin-bottom: 32px; position: relative; display: grid; grid-template-columns: 1fr 300px; gap: 48px; align-items: start; border-bottom: var(--line-w) solid var(--line); }
.bio-hero::before { content: ''; position: absolute; top: 0; left: 0; width: 24px; height: 2px; background: var(--accent); }
.bio-hero-left h1 { font-family: 'Bebas Neue', 'Barlow Condensed', sans-serif; font-size: 56px; text-transform: uppercase; letter-spacing: 2px; line-height: 0.9; margin-bottom: 14px; margin-top: 20px; }
.bio-hero-left h1 span { color: var(--accent); }
.bio-tagline { font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--text-2); margin-bottom: 14px; }
.bio-hero-left p { font-size: 14px; color: var(--text-2); line-height: 1.75; max-width: 480px; margin-bottom: 22px; }
.bio-contact-grid { display: flex; flex-direction: column; gap: 12px; }
.bio-contact-item { display: flex; align-items: flex-start; gap: 12px; }
.bio-contact-icon { width: 28px; height: 28px; background: var(--accent-dim); border: 1px solid var(--border-a); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--accent); }
.bio-contact-icon svg { width: 12px; height: 12px; }
.bio-contact-lbl { font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-3); margin-bottom: 2px; }
.bio-contact-val { font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500; color: var(--text); }
.bio-contact-val a { color: var(--accent); text-decoration: none; }
.bio-contact-val a:hover { text-decoration: underline; }
.bio-section { background: var(--bg-2); border: var(--line-w) solid var(--line); padding: 22px 26px; margin-bottom: 12px; }
.bio-section-title { font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--accent); margin-bottom: 18px; }
.team-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); }
.team-card { background: var(--bg-3); border: none; padding: 18px; text-align: center; transition: background 0.12s; }
.team-card:hover { background: var(--bg-4); }
.team-av { width: 44px; height: 44px; background: var(--accent); display: flex; align-items: center; justify-content: center; font-family: 'Barlow Condensed', sans-serif; font-weight: 900; font-size: 15px; color: oklch(97% 0.003 85); margin: 0 auto 10px; }
.team-name { font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 15px; letter-spacing: 0.3px; margin-bottom: 2px; }
.team-role { font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 1px; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.team-email { font-size: 11px; color: var(--text-2); }
.team-email a { color: var(--text-2); text-decoration: none; }
.team-email a:hover { color: var(--accent); }

/* ── SECÇÕES DE LISBOA ── */
.lisbon-hero { background: transparent; padding: 32px 0 36px; margin-bottom: 28px; position: relative; border-bottom: var(--line-w) solid var(--line); }
.lisbon-hero::before { content: ''; display: block; width: 20px; height: 2px; background: var(--accent); margin-bottom: 22px; }
.lisbon-hero h2 { font-family: 'Bebas Neue', 'Barlow Condensed', sans-serif; font-size: 48px; text-transform: uppercase; letter-spacing: 2px; line-height: 0.9; margin-bottom: 10px; }
.lisbon-hero p { font-size: 14px; color: var(--text-2); line-height: 1.7; }
.places-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-bottom: 24px; background: var(--line); border: var(--line-w) solid var(--line); }
.place-card { background: var(--bg-2); overflow: hidden; cursor: pointer; transition: background 0.12s; }
.place-card:hover { background: var(--bg-3); }
.place-thumb { height: 110px; display: flex; align-items: center; justify-content: center; font-size: 40px; background: var(--bg-3); position: relative; overflow: hidden; }
.place-body { padding: 12px 14px; }
.place-name { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 14px; letter-spacing: 0.3px; margin-bottom: 3px; }
.place-desc { font-size: 12px; color: var(--text-2); line-height: 1.5; }
.place-tag { display: inline-block; margin-top: 6px; padding: 2px 8px; background: var(--accent-dim); color: var(--accent); font-family: 'DM Mono', monospace; font-size: 9px; border-radius: var(--r-pill); }
.place-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-bottom: 20px; }
.place-detail-image-wrap { overflow: hidden; height: 260px; background: var(--bg-3); }
.place-detail-image-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.place-detail-info { display: flex; flex-direction: column; gap: 14px; }

/* ── MENSAGENS E CHAT ── */
.msg-layout { display: grid; grid-template-columns: 260px 1fr; gap: 1px; height: calc(100vh - 140px); background: var(--line); }
.conv-panel { background: var(--bg-2); overflow-y: auto; }
.conv-panel-hdr { padding: 14px 16px; border-bottom: var(--line-w) solid var(--line); font-family: 'Bebas Neue', 'Barlow Condensed', sans-serif; font-size: 16px; letter-spacing: 2px; text-transform: uppercase; }
.conv-item { padding: 12px 16px; border-bottom: var(--line-w) solid var(--line); cursor: pointer; transition: background 0.12s; display: flex; gap: 10px; align-items: center; }
.conv-item:hover, .conv-item.on { background: var(--bg-3); }
.conv-item.on { border-left: 2px solid var(--accent); }
.cav { width: 32px; height: 32px; border-radius: var(--r); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 11px; color: oklch(97% 0.003 85); background: var(--accent); }
.conv-name { font-family: 'DM Sans', sans-serif; font-weight: 500; font-size: 13px; margin-bottom: 2px; }
.conv-prev { font-size: 11px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.conv-time { font-size: 10px; color: var(--text-3); margin-left: auto; flex-shrink: 0; }
.unread { width: 14px; height: 14px; background: var(--accent); border-radius: 50%; font-size: 8px; font-weight: 700; color: oklch(97% 0.003 85); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.chat-panel { background: var(--bg-2); display: flex; flex-direction: column; }
.chat-hdr { padding: 14px 18px; border-bottom: var(--line-w) solid var(--line); display: flex; align-items: center; gap: 12px; }
.chat-hdr-info h4 { font-family: 'DM Sans', sans-serif; font-weight: 600; font-size: 14px; }
.chat-hdr-info span { font-family: 'DM Mono', monospace; font-size: 10px; color: var(--accent); letter-spacing: 0.5px; }
.chat-msgs { flex: 1; padding: 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.cmsg { display: flex; gap: 8px; max-width: 68%; }
.cmsg.out { align-self: flex-end; flex-direction: row-reverse; }
.cmsg-av { width: 24px; height: 24px; border-radius: var(--r); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 9px; color: oklch(97% 0.003 85); background: var(--accent); }
.cmsg-bubble { padding: 8px 12px; font-size: 13px; line-height: 1.55; background: var(--bg-3); border: var(--line-w) solid var(--line); }
.cmsg.out .cmsg-bubble { background: var(--accent-dim); border-color: var(--border-a); }
.cmsg-time { font-size: 10px; color: var(--text-3); align-self: flex-end; margin: 0 4px; }
.chat-input-row { padding: 12px 18px; border-top: var(--line-w) solid var(--line); display: flex; gap: 8px; align-items: center; }
.chat-inp { flex: 1; background: var(--bg-3); border: var(--line-w) solid var(--line); padding: 8px 12px; color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 13px; outline: none; transition: border-color 0.12s, box-shadow 0.12s; }
.chat-inp:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-dim); }
.send-btn { width: 34px; height: 34px; background: var(--accent); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: opacity 0.12s; }
.send-btn:hover { opacity: 0.88; }

/* ── CHAT DE SUPORTE ── */
/* ── Botão de suporte ── */
#support-help-fab {
  position: fixed; bottom: 24px; right: 20px; z-index: 9999;
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-a); background: var(--bg-2); color: var(--accent);
  border-radius: var(--r-md);
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.45), 0 0 0 1px rgba(237,28,36,0.08);
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
#support-help-fab svg { width: 18px; height: 18px; flex-shrink: 0; }
#support-help-fab:hover {
  transform: translateY(-2px);
  background: var(--bg-3);
  box-shadow: 0 8px 32px rgba(0,0,0,0.55), 0 0 0 1px var(--border-a);
}
#support-help-fab .support-fab-badge {
  position: absolute; top: -4px; right: -4px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg);
  display: none;
}
#support-help-fab.has-unread .support-fab-badge { display: block; }

/* ── Camada de suporte ── */
#support-chat-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 11970; display: none;
  align-items: flex-end; justify-content: flex-end;
  padding: 76px 20px 20px;
}
#support-chat-overlay.open { display: flex; }

/* ── Painel ── */
.support-chat-panel {
  width: min(420px, calc(100vw - 28px));
  max-height: min(640px, calc(100vh - 96px));
  background: var(--bg-1);
  border: var(--line-w) solid var(--line);
  border-top: 3px solid var(--accent);
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

/* ── Cabeçalho do painel ── */
.support-chat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  background: var(--bg-2);
  border-bottom: var(--line-w) solid var(--line);
  flex-shrink: 0;
}
.support-chat-title {
  font-family: 'Bebas Neue', 'Barlow Condensed', sans-serif;
  font-size: 18px; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--text);
}
.support-chat-title span { color: var(--accent); }
.support-chat-close {
  border: none; background: transparent;
  color: var(--text-3); font-size: 22px; line-height: 1;
  cursor: pointer; padding: 2px 4px;
  transition: color 0.12s;
}
.support-chat-close:hover { color: var(--text); }

/* ── Corpo do painel ── */
.support-chat-body {
  padding: 18px; display: flex; flex-direction: column;
  gap: 12px; flex: 1; overflow-y: auto; min-height: 260px;
}

/* ── Formulário de novo ticket ── */
.support-chat-copy {
  font-size: 13px; line-height: 1.55; color: var(--text-2);
  border-bottom: var(--line-w) solid var(--line); padding-bottom: 14px; margin-bottom: 2px;
}
.support-chat-label {
  display: block; font-family: 'DM Mono', monospace;
  font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 6px;
}
.support-chat-input {
  width: 100%; background: var(--bg-3); border: var(--line-w) solid var(--line);
  padding: 10px 14px; color: var(--text); font-size: 14px;
  margin-bottom: 12px; outline: none;
  transition: border-color 0.12s, background 0.12s;
}
.support-chat-input:focus { border-color: var(--accent); background: var(--bg-4); }
.support-chat-note { min-height: 18px; font-size: 12px; color: var(--text-2); }
.support-chat-note[data-state='error'] { color: var(--red-s); }

/* ── Conversa ── */
.support-conversation { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.support-ticket-meta {
  display: flex; align-items: center; gap: 8px;
  font-family: 'DM Mono', monospace; font-size: 10px;
  letter-spacing: 0.8px; text-transform: uppercase;
  color: var(--text-3); padding-bottom: 8px;
  border-bottom: var(--line-w) solid var(--line);
}

/* ── Lista de mensagens ── */
.support-messages {
  flex: 1; min-height: 240px; max-height: 340px;
  overflow-y: auto; display: flex; flex-direction: column;
  gap: 10px; padding: 2px 0;

}
.support-msg {
  max-width: 92%; padding: 9px 13px;
  background: var(--bg-3); border: var(--line-w) solid var(--line);
  font-size: 13px; line-height: 1.5;
}
.support-msg.mine {
  margin-left: auto;
  background: var(--accent-dim);
  border-color: var(--border-a);
}
.support-msg.support { margin-right: auto; }
.support-msg.system {
  margin: 4px auto; text-align: center; max-width: 80%;
  border: none; background: transparent;
  color: var(--text-3); font-size: 11px;
}
.support-msg-head {
  display: flex; justify-content: space-between; gap: 8px;
  font-family: 'DM Mono', monospace; font-size: 9px;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-3); margin-bottom: 5px;
}
.support-msg.mine .support-msg-head { color: var(--accent); opacity: 0.7; }
.support-msg-body { color: var(--text); word-break: break-word; }
.support-msg-media-link {
  display: block; margin-top: 8px; overflow: hidden;
  border: var(--line-w) solid var(--line); max-width: 200px;
}
.support-msg.mine .support-msg-media-link { border-color: var(--border-a); }
.support-msg-media { display: block; width: 100%; height: auto; max-width: 200px; max-height: 200px; object-fit: cover; }

/* ── Área de escrita ── */
.support-compose {
  border-top: var(--line-w) solid var(--line); padding-top: 12px;
  display: flex; flex-direction: column; gap: 8px; flex-shrink: 0;
}
.support-compose-toolbar { display: flex; align-items: center; gap: 8px; }
#support-attach-btn { padding: 5px 10px; font-size: 11px; }
.support-attach-name {
  font-size: 11px; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1;
}
.support-compose-input {
  width: 100%; background: var(--bg-3); border: var(--line-w) solid var(--line);
  padding: 10px 13px; color: var(--text); font-family: 'DM Sans', sans-serif;
  font-size: 13px; resize: none; min-height: 72px; outline: none;
  transition: border-color 0.12s, background 0.12s;
}
.support-compose-input:focus { border-color: var(--accent); background: var(--bg-4); }
.support-compose-actions { display: flex; justify-content: flex-end; gap: 8px; align-items: center; }

/* ── TRANSIÇÃO DE TEMA ── */
body.theme-switching *,
body.theme-switching *::before,
body.theme-switching *::after {
  transition:
    background-color 0.22s ease,
    color 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease !important;
}

.loading-wordmark, .login-brand, .hero-logo-big, .ki-logo-img { transition: opacity 0.13s ease; }
body.theme-switching .loading-wordmark,
body.theme-switching .login-brand,
body.theme-switching .hero-logo-big,
body.theme-switching .ki-logo-img { opacity: 0 !important; transition: opacity 0.13s ease !important; }

/* ── AVISOS E DIÁLOGOS ── */
#dirty-badge {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  background: #c0392b; color: #fff;
  padding: 5px 16px; border-radius: var(--r-pill);
  font-size: 11px; font-family: 'DM Mono', monospace; font-weight: 500;
  letter-spacing: 0.5px; z-index: 9500; pointer-events: none;
  box-shadow: 0 2px 12px rgba(192,57,43,0.45);
  animation: dirty-pulse 2s ease-in-out infinite;
}
@keyframes dirty-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
#ui-toast-stack { position: fixed; top: 14px; right: 60px; z-index: 12000; width: min(340px, calc(100vw - 80px)); display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.ui-toast {
  pointer-events: auto; border: var(--line-w) solid var(--line);
  background: var(--bg-3); color: var(--text);
  padding: 10px 14px; font-family: 'DM Sans', sans-serif;
  font-size: 13px; line-height: 1.45;
  box-shadow: 0 8px 28px rgba(0,0,0,0.6);
  animation: toastIn 0.15s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: translateX(0); } }
.ui-toast.info   { border-color: rgba(255,255,255,0.12); }
.ui-toast.success { border-color: rgba(34,197,94,0.40); }
.ui-toast.error  { border-color: rgba(239,68,68,0.40); }

#ui-dialog-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.82); backdrop-filter: blur(6px); z-index: 12010; display: none; align-items: center; justify-content: center; padding: 20px; }
#ui-dialog-overlay.open { display: flex; }
.ui-dialog { width: min(420px, 100%); background: var(--bg-3); border: 1px solid rgba(255,255,255,0.09); padding: 22px; animation: modalIn 0.18s cubic-bezier(0.16,1,0.3,1); }
.ui-dialog-title { font-family: 'Bebas Neue', 'Barlow Condensed', sans-serif; font-size: 20px; letter-spacing: 2px; color: var(--accent); margin-bottom: 10px; }
.ui-dialog-message { font-family: 'DM Sans', sans-serif; color: var(--text-2); font-size: 14px; line-height: 1.55; white-space: pre-wrap; margin-bottom: 16px; }
.ui-dialog-input { width: 100%; background: var(--bg-4); border: 1px solid rgba(255,255,255,0.12); padding: 10px 14px; color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 14px; margin-bottom: 14px; outline: none; }
.ui-dialog-input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-dim); }
.ui-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ── INÍCIO DE SESSÃO ── */
#login-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: oklch(9% 0.006 35);
  background-image:
    radial-gradient(ellipse 70% 60% at 50% 0%, rgba(237,28,36,0.07) 0%, transparent 65%),
    repeating-linear-gradient(-55deg, transparent, transparent 40px, rgba(255,255,255,0.008) 40px, rgba(255,255,255,0.008) 41px);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
#login-overlay.open { display: flex; }

#login-box {
  background: var(--bg-2);
  border: 1px solid oklch(26% 0.008 15);
  border-top: 3px solid var(--accent);
  padding: 48px 44px 44px;
  width: 100%; max-width: 400px; position: relative;
  animation: modalIn 0.24s cubic-bezier(0.16,1,0.3,1);
  box-shadow: 0 32px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(237,28,36,0.06);
}

.login-brand {
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 40px;
}
.login-brand img { height: 40px; width: auto; }

#login-box h2 {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
  font-size: 13px; letter-spacing: 3px; color: var(--text-2);
  margin-bottom: 4px; text-align: center; text-transform: uppercase;
}
#login-box .login-sub { font-family: 'DM Sans', sans-serif; font-size: 13px; color: var(--text-3); margin-bottom: 28px; text-align: center; }

.login-field { margin-bottom: 8px; }
.login-field label { display: none; }
.login-field input {
  width: 100%; height: 48px;
  background: var(--bg-3); border: 1px solid oklch(26% 0.008 15);
  padding: 0 16px; color: var(--text);
  font-family: 'DM Sans', sans-serif; font-size: 14px;
  outline: none; transition: border-color 0.12s, box-shadow 0.12s;
  box-sizing: border-box; border-radius: var(--r);
}
.login-field input::placeholder { color: var(--text-3); }
.login-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

#login-submit {
  width: 100%; height: 48px; margin-top: 12px;
  background: var(--accent); color: #fff; border: none;
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
  font-size: 15px; letter-spacing: 2px; text-transform: uppercase;
  cursor: pointer; transition: opacity 0.12s, box-shadow 0.12s;
  border-radius: var(--r);
}
#login-submit:hover { opacity: 0.90; box-shadow: 0 4px 20px var(--accent-glow); }
#login-submit:active { opacity: 0.75; }

#login-close { position: absolute; top: 14px; right: 16px; background: none; border: none; color: var(--text-3); font-size: 16px; cursor: pointer; line-height: 1; transition: color 0.12s; }
#login-close:hover { color: var(--text); }
#login-error { color: var(--red-s); font-family: 'DM Sans', sans-serif; font-size: 12px; margin-top: 12px; display: none; text-align: center; line-height: 1.5; }

/* ── MODO DE FEEDBACK ── */
#fb-toggle { position: fixed; bottom: 22px; right: 22px; z-index: 9999; background: var(--accent); color: oklch(97% 0.003 85); font-family: 'DM Mono', monospace; font-weight: 500; font-size: 11px; letter-spacing: 1px; padding: 10px 16px; border: none; cursor: pointer; box-shadow: 0 4px 20px var(--accent-glow); display: flex; align-items: center; gap: 7px; transition: background 0.18s, color 0.18s, border-color 0.18s, opacity 0.18s, transform 0.18s, box-shadow 0.18s; }
#fb-toggle:hover { background: var(--accent-h); transform: translateY(-1px); }
#fb-toggle.active { background: #ff4444; color: #fff; }
.fb-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--bg); }
#fb-toggle.active .fb-dot { background: #fff; animation: fbBlink 1s infinite; }
@keyframes fbBlink { 0%,100% { opacity: 1 } 50% { opacity: 0.3 } }
#fb-bar { position: fixed; top: 0; left: var(--sidebar-w); right: 0; z-index: 9996; background: rgba(237,28,36,0.95); color: #000; font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: 2px; text-transform: uppercase; padding: 6px 20px; text-align: center; display: none; }
body.fb-mode * { cursor: crosshair !important; }
body.fb-mode *:not(#fb-toggle):not(#fb-bar):not(#fb-popup):not(#fb-popup *):not(.fb-pin):hover { outline: 2px solid var(--accent) !important; outline-offset: 2px; }
#fb-popup { position: fixed; z-index: 10000; background: var(--bg-3); border: 1px solid var(--accent); padding: 14px; width: 290px; box-shadow: 0 8px 30px rgba(0,0,0,0.7); display: none; }
#fb-popup h4 { font-family: 'Bebas Neue', 'Barlow Condensed', sans-serif; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
#fb-element-name { background: var(--bg-4); border: var(--line-w) solid var(--line); padding: 5px 9px; font-family: 'DM Mono', monospace; font-size: 11px; color: var(--text-2); margin-bottom: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#fb-textarea { width: 100%; background: var(--bg-4); border: var(--line-w) solid var(--line); padding: 9px 12px; color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 13px; resize: none; height: 84px; outline: none; transition: border-color 0.15s; box-sizing: border-box; }
#fb-textarea:focus { border-color: var(--accent); }
.fb-popup-btns { display: flex; gap: 7px; margin-top: 9px; }
.fb-btn { flex: 1; padding: 8px; border: none; font-family: 'DM Sans', sans-serif; font-weight: 600; font-size: 12px; cursor: pointer; }
.fb-btn-save { background: var(--accent); color: #fff; }
.fb-btn-cancel { background: var(--bg-5); color: var(--text-2); border: var(--line-w) solid var(--line); }
.fb-pin { position: fixed; z-index: 9998; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: oklch(97% 0.003 85); font-family: 'Barlow Condensed', sans-serif; font-weight: 900; font-size: 10px; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 2px 10px var(--accent-glow); border: 2px solid oklch(97% 0.003 85); transition: transform 0.12s; }
.fb-pin:hover { transform: scale(1.2); }
#fb-toast { position: fixed; bottom: 76px; left: 50%; transform: translateX(-50%); background: var(--bg-3); border: 1px solid var(--border-a); color: var(--accent); font-family: 'DM Mono', monospace; font-weight: 500; font-size: 11px; letter-spacing: 1px; padding: 8px 16px; z-index: 10001; opacity: 0; transition: opacity 0.18s; pointer-events: none; }
#fb-toast.show { opacity: 1; }

/* ── UTILITÁRIOS ── */
.btn-sm { font-size: 12px; padding: 5px 12px; }
.hidden-file-input { display: none; }
.am-input.btn-sm { padding: 6px 12px; }

/* ── IMPRESSÃO ── */
@media print {
  .sidebar, #theme-toggle-fab, .loading-screen, #login-overlay,
  .topbar, .doc-page-topbar, .doc-page-actions,
  #packet-doc-add-row, .packet-doc-item-controls,
  .packet-doc-thumb-actions, .packet-doc-mini-btn,
  #project-doc-print-btn, .support-widget, #fb-pin-layer { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .shell { display: block !important; }
  .main { margin-left: 0 !important; padding: 0 !important; }
  .section { display: none !important; }
  #sec-project-doc-detail { display: block !important; padding: 16px !important; }
  .doc-page-hero { border-bottom: 1px solid #000 !important; padding-bottom: 12px !important; margin-bottom: 14px !important; }
  .doc-page-kicker, .doc-page-title, .doc-page-subtitle { color: #000 !important; }
  .packet-doc-item, .packet-doc-item-readonly, .packet-doc-item-editable { break-inside: avoid; border: 1px solid #ccc !important; background: #fff !important; color: #000 !important; margin-bottom: 7px !important; }
  .packet-doc-item-name, .packet-doc-item-note { color: #000 !important; }
  .packet-doc-item-badge { border: 1px solid #ccc !important; background: #fff !important; color: #000 !important; }
  .packet-doc-item-badge.on { background: #000 !important; color: #fff !important; }
  .packet-doc-item-check { display: none !important; }
  .packet-doc-thumb { max-width: 80px !important; max-height: 60px !important; }
  a { color: #000 !important; text-decoration: none !important; }
}

/* ── RESPONSIVO ── */
@media (max-width: 1200px) {
  .inprog-grid { grid-template-columns: repeat(3, 1fr); }
  .proj-detail-info { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .inprog-grid { grid-template-columns: repeat(2, 1fr); }
  .proj-grid { grid-template-columns: repeat(2, 1fr); }
  .places-grid, .explore-grid { grid-template-columns: repeat(2, 1fr); }
  .team-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .sidebar { width: var(--sidebar-w-mobile); padding: 0 0 16px; }
  .main { margin-left: var(--sidebar-w-mobile); }
  .nav-label, .nav-username { display: none; }
  .nav-btn { justify-content: center; padding: 0; }
  .user-dot { padding: 7px; justify-content: center; }
  .ki-logo-img { justify-content: center; }
  .topbar-right { padding-right: 44px; flex-wrap: wrap; justify-content: flex-end; }
  .profile-layout { grid-template-columns: 1fr; }
  #profile-scope-switch-btn { min-width: 0; width: 100%; }
  .roles-manager-grid { grid-template-columns: 1fr; }
  .bio-hero { grid-template-columns: 1fr; padding: 22px 20px; gap: 14px; }
  .msg-layout { grid-template-columns: 1fr; height: auto; }
  #support-chat-overlay { padding: 8px; }
  .support-chat-panel { width: calc(100vw - 16px); max-height: calc(100vh - 64px); }
  #support-help-fab { bottom: 10px; right: 10px; }
  #theme-toggle-fab { top: 8px; right: 8px; width: 30px; height: 30px; }
  .form-attach-toolbar { flex-direction: column; align-items: flex-start; }
  .packet-doc-item { grid-template-columns: 1fr; padding-top: 32px; }
  .packet-doc-item-readonly { grid-template-columns: 1fr; }
  .doc-page-hero { flex-direction: column; align-items: stretch; }
  .doc-page-actions { justify-content: flex-start; }
  .packet-doc-item-controls { flex-direction: row; flex-wrap: wrap; }
  .packet-doc-new-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .section { padding: 20px 18px; }
  .proj-detail-hero { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; }
  .proj-grid { grid-template-columns: 1fr; }
  .places-grid, .explore-grid { grid-template-columns: 1fr; }
  .inprog-grid { grid-template-columns: repeat(2, 1fr); }
  .team-grid { grid-template-columns: 1fr; }
  .profile-layout { grid-template-columns: 1fr; }
  .modal-overlay { padding: 14px 10px; }
  .modal { padding: 22px 18px; }
  .proj-detail-info { grid-template-columns: repeat(2, 1fr); }
  .doc-page-hero { flex-direction: column; gap: 10px; }
  .doc-page-actions { flex-wrap: wrap; gap: 6px; }
  .topbar { margin-bottom: 18px; }
  .hero-banner { padding: 28px 0 36px; }
}

/* ── EQUIPA ── */
.crew-table {
  display: grid;
  grid-template-columns: 30px minmax(160px, 220px) 1fr;
  gap: 1px; background: var(--line);
  border: var(--line-w) solid var(--line);
  margin-bottom: 8px;
}
.crew-row {
  display: contents;
}
.crew-table .drag-handle {
  background: var(--bg); padding: 10px 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 14px;
}
.crew-role, .crew-name {
  background: var(--bg); padding: 10px 14px;
  font-size: 13px;
}
.crew-role {
  font-family: 'DM Mono', monospace;
  font-size: 11px; letter-spacing: 0.5px;
  color: var(--text-2); text-transform: uppercase;
}
.crew-name { color: var(--text); font-weight: 500; }
.crew-empty { font-size: 13px; color: var(--text-2); padding: 12px 0; }

.crew-editor-toolbar {
  display: flex; gap: 8px; margin-bottom: 10px;
}
#crew-editor-rows {
  display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px;
}
.crew-editor-row {
  display: grid;
  grid-template-columns: minmax(160px, 240px) 1fr auto;
  gap: 6px; align-items: center;
}
.crew-editor-header {
  display: grid;
  grid-template-columns: minmax(160px, 240px) 1fr;
  gap: 6px; padding: 0 0 4px;
}
.crew-editor-header span {
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text-3);
  padding: 0 2px;
}
.crew-col-hdr {
  background: var(--bg-2); padding: 7px 14px;
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text-3);
  border-bottom: 1px solid var(--accent);
}
.crew-editor-row input,
.crew-editor-row select {
  background: var(--bg-2); border: var(--line-w) solid var(--line);
  color: var(--text); padding: 7px 10px;
  font-family: 'DM Sans', sans-serif; font-size: 13px;
  outline: none; transition: border-color 0.12s;
}
.crew-editor-row input:focus,
.crew-editor-row select:focus { border-color: var(--accent); }
.crew-remove-btn {
  background: none; border: var(--line-w) solid var(--line);
  color: var(--text-3); padding: 6px 9px;
  cursor: pointer; transition: background 0.12s, color 0.12s, border-color 0.12s, opacity 0.12s, transform 0.12s, box-shadow 0.12s;
  font-size: 14px; line-height: 1;
}
.crew-remove-btn:hover { border-color: var(--red-s); color: var(--red-s); }

/* ── Tema claro: contornos e superfícies ── */

body.theme-light .filt {
  border-color: rgba(0,0,0,0.12);
  color: var(--text-3);
}
body.theme-light .filt:not(.on):hover {
  border-color: rgba(0,0,0,0.25);
  color: var(--text-2);
}
body.theme-light .filt.on {
  background: #111;
  color: #fff;
  border-color: #111;
}
body.theme-light .scope-chip {
  border-color: rgba(0,0,0,0.12);
  color: var(--text-3);
}
body.theme-light .scope-chip:hover {
  border-color: rgba(0,0,0,0.25);
}
body.theme-light .modal,
body.theme-light .access-modal {
  background: #fff;
  border-color: rgba(0,0,0,0.10);
}
body.theme-light .modal-title,
body.theme-light .access-modal-title { color: var(--text); }
body.theme-light .am-section-title   { color: var(--text-2); }
body.theme-light .am-btn-cancel      { border-color: rgba(0,0,0,0.12); color: var(--text-2); }
body.theme-light .am-btn-cancel:hover { border-color: rgba(0,0,0,0.30); color: var(--text); }
body.theme-light .ui-dialog          { background: #fff; border-color: rgba(0,0,0,0.10); }
body.theme-light .ui-dialog-title    { color: var(--accent); }
body.theme-light .ui-dialog-input    { background: var(--bg-3); border-color: rgba(0,0,0,0.12); color: var(--text); }
body.theme-light .perm-chip          { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.10); color: var(--text-2); }
body.theme-light .perm-chip.on       { background: var(--accent-dim); border-color: var(--border-a); color: var(--accent); }
body.theme-light #login-box          { border-color: rgba(0,0,0,0.10); }
body.theme-light .login-field input  {
  background: var(--bg-3);
  border-color: rgba(0,0,0,0.12);
  color: var(--text);
}
body.theme-light .login-field input::placeholder { color: var(--text-3); }
body.theme-light .login-field input:focus {
  border-color: var(--accent);
  background: #fff;
}
body.theme-light #login-box h2    { color: var(--text); }
body.theme-light .login-sub        { color: var(--text-2); }
body.theme-light .packet-doc-item  {
  background: #fff;
  border-color: rgba(0,0,0,0.09);
}
body.theme-light .packet-doc-item.is-checked {
  border-color: var(--accent);
  background: var(--accent-dim);
}
body.theme-light .packet-doc-list  { background: var(--bg-3); border-color: rgba(0,0,0,0.09); }
body.theme-light .script-tab-btn   { border-color: rgba(0,0,0,0.12); color: var(--text-2); }
body.theme-light .packet-wrap      { background: var(--bg-2); border-color: rgba(0,0,0,0.09); }
body.theme-light .roles-manager    { background: var(--bg-2); border-color: rgba(0,0,0,0.09); }
body.theme-light .roles-list-pane,
body.theme-light .roles-editor-pane { background: var(--bg-3); }
body.theme-light .role-template-item { border-color: rgba(0,0,0,0.10); }
body.theme-light .role-perm-item   { border-color: rgba(0,0,0,0.10); }
body.theme-light .proj-perm-row    { background: var(--bg-3); border-color: rgba(0,0,0,0.09); }
body.theme-light .proj-perm-header:hover { background: rgba(0,0,0,0.03); }
body.theme-light .doc-chip         { border-color: rgba(0,0,0,0.10); color: var(--text-2); }
body.theme-light .access-btn       { border-color: rgba(0,0,0,0.12); }
body.theme-light .access-row       { background: var(--bg-2); border-bottom-color: rgba(0,0,0,0.07); }
body.theme-light .access-row:hover { background: var(--bg-3); }
body.theme-light .access-icon-btn:hover { background: var(--bg-4); }
body.theme-light .access-list      { border-color: rgba(0,0,0,0.09); }
body.theme-light .ui-toast.info    { border-color: rgba(0,0,0,0.12); }
body.theme-light ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.14); }
body.theme-light ::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.26); }
body.theme-light .chat-inp,
body.theme-light .support-chat-input,
body.theme-light .support-compose-input {
  background: var(--bg-3);
  border-color: rgba(0,0,0,0.10);
  color: var(--text);
}
body.theme-light .support-msg      { background: var(--bg-3); border-color: rgba(0,0,0,0.09); }
body.theme-light .conv-panel,
body.theme-light .chat-panel       { background: var(--bg-2); border-color: rgba(0,0,0,0.09); }
body.theme-light .proj-detail-hero  { background: var(--bg-2); border-color: rgba(0,0,0,0.09); }
body.theme-light .proj-detail-info-item { background: var(--bg-2); }
body.theme-light .trash-card       { background: var(--bg-2); }
body.theme-light .crew-table .crew-role,
body.theme-light .crew-table .crew-name { background: var(--bg-2); }
body.theme-light .crew-editor-row input,
body.theme-light .crew-editor-row select { background: var(--bg-3); border-color: rgba(0,0,0,0.12); color: var(--text); }

/* ── ESTATÍSTICAS DO PAINEL ── */
.hero-stats {
  display: flex;
  gap: 1px;
  margin-top: 28px;
  background: var(--line);
  border: var(--line-w) solid var(--line);
  width: fit-content;
  min-width: 360px;
}
.hero-stat {
  background: var(--bg);
  padding: 14px 20px;
  min-width: 90px;
  transition: background 0.12s;
}
body.theme-light .hero-stat { background: var(--bg-2); }
.hero-stat:hover            { background: var(--bg-2); }
.hero-stat-val {
  font-family: 'Bebas Neue', 'Barlow Condensed', sans-serif;
  font-size: 32px; letter-spacing: 2px;
  color: var(--accent); line-height: 1;
}
.hero-stat-lbl {
  font-family: 'DM Mono', monospace;
  font-size: 9px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--text-3);
  margin-top: 3px;
}

/* ── ESTADOS VAZIOS ── */
.proj-empty-state {
  grid-column: 1 / -1;
  padding: 36px 24px;
  text-align: center;
  background: var(--bg);
}
.proj-empty-full { background: transparent; border: 1px dashed var(--line); }
.proj-empty-icon {
  font-size: 32px; opacity: 0.15;
  margin-bottom: 10px; display: block;
}
.proj-empty-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--text-3);
}

body.theme-light {
  --text-2: #514d48;
  --text-3: #7c7872;
  --line:  rgba(0,0,0,0.09);
  --line-2: rgba(0,0,0,0.05);
}

/* ── Elevação do conteúdo principal ── */
.main { background: var(--bg-1); }
body.theme-light .main { background: var(--bg-1); }

/* ── Barra lateral: temas ── */
.sidebar { background: oklch(10% 0.007 35); border-right: 1px solid oklch(20% 0.006 35); }
body.theme-light .sidebar {
  background: oklch(95% 0.004 15);
  border-right: 1px solid rgba(0,0,0,0.09);
}
body.theme-light .nav-btn { color: oklch(38% 0.007 35); }
body.theme-light .nav-btn:hover { background: rgba(0,0,0,0.05); color: oklch(18% 0.007 35); }
body.theme-light .nav-btn.active { background: rgba(237,28,36,0.08); color: var(--accent); }
body.theme-light .user-dot:hover { background: rgba(0,0,0,0.04); }
body.theme-light .user-dot.active { background: rgba(237,28,36,0.06); }
body.theme-light .nav-label { color: inherit; }
body.theme-light .sidebar-bottom { border-top-color: rgba(0,0,0,0.08); background: transparent; }
body.theme-light .user-dot:hover { background: rgba(0,0,0,0.05); }
body.theme-light .ki-logo-img { border-bottom-color: rgba(0,0,0,0.08); }
body.theme-light .sidebar::before { background: var(--accent); }

/* ── Anel do emblema ── */
.badge { box-shadow: 0 0 0 2px var(--bg-1); }

/* ── Superfícies dos cartões ── */
.inprog-card         { background: var(--bg-2); }
.proj-card           { background: var(--bg-2); }
body.theme-light .inprog-card { background: #fff; border: 1px solid rgba(0,0,0,0.07); }
body.theme-light .proj-card   { background: #fff; }
body.theme-light .inprog-grid { background: rgba(0,0,0,0.07); }
body.theme-light .proj-grid   { background: rgba(0,0,0,0.07); }
body.theme-light .proj-footer { background: #fff; border-top-color: rgba(0,0,0,0.07); }

/* ── Banner principal: cores ── */
.hero-banner { background: var(--bg-1); padding: 40px 40px 44px; border-bottom: none; border: var(--line-w) solid var(--line); margin-bottom: 24px; }
.hero-banner::before { background: var(--accent); }
.hero-eyebrow { color: var(--text-2); }
body.theme-light .hero-banner { background: #fff; border-color: rgba(0,0,0,0.08); }

/* ── Barra de estatísticas ── */
.hero-stats { margin-top: 24px; min-width: 0; width: 100%; max-width: 480px; border-color: var(--line); background: var(--line); }
.hero-stat  { background: var(--bg-2); }
.hero-stat:hover { background: var(--bg-3); }
.hero-stat-val { font-size: 36px; }
.hero-stat-lbl { color: var(--text-2); }
body.theme-light .hero-stat { background: var(--bg-1); }
body.theme-light .hero-stat:hover { background: var(--bg-2); }

/* ── Etiquetas de secção ── */
.section-subtitle { color: var(--accent); opacity: 1; }
.divider          { color: var(--text-2); }
.clients-label    { color: var(--text-2); }
.hero-stat-lbl    { color: var(--text-2); }
.proj-empty-label { color: var(--text-2); }

/* ── Linha de projeto ── */
.proj-row:hover { background: var(--bg-2); }
body.theme-light .proj-row:hover { background: var(--bg-2); }

/* ── Cartões em curso ── */
.inprog-thumb  { background: var(--bg-3); }
.inprog-client { color: var(--accent); }
.inprog-dir    { color: var(--text-2); }

/* ── Cartões de projeto ── */
.proj-thumb     { background: var(--bg-3); }
.proj-client    { color: var(--accent); }
.proj-type      { color: var(--text-2); }
.proj-row-meta  { color: var(--text-2); }

/* ── Barra superior ── */
.topbar { background: var(--bg-1); border-bottom: var(--line-w) solid var(--line); padding-bottom: 20px; }
body.theme-light .topbar { background: var(--bg-1); border-bottom-color: rgba(0,0,0,0.08); }

/* ── Superfície dos modais ── */
.modal, .access-modal { background: var(--bg-2); }
body.theme-light .modal,
body.theme-light .access-modal { background: #fff; }

/* ── Superfície dos avisos ── */
.ui-toast { background: var(--bg-2); border-color: rgba(255,255,255,0.10); }
body.theme-light .ui-toast { background: #fff; border-color: rgba(0,0,0,0.10); }

/* ── Diálogo ── */
.ui-dialog { background: var(--bg-2); }
body.theme-light .ui-dialog { background: #fff; }

/* ── Caixa de início de sessão ── */
#login-box { background: var(--bg-2); }
body.theme-light #login-box { background: #fff; }

/* ── Botão de tema ── */
#theme-toggle-fab { background: var(--bg-2); color: var(--text-2); }
body.theme-light #theme-toggle-fab { background: #fff; color: var(--text-2); border-color: rgba(0,0,0,0.12); }

/* ── Cartões de perfil e definições ── */
.prof-card, .sett-card { background: var(--bg-2); }
body.theme-light .prof-card,
body.theme-light .sett-card { background: #fff; }

/* ── Linhas de acesso ── */
.access-row { background: var(--bg-2); }

/* ── Cartões de clientes ── */

/* ── Cartões de documentos ── */
.doc-card { background: var(--bg-2); }
.doc-card:hover { background: var(--bg-3); }
body.theme-light .doc-card { background: #fff; }
body.theme-light .doc-card:hover { background: var(--bg-2); }

/* ── Grelha de informação do projeto ── */
.proj-detail-info-item { background: var(--bg-2); }
.proj-detail-hero      { background: var(--bg-2); }

/* ── Menu de contexto ── */
.proj-ctx-menu { background: var(--bg-2); }
body.theme-light .proj-ctx-menu { background: #fff; border-color: rgba(0,0,0,0.10); }

/* ── Editor de roles e permissões ── */
.roles-list-pane, .roles-editor-pane { background: var(--bg-2); }

/* ── Faixa de clientes ── */
.client-chip { border-color: var(--line); }
body.theme-light .client-chip { border-color: rgba(0,0,0,0.12); }

/* ── Pontos de estado ── */
.dot-plan { background: var(--text-3); }
.dot-prod { background: var(--accent); }
.dot-live { background: var(--green); }

/* ── Trilho da barra de progresso ── */
.pbar  { background: var(--bg-4); }
.inprog-bar { background: var(--bg-4); }

/* ── SECÇÕES DE PRODUÇÃO ── */

.prod-table {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1px; background: var(--line);
  border: var(--line-w) solid var(--line); margin-bottom: 8px;
}
.prod-table-row { display: contents; }
.prod-cell-left, .prod-cell-right {
  background: var(--bg-2); padding: 10px 14px; font-size: 13px;
}
.prod-cell-left { color: var(--text); font-weight: 500; }
.prod-cell-right { color: var(--text-2); }
.prod-empty { font-size: 13px; color: var(--text-2); padding: 12px 0; }
#custom-docs-divider { display: none; }

.prod-section-card {
  border: var(--line-w) solid var(--border);
  margin: 0 0 6px; overflow: hidden;
}
.prod-section-card-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px;
  background: var(--accent); color: #fff;
  cursor: pointer;
}
.prod-section-hdr-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.prod-section-complete-btn { font-size: 11px !important; gap: 4px; }
.prod-section-complete-btn.is-complete { border-color: rgba(255,255,255,0.5) !important; color: rgba(255,255,255,0.8) !important; }
.psc-check-icon { font-style: normal; }
.prod-section-card-title {
  font-family: 'Bebas Neue', 'Barlow Condensed', sans-serif;
  font-size: 18px; letter-spacing: 2px; font-weight: 900; text-transform: uppercase; color: #fff;
}
.prod-section-card-body { padding: 12px 16px; }
.section-empty-state {
  font-size: 12px; color: var(--text-3); padding: 10px 2px;
  font-style: italic;
}
.prod-section-card-editor { padding: 20px 24px; border-top: var(--line-w) solid var(--border); }
.sec-inline-edit {
  background: rgba(0,0,0,0.25) !important;
  color: #fff !important; border: 1px solid rgba(255,255,255,0.3) !important;
  font-size: 11px !important; padding: 3px 10px !important;
  letter-spacing: 0.5px !important;
}

.drag-handle { cursor: grab; color: var(--text-3); padding: 0 6px 0 0; font-size: 14px; flex-shrink: 0; }
.drag-handle:active { cursor: grabbing; }
[draggable].drag-active { opacity: 0.4; }
[draggable].drag-over { outline: 2px solid var(--accent); outline-offset: -2px; }

.shooting-list { display: flex; flex-direction: column; gap: 1px; }
.shot-list-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: var(--bg-1); border-bottom: var(--line-w) solid var(--border); }
.shot-list-row.shot-done { opacity: 0.55; }
.shot-list-num { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--accent); min-width: 24px; }
.shot-list-thumb { width: 48px; height: 36px; object-fit: cover; border-radius: 3px; flex-shrink: 0; }
.shot-list-thumb-empty { width: 48px; height: 36px; background: var(--bg-2); border-radius: 3px; flex-shrink: 0; }
.shot-list-label { flex: 1; font-size: 13px; color: var(--text-1); }
.shot-list-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.prod-inline-panel {
  padding: 16px; background: transparent;
}
.prod-inline-panel-title {
  font-family: 'Bebas Neue', 'BebasNeueBold', sans-serif;
  font-size: 14px; letter-spacing: 2px; margin-bottom: 18px;
  color: var(--text-2); text-transform: uppercase;
  padding-bottom: 10px; border-bottom: var(--line-w) solid var(--line);
}
.prod-inline-panel-title span { color: var(--accent); }
body.theme-light .prod-cell-left,
body.theme-light .prod-cell-right { background: #fff; }

#actors-editor-rows { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.actor-editor-row {
  display: grid; grid-template-columns: 1fr 1fr auto;
  gap: 6px; align-items: center;
}
.actor-editor-row input {
  background: var(--bg-2); border: var(--line-w) solid var(--line);
  color: var(--text); padding: 7px 10px;
  font-family: 'DM Sans', sans-serif; font-size: 13px;
  outline: none; transition: border-color 0.12s;
}
.actor-editor-row input:focus { border-color: var(--accent); }

.prod-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; }
.prod-tab-btn {
  position: relative;
  padding: 6px 16px; border: var(--line-w) solid var(--line);
  background: transparent; color: var(--text-2);
  font-family: 'DM Sans', sans-serif; font-size: 13px;
  cursor: pointer; transition: background 0.12s, color 0.12s, border-color 0.12s, opacity 0.12s, transform 0.12s, box-shadow 0.12s;
}
.prod-tab-btn:hover { background: var(--bg-3); color: var(--text); }
.prod-tab-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.prod-tab-btn.active::after {
  content: ''; display: block;
  position: absolute; bottom: -1px; left: 0; right: 0;
  height: 2px; background: var(--accent);
}
.prod-tab-btn.edit-btn { font-size: 11px; padding: 4px 10px; }
.script-tab-duration {
  font-family: 'DM Mono', monospace; font-size: 10px;
  opacity: 0.7; margin-left: 5px;
  letter-spacing: 0.5px;
}

.script-content-panel { display: none; }
.script-content-panel.active { display: block; }
.script-body {
  background: var(--bg-2); border: var(--line-w) solid var(--line);
  border-top: 2px solid var(--accent);
  padding: 24px 28px;
  font-family: 'DM Sans', sans-serif; font-size: 14px; line-height: 1.8;
  color: var(--text); white-space: pre-wrap; min-height: 120px;
}
body.theme-light .script-body { background: var(--bg-2); }

.shooting-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px; background: var(--line); border: var(--line-w) solid var(--line); margin-bottom: 8px;
}
.shot-item {
  background: var(--bg-2); position: relative;
  cursor: pointer; overflow: hidden;
}
.shot-thumb {
  width: 100%; height: 160px;
  object-fit: contain; display: block;
  background: var(--bg-3);
}
.shot-thumb-empty {
  width: 100%; height: 160px;
  background: var(--bg-3);
  display: flex; align-items: center; justify-content: center;
}
.shot-thumb-empty span {
  font-family: 'Bebas Neue', sans-serif; font-size: 52px;
  color: var(--accent); opacity: 0.12;
}
.shot-number {
  position: absolute; top: 6px; left: 6px;
  font-family: 'DM Mono', monospace;
  font-size: 11px; font-weight: 700; color: #fff;
  background: var(--accent);
  padding: 2px 6px; border-radius: 3px; line-height: 1.4;
  pointer-events: none; z-index: 1;
}
.shot-check {
  position: absolute; top: 6px; right: 6px;
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.6);
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s, opacity 0.15s, transform 0.15s, box-shadow 0.15s;
  font-size: 12px; color: transparent; z-index: 2;
}
.no-interact { cursor: default !important; pointer-events: none !important; }
.no-interact:hover { border-color: inherit !important; color: inherit !important; background: inherit !important; transform: none !important; box-shadow: none !important; }
.shot-check.checked { background: var(--green); border-color: var(--green); color: #fff; }
.shot-check:hover { border-color: #fff; }
.shot-label {
  padding: 4px 8px; font-size: 11px;
  color: var(--text-2); background: var(--bg-2);
  border-top: var(--line-w) solid var(--line);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 4px;
  min-height: 28px;
}
.shot-label-text { flex: 1; min-width: 0; }
.shot-card-btns {
  display: flex; gap: 2px; flex-shrink: 0; align-items: center;
  opacity: 0; transition: opacity 0.15s;
}
.shot-item:hover .shot-card-btns { opacity: 1; }
.shot-delete {
  background: rgba(239,68,68,0.85); border: none;
  color: #fff; font-size: 11px; padding: 2px 6px;
  cursor: pointer; border-radius: var(--r); flex-shrink: 0;
  line-height: 1.4;
}
body.theme-light .shot-item { background: #fff; }
.shot-add-tile {
  background: var(--bg-2) !important;
  border: 2px dashed var(--line) !important;
  display: flex !important; align-items: center; justify-content: center;
  min-height: 160px; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.shot-add-tile:hover { border-color: var(--accent) !important; background: var(--accent-dim) !important; }
.shot-add-icon {
  font-size: 48px; font-family: 'Bebas Neue', sans-serif;
  color: var(--accent); opacity: 0.4; line-height: 1;
  transition: opacity 0.15s;
}
.shot-add-tile:hover .shot-add-icon { opacity: 0.9; }
.shot-edit {
  background: rgba(0,0,0,0.6); border: none;
  color: #fff; font-size: 11px; padding: 2px 6px;
  cursor: pointer; border-radius: 2px; flex-shrink: 0;
  line-height: 1.4;
}
.shot-list-actions .shot-edit { background: transparent; color: var(--text-2); font-size: 13px; border: none; cursor: pointer; padding: 2px 4px; }

.casting-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  padding: 16px 0;
}
.casting-card {
  display: flex; flex-direction: column;
  cursor: default; border-radius: var(--r);
  overflow: hidden;
  border: var(--line-w) solid var(--line);
  transition: border-color 0.15s;
  text-align: center;
}
.casting-card:hover { border-color: var(--accent); }
.casting-photo {
  width: 100%; aspect-ratio: 1;
  overflow: hidden; flex-shrink: 0;
  background: var(--bg-3);
  border-radius: 0;
}
.casting-photo img { width: 100%; height: 100%; object-fit: cover; }
.casting-photo-empty {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
}
.casting-card-info { padding: 8px 10px 10px; }
.casting-name {
  font-family: 'Bebas Neue', 'Barlow Condensed', sans-serif;
  font-size: 18px; letter-spacing: 1px;
  color: var(--accent); line-height: 1.1; margin-bottom: 2px;
}
.casting-char {
  font-family: 'Bebas Neue', 'Barlow Condensed', sans-serif;
  font-size: 15px; letter-spacing: 0.5px; color: var(--text-1);
  line-height: 1.1;
}

.actors-list { display: flex; flex-direction: column; gap: 1px; }
.actors-list-header {
  display: grid; grid-template-columns: 64px 1fr auto;
  gap: 14px; padding: 7px 16px;
  background: oklch(11% 0.008 35);
  border-bottom: var(--line-w) solid var(--line);
}
.actors-list-header span {
  font-size: 10px; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--text-3);
}
.actors-list-header span:first-child { text-align: center; }
.actor-item {
  display: flex; gap: 14px; align-items: center;
  background: var(--bg-2); padding: 12px 16px;
  border-bottom: var(--line-w) solid var(--line);
  transition: background 0.12s;
}
.actor-item:hover { background: var(--bg-3); }
.actor-photo {
  width: 64px; height: 64px; border-radius: 50%;
  overflow: hidden; flex-shrink: 0;
  background: var(--bg-4);
  transition: box-shadow 0.15s;
}
.actor-item:hover .actor-photo { box-shadow: 0 0 0 2px var(--accent); }
.actor-photo img { width: 100%; height: 100%; object-fit: cover; }
.actor-photo-empty {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--bg-4); display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
}
.actor-info { flex: 1; min-width: 0; }
.actor-name { font-weight: 600; font-size: 14px; }
.actor-character {
  display: inline-block; margin-top: 4px;
  font-size: 11px; font-family: 'DM Mono', monospace;
  letter-spacing: 0.3px; text-transform: uppercase;
  color: var(--text-3);
}
.actor-edit-btn { flex-shrink: 0; }
.actor-photo-label {
  display: block; position: relative; width: 80px; height: 80px; cursor: pointer;
  background: none; border: none; padding: 0;
}
.actor-photo-preview-wrap {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--bg-4); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: filter 0.15s;
}
.actor-photo-label:hover .actor-photo-preview-wrap { filter: brightness(0.6); }
.actor-photo-hover-hint {
  position: absolute; inset: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; opacity: 0; transition: opacity 0.15s; pointer-events: none;
}
.actor-photo-label:hover .actor-photo-hover-hint { opacity: 1; }
body.theme-light .actor-item { background: var(--bg-2); }
body.theme-light .actor-item:hover { background: var(--bg-3); }
body.theme-light .actors-list-header { background: var(--bg-3); }

.logos-list { display: flex; flex-wrap: wrap; gap: 12px; padding: 12px 0; }
.logo-item {
  position: relative; width: 100px; height: 80px;
  background: var(--bg-2); border-radius: var(--r);
  border: var(--line-w) solid var(--border); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.logo-item:hover .logo-delete-btn { display: flex; }
.logo-preview { max-width: 90%; max-height: 70px; object-fit: contain; }
.logo-delete-btn {
  display: none; position: absolute; top: 4px; right: 4px;
  background: rgba(217,0,13,0.85); color: #fff; border: none;
  width: 20px; height: 20px; border-radius: 50%;
  font-size: 10px; cursor: pointer; align-items: center; justify-content: center;
}

.decors-list { display: flex; flex-direction: column; gap: 1px; }
.decor-item {
  display: flex; gap: 18px; align-items: flex-start;
  background: var(--bg-2); padding: 16px 20px;
  border: var(--line-w) solid var(--line); margin-bottom: 1px;
  transition: background 0.12s;
}
.decor-item:hover { background: oklch(25% 0.005 35); }
.decor-thumb {
  width: 96px; height: 72px; object-fit: cover;
  flex-shrink: 0; background: var(--bg-3);
  border: var(--line-w) solid var(--line);
  border-radius: var(--r);
}
.decor-thumb-empty {
  width: 96px; height: 72px; flex-shrink: 0;
  background: var(--bg-3); display: flex;
  align-items: center; justify-content: center;
  font-size: 24px; opacity: 0.3;
  border-radius: var(--r);
}
.decor-info { flex: 1; }
.decor-id { font-family: 'DM Mono', monospace; font-size: 10px; color: var(--accent); letter-spacing: 1px; margin-bottom: 3px; }
.decor-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 17px; font-weight: 800; letter-spacing: -0.2px; margin-bottom: 4px;
}
.decor-ambient {
  font-family: 'DM Mono', monospace; font-size: 10px;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin-bottom: 4px;
}
.decor-address { font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.decor-actions { display: flex; gap: 6px; }
body.theme-light .decor-item { background: var(--bg-2); }
body.theme-light .decor-item:hover { background: var(--bg-3); }

.prod-add-panel {
  background: var(--bg-2); border: var(--line-w) solid var(--line);
  padding: 16px; margin-top: 8px; margin-bottom: 12px;
}
body.theme-light .prod-add-panel { background: #fff; }

/* ── TELEMÓVEL: LAYOUT RESPONSIVO ── */

/* ── Botão de menu ── */

/* ── Barra de navegação móvel ── */
#mobile-topbar {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; height: 52px;
  z-index: 500;
  background: var(--bg);
  border-bottom: var(--line-w) solid var(--line);
  align-items: center; gap: 0; padding: 0 4px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
#mobile-topbar-title {
  flex: 1; min-width: 0;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 17px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 0 6px;
}
#mobile-topbar-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
/* ── Botões de navegação móvel ── */
#mobile-menu-btn {
  width: 44px; height: 52px; flex-shrink: 0;
  background: transparent; border: none; border-right: var(--line-w) solid var(--line);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 5px;
  transition: background 0.15s; padding: 0 12px;
}
#mobile-menu-btn:hover { background: rgba(255,255,255,0.06); }
#mobile-back-btn {
  display: none; flex-shrink: 0;
  height: 52px; max-width: 160px;
  padding: 0 10px 0 8px;
  background: transparent; border: none; border-right: var(--line-w) solid var(--line);
  cursor: pointer; align-items: center; justify-content: center; gap: 4px;
  color: var(--text-2); transition: background 0.15s; overflow: hidden;
}
#mobile-back-btn:hover { background: rgba(255,255,255,0.06); }
#mobile-back-btn svg { pointer-events: none; stroke: var(--text-2); flex-shrink: 0; }
#mobile-back-label {
  font-size: 12px; font-family: 'DM Sans', sans-serif; font-weight: 500;
  color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  pointer-events: none; max-width: 110px;
}
body.theme-light #mobile-back-btn svg { stroke: #5a5450; }
body.theme-light #mobile-back-label { color: #5a5450; }

body.nav-open #mobile-menu-btn span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.nav-open #mobile-menu-btn span:nth-child(2) { opacity: 0; }
body.nav-open #mobile-menu-btn span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
body.nav-open #mobile-topbar { border-bottom-color: transparent; }

#mobile-menu-btn span {
  display: block; width: 20px; height: 2px;
  background: oklch(78% 0.006 35); border-radius: 2px;
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1), opacity 0.2s, width 0.2s;
}

/* ── Fundo da barra lateral ── */
.sidebar-backdrop {
  display: none; position: fixed; inset: 0; z-index: 99;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(3px);
  z-index: 350;
}
body.nav-open .sidebar-backdrop { display: block; }

/* ── Tablet (até 1024px) ── */
@media (max-width: 1024px) {
  .inprog-grid { grid-template-columns: repeat(3, 1fr); }
  .section { padding: 32px 36px; }
  .topbar-right { padding-right: 50px; }
}

/* ── Telemóvel (até 768px) ── */
@media (max-width: 768px) {
  #mobile-topbar { display: flex; }
  #mobile-menu-btn { display: flex; }
  #sidebar-theme-btn { display: none !important; }
  .section.active > .topbar { display: none !important; }
  .proj-nav-bar { display: none !important; }
  .proj-section-back { display: none !important; }
  #sec-project-detail.section-mode #proj-section-back { display: none !important; }
  #sec-project-detail.section-mode .prod-section-card-title { display: none !important; }

  .sidebar {
    width: 260px !important;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.16,1,0.3,1);
    z-index: 450;
    padding: 0 0 20px;
    box-shadow: 4px 0 32px rgba(0,0,0,0.5);
  }
  body.nav-open .sidebar { transform: translateX(0); }

  .main { margin-left: 0 !important; padding-top: 52px; }
  .sidebar { top: 52px !important; height: calc(100dvh - 52px) !important; height: calc(100vh - 52px) !important; overflow: hidden !important; }

  .nav-label, .nav-username { display: block !important; }
  .nav-btn { justify-content: flex-start !important; padding: 0 10px !important; }
  .user-dot { padding: 8px 10px !important; justify-content: flex-start !important; }
  .ki-logo-img { justify-content: flex-start !important; padding-left: 16px; }

  .topbar { padding-left: 52px; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
  .topbar-right { padding-right: 44px; flex-wrap: wrap; width: 100%; justify-content: flex-start; }
  .search { width: 100%; max-width: 100%; }
  .page-title { font-size: 28px; }

  #theme-toggle-fab { right: 10px; top: 10px; }

  .section { padding: 20px 16px; }

  .hero-banner { padding: 24px 0 30px; }
  .hero-logo-big img { height: clamp(36px, 7vw, 56px); }
  .hero-stats { max-width: 100%; min-width: 0; }
  .hero-stat { padding: 12px 16px; }
  .hero-stat-val { font-size: 28px; }

  .inprog-grid { grid-template-columns: repeat(2, 1fr); }
  .proj-grid { grid-template-columns: repeat(2, 1fr); }
  .client-admin-grid { grid-template-columns: 1fr; }

  .proj-detail-hero { flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; }
  .proj-detail-info { grid-template-columns: repeat(2, 1fr); }

  .modal-overlay, .access-modal-overlay { padding: 0; align-items: flex-end; }
  .modal, .access-modal {
    max-width: 100% !important; width: 100% !important;
    border-radius: var(--r-md) var(--r-md) 0 0;
    max-height: 92vh; overflow-y: auto;
    animation: modalSlideUp 0.25s cubic-bezier(0.16,1,0.3,1);
  }
  @keyframes modalSlideUp {
    from { transform: translateY(100%); opacity: 0.8; }
    to   { transform: translateY(0);    opacity: 1; }
  }

  .am-row { flex-direction: column; }
  .am-field { width: 100%; }

  .crew-editor-row, .actor-editor-row { grid-template-columns: 1fr auto; }
  .crew-editor-row input:first-child, .actor-editor-row input:first-child { grid-column: 1 / -2; }

  .shooting-grid { grid-template-columns: repeat(2, 1fr); }

  .decor-item { flex-direction: column; }
  .decor-thumb, .decor-thumb-empty { width: 100%; height: 160px; }

  .profile-layout { grid-template-columns: 1fr; }
  .bio-hero { grid-template-columns: 1fr; gap: 16px; }

  .explore-grid, .places-grid { grid-template-columns: repeat(2, 1fr); }

  .roles-manager-grid { grid-template-columns: 1fr; }

  .doc-page-hero { flex-direction: column; gap: 10px; }
  .doc-page-actions { flex-wrap: wrap; justify-content: flex-start; gap: 6px; }

  .msg-layout { grid-template-columns: 1fr; }
  #support-chat-overlay { padding: 0; align-items: flex-end; }
  .support-chat-panel {
    width: 100%; max-height: 90vh;
    border-radius: var(--r-md) var(--r-md) 0 0;
  }

  .pdf-iframe { height: calc(100vh - 120px); min-height: 400px; }

  .prod-table { grid-template-columns: 1fr; }

  .filter-row { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .filter-row::-webkit-scrollbar { display: none; }
}

/* ── Telemóvel pequeno (até 480px) ── */
@media (max-width: 480px) {
  .section { padding: 16px 12px; }
  .topbar { padding-left: 54px; }
  .page-title { font-size: 24px; }
  .hero-logo-big img { height: 40px; }
  .inprog-grid { grid-template-columns: 1fr; }
  .proj-grid { grid-template-columns: 1fr; }
  .explore-grid, .places-grid { grid-template-columns: 1fr; }
  .shooting-grid { grid-template-columns: 1fr; }
  .proj-detail-info { grid-template-columns: 1fr; }
  .hero-stats { flex-direction: column; max-width: 280px; }
  .hero-stat { padding: 10px 14px; }
  .inprog-thumb { height: 160px; }
  .modal { padding: 18px 14px !important; }
  .modal-title { font-size: 20px; }
  .btn { padding: 8px 12px; font-size: 12px; }
  .btn-accent { padding: 9px 16px; }

  .shot-check { width: 36px; height: 36px; }
  .doc-check  { width: 24px; height: 24px; }
}

/* ── Alvos de toque ── */
@media (max-width: 768px) {
  .nav-btn  { min-height: 44px; }
  .user-dot { min-height: 44px; }
  .btn      { min-height: 40px; }
  .am-btn   { min-height: 44px; padding: 10px 20px; }
  .filt     { min-height: 36px; }
  .scope-chip { min-height: 36px; }
  .access-btn { min-height: 40px; }
  .access-icon-btn { width: 40px; height: 40px; }
  .access-row { padding: 12px 14px; gap: 12px; }
  .crew-remove-btn { width: 40px; height: 40px; }
  .am-input, .login-field input { height: 48px; font-size: 16px; }
  textarea.am-input { height: auto; font-size: 16px; }
  select.am-input   { height: 48px; font-size: 16px; }
}

/* ── CRONOGRAMA ── */
.cronograma-file-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-2); border: var(--line-w) solid var(--line);
  padding: 10px 14px;
  font-family: 'DM Sans', sans-serif; font-size: 13px;
  color: var(--text);
}
body.theme-light .cronograma-file-row { background: #fff; }
.cronograma-file-row svg { color: var(--accent); flex-shrink: 0; }
#cronograma-filename { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cronograma-preview-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; margin-left: 6px; }
.crono-icon-btn {
  background: none; border: var(--line-w) solid var(--line); border-radius: var(--r);
  color: var(--text-3); cursor: pointer; text-decoration: none;
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.crono-icon-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }

#cronograma-viewer { display: none; }
#sec-project-detail.section-mode #cronograma-viewer { display: block; }

.cronograma-img-view {
  display: block; max-width: 100%; width: 100%;
  max-height: 80vh; object-fit: contain;
  background: var(--bg-3); border-top: var(--line-w) solid var(--line);
}
.cronograma-pdf-view {
  display: block; width: 100%; height: 80vh; min-height: 500px;
  border: none; border-top: var(--line-w) solid var(--line); background: var(--bg-3);
}
.cronograma-file-download {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 48px 24px;
  border-top: var(--line-w) solid var(--line);
}
.cronograma-file-download svg { color: var(--text-3); }
.cronograma-file-name { font-size: 14px; color: var(--text-2); font-family: 'DM Mono', monospace; }

/* ── FOLHA DE SERVIÇO ── */
.callsheet-day-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0 12px; gap: 12px;
}
.callsheet-date {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800; font-size: 18px; text-transform: capitalize;
  flex: 1; min-width: 0;
}
.callsheet-day-actions { display: flex; align-items: center; gap: 8px; }
.callsheet-print-icon {
  display: flex; align-items: center; gap: 5px;
  font-family: 'DM Mono', monospace; font-size: 11px;
  color: var(--text-2); text-decoration: none;
  border: var(--line-w) solid var(--line); border-radius: var(--r);
  padding: 5px 10px; transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.callsheet-print-icon:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }

.plan-card-ui {
  border: var(--line-w) solid var(--line); margin-bottom: 4px; border-radius: var(--r);
  background: var(--bg-2); transition: background 0.12s; overflow: hidden;
}
body.theme-light .plan-card-ui:not(.is-milestone) { background: var(--bg-3); }
.plan-card-ui.is-milestone {
  background: var(--accent); border-color: var(--accent); margin-bottom: 6px;
}

.plan-card-head {
  display: flex; align-items: center; gap: 0;
  padding: 11px 14px; min-height: 48px;
}
.plan-card-time {
  font-family: 'DM Mono', monospace;
  font-size: 13px; font-weight: 700; color: var(--accent);
  flex-shrink: 0; margin-right: 2px; white-space: nowrap;
}
.plan-card-sep {
  font-size: 13px; color: var(--text-3);
  margin: 0 6px; flex-shrink: 0;
}
.plan-card-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600; font-size: 15px; flex: 1;
  color: var(--text-1);
}
.plan-card-ui.is-milestone .plan-card-time { color: rgba(255,255,255,0.75); margin-right: 0; }
.plan-card-ui.is-milestone .plan-card-sep { color: rgba(255,255,255,0.5); }
.plan-card-ui.is-milestone .plan-card-label {
  font-weight: 700; font-size: 15px; color: #fff; text-transform: uppercase; letter-spacing: 0.3px;
}

.plan-card-check {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--text-3); flex-shrink: 0; opacity: 0.5;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 10px; color: transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s, opacity 0.15s;
  margin-left: 10px;
}
.plan-card-check:hover { border-color: var(--green); opacity: 1; }
.plan-card-check.checked { background: var(--green); border-color: var(--green); color: #fff; opacity: 1; }

.plan-card-ui.has-body { cursor: pointer; }
.plan-card-ui.has-body:hover { background: var(--bg-3); }
body.theme-light .plan-card-ui.has-body:not(.is-milestone):hover { background: oklch(86% 0.01 72); }
.plan-card-expand {
  color: var(--text-3); font-size: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-left: 4px; line-height: 1; pointer-events: none;
}
.plan-card-ui.has-body:hover .plan-card-expand { color: var(--accent); }
.plan-card-ui.expanded .plan-card-expand { color: var(--accent); }

.plan-card-edit-icon {
  background: none; border: none; cursor: pointer;
  color: var(--text-3); font-size: 13px; padding: 2px 6px;
  flex-shrink: 0; opacity: 0; transition: opacity 0.12s, color 0.12s;
}
.plan-card-ui:hover .plan-card-edit-icon { opacity: 1; }
.plan-card-edit-icon:hover { color: var(--accent); }
.plan-card-ui.is-milestone .plan-card-edit-icon { color: rgba(255,255,255,0.6); }
.plan-card-ui.is-milestone:hover .plan-card-edit-icon { opacity: 1; }
.plan-card-ui.is-milestone .plan-card-edit-icon:hover { color: #fff; }

.plan-card-body {
  display: none; grid-template-columns: 96px 1fr;
  gap: 0; border-top: var(--line-w) solid var(--line);
}
.plan-card-ui.expanded .plan-card-body { display: grid; }
.plan-card-body--no-img { grid-template-columns: 1fr !important; }
@media (max-width: 600px) { .plan-card-body { grid-template-columns: 1fr; } }

.plan-card-img {
  width: 96px; height: 72px; object-fit: cover;
  display: block; flex-shrink: 0;
  border-radius: var(--r);
}
.plan-card-details {
  padding: 10px 14px; display: flex; flex-direction: column; gap: 6px;
}
.plan-card-row { display: flex; gap: 8px; font-size: 12px; }
.plan-card-lbl {
  font-family: 'DM Mono', monospace; font-size: 9px;
  letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-3); min-width: 52px; flex-shrink: 0; margin-top: 1px;
}
.call-time-chip {
  font-family: 'DM Mono', monospace; font-size: 9px;
  background: var(--accent-dim); color: var(--accent);
  padding: 1px 5px; border-radius: var(--r-pill);
  margin-left: 4px;
}

/* ── REGISTO DE AUDITORIA ── */
.audit-filter-bar {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; margin-bottom: 16px;
}
.audit-select {
  background: var(--bg-3); color: var(--text);
  border: var(--line-w) solid var(--line); border-radius: var(--r-md);
  padding: 5px 10px; font-family: 'DM Sans', sans-serif;
  font-size: 12px; cursor: pointer;
  transition: border-color 0.12s;
}
.audit-select:focus { outline: none; border-color: var(--accent); }
.audit-date-input {
  background: var(--bg-3); color: var(--text);
  border: var(--line-w) solid var(--line); border-radius: var(--r-md);
  padding: 5px 10px; font-family: 'DM Mono', monospace;
  font-size: 12px;
}
.audit-date-input:focus { outline: none; border-color: var(--accent); }

.audit-table-wrap { overflow-x: auto; }
.audit-table {
  width: 100%; border-collapse: collapse;
  font-family: 'DM Sans', sans-serif; font-size: 12px;
}
.audit-table th {
  text-align: left; padding: 8px 12px;
  border-bottom: var(--line-w) solid var(--line);
  color: var(--text-3);
  font-family: 'DM Mono', monospace;
  font-size: 10px; letter-spacing: 1px; text-transform: uppercase;
  font-weight: 500; white-space: nowrap;
}
.audit-table td {
  padding: 9px 12px; border-bottom: 1px solid var(--line-2);
  vertical-align: top; color: var(--text);
}
.audit-table tr:hover td { background: var(--bg-2); }

.audit-user-cell {
  display: flex; align-items: center; gap: 7px; white-space: nowrap;
}
.audit-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; color: #fff;
  flex-shrink: 0; font-family: 'Barlow Condensed', sans-serif;
}
.audit-username { color: var(--text-2); font-size: 11px; }

.audit-action-badge {
  display: inline-block;
  padding: 2px 7px; border-radius: var(--r-pill);
  font-family: 'DM Mono', monospace; font-size: 10px;
  letter-spacing: 0.3px; white-space: nowrap;
  background: var(--bg-4); color: var(--text-2);
}
.audit-action-badge.create { background: rgba(34,197,94,0.12); color: #22c55e; }
.audit-action-badge.update { background: rgba(245,158,11,0.12); color: #f59e0b; }
.audit-action-badge.delete,
.audit-action-badge.trash,
.audit-action-badge.deactivate { background: rgba(239,68,68,0.12); color: #ef4444; }
.audit-action-badge.restore { background: rgba(99,102,241,0.12); color: #818cf8; }
.audit-action-badge.reset_password { background: rgba(14,165,233,0.12); color: #38bdf8; }

.audit-entity-cell { white-space: nowrap; }
.audit-entity-type {
  font-family: 'DM Mono', monospace; font-size: 9px;
  color: var(--text-3); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px;
}
.audit-entity-label { font-size: 12px; color: var(--text); margin-top: 1px; }
.audit-entity-label-main { font-size: 13px; font-weight: 500; color: var(--text); }
.audit-entity-parent {
  font-size: 11px; color: var(--accent); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px;
}

.audit-details-cell {
  max-width: 200px; overflow: hidden;
  white-space: nowrap; text-overflow: ellipsis;
  color: var(--text-2); font-family: 'DM Mono', monospace; font-size: 10px;
}
.audit-ip {
  font-family: 'DM Mono', monospace; font-size: 10px;
  color: var(--text-3); white-space: nowrap;
}
.audit-ts {
  font-family: 'DM Mono', monospace; font-size: 10px;
  color: var(--text-2); white-space: nowrap;
}

.audit-empty {
  padding: 48px; text-align: center;
  color: var(--text-3); font-size: 13px;
}

/* ── Separadores de auditoria ── */
.audit-tabs-row { display: flex; gap: 0; border-bottom: var(--line-w) solid var(--line); margin-bottom: 20px; }
.audit-main-tab { background: transparent; border: none; border-bottom: 2px solid transparent; padding: 10px 16px; font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 2px; text-transform: uppercase; color: var(--text-3); cursor: pointer; margin-bottom: -1px; transition: color 0.15s, border-color 0.15s; }
.audit-main-tab:hover { color: var(--text); }
.audit-main-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* ── Painel de sessões ── */
.sessions-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.sessions-header-info { font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-3); }
.sessions-loading, .sessions-empty { padding: 32px; text-align: center; font-size: 13px; color: var(--text-3); font-family: 'DM Sans', sans-serif; }
.session-user-block { border: var(--line-w) solid var(--line); margin-bottom: 8px; overflow: hidden; }
.session-user-header { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--bg-2); border-bottom: var(--line-w) solid var(--line); flex-wrap: wrap; gap: 10px; }
.session-avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: 'Barlow Condensed', sans-serif; font-weight: 900; font-size: 13px; color: #fff; flex-shrink: 0; }
.session-user-info { flex: 1; min-width: 0; }
.session-user-name { font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 15px; color: var(--text); }
.session-user-meta { font-family: 'DM Mono', monospace; font-size: 9px; color: var(--text-3); margin-top: 2px; letter-spacing: 0.5px; }
.session-role { color: var(--accent); }
.session-user-count { font-family: 'DM Mono', monospace; font-size: 9px; color: var(--text-3); letter-spacing: 1px; white-space: nowrap; }
.session-terminate-all-btn { padding: 5px 10px; border: 1px solid rgba(239,68,68,0.3); background: transparent; color: var(--red-s); cursor: pointer; font-family: 'DM Mono', monospace; font-size: 8px; letter-spacing: 1px; text-transform: uppercase; transition: background 0.12s, border-color 0.12s; white-space: nowrap; }
.session-terminate-all-btn:hover { background: var(--red-dim); border-color: var(--red-s); }
.session-rows-header { display: grid; grid-template-columns: 1fr 1fr 100px 100px 80px; padding: 6px 16px; background: var(--bg-3); font-family: 'DM Mono', monospace; font-size: 8px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-3); }
.session-row { display: grid; grid-template-columns: 1fr 1fr 100px 100px 80px; padding: 10px 16px; border-top: var(--line-w) solid var(--line); font-size: 12px; color: var(--text-2); font-family: 'DM Sans', sans-serif; align-items: center; transition: background 0.1s; }
.session-row:hover { background: var(--bg-2); }
.session-row.is-current { background: rgba(237,28,36,0.03); }
.session-current-badge { font-family: 'DM Mono', monospace; font-size: 8px; letter-spacing: 1px; text-transform: uppercase; color: var(--accent); border: 1px solid var(--border-a); padding: 2px 6px; }
.session-terminate-btn { padding: 4px 8px; border: 1px solid rgba(239,68,68,0.25); background: transparent; color: var(--red-s); cursor: pointer; font-size: 11px; font-family: 'DM Mono', monospace; transition: background 0.12s; }
.session-terminate-btn:hover { background: var(--red-dim); border-color: var(--red-s); }
.session-actions { display: flex; gap: 6px; align-items: center; }
.session-scope { display: flex; align-items: center; gap: 5px; }
.session-scope-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
body.theme-light .session-user-block { border-color: rgba(0,0,0,0.10); }
body.theme-light .session-rows-header { background: #f4f2ef; }
body.theme-light .session-row.is-current { background: rgba(237,28,36,0.02); }

.audit-pagination {
  display: flex; align-items: center; gap: 6px;
  justify-content: center; padding: 20px 0;
  flex-wrap: wrap;
}
.audit-page-btn {
  padding: 5px 12px; border-radius: var(--r-md);
  border: var(--line-w) solid var(--line); background: transparent;
  color: var(--text-2); font-family: 'DM Sans', sans-serif;
  font-size: 12px; cursor: pointer; transition: background 0.1s, color 0.1s, border-color 0.1s, opacity 0.1s, transform 0.1s, box-shadow 0.1s;
}
.audit-page-btn:hover { border-color: var(--accent); color: var(--accent); }
.audit-page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.audit-page-btn:disabled { opacity: 0.35; cursor: not-allowed; }

body.theme-light .audit-select { background: var(--bg-3); color: var(--text); }
body.theme-light .audit-date-input { background: var(--bg-3); color: var(--text); }

/* ── SUPERFÍCIES DO PROJETO ── */

/* ── Linhas de projeto ── */
.proj-row {
  padding: 14px 12px;
  transition: background 0.12s, border-color 0.12s;
}
.proj-row:hover { background: var(--bg-2); }
.proj-row-icon { width: 40px; height: 40px; }
.proj-row-name { font-size: 17px; letter-spacing: -0.3px; }
.pbar { height: 3px; border-radius: 2px; }
.pbar-wrap { width: 88px; }

/* ── Menu de contexto ── */
.proj-ctx-menu {
  min-width: 180px;
  padding: 5px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.75), 0 0 0 1px rgba(255,255,255,0.04);
}
.proj-ctx-item { padding: 9px 14px; font-size: 13px; }
.proj-ctx-sep {
  height: 1px; background: var(--line);
  margin: 4px 0; pointer-events: none;
}

/* ── Cabeçalho do projeto ── */
.proj-detail-hero {
  padding: 22px 26px;
  gap: 0; min-height: 0;
}
.proj-detail-hero.has-project-image { min-height: 140px; align-items: flex-end; padding-bottom: 18px; }
.proj-detail-hero-actions {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.proj-gear-btn {
  background: none; border: var(--line-w) solid var(--line); color: var(--text-3);
  width: 30px; height: 30px; border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.proj-gear-btn:hover { color: var(--text); border-color: var(--text-3); background: var(--bg-3); }

.ps-img-preview {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px; position: relative;
}
.ps-img-preview img {
  height: 52px; width: 52px; flex-shrink: 0;
  object-fit: contain; border-radius: var(--r);
  border: var(--line-w) solid var(--line); background: var(--bg-3);
}
.ps-cover-preview img { height: 52px; width: 96px; object-fit: cover; }
.ps-img-remove {
  background: var(--bg-3); border: var(--line-w) solid var(--line); color: var(--text-3);
  width: 20px; height: 20px; border-radius: 50%; font-size: 10px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: color 0.12s, border-color 0.12s;
}
.ps-img-remove:hover { color: var(--red-s); border-color: var(--red-s); }

.ps-client-portal { margin-bottom: 4px; }
.ps-portal-empty { font-size: 12px; color: var(--text-3); padding: 8px 0; }
.ps-portal-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--bg-2); border: var(--line-w) solid var(--line); border-radius: var(--r);
  padding: 10px 14px;
}
.ps-portal-info { display: flex; align-items: center; gap: 8px; }
.ps-portal-username { font-family: 'DM Mono', monospace; font-size: 13px; font-weight: 500; }
.ps-portal-actions { display: flex; align-items: center; gap: 6px; }
.ps-chg-pw-label { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.ps-chg-pw-label input[type="checkbox"] { cursor: pointer; }

.am-section-divider {
  font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--text-3);
  border-top: var(--line-w) solid var(--line); padding-top: 16px; margin-top: 4px;
}
.am-field-desc { font-size: 12px; color: var(--text-3); margin-bottom: 10px; }
.ps-visibility-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px; margin-bottom: 8px;
}
.ps-vis-row {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 6px 10px; border-radius: var(--r); border: var(--line-w) solid var(--line);
  background: var(--bg-2); transition: background 0.12s;
}
.ps-vis-row:hover { background: var(--bg-3); }
.ps-vis-name { font-size: 12px; color: var(--text-2); }

.proj-detail-initials {
  width: 56px; height: 56px;
  font-size: 22px;
  border-radius: var(--r-md);
}
.proj-detail-title {
  font-size: 32px;
  letter-spacing: 1.5px;
}
.proj-detail-meta { font-size: 12px; margin-top: 4px; }

.proj-detail-info-item { padding: 16px 18px; }
.proj-detail-info-lbl { font-size: 8px; letter-spacing: 2px; margin-bottom: 6px; }
.proj-detail-info-val { font-size: 16px; }

/* ── Cartões da grelha de documentos ── */
.doc-card {
  padding: 16px 14px;
  gap: 10px;
  transition: background 0.12s, border-color 0.12s;
}
.doc-card:hover { background: var(--bg-2); border-bottom: 2px solid var(--accent); }
.doc-card.done { background: var(--bg-2); }
.doc-card.done .doc-name { color: var(--text-3); }
.doc-icon {
  width: 28px; height: 28px;
  background: var(--accent-dim);
}
.doc-name { font-size: 12px; font-weight: 700; line-height: 1.25; }
.doc-check { width: 20px; height: 20px; }

/* ── Cartões de secção (pré-visualização) ── */
#sec-project-detail:not(.section-mode) .prod-section-card {
  border-color: var(--line);
  margin-bottom: 4px;
}
#sec-project-detail:not(.section-mode) .prod-section-card-hdr {
  background: transparent !important;
  border-bottom: var(--line-w) solid var(--line) !important;
  padding: 8px 16px !important;
  cursor: pointer !important;
}
#sec-project-detail:not(.section-mode) .prod-section-card-title {
  font-family: 'DM Mono', monospace !important;
  font-size: 9px !important;
  letter-spacing: 2.5px !important;
  color: var(--accent) !important;
  font-weight: 500 !important;
  text-transform: uppercase !important;
}
#sec-project-detail:not(.section-mode) .prod-section-card-title::after {
  content: '';
  display: inline-block; width: 10px; height: 10px; margin-left: 6px; vertical-align: -1px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z'/%3E%3C/svg%3E") center / contain no-repeat;
  font-size: 10px;
  opacity: 0.5;
  font-family: sans-serif;
  letter-spacing: 0;
}
#sec-project-detail:not(.section-mode) .prod-section-card-body {
  min-height: 0 !important;
  max-height: none;
  overflow: hidden;
  padding: 0 !important;
  position: relative;
}

/* ── Pré-visualização: equipa ── */
#sec-project-detail:not(.section-mode) .crew-row.crew-header-row { display: none !important; }
#sec-project-detail:not(.section-mode) .drag-handle { display: none !important; }
#sec-project-detail:not(.section-mode) .crew-table {
  grid-template-columns: minmax(120px, 180px) 1fr !important;
}
#sec-project-detail:not(.section-mode) .crew-role,
#sec-project-detail:not(.section-mode) .crew-name {
  min-height: 0 !important;
  padding: 3px 10px !important;
  font-size: 11px !important;
  line-height: 1.4;
}

/* ── Pré-visualização: atores ── */
#sec-project-detail:not(.section-mode) .actors-list-header { display: none !important; }
#sec-project-detail:not(.section-mode) .actor-item { padding: 4px 10px !important; gap: 8px !important; }
#sec-project-detail:not(.section-mode) .actor-photo,
#sec-project-detail:not(.section-mode) .actor-photo-empty { width: 28px !important; height: 28px !important; }
#sec-project-detail:not(.section-mode) .actor-info { display: flex; align-items: baseline; gap: 0; flex-wrap: nowrap; }
#sec-project-detail:not(.section-mode) .actor-name { font-size: 11px !important; display: inline; }
#sec-project-detail:not(.section-mode) .actor-character {
  display: inline !important;
  font-size: 10px !important;
}
#sec-project-detail:not(.section-mode) .actor-character::before {
  content: ' · ';
  opacity: 0.5;
}
#sec-project-detail:not(.section-mode) .actor-edit-btn { display: none !important; }

/* ── Sem pré-visualização: casting ── */
#sec-project-detail:not(.section-mode) #wrap-casting { display: none !important; }

/* ── Pré-visualização: décors ── */
#sec-project-detail:not(.section-mode) .decors-list {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 1px !important;
}
#sec-project-detail:not(.section-mode) .decor-item { padding: 4px 10px !important; gap: 10px !important; }
#sec-project-detail:not(.section-mode) .decor-thumb {
  width: 96px !important; height: 72px !important; flex-shrink: 0 !important;
}
#sec-project-detail:not(.section-mode) .decor-thumb-empty { display: none !important; }
#sec-project-detail:not(.section-mode) .decor-name { font-size: 11px !important; }
#sec-project-detail:not(.section-mode) .decor-ambient,
#sec-project-detail:not(.section-mode) .decor-address { font-size: 10px !important; }
#sec-project-detail:not(.section-mode) .decor-actions button[onclick*="openDecorPanel"] { display: none !important; }

/* ── Pré-visualização: logótipos ── */
#sec-project-detail:not(.section-mode) .logos-list { gap: 6px !important; padding: 6px 10px !important; }
#sec-project-detail:not(.section-mode) .logo-item { width: 56px !important; height: 40px !important; }

/* ── Pré-visualização: rodagem ── */
#sec-project-detail:not(.section-mode) #shooting-section {
  padding: 4px 12px 12px 12px !important;
}
#sec-project-detail:not(.section-mode) .shooting-grid {
  display: flex !important; flex-direction: row !important;
  flex-wrap: wrap !important; gap: 4px !important;
  max-width: 100% !important;
}
#sec-project-detail:not(.section-mode) .shot-item {
  min-height: 0 !important; width: 130px !important; flex-shrink: 0 !important;
  border: var(--line-w) solid var(--line) !important;
}
#sec-project-detail:not(.section-mode) .shot-thumb {
  height: 110px !important; object-fit: cover !important; width: 100% !important;
}
#sec-project-detail:not(.section-mode) .shot-thumb-empty {
  height: 110px !important; width: 100% !important;
  display: flex !important; align-items: center; justify-content: center;
}
#sec-project-detail:not(.section-mode) #shooting-script-tabs {
  padding: 0 0 4px !important; gap: 4px !important;
}
#sec-project-detail:not(.section-mode) #shooting-script-tabs .prod-tab-btn {
  font-size: 10px !important; padding: 3px 8px !important;
}
#sec-project-detail:not(.section-mode) .shot-number { font-size: 9px !important; top: 3px !important; left: 3px !important; padding: 1px 4px !important; }
#sec-project-detail:not(.section-mode) .shot-label { font-size: 9px !important; padding: 2px 6px !important; }
#sec-project-detail:not(.section-mode) .shot-delete { display: none !important; }
#sec-project-detail:not(.section-mode) .shot-add-tile { display: none !important; }
#sec-project-detail:not(.section-mode) .shot-label-edit { display: none !important; }
#sec-project-detail:not(.section-mode) .shot-check { width: 16px !important; height: 16px !important; font-size: 9px !important; top: 4px !important; right: 4px !important; }
#sec-project-detail:not(.section-mode) .shot-list-row { padding: 3px 10px !important; }
#sec-project-detail:not(.section-mode) .shot-list-thumb,
#sec-project-detail:not(.section-mode) .shot-list-thumb-empty { width: 32px !important; height: 24px !important; }
#sec-project-detail:not(.section-mode) .shot-list-label { font-size: 11px !important; }
#sec-project-detail:not(.section-mode) .shot-list-actions { display: none !important; }

/* ── Pré-visualização: guiões ── */
#sec-project-detail:not(.section-mode) .prod-tabs { padding: 0 10px !important; gap: 4px !important; }
#sec-project-detail:not(.section-mode) .prod-tab-btn { font-size: 10px !important; padding: 3px 8px !important; }
#sec-project-detail:not(.section-mode) .prod-tab-btn.edit-btn { display: none !important; }
#sec-project-detail:not(.section-mode) .script-body {
  min-height: 0 !important;
  padding: 8px 12px !important;
  font-size: 11px !important;
  line-height: 1.5 !important;
  border-top-width: 1px !important;
  max-height: 160px;
  overflow-y: auto;
}
#sec-project-detail:not(.section-mode) .script-content { font-size: 11px !important; padding: 4px 10px !important; max-height: 60px; overflow: hidden; }

/* ── Pré-visualização: folha de serviço ── */
#sec-project-detail:not(.section-mode) #callsheet-day-tabs,
#sec-project-detail:not(.section-mode) #callsheet-day-content { display: none !important; }
#sec-project-detail.section-mode #callsheet-preview { display: none !important; }

.csp-day { border-bottom: var(--line-w) solid var(--line); }
.csp-day:last-child { border-bottom: none; }
.csp-day-hdr {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: none; border: none; cursor: pointer; padding: 6px 10px;
  color: var(--text-1); text-align: left;
}
.csp-day-hdr:hover { background: var(--bg-2); }
.csp-day-date { font-family: 'DM Mono', monospace; font-size: 11px; font-weight: 600; text-transform: capitalize; flex: 1; }
.csp-day-counts { font-size: 10px; color: var(--text-3); font-family: 'DM Mono', monospace; white-space: nowrap; }
.csp-chevron { flex-shrink: 0; color: var(--text-3); transition: transform 0.15s; }
.csp-day.open .csp-chevron { transform: rotate(180deg); }
.csp-day-body { display: none; padding: 0 10px 6px; }
.csp-day.open .csp-day-body { display: block; }
.csp-plan {
  display: flex; align-items: baseline; gap: 6px;
  padding: 3px 0; border-bottom: var(--line-w) solid var(--line);
  font-size: 11px; color: var(--text-2);
}
.csp-plan:last-child { border-bottom: none; }
.csp-plan-done { opacity: 0.45; text-decoration: line-through; }
.csp-time { font-family: 'DM Mono', monospace; font-size: 10px; color: var(--accent); flex-shrink: 0; min-width: 32px; }
.csp-label { flex: 1; color: var(--text-1); font-size: 11px; }
.csp-decor { font-size: 10px; color: var(--text-3); font-style: italic; }
.csp-shot { font-size: 10px; color: var(--text-3); }
.csp-empty { font-size: 10px; color: var(--text-3); padding: 4px 0; }
.csp-check {
  flex-shrink: 0; width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid var(--text-3); background: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 8px; cursor: pointer; color: transparent;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.csp-check.checked { background: var(--green); border-color: var(--green); color: #fff; }
.csp-check:hover { border-color: var(--accent); }
.csp-print-btn {
  flex-shrink: 0; color: var(--text-3); display: flex; align-items: center;
  padding: 2px 4px; border-radius: 3px; text-decoration: none;
  transition: color 0.12s, background 0.12s;
}
.csp-print-btn:hover { color: var(--accent); background: var(--accent-dim); }
.tab-edit-btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; opacity: 0; margin-left: 4px; cursor: pointer;
  color: var(--text-3); transition: opacity 0.12s, color 0.12s;
  vertical-align: middle;
}
.prod-tab-btn:hover .tab-edit-btn,
.prod-tab-btn.active .tab-edit-btn { opacity: 1; }
.tab-edit-btn:hover { color: var(--accent); }
.tab-count {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff;
  font-size: 9px; font-weight: 700;
  width: 16px; height: 16px; border-radius: 50%;
  margin-left: 5px; vertical-align: middle;
}

/* ── Pré-visualização: cronograma ── */
#sec-project-detail:not(.section-mode) .cronograma-file-row { padding: 4px 10px !important; font-size: 11px !important; }

/* ── Cartões de secção (edição) ── */
.prod-section-card-hdr {
  padding: 14px 24px;
  background: oklch(10% 0.008 35);
  border-bottom: 2px solid var(--accent);
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
.prod-section-card-title {
  font-size: 22px;
  letter-spacing: 3px;
  color: var(--accent);
  text-shadow: 0 0 24px rgba(237,28,36,0.25);
}
.prod-section-card-body {
  padding: 24px 28px;
  min-height: 60vh;
  background: var(--bg-1);
}
.prod-section-card-editor {
  padding: 24px 28px; border-top: 2px solid var(--accent);
  background: var(--bg-1);
}

/* ── Tabela da equipa ── */
.crew-table {
  grid-template-columns: 28px minmax(180px, 240px) 1fr;
}
.crew-role, .crew-name { padding: 10px 14px; min-height: 44px; display: flex; align-items: center; }
.crew-role {
  font-family: 'DM Mono', monospace;
  font-size: 11px; letter-spacing: 0.5px; color: var(--text-3);
  text-transform: uppercase;
  border-right: var(--line-w) solid var(--line);
}
.crew-name { font-size: 14px; font-weight: 600; }
.crew-row:nth-child(odd) .crew-role,
.crew-row:nth-child(odd) .crew-name,
.crew-row:nth-child(odd) .drag-handle { background: var(--bg); }
.crew-row:nth-child(even) .crew-role,
.crew-row:nth-child(even) .crew-name,
.crew-row:nth-child(even) .drag-handle { background: var(--bg-2); }
.crew-col-hdr { background: oklch(11% 0.008 35); border-bottom: 2px solid var(--accent); }
.crew-editor-row input,
.crew-editor-row select {
  padding: 8px 12px; height: 38px; box-sizing: border-box;
}
.crew-editor-row select { font-family: 'DM Mono', monospace; }

#crew-editor-rows { gap: 10px; }
.crew-editor-row { padding-bottom: 10px; border-bottom: var(--line-w) solid var(--line); }
.crew-editor-row:last-child { border-bottom: none; padding-bottom: 0; }
.crew-contact-fields {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
}
.crew-contact-field { display: flex; align-items: center; gap: 8px; min-width: 0; }
.crew-contact-field input[type="tel"],
.crew-contact-field input[type="email"] { flex: 1; min-width: 0; }
.crew-client-toggle {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  font-size: 11px; color: var(--text-3); cursor: pointer; user-select: none; white-space: nowrap;
}
.crew-editor-row .crew-client-toggle input[type="checkbox"] {
  width: 16px; height: 16px; padding: 0; margin: 0;
  accent-color: var(--accent); cursor: pointer;
}
.crew-client-toggle:has(input:checked) { color: var(--text); }
.crew-name.has-contacts { flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px; }
.crew-contacts { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; font-size: 12px; font-weight: 400; }
.crew-contact-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; max-width: 100%; }
.crew-contact { color: var(--text-2); text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
.crew-contact:hover { color: var(--accent); text-decoration: underline; }
.crew-contact-badge {
  font-family: 'DM Mono', monospace; font-size: 8.5px; letter-spacing: 0.5px; text-transform: uppercase; line-height: 1.4;
  color: var(--accent); border: 1px solid currentColor; padding: 0 4px; flex-shrink: 0;
}
#sec-project-detail:not(.section-mode) .crew-contacts { font-size: 10.5px; gap: 0 10px; }
#sec-project-detail:not(.section-mode) .crew-contact-badge { display: none; }
@media (max-width: 768px) {
  #crew-editor-rows .crew-editor-row { grid-template-columns: 1fr auto; }
  #crew-editor-rows .crew-input-role { grid-column: 1 / -1; width: 100%; }
  #crew-editor-rows .crew-input-name { grid-column: 1; }
  #crew-editor-rows .crew-remove-btn { grid-column: 2; align-self: stretch; }
  .crew-contact-fields { grid-template-columns: 1fr; }
}

/* ── Cartões de casting ── */
.casting-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; padding: 20px 0; }
.casting-photo { width: 100%; aspect-ratio: 1; border-radius: 0; }
.casting-photo-wrap { position: relative; width: 100%; }
.casting-card:hover .casting-photo { filter: brightness(0.55); }
.casting-upload-hint {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; opacity: 0; transition: opacity 0.15s; pointer-events: none;
}
.casting-card:hover .casting-upload-hint { opacity: 1; }
.casting-card-info { padding: 10px 12px 12px; text-align: center; }
.casting-name {
  font-family: 'Bebas Neue', 'Barlow Condensed', sans-serif;
  font-size: 20px; letter-spacing: 1.5px; color: var(--accent); line-height: 1.1;
}
.casting-char {
  font-family: 'Bebas Neue', 'Barlow Condensed', sans-serif;
  font-size: 16px; letter-spacing: 0.5px; color: var(--text-1); line-height: 1.1; margin-top: 2px;
}

/* ── Storyboard de rodagem ── */
.shooting-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 2px; }
.shot-item {
  min-height: 180px;
  border-bottom: 2px solid transparent;
  transition: border-color 0.12s;
}
.shot-item:hover { border-bottom-color: var(--accent); }
.shot-thumb, .shot-thumb-empty { height: 180px; }
.shot-number { font-size: 13px; top: 8px; left: 8px; padding: 3px 8px; }
.shot-label {
  font-size: 12px; padding: 8px 12px;
  color: var(--text); font-weight: 500;
}
#sec-project-detail:not(.section-mode) #wrap-shooting .prod-section-card-body {
  min-height: 0 !important; padding: 0 10px 6px 10px !important;
}

/* ── TEMAS CLARO E ESCURO ── */

/* ── Tokens do tema claro ── */
body.theme-light {
  --accent-text: #C4161D;
  --text-2: #4a4643;
  --text-3: #7a7672;
}

/* ── Barra lateral no tema claro ── */
body.theme-light .sidebar {
  background: #f5f3f0;
  border-right: 1px solid rgba(0,0,0,0.09);
  box-shadow: none;
}
body.theme-light .sidebar-bottom {
  background: #ede9e4;
  border-top-color: rgba(0,0,0,0.08);
}
body.theme-light .nav-btn { color: #6b6560; }
body.theme-light .nav-btn:hover { background: rgba(0,0,0,0.05); color: #1a1714; }
body.theme-light .nav-btn.active { background: rgba(237,28,36,0.08); color: #C4161D; }
body.theme-light .user-dot:hover { background: rgba(0,0,0,0.05); }
body.theme-light .user-dot.active { background: rgba(237,28,36,0.07); }
body.theme-light .nav-username { color: #4a4643; }
body.theme-light .ki-logo-img { border-bottom-color: rgba(0,0,0,0.07); }
body.theme-light .badge { box-shadow: 0 0 0 2px #f5f3f0; }

/* ── Chips de filtro e âmbito ── */
body.theme-light .filt { border-color: rgba(0,0,0,0.14); color: #6b6560; }
body.theme-light .filt:not(.on):hover { border-color: rgba(0,0,0,0.28); color: #1a1714; }
body.theme-light .filt.on { background: #1a1714; color: #fff; border-color: #1a1714; }
body.theme-light .scope-chip { border-color: rgba(0,0,0,0.14); color: #6b6560; }
body.theme-light .scope-chip:hover { border-color: rgba(0,0,0,0.28); color: #1a1714; }

/* ── Campos de formulário ── */
body.theme-light .am-input {
  background: #fff;
  border-color: rgba(0,0,0,0.14);
  color: var(--text);
}
body.theme-light .am-input:focus {
  border-color: var(--accent);
  background: #fff;
}
body.theme-light .am-input::placeholder { color: #9c9894; }
body.theme-light select.am-input { background: #fff; color: var(--text); }
body.theme-light .am-field label { color: var(--text-2); }
body.theme-light .am-section-title { color: #7a7672; border-bottom-color: rgba(0,0,0,0.08); }
body.theme-light .am-btn-cancel { border-color: rgba(0,0,0,0.14); color: #4a4643; }

/* ── Trilho do interruptor ── */
body.theme-light .toggle { background: rgba(0,0,0,0.12); border-color: rgba(0,0,0,0.14); }
body.theme-light .toggle.on { background: rgba(237,28,36,0.14); border-color: var(--border-a); }
body.theme-light .toggle::after { background: #8a8480; }
body.theme-light .toggle.on::after { background: var(--accent); }

/* ── Cabeçalhos dos cartões de secção ── */
body.theme-light #sec-project-detail.section-mode .prod-section-card-hdr {
  background: #2a2724 !important;
  border-bottom-color: var(--accent) !important;
}
body.theme-light #sec-project-detail.section-mode .prod-section-card-title { color: #fff !important; text-shadow: none; }
body.theme-light #sec-project-detail.section-mode .prod-section-card-hdr .btn,
body.theme-light #sec-project-detail.section-mode .prod-section-card-hdr .btn-outline,
body.theme-light #sec-project-detail.section-mode .prod-section-card-hdr .btn-sm {
  color: rgba(255,255,255,0.82) !important;
  border-color: rgba(255,255,255,0.22) !important;
  background: transparent !important;
}
body.theme-light #sec-project-detail.section-mode .prod-section-card-hdr .btn:hover,
body.theme-light #sec-project-detail.section-mode .prod-section-card-hdr .btn-outline:hover {
  color: #fff !important;
  border-color: rgba(255,255,255,0.55) !important;
  background: rgba(255,255,255,0.08) !important;
}
body.theme-light #sec-project-detail.section-mode .prod-section-card-hdr .btn-accent {
  color: #fff !important;
  border-color: var(--accent) !important;
  background: var(--accent) !important;
}
body.theme-light #sec-project-detail.section-mode .prod-section-complete-btn {
  color: rgba(255,255,255,0.65) !important;
  border-color: rgba(255,255,255,0.2) !important;
}
body.theme-light #sec-project-detail.section-mode .prod-section-complete-btn.is-complete {
  color: #fff !important;
  border-color: rgba(255,255,255,0.45) !important;
}
body.theme-light .prod-section-card-body { background: var(--bg-1); }
body.theme-light .prod-section-card-editor { background: var(--bg-1); }

/* ── Cliente no cartão de projeto ── */
body.theme-light .phc-client { color: #C4161D; }
body.theme-light .decor-id { color: #C4161D; }
body.theme-light .decor-ambient { color: #C4161D; }
body.theme-light .csp-time { color: #C4161D; }
body.theme-light .plan-card-time { color: #C4161D; }
body.theme-light .explore-tag { color: #C4161D; }
body.theme-light .place-tag { color: #C4161D; background: rgba(196,22,29,0.08); }
body.theme-light .section-subtitle { color: #C4161D; }
body.theme-light .bio-section-title { color: #C4161D; }
body.theme-light .team-role { color: #C4161D; }
body.theme-light .packet-col-title { color: #C4161D; }
body.theme-light .packet-script-version { color: #C4161D; }
body.theme-light .pstat-val { color: #C4161D; }
body.theme-light .hero-stat-val { color: #C4161D; }
body.theme-light .doc-page-title span { color: #C4161D; }
body.theme-light .callsheet-date { color: var(--text); }

/* ── Camadas dos cartões Explore ── */
.explore-name { color: #fff; }
.explore-sub { color: rgba(255,255,255,0.55); }

/* ── Trilho da barra de progresso ── */
body.theme-light .phc-bar { background: rgba(0,0,0,0.10); }
body.theme-light .pbar { background: rgba(0,0,0,0.10); }
body.theme-light .inprog-bar { background: rgba(0,0,0,0.10); }

/* ── Registo de auditoria ── */
body.theme-light .audit-table td { color: var(--text); }
body.theme-light .audit-table tr:hover td { background: var(--bg-2); }
body.theme-light .audit-select,
body.theme-light .audit-date-input {
  background: #fff;
  border-color: rgba(0,0,0,0.14);
  color: var(--text);
}
body.theme-light .audit-action-badge { background: rgba(0,0,0,0.06); color: #4a4643; }
body.theme-light .audit-page-btn { border-color: rgba(0,0,0,0.14); color: var(--text-2); }
body.theme-light .audit-page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Página de acessos ── */
body.theme-light .access-row { background: var(--bg-2); border-bottom-color: rgba(0,0,0,0.07); }
body.theme-light .access-row:hover { background: var(--bg-3); }
body.theme-light .access-list { border-color: rgba(0,0,0,0.09); }
body.theme-light .access-status-dot { box-shadow: 0 0 0 2px var(--bg-2); }
body.theme-light .access-role-badge.role-admin { color: #C4161D; background: rgba(237,28,36,0.08); border-color: rgba(237,28,36,0.20); }
body.theme-light .access-role-badge.role-default { background: rgba(0,0,0,0.04); color: #4a4643; border-color: rgba(0,0,0,0.10); }
body.theme-light .perm-chip { background: rgba(0,0,0,0.04); color: var(--text-2); border-color: rgba(0,0,0,0.10); }
body.theme-light .perm-chip.on { background: rgba(237,28,36,0.08); color: #C4161D; border-color: rgba(237,28,36,0.20); }
body.theme-light .role-template-badge.system { background: rgba(0,0,0,0.05); color: #7a7672; }

/* ── Campos dos modais ── */
body.theme-light .ui-dialog-input { background: #f4f2ef; border-color: rgba(0,0,0,0.14); color: var(--text); }
body.theme-light .ui-dialog-message { color: #4a4643; }

/* ── Início de sessão no tema claro ── */
body.theme-light #login-overlay { background: oklch(92% 0.006 35); }
body.theme-light #login-box { background: #ffffff; border-color: rgba(0,0,0,0.10); box-shadow: 0 16px 48px rgba(0,0,0,0.12); }
body.theme-light .login-brand { color: var(--text); }
body.theme-light #login-box h2 { color: var(--text-2); }
body.theme-light .login-sub { color: var(--text-3); }
body.theme-light .login-field input { background: #f4f2ef; border-color: rgba(0,0,0,0.14); color: var(--text); }
body.theme-light .login-field input:focus { background: #fff; border-color: var(--accent); }

/* ── Tag branca no tema claro ── */
body.theme-light .tag-w { background: rgba(0,0,0,0.05); color: var(--text-2); }

/* ── Corpo do guião ── */
body.theme-light .script-body { background: #fff; border-color: rgba(0,0,0,0.10); }

/* ── Cartão de plano ── */
body.theme-light .plan-card-ui:not(.is-milestone) { background: var(--bg-3); border-color: rgba(0,0,0,0.14); }
body.theme-light .plan-card-label { color: var(--text); }
body.theme-light .plan-card-sep { color: var(--text-3); }

/* ── Botões de âmbito ── */
body.theme-light .btn.scope-switch-krypton { border-color: rgba(196,22,29,0.35); color: #C4161D; }
body.theme-light .btn.scope-switch-krypton:hover { border-color: #C4161D; color: #9E1218; }

/* ── Texto preto no tema escuro ── */

/* ── Cartões de plano da folha de serviço ── */
.plan-card-head { padding: 12px 16px; gap: 0; min-height: 48px; }
.plan-card-time { font-size: 14px; font-weight: 700; min-width: auto; }
.plan-card-sep { font-size: 14px; margin: 0 8px; }
.plan-card-label { font-size: 15px; font-weight: 600; }
.plan-card-check { width: 20px; height: 20px; font-size: 11px; }
.plan-card-expand { width: 26px; height: 26px; font-size: 12px; }
.plan-card-ui.expanded .plan-card-body { display: grid; }
.plan-card-body { padding: 0; gap: 0; }
.plan-card-details { padding: 10px 16px 14px; gap: 0; }
.plan-card-img { width: 96px; height: 72px; border-radius: 0; object-fit: cover; }
.plan-card-lbl { min-width: 64px; font-size: 10px; font-weight: 700; letter-spacing: 1px; }
.plan-card-row { gap: 12px; padding: 4px 0; border-bottom: var(--line-w) solid var(--line); font-size: 13px; }
.plan-card-row:last-child { border-bottom: none; }
.callsheet-date { font-size: 20px; }

body.theme-light .proj-ctx-menu { box-shadow: 0 8px 24px rgba(0,0,0,0.14), 0 0 0 1px rgba(0,0,0,0.07); }
body.theme-light .prod-section-card-hdr { background: var(--bg-3) !important; border-bottom-color: rgba(0,0,0,0.06) !important; }
body.theme-light #sec-project-detail:not(.section-mode) .prod-section-card-hdr { background: transparent !important; }
body.theme-light .doc-card:hover { background: var(--bg-3); }
body.theme-light .prod-section-card-editor,
body.theme-light .prod-inline-panel { background: var(--bg-1) !important; }
body.theme-light .prod-section-card-body { background: var(--bg-1); }
body.theme-light .actors-list-header,
body.theme-light .crew-col-hdr { background: var(--bg-3) !important; border-bottom-color: var(--accent) !important; }

/* ── LOGIN, INÍCIO, ACESSOS, ARQUIVO E MODAIS ── */

/* ── Fundo dos modais ── */
.modal-overlay, .access-modal-overlay {
  background: rgba(0,0,0,0.88);
}

/* ── Título de secção do modal ── */
.modal-title, .access-modal-title { font-size: 26px; letter-spacing: 3px; }
.am-section-title {
  font-size: 8px; letter-spacing: 3px;
  color: var(--accent); opacity: 1; margin-bottom: 10px;
}

/* ── Campos dos modais (tema claro) ── */
body.theme-light .am-input {
  background: var(--bg-1);
  border-color: rgba(0,0,0,0.12);
}
body.theme-light .am-input:focus { background: var(--bg-1); }
body.theme-light .am-btn-cancel { border-color: rgba(0,0,0,0.14); color: var(--text-2); }
body.theme-light .am-btn-cancel:hover { border-color: rgba(0,0,0,0.28); color: var(--text); }
body.theme-light .modal, body.theme-light .access-modal {
  border-color: rgba(0,0,0,0.1);
  box-shadow: 0 16px 48px rgba(0,0,0,0.12);
}

/* ── Início: subtítulo de secção ── */
.section-subtitle {
  font-size: 8px; letter-spacing: 4px; margin-bottom: 20px; margin-top: 12px;
}
.section-subtitle::after { background: rgba(237,28,36,0.2); }

/* ── Início: separador ── */
.divider { letter-spacing: 2px; }

/* ── Início: estado vazio ── */
.proj-empty-state { padding: 40px 24px; border: none; border-radius: var(--r-md); }
.proj-empty-full {
  border: 1px dashed rgba(255,255,255,0.08);
  padding: 48px 24px;
}
.proj-empty-icon { font-size: 28px; opacity: 0.12; margin-bottom: 14px; }
.proj-empty-label {
  font-size: 10px; letter-spacing: 2.5px;
  color: var(--text-3); text-transform: uppercase;
}

/* ── Arquivo: nota do lixo ── */
.trash-note {
  font-size: 12px; letter-spacing: 0.2px;
  color: var(--text-3); margin-bottom: 20px;
}

/* ── Arquivo: ações do lixo ── */
.trash-card-actions { gap: 6px; }
.trash-card-actions .btn { font-size: 12px; }

/* ── Acessos: avatar ── */
.access-avatar { color: #fff; }

/* ── Acessos: super admin ── */
.access-row.is-super-admin .access-avatar {
  box-shadow: 0 0 0 2px #c9920a, 0 0 0 4px rgba(201,146,10,0.15);
}

/* ── Caixa da palavra-passe ── */
.am-password-display {
  background: var(--bg-2); border: 1px solid rgba(255,255,255,0.12);
  padding: 10px 14px; font-family: 'DM Mono', monospace;
  font-size: 15px; letter-spacing: 3px; color: var(--text);
  min-height: 44px; display: flex; align-items: center;
}

/* ── ADAPTAÇÕES RESPONSIVAS ── */

/* ── Tablet (até 1024px) ── */
@media (max-width: 1024px) {
  .proj-docs-grid { grid-template-columns: repeat(4, 1fr); }
  .proj-detail-info { grid-template-columns: repeat(2, 1fr); }
}

/* ── Telemóvel (até 768px) ── */
@media (max-width: 768px) {
  .nav-btn { min-height: 44px !important; }
  .access-icon-btn { width: 40px; height: 40px; }
  .doc-check { width: 24px; height: 24px; }

  .proj-docs-grid { grid-template-columns: repeat(4, 1fr); }

  .access-role-badge { display: none; }
  .access-scope { display: none; }
  .access-row { padding: 12px 14px; gap: 12px; }
  .access-identity .access-crown { display: none; }

  .crew-table { grid-template-columns: minmax(140px, 200px) 1fr; }
  .crew-table .drag-handle { display: none; }

  .hero-banner {
    border-left: none !important;
    border-top: 3px solid var(--accent) !important;
    padding: 28px 20px 32px !important;
  }

  .audit-filter-bar { flex-direction: column; gap: 6px; }
  .audit-select, .audit-date-input { width: 100%; min-width: 0; }

  .proj-detail-info { grid-template-columns: repeat(2, 1fr); }

  .casting-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }

  .archive-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .archive-tab { white-space: nowrap; }

  .access-filter-bar { flex-direction: column; align-items: flex-start; gap: 8px; }
  .access-status-chips, .access-scope-chips { flex-wrap: wrap; }

  .proj-detail-initials { width: 44px; height: 44px; font-size: 17px; }
  .proj-detail-title { font-size: 24px; }

  .proj-ctx-menu { min-width: 200px; }
  .proj-ctx-item { padding: 12px 16px; font-size: 14px; }
}

/* ── Telemóvel pequeno (até 480px) ── */
@media (max-width: 480px) {
  .proj-docs-grid { grid-template-columns: repeat(2, 1fr); }

  #login-box { padding: 36px 24px 28px; }
  .login-brand img { height: 34px; }

  .shot-item { min-height: 180px; }

  .access-meta { gap: 6px; }

  .topbar { padding-left: 56px; padding-right: 0; }

  .phc-cover { height: 110px; }
}

/* ── Alvos de toque (revisão) ── */
@media (max-width: 768px) {
  .scope-chip   { min-height: 38px; padding: 0 14px; }
  .archive-tab  { min-height: 38px; }
  .btn          { min-height: 42px; }
  .am-btn       { min-height: 48px; padding: 12px 22px; }
}

/* ── Movimento reduzido ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── MELHORIAS DE INTERFACE ── */

/* ── Botão de mudança de app ── */
#profile-scope-switch-btn {
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 0;
  max-width: 100%;
}

/* ── Navegação: indicador ativo ── */
.nav-btn.active::before { display: none; }
.nav-btn.active {
  background: rgba(237, 28, 36, 0.1);
  color: var(--accent);
  font-weight: 600;
}
.nav-btn { height: 38px; }
.nav-btn svg { width: 17px; height: 17px; }

/* ── Início de sessão: cinematográfico ── */
#login-overlay {
  background: oklch(9% 0.006 35);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -5%, rgba(237,28,36,0.07) 0%, transparent 65%),
    repeating-linear-gradient(
      -55deg,
      transparent,
      transparent 38px,
      rgba(255,255,255,0.012) 38px,
      rgba(255,255,255,0.012) 39px
    );
}

#login-box {
  background: oklch(16% 0.006 35);
  border: 1px solid rgba(237, 28, 36, 0.18);
  border-top: 3px solid var(--accent);
  border-radius: 0;
  padding: 48px 44px 44px;
  max-width: 400px;
  box-shadow: 0 40px 100px rgba(0,0,0,0.8), 0 0 0 1px rgba(237,28,36,0.06) inset;
}

.login-brand {
  margin-bottom: 44px;
}
.login-brand img { height: 44px; }

#login-box h2 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-family: 'DM Mono', monospace;
  color: var(--text-2);
  margin-bottom: 6px;
}

.login-field input {
  background: oklch(19% 0.005 35);
  border: 1px solid rgba(255,255,255,0.09);
  height: 48px;
  font-size: 14px;
  border-radius: 0;
  padding: 0 18px;
}
.login-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  background: oklch(20% 0.006 35);
}

#login-submit {
  height: 48px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  border-radius: 0;
  margin-top: 12px;
}
#login-submit:hover { opacity: 1; background: var(--accent-h, #e01f00); }

/* ── Cabeçalho do início ── */
.hero-banner {
  padding: 44px 44px 48px;
  border-left: 3px solid var(--accent);
  border-top: none;
  border-right: none;
  border-bottom: none;
}
.hero-banner::before { display: none; }
.hero-logo-big { margin-bottom: 8px; }
.hero-logo-big img { height: clamp(48px, 7vw, 72px); }
.hero-eyebrow {
  font-size: 11px;
  letter-spacing: 3.5px;
  margin-bottom: 10px;
  color: var(--text-2);
}

/* ── Cartões de projeto ── */
.phc-cover { height: 160px; }
.phc-initials { font-size: 62px; }
.phc-title { font-size: 16px; }
.phc-body { padding: 12px 14px 14px; }

/* ── Subtítulo de secção ── */
.section-subtitle {
  font-size: 9px;
  letter-spacing: 3px;
  margin-bottom: 14px;
}

body.theme-light #login-overlay {
  background: oklch(15% 0.01 15);
  background-image: radial-gradient(ellipse 80% 50% at 50% -5%, rgba(237,28,36,0.04) 0%, transparent 65%);
}
body.theme-light #login-box {
  background: oklch(96% 0.003 15);
  border-color: rgba(237,28,36,0.2);
  box-shadow: 0 40px 100px rgba(0,0,0,0.15);
}
body.theme-light .login-field input { background: #fff; border-color: rgba(0,0,0,0.1); }
body.theme-light .login-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: #fff; }
body.theme-light #login-box h2 { color: var(--text-2); }
body.theme-light .hero-banner { background: #fff; border-left-color: var(--accent); }

/* ── TELEMÓVEL: TODAS AS PÁGINAS ── */

/* ── 768px: tablet ── */
@media (max-width: 768px) {
  .prod-sections-grid { grid-template-columns: 1fr 1fr; }

  .callsheet-day-header { flex-wrap: wrap; gap: 8px; }
  .callsheet-day-actions { flex-wrap: wrap; gap: 6px; }

  .am-row { flex-direction: column; gap: 8px; }
  .am-field { flex: none; width: 100%; }

  .proj-perm-row { margin-bottom: 4px; }

  .shot-list-row { gap: 8px; padding: 8px; }
  .shot-list-thumb, .shot-list-thumb-empty { width: 48px; height: 36px; flex-shrink: 0; }
  .shot-list-label { font-size: 11px; }

  .casting-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  .ps-portal-row { flex-direction: column; gap: 10px; align-items: flex-start; }
  .ps-portal-actions { flex-wrap: wrap; }

  .ps-visibility-grid { grid-template-columns: 1fr; }

  .proj-section-backbar { padding: 8px 12px; gap: 8px; }

  .decor-item { flex-direction: column; gap: 10px; padding: 12px; }
  .decor-thumb { width: 100%; height: 140px; object-fit: cover; }
  .decor-thumb-empty { width: 100%; height: 80px; }

  .crew-table { grid-template-columns: minmax(130px, 200px) 1fr; overflow-x: visible; }
  .drag-handle, .crew-col-sort, .crew-hdr-sort { display: none !important; }

  .csp-plan { flex-wrap: wrap; gap: 4px; }
  .csp-check { flex-shrink: 0; }

  .ps-client-portal { padding: 10px 0; }

  #sec-project-detail.section-mode .prod-section-card-hdr { flex-wrap: wrap; gap: 8px; }
  #sec-project-detail.section-mode .prod-section-hdr-actions { flex-wrap: wrap; }
}

/* ── 600px: telemóvel na horizontal ── */
@media (max-width: 600px) {
  .prod-sections-grid { grid-template-columns: 1fr; }

  .callsheet-day-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .callsheet-day-actions { width: 100%; justify-content: flex-start; }

  .casting-grid { grid-template-columns: 1fr; }

  .crew-table { grid-template-columns: minmax(100px, 1fr) 1fr; }
  .crew-col-sort, .crew-hdr-sort { display: none; }

  .proj-perm-header { flex-wrap: wrap; }

  .csp-day-body { overflow-x: auto; }
}

/* ── 480px: telemóvel na vertical ── */
@media (max-width: 480px) {
  .proj-detail-info { grid-template-columns: 1fr; }

  .modal-overlay { padding: 8px; align-items: flex-end; }
  .modal, .modal-lg { border-radius: 14px 14px 0 0; max-height: 92vh; overflow-y: auto; width: 100%; max-width: 100%; }
  .am-section { padding-top: 12px; }

  .crew-editor-row { flex-direction: column; gap: 6px; }
  .crew-input-role, .crew-input-name { width: 100%; }

  .actor-form-row { flex-direction: column; }

  .shot-list-row { flex-wrap: wrap; }
  .shot-list-actions { margin-left: auto; }

  .ps-visibility-grid { gap: 8px; }
  .ps-vis-row { gap: 8px; }

  .doc-card { min-height: 72px; }

  .callsheet-preview-plan { flex-direction: column; }

  .proj-detail-hero { min-height: 0; }

  #proj-section-back-name { display: none; }
}

/* ── Transbordo e redimensionamento ── */
.section, .main, .prod-section-card-body, .modal, .modal-lg,
.proj-docs-grid, .casting-grid, .shooting-grid, .crew-table,
.am-section, .proj-perm-list { min-width: 0; }

img { max-width: 100%; height: auto; }
.shot-thumb, .decor-thumb, .actor-photo, .cronograma-img-view { max-width: 100%; }

.shot-list-row, .callsheet-day-body {
  overflow-x: auto;
}
.crew-section { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 480px) {
  .crew-editor-row {
    grid-template-columns: 1fr;
  }
  .crew-editor-header {
    display: none;
  }

  .modal-overlay { align-items: flex-end; }

  .proj-section-backbar { flex-wrap: wrap; gap: 6px; }

  .csp-day-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  .actor-inline-panel, .decor-inline-panel, .script-inline-panel { 
    min-width: 0; width: 100%;
  }

  .ps-visibility-grid { max-height: 300px; overflow-y: auto; }

  .shooting-list { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  .plan-card-img { width: 72px; height: 54px; }
}

@media (max-width: 600px) {
  #sec-project-detail.section-mode .prod-sections-grid {
    grid-template-columns: 1fr;
  }

  .callsheet-preview-plan { flex-wrap: wrap; }

  .proj-detail-info { grid-template-columns: repeat(2, 1fr); }
}

/* ── CABEÇALHOS FIXOS MÓVEIS ── */
@media (max-width: 768px) {
  .proj-nav-bar { display: none !important; }
  .proj-section-back { display: none !important; }

  #sec-project-detail .proj-detail-hero { margin-top: 0; }

  #sec-project-detail.section-mode .prod-section-card-hdr {
    position: sticky; top: 0; z-index: 100;
  }

  #main-content { overflow-y: auto; }
}

@media (max-width: 480px) {
  .proj-nav-bar {
    margin: 0 -12px;
    padding: 10px 12px;
  }
}
/* ── Botão de menu no tema claro ── */
body.theme-light #mobile-menu-btn { border-right-color: rgba(0,0,0,0.08); }
body.theme-light #mobile-menu-btn span { background: #3a3532; }
body.theme-light #mobile-back-btn { border-right-color: rgba(0,0,0,0.08); }
body.theme-light #mobile-back-btn svg { stroke: #5a5450; }
body.theme-light #mobile-menu-btn:hover,
body.theme-light #mobile-back-btn:hover { background: rgba(0,0,0,0.04); }

/* ── Cabeçalho fixo no tema claro ── */
body.theme-light .proj-nav-bar,
body.theme-light .section.active > .topbar {
  border-bottom-color: rgba(0,0,0,0.08);
}

/* ── Safari iOS e transbordo ── */
html {
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

body {
  overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom);
}

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

@media (max-width: 768px) {
  .shell {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .main {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .section {
    max-width: 100%;
    overflow-x: hidden;
  }

  .sidebar {
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    height: 100vh;
    height: 100dvh;
  }

  .prod-section-card, .proj-detail-hero, .doc-card,
  .topbar, .proj-nav-bar, .proj-detail-info {
    max-width: 100%;
  }

  .crew-table, .shooting-list, .audit-table-wrap,
  .filter-row, .csp-day-body {
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .sidebar { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .sidebar-bottom { padding-bottom: env(safe-area-inset-bottom); }
}

body.theme-light #mobile-topbar {
  border-bottom-color: rgba(0,0,0,0.08);
}
body.theme-light #mobile-menu-btn span { background: #3a3532; }
body.theme-light #mobile-menu-btn:hover,
body.theme-light #mobile-back-btn:hover { background: rgba(0,0,0,0.06); }
body.theme-light #mobile-back-btn svg { stroke: #3a3532; }

body.theme-light #mobile-menu-btn:hover { background: rgba(0,0,0,0.06); }
body.theme-light #mobile-back-btn svg { stroke: #5a5450; }
body.theme-light #mobile-back-btn { color: #5a5450; }
body.theme-light #mobile-menu-btn span { background: #3a3532; }

/* ── Botão de ação móvel ── */
.mobile-action-btn {
  height: 28px; padding: 0 11px;
  background: var(--accent); color: #fff;
  border: none; cursor: pointer; flex-shrink: 0;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700; font-size: 13px; letter-spacing: 0.5px;
  transition: opacity 0.15s;
}
.mobile-action-btn:hover { opacity: 0.85; }

/* ── Botão de tema da barra móvel ── */
#mobile-theme-btn {
  width: 32px; height: 32px; flex-shrink: 0;
  border-radius: 50%; border: none;
  background: transparent; color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative;
  transition: color 0.15s, background 0.15s;
  margin-left: auto; margin-right: 6px;
}
#mobile-theme-btn:hover { color: var(--text); background: rgba(255,255,255,0.08); }
#mobile-theme-btn svg { pointer-events: none; }
body.theme-light #mobile-theme-btn { color: var(--text-3); }
body.theme-light #mobile-theme-btn:hover { background: rgba(0,0,0,0.06); }

#mobile-theme-btn .theme-icon {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 16px; height: 16px;
}
#mobile-theme-btn[data-mode='dark'] .theme-icon-moon  { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
#mobile-theme-btn[data-mode='dark'] .theme-icon-sun   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#mobile-theme-btn[data-mode='light'] .theme-icon-moon { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#mobile-theme-btn[data-mode='light'] .theme-icon-sun  { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }

/* ── TELEMÓVEL: CONTEÚDO DAS SECÇÕES ── */

@media (max-width: 768px) {
  /* ── Corpo dos cartões de secção ── */
  #sec-project-detail.section-mode .prod-section-card-body { padding: 0 0 16px; }
  #sec-project-detail.section-mode .prod-section-card-editor { padding: 12px; }

  /* ── EQUIPA ── */
  .crew-section { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* ── ATORES ── */
  .actor-item { gap: 10px; padding: 10px 12px; }
  .actor-photo { width: 48px; height: 48px; }
  .actors-list-header { grid-template-columns: 48px 1fr auto; gap: 10px; padding: 6px 12px; }

  /* ── GRELHA DE CASTING ── */
  .casting-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; padding: 8px 0; }

  /* ── GRELHA DE RODAGEM ── */
  .shooting-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .shot-thumb { height: 120px; }
  .shot-thumb-empty { height: 120px; }
  .shot-label { font-size: 10px; padding: 4px 6px; }

  /* ── LISTA DE RODAGEM ── */
  .shooting-list { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .shot-list-row { gap: 8px; padding: 8px 10px; }
  .shot-list-thumb { width: 44px; height: 33px; }
  .shot-list-label { font-size: 12px; }

  /* ── DÉCORS ── */
  .decor-item { flex-direction: column; padding: 10px; gap: 8px; }
  .decor-thumb { width: 100%; height: 120px; }
  .decor-thumb-empty { width: 100%; height: 80px; }

  /* ── FOLHA DE SERVIÇO ── */
  .callsheet-day-header { flex-wrap: wrap; gap: 8px; padding: 10px 0; }
  .callsheet-day-actions { flex-wrap: wrap; gap: 6px; }
  .callsheet-date { font-size: 16px; }
  .csp-day-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .csp-plan { gap: 4px; padding: 4px 0; font-size: 11px; }

  /* ── CARTÕES DE PLANO ── */
  .plan-card-body { grid-template-columns: 72px 1fr; }
  .plan-card-img { width: 72px; height: 54px; }
  .plan-card-details { padding: 8px 10px; }
  .plan-card-ui { padding: 10px 12px; }

  /* ── GUIÕES ── */
  .script-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  .script-tab-btn { font-size: 11px; padding: 6px 12px; }
  .packet-wrap { padding: 12px; }
  .packet-doc-list { font-size: 13px; }

  /* ── CRONOGRAMA ── */
  .cronograma-img-view { width: 100%; height: auto; max-height: 70vh; object-fit: contain; }
  .cronograma-pdf-view { height: 70vh; min-height: 300px; }

  /* ── LOGÓTIPOS ── */
  .logo-item { padding: 8px; }
  .logo-preview { max-width: 100%; height: auto; }

  /* ── GRELHA DE CARTÕES DE DOCUMENTOS ── */
  .proj-docs-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .doc-card { min-height: 68px; padding: 8px; }
  .doc-name { font-size: 9px; }
}

@media (max-width: 480px) {
  /* ── RODAGEM ── */
  .shooting-grid { grid-template-columns: repeat(2, 1fr); }
  .shot-thumb { height: 100px; }
  .shot-thumb-empty { height: 100px; }

  /* ── ATORES ── */
  .actor-item { gap: 8px; padding: 8px 10px; }
  .actor-photo { width: 40px; height: 40px; }
  .actors-list-header { grid-template-columns: 40px 1fr auto; }

  /* ── CASTING ── */
  .casting-grid { grid-template-columns: repeat(2, 1fr); }

  /* ── FOLHA DE SERVIÇO ── */
  .callsheet-day-header { flex-direction: column; align-items: flex-start; }
  .plan-card-body { grid-template-columns: 1fr; }
  .plan-card-img { width: 100%; height: 120px; border-radius: 0; }

  /* ── GRELHA DE CARTÕES DE DOCUMENTOS ── */
  .proj-docs-grid { grid-template-columns: repeat(2, 1fr); }

  /* ── GUIÕES ── */
  .packet-doc-item { grid-template-columns: 1fr; }
  .packet-doc-item-controls { flex-wrap: wrap; }
}

/* ── SELEÇÃO MÚLTIPLA DE ATORES ── */
.actor-multi-select { position: relative; }
.actor-ms-trigger {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 36px; padding: 4px 10px; gap: 6px;
  background: var(--bg-2); border: var(--line-w) solid var(--border); border-radius: 6px;
  cursor: pointer; font-size: 13px; color: var(--text-1); user-select: none;
}
.actor-ms-trigger:hover { border-color: var(--accent); }
.actor-ms-chips { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.actor-ms-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--accent); color: #fff; border-radius: 4px;
  padding: 2px 7px; font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
}
.actor-ms-chip-remove { cursor: pointer; opacity: 0.7; line-height: 1; font-size: 13px; }
.actor-ms-chip-remove:hover { opacity: 1; }
.actor-ms-placeholder { color: var(--text-3); font-size: 12px; }
.actor-ms-caret { color: var(--text-3); font-size: 10px; flex-shrink: 0; }
.actor-ms-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 200;
  background: var(--bg-2); border: var(--line-w) solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25); overflow: hidden;
}
.actor-ms-search {
  width: 100%; box-sizing: border-box;
  padding: 8px 12px; border: none; border-bottom: var(--line-w) solid var(--border);
  background: transparent; color: var(--text-1); font-size: 13px; outline: none;
}
.actor-ms-list { max-height: 180px; overflow-y: auto; }
.actor-ms-option {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; cursor: pointer; font-size: 13px; color: var(--text-1);
}
.actor-ms-option:hover { background: var(--bg-3); }
.actor-ms-option input[type=checkbox] { accent-color: var(--accent); width: 14px; height: 14px; flex-shrink: 0; }
.actor-ms-empty { padding: 10px 12px; font-size: 12px; color: var(--text-3); text-align: center; }

/* ── MODAL DE PALAVRA-PASSE ── */
#pw-modal-overlay { z-index: 9000; }
.pw-credential-row { display: flex; flex-direction: column; gap: 4px; }
.pw-credential-label { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: var(--text-3); text-transform: uppercase; }
.pw-credential-block {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-3); border: var(--line-w) solid var(--border); border-radius: 6px;
  padding: 8px 12px; font-family: 'DM Mono', monospace; font-size: 14px;
  color: var(--text-1);
}
.pw-credential-value { flex: 1; word-break: break-all; }
.pw-copy-btn {
  flex-shrink: 0; background: none; border: var(--line-w) solid var(--border);
  border-radius: 4px; padding: 4px 8px; cursor: pointer;
  color: var(--text-2); font-size: 11px; transition: background 0.15s, color 0.15s;
}
.pw-copy-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.pw-copy-btn.copied { background: var(--green-s, #22c55e); color: #fff; border-color: transparent; }

/* ── PWA instalada: área segura iOS ── */
@media (display-mode: standalone) {
  #mobile-topbar {
    padding-top: env(safe-area-inset-top);
    height: calc(52px + env(safe-area-inset-top));
  }
}
body.is-standalone #mobile-topbar {
  padding-top: env(safe-area-inset-top);
  height: calc(52px + env(safe-area-inset-top));
}

/* ── PROMPT DE INSTALAÇÃO iOS ── */
#ios-install-prompt {
  position: fixed; inset: 0; z-index: 11000;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0 12px calc(12px + env(safe-area-inset-bottom));
  animation: iip-fadein 0.25s ease;
}
@keyframes iip-fadein { from { opacity: 0 } to { opacity: 1 } }
.iip-sheet {
  width: 100%; max-width: 440px;
  background: var(--bg-2); border: var(--line-w) solid var(--border);
  border-radius: 20px 20px 16px 16px; padding: 24px 20px 20px;
  position: relative;
  box-shadow: 0 -4px 48px rgba(0,0,0,0.5);
  animation: iip-slideup 0.3s cubic-bezier(0.16,1,0.3,1);
}
@keyframes iip-slideup { from { transform: translateY(48px); opacity: 0 } to { transform: none; opacity: 1 } }
.iip-close {
  position: absolute; top: 14px; right: 14px;
  background: var(--bg-3); border: var(--line-w) solid var(--border); border-radius: 50%;
  width: 28px; height: 28px; cursor: pointer; font-size: 12px;
  color: var(--text-2); display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.iip-icon {
  width: 64px; height: 64px; border-radius: 14px; overflow: hidden;
  margin: 0 auto 14px; border: var(--line-w) solid var(--border);
}
.iip-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.iip-title {
  text-align: center; font-family: 'Barlow Condensed', sans-serif;
  font-size: 24px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.iip-body { font-size: 14px; color: var(--text-2); }
.iip-body p { margin: 0 0 14px; text-align: center; }
.iip-step {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-top: var(--line-w) solid var(--border); font-size: 13px; color: var(--text-1);
  line-height: 1.4;
}
.iip-step:last-child { border-bottom: var(--line-w) solid var(--border); }
.iip-step-num {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.iip-arrow {
  text-align: center; font-size: 20px; color: var(--accent);
  margin-top: 14px; animation: iip-bounce 1.2s ease infinite;
}
@keyframes iip-bounce { 0%,100% { transform: translateY(0) } 50% { transform: translateY(6px) } }
.iip-install-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin-top: 16px;
  background: var(--accent); color: #fff; border: none; border-radius: 12px;
  padding: 13px 20px; font-family: 'Barlow Condensed', sans-serif;
  font-size: 16px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase;
  cursor: pointer; transition: opacity 0.15s;
}
.iip-install-btn:hover { opacity: 0.88; }
.iip-install-btn:active { opacity: 0.75; }