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

:root {
  --ink: #1b1f23;
  --muted: #5f6b7a;
  --surface: #f5f7fb;
  --panel: #ffffff;
  --line: #dbe2ea;
  --brand-primary: #0f6cbd;
  --brand-secondary: #0067b8;
  --accent: #0f6cbd;
  --accent-soft: #e8f2fb;
  --power-blue: var(--brand-primary);
  --power-blue-strong: var(--brand-secondary);
  --power-black: var(--ink);

  /* Workspace Alerts: user-customizable colors (saved in localStorage) */
  --alerts-author-bg: #f7f3cf;
  --alerts-author-border: rgba(245, 208, 94, 0.45);
  --alerts-assignee-bg: #79c3aa;
  --alerts-assignee-border: rgba(16, 185, 129, 0.38);
  --alerts-assignee-text: #05302a;
  --alerts-assignee-muted: rgba(5, 48, 42, 0.7);
  --radius-sm: 5px;
  --radius-md: 7px;
  --radius-lg: 9px;
  --shadow-xs: 0 2px 6px rgba(15, 108, 189, 0.08);
  --shadow-sm: 0 4px 10px rgba(15, 108, 189, 0.1);
  --shadow-md: 0 8px 20px rgba(15, 108, 189, 0.12);
  --shadow-lg: 0 12px 30px rgba(15, 108, 189, 0.16);
  --shadow: var(--shadow-md);

  /* Scrollbar (default = light theme) */
  --scroll-track: rgba(15, 23, 42, 0.06);
  --scroll-thumb: rgba(15, 108, 189, 0.35);
  --scroll-thumb-hover: rgba(15, 108, 189, 0.55);
}

* {
  box-sizing: border-box;
}

/* evita scroll fantasma */
html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: 'Manrope', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 20%, rgba(15, 108, 189, 0.12), transparent 42%),
    radial-gradient(circle at 90% 10%, rgba(0, 120, 212, 0.14), transparent 40%),
    linear-gradient(135deg, #f5f7fb, #eef3f9);
}

/* Scrollbar theming (Firefox + WebKit). Dark pages override vars. */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--scroll-track);
}

::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 999px;
  border: 2px solid var(--scroll-track);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-thumb-hover);
}

/* área principal cobre a tela sem ultrapassar */
main {
  min-height: calc(100vh - 72px); /* altura da top-nav */
  background: #ffffff;
}

/* ===================== WORKSPACE THEME (Portal/Admin) ===================== */

/* Dark theme matches the DataGLAM landing (glass + deep navy). */
body.theme-dark-glass {
  color-scheme: dark;
  color: rgba(248, 250, 252, 0.96);

  /* Keep these generic tokens usable by pages that rely on theme.css. */
  --ink: rgba(248, 250, 252, 0.96);
  --muted: rgba(226, 232, 240, 0.72);
  --surface: transparent;
  --panel: rgba(255, 255, 255, 0.06);
  --line: rgba(148, 163, 184, 0.18);

  /* Scrollbar */
  --scroll-track: rgba(2, 6, 23, 0.70);
  --scroll-thumb: rgba(114, 183, 178, 0.40);
  --scroll-thumb-hover: rgba(114, 183, 178, 0.70);

  background:
    radial-gradient(1200px 520px at 10% 0%, rgba(15, 108, 189, 0.32), transparent 60%),
    radial-gradient(1000px 520px at 90% 10%, rgba(114, 183, 178, 0.24), transparent 60%),
    radial-gradient(900px 520px at 50% 120%, rgba(212, 163, 115, 0.16), transparent 55%),
    linear-gradient(135deg, rgba(2, 6, 23, 0.98), rgba(15, 23, 42, 0.98));
}

/* Dark theme: global components (avoid "white leftovers" across pages). */
body.theme-dark-glass .top-nav {
  background: rgba(2, 6, 23, 0.62);
  border-bottom-color: rgba(148, 163, 184, 0.18);
}

body.theme-dark-glass .brand {
  color: rgba(248, 250, 252, 0.96);
}

body.theme-dark-glass .nav-links a {
  color: rgba(226, 232, 240, 0.78);
}

body.theme-dark-glass .nav-links a:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(114, 183, 178, 0.35);
}

body.theme-dark-glass .nav-links a.active {
  color: rgba(114, 183, 178, 0.95);
  border-color: rgba(114, 183, 178, 0.55);
  background: rgba(2, 6, 23, 0.25);
}

body.theme-dark-glass .btn {
  background: rgba(2, 6, 23, 0.35);
  border-color: rgba(148, 163, 184, 0.22);
  color: rgba(248, 250, 252, 0.96);
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.35);
}

body.theme-dark-glass .btn:hover {
  border-color: rgba(93, 169, 255, 0.55);
  box-shadow: 0 14px 40px rgba(2, 6, 23, 0.45);
}

body.theme-dark-glass .btn-secondary {
  background: rgba(2, 6, 23, 0.35);
}

body.theme-dark-glass .nav-actions {
  background: rgba(2, 6, 23, 0.35);
  border-color: rgba(148, 163, 184, 0.22);
}

body.theme-dark-glass input,
body.theme-dark-glass select,
body.theme-dark-glass textarea {
  background: rgba(2, 6, 23, 0.35);
  border-color: rgba(148, 163, 184, 0.22);
  color: rgba(248, 250, 252, 0.96);
}

body.theme-dark-glass input::placeholder,
body.theme-dark-glass textarea::placeholder {
  color: rgba(226, 232, 240, 0.58);
}

/* The light theme uses a white "main" slab, but dark needs the background to show through. */
body.theme-dark-glass main {
  background: transparent;
}

/* ===================== AUTH (Login/Register) ===================== */

body.auth-glass {
  background:
    radial-gradient(1200px 520px at 10% 0%, rgba(15, 108, 189, 0.28), transparent 60%),
    radial-gradient(1000px 520px at 90% 10%, rgba(114, 183, 178, 0.20), transparent 60%),
    radial-gradient(900px 520px at 50% 120%, rgba(212, 163, 115, 0.14), transparent 55%),
    linear-gradient(135deg, rgba(2, 6, 23, 0.98), rgba(15, 23, 42, 0.98));
  color: rgba(248, 250, 252, 0.96);
  color-scheme: dark;

  --auth-input-bg: rgba(2, 6, 23, 0.52);

  --scroll-track: rgba(2, 6, 23, 0.65);
  --scroll-thumb: rgba(114, 183, 178, 0.45);
  --scroll-thumb-hover: rgba(114, 183, 178, 0.72);
}

/* Landing page uses its own CSS, but keep scrollbars consistent with the dark theme. */
body.landing-glass {
  --scroll-track: rgba(2, 6, 23, 0.70);
  --scroll-thumb: rgba(114, 183, 178, 0.40);
  --scroll-thumb-hover: rgba(114, 183, 178, 0.70);
}

body.auth-glass main {
  background: transparent;
  min-height: 100vh;
  padding: 42px 18px 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

/* Long forms (register, reset password, etc.) should start closer to the top
   but remain centered horizontally. */
body.auth-glass.auth-long main {
  align-items: center;
  justify-content: flex-start;
}

.auth-shell {
  width: min(1100px, 100%);
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 26px;
  align-items: stretch;
}

.auth-shell--stack {
  width: min(1200px, 100%);
  grid-template-columns: 1fr;
}

.auth-shell--stack .auth-copy,
.auth-shell--stack .auth-card {
  width: 100%;
}

.auth-copy,
.auth-card {
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 26px 80px rgba(2, 6, 23, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.auth-copy {
  padding: 24px 24px 22px;
  position: relative;
  overflow: hidden;
}

.auth-copy::before {
  content: "";
  position: absolute;
  inset: -1px;
  background:
    radial-gradient(560px 280px at 18% 18%, rgba(15, 108, 189, 0.30), transparent 60%),
    radial-gradient(520px 260px at 88% 10%, rgba(114, 183, 178, 0.18), transparent 65%);
  opacity: 0.9;
  pointer-events: none;
}

.auth-copy > * { position: relative; }

.auth-eyebrow {
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-weight: 800;
  color: rgba(226, 232, 240, 0.88);
}

.auth-title {
  font-family: 'Manrope', sans-serif;
  font-size: 36px;
  line-height: 1.08;
  margin: 10px 0 12px;
  letter-spacing: -0.02em;
  text-shadow: 0 14px 36px rgba(2, 6, 23, 0.65);
}

.auth-subtitle {
  margin: 0;
  color: rgba(226, 232, 240, 0.74);
  line-height: 1.65;
  font-size: 15px;
}

.auth-bullets {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.auth-bullets li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: rgba(226, 232, 240, 0.78);
  line-height: 1.55;
  font-size: 13px;
}

.auth-bullets li svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin-top: 1px;
  color: rgba(114, 183, 178, 0.95);
}

.auth-card {
  padding: 22px 22px 18px;
  display: grid;
  gap: 16px;
}

.auth-card form {
  display: grid;
  gap: 14px;
  margin-top: 4px;
}

.auth-submit { margin-top: 6px; }

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.auth-brand strong {
  font-family: 'Manrope', sans-serif;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: rgba(248, 250, 252, 0.96);
}

.auth-brand small {
  display: block;
  font-size: 12px;
  color: rgba(226, 232, 240, 0.74);
  margin-top: 2px;
}

.auth-field {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 800;
  color: rgba(226, 232, 240, 0.78);
}

.auth-field input {
  width: 100%;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: var(--auth-input-bg);
  color: rgba(248, 250, 252, 0.96);
  outline: none;
}

.auth-field input::placeholder { color: rgba(226, 232, 240, 0.42); }

.auth-field input:focus {
  border-color: rgba(114, 183, 178, 0.55);
  box-shadow: 0 0 0 3px rgba(114, 183, 178, 0.14);
}

body.auth-glass .btn {
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(2, 6, 23, 0.30);
  color: rgba(226, 232, 240, 0.92);
  box-shadow: 0 16px 40px rgba(2, 6, 23, 0.35);
}

body.auth-glass .btn:hover {
  border-color: rgba(226, 232, 240, 0.24);
  background: rgba(2, 6, 23, 0.42);
  box-shadow: 0 20px 55px rgba(2, 6, 23, 0.45);
}

body.auth-glass .btn-primary {
  background: linear-gradient(135deg, rgba(15, 108, 189, 0.92), rgba(0, 120, 212, 0.92));
  border: 1px solid rgba(15, 108, 189, 0.55);
  color: #fff;
  box-shadow: 0 22px 70px rgba(15, 108, 189, 0.30);
}

body.auth-glass .btn-primary:hover {
  background: linear-gradient(135deg, rgba(15, 108, 189, 0.98), rgba(0, 120, 212, 0.98));
  border-color: rgba(226, 232, 240, 0.28);
}

.auth-alert {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.12);
  color: rgba(254, 226, 226, 0.96);
  font-size: 13px;
  font-weight: 800;
}

.auth-notice {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(16, 185, 129, 0.40);
  background: rgba(16, 185, 129, 0.10);
  color: rgba(167, 243, 208, 0.96);
  font-size: 13px;
  font-weight: 900;
}

.auth-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}

.auth-links--start { justify-content: flex-start; }
.auth-submit { width: 100%; }

.auth-link {
  font-size: 12px;
  font-weight: 900;
  color: rgba(226, 232, 240, 0.86);
}

.auth-link:hover { text-decoration: underline; }

.auth-footnote {
  margin: 0;
  font-size: 12px;
  color: rgba(226, 232, 240, 0.66);
  line-height: 1.5;
}

.auth-powered {
  margin: 0;
  width: 100%;
  text-align: center;
  font-size: 12px;
  font-weight: 900;
  color: rgba(226, 232, 240, 0.62);
}

.auth-powered strong { color: rgba(248, 250, 252, 0.9); }

/* Registration helper components (kept generic but scoped by .auth-glass usage) */
body.auth-glass .section-title {
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: -0.01em;
  margin: 10px 0 8px;
  color: rgba(248, 250, 252, 0.96);
}

body.auth-glass .form-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}
body.auth-glass .form-grid.form-grid--1 { grid-template-columns: 1fr; }
body.auth-glass .form-grid.form-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body.auth-glass .form-grid.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 980px) {
  body.auth-glass .form-grid.form-grid--2,
  body.auth-glass .form-grid.form-grid--3 { grid-template-columns: 1fr; }
}

body.auth-glass .form-field {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 800;
  color: rgba(226, 232, 240, 0.78);
}

body.auth-glass .form-field input,
body.auth-glass .form-field select {
  width: 100%;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: var(--auth-input-bg);
  color: rgba(248, 250, 252, 0.96);
  outline: none;
}

/* Some browsers allow styling option list; keep it dark where supported. */
body.auth-glass select option {
  background: rgba(2, 6, 23, 0.98);
  color: rgba(248, 250, 252, 0.96);
}

/* Keep browser autofill aligned with the dark auth theme. */
body.auth-glass input:-webkit-autofill,
body.auth-glass input:-webkit-autofill:hover,
body.auth-glass input:-webkit-autofill:focus {
  -webkit-text-fill-color: rgba(248, 250, 252, 0.96);
  -webkit-box-shadow: 0 0 0px 1000px rgba(2, 6, 23, 0.35) inset;
  transition: background-color 9999s ease-in-out 0s;
}

body.auth-glass .form-field input:focus,
body.auth-glass .form-field select:focus {
  border-color: rgba(114, 183, 178, 0.55);
  box-shadow: 0 0 0 3px rgba(114, 183, 178, 0.14);
}

body.auth-glass .note {
  margin: 0;
  font-size: 12px;
  color: rgba(226, 232, 240, 0.66);
  line-height: 1.5;
}

body.auth-glass .hidden { display: none !important; }

body.auth-glass .is-invalid {
  border-color: rgba(239, 68, 68, 0.75) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

body.auth-glass .field-error {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 900;
  color: rgba(254, 202, 202, 0.96);
}

@media (max-width: 980px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-title { font-size: 30px; }
}

/* ===================== COMPONENTES ===================== */

a {
  color: inherit;
  text-decoration: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 108, 189, 0.4);
  box-shadow: var(--shadow-sm);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-secondary), var(--brand-primary));
  border: none;
  color: #ffffff;
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: #ffffff;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 12px;
}

.nav-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: var(--shadow-xs);
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.section-title {
  font-family: 'Manrope', sans-serif;
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 4px;
}

.section-subtitle {
  color: var(--muted);
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.limit-card {
  margin-top: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.limit-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 700;
}

.limit-progress {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  border: 0;
  background: rgba(15, 108, 189, 0.12);
}

.limit-progress::-webkit-progress-bar {
  background: rgba(15, 108, 189, 0.12);
}

.limit-progress::-webkit-progress-value {
  background: var(--brand-primary);
}

.limit-progress::-moz-progress-bar {
  background: var(--brand-primary);
}

body.theme-dark-glass .limit-progress,
body.theme-dark-glass .limit-progress::-webkit-progress-bar {
  background: rgba(15, 23, 42, 0.65);
}

body.theme-dark-glass .limit-progress::-webkit-progress-value,
body.theme-dark-glass .limit-progress::-moz-progress-bar {
  background: rgba(114, 183, 178, 0.95);
}

.is-invalid {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.field-error {
  color: #b91c1c;
  font-size: 12px;
  margin-top: 4px;
  font-weight: 700;
}

/* ===================== TOP NAV ===================== */

.top-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.top-nav-inner {
  width: 100%;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  color: var(--power-black);
}

.brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  gap: 10px;
  align-items: center;
}

.nav-links a {
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 13px;
}

.nav-links a:hover {
  border-color: rgba(15, 108, 189, 0.35);
  background: var(--accent-soft);
}

.nav-toggle {
  display: none;
}

@media (max-width: 820px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links.open {
    display: flex;
  }
}

/* ===================== ELEMENTOS ===================== */

.panel,
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.hero {
  background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(235,244,255,0.95));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 20px;
}

input,
select,
textarea {
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

/* ===================== UTILIDADES ===================== */

.hidden { display: none; }
.inline-block { display: inline-block; }
.overflow-x { overflow-x: auto; }

.flex-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.align-end { align-items: flex-end; }
.align-start { align-items: flex-start; }

.mt-6 { margin-top: 6px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-10 { margin-bottom: 10px; }
.mb-12 { margin-bottom: 12px; }
.ml-auto { margin-left: auto; }

.full-row { grid-column: 1 / -1; }

/* ===================== TABLE COMPONENT (shared) ===================== */

/* wrapper para evitar quebrar layout em telas pequenas */
.table-wrapper,
.table-wrap{
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 14px;
}

.table-wrapper--scroll{
  overflow: auto;
  max-height: min(70vh, 720px);
}

.recurring-group-row td{
  background: rgba(15, 23, 42, 0.06);
  border-bottom: 1px solid var(--line-color, var(--line));
}
.recurring-group-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.recurring-group-left{
  display:flex;
  align-items:center;
  gap:12px;
}
.recurring-group-info{
  display:flex;
  flex-direction:column;
  gap:2px;
  align-items:flex-start;
  text-align:left;
}
.recurring-group-meta{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.recurring-group-toggle{
  width:32px;
  height:32px;
  padding:0;
}
.recurring-group-toggle.is-collapsed svg{
  transform: rotate(-90deg);
}
.recurring-group-item.is-collapsed{
  display:none;
}

body.theme-dark-glass .recurring-group-row td{
  background: rgba(15, 23, 42, 0.45);
  border-color: rgba(148, 163, 184, 0.18);
}

/* tabela padrão do workspace */
.table-cards,
.ws-table,
.admin-table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--line-color, var(--line));
  border-radius: 14px;
  background: #fff;
  min-width: 720px;
}

/* quando a tabela for pequena, pode remover min-width no HTML adicionando class ws-table--auto */
.ws-table--auto{ min-width: 0 !important; }

.table-cards thead th,
.ws-table thead th,
.admin-table thead th{
  position: sticky;
  top: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(245,247,251,0.96));
  color: var(--text-muted, var(--muted));
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line-color, var(--line));
}

.table-cards th, .table-cards td,
.ws-table th, .ws-table td,
.admin-table th, .admin-table td{
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line-color, var(--line));
  vertical-align: middle;
  color: var(--text-ink, var(--ink));
  font-size: 14px;
}

.table-cards tbody tr:nth-child(even),
.ws-table tbody tr:nth-child(even),
.admin-table tbody tr:nth-child(even){
  background: rgba(245,247,251,0.55);
}

.table-cards tbody tr:hover,
.ws-table tbody tr:hover,
.admin-table tbody tr:hover{
  background: rgba(232,242,251,0.75);
}

.inline-actions,
.table-actions{
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

/* coluna de ações alinhada à direita */
.table-cards td:last-child,
.ws-table td:last-child,
.admin-table td:last-child{
  text-align: right;
}

/* cell com avatar + nome */
.table-name{
  display: inline-flex;
  gap: 10px;
  align-items: center;
  font-weight: 700;
}

.table-avatar{
  width: 32px;
  height: 32px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--line-color, var(--line));
  background: #fff;
}

/* Dark glass: tables should not render as white blocks. */
body.theme-dark-glass .table-wrapper,
body.theme-dark-glass .table-wrap{
  border: 1px solid rgba(148, 163, 184, 0.18);
}

body.theme-dark-glass .table-cards,
body.theme-dark-glass .ws-table,
body.theme-dark-glass .admin-table{
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(148, 163, 184, 0.18) !important;
  box-shadow: 0 26px 80px rgba(2, 6, 23, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

body.theme-dark-glass .table-cards thead th,
body.theme-dark-glass .ws-table thead th,
body.theme-dark-glass .admin-table thead th{
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.65), rgba(2, 6, 23, 0.35)) !important;
  color: rgba(226, 232, 240, 0.80) !important;
  border-bottom-color: rgba(148, 163, 184, 0.18) !important;
}

body.theme-dark-glass .table-cards th,
body.theme-dark-glass .table-cards td,
body.theme-dark-glass .ws-table th,
body.theme-dark-glass .ws-table td,
body.theme-dark-glass .admin-table th,
body.theme-dark-glass .admin-table td{
  color: rgba(248, 250, 252, 0.92) !important;
  border-bottom-color: rgba(148, 163, 184, 0.18) !important;
}

body.theme-dark-glass .table-cards tbody tr:nth-child(even),
body.theme-dark-glass .ws-table tbody tr:nth-child(even),
body.theme-dark-glass .admin-table tbody tr:nth-child(even){
  background: rgba(2, 6, 23, 0.18) !important;
}

body.theme-dark-glass .table-cards tbody tr:hover,
body.theme-dark-glass .ws-table tbody tr:hover,
body.theme-dark-glass .admin-table tbody tr:hover{
  background: rgba(255, 255, 255, 0.08) !important;
}

body.theme-dark-glass .table-avatar{
  background: rgba(255, 255, 255, 0.92) !important;
  border-color: rgba(148, 163, 184, 0.18) !important;
}

/* status pill */
.pill{
  display:inline-flex;
  align-items:center;
  padding:4px 10px;
  border-radius:999px;
  font-size:11px;
  font-weight:700;
  background: #F1F5F9;
  color: var(--text-muted, var(--muted));
  border: 1px solid var(--line-color, var(--line));
}

.pill-ok {
  background: #DCFCE7;
  border-color: #BBF7D0;
  color: #166534;
}

.help-step-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.help-mt-12 {
  margin-top: 12px;
}

.help-form {
  margin: 0;
}

.help-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.help-card {
  background: #ffffff;
  border: 1px solid var(--line-color, var(--line));
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

body.theme-dark-glass .help-card {
  background: #0b1220;
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.35);
}

.help-card--wide {
  grid-column: 1 / -1;
}

.help-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.help-card-title {
  font-weight: 900;
}

.help-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--line-color, var(--line));
  background:
    radial-gradient(circle at 10% 20%, rgba(15, 108, 189, 0.10), transparent 45%),
    radial-gradient(circle at 95% 10%, rgba(0, 120, 212, 0.10), transparent 35%),
    #ffffff;
  box-shadow: var(--shadow-xs);
}

body.theme-dark-glass .help-hero {
  border-color: rgba(148, 163, 184, 0.18);
  background:
    radial-gradient(circle at 10% 20%, rgba(93, 169, 255, 0.18), transparent 45%),
    radial-gradient(circle at 95% 10%, rgba(46, 211, 198, 0.12), transparent 35%),
    #0b1220;
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.35);
}

.help-hero-title {
  margin: 0 0 6px;
  font-weight: 900;
  font-size: 22px;
}

.help-hero-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.help-hero-meta {
  display: grid;
  gap: 10px;
  min-width: min(340px, 100%);
}

.help-progress-row {
  display: grid;
  gap: 6px;
}

.help-progress-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.help-progress {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line-color, var(--line));
  background: #f1f5f9;
}

.help-progress::-webkit-progress-bar {
  background: #f1f5f9;
}

.help-progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--brand-secondary), var(--brand-primary));
  border-radius: 999px;
}

.help-progress::-moz-progress-bar {
  background: linear-gradient(90deg, var(--brand-secondary), var(--brand-primary));
  border-radius: 999px;
}

.help-quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.help-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid var(--line-color, var(--line));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  color: var(--brand-secondary);
  flex: 0 0 auto;
}

.help-card-icon svg {
  width: 18px;
  height: 18px;
}

.help-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.help-card-head-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.help-bullets {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  display: grid;
  gap: 6px;
}

.help-faq {
  border: 1px solid var(--line-color, var(--line));
  border-radius: 16px;
  padding: 12px 14px;
  background: #ffffff;
}

body.theme-dark-glass .help-faq {
  background: #0b1220;
  border-color: rgba(148, 163, 184, 0.18);
}

.help-faq summary {
  cursor: pointer;
  font-weight: 900;
  color: var(--ink);
  list-style: none;
}

body.theme-dark-glass .help-faq summary {
  color: rgba(226, 232, 240, 0.9);
}

.help-faq summary::-webkit-details-marker {
  display: none;
}

.help-faq summary::after {
  content: '+';
  float: right;
  color: var(--muted);
  font-weight: 900;
}

.help-faq[open] summary::after {
  content: '-';
}

.help-faq p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.help-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.help-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-color, var(--line));
}

.help-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* Plans admin */
.plan-card-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* simple onboarding/help modal (portal) */
.ws-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px 12px;
  z-index: 2000;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.ws-modal.is-open {
  display: flex;
}

.ws-modal-card {
  width: min(760px, 100%);
  background: #ffffff;
  border: 1px solid var(--line-color, var(--line));
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow-lg);
}

body.theme-dark-glass .ws-modal-card {
  background: #0b1220 !important;
  border-color: #1f2a37 !important;
  box-shadow: 0 26px 80px rgba(2, 6, 23, 0.55);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.ws-modal-title {
  margin: 0 0 6px;
  font-weight: 900;
  font-size: 18px;
}

.ws-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.ws-checklist {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

/* mobile: esconde cabeçalho e usa data-label */
@media (max-width: 720px){
  .table-cards,
  .ws-table,
  .admin-table{
    min-width: 0;
    border: none;
    border-radius: 0;
  }

  .table-cards thead,
  .ws-table thead,
  .admin-table thead{
    display:none;
  }

  .table-cards tr,
  .ws-table tr,
  .admin-table tr{
    display:block;
    padding: 12px;
    border: 1px solid var(--line-color, var(--line));
    border-radius: 14px;
    background: #fff;
    margin-bottom: 10px;
  }

  .table-cards td,
  .ws-table td,
  .admin-table td{
    display:flex;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 0;
    padding: 8px 0;
    text-align: left !important;
  }

  .table-cards td::before,
  .ws-table td::before,
  .admin-table td::before{
    content: attr(data-label);
    color: var(--text-muted, var(--muted));
    font-weight: 800;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
  }

  .inline-actions,
  .table-actions{
    width: 100%;
    justify-content: flex-start;
  }

  body.theme-dark-glass .table-cards tr,
  body.theme-dark-glass .ws-table tr,
  body.theme-dark-glass .admin-table tr{
    background: rgba(15, 23, 42, 0.55);
    border-color: rgba(148, 163, 184, 0.18);
  }
}

/* alerts: kanban layout + comment preview */
.alerts-head-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.alerts-tabs {
  gap: 8px;
}

.alerts-recurring-board {
  margin-top: 8px;
}

.alerts-recurring-board .alerts-kanban {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 1100px) {
  .alerts-recurring-board .alerts-kanban { grid-template-columns: 1fr; }
}

.alerts-kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

@media (max-width: 1100px) {
  .alerts-kanban {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .alerts-kanban {
    grid-template-columns: 1fr;
  }
}

.kanban-col {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--line-color, var(--line));
  border-radius: 18px;
  overflow: hidden;
}

.kanban-col-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--line-color, var(--line));
  background: #ffffff;
}

.kanban-col-head--novo {
  background: linear-gradient(180deg, rgba(247, 243, 207, 0.75), #ffffff);
}

.kanban-col-head--analise {
  background: linear-gradient(180deg, rgba(219, 234, 254, 0.75), #ffffff);
}

.kanban-col-head--testes {
  background: linear-gradient(180deg, rgba(186, 230, 253, 0.75), #ffffff);
}

.kanban-col-head--feito {
  background: linear-gradient(180deg, rgba(220, 252, 231, 0.75), #ffffff);
}

.kanban-col-title strong {
  display: block;
  font-weight: 900;
}

.kanban-col-body {
  display: grid;
  gap: 12px;
  padding: 12px 14px 14px;
  max-height: 62vh;
  overflow: auto;
}

.alert-card {
  background: #ffffff;
  border: 1px solid var(--line-color, var(--line));
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
  display: grid;
  gap: 10px;
  position: relative;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.alert-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--alert-accent, rgba(15, 108, 189, 0.6));
  opacity: 0.9;
}

.alert-card[data-priority="baixa"] { --alert-accent: rgba(16, 185, 129, 0.75); }
.alert-card[data-priority="media"] { --alert-accent: rgba(59, 130, 246, 0.75); }
.alert-card[data-priority="alta"] { --alert-accent: rgba(249, 115, 22, 0.85); }
.alert-card[data-priority="critica"] { --alert-accent: rgba(239, 68, 68, 0.9); }

.alert-card:not(.is-dragging):not(.is-updating):hover {
  border-color: rgba(15, 108, 189, 0.26);
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.16);
  transform: translateY(-1px);
}

.alert-card.is-dragging {
  opacity: 0.65;
  transform: rotate(-0.4deg);
}

.alert-card.is-just-moved {
  animation: wsCardPop 0.55s ease both;
}

.alert-card.is-updating {
  pointer-events: none;
  opacity: 0.78;
}

.alert-card.is-updating::after {
  content: "Salvando...";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  color: rgba(15, 23, 42, 0.76);
  letter-spacing: .02em;
  z-index: 3;
}

.alert-card.is-updating::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(15, 23, 42, 0.18);
  border-top-color: rgba(15, 108, 189, 0.85);
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, calc(-50% - 18px));
  animation: wsSpin 0.8s linear infinite;
  z-index: 4;
}

/* Dark glass: alerts/kanban surfaces must match the theme. */
body.theme-dark-glass .kanban-col{
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(148, 163, 184, 0.18) !important;
  box-shadow: 0 26px 80px rgba(2, 6, 23, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

body.theme-dark-glass .kanban-col-head{
  background: rgba(2, 6, 23, 0.45) !important;
  border-bottom-color: rgba(148, 163, 184, 0.18) !important;
  color: rgba(248, 250, 252, 0.96);
}

body.theme-dark-glass .kanban-col-head--novo{
  background: linear-gradient(180deg, rgba(245, 208, 94, 0.10), rgba(2, 6, 23, 0.45)) !important;
}

body.theme-dark-glass .kanban-col-head--analise{
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.14), rgba(2, 6, 23, 0.45)) !important;
}

body.theme-dark-glass .kanban-col-head--testes{
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.16), rgba(2, 6, 23, 0.45)) !important;
}

body.theme-dark-glass .kanban-col-head--feito{
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.14), rgba(2, 6, 23, 0.45)) !important;
}

body.theme-dark-glass .alert-card{
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.86), rgba(2, 6, 23, 0.92)) !important;
  border-color: rgba(148, 163, 184, 0.18) !important;
  box-shadow: 0 18px 55px rgba(2, 6, 23, 0.50);
  color: rgba(248, 250, 252, 0.92);
}

body.theme-dark-glass .alert-card:not(.is-dragging):not(.is-updating):hover{
  border-color: rgba(114, 183, 178, 0.55) !important;
  box-shadow: 0 28px 80px rgba(2, 6, 23, 0.62);
}

body.theme-dark-glass .alert-card.is-updating::after{
  background: rgba(2, 6, 23, 0.70) !important;
  color: rgba(248, 250, 252, 0.92) !important;
}

body.theme-dark-glass .alerts-filter-block{
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(148, 163, 184, 0.18) !important;
  box-shadow: 0 26px 80px rgba(2, 6, 23, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

body.theme-dark-glass .alerts-date,
body.theme-dark-glass .alerts-search-input,
body.theme-dark-glass .alerts-select,
body.theme-dark-glass .alerts-theme-field input[type="color"]{
  background: rgba(2, 6, 23, 0.35) !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
  color: rgba(248, 250, 252, 0.92) !important;
}

body.theme-dark-glass .alerts-filter-help{ color: rgba(226, 232, 240, 0.70); }

body.theme-dark-glass .alert-card.is-recurring{
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.10), rgba(2, 6, 23, 0.38)) !important;
  border-left-color: rgba(16, 185, 129, 0.60) !important;
}

body.theme-dark-glass .alert-card.is-planned{
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.14), rgba(2, 6, 23, 0.38)) !important;
  border-left-color: rgba(245, 158, 11, 0.70) !important;
}

body.theme-dark-glass .pill--recurring{
  color: rgba(167, 243, 208, 0.96);
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.28);
}

body.theme-dark-glass .recurring-title{ color: rgba(226, 232, 240, 0.78); }

body.theme-dark-glass .alerts-search-input,
body.theme-dark-glass .alerts-select{
  background: rgba(2, 6, 23, 0.35) !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
  color: rgba(248, 250, 252, 0.92) !important;
}

body.theme-dark-glass .alerts-assignee-summary{
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(148, 163, 184, 0.18) !important;
  box-shadow: 0 26px 80px rgba(2, 6, 23, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

body.theme-dark-glass .swimlane{
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(148, 163, 184, 0.18) !important;
}

body.theme-dark-glass .swimlane-head{
  background: rgba(2, 6, 23, 0.45) !important;
  border-bottom-color: rgba(148, 163, 184, 0.18) !important;
  color: rgba(248, 250, 252, 0.96);
}

body.theme-dark-glass .ws-toast--error{
  background: rgba(127, 29, 29, 0.25);
  border-color: rgba(239, 68, 68, 0.45);
  color: rgba(254, 226, 226, 0.96);
}

body.theme-dark-glass .ws-toast--ok{
  background: rgba(6, 95, 70, 0.25);
  border-color: rgba(16, 185, 129, 0.42);
  color: rgba(209, 250, 229, 0.96);
}

/* ===================== DARK GLASS: Global forms + billing + alerts thread ===================== */

body.theme-dark-glass input,
body.theme-dark-glass select,
body.theme-dark-glass textarea {
  background: rgba(2, 6, 23, 0.35) !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
  color: rgba(248, 250, 252, 0.96) !important;
}

body.theme-dark-glass input::placeholder,
body.theme-dark-glass textarea::placeholder {
  color: rgba(226, 232, 240, 0.58) !important;
}

body.theme-dark-glass select option {
  color: #0f172a;
}

body.theme-dark-glass .hero {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: 0 26px 80px rgba(2, 6, 23, 0.45);
}

body.theme-dark-glass .addon-card {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(148, 163, 184, 0.18) !important;
}

body.theme-dark-glass .plan-tag {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(148, 163, 184, 0.28);
  color: rgba(226, 232, 240, 0.86);
}
body.theme-dark-glass .plan-tag.tag-cycle {
  border-color: rgba(114, 183, 178, 0.45);
  background: rgba(114, 183, 178, 0.18);
  color: rgba(226, 232, 240, 0.92);
}
body.theme-dark-glass .plan-tag.tag-recommended,
body.theme-dark-glass .plan-tag.tag-best {
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(148, 163, 184, 0.16);
}
body.theme-dark-glass .plan-tag.tag-current {
  border-color: rgba(217, 129, 185, 0.45);
  background: rgba(217, 129, 185, 0.18);
  color: rgba(255, 228, 248, 0.95);
}

body.theme-dark-glass .receipts-table th,
body.theme-dark-glass .receipts-table td {
  border-bottom-color: rgba(148, 163, 184, 0.18);
  color: rgba(226, 232, 240, 0.86);
}

body.theme-dark-glass .alert-reply {
  background: rgba(2, 6, 23, 0.45) !important;
  border-color: rgba(148, 163, 184, 0.18) !important;
  color: rgba(248, 250, 252, 0.92);
}
body.theme-dark-glass .alert-reply-msg { color: rgba(226, 232, 240, 0.86); }
body.theme-dark-glass .alert-thread-form textarea {
  background: rgba(2, 6, 23, 0.35) !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
  color: rgba(248, 250, 252, 0.96) !important;
}

body.theme-dark-glass .alert-thread-form {
  background: #0b1220;
  box-shadow: 0 -12px 18px rgba(2, 6, 23, 0.55);
}
body.theme-dark-glass .mentions-popover {
  background: rgba(2, 6, 23, 0.85) !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
  box-shadow: 0 26px 80px rgba(2, 6, 23, 0.65);
}
body.theme-dark-glass .mentions-search {
  background: rgba(2, 6, 23, 0.35) !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
  color: rgba(248, 250, 252, 0.92) !important;
}
body.theme-dark-glass .mentions-item {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(148, 163, 184, 0.22) !important;
  color: rgba(226, 232, 240, 0.88) !important;
}
body.theme-dark-glass .mentions-item:hover {
  background: rgba(255, 255, 255, 0.10) !important;
  border-color: rgba(114, 183, 178, 0.55) !important;
}

@keyframes wsSpin {
  to { transform: translate(-50%, calc(-50% - 18px)) rotate(360deg); }
}

@keyframes wsCardPop {
  0% { transform: translateY(0); }
  35% { transform: translateY(-2px); box-shadow: 0 22px 46px rgba(15, 23, 42, 0.16); }
  100% { transform: translateY(0); }
}

.kanban-col.is-dragover {
  box-shadow: 0 0 0 3px rgba(15, 108, 189, 0.14);
  border-color: rgba(15, 108, 189, 0.35);
}

.alert-card-top {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.alert-people {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (max-width: 520px) {
  .alert-people { grid-template-columns: 1fr; }
}

.alert-person {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(248, 250, 252, 0.7);
}
body.theme-dark-glass .alert-person {
  background: rgba(2, 6, 23, 0.55);
  border-color: rgba(148, 163, 184, 0.22);
}

.alert-person--author {
  border-style: solid;
  border-color: var(--alerts-author-border);
  background: var(--alerts-author-bg);
}

.alert-person--assignee {
  border-style: solid;
  border-color: var(--alerts-assignee-border);
  background: var(--alerts-assignee-bg);
  color: var(--alerts-assignee-text);
}

.alert-person--assignee .muted {
  color: var(--alerts-assignee-muted);
}
body.theme-dark-glass .alert-person--assignee strong {
  color: rgba(248, 250, 252, 0.96);
}

.alert-person-value {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.alert-person-value strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ws-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: .02em;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(15, 23, 42, 0.12);
  color: rgba(15, 23, 42, 0.8);
  flex: 0 0 auto;
}

.alert-person--assignee .ws-avatar {
  color: var(--alerts-assignee-text);
}

.label-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.label-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  opacity: 0.8;
}

.alert-title {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.25;
}

.alert-title-text {
  min-width: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}

@media (max-width: 720px) {
  .alert-title-text { -webkit-line-clamp: 2; }
}

.kind-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(248, 250, 252, 0.92);
  color: rgba(15, 23, 42, 0.72);
}

.kind-badge--comment {
  background: rgba(59, 130, 246, 0.10);
  border-color: rgba(59, 130, 246, 0.22);
  color: rgb(255 255 255 / 92%);
}

.kind-badge--recurring {
  background: rgba(16, 185, 129, 0.38);
  border-color: rgba(16, 185, 129, 0.68);
  color: #f8fafc;
}

.kind-badge--planned {
  background: rgba(79, 70, 229, 0.38);
  border-color: rgba(79, 70, 229, 0.7);
  color: #f8fafc;
}

.recurring-title {
  font-size: 12px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.kind-badge--workspace {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.32);
  color: rgba(255, 255, 255, 0.92);
}

.title-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  opacity: 0.9;
}

.age-pill,
.date-pill {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.08);
  color: rgba(15, 23, 42, 0.72);
}

.age-7 {
  border-left: 4px solid rgba(239, 68, 68, 0.55);
}

.age-3 {
  border-left: 4px solid rgba(245, 158, 11, 0.55);
}

.age-1 {
  border-left: 4px solid rgba(59, 130, 246, 0.45);
}

.age-0 {
  border-left: 4px solid rgba(16, 185, 129, 0.35);
}

.alert-context {
  display: grid;
  gap: 4px;
}

.alert-summary {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.alert-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.alert-meta-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.alert-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(248, 250, 252, 0.88);
  font-size: 12px;
  font-weight: 800;
  color: rgba(15, 23, 42, 0.78);
}

body.theme-dark-glass .alert-meta-item {
  background: #0b1220;
  border-color: #1f2a37;
  color: rgba(226, 232, 240, 0.86);
}

.alert-meta-item svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  opacity: 0.86;
}

.alert-meta-item strong {
  font-weight: 900;
  color: rgb(247 247 247 / 90%);
}

.alert-meta-item .muted {
  font-weight: 800;
  font-size: 11px;
}

.alert-meta-item--time {
  background: rgba(15, 23, 42, 0.03);
  border-color: rgba(15, 23, 42, 0.08);
}

.alert-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-start;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.alert-card:hover .alert-actions,
.alert-card:focus-within .alert-actions {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@media (max-width: 900px) {
  .alert-actions {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
}

.alert-actions .inline-actions {
  justify-content: flex-start;
  margin-right: auto;
}

.alert-actions .btn-primary {
  box-shadow: 0 10px 18px rgba(15, 108, 189, 0.22);
}

.alert-actions select.btn {
  width: auto;
  min-width: 132px;
}

@media (max-width: 520px) {
  .alert-actions select.btn { width: 100%; }
}

.alerts-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
  align-items: stretch;
  margin: 8px 0 16px;
}

.alerts-filters.alerts-filters--stack {
  grid-template-columns: 1fr;
}

@media (max-width: 1200px) {
  .alerts-filters { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
}

@media (max-width: 720px) {
  .alerts-filters { grid-template-columns: 1fr; }
}

.alerts-filter-block {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--line-color, var(--line));
  border-radius: 16px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 80px;
}

.alerts-filters .pill {
  cursor: pointer;
}

.alerts-filters .pill.status-ativo,
.alerts-filters .pill[aria-pressed="true"] {
  background: rgba(249, 115, 22, 0.22);
  border-color: rgba(249, 115, 22, 0.65);
  color: #fff;
  box-shadow: 0 10px 18px rgba(249, 115, 22, 0.18);
}

body.theme-dark-glass .alerts-filters .pill.status-ativo,
body.theme-dark-glass .alerts-filters .pill[aria-pressed="true"] {
  background: rgba(249, 115, 22, 0.26);
  border-color: rgba(249, 115, 22, 0.75);
  color: rgba(255, 255, 255, 0.95);
}

.alerts-filter-label {
  font-weight: 900;
  letter-spacing: .02em;
  margin-bottom: 8px;
}

.alerts-date-grid {
  display: grid;
  grid-template-columns: auto minmax(130px, 1fr) auto minmax(130px, 1fr) 36px;
  gap: 10px;
  align-items: center;
}

.alerts-date-grid label {
  font-weight: 700;
  opacity: 0.85;
}

.alerts-date {
  color: rgba(15, 23, 42, 0.86);
}

.alerts-date-grid .btn {
  height: 40px;
  width: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
}

.alerts-date {
  width: 100%;
  max-width: 150px;
  height: 40px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(248, 250, 252, 0.85);
  font-weight: 700;
  font-size: 12px;
  color: rgba(15, 23, 42, 0.86);
}

.alerts-date:focus {
  outline: 2px solid rgba(15, 108, 189, 0.28);
  border-color: rgba(15, 108, 189, 0.35);
}

.alerts-filter-help {
  font-size: 12px;
  font-weight: 700;
  opacity: 0.78;
}

.alerts-theme-form {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.alerts-theme-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 10px;
}

.alerts-theme-field {
  display: grid;
  gap: 8px;
}

.alerts-theme-field input[type="color"] {
  width: 100%;
  height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(248, 250, 252, 0.85);
  padding: 6px;
  cursor: pointer;
}

@media (max-width: 520px) {
  .alerts-date-grid { grid-template-columns: 1fr; }
  .alerts-date-grid .btn { width: 100%; justify-self: stretch; }
  .alerts-date { max-width: 100%; }
  .alerts-theme-grid { grid-template-columns: 1fr; }
}

[data-filter-status],
[data-filter-origin],
[data-filter-priority],
[data-filter-view],
[data-recurring-filter-priority] {
  cursor: pointer;
}

.alert-card.is-recurring {
  border-left: 4px solid rgba(16, 185, 129, 0.55);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.06), #ffffff);
}

.alert-card.is-recurring.is-recurring-done {
  border-left-color: rgba(34, 197, 94, 0.6);
}

.alert-card.is-planned {
  border-left: 4px solid rgba(245, 158, 11, 0.55);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.06), #ffffff);
}

.alert-card.is-planned.is-recurring-done {
  border-left-color: rgba(16, 185, 129, 0.6);
}

.pill--recurring {
  background: rgba(16, 185, 129, 0.10);
  border-color: rgba(16, 185, 129, 0.25);
  color: rgba(5, 48, 42, 0.92);
}

.recurring-title {
  font-size: 12px;
  font-weight: 800;
  color: rgba(15, 23, 42, 0.78);
}

.ws-toast-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 10px;
  z-index: 3000;
  max-width: min(420px, calc(100vw - 32px));
}

.ws-toast {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
  font-size: 13px;
  font-weight: 700;
  color: rgba(15, 23, 42, 0.86);
  transform: translateY(8px);
  opacity: 0;
  transition: transform .18s ease, opacity .18s ease;
}

.ws-toast.is-in {
  transform: translateY(0);
  opacity: 1;
}

.ws-toast--error {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(254, 242, 242, 0.92);
  color: rgba(127, 29, 29, 0.95);
}

.ws-toast--ok {
  border-color: rgba(16, 185, 129, 0.42);
  background: rgba(236, 253, 245, 0.92);
  color: rgba(6, 95, 70, 0.95);
}

.alerts-search {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.alerts-search-input {
  flex: 1;
  min-width: 180px;
  height: 40px;
  border: 1px solid var(--line-color, var(--line));
  border-radius: 12px;
  padding: 8px 10px;
  background: #ffffff;
}

.alerts-select {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line-color, var(--line));
  border-radius: 12px;
  padding: 8px 10px;
  background: #ffffff;
}

.alerts-assignee-summary {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--line-color, var(--line));
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 12px;
}

.alerts-assignee-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.is-hidden {
  display: none !important;
}

.alerts-summary {
  margin-top: 16px;
}

.swimlanes {
  display: grid;
  gap: 14px;
}

.swimlane {
  border: 1px solid var(--line-color, var(--line));
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.65);
  overflow: hidden;
}

.swimlane-head {
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line-color, var(--line));
  background: linear-gradient(180deg, rgba(15, 108, 189, 0.06), #ffffff);
}

.swimlane-body {
  padding: 12px 14px 14px;
  display: grid;
  gap: 12px;
  grid-auto-flow: column;
  grid-auto-columns: minmax(320px, 1fr);
  overflow-x: auto;
}

.swimlane-body .alert-card {
  max-width: 560px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon svg {
  width: 18px;
  height: 18px;
}

.alert-modal-card {
  width: min(860px, 100%);
  max-height: 86vh;
  overflow: auto;
  overscroll-behavior: contain;
}

.alert-modal-meta {
  margin-top: 8px;
}

.alert-modal-message {
  margin-top: 12px;
  white-space: pre-wrap;
  line-height: 1.55;
  color: var(--text-ink, var(--ink));
}

.alert-modal-image-wrap {
  margin-top: 14px;
}

.alert-modal-image {
  max-width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line-color, var(--line));
  display: block;
}

.alert-modal-image-missing {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px dashed rgba(100, 116, 139, 0.35);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.85);
}

body.theme-dark-glass .alert-modal-image-missing {
  background: #0b1220;
  border-color: rgba(148, 163, 184, 0.28);
  color: rgba(226, 232, 240, 0.82);
}

.alert-thread {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(100, 116, 139, 0.35);
  display: grid;
  gap: 10px;
}

.alert-thread-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.alert-thread-list {
  max-height: 360px;
  max-height: min(40vh, 360px);
  overflow: auto;
  display: grid;
  gap: 10px;
  padding-right: 4px;
  -webkit-overflow-scrolling: touch;
}

.alert-thread-more {
  display: flex;
  justify-content: center;
}

.alert-reply {
  border: 1px solid var(--line-color, var(--line));
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.85);
  padding: 10px 12px;
  display: grid;
  gap: 6px;
}

.alert-reply-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.alert-reply-author {
  font-weight: 900;
  font-size: 12px;
  color: var(--text-ink, var(--ink));
}

.alert-reply-time {
  font-size: 11px;
  color: var(--text-muted, var(--muted));
}

.alert-reply-msg {
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  color: rgba(15, 23, 42, 0.88);
}

.alert-reply-msg.is-collapsed {
  max-height: 8.4em;
  overflow: hidden;
}

.alert-reply-msg.is-expanded {
  max-height: none;
}

.alert-reply-toggle {
  align-self: flex-start;
  padding: 2px 8px;
  font-size: 11px;
}

.alert-thread-form {
  display: grid;
  gap: 8px;
  position: sticky;
  bottom: 0;
  background: #ffffff;
  padding-top: 8px;
  z-index: 2;
  box-shadow: 0 -12px 18px rgba(15, 23, 42, 0.06);
}

.alert-thread-form textarea {
  width: 100%;
  min-height: 84px;
  border: 1px solid var(--line-color, var(--line));
  border-radius: 14px;
  padding: 10px 12px;
  background: #ffffff;
  font-size: 13px;
  line-height: 1.45;
  resize: vertical;
}

.alert-thread-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.alert-reply-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.alert-reply-mentions {
  position: relative;
}

.mentions-popover {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  width: min(320px, calc(100vw - 40px));
  background: #ffffff;
  border: 1px solid var(--line-color, var(--line));
  border-radius: 14px;
  box-shadow: 0 18px 40px -24px rgba(15, 23, 42, 0.38);
  padding: 10px;
  z-index: 1200;
}

.mentions-search {
  width: 100%;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--line-color, var(--line));
  padding: 8px 10px;
  font-size: 13px;
}

.mentions-list {
  margin-top: 8px;
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
}

.mentions-item {
  width: 100%;
  text-align: left;
  border-radius: 12px;
  padding: 9px 10px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: rgba(248, 250, 252, 0.85);
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
}

.mentions-item:hover {
  border-color: rgba(148, 163, 184, 0.9);
  background: rgba(241, 245, 249, 0.95);
}

.ws-mention {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 12px;
  color: #0c4a6e;
  background: rgba(224, 242, 254, 0.9);
  border: 1px solid rgba(186, 230, 253, 0.95);
  margin: 0 2px;
}

.alert-reply-attach-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line-color, var(--line));
  border-radius: 14px;
  padding: 10px;
  background: rgba(248, 250, 252, 0.85);
}

body.theme-dark-glass .alert-reply-attach-preview {
  background: #0b1220;
  border-color: rgba(148, 163, 184, 0.22);
  color: rgba(226, 232, 240, 0.82);
}

.alert-reply-attach-preview img {
  width: 100%;
  max-width: 320px;
  max-height: 140px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: #ffffff;
}

.alert-reply-attachment {
  margin-top: 8px;
}

.alert-reply-attachment-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.alert-reply-attachment-thumb {
  width: 160px;
  max-width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: #ffffff;
}

.alert-thread-form.is-loading {
  opacity: 0.85;
}

.alert-thread-form.is-loading textarea {
  pointer-events: none;
}

.ws-skel {
  border: 1px solid var(--line-color, var(--line));
  border-radius: 14px;
  background: #ffffff;
  overflow: hidden;
}

.ws-skel .ws-skel-bar {
  height: 10px;
  margin: 10px 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(15,23,42,0.06), rgba(15,23,42,0.12), rgba(15,23,42,0.06));
  background-size: 240% 100%;
  animation: wsSkel 1.1s ease infinite;
}

.ws-skel .ws-skel-bar.ws-skel-bar--short {
  width: 54%;
}

.ws-skel .ws-skel-bar.ws-skel-bar--long {
  width: 86%;
}

@keyframes wsSkel {
  0% { background-position: 0% 0; }
  100% { background-position: 120% 0; }
}

/* ===================== PORTAL LAYOUT ===================== */

body.portal-layout main {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

body.portal-layout .hero-card {
  background: var(--panel);
  padding: 24px;
  border-radius: 26px;
  box-shadow: 0 18px 40px rgba(15, 108, 189, 0.08);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

body.portal-layout .hero-meta { display: flex; align-items: center; gap: 12px; }
body.portal-layout .hero-avatars { display: flex; gap: 6px; }
body.portal-layout .hero-avatars img {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid var(--line);
}
body.portal-layout .hero-avatars img:first-child {
  object-fit: contain;
  background: #ffffff;
  padding: 6px;
}
body.portal-layout .hero-title { font-size: 24px; margin: 0; }
body.portal-layout .hero-desc { color: var(--muted); margin: 0; }
body.portal-layout .hero-desc--mt { margin-top: 6px; }
body.portal-layout .hero-eyebrow {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
}
body.portal-layout .btn-row { display: flex; gap: 12px; flex-wrap: wrap; }
body.portal-layout .btn-pill { border-radius: 999px; }

body.portal-layout .panel,
body.portal-layout .section-card {
  background: var(--panel);
  padding: 20px;
  border-radius: 22px;
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(15, 108, 189, 0.08);
}

body.portal-layout .section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
body.portal-layout .section-head h3 { margin: 4px 0 0; }
body.portal-layout .section-sub { color: var(--muted); font-size: 13px; margin: 0; }

/* Utilities used by portal pages */
body.portal-layout .u-row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
body.portal-layout .u-row-between-wrap { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
body.portal-layout .u-row-between-start { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
body.portal-layout .u-row-wrap { display: flex; gap: 8px; flex-wrap: wrap; }
body.portal-layout .u-mb-10 { margin-bottom: 10px; }
body.portal-layout .u-mt-6 { margin: 6px 0 0; }
body.portal-layout .u-mt-8 { margin-top: 8px; }
body.portal-layout .u-mt-10 { margin-top: 10px; }

body.portal-layout .search { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
body.portal-layout .search input,
body.portal-layout .search select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f9fafb;
}
body.portal-layout .fav-toggle { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }

body.portal-layout .grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
body.portal-layout .card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
  box-shadow: 0 14px 32px rgba(15, 108, 189, 0.12);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
body.portal-layout .card .btn-primary { margin-top: auto; }
body.portal-layout .report-grid {
  max-width: none;
  margin: 0;
  grid-template-columns: 1fr;
}
body.portal-layout .card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
body.portal-layout .tag-list { display: flex; gap: 6px; flex-wrap: wrap; }
body.portal-layout .chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  background: #f8fafc;
  color: var(--muted);
  font-weight: 700;
  border: 1px solid var(--line);
}
body.portal-layout button.chip { cursor: pointer; }
body.portal-layout button.chip:hover { background: #eef2f7; color: var(--ink); }
body.portal-layout button.chip.is-active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #ffffff;
}
body.portal-layout .thumb {
  background: #f1f5f9;
  border-radius: 12px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
}
body.portal-layout .thumb img { width: 100%; height: 100%; object-fit: cover; }
body.portal-layout .fav-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  color: #94a3b8;
  transition: all 0.15s ease;
}
body.portal-layout .fav-btn:hover { border-color: #facc15; color: #f59e0b; }
body.portal-layout .fav-btn.is-fav {
  color: #f59e0b;
  border-color: #f59e0b;
  background: #fff7d6;
  box-shadow: 0 6px 14px rgba(245, 158, 11, 0.18);
}

/* Portal task board */
body.portal-layout .task-board { padding: 0; overflow: hidden; }
body.portal-layout .task-board-head {
  padding: 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
body.portal-layout .task-board-title { margin: 0; font-size: 20px; }
body.portal-layout .task-board-sub { margin: 0; color: var(--muted); }
body.portal-layout .task-board-stats { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
body.portal-layout .task-board-grid { display: grid; grid-template-columns: minmax(220px, 260px) 1fr; }
body.portal-layout .task-board-filters {
  padding: 16px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
body.portal-layout .filter-group label { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; display: block; }
body.portal-layout .filter-group select,
body.portal-layout .filter-group input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f9fafb;
}
body.portal-layout .task-board-list {
  padding: 16px;
  max-height: 72vh;
  overflow: auto;
  scrollbar-gutter: stable;
}
body.portal-layout .task-list { display: grid; gap: 12px; }
body.portal-layout .task-list.is-collapsed { display: none; }
body.portal-layout .task-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
body.portal-layout .task-card.task-done { opacity: 0.7; }
body.portal-layout .task-card-head { display: flex; justify-content: space-between; gap: 12px; }
body.portal-layout .task-badges { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
body.portal-layout .status-pill,
body.portal-layout .priority-pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  background: #eef2f7;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
  min-height: 24px;
  white-space: nowrap;
}
body.portal-layout .status-pill.is-done { background: #dcfce7; color: #166534; }
body.portal-layout .status-pill.is-future { background: #fef3c7; color: #92400e; }
body.portal-layout .priority-pill.is-low { background: #f1f5f9; color: #475569; }
body.portal-layout .priority-pill.is-high { background: #fee2e2; color: #991b1b; }
body.portal-layout .priority-pill.is-critical { background: #ffedd5; color: #9a3412; }
body.portal-layout .pill-icon { width: 12px; height: 12px; display: inline-block; }
body.portal-layout .task-meta { display: flex; gap: 10px; color: var(--muted); font-size: 12px; }
body.portal-layout .task-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
body.portal-layout .task-actions textarea {
  flex: 1;
  min-width: 200px;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
}
body.portal-layout .task-desc,
body.portal-layout .task-note { font-size: 12px; line-height: 1.4; }
body.portal-layout .task-desc { margin: 4px 0 0; }
body.portal-layout .task-note { margin: 6px 0 0; }
body.portal-layout .task-log {
  border-top: 1px dashed var(--line);
  padding-top: 10px;
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  padding-right: 4px;
}
body.portal-layout .task-log-item {
  font-size: 12px;
  color: var(--muted);
  display: grid;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
}
body.portal-layout .task-log-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
body.portal-layout .task-log-author { font-weight: 700; color: var(--ink); }
body.portal-layout .task-log-status {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--muted);
}
body.portal-layout .task-log-status.is-done { background: #dcfce7; color: #166534; }
body.portal-layout .task-log-status.is-comment { background: #e0f2fe; color: #0c4a6e; }
body.portal-layout .task-log-meta { font-size: 11px; color: var(--muted); }

/* Notice / inbox cards */
body.portal-layout .notice-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
body.portal-layout .notice-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 14px 32px rgba(15, 108, 189, 0.12);
}
body.portal-layout .notice-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
body.portal-layout .notice-title { display: flex; align-items: center; gap: 10px; }
body.portal-layout .notice-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef2ff;
  color: #1d4ed8;
}
body.portal-layout .notice-icon--warn { background: #fef3c7; color: #92400e; }
body.portal-layout .notice-icon--info { background: #e0f2fe; color: #0c4a6e; }
body.portal-layout .notice-icon svg { width: 20px; height: 20px; }
body.portal-layout .notice-list { display: grid; gap: 10px; }
body.portal-layout .notice-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
}
body.portal-layout .notice-meta { font-size: 12px; color: var(--muted); }
body.portal-layout .notice-kanban { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
body.portal-layout .notice-column {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
  box-shadow: 0 14px 32px rgba(15, 108, 189, 0.12);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 220px;
}
body.portal-layout .notice-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
body.portal-layout .notice-column-title { display: flex; align-items: center; gap: 10px; }
body.portal-layout .notice-column-body { display: grid; gap: 12px; }
body.portal-layout .notice-kanban--scroll .notice-column-body {
  max-height: 68vh;
  overflow: auto;
  padding-right: 6px;
  scrollbar-gutter: stable;
}
@media (max-width: 1024px) {
  body.portal-layout .notice-kanban--scroll .notice-column-body { max-height: none; overflow: visible; padding-right: 0; }
}
body.portal-layout .notice-tile {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: inherit;
  text-decoration: none;
}
body.portal-layout .notice-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-start; margin-bottom: 12px; }
body.portal-layout .notice-tile--notif.is-unread {
  background: #ffffff;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.06);
  border-color: #cbd5e1;
}
body.portal-layout .notice-tile-link { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit; }
body.portal-layout .notice-tile-actions { display: flex; justify-content: flex-end; padding-top: 6px; }
body.portal-layout .notice-tile strong { font-size: 13px; }
body.portal-layout .notice-subtitle { color: var(--muted); font-size: 13px; margin-top: 6px; }
body.portal-layout .notice-lead { margin-top: 6px; margin-bottom: 26px; }

body.portal-layout .comment-badges { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
body.portal-layout .comment-badge {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: #1f2937;
  color: #e5e7eb;
  letter-spacing: 0.02em;
  border: 1px solid rgba(148, 163, 184, 0.35);
}
body.portal-layout .comment-badge.status-novo { background: #1d4ed8; color: #eff6ff; border-color: rgba(96, 165, 250, 0.45); }
body.portal-layout .comment-badge.status-em_analise { background: #b45309; color: #fff7ed; border-color: rgba(251, 191, 36, 0.45); }
body.portal-layout .comment-badge.status-em_testes { background: #0ea5e9; color: #e0f2fe; border-color: rgba(56, 189, 248, 0.45); }
body.portal-layout .comment-badge.status-feito { background: #15803d; color: #dcfce7; border-color: rgba(34, 197, 94, 0.45); }
body.portal-layout .comment-badge.priority-baixa { background: #0f766e; color: #ecfeff; border-color: rgba(45, 212, 191, 0.45); }
body.portal-layout .comment-badge.priority-media { background: #1d4ed8; color: #e0f2fe; border-color: rgba(96, 165, 250, 0.45); }
body.portal-layout .comment-badge.priority-alta { background: #ea580c; color: #fff7ed; border-color: rgba(253, 186, 116, 0.45); }
body.portal-layout .comment-badge.priority-critica { background: #dc2626; color: #fee2e2; border-color: rgba(252, 165, 165, 0.45); }
body.portal-layout .comment-badge.replies { background: #0f172a; color: #f8fafc; text-transform: none; font-weight: 800; border-color: rgba(148, 163, 184, 0.35); }

body.portal-layout .comment-filter-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 0; }
body.portal-layout .comment-filter-btn { padding: 6px 10px; border-radius: 999px; font-size: 12px; }
body.portal-layout .comment-filter-btn.is-active { background: var(--brand-primary); border-color: var(--brand-primary); color: #ffffff; }
body.portal-layout .comment-filter-btn[data-comment-filter="novo"] { border-color: rgba(59, 130, 246, 0.5); color: #93c5fd; background: rgba(59, 130, 246, 0.12); }
body.portal-layout .comment-filter-btn[data-comment-filter="em_analise"] { border-color: rgba(245, 158, 11, 0.5); color: #fcd34d; background: rgba(245, 158, 11, 0.12); }
body.portal-layout .comment-filter-btn[data-comment-filter="em_testes"] { border-color: rgba(14, 165, 233, 0.5); color: #7dd3fc; background: rgba(14, 165, 233, 0.12); }
body.portal-layout .comment-filter-btn[data-comment-filter="feito"] { border-color: rgba(34, 197, 94, 0.5); color: #86efac; background: rgba(34, 197, 94, 0.12); }
body.portal-layout .comment-filter-btn.is-active[data-comment-filter="novo"] { background: #1d4ed8; border-color: #1d4ed8; color: #eff6ff; }
body.portal-layout .comment-filter-btn.is-active[data-comment-filter="em_analise"] { background: #b45309; border-color: #b45309; color: #fff7ed; }
body.portal-layout .comment-filter-btn.is-active[data-comment-filter="em_testes"] { background: #0ea5e9; border-color: #0ea5e9; color: #e0f2fe; }
body.portal-layout .comment-filter-btn.is-active[data-comment-filter="feito"] { background: #15803d; border-color: #15803d; color: #dcfce7; }

body.portal-layout .comment-form textarea {
  width: 100%;
  min-height: 56px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
}
body.portal-layout .comment-form select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
}
body.portal-layout .comment-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
body.portal-layout .comment-field label { display: block; margin-bottom: 6px; }
body.portal-layout .comment-upload-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
body.portal-layout .comment-upload {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #f9fafb;
}
body.portal-layout .comment-upload input { display: none; }
body.portal-layout .comment-upload svg { width: 20px; height: 20px; }
body.portal-layout .comment-upload-preview { font-size: 12px; color: var(--muted); flex: 1; min-width: 140px; }
body.portal-layout .comment-send-btn { margin-left: auto; white-space: nowrap; }
body.portal-layout .comment-actions-row { display: flex; justify-content: center; margin-top: 8px; }
body.portal-layout .comment-thumb-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
body.portal-layout .comment-thumb-btn { padding: 6px 10px; font-size: 12px; }
body.portal-layout .comment-thumb-btn.comment-thumb-btn--thumb { padding: 0; border: 0; background: transparent; cursor: pointer; }
body.portal-layout .comment-thumb-hide { padding: 6px 10px; font-size: 12px; }
body.portal-layout .comment-thumb-wrap.is-collapsed .comment-thumb-btn--thumb { display: none; }
body.portal-layout .comment-content { flex: 1; min-width: 0; }
body.portal-layout .comment-message { white-space: pre-wrap; }
body.portal-layout .comment-edit-text { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; }
body.portal-layout .comment-edit-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
body.portal-layout .comment-thread { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
body.portal-layout .comment-replies { display: grid; gap: 10px; margin-bottom: 10px; }
body.portal-layout .comment-reply { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; }
body.portal-layout .comment-reply-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
body.portal-layout .comment-reply-author { font-weight: 900; font-size: 12px; }
body.portal-layout .comment-reply-message { white-space: pre-wrap; font-size: 13px; }
body.portal-layout .comment-reply-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
body.portal-layout .comment-reply-text { width: 100%; min-height: 62px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); }
body.portal-layout .comment-upload--sm { width: 34px; height: 34px; border-radius: 10px; }
body.portal-layout .comment-reply-form.is-sending { opacity: 0.75; pointer-events: none; }
body.portal-layout .comment-item.is-focus {
  outline: 2px solid rgba(15, 108, 189, 0.35);
  box-shadow: 0 12px 28px rgba(15, 108, 189, 0.10);
  border-radius: 12px;
}
body.portal-layout .resize-label-row { display: flex; justify-content: space-between; gap: 8px; }
body.portal-layout .is-hidden { display: none !important; }
body.portal-layout .plan-pill-end-muted { font-weight: 700; text-transform: none; }

/* Dark glass overrides (portal) */
body.portal-layout.theme-dark-glass .section-card,
body.portal-layout.theme-dark-glass .card,
body.portal-layout.theme-dark-glass .notice-card,
body.portal-layout.theme-dark-glass .notice-column {
  background: var(--panel);
  border-color: var(--line);
  box-shadow: 0 26px 80px rgba(2, 6, 23, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
body.portal-layout.theme-dark-glass .comment-badge { background: rgba(148, 163, 184, 0.18); color: rgba(226, 232, 240, 0.8); }
body.portal-layout.theme-dark-glass .comment-badge.replies { background: rgba(148, 163, 184, 0.18); color: rgba(226, 232, 240, 0.9); }
body.portal-layout.theme-dark-glass .notice-tile {
  background: #0f172a;
  border-color: rgba(148, 163, 184, 0.22);
  color: rgba(226, 232, 240, 0.9);
}
body.portal-layout.theme-dark-glass .notice-meta { color: rgba(148, 163, 184, 0.9); }
body.portal-layout.theme-dark-glass .notice-tile--notif.is-unread {
  background: #111827;
  border-color: rgba(148, 163, 184, 0.28);
  box-shadow: 0 16px 34px rgba(2, 6, 23, 0.4);
}
body.portal-layout.theme-dark-glass .pill {
  background: rgba(2, 6, 23, 0.35);
  color: rgba(226, 232, 240, 0.86);
  border-color: rgba(148, 163, 184, 0.22);
}
body.portal-layout.theme-dark-glass .btn {
  background: rgba(2, 6, 23, 0.38);
  border-color: rgba(148, 163, 184, 0.22);
  color: rgba(248, 250, 252, 0.96);
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.35);
}
body.portal-layout.theme-dark-glass .btn:hover {
  border-color: rgba(93, 169, 255, 0.55);
  box-shadow: 0 14px 40px rgba(2, 6, 23, 0.45);
}
body.portal-layout.theme-dark-glass .btn-primary {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 108, 189, 0.28);
}
body.portal-layout.theme-dark-glass .btn-primary:hover {
  background: var(--brand-secondary);
  border-color: var(--brand-secondary);
}
body.portal-layout.theme-dark-glass .chip {
  background: rgba(2, 6, 23, 0.25);
  color: rgba(226, 232, 240, 0.75);
  border-color: var(--line);
}
body.portal-layout.theme-dark-glass button.chip:hover { background: rgba(255, 255, 255, 0.10); }
body.portal-layout.theme-dark-glass button.chip.is-active {
  background: rgba(114, 183, 178, 0.88);
  border-color: rgba(114, 183, 178, 0.88);
  color: rgba(2, 6, 23, 0.98);
}

/* Portal navigation (submenu + badges) */
body.portal-layout .brand img {
  background: #ffffff;
  padding: 6px;
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
}
body.portal-layout .nav-badge {
  margin-left: 4px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 10px 18px rgba(239, 68, 68, 0.18);
}
body.portal-layout .nav-badge.is-hidden { display: none; }
body.portal-layout .nav-group { position: relative; display: inline-flex; align-items: center; }
body.portal-layout .nav-group::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 8px;
}
body.portal-layout .nav-group summary {
  list-style: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 600;
  color: var(--muted);
  border: 2px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  font-size: 14px;
}
body.portal-layout .nav-links a,
body.portal-layout .nav-submenu a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
body.portal-layout .nav-group summary::-webkit-details-marker { display: none; }
body.portal-layout .nav-group summary::after {
  content: '▾';
  font-size: 12px;
  opacity: 0.7;
  transition: transform 0.2s ease;
}
body.portal-layout .nav-group[open] summary::after { transform: rotate(180deg); }
body.portal-layout .nav-group summary:hover { color: var(--ink); background-color: #f1f5f9; }
body.portal-layout .nav-group.is-active summary {
  color: var(--brand-primary);
  border-bottom: 2px solid var(--brand-primary);
}
body.portal-layout.theme-dark-glass .nav-group summary:hover {
  color: rgba(248, 250, 252, 0.96);
  background: rgba(255, 255, 255, 0.06);
}
body.portal-layout.theme-dark-glass .nav-group.is-active summary {
  color: rgba(114, 183, 178, 0.95);
  border-bottom-color: rgba(114, 183, 178, 0.85);
}
body.portal-layout .nav-submenu {
  position: absolute;
  top: 100%;
  margin-top: 8px;
  left: 0;
  min-width: 220px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.12);
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 60;
}
body.portal-layout .nav-group[open] .nav-submenu { display: flex; }
@media (hover: hover) and (pointer: fine) {
  body.portal-layout .nav-group[open] .nav-submenu { display: none; }
  body.portal-layout .nav-group[open] summary::after { transform: none; }
  body.portal-layout .nav-group:hover .nav-submenu { display: flex; }
  body.portal-layout .nav-group:hover summary::after { transform: rotate(180deg); }
}
body.portal-layout.theme-dark-glass .nav-submenu {
  background: rgba(2, 6, 23, 0.92);
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: 0 26px 70px rgba(2, 6, 23, 0.6);
}
body.portal-layout .nav-ico {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 18px;
  line-height: 1;
}
body.portal-layout .nav-ico svg {
  width: 18px;
  height: 18px;
  display: block;
}
body.portal-layout .top-nav-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; justify-content: flex-end; }
body.portal-layout .portal-link {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  background: var(--panel);
}
body.portal-layout .portal-link:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
body.portal-layout.theme-dark-glass .portal-link { background: #0b1220; color: rgba(226, 232, 240, 0.92); border-color: rgba(148, 163, 184, 0.22); }
body.portal-layout.theme-dark-glass .portal-link:hover { color: #ffffff; border-color: rgba(93, 169, 255, 0.7); }
@media (min-width: 1025px) {
  body.portal-layout .top-nav-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
  }
  body.portal-layout .nav-links { justify-content: center; justify-self: center; }
  body.portal-layout .top-nav-actions { margin-left: 0; }
}
body.portal-layout .plan-pill-wrap { display: flex; align-items: center; gap: 8px; }
body.portal-layout .plan-pill { display: inline-flex; align-items: center; gap: 6px; text-transform: none; font-weight: 800; }
body.portal-layout .plan-pill-end-muted { margin-left: 4px; }
@media (max-width: 1024px) {
  body.portal-layout .plan-pill-wrap { display: none; }
}
body.portal-layout .user-profile { position: relative; }
body.portal-layout .user-profile-toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; }
body.portal-layout .user-profile-toggle img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--line); }
body.portal-layout .user-profile-toggle span { font-weight: 600; font-size: 14px; color: var(--ink); font-family: 'Inter', sans-serif; }
body.portal-layout .user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 220px;
  background: var(--panel);
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 5px 10px -5px rgba(0,0,0,0.04);
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
}
body.portal-layout .user-dropdown.open { display: flex; }
body.portal-layout .user-dropdown a { padding: 10px 12px; font-size: 14px; color: var(--ink); text-decoration: none; border-radius: 8px; display: block; }
body.portal-layout .user-dropdown a:hover { background-color: #f1f5f9; }
body.portal-layout .user-dropdown a.logout { color: #ef4444; }
body.portal-layout.theme-dark-glass .user-dropdown {
  background: rgba(2, 6, 23, 0.72);
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: 0 26px 70px rgba(2, 6, 23, 0.6);
}
body.portal-layout.theme-dark-glass .user-dropdown a { color: rgba(248, 250, 252, 0.92); }
body.portal-layout.theme-dark-glass .user-dropdown a:hover { background: rgba(255, 255, 255, 0.06); }
body.portal-layout .nav-toggle { display: none; background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 8px; cursor: pointer; }
@media (max-width: 1024px) {
  body.portal-layout .top-nav-inner { position: relative; }
  body.portal-layout .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 24px;
    right: auto;
    width: calc(100% - 48px);
    background: var(--panel);
    flex-direction: column;
    align-items: flex-start;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    z-index: 50;
  }
  body.portal-layout .nav-links.open { display: flex; }
  body.portal-layout.theme-dark-glass .nav-links { background: #0b1220; border-color: rgba(148, 163, 184, 0.28); }
  body.portal-layout .nav-toggle { display: block; }
  body.portal-layout .nav-group { width: 100%; display: flex; flex-direction: column; align-items: stretch; }
  body.portal-layout .nav-links > a,
  body.portal-layout .nav-group summary {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
  }
  body.portal-layout .nav-submenu {
    position: static;
    min-width: 0;
    box-shadow: none;
    border: 0;
    padding: 6px 0 0 0;
    margin-top: 6px;
    border-left: 0;
    align-items: flex-start;
    width: 100%;
  }
  body.portal-layout .nav-submenu a {
    justify-content: flex-start;
    text-align: left;
    padding-left: 18px;
    width: 100%;
  }
  body.portal-layout.theme-dark-glass .nav-submenu { border-left-color: rgba(148, 163, 184, 0.22); }
}

/* Portal report modal */
body.portal-layout .modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.25);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 1000;
}
body.portal-layout .modal.open { display: flex; }
body.portal-layout .modal-content {
  width: min(1200px, 95vw);
  height: min(88vh, 980px);
  background: var(--panel);
  border-radius: 26px;
  box-shadow: 0 20px 40px rgba(15,23,42,0.12);
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  overflow: hidden;
  position: relative;
}
body.portal-layout .iframe-wrap { position: relative; height: 100%; }
body.portal-layout .modal-iframe { width: 100%; height: 100%; border: 0; background: #f8fafc; }
body.portal-layout .watermark-layer {
  position: absolute;
  inset: 0;
  background-image: var(--watermark-image);
  background-size: 320px 160px;
  background-repeat: repeat;
  pointer-events: none;
  opacity: 0.3;
}
body.portal-layout .modal-side {
  padding: 16px;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--panel);
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
body.portal-layout.theme-dark-glass .modal-side {
  background: rgba(2, 6, 23, 0.92);
  border-left-color: rgba(148, 163, 184, 0.22);
  box-shadow: inset 0 0 0 1px rgba(2, 6, 23, 0.35);
}
body.portal-layout .modal-head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  cursor: grab;
  touch-action: none;
}
body.portal-layout .modal-head-meta { display: flex; flex-direction: column; gap: 4px; }
body.portal-layout .modal-head-meta strong { font-size: 16px; }
body.portal-layout .modal-head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-start; }
body.portal-layout .btn.btn-icon { width: 38px; height: 38px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; }
body.portal-layout .btn.btn-icon svg { width: 18px; height: 18px; }
body.portal-layout .modal.is-dragging .modal-head-row { cursor: grabbing; }
body.portal-layout .modal.is-dragging { user-select: none; }
body.portal-layout .resize-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
body.portal-layout .resize-control { margin: 0; }

body.portal-layout .modal.is-chat-hidden .modal-content { grid-template-columns: 1fr; }
body.portal-layout .modal.is-chat-hidden .modal-side {
  position: absolute;
  top: 14px;
  right: 14px;
  width: auto;
  height: auto;
  padding: 10px 12px;
  border-left: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(15, 108, 189, 0.08);
  background: #0b1220;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: 5;
}
body.portal-layout .modal.is-chat-hidden .resize-control,
body.portal-layout .modal.is-chat-hidden .comment-log,
body.portal-layout .modal.is-chat-hidden .comment-actions-row,
body.portal-layout .modal.is-chat-hidden .comment-form { display: none; }
body.portal-layout .modal.is-chat-actions-hidden .comment-actions,
body.portal-layout .modal.is-chat-actions-hidden .comment-actions-row,
body.portal-layout .modal.is-chat-actions-hidden .comment-form,
body.portal-layout .modal.is-chat-actions-hidden .comment-filter-row { display: none; }

body.portal-layout .modal.is-minimized { background: transparent; padding: 10px; }
body.portal-layout .modal.is-minimized .modal-content {
  grid-template-columns: 1fr;
  width: min(1400px, 98vw);
  height: min(92vh, 980px);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
body.portal-layout .modal.is-minimized .modal-side { display: none; }
body.portal-layout .modal.is-minimized .iframe-wrap {
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(15, 108, 189, 0.08);
  background: #0b1220;
}
body.portal-layout .modal-minimized-btn {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: #0b1220;
  color: #ffffff;
  box-shadow: 0 18px 40px rgba(15, 108, 189, 0.08);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  pointer-events: auto;
}
body.portal-layout .modal-minimized-btn svg { width: 20px; height: 20px; }
body.portal-layout .modal-minimized-btn.is-visible { display: inline-flex; }

body.portal-layout .modal.is-report-full { padding: 0; background: rgba(15, 23, 42, 0.35); }
body.portal-layout .modal.is-report-full .modal-content { width: 100vw; height: 100vh; border-radius: 0; }

body.portal-layout .comment-log { flex: 1; overflow: auto; display: grid; gap: 10px; font-size: 12px; }
body.portal-layout .comment-item {
  background: #f8fafc;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  display: grid;
  gap: 8px;
}
body.portal-layout .comment-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
body.portal-layout .comment-author { font-weight: 700; color: var(--ink); }
body.portal-layout .comment-actions { display: flex; gap: 8px; margin-top: 6px; align-items: center; flex-wrap: wrap; }
body.portal-layout .comment-actions select {
  width: auto;
  min-width: 120px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 12px;
  background: #ffffff;
}
body.portal-layout .comment-body { display: flex; gap: 10px; align-items: flex-start; }
body.portal-layout .comment-thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line); background: #ffffff; }
body.portal-layout .comment-meta { font-size: 11px; color: var(--muted); }

body.portal-layout .attachment-modal .modal-content {
  width: min(1100px, 96vw);
  height: min(86vh, 940px);
  grid-template-columns: 1fr;
  grid-template-rows: auto auto minmax(0, 1fr);
}
body.portal-layout .attachment-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
body.portal-layout .attachment-head-meta { display: flex; flex-direction: column; gap: 4px; }
body.portal-layout .attachment-head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
body.portal-layout .attachment-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 12px 16px; border-bottom: 1px solid var(--line); }
body.portal-layout .attachment-field { display: flex; flex-direction: column; gap: 6px; min-width: 160px; }
body.portal-layout .attachment-field input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #ffffff;
  font-size: 13px;
}
body.portal-layout .attachment-stage { padding: 14px 16px; overflow: auto; }
body.portal-layout .attachment-frame {
  margin: 0 auto;
  width: 860px;
  height: 520px;
  max-width: 100%;
  max-height: 70vh;
  min-width: 260px;
  min-height: 200px;
  resize: both;
  overflow: auto;
  background: #0b1220;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.10);
}
body.portal-layout .attachment-frame img { display: block; width: 100%; height: 100%; object-fit: contain; background: #0b1220; }

body.portal-layout.theme-dark-glass .modal.is-chat-hidden .modal-side {
  background: #0b1220;
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: 0 16px 36px rgba(2, 6, 23, 0.45);
}
body.portal-layout.theme-dark-glass .comment-item {
  background: #0f172a;
  border-color: rgba(148, 163, 184, 0.22);
  color: rgba(226, 232, 240, 0.9);
}
body.portal-layout.theme-dark-glass .comment-reply {
  background: rgba(2, 6, 23, 0.65);
  border-color: rgba(148, 163, 184, 0.22);
  color: rgba(226, 232, 240, 0.9);
}
body.portal-layout.theme-dark-glass .comment-reply-author {
  color: rgba(248, 250, 252, 0.96);
}
body.portal-layout.theme-dark-glass .comment-reply-message {
  color: rgba(226, 232, 240, 0.9);
}
body.portal-layout.theme-dark-glass .comment-reply-text {
  background: #0b1220;
  color: rgba(226, 232, 240, 0.92);
  border-color: rgba(148, 163, 184, 0.22);
}
body.portal-layout.theme-dark-glass .comment-actions select {
  background: #0b1220;
  color: rgba(226, 232, 240, 0.9);
  border-color: rgba(148, 163, 184, 0.22);
}
body.portal-layout.theme-dark-glass .comment-thumb {
  background: #0b1220;
  border-color: rgba(148, 163, 184, 0.22);
}
body.portal-layout.theme-dark-glass .comment-upload {
  background: rgba(2, 6, 23, 0.30);
  border-color: rgba(148, 163, 184, 0.22);
  color: rgba(226, 232, 240, 0.78);
}
