/* ================================================================
   Zyllo — Design System
   Estética: editorial + tech. Fraunces no display, Geist no UI.
   Dark primário, light alternativo. Acentos vibrantes pontuais.
   ================================================================ */

/* ================================================================
   Zyllo — Design System
   Inspirado em Linear, Raycast, Vercel.
   Fontes: Space Grotesk (display + UI), JetBrains Mono.
   Paleta: gradiente azul → índigo → violeta.
   ================================================================ */

:root {
  /* === LIGHT === */
  --bg:           #FFFFFF;
  --bg-elev:      #FFFFFF;
  --bg-soft:      #F8FAFC;        /* Surface */
  --bg-sunken:    #EEF2FF;        /* Surface Secondary (azul muito claro) */
  --line:         #E2E8F0;
  --line-hover:   #CBD5E1;
  --line-soft:    #EEF2F7;
  --text:         #0F172A;        /* Primary text */
  --text-muted:   #475569;        /* Secondary */
  --text-dim:     #94A3B8;        /* Muted */

  /* Acento — gradiente */
  --accent:        #2563EB;       /* Indigo — primário */
  --accent-hover:  #1D4ED8;
  --accent-soft:   #EEF2FF;       /* fundo de hover/seleção */
  --accent-ink:    #1E3A8A;
  --accent-sky:    #0EA5E9;       /* azul claro */
  --accent-violet: #7C3AED;       /* violeta */
  --accent-purple: #9333EA;       /* roxo */
  --grad-primary: linear-gradient(135deg, #0EA5E9 0%, #2563EB 50%, #9333EA 100%);
  --grad-text:    linear-gradient(135deg, #0EA5E9 0%, #2563EB 40%, #9333EA 100%);

  /* Cores semânticas */
  --emerald:       #10B981;       /* sucesso */
  --gold:          #F59E0B;       /* aviso */
  --danger:        #EF4444;       /* erro / urgência */
  --plum:          #7C3AED;
  --sky:           #0EA5E9;

  /* Sombras finas tipo Linear */
  --shadow-sm: 0 1px 2px rgba(15,23,42,.04);
  --shadow-md: 0 4px 12px -2px rgba(15,23,42,.06), 0 2px 4px -1px rgba(15,23,42,.04);
  --shadow-lg: 0 20px 40px -12px rgba(15,23,42,.12), 0 8px 16px -8px rgba(15,23,42,.06);
  --shadow-glow: 0 0 24px -4px rgba(37, 99, 235, 0.25);

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;

  /* Space Grotesk em todos os lugares — geométrico, moderno */
  --font-display: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-ui:      'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'SF Mono', monospace;

  --header-h: 60px;
  --sidebar-w: 256px;
  --sidebar-collapsed-w: 64px;
}

/* === DARK — premium, profundo, com glow violeta === */
[data-theme="dark"] {
  --bg:           #0B1120;        /* deep navy */
  --bg-elev:      #111827;        /* cards */
  --bg-soft:      #1E293B;        /* elevated */
  --bg-sunken:    #0A0F1C;        /* sidebar/sunken */
  --line:         #1E293B;
  --line-hover:   #334155;
  --line-soft:    #15202F;
  --text:         #F8FAFC;
  --text-muted:   #CBD5E1;
  --text-dim:     #64748B;

  --accent:        #6366F1;       /* indigo brilhante */
  --accent-hover:  #818CF8;
  --accent-soft:   #1E1B4B;
  --accent-ink:    #C7D2FE;
  --accent-sky:    #38BDF8;
  --accent-violet: #C084FC;
  --accent-purple: #A855F7;
  --grad-primary: linear-gradient(135deg, #38BDF8 0%, #6366F1 50%, #A855F7 100%);
  --grad-text:    linear-gradient(135deg, #38BDF8 0%, #818CF8 40%, #C084FC 100%);

  --emerald:       #34D399;
  --gold:          #FBBF24;
  --danger:        #F87171;
  --plum:          #A78BFA;
  --sky:           #38BDF8;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 8px 24px -6px rgba(0,0,0,.55);
  --shadow-lg: 0 24px 48px -12px rgba(0,0,0,.7);
  --shadow-glow: 0 0 32px -4px rgba(99, 102, 241, 0.4);
}

/* Toques dourados no dark (apenas dark) */
[data-theme="dark"] .login-grad,
[data-theme="dark"] .dash-hero h1 em,
[data-theme="dark"] .view-title em {
  color: var(--gold);
}
[data-theme="dark"] .nav-item.active {
  background: linear-gradient(135deg, #1a2640 0%, #1f2c4a 100%);
  border-left: 3px solid var(--gold);
  padding-left: 13px;
}
[data-theme="dark"] .btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #3b8bdc 100%);
  box-shadow: 0 2px 8px rgba(78, 164, 245, 0.3);
}
[data-theme="dark"] .btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-hover) 0%, #4ea4f5 100%);
}
[data-theme="dark"] .card,
[data-theme="dark"] .modal-shell {
  background: linear-gradient(180deg, #141b2e 0%, #121828 100%);
  border-color: var(--line);
}
[data-theme="dark"] .priority-chip.urgent {
  background: linear-gradient(135deg, #441818 0%, #2a1010 100%);
  color: #fca5a5;
  border: 1px solid #6b2020;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; margin: 0; }

/* Scrollbars discretas */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ================================================================
   LOGIN
   ================================================================ */
.login-body {
  min-height: 100vh;
  background: var(--bg);
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  min-height: 100vh;
}

@media (max-width: 880px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-art { display: none; }
}

.login-art {
  position: relative;
  background:
    radial-gradient(900px 600px at 0% 100%, rgba(14,165,233,.22), transparent 55%),
    radial-gradient(900px 700px at 100% 0%, rgba(124,58,237,.18), transparent 55%),
    radial-gradient(600px 500px at 50% 50%, rgba(37,99,235,.14), transparent 60%),
    linear-gradient(135deg, #0F172A 0%, #1E1B4B 100%);
  color: #F8FAFC;
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
[data-theme="dark"] .login-art {
  background:
    radial-gradient(900px 600px at 0% 100%, rgba(56,189,248,.32), transparent 55%),
    radial-gradient(900px 700px at 100% 0%, rgba(168,85,247,.28), transparent 55%),
    radial-gradient(600px 500px at 50% 50%, rgba(99,102,241,.22), transparent 60%),
    linear-gradient(135deg, #050913 0%, #0A0F1C 50%, #15102E 100%);
}

/* Textura sutil de grão */
.login-art-grain {
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .07 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: .8;
  pointer-events: none;
  mix-blend-mode: overlay;
}

.login-brand { position: relative; z-index: 1; }
.login-logo {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.01em;
}
.login-logo svg { width: 32px; height: 32px; color: #4ea4f5; }
[data-theme="dark"] .login-logo svg { color: var(--gold); }

.login-headline {
  position: relative; z-index: 1;
  margin: auto 0;
  max-width: 460px;
}
.login-headline h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0 0 24px;
}
.login-headline h1 em {
  font-style: italic;
  font-weight: 400;
  color: #c2d4ed;
}
.login-grad {
  background: linear-gradient(95deg, #4ea4f5 0%, #76c4ff 60%, #b8e0ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-style: italic;
}
[data-theme="dark"] .login-grad {
  background: linear-gradient(95deg, #d4af6a 0%, #e6c282 60%, #f0d49c 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
.login-headline p {
  color: #b6c7e1;
  font-size: 16px;
  line-height: 1.55;
  max-width: 420px;
}

.login-features {
  position: relative; z-index: 1;
  margin-top: 56px;
  display: grid;
  gap: 18px;
  max-width: 440px;
}
.login-feat {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 16px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--r-md);
  backdrop-filter: blur(8px);
}
.login-feat-icon {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: rgba(78, 164, 245, .18);
  color: #6cb4f8;
  font-size: 18px;
  font-weight: 600;
  flex-shrink: 0;
}
[data-theme="dark"] .login-feat-icon {
  background: rgba(212, 175, 106, .15);
  color: var(--gold);
}
.login-feat strong { display: block; font-size: 14px; color: #e8ecf3; }
.login-feat span { display: block; color: #8c9ab4; font-size: 13px; margin-top: 2px; }

.login-foot {
  position: relative; z-index: 1;
  margin-top: 48px;
  color: #5e6e8a;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.login-form-wrap {
  position: relative;
  display: grid; place-items: center;
  padding: 48px 32px;
  background: var(--bg);
}
[data-theme="dark"] .login-form-wrap {
  /* Casa com a coluna art: começa um pouco mais claro mas com nuance da paleta */
  background:
    radial-gradient(800px 600px at 100% 0%, rgba(99, 102, 241, .06), transparent 60%),
    radial-gradient(700px 500px at 0% 100%, rgba(56, 189, 248, .04), transparent 60%),
    #0A0F1C;
}
.login-theme-toggle {
  position: absolute;
  top: 18px; right: 22px;
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  cursor: pointer;
  display: grid; place-items: center;
  color: var(--text-muted);
  transition: all .15s;
}
.login-theme-toggle:hover {
  color: var(--text);
  border-color: var(--accent);
}
.login-theme-toggle .ico-dark { display: none; }
[data-theme="dark"] .login-theme-toggle .ico-light { display: none; }
[data-theme="dark"] .login-theme-toggle .ico-dark { display: block; }

.login-form {
  width: 100%;
  max-width: 400px;
}
.login-form header { margin-bottom: 36px; }
.login-form h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 36px;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.login-form header p {
  color: var(--text-muted);
  margin: 0;
}

.field {
  margin-bottom: 18px;
}
.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field input[type="date"],
.field input[type="datetime-local"],
.field select,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
  color: var(--text);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(20,18,12,.06);
}

.field-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px;
}
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.check input { accent-color: var(--accent); }
.link-muted { font-size: 13px; color: var(--text-muted); }
.link-muted:hover { color: var(--text); text-decoration: underline; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: var(--text);
  color: var(--bg);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.01em;
  transition: transform .08s, background .15s, box-shadow .15s;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: #2a2722; box-shadow: var(--shadow-md); }
[data-theme="dark"] .btn-primary { background: var(--accent); color: #0b0d17; }
[data-theme="dark"] .btn-primary:hover { background: #ff8466; }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary.loading span { opacity: .6; }
.btn-block { width: 100%; }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 13px;
  transition: background .15s, border-color .15s;
}
.btn-ghost:hover { background: var(--bg-soft); border-color: var(--text-muted); }

.login-error {
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-radius: var(--r-sm);
  font-size: 13px;
  border-left: 3px solid var(--accent);
}

.demo-box {
  margin-top: 24px;
  padding: 14px 16px;
  background: var(--bg-soft);
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  font-size: 12.5px;
}
.demo-box strong { display: block; margin-bottom: 4px; font-family: var(--font-display); font-style: italic; }
.demo-box p { margin: 0; color: var(--text-muted); line-height: 1.6; }
.demo-box code {
  font-family: var(--font-mono);
  background: var(--bg-elev);
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid var(--line);
}

/* ================================================================
   APP SHELL
   ================================================================ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: 100vh;
  height: 100vh;
  overflow: hidden;
}

@media (max-width: 768px) {
  .app { grid-template-columns: 1fr; }
}

/* ===== Sidebar ===== */
.sidebar {
  background: var(--bg-elev);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.sidebar-logo svg { width: 26px; height: 26px; color: var(--accent); }

.sidebar-nav {
  flex: 1; overflow-y: auto;
  padding: 12px;
}

.nav-section {
  margin-bottom: 18px;
}
.nav-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  padding: 4px 10px 8px;
  display: flex; justify-content: space-between; align-items: center;
}
.nav-section-title .add-btn {
  width: 18px; height: 18px;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text-muted);
}
.nav-section-title .add-btn:hover { color: var(--text); border-color: var(--text); }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--bg-soft); color: var(--text); }
.nav-item.active {
  background: var(--text);
  color: var(--bg);
}
[data-theme="dark"] .nav-item.active { background: var(--accent); color: #0b0d17; }
.nav-item .nav-dot {
  width: 8px; height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}
.nav-item .badge {
  margin-left: auto;
  font-size: 11px;
  background: var(--bg-soft);
  padding: 1px 7px;
  border-radius: 10px;
  color: var(--text-muted);
}
.nav-item.active .badge { background: rgba(255,255,255,.2); color: inherit; }

.sidebar-foot {
  padding: 12px;
  border-top: 1px solid var(--line-soft);
}

/* User card no rodapé do sidebar */
.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background .15s;
}
.user-card:hover { background: var(--bg-soft); }
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--plum));
  color: white;
  display: grid; place-items: center;
  font-weight: 600;
  font-size: 12px;
  flex-shrink: 0;
}
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.lg { width: 44px; height: 44px; font-size: 16px; }
.user-card .info { flex: 1; min-width: 0; }
.user-card .name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card .role { font-size: 11px; color: var(--text-muted); text-transform: capitalize; }

/* ===== Main ===== */
.main {
  display: grid;
  grid-template-rows: var(--header-h) 1fr;
  overflow: hidden;
}

.topbar {
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.topbar-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 20px;
  letter-spacing: -0.01em;
}
.topbar-title em {
  font-style: italic;
  color: var(--text-muted);
  font-weight: 400;
}
.topbar .right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.search-input {
  position: relative;
  flex: 1;
  max-width: 360px;
}
.search-input input,
.search-input input[type="text"] {
  width: 100%;
  padding: 8px 14px 8px 38px !important;
  background: var(--bg-soft);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-size: 13px;
}
.search-input input:focus {
  outline: none;
  background: var(--bg-elev);
  border-color: var(--line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.search-input svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--text-dim);
  pointer-events: none;
}

/* Botão pílula com ícone */
.icon-btn {
  position: relative;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  color: var(--text-muted);
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--bg-soft); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .dot {
  position: absolute; top: 6px; right: 7px;
  width: 8px; height: 8px;
  background: var(--accent);
  border: 2px solid var(--bg-elev);
  border-radius: 50%;
}

.content {
  overflow-y: auto;
  background: var(--bg);
  padding: 24px 28px 80px;
}

/* ================================================================
   DASHBOARD
   ================================================================ */
.dash-hero {
  margin-bottom: 32px;
}
.dash-hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0 0 4px;
}
.dash-hero h1 em { font-style: italic; color: var(--accent); }
.dash-hero p { color: var(--text-muted); margin: 0; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}
.kpi {
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}
.kpi-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.kpi-value {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 38px;
  line-height: 1;
  letter-spacing: -0.03em;
}
.kpi-value .unit {
  font-size: 16px;
  font-family: var(--font-ui);
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 4px;
}
.kpi-trend {
  margin-top: 8px;
  font-size: 12px;
  color: var(--emerald);
}
.kpi.accent { background: var(--text); color: var(--bg); border-color: transparent; }
[data-theme="dark"] .kpi.accent { background: var(--accent); color: #0b0d17; }
.kpi.accent .kpi-label { color: rgba(255,255,255,.7); }
[data-theme="dark"] .kpi.accent .kpi-label { color: rgba(11,13,23,.7); }
.kpi.warn .kpi-value { color: var(--accent); }

.section-title {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 14px;
}
.section-title h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.01em;
  margin: 0;
}
.section-title h2 em { font-style: italic; color: var(--text-muted); font-weight: 400; }

.dash-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 32px;
}
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } }

.card {
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 20px 22px;
}
.card h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 16px;
  margin: 0 0 16px;
  letter-spacing: -0.005em;
}

/* Lista de top usuários */
.top-list { display: flex; flex-direction: column; gap: 12px; }
.top-row {
  display: flex; align-items: center; gap: 12px;
}
.top-row .info { flex: 1; }
.top-row .name { font-size: 13.5px; font-weight: 500; }
.top-row .bar {
  height: 4px; background: var(--bg-soft); border-radius: 3px;
  margin-top: 5px; overflow: hidden;
}
.top-row .bar > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--plum));
  border-radius: 3px;
}
.top-row .h-val {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

/* ================================================================
   KANBAN
   ================================================================ */
.kanban-toolbar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.proj-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 8px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
}
.proj-pill .dot {
  width: 8px; height: 8px; border-radius: 50%;
}

.kanban {
  display: flex; gap: 14px;
  overflow-x: auto;
  padding-bottom: 24px;
  min-height: 70vh;
}
.col {
  flex: 0 0 290px;
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  display: flex; flex-direction: column;
  max-height: calc(100vh - 220px);
}
.col-head {
  padding: 12px 14px 10px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--line-soft);
}
.col-head .dot {
  width: 9px; height: 9px; border-radius: 3px;
}
.col-head .name {
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex: 1;
}
.col-head .count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-elev);
  padding: 1px 6px;
  border-radius: 4px;
}

.col-body {
  padding: 10px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px;
  flex: 1;
}

.col-body.drag-over {
  background: var(--accent-soft);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

.col-add {
  margin: 8px 10px 12px;
  padding: 7px;
  background: transparent;
  border: 1px dashed var(--line);
  border-radius: var(--r-sm);
  color: var(--text-muted);
  font-size: 12.5px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer;
}
.col-add:hover { border-color: var(--text); color: var(--text); }

/* Card */
.tcard {
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: 12px 13px;
  cursor: grab;
  transition: box-shadow .15s, transform .08s, border-color .15s;
  position: relative;
}
.tcard:hover { box-shadow: var(--shadow-md); border-color: var(--line); }
.tcard:active { cursor: grabbing; transform: scale(.98); }
.tcard.dragging { opacity: .4; }
.tcard.has-timer {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 16px -4px rgba(255,77,46,.4);
}

.tcard-tags {
  display: flex; gap: 4px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.tag {
  display: inline-flex; align-items: center;
  font-size: 10.5px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 10px;
  letter-spacing: 0.01em;
}

.tcard-title {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.005em;
  color: var(--text);
  margin: 0 0 10px;
}

.tcard-meta {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
}
.tcard-meta .meta {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px;
  color: var(--text-muted);
}
.tcard-meta .meta svg { width: 13px; height: 13px; }
.tcard-meta .meta.urgent { color: var(--accent); font-weight: 500; }
.tcard-meta .meta.timer { color: var(--accent); font-weight: 600; font-family: var(--font-mono); }

.tcard-bottom {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 10px;
}
.tcard-prio {
  width: 4px; height: 16px; border-radius: 2px;
  position: absolute; left: 0; top: 12px;
}
.tcard-prio.high   { background: var(--gold); }
.tcard-prio.urgent { background: var(--accent); }
.tcard-prio.normal { background: var(--sky); }
.tcard-prio.low    { background: var(--text-dim); }

.assignees { display: flex; }
.assignees .avatar {
  margin-left: -6px;
  border: 2px solid var(--bg-elev);
}
.assignees .avatar:first-child { margin-left: 0; }

.checklist-progress {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ================================================================
   MODAL DA TAREFA (Drawer estilo lateral)
   ================================================================ */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(11, 13, 23, .35);
  backdrop-filter: blur(4px);
  z-index: 50;
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.drawer {
  position: fixed; top: 0; right: 0;
  width: min(720px, 100%);
  height: 100vh;
  background: var(--bg-elev);
  border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
  z-index: 51;
  box-shadow: var(--shadow-lg);
  animation: slideIn .25s cubic-bezier(.2,.8,.2,1);
}

.drawer-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 12px;
}
.drawer-head .breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  flex: 1;
}
.drawer-head .breadcrumb strong { color: var(--text); font-weight: 500; }

.drawer-body {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 260px;
}
@media (max-width: 720px) {
  .drawer-body { grid-template-columns: 1fr; }
}

.drawer-main { padding: 24px 28px 24px; min-width: 0; }
.drawer-side {
  padding: 24px 22px;
  border-left: 1px solid var(--line-soft);
  background: var(--bg-sunken);
}

.task-title-input {
  width: 100%;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  border: none;
  background: transparent;
  padding: 4px 0;
  margin-bottom: 6px;
  resize: none;
}
.task-title-input:focus { outline: none; }

/* Timer grandão */
.timer-block {
  margin: 16px 0 24px;
  padding: 20px 22px;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-soft) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  display: flex; align-items: center; gap: 16px;
}
.timer-block.running {
  background: linear-gradient(135deg, #1a0a05 0%, #2a1208 100%);
  border-color: var(--accent);
  color: white;
}
[data-theme="dark"] .timer-block.running { background: linear-gradient(135deg, var(--accent) 0%, #b53116 100%); }

.timer-display {
  font-family: var(--font-mono);
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -0.02em;
  flex: 1;
  font-variant-numeric: tabular-nums;
}
.timer-block.running .timer-display { color: white; }
.timer-block.running .timer-label { color: rgba(255,255,255,.7); }

.timer-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 2px;
}

.timer-btn {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: white;
  display: grid; place-items: center;
  cursor: pointer;
  transition: transform .12s, box-shadow .15s;
  box-shadow: 0 6px 20px -6px var(--accent);
}
.timer-btn:hover { transform: scale(1.06); }
.timer-btn:active { transform: scale(.96); }
.timer-btn svg { width: 24px; height: 24px; }
.timer-block.running .timer-btn { background: white; color: var(--accent); box-shadow: 0 6px 20px -6px rgba(0,0,0,.4); }

.timer-total {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.timer-block.running .timer-total { color: rgba(255,255,255,.8); }

/* Seções da drawer */
.drawer-section {
  margin-bottom: 28px;
}
.drawer-section .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 8px;
  display: flex; align-items: center; justify-content: space-between;
}

.task-description {
  width: 100%;
  min-height: 120px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  font-size: 14px;
  line-height: 1.55;
  font-family: var(--font-ui);
  resize: vertical;
}
.task-description:focus { outline: none; border-color: var(--line); background: var(--bg-elev); }

/* Checklist */
.check-list { display: flex; flex-direction: column; gap: 4px; }
.check-item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px;
  border-radius: var(--r-sm);
}
.check-item:hover { background: var(--bg); }
.check-item.done { color: var(--text-muted); text-decoration: line-through; }
.check-item input[type=checkbox] {
  accent-color: var(--accent);
  cursor: pointer;
}

.check-add {
  display: flex; gap: 8px;
  margin-top: 8px;
}
.check-add input {
  flex: 1;
  padding: 7px 12px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 13px;
}

/* Comentários */
.comments { display: flex; flex-direction: column; gap: 14px; }
.comment {
  display: flex; gap: 10px;
}
.comment .body { flex: 1; }
.comment .head {
  display: flex; align-items: baseline; gap: 8px;
  margin-bottom: 4px;
}
.comment .head .name { font-weight: 500; font-size: 13px; }
.comment .head .time { font-size: 11px; color: var(--text-dim); }
.comment .text {
  font-size: 13.5px;
  line-height: 1.5;
}
.comment-form {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 16px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
}
.comment-form textarea {
  width: 100%; min-height: 60px;
  border: none;
  background: transparent;
  resize: none;
  font-family: var(--font-ui);
  font-size: 13.5px;
}
.comment-form textarea:focus { outline: none; }

/* Side panel da tarefa: meta */
.meta-list { display: flex; flex-direction: column; gap: 16px; }
.meta-item .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.meta-item .val {
  font-size: 13.5px;
}

.priority-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
}
.priority-chip.urgent { background: var(--accent-soft); color: var(--accent-ink); }
.priority-chip.high   { background: #fff4dd; color: #8a5a00; }
.priority-chip.normal { background: #dfeaf6; color: #1e4a72; }
.priority-chip.low    { background: var(--bg-soft); color: var(--text-muted); }
[data-theme="dark"] .priority-chip.high { background: rgba(245,196,108,.15); color: var(--gold); }
[data-theme="dark"] .priority-chip.normal { background: rgba(95,179,232,.15); color: var(--sky); }

/* Presence indicator no head do drawer */
.presence {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: var(--bg-soft);
  border-radius: 100px;
  font-size: 11px;
}
.presence .pulse {
  width: 6px; height: 6px;
  background: var(--emerald);
  border-radius: 50%;
  box-shadow: 0 0 0 0 var(--emerald);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(15,122,85,.7); }
  70% { box-shadow: 0 0 0 8px rgba(15,122,85,0); }
  100% { box-shadow: 0 0 0 0 rgba(15,122,85,0); }
}

/* Typing indicator (alguém está editando um campo) */
.typing-indicator {
  margin-top: 6px;
  font-size: 11px;
  color: var(--accent);
  font-style: italic;
}

/* ================================================================
   TOAST / NOTIFICATIONS
   ================================================================ */
.toast-stack {
  position: fixed;
  top: 16px; right: 16px;
  z-index: 100;
  display: flex; flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 380px;
  padding: 13px 14px 13px 16px;
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  animation: toastIn .25s ease;
  display: flex; gap: 10px; align-items: flex-start;
  transition: opacity .3s, transform .3s;
}
.toast-body { flex: 1; min-width: 0; }
.toast strong { display: block; font-size: 13px; margin-bottom: 2px; color: var(--text); }
.toast span { color: var(--text-muted); font-size: 12.5px; }
.toast.success { border-left-color: var(--emerald); }
.toast.error   { border-left-color: var(--danger); }
.toast-close {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  border-radius: 5px;
  display: grid; place-items: center;
  transition: all .12s;
}
.toast-close:hover { background: var(--bg-soft); color: var(--text); }
@keyframes toastIn { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ================================================================
   NOTIFICATIONS DROPDOWN
   ================================================================ */
.notif-pop {
  position: absolute;
  top: 46px; right: 0;
  width: 360px;
  max-height: 480px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  z-index: 60;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.notif-pop header {
  padding: 12px 16px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--line-soft);
}
.notif-pop header h4 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 15px;
  margin: 0;
}
.notif-list { flex: 1; overflow-y: auto; }
.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background .12s;
  position: relative;
}
.notif-item:hover { background: var(--bg-soft); }
.notif-item.unread::before {
  content: "";
  position: absolute; left: 6px; top: 22px;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
}
.notif-item .title { font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.notif-item .body { font-size: 12.5px; color: var(--text-muted); }
.notif-item .time { font-size: 11px; color: var(--text-dim); margin-top: 4px; }

/* ================================================================
   REPORTS (charts)
   ================================================================ */
.chart-card {
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 20px 22px;
}
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 200px;
  padding-top: 12px;
}
.bar-chart .bar {
  flex: 1;
  background: linear-gradient(180deg, var(--accent) 0%, #ffb27a 100%);
  border-radius: 4px 4px 0 0;
  position: relative;
  min-width: 16px;
  transition: opacity .15s;
}
.bar-chart .bar:hover { opacity: .8; }
.bar-chart .bar .v {
  position: absolute;
  top: -22px; left: 50%; transform: translateX(-50%);
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  white-space: nowrap;
}
.bar-chart .bar .l {
  position: absolute;
  bottom: -22px; left: 50%; transform: translateX(-50%);
  font-size: 10px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.donut {
  position: relative;
  width: 180px; height: 180px;
  margin: 0 auto;
}
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut .center {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  flex-direction: column;
  text-align: center;
}
.donut .center .v {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 28px;
  letter-spacing: -0.02em;
}
.donut .center .l {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.legend { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; }

/* ================================================================
   RESPONSIVO MOBILE
   ================================================================ */
@media (max-width: 768px) {
  .sidebar {
    position: fixed; top: 0; left: 0;
    z-index: 30;
    width: 280px;
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.2,.8,.2,1);
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }

  .menu-toggle { display: grid !important; }

  .topbar { padding: 0 14px; }
  .topbar-title { font-size: 16px; }
  .content { padding: 16px 14px 80px; }

  .drawer { width: 100%; }
  .drawer-side { display: none; }
  .drawer-body { grid-template-columns: 1fr; }

  .kanban { gap: 10px; }
  .col { flex: 0 0 84vw; }

  .kpi-value { font-size: 30px; }
  .timer-display { font-size: 28px; }
}

.menu-toggle { display: none; }
.mobile-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 29;
}
.mobile-overlay.active { display: block; }

/* Loading skeleton */
.skel {
  background: linear-gradient(90deg, var(--bg-soft) 0%, var(--bg-sunken) 50%, var(--bg-soft) 100%);
  background-size: 200% 100%;
  animation: skel 1.4s infinite;
  border-radius: var(--r-sm);
}
@keyframes skel { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Util */
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11.5px; }
.font-mono { font-family: var(--font-mono); }

/* ================================================================
   TREEVIEW (Cliente → Projeto → Pasta → ... → Tarefas)
   ================================================================ */
.tree {
  font-size: 13.5px;
  padding: 4px 4px 12px;
}

.tree-node {
  position: relative;
}

.tree-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px 4px 4px;
  border-radius: var(--r-sm);
  cursor: pointer;
  user-select: none;
  position: relative;
  min-height: 26px;
}
.tree-row:hover { background: var(--bg-soft); }
.tree-row.selected {
  background: var(--text);
  color: var(--bg);
}
[data-theme="dark"] .tree-row.selected {
  background: var(--accent);
  color: #0b0d17;
}
.tree-row.selected .tree-count { background: rgba(255,255,255,.2); color: inherit; }

.tree-caret {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--text-dim);
  transition: transform .15s;
  cursor: pointer;
}
.tree-caret svg { width: 10px; height: 10px; }
.tree-caret.expanded { transform: rotate(90deg); }
.tree-caret.empty { visibility: hidden; }

.tree-icon {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 12px;
}
.tree-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

.tree-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.tree-count {
  font-size: 10.5px;
  color: var(--text-muted);
  background: var(--bg-soft);
  padding: 1px 6px;
  border-radius: 100px;
  flex-shrink: 0;
  font-family: var(--font-mono);
}

.tree-actions {
  display: none;
  gap: 2px;
  flex-shrink: 0;
}
.tree-row:hover .tree-actions { display: flex; }
.tree-action {
  width: 20px; height: 20px;
  display: grid; place-items: center;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-muted);
}
.tree-action:hover { background: var(--bg-elev); color: var(--text); }
.tree-action svg { width: 12px; height: 12px; }

.tree-children {
  display: none;
}
.tree-node.expanded > .tree-children { display: block; }

/* Linhas verticais sutis pra hierarquia */
.tree-children {
  position: relative;
  margin-left: 12px;
}
.tree-children::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 8px;
  width: 1px;
  background: var(--line-soft);
}

/* Estado vazio */
.tree-empty {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-dim);
  font-style: italic;
}

/* ================================================================
   FILTROS DA VIEW BOARD (folder breadcrumb + só minhas)
   ================================================================ */
.board-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
}

.breadcrumb-trail {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}
.breadcrumb-trail .crumb {
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.breadcrumb-trail .crumb:hover { background: var(--bg-soft); color: var(--text); }
.breadcrumb-trail .crumb.active { color: var(--text); font-weight: 500; }
.breadcrumb-trail .crumb svg { width: 12px; height: 12px; color: var(--text-dim); }
.breadcrumb-trail .sep { color: var(--text-dim); font-size: 11px; }

.toolbar-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  font-size: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 100px;
  cursor: pointer;
  font-weight: 500;
}
.toolbar-toggle:hover { border-color: var(--text-muted); }
.toolbar-toggle.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
[data-theme="dark"] .toolbar-toggle.active { background: var(--accent); color: #0b0d17; border-color: var(--accent); }

/* ================================================================
   MEMBROS - USERS ADMIN PAGE
   ================================================================ */
.users-table {
  width: 100%;
  border-collapse: collapse;
}
.users-table thead th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.users-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13.5px;
  vertical-align: middle;
}
.users-table tbody tr:hover { background: var(--bg-soft); }

.user-badge-role {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 500;
  text-transform: capitalize;
}
.user-badge-role.owner    { background: var(--accent-soft); color: var(--accent-ink); }
.user-badge-role.admin    { background: #fff4dd; color: #8a5a00; }
.user-badge-role.manager  { background: #dfeaf6; color: #1e4a72; }
.user-badge-role.member   { background: var(--bg-soft); color: var(--text-muted); }
.user-badge-role.guest    { background: var(--bg-soft); color: var(--text-dim); }
[data-theme="dark"] .user-badge-role.admin  { background: rgba(245,196,108,.15); color: var(--gold); }
[data-theme="dark"] .user-badge-role.manager { background: rgba(95,179,232,.15); color: var(--sky); }

.user-badge-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text-muted);
}
.user-badge-status::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-dim);
}
.user-badge-status.active::before { background: var(--emerald); }
.user-badge-status.suspended::before { background: var(--accent); }
.user-badge-status.invited::before { background: var(--gold); }

/* ================================================================
   COLUMN EDITOR (personalização de colunas do Kanban)
   ================================================================ */
.col-editor-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  margin-bottom: 8px;
}
.col-editor-row input[type="text"] {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg-elev);
  font-size: 13px;
}
.col-editor-row input[type="color"] {
  width: 32px; height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 2px;
  background: var(--bg-elev);
}
.col-editor-row .grip {
  cursor: grab;
  color: var(--text-dim);
  padding: 4px;
}
.col-editor-row .grip:active { cursor: grabbing; }
.col-editor-row.dragging { opacity: .4; }

/* ================================================================
   TASK DRAWER — Layout estilo Wrike
   ================================================================ */
.task-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  z-index: 79;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.task-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
[data-theme="dark"] .task-drawer-backdrop {
  background: rgba(0, 0, 0, 0.55);
}
.task-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 720px;
  max-width: 96vw;
  background: var(--bg-elev);
  border-left: 1px solid var(--line);
  box-shadow: -8px 0 32px rgba(0,0,0,.08);
  z-index: 80;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .25s ease;
}
.task-drawer.open { transform: translateX(0); }
[data-theme="dark"] .task-drawer { box-shadow: -8px 0 32px rgba(0,0,0,.4); }

.td-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.td-breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 6px;
  align-items: center;
}
.td-bc-sep { color: var(--text-dim); }
.td-head-actions { display: flex; gap: 6px; }

.td-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px 28px;
}

/* Título */
.td-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.td-status-toggle {
  width: 26px; height: 26px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  display: grid;
  place-items: center;
}
.td-status-toggle:hover { color: var(--text); }
.td-title-row.done .td-status-toggle { color: var(--emerald); }
.td-title-row.done .td-title-input { text-decoration: line-through; color: var(--text-muted); }

.td-title-input {
  flex: 1;
  font-size: 22px;
  font-weight: 600;
  font-family: var(--font-display, var(--font-ui));
  background: transparent;
  border: 1px solid transparent;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  color: var(--text);
  line-height: 1.3;
}
.td-title-input:focus { background: var(--bg); border-color: var(--line); outline: none; }

/* Linha inline de pills */
.td-inline-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.td-pill {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 10px;
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  cursor: pointer;
  min-width: 110px;
  transition: border-color .15s;
}
.td-pill:hover { border-color: var(--line); }
.td-pill-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-dim);
}
.td-pill-value {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
}
.td-pill-empty { color: var(--text-dim); font-weight: 400; }
.td-status-dot {
  width: 8px; height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}
.td-avatars { display: flex; gap: -2px; }
.td-avatars > * + * { margin-left: -6px; }
.td-avatar-more {
  width: 22px; height: 22px;
  background: var(--text-dim);
  color: white;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 600;
  border: 2px solid var(--bg);
}

/* Prioridade */
.prio-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.prio-dot.low      { background: #94a3b8; }
.prio-dot.normal   { background: #3b82f6; }
.prio-dot.high     { background: #f59e0b; }
.prio-dot.urgent   { background: #ef4444; }

/* Linha de ações */
.td-actions-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}
.td-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .12s;
}
.td-action:hover { background: var(--bg); color: var(--text); }
.td-action.td-action-timer.running {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.td-action.td-action-timer.running:hover { background: var(--accent); opacity: .9; }

/* Seções */
.td-section {
  margin-bottom: 20px;
}
.td-section h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-dim);
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.td-section-count {
  background: var(--bg);
  color: var(--text-muted);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 100px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

/* Descrição */
.td-desc {
  width: 100%;
  border: 1px solid var(--line-soft);
  background: var(--bg);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  min-height: 80px;
  font-family: var(--font-ui);
  color: var(--text);
}
.td-desc:focus { border-color: var(--line); outline: none; }

/* Anexos */
.td-attach-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  margin-bottom: 6px;
}
.td-attach-icon { font-size: 22px; flex-shrink: 0; }
.td-attach-info { flex: 1; min-width: 0; }
.td-attach-name {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.td-attach-name:hover { color: var(--accent); }
.td-attach-meta { font-size: 11px; color: var(--text-muted); }
.td-attach-delete { width: 28px; height: 28px; color: var(--text-dim); }
.td-attach-delete:hover { color: var(--accent); }

/* Subtarefas */
.td-subtask-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  margin-bottom: 4px;
  cursor: pointer;
  transition: background .12s;
}
.td-subtask-item:hover { background: var(--bg-soft); }
.td-subtask-title { flex: 1; font-size: 13px; font-weight: 500; }

/* Time entries */
.td-time-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  margin-bottom: 4px;
}

/* Comments */
.td-comment {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.td-comment:last-child { border-bottom: none; }
.td-comment-body { flex: 1; }
.td-comment-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}
.td-comment-text {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.mention {
  background: var(--accent-soft);
  color: var(--accent-ink);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 500;
}

.td-comment-input {
  margin-top: 12px;
}
.td-comment-input textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: 13px;
  font-family: var(--font-ui);
  resize: vertical;
}
.td-comment-input textarea:focus { border-color: var(--accent); outline: none; }
.td-comment-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

/* Assignee picker */
.td-assignee-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  cursor: pointer;
}
.td-assignee-row:hover { background: var(--bg-soft); }
.td-assignee-row input { margin: 0; }

/* Pop menu (status, priority, etc) */
.pop-menu {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  padding: 4px;
  min-width: 180px;
}
.pop-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 13px;
}
.pop-item:hover { background: var(--bg-soft); }

/* ================================================================
   COLOR PRESETS (paleta predefinida — verde, azul, vermelho, cinza)
   ================================================================ */
.color-preset-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  margin-top: 6px;
}
.color-preset {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform .1s, border-color .1s;
}
.color-preset:hover { transform: scale(1.1); }
.color-preset.selected {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--bg-elev), 0 0 0 4px var(--text);
}

/* ================================================================
   GANTT
   ================================================================ */
.gantt-row .gantt-bar:hover {
  filter: brightness(1.15);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

/* Subtask refinada (com toggle + título clicável) */
.td-subtask-item {
  padding: 6px 10px !important;
}
.td-subtask-toggle {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  flex-shrink: 0;
}
.td-subtask-toggle:hover { color: var(--text); }
.td-subtask-title {
  cursor: pointer;
  flex: 1;
}
.td-subtask-title:hover { color: var(--accent); }
.td-subtask-title.done {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* WYSIWYG (editor de descrição) */
.wysiwyg-wrap {
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  background: var(--bg);
  overflow: hidden;
}
.wysiwyg-wrap:focus-within { border-color: var(--line); }
.wysiwyg-toolbar {
  display: flex;
  gap: 2px;
  padding: 6px 8px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line-soft);
  flex-wrap: wrap;
}
.wysiwyg-btn {
  background: transparent;
  border: 1px solid transparent;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  min-width: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.wysiwyg-btn:hover { background: var(--bg-soft); color: var(--text); }
.wysiwyg-btn.active { background: var(--accent-soft); color: var(--accent-ink); }
.wysiwyg-sep {
  width: 1px;
  background: var(--line-soft);
  margin: 4px 4px;
}
.wysiwyg-editor {
  padding: 12px 14px;
  min-height: 180px;
  max-height: 560px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.65;
  outline: none;
  color: var(--text);
  font-family: var(--font-ui);
  resize: vertical;
}
.wysiwyg-editor:empty:before {
  content: attr(data-placeholder);
  color: var(--text-dim);
  pointer-events: none;
}
/* Imagens redimensionáveis no editor */
.wysiwyg-editor img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 6px 0;
  resize: both;
  overflow: hidden;
  display: inline-block;
  cursor: nwse-resize;
}
.wysiwyg-editor img.selected-img {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.wysiwyg-editor b, .wysiwyg-editor strong { font-weight: 600; }
.wysiwyg-editor i, .wysiwyg-editor em { font-style: italic; }
.wysiwyg-editor h1, .wysiwyg-editor h2, .wysiwyg-editor h3 {
  font-weight: 600;
  margin: 12px 0 6px;
}
.wysiwyg-editor h1 { font-size: 18px; }
.wysiwyg-editor h2 { font-size: 16px; }
.wysiwyg-editor h3 { font-size: 14px; }
.wysiwyg-editor ul, .wysiwyg-editor ol {
  padding-left: 22px;
  margin: 6px 0;
}
.wysiwyg-editor li { margin: 2px 0; }
.wysiwyg-editor a { color: var(--accent); text-decoration: underline; }
.wysiwyg-editor blockquote {
  border-left: 3px solid var(--line);
  padding-left: 12px;
  color: var(--text-muted);
  margin: 8px 0;
}
.wysiwyg-editor code {
  background: var(--bg-soft);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.wysiwyg-editor pre {
  background: var(--bg-soft);
  padding: 10px;
  border-radius: 6px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  margin: 8px 0;
}

/* Modal de confirmação do timer (estilo Wrike) */
.timer-confirm-modal {
  text-align: center;
  padding: 8px 0;
}
.timer-confirm-display {
  font-family: var(--font-mono);
  font-size: 42px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.02em;
  margin: 10px 0;
}
.timer-confirm-task {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 14px;
}
.timer-confirm-edit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 14px 0;
}
.timer-confirm-edit input {
  width: 60px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 18px;
  padding: 6px 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
}
.timer-confirm-edit span {
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--text-dim);
}

/* ================================================================
   NOTIFICATIONS — Redesign
   ================================================================ */
#notifDot {
  position: absolute;
  top: 4px; right: 4px;
  min-width: 16px;
  height: 16px;
  background: var(--danger);
  color: white;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 700;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg-elev);
  box-shadow: 0 2px 6px rgba(220,38,38,.4);
}
[data-theme="dark"] #notifDot { box-shadow: 0 2px 8px rgba(248,113,113,.5); }

/* (notif-pop é definido no bloco "NOTIF POPUP" mais abaixo) */
.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.notif-header h4 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.notif-badge-inline {
  background: var(--accent);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
  text-transform: lowercase;
}
.notif-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.notif-action:hover { background: var(--accent-soft); }

.notif-list {
  flex: 1;
  overflow-y: auto;
}
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background .12s;
  position: relative;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-soft); }
.notif-item.unread { background: linear-gradient(90deg, var(--accent-soft) 0%, transparent 50%); }
.notif-item.unread:hover { background: linear-gradient(90deg, var(--accent-soft) 0%, var(--bg-soft) 80%); }

.notif-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 16px;
  flex-shrink: 0;
}
.notif-body { flex: 1; min-width: 0; }
.notif-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.notif-text {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.notif-time {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}
.notif-unread-dot {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
}
.notif-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.notif-empty p {
  font-size: 13px;
  margin: 4px 0;
}

/* ================================================================
   LIGHTBOX (preview de anexo)
   ================================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  display: flex;
  flex-direction: column;
  z-index: 200;
  opacity: 0;
  transition: opacity .2s;
}
.lightbox.open { opacity: 1; }
.lightbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  color: white;
  font-size: 13px;
  font-weight: 500;
}
.lightbox-actions { display: flex; gap: 6px; }
.lightbox-btn {
  background: rgba(255,255,255,.1);
  border: none;
  color: white;
  width: 36px; height: 36px;
  border-radius: 6px;
  cursor: pointer;
  display: grid;
  place-items: center;
  text-decoration: none;
}
.lightbox-btn:hover { background: rgba(255,255,255,.2); }
.lightbox img {
  max-width: 92vw;
  max-height: calc(100vh - 90px);
  object-fit: contain;
  margin: 0 auto;
  display: block;
}
.lightbox-pdf iframe {
  flex: 1;
  background: white;
  margin: 0 5vw 24px;
  border-radius: 8px;
}

/* ================================================================
   ATTACHMENT THUMB
   ================================================================ */
.td-attach-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-soft);
  cursor: zoom-in;
  border: 1px solid var(--line-soft);
}
.td-attach-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* WYSIWYG select */
.wysiwyg-select {
  padding: 4px 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-size: 11.5px;
  border-radius: 4px;
  cursor: pointer;
  max-width: 100px;
}
.wysiwyg-select:hover { background: var(--bg-soft); }
.wysiwyg-select:focus { outline: 1px solid var(--accent); }

/* Imagens dentro do WYSIWYG */
.wysiwyg-editor img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 4px 0;
}
.wysiwyg-editor hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 10px 0;
}

/* ================================================================
   PALETA SEMÂNTICA — Classes utilitárias que respeitam o tema
   Em vez de cores fixas (#dcfce7, #166534) usar essas classes.
   ================================================================ */
.alert-success {
  background: rgba(16, 163, 127, 0.12);
  color: var(--emerald);
  border: 1px solid rgba(16, 163, 127, 0.25);
  padding: 10px 14px;
  border-radius: var(--r-md);
  font-size: 13px;
}
.alert-error {
  background: rgba(220, 38, 38, 0.10);
  color: var(--danger);
  border: 1px solid rgba(220, 38, 38, 0.22);
  padding: 10px 14px;
  border-radius: var(--r-md);
  font-size: 13px;
}
.alert-warn {
  background: rgba(192, 138, 26, 0.12);
  color: var(--gold);
  border: 1px solid rgba(192, 138, 26, 0.25);
  padding: 10px 14px;
  border-radius: var(--r-md);
  font-size: 13px;
}
.alert-info {
  background: var(--accent-soft);
  color: var(--accent-ink);
  border: 1px solid rgba(0, 123, 214, 0.25);
  padding: 10px 14px;
  border-radius: var(--r-md);
  font-size: 13px;
}
[data-theme="dark"] .alert-info {
  border-color: rgba(78, 164, 245, 0.25);
}

/* Fix priority chips no dark */
[data-theme="dark"] .priority-chip.normal {
  background: rgba(78, 164, 245, 0.15);
  color: #93c5fd;
}
[data-theme="dark"] .priority-chip.high {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}
[data-theme="dark"] .priority-chip.urgent {
  background: rgba(248, 113, 113, 0.15);
  color: #fca5a5;
}
[data-theme="dark"] .priority-chip.low {
  background: rgba(156, 163, 175, 0.15);
  color: #94a3b8;
}

/* Role badges no dark */
[data-theme="dark"] .user-badge-role.manager {
  background: rgba(78, 164, 245, 0.15);
  color: #93c5fd;
}
[data-theme="dark"] .user-badge-role.admin {
  background: rgba(212, 175, 106, 0.15);
  color: var(--gold);
}
[data-theme="dark"] .user-badge-role.owner {
  background: rgba(212, 175, 106, 0.2);
  color: var(--gold);
  font-weight: 600;
}
[data-theme="dark"] .user-badge-role.member {
  background: rgba(156, 163, 175, 0.15);
  color: #94a3b8;
}

/* Fix btn-primary (texto branco no dark) */
[data-theme="dark"] .btn-primary {
  color: white;
}
[data-theme="dark"] .nav-item.active {
  color: white;
}
[data-theme="dark"] .kpi.accent { color: white; }
[data-theme="dark"] .toolbar-toggle.active { color: white; }

/* Fix timer running (branco fica errado no dark com accent claro) */
[data-theme="dark"] .timer-block.running .timer-btn {
  background: var(--bg-elev);
  color: var(--accent);
}

/* Modais no dark */
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="datetime-local"],
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background: var(--bg-sunken);
  color: var(--text);
  border-color: var(--line);
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: var(--text-dim);
}

/* Pop menu, dropdowns, tooltips no dark */
[data-theme="dark"] .pop-menu {
  background: var(--bg-elev);
  border-color: var(--line);
}
[data-theme="dark"] .pop-item:hover { background: var(--bg-soft); }

/* WYSIWYG no dark */
[data-theme="dark"] .wysiwyg-editor code {
  background: var(--bg-sunken);
}
[data-theme="dark"] .wysiwyg-editor pre {
  background: var(--bg-sunken);
}

/* Cards e tabelas no dark */
[data-theme="dark"] table { color: var(--text); }
[data-theme="dark"] table th { color: var(--text-muted); }

/* Sidebar collapsed states */
[data-theme="dark"] .nav-section-label { color: var(--text-dim); }

/* ================================================================
   SEARCH GLOBAL (dropdown de resultados)
   ================================================================ */
.search-input { position: relative; }
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  max-height: 480px;
  overflow-y: auto;
  z-index: 70;
  padding: 6px;
}
.search-section-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  font-weight: 600;
  padding: 10px 12px 4px;
}
.search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .12s;
}
.search-result:hover { background: var(--bg-soft); }
.search-result-body { flex: 1; min-width: 0; }
.search-result-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}
.search-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ================================================================
   NOTIF POPUP — Posicionamento corrigido
   ================================================================ */
.notif-wrap {
  position: relative;
  display: inline-flex;
}
.notif-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 380px;
  max-width: calc(100vw - 32px);
  max-height: 480px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 60;
}
@media (max-width: 480px) {
  .notif-pop {
    position: fixed;
    top: var(--header-h);
    right: 8px;
    left: 8px;
    width: auto;
    max-height: calc(100vh - var(--header-h) - 16px);
  }
}

/* ================================================================
   REPORTS — KPIs e tabelas
   ================================================================ */
.kpi-card {
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: 14px 16px;
}
.kpi-card .kpi-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}
.kpi-card .kpi-value {
  font-size: 28px;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--text);
  margin: 6px 0 4px;
  line-height: 1;
}
.kpi-card .kpi-trend {
  font-size: 11px;
  color: var(--text-muted);
}
.kpi-trend-up    { color: var(--emerald); font-weight: 500; }
.kpi-trend-down  { color: var(--danger);  font-weight: 500; }
.kpi-trend-neutral { color: var(--text-dim); }

.rpt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.rpt-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  font-weight: 600;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-soft);
}
.rpt-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text);
}
.rpt-table tr:last-child td { border-bottom: none; }
.rpt-table tr:hover td { background: var(--bg-soft); }

/* ================================================================
   SLA BADGE (no drawer e no card de tarefa)
   ================================================================ */
.sla-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
}
.sla-badge.on_track {
  background: rgba(16, 163, 127, 0.12);
  color: var(--emerald);
}
.sla-badge.met {
  background: rgba(16, 163, 127, 0.18);
  color: var(--emerald);
}
.sla-badge.at_risk {
  background: rgba(192, 138, 26, 0.15);
  color: var(--gold);
}
.sla-badge.breached {
  background: rgba(220, 38, 38, 0.12);
  color: var(--danger);
}
[data-theme="dark"] .sla-badge.on_track,
[data-theme="dark"] .sla-badge.met { color: #34d399; }
[data-theme="dark"] .sla-badge.at_risk { color: #fbbf24; }
[data-theme="dark"] .sla-badge.breached { color: #fca5a5; }

.sla-progress {
  margin-top: 6px;
  background: var(--bg-soft);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
}
.sla-progress-bar {
  height: 100%;
  border-radius: 4px;
  transition: width .3s;
}

/* ================================================================
   MY TASKS — Lista (tabela) + Grid (cards) com breadcrumb
   ================================================================ */
.mt-group-head {
  padding: 12px 18px;
  background: var(--bg-soft);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  justify-content: space-between;
}
.mt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.mt-table thead th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  font-weight: 600;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg);
}
.mt-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text);
  vertical-align: middle;
}
.mt-row { cursor: pointer; transition: background .12s; }
.mt-row:hover td { background: var(--bg-soft); }

.mt-name {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mt-title {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}
.mt-icon-mini {
  font-size: 10px;
  color: var(--text-muted);
  background: var(--bg-soft);
  padding: 1px 6px;
  border-radius: 4px;
}

.mt-loc {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted);
}
.bc-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.bc-color {
  width: 8px; height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}
.bc-sep {
  color: var(--text-dim);
  margin: 0 4px;
  font-size: 10px;
}

.mt-status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.mt-timer-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line);
  cursor: pointer;
  color: var(--text-muted);
  font-size: 11px;
  display: grid;
  place-items: center;
  transition: all .12s;
}
.mt-timer-btn:hover { color: var(--accent); border-color: var(--accent); }
.mt-timer-btn.running {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* Grid */
.mt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.mt-card {
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: 14px;
  cursor: pointer;
  transition: border-color .12s, box-shadow .12s;
}
.mt-card:hover {
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.mt-card-loc {
  font-size: 11px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
}
.mt-card-title {
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
}
.mt-card-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.text-danger { color: var(--danger); }


/* ================================================================
   ZYLLO — Componentes premium
   ================================================================ */

/* Logo Zyllo no sidebar */
.zyllo-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.025em;
  color: var(--text);
}
.zyllo-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--grad-primary);
  display: grid;
  place-items: center;
  color: white;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  box-shadow: var(--shadow-glow);
}

/* Botão primário com gradiente */
.btn-primary {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--r-sm);
  padding: 8px 14px;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .12s, transform .12s, box-shadow .12s;
  box-shadow: 0 1px 2px rgba(37,99,235,.18);
  position: relative;
  overflow: hidden;
}
.btn-primary:hover { background: var(--accent-hover, #1D4ED8); }
[data-theme="dark"] .btn-primary:hover { background: #4F46E5; }
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.18) 0%, transparent 50%);
  opacity: 0;
  transition: opacity .15s;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -2px rgba(37, 99, 235, .35), 0 2px 4px rgba(0,0,0,.06);
}
.btn-primary:hover::before { opacity: 1; }
.btn-primary:active { transform: translateY(0); }
[data-theme="dark"] .btn-primary:hover {
  box-shadow: 0 4px 16px -2px rgba(99, 102, 241, .5);
}

/* Botão ghost / secundário */
.btn-ghost {
  background: var(--bg-elev);
  color: var(--text-muted);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 7px 13px;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  transition: all .12s;
}
.btn-ghost:hover {
  border-color: var(--line-hover);
  color: var(--text);
  background: var(--bg-soft);
}

/* Texto com gradiente */
.gradient-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* Cards modernos */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
}
.card:hover {
  border-color: var(--line-hover);
}

/* Inputs Linear-style */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="search"],
input[type="url"],
input[type="tel"],
textarea,
select {
  font-family: var(--font-ui);
  font-size: 13.5px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: var(--r-sm);
  color: var(--text);
  transition: border-color .12s, box-shadow .12s;
  width: 100%;
}
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background: var(--bg-sunken);
}
[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .15);
}

/* Nav item ativo com gradiente sutil */
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
[data-theme="dark"] .nav-item.active {
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-left: 3px solid var(--accent);
  padding-left: 13px;
}

/* === SLA block no drawer === */
.td-sla-block {
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: 10px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.td-sla-pick {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  transition: all .12s;
}
.td-sla-pick:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* === Context Menu (botão direito) === */
.ctx-menu {
  position: fixed;
  z-index: 9999;
  min-width: 200px;
  max-width: 280px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 4px;
  font-size: 13px;
  user-select: none;
  animation: ctx-in .12s ease-out;
}
@keyframes ctx-in {
  from { opacity: 0; transform: scale(.96); }
  to { opacity: 1; transform: scale(1); }
}
.ctx-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  gap: 12px;
  font-family: var(--font-ui);
  font-size: 13px;
}
.ctx-item:hover:not(:disabled) {
  background: var(--bg-soft);
}
.ctx-item:disabled {
  color: var(--text-dim);
  cursor: not-allowed;
}
.ctx-item.danger {
  color: var(--danger);
}
.ctx-item.danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.08);
}
.ctx-label { display: inline-flex; gap: 6px; align-items: center; }
.ctx-shortcut {
  color: var(--text-dim);
  font-size: 11px;
  font-family: var(--font-mono);
}
.ctx-sep {
  height: 1px;
  background: var(--line-soft);
  margin: 4px 6px;
}

/* Botão danger (modais de exclusão) */
.btn-danger {
  background: var(--danger);
  color: white;
  border: none;
  border-radius: var(--r-sm);
  padding: 8px 16px;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  transition: filter .12s;
}
.btn-danger:hover { filter: brightness(1.08); }

/* Pop-menu item danger */
.pop-item.danger { color: var(--danger); }
.pop-item.danger:hover { background: rgba(239,68,68,0.08); }

/* === Busca melhorada === */
.search-loading {
  padding: 18px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.search-loading .spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.search-result.active {
  background: var(--accent-soft);
}
.search-result mark {
  background: rgba(37, 99, 235, 0.18);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}
[data-theme="dark"] .search-result mark {
  background: rgba(99, 102, 241, 0.3);
}
.search-result-meta .bc-color {
  width: 7px; height: 7px; border-radius: 2px; display: inline-block;
  margin-right: 3px; vertical-align: middle;
}
.search-enter {
  font-size: 11px;
  color: var(--text-dim);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: auto;
  opacity: 0;
}
.search-result.active .search-enter { opacity: 1; }
.search-empty { padding: 24px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* === Drag-and-drop na treeview === */
.tree-row.dragging {
  opacity: 0.45;
}
.tree-row.drop-target {
  background: var(--accent-soft);
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
  border-radius: 6px;
}
[data-theme="dark"] .tree-row.drop-target {
  background: rgba(99, 102, 241, 0.16);
}

/* === Responsivo extra para Zyllo === */
@media (max-width: 768px) {
  .task-drawer {
    width: 100%;
    max-width: 100%;
  }
  .search-input { max-width: none; }
  .toast-stack { left: 8px; right: 8px; top: 8px; }
  .toast { min-width: 0; max-width: 100%; }
  .ctx-menu { max-width: calc(100vw - 16px); }

  /* Botões e tabelas */
  .btn-primary, .btn-ghost { font-size: 13px; padding: 8px 12px; }
  .rpt-table { font-size: 12px; }

  /* Login: stack vertical no mobile */
  .login-art { display: none; }
}

@media (max-width: 480px) {
  .topbar-title { font-size: 14px; }
  .topbar-title em { display: none; }
  .toolbar-toggle { padding: 5px 10px; font-size: 12px; }
}

/* === Activity log no drawer === */
.td-activity-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.td-activity-item {
  display: flex;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
}
.td-activity-item:hover { background: var(--bg-soft); }
.td-activity-icon {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  background: var(--bg-soft);
  border-radius: 50%;
  font-size: 11px;
  flex-shrink: 0;
}
.td-activity-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}
.td-activity-body strong { color: var(--text); font-weight: 600; }
.td-activity-time {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* === Presença em tarefa === */
.td-presence {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: 8px;
  margin-left: auto;
  font-size: 11px;
}
.td-presence-label {
  color: var(--text-dim);
  font-size: 11px;
  margin-right: 4px;
}
.td-presence-avatar {
  position: relative;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-grid; place-items: center;
  color: white;
  font-size: 11px;
  font-weight: 600;
  overflow: hidden;
  border: 2px solid var(--bg-elev);
  margin-left: -6px;
}
.td-presence-avatar:first-child { margin-left: 0; }
.td-presence-avatar img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.td-presence-dot {
  position: absolute;
  bottom: -1px; right: -1px;
  width: 8px; height: 8px;
  background: var(--emerald);
  border: 2px solid var(--bg-elev);
  border-radius: 50%;
}
.td-presence-more {
  color: var(--text-muted);
  font-size: 11px;
  margin-left: 4px;
}

/* === Badges de status (histórico de import, etc) === */
.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px;
  font-weight: 600; background: var(--bg-soft); color: var(--text-muted); line-height: 1.5; }
.badge-success { background: rgba(16, 185, 129, .12); color: var(--emerald); }
.badge-danger  { background: rgba(239, 68, 68, .12);  color: var(--danger); }
.badge-info    { background: rgba(59, 130, 246, .12); color: var(--accent); }

.card-light {
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}

/* === Dark theme: garante legibilidade de ícones/textos === */
[data-theme="dark"] svg { color: inherit; }
[data-theme="dark"] .icon-btn,
[data-theme="dark"] .btn-ghost {
  color: var(--text-muted);
}
[data-theme="dark"] .icon-btn:hover,
[data-theme="dark"] .btn-ghost:hover {
  color: var(--text);
  background: var(--bg-soft);
}
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background: var(--bg-soft);
  color: var(--text);
  border-color: var(--line);
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: var(--text-dim);
}
[data-theme="dark"] .badge,
[data-theme="dark"] .priority-chip,
[data-theme="dark"] .mt-status-pill,
[data-theme="dark"] .tag-chip {
  /* Mantém o color que o JS aplicou inline (que já é a cor de destaque) */
  color: inherit;
}
/* Toasts em dark: fundo escuro com texto claro */
[data-theme="dark"] .toast {
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--line);
}
[data-theme="dark"] .pop-menu,
[data-theme="dark"] .ctx-menu,
[data-theme="dark"] .dropdown-menu {
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--line);
}
[data-theme="dark"] .pop-menu button,
[data-theme="dark"] .ctx-menu button,
[data-theme="dark"] .dropdown-menu button {
  color: var(--text);
}
[data-theme="dark"] .pop-menu button:hover,
[data-theme="dark"] .ctx-menu button:hover {
  background: var(--bg-soft);
}
/* Cards de filtro/toggle */
[data-theme="dark"] .toolbar-toggle {
  color: var(--text-muted);
  background: transparent;
}
[data-theme="dark"] .toolbar-toggle.active {
  color: var(--text);
  background: var(--bg-soft);
}
/* Tabelas */
[data-theme="dark"] table thead th { color: var(--text-muted); }
[data-theme="dark"] table tbody td { color: var(--text); }
/* Links que herdam color do parent */
[data-theme="dark"] a { color: inherit; }
[data-theme="dark"] a:not([class]) { color: var(--accent-ink); }

/* === Painéis (estilo Wrike "Tarefas por colaborador") === */
.panels-board {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 16px;
  min-height: 0;
}
.panel-col {
  flex: 0 0 320px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 200px);
}
.panel-col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  font-size: 13px;
}
.panel-col-icon {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--bg-soft);
  display: inline-grid; place-items: center;
  font-size: 12px;
}
.panel-col-name { flex: 1; }
.panel-col-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-soft);
  padding: 1px 8px;
  border-radius: 9px;
}
.panel-col-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex; flex-direction: column; gap: 8px;
}
.panel-task {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color .12s, transform .12s, box-shadow .12s;
}
.panel-task:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.panel-task-head {
  display: flex; align-items: flex-start; gap: 6px;
  margin-bottom: 6px;
}
.panel-task-title {
  font-size: 13px; font-weight: 500; line-height: 1.35;
}
.panel-task-meta {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px;
}
.panel-task-foot {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px;
  color: var(--text-muted);
}
