/* ═══════════════════════════════════════════════════════════════
   GROUP LIBERTY – ASSESSORIA INTERNACIONAL
   Design System · Cores inspiradas na bandeira de Portugal
═══════════════════════════════════════════════════════════════ */

:root {
  /* Cores Portugal */
  --portugal-green:       #006600;
  --portugal-green-light: #008000;
  --portugal-green-dark:  #004d00;
  --portugal-red:         #cc0000;
  --portugal-red-light:   #e60000;
  --portugal-red-dark:    #990000;
  --portugal-gold:        #e6a817;

  /* Neutros */
  --bg-app:       #f0f2f5;
  --bg-card:      #ffffff;
  --bg-sidebar:   #0a1628;
  --bg-sidebar-hover: rgba(255,255,255,0.08);
  --bg-sidebar-active: rgba(0,153,0,0.20);

  /* Texto */
  --text-primary:   #0d1b2a;
  --text-secondary: #4a5568;
  --text-muted:     #8898aa;
  --text-sidebar:   #a0aec0;

  /* Bordas */
  --border:       #e2e8f0;
  --border-light: #f1f5f9;

  /* Sombras */
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:  0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:  0 10px 40px rgba(0,0,0,.14);
  --shadow-xl:  0 20px 60px rgba(0,0,0,.18);

  /* Radi */
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Sidebar */
  --sidebar-w: 260px;
  --topbar-h:  64px;

  /* Transições */
  --transition: all .22s cubic-bezier(.4,0,.2,1);
}

/* ── RESET & BASE ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body { font-family: 'Inter', system-ui, -apple-system, sans-serif; background: var(--bg-app); color: var(--text-primary); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ══════════════════════════════════════════════════════════════
   SCREENS (navegação entre telas)
══════════════════════════════════════════════════════════════ */
.screen { display: none; min-height: 100vh; }
.screen.active { display: block; }

/* ══════════════════════════════════════════════════════════════
   AUTH LAYOUT (Login + Recuperar Senha)
══════════════════════════════════════════════════════════════ */
.auth-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* ── PAINEL ESQUERDO (BRAND) ─────────────────────────────── */
.auth-brand {
  background: linear-gradient(145deg, var(--portugal-green-dark) 0%, var(--portugal-green) 50%, #009900 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 48px;
  position: relative;
  overflow: hidden;
}

.auth-brand::before {
  content: '';
  position: absolute;
  top: -120px; right: -120px;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
}
.auth-brand::after {
  content: '';
  position: absolute;
  bottom: -80px; left: -80px;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
}

.brand-content {
  position: relative;
  z-index: 2;
  color: #fff;
  text-align: center;
  max-width: 360px;
}

.brand-logo-wrap { margin-bottom: 24px; }
.brand-emblem {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  border: 3px solid rgba(255,255,255,.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}
.emblem-gl {
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -1px;
}

.brand-name { font-size: 2rem; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 4px; }
.brand-tagline { font-size: .95rem; opacity: .8; font-weight: 400; margin-bottom: 28px; }

.brand-divider {
  width: 48px; height: 3px;
  background: var(--portugal-gold);
  border-radius: 2px;
  margin: 0 auto 20px;
}

.brand-desc { font-size: .9rem; line-height: 1.7; opacity: .85; margin-bottom: 36px; }

.brand-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
  background: rgba(255,255,255,.10);
  border-radius: var(--radius-lg);
  padding: 20px 12px;
  backdrop-filter: blur(8px);
}
.stat-item { text-align: center; }
.stat-num { display: block; font-size: 1.4rem; font-weight: 800; color: #fff; }
.stat-label { display: block; font-size: .72rem; opacity: .75; margin-top: 2px; }

.brand-flags { font-size: 1.8rem; letter-spacing: 6px; opacity: .9; }

/* Steps de segurança (tela Recuperar Senha) */
.brand-security-info { margin-top: 32px; }
.sec-step {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,.15);
  font-size: .9rem;
  opacity: .9;
}
.sec-step:last-child { border-bottom: none; }
.sec-num {
  width: 28px; height: 28px;
  background: rgba(255,255,255,.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: .85rem;
  flex-shrink: 0;
}

/* ── PAINEL DIREITO (FORMULÁRIO) ──────────────────────────── */
.auth-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 48px;
  background: #fff;
}

.auth-form-wrap { width: 100%; max-width: 400px; }

.form-header { margin-bottom: 36px; }
.form-header h2 { font-size: 1.75rem; font-weight: 800; color: var(--text-primary); margin-bottom: 8px; }
.form-header p { color: var(--text-secondary); font-size: .95rem; }

.form-icon-header {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, var(--portugal-green), var(--portugal-green-light));
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; color: #fff;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(0,102,0,.25);
}

/* Campos de formulário */
.field-group { margin-bottom: 20px; }
.field-group label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .83rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 7px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrap > i {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: .85rem;
  pointer-events: none;
}
.input-wrap input,
.input-wrap select {
  width: 100%;
  padding: 11px 42px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem;
  color: var(--text-primary);
  background: #fff;
  transition: var(--transition);
  outline: none;
}
.input-wrap input:focus,
.input-wrap select:focus {
  border-color: var(--portugal-green);
  box-shadow: 0 0 0 3px rgba(0,102,0,.12);
}
.input-wrap input::placeholder { color: var(--text-muted); }
.toggle-pw {
  position: absolute;
  right: 12px;
  color: var(--text-muted);
  font-size: .85rem;
  transition: color .2s;
}
.toggle-pw:hover { color: var(--portugal-green); }

.forgot-link { font-size: .8rem; color: var(--portugal-green); font-weight: 500; transition: opacity .2s; }
.forgot-link:hover { opacity: .75; }

.field-row { margin-bottom: 20px; }
.checkbox-label {
  display: flex; align-items: center; gap: 8px;
  font-size: .85rem; color: var(--text-secondary); cursor: pointer;
}
.checkbox-label input[type=checkbox] { accent-color: var(--portugal-green); width: 15px; height: 15px; }

/* Botões */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px;
  background: linear-gradient(135deg, var(--portugal-green), var(--portugal-green-light));
  color: #fff;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 600;
  transition: var(--transition);
  box-shadow: 0 4px 14px rgba(0,102,0,.25);
  white-space: nowrap;
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--portugal-green-dark), var(--portugal-green));
  box-shadow: 0 6px 20px rgba(0,102,0,.35);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-full { width: 100%; }

.btn-outline {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-primary);
  background: #fff;
  transition: var(--transition);
}
.btn-outline:hover {
  border-color: var(--portugal-green);
  color: var(--portugal-green);
  background: rgba(0,102,0,.04);
}

.btn-sm { padding: 6px 14px; font-size: .8rem; }

.back-btn {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text-secondary);
  font-size: .85rem;
  font-weight: 500;
  margin-bottom: 32px;
  transition: color .2s;
}
.back-btn:hover { color: var(--portugal-green); }

/* Divider */
.auth-divider {
  text-align: center;
  margin: 22px 0 14px;
  position: relative;
}
.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%; left: 0;
  width: 100%; height: 1px;
  background: var(--border);
}
.auth-divider span {
  position: relative;
  background: #fff;
  padding: 0 12px;
  font-size: .78rem;
  color: var(--text-muted);
}

.auth-security {
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  font-size: .78rem;
  color: var(--text-muted);
}
.auth-security i { color: var(--portugal-green); }

.demo-badge {
  margin-top: 24px;
  padding: 10px 16px;
  background: rgba(230,168,23,.12);
  border: 1px dashed var(--portugal-gold);
  border-radius: var(--radius);
  font-size: .8rem;
  color: #7a5a00;
  text-align: center;
}
.demo-badge i { margin-right: 4px; }

/* Success state */
.success-state { text-align: center; padding: 20px 0; }
.success-icon {
  font-size: 3.5rem;
  color: var(--portugal-green);
  margin-bottom: 16px;
}
.success-state h3 { font-size: 1.5rem; font-weight: 700; margin-bottom: 10px; }
.success-state p { color: var(--text-secondary); margin-bottom: 28px; line-height: 1.6; }

/* ══════════════════════════════════════════════════════════════
   APP LAYOUT (Dashboard)
══════════════════════════════════════════════════════════════ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 1000;
  transition: width .28s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  min-height: var(--topbar-h);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-emblem {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--portugal-green), var(--portugal-green-light));
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,153,0,.3);
}

.sidebar-brand-text { overflow: hidden; }
.sb-name {
  display: block;
  font-size: .9rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}
.sb-tag {
  display: block;
  font-size: .68rem;
  color: rgba(255,255,255,.5);
  white-space: nowrap;
}

.sidebar-toggle {
  color: var(--text-sidebar);
  font-size: .9rem;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  flex-shrink: 0;
}
.sidebar-toggle:hover { background: var(--bg-sidebar-hover); color: #fff; }

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 14px 10px;
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }

.nav-section-label {
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.3);
  padding: 16px 10px 6px;
  font-weight: 600;
  white-space: nowrap;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text-sidebar);
  font-size: .875rem;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 2px;
  white-space: nowrap;
  position: relative;
}
.nav-item i {
  width: 18px;
  text-align: center;
  font-size: .9rem;
  flex-shrink: 0;
}
.nav-item span:first-of-type { flex: 1; }
.nav-item:hover { background: var(--bg-sidebar-hover); color: #fff; }
.nav-item.active {
  background: var(--bg-sidebar-active);
  color: #4de44d;
  font-weight: 600;
  border-left: 3px solid var(--portugal-green-light);
}

/* Badges nav */
.badge {
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  margin-left: auto;
  flex-shrink: 0;
}
.badge-green { background: rgba(0,153,0,.3); color: #4de44d; }
.badge-orange { background: rgba(230,168,23,.3); color: #f5c842; }
.badge-red    { background: rgba(204,0,0,.35); color: #ff6b6b; }
.badge-blue   { background: rgba(0,102,204,.3); color: #6bb8ff; }

/* User footer */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px;
  border-top: 1px solid rgba(255,255,255,.07);
  background: rgba(0,0,0,.15);
}
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--portugal-red), var(--portugal-red-light));
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.user-info { flex: 1; overflow: hidden; }
.user-name { display: block; font-size: .82rem; font-weight: 600; color: #fff; white-space: nowrap; }
.user-role { display: block; font-size: .7rem; color: rgba(255,255,255,.4); white-space: nowrap; }
.logout-btn {
  color: rgba(255,255,255,.4);
  font-size: .9rem;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  flex-shrink: 0;
}
.logout-btn:hover { color: var(--portugal-red-light); background: rgba(255,255,255,.05); }

/* ── MAIN CONTENT ─────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left .28s cubic-bezier(.4,0,.2,1);
}

/* ── TOPBAR ───────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.topbar-left { display: flex; align-items: center; gap: 16px; }
.mobile-menu-btn { display: none; color: var(--text-secondary); font-size: 1.1rem; padding: 6px; }
.breadcrumb { font-size: .9rem; font-weight: 600; color: var(--text-primary); }

.topbar-right { display: flex; align-items: center; gap: 12px; }

.search-box {
  display: flex; align-items: center;
  background: var(--bg-app);
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  padding: 7px 14px;
  gap: 8px;
  transition: var(--transition);
}
.search-box:focus-within {
  border-color: var(--portugal-green);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0,102,0,.1);
}
.search-box i { color: var(--text-muted); font-size: .85rem; }
.search-box input {
  border: none; background: none; outline: none;
  font-size: .85rem; color: var(--text-primary); width: 200px;
}
.search-box input::placeholder { color: var(--text-muted); }

.icon-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius);
  background: var(--bg-app);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  font-size: .9rem;
  transition: var(--transition);
  position: relative;
}
.icon-btn:hover { background: rgba(0,102,0,.08); color: var(--portugal-green); }
.notif-dot {
  position: absolute;
  top: 7px; right: 7px;
  width: 7px; height: 7px;
  background: var(--portugal-red);
  border-radius: 50%;
  border: 2px solid #fff;
}

.topbar-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--portugal-red), var(--portugal-red-light));
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 700; color: #fff;
  cursor: pointer;
}

/* ── PANELS ───────────────────────────────────────────────── */
.panel { display: none; padding: 28px 28px 40px; animation: fadeIn .25s ease; }
.panel.active { display: block; }

@keyframes fadeIn { from { opacity:0; transform: translateY(6px); } to { opacity:1; transform: translateY(0); } }

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}
.panel-title { font-size: 1.5rem; font-weight: 800; color: var(--text-primary); margin-bottom: 4px; }
.panel-subtitle { font-size: .875rem; color: var(--text-secondary); }
.panel-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── KPI CARDS ────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.kpi-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
}
.kpi-green::before { background: var(--portugal-green); }
.kpi-blue::before  { background: #006699; }
.kpi-red::before   { background: var(--portugal-red); }
.kpi-gold::before  { background: var(--portugal-gold); }

.kpi-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.kpi-green .kpi-icon { background: rgba(0,102,0,.10); color: var(--portugal-green); }
.kpi-blue .kpi-icon  { background: rgba(0,102,153,.10); color: #006699; }
.kpi-red .kpi-icon   { background: rgba(204,0,0,.10); color: var(--portugal-red); }
.kpi-gold .kpi-icon  { background: rgba(230,168,23,.12); color: #a87c00; }

.kpi-info { flex: 1; }
.kpi-value { display: block; font-size: 1.6rem; font-weight: 800; color: var(--text-primary); line-height: 1.2; }
.kpi-label { display: block; font-size: .8rem; color: var(--text-secondary); margin: 4px 0; }
.kpi-delta { display: flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 600; }
.kpi-delta.positive { color: #008000; }
.kpi-delta.negative { color: var(--portugal-red); }

/* ── CARD BASE ────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 22px;
  margin-bottom: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}
.card-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-header h3 i { color: var(--portugal-green); }
.card-link { font-size: .8rem; color: var(--portugal-green); font-weight: 600; }
.card-link:hover { opacity: .75; }
.card-select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: .8rem;
  color: var(--text-secondary);
  cursor: pointer;
  outline: none;
}
.card-header-actions { display: flex; align-items: center; gap: 10px; }

/* ── GRIDS DASHBOARD ─────────────────────────────────────── */
.mid-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.bottom-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

/* ── ATIVIDADE ────────────────────────────────────────────── */
.activity-list { list-style: none; }
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-light);
}
.activity-item:last-child { border-bottom: none; }
.act-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.dot-green  { background: var(--portugal-green); }
.dot-blue   { background: #006699; }
.dot-orange { background: #e6a817; }
.dot-red    { background: var(--portugal-red); }

.act-info { flex: 1; }
.act-info strong { display: block; font-size: .86rem; font-weight: 600; color: var(--text-primary); }
.act-info span   { font-size: .78rem; color: var(--text-secondary); }
.act-time { font-size: .73rem; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }

/* ── PIE CHART LAYOUT ─────────────────────────────────────── */
.chart-legend-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.pie-legend { flex: 1; min-width: 120px; }
.legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: .8rem;
  color: var(--text-secondary);
  padding: 5px 0;
  border-bottom: 1px solid var(--border-light);
}
.legend-item:last-child { border-bottom: none; }
.legend-item strong { color: var(--text-primary); font-weight: 700; }
.leg-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ── TASK LIST ────────────────────────────────────────────── */
.task-list { list-style: none; }
.task-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}
.task-item:last-child { border-bottom: none; }
.task-check { width: 20px; flex-shrink: 0; padding-top: 1px; }
.task-check i { font-size: .9rem; }
.priority-high .task-check i { color: var(--portugal-red); }
.priority-med .task-check i  { color: var(--portugal-gold); }
.priority-low .task-check i  { color: var(--text-muted); }
.task-done .task-check i     { color: var(--portugal-green); }

.task-body { flex: 1; }
.task-name { display: block; font-size: .86rem; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.task-done-text { text-decoration: line-through; opacity: .5; }
.task-meta { font-size: .76rem; color: var(--text-muted); display: flex; gap: 8px; flex-wrap: wrap; }
.task-meta i { color: var(--text-muted); }

/* ── DATA TABLE ───────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  background: var(--bg-app);
  border-bottom: 1px solid var(--border);
}
.data-table th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.data-table th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }
.data-table td {
  padding: 13px 14px;
  font-size: .86rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.data-table tr:hover td { background: rgba(0,102,0,.03); }
.data-table tr:last-child td { border-bottom: none; }

.client-cell { display: flex; align-items: center; gap: 10px; }
.client-av {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.client-cell strong { display: block; font-size: .86rem; font-weight: 600; }
.client-cell small  { display: block; font-size: .75rem; color: var(--text-muted); }

/* Tags */
.tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: .73rem;
  font-weight: 600;
  white-space: nowrap;
}
.tag-blue   { background: #e0f0ff; color: #0066aa; }
.tag-green  { background: #e0f5e0; color: #006600; }
.tag-gold   { background: #fff3d0; color: #7a5a00; }
.tag-purple { background: #f0e6ff; color: #6600aa; }
.tag-red    { background: #ffe6e6; color: #aa0000; }
.tag-orange { background: #fff0e0; color: #885500; }

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: .73rem;
  font-weight: 700;
  white-space: nowrap;
}
.status-active  { background: #e0f5e0; color: #006600; }
.status-pending { background: #fff3d0; color: #7a5a00; }
.status-review  { background: #e0f0ff; color: #0066aa; }
.status-done    { background: #f0f0f0; color: #555; }
.status-alert   { background: #ffe6e6; color: #aa0000; border: 1px solid rgba(170,0,0,.2); }

/* Ações tabela */
.td-actions { display: flex; gap: 6px; }
.act-btn {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  font-size: .78rem;
  transition: var(--transition);
  background: #fff;
}
.act-btn:hover { border-color: var(--portugal-green); color: var(--portugal-green); background: rgba(0,102,0,.05); }
.act-del:hover { border-color: var(--portugal-red); color: var(--portugal-red); background: rgba(204,0,0,.05); }

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  font-size: .8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 10px;
}
.pagination { display: flex; gap: 4px; }
.pg-btn {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .78rem;
  color: var(--text-secondary);
  background: #fff;
  transition: var(--transition);
}
.pg-btn:hover:not(:disabled) { border-color: var(--portugal-green); color: var(--portugal-green); }
.pg-btn.pg-active { background: var(--portugal-green); color: #fff; border-color: var(--portugal-green); }
.pg-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── FILTER ROW ───────────────────────────────────────────── */
.filter-row { display: flex; gap: 12px; flex-wrap: wrap; width: 100%; }
.search-inline {
  padding: 7px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .84rem;
  outline: none;
  transition: var(--transition);
  color: var(--text-primary);
}
.search-inline:focus { border-color: var(--portugal-green); box-shadow: 0 0 0 3px rgba(0,102,0,.1); }
.search-inline.wide { flex: 1; min-width: 200px; }

/* ── KANBAN ───────────────────────────────────────────────── */
.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 20px;
}
.kanban-col {
  min-width: 230px;
  flex-shrink: 0;
}
.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #fff;
  border-radius: var(--radius) var(--radius) 0 0;
  border-top: 3px solid;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  font-size: .84rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0;
}
.kn-count {
  background: var(--bg-app);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: .72rem;
  color: var(--text-secondary);
}
.kanban-card {
  background: #fff;
  border: 1px solid var(--border);
  border-top: none;
  padding: 14px;
  margin-bottom: 8px;
  transition: var(--transition);
  cursor: pointer;
}
.kanban-card:last-child { border-radius: 0 0 var(--radius) var(--radius); border-bottom: 1px solid var(--border); }
.kanban-card:first-of-type { border-top: 1px solid var(--border); }
.kanban-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); z-index: 2; position: relative; }
.kn-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.kn-id { font-size: .72rem; color: var(--text-muted); }
.kanban-card strong { display: block; font-size: .86rem; font-weight: 700; margin-bottom: 4px; }
.kanban-card p { font-size: .78rem; color: var(--text-secondary); margin-bottom: 10px; }
.kn-footer { display: flex; align-items: center; justify-content: space-between; font-size: .75rem; color: var(--text-muted); }
.kn-date { padding: 2px 7px; background: var(--bg-app); border-radius: var(--radius-sm); }
.kn-urgent { background: rgba(204,0,0,.1); color: var(--portugal-red); font-weight: 700; }
.done-card { opacity: .7; }

/* ── DOCUMENTOS ───────────────────────────────────────────── */
.doc-layout { display: grid; grid-template-columns: 200px 1fr; gap: 20px; }
.doc-sidebar-tree { padding: 18px 14px; }
.doc-tree-header { font-size: .8rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 12px; }
.doc-tree { list-style: none; }
.doc-tree-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: .84rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 2px;
}
.doc-tree-item i { color: var(--portugal-gold); font-size: .85rem; }
.doc-tree-item:hover { background: var(--bg-app); color: var(--text-primary); }
.doc-tree-item.active { background: rgba(0,102,0,.08); color: var(--portugal-green); font-weight: 600; }
.doc-tree-item.sub { padding-left: 24px; font-size: .8rem; }

.doc-main { padding: 0; }
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.doc-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}
.doc-card:hover { border-color: var(--portugal-green); background: rgba(0,102,0,.03); transform: translateY(-2px); }
.doc-icon { font-size: 2.2rem; margin-bottom: 10px; }
.doc-icon.pdf  i { color: #cc0000; }
.doc-icon.img  i { color: #0066aa; }
.doc-icon.word i { color: #003399; }
.doc-icon.xls  i { color: #006600; }
.doc-name { font-size: .78rem; font-weight: 600; color: var(--text-primary); word-break: break-all; margin-bottom: 4px; }
.doc-meta { font-size: .7rem; color: var(--text-muted); }

/* ── AGENDA ───────────────────────────────────────────────── */
.agenda-layout { display: grid; gap: 20px; }
.event-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
}
.event-item:last-child { border-bottom: none; }
.event-today { background: rgba(0,102,0,.04); border-radius: var(--radius); padding: 16px; margin: -4px; }
.event-time-col { text-align: center; min-width: 44px; flex-shrink: 0; }
.event-day { display: block; font-size: 1.4rem; font-weight: 800; color: var(--text-primary); line-height: 1; }
.event-month { display: block; font-size: .7rem; text-transform: uppercase; color: var(--text-muted); letter-spacing: .05em; }
.event-body { flex: 1; }
.event-title { display: block; font-size: .9rem; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.event-detail { display: block; font-size: .78rem; color: var(--text-muted); margin-bottom: 3px; }
.event-detail i { margin-right: 4px; }
.event-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.badge-red    { background: #ffe6e6; color: #aa0000; }
.badge-orange { background: #fff3d0; color: #7a5a00; }
.badge-blue   { background: #e0f0ff; color: #0066aa; }
.badge-green  { background: #e0f5e0; color: #006600; }

/* ── FINANCEIRO ───────────────────────────────────────────── */
.val-pos { color: #006600; font-weight: 700; }
.val-neg { color: var(--portugal-red); font-weight: 700; }

/* ── COLABORADORES ────────────────────────────────────────── */
.collab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.collab-card {
  text-align: center;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}
.collab-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.collab-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 800; color: #fff;
  margin-bottom: 8px;
  box-shadow: var(--shadow-md);
}
.collab-card strong { font-size: 1rem; font-weight: 700; }
.collab-role { font-size: .8rem; color: var(--portugal-green); font-weight: 600; }
.collab-meta { font-size: .78rem; color: var(--text-secondary); display: flex; align-items: center; gap: 5px; }
.collab-actions { display: flex; gap: 8px; margin-top: 8px; }

/* ── SETTINGS ─────────────────────────────────────────────── */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.settings-section h3 { font-size: 1rem; font-weight: 700; margin-bottom: 18px; display: flex; align-items: center; gap: 8px; }
.settings-section h3 i { color: var(--portugal-green); }
.settings-form { display: flex; flex-direction: column; gap: 16px; }
.notif-options { display: flex; flex-direction: column; gap: 14px; }
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .88rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-light);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-switch {
  width: 42px; height: 24px;
  background: var(--border);
  border-radius: 12px;
  position: relative;
  transition: background .2s;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle-switch.active { background: var(--portugal-green); }
.toggle-knob {
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: left .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.toggle-switch.active .toggle-knob { left: 18px; }

/* ── COMING SOON ──────────────────────────────────────────── */
.coming-soon-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 40px;
  gap: 16px;
}
.coming-soon-panel > i { font-size: 3.5rem; color: var(--portugal-green); opacity: .4; }
.coming-soon-panel h3 { font-size: 1.3rem; font-weight: 700; color: var(--text-primary); }
.coming-soon-panel p { color: var(--text-secondary); max-width: 400px; font-size: .9rem; line-height: 1.7; }
.cs-badge {
  display: inline-block;
  padding: 6px 18px;
  background: rgba(230,168,23,.12);
  border: 1px solid rgba(230,168,23,.3);
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 700;
  color: #7a5a00;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .mid-grid { grid-template-columns: 1fr; }
  .bottom-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-form-panel { padding: 40px 24px; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .mobile-menu-btn { display: flex; }
  .search-box input { width: 140px; }
}

@media (max-width: 600px) {
  .panel { padding: 18px; }
  .kpi-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 14px; }
  .topbar-right .search-box { display: none; }
  .kanban-board { gap: 10px; }
  .kanban-col { min-width: 200px; }
  .doc-layout { grid-template-columns: 1fr; }
  .collab-grid { grid-template-columns: 1fr; }
}

/* Overlay mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 999;
}
.sidebar-overlay.active { display: block; }
