/* ═══════════════════════════════════════════════════════════
   Clivus SST — Plataforma (Login + Painéis)  app.css
   ═══════════════════════════════════════════════════════════ */
:root {
  --navy:        #1B3A5C;
  --navy-dark:   #112843;
  --navy-light:  #2166A8;
  --green:       #2E8B3F;
  --green-light: #3DA851;
  --green-pale:  #E8F5EB;
  --blue-pale:   #EBF2FA;
  --amber:       #F59E0B;
  --amber-pale:  #FEF3C7;
  --red:         #DC2626;
  --red-pale:    #FEE2E2;
  --gray:        #6B7280;
  --gray-2:      #9CA3AF;
  --gray-light:  #F3F4F6;
  --white:       #FFFFFF;
  --text:        #1F2937;
  --border:      #E5E7EB;
  --shadow:      0 4px 24px rgba(27,58,92,0.10);
  --shadow-lg:   0 12px 48px rgba(27,58,92,0.16);
  --radius:      16px;
}

* , *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; color: var(--text); line-height: 1.6; background: var(--gray-light); }
a { text-decoration: none; color: inherit; }

/* ═══ BOTÕES ═══ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 10px; font-weight: 600; font-size: 0.9rem;
  border: none; cursor: pointer; font-family: 'Inter', sans-serif; transition: all 0.2s;
}
.btn-primary { background: var(--green); color: var(--white); }
.btn-primary:hover { background: var(--green-light); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(46,139,63,0.35); }
.btn-navy { background: var(--navy); color: var(--white); }
.btn-navy:hover { background: var(--navy-dark); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--navy); color: var(--navy); }
.btn-ghost { background: var(--gray-light); color: var(--text); }
.btn-ghost:hover { background: #E5E7EB; }
.btn-sm { padding: 7px 14px; font-size: 0.8rem; border-radius: 8px; }
.btn-lg { padding: 14px 30px; font-size: 0.95rem; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-danger { background: var(--red); color: var(--white); }
.btn-danger:hover { background: #B91C1C; }

/* ═══ LOGIN ═══ */
.login-page {
  min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr;
}
.login-aside {
  background: linear-gradient(140deg, var(--navy-dark) 0%, var(--navy) 55%, #1A4D7C 100%);
  color: var(--white); padding: 56px 60px; position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
}
.login-aside::before {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 50px 50px;
}
.login-aside-glow {
  position: absolute; top: -10%; right: -10%; width: 500px; height: 500px;
  border-radius: 50%; background: radial-gradient(circle, rgba(46,139,63,0.20) 0%, transparent 65%);
}
.login-aside > * { position: relative; z-index: 1; }
.login-aside .logo img { height: 44px; filter: brightness(0) invert(1); }
.login-aside h1 { font-size: 2.2rem; font-weight: 800; line-height: 1.2; margin: 24px 0 16px; }
.login-aside h1 em { color: #82DDA0; font-style: normal; }
.login-aside p.lead { color: rgba(255,255,255,0.72); font-size: 1.05rem; max-width: 440px; }
.login-aside-features { list-style: none; margin-top: 36px; display: flex; flex-direction: column; gap: 16px; }
.login-aside-features li { display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,0.88); font-size: 0.95rem; }
.login-aside-features .ic {
  width: 36px; height: 36px; border-radius: 10px; background: rgba(46,139,63,0.2);
  border: 1px solid rgba(46,139,63,0.35); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.login-aside-features .ic svg { width: 18px; height: 18px; stroke: #82DDA0; }
.login-aside-foot { color: rgba(255,255,255,0.45); font-size: 0.82rem; }

.login-main { display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--white); }
.login-box { width: 100%; max-width: 420px; }
.login-box h2 { font-size: 1.7rem; font-weight: 800; color: var(--navy); margin-bottom: 6px; }
.login-box .sub { color: var(--gray); font-size: 0.95rem; margin-bottom: 28px; }

/* Persona selector */
.persona-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 24px; }
.persona-opt {
  border: 1.5px solid var(--border); border-radius: 12px; padding: 14px 12px;
  cursor: pointer; text-align: center; transition: all 0.2s; background: var(--white);
}
.persona-opt:hover { border-color: var(--navy-light); }
.persona-opt.active { border-color: var(--green); background: var(--green-pale); }
.persona-opt .p-ic {
  width: 40px; height: 40px; border-radius: 11px; margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center; background: var(--blue-pale);
  transition: background 0.2s;
}
.persona-opt.active .p-ic { background: var(--white); }
.persona-opt .p-ic svg { width: 20px; height: 20px; }
.persona-opt strong { display: block; font-size: 0.85rem; color: var(--navy); font-weight: 700; }
.persona-opt small { font-size: 0.72rem; color: var(--gray-2); }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 6px; }
.field input {
  width: 100%; padding: 12px 15px; border: 1.5px solid var(--border); border-radius: 10px;
  font-family: 'Inter', sans-serif; font-size: 0.92rem; background: #FAFAFA; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus { border-color: var(--green); background: var(--white); box-shadow: 0 0 0 3px rgba(46,139,63,0.1); }
.login-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; font-size: 0.84rem; }
.login-row a { color: var(--green); font-weight: 600; }
.login-error { background: var(--red-pale); color: var(--red); padding: 10px 14px; border-radius: 9px; font-size: 0.85rem; margin-bottom: 16px; display: none; }
.login-error.show { display: block; }
.login-foot { text-align: center; margin-top: 22px; font-size: 0.88rem; color: var(--gray); }
.login-foot a { color: var(--green); font-weight: 600; }

.demo-hint {
  margin-top: 24px; background: var(--blue-pale); border: 1px solid #D6E4F5;
  border-radius: 11px; padding: 14px 16px; font-size: 0.8rem; color: var(--navy);
}
.demo-hint strong { display: block; margin-bottom: 4px; }
.demo-hint code { background: var(--white); padding: 1px 6px; border-radius: 4px; font-size: 0.78rem; }

/* ═══ LAYOUT PAINEL ═══ */
.app { display: grid; grid-template-columns: 256px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--navy-dark); color: rgba(255,255,255,0.7);
  padding: 22px 18px; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sidebar-logo { padding: 4px 8px 22px; border-bottom: 1px solid rgba(255,255,255,0.08); margin-bottom: 18px; }
.sidebar-logo img { height: 34px; filter: brightness(0) invert(1); }
.sidebar-role {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px;
  color: var(--gray-2); padding: 0 10px 10px;
}
.nav-menu { list-style: none; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav-menu a {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 9px;
  color: rgba(255,255,255,0.7); font-size: 0.9rem; font-weight: 500; transition: all 0.18s; cursor: pointer;
}
.nav-menu a:hover { background: rgba(255,255,255,0.06); color: var(--white); }
.nav-menu a.active { background: var(--green); color: var(--white); }
.nav-menu a svg { width: 19px; height: 19px; flex-shrink: 0; }
.nav-menu .nav-sep { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 1px; color: var(--gray-2); padding: 16px 12px 6px; }

.sidebar-user {
  border-top: 1px solid rgba(255,255,255,0.08); padding-top: 16px; margin-top: 12px;
  display: flex; align-items: center; gap: 11px;
}
.sidebar-user .avatar {
  width: 40px; height: 40px; border-radius: 10px; background: var(--green);
  color: var(--white); font-weight: 700; font-size: 0.9rem; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-user .info { flex: 1; min-width: 0; }
.sidebar-user .info strong { display: block; color: var(--white); font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .info small { font-size: 0.75rem; color: var(--gray-2); }
.sidebar-user .logout { color: var(--gray-2); cursor: pointer; padding: 6px; border-radius: 8px; transition: all 0.2s; }
.sidebar-user .logout:hover { background: rgba(255,255,255,0.08); color: var(--white); }
.sidebar-user .logout svg { width: 18px; height: 18px; display: block; }

/* Conteúdo */
.main { display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  background: var(--white); border-bottom: 1px solid var(--border);
  padding: 0 32px; height: 68px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.topbar h1 { font-size: 1.3rem; font-weight: 800; color: var(--navy); }
.topbar .topbar-sub { font-size: 0.82rem; color: var(--gray); font-weight: 400; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-icon {
  width: 40px; height: 40px; border-radius: 10px; background: var(--gray-light);
  display: flex; align-items: center; justify-content: center; cursor: pointer; position: relative; transition: background 0.2s;
}
.topbar-icon:hover { background: #E5E7EB; }
.topbar-icon svg { width: 19px; height: 19px; stroke: var(--gray); }
.topbar-icon .dot { position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; background: var(--red); border-radius: 50%; border: 2px solid var(--white); }

.mobile-toggle { display: none; width: 40px; height: 40px; border-radius: 10px; background: var(--gray-light); border: none; cursor: pointer; align-items: center; justify-content: center; }
.mobile-toggle svg { width: 20px; height: 20px; }

.content { padding: 32px; flex: 1; }

/* Page heading inside content */
.page-head { margin-bottom: 24px; }
.page-head h2 { font-size: 1.4rem; font-weight: 800; color: var(--navy); margin-bottom: 4px; }
.page-head p { color: var(--gray); font-size: 0.92rem; }

/* ═══ COMPONENTES ═══ */
.cards-row { display: grid; gap: 18px; margin-bottom: 26px; }
.cards-4 { grid-template-columns: repeat(4, 1fr); }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.cards-2 { grid-template-columns: repeat(2, 1fr); }

.stat {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; display: flex; flex-direction: column; gap: 4px;
}
.stat .stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat .stat-ic { width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center; }
.stat .stat-ic svg { width: 21px; height: 21px; }
.stat-ic.green { background: var(--green-pale); } .stat-ic.green svg { stroke: var(--green); }
.stat-ic.blue { background: var(--blue-pale); } .stat-ic.blue svg { stroke: var(--navy-light); }
.stat-ic.amber { background: var(--amber-pale); } .stat-ic.amber svg { stroke: var(--amber); }
.stat-ic.red { background: var(--red-pale); } .stat-ic.red svg { stroke: var(--red); }
.stat .num { font-size: 1.9rem; font-weight: 800; color: var(--navy); line-height: 1.1; }
.stat .label { font-size: 0.85rem; color: var(--gray); }
.stat .trend { font-size: 0.78rem; font-weight: 600; }
.trend.up { color: var(--green); } .trend.down { color: var(--red); }

.panel {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; margin-bottom: 24px;
}
.panel-head { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-head h3 { font-size: 1.05rem; font-weight: 700; color: var(--navy); }
.panel-head p { font-size: 0.82rem; color: var(--gray); }
.panel-body { padding: 24px; }
.panel-body.flush { padding: 0; }

/* Tabela */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; padding: 13px 24px; font-size: 0.74rem; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--gray-2); font-weight: 700; background: #FBFBFC; border-bottom: 1px solid var(--border);
}
.table td { padding: 15px 24px; font-size: 0.88rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #FBFCFD; }
.table .strong { font-weight: 600; color: var(--navy); }
.table .muted { color: var(--gray); font-size: 0.82rem; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 100px; font-size: 0.74rem; font-weight: 700; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.green { background: var(--green-pale); color: var(--green); }
.badge.blue { background: var(--blue-pale); color: var(--navy-light); }
.badge.amber { background: var(--amber-pale); color: #B45309; }
.badge.red { background: var(--red-pale); color: var(--red); }
.badge.gray { background: var(--gray-light); color: var(--gray); }
.badge-plain::before { display: none; }

/* Progress */
.progress { height: 7px; background: var(--gray-light); border-radius: 100px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--green); border-radius: 100px; }

/* Timeline */
.timeline { list-style: none; position: relative; padding-left: 6px; }
.timeline li { position: relative; padding: 0 0 22px 28px; }
.timeline li::before {
  content: ''; position: absolute; left: 0; top: 3px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--white); border: 3px solid var(--border); z-index: 1;
}
.timeline li::after { content: ''; position: absolute; left: 6px; top: 14px; bottom: -3px; width: 2px; background: var(--border); }
.timeline li:last-child::after { display: none; }
.timeline li.done::before { background: var(--green); border-color: var(--green); }
.timeline li.active::before { background: var(--white); border-color: var(--green); box-shadow: 0 0 0 4px var(--green-pale); }
.timeline li .tl-title { font-weight: 600; font-size: 0.9rem; color: var(--navy); }
.timeline li .tl-meta { font-size: 0.78rem; color: var(--gray); }

/* List items (demandas / docs) */
.list-item { display: flex; align-items: center; gap: 14px; padding: 16px 24px; border-bottom: 1px solid var(--border); transition: background 0.15s; }
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: #FBFCFD; }
.list-item .li-ic { width: 44px; height: 44px; border-radius: 11px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.li-ic.green { background: var(--green-pale); } .li-ic.green svg { stroke: var(--green); }
.li-ic.blue { background: var(--blue-pale); } .li-ic.blue svg { stroke: var(--navy-light); }
.li-ic.amber { background: var(--amber-pale); } .li-ic.amber svg { stroke: var(--amber); }
.list-item .li-ic svg { width: 21px; height: 21px; }
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-main strong { display: block; font-size: 0.9rem; color: var(--navy); font-weight: 600; }
.list-item .li-main small { font-size: 0.8rem; color: var(--gray); }
.list-item .li-side { text-align: right; flex-shrink: 0; }

/* Two-col content layout */
.split { display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px; align-items: start; }

/* Empty / info banner */
.banner { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: 12px; font-size: 0.88rem; }
.banner.info { background: var(--blue-pale); color: var(--navy); }
.banner.warn { background: var(--amber-pale); color: #92400E; }
.banner.success { background: var(--green-pale); color: #166534; }
.banner svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; }

/* Avatar list */
.mini-avatar { width: 34px; height: 34px; border-radius: 8px; background: var(--navy); color: var(--white); display: inline-flex; align-items: center; justify-content: center; font-size: 0.78rem; font-weight: 700; }

/* Rating stars */
.rating { color: var(--amber); font-size: 0.85rem; }

/* ═══ MANUAL ═══ */
.manual-layout { display: grid; grid-template-columns: 280px 1fr; max-width: 1240px; margin: 0 auto; gap: 0; }
.manual-toc {
  position: sticky; top: 90px; align-self: start; height: calc(100vh - 110px); overflow-y: auto;
  padding: 24px 20px; border-right: 1px solid var(--border);
}
.manual-toc h4 { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1px; color: var(--gray-2); margin-bottom: 12px; }
.manual-toc ul { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.manual-toc ul li a { display: block; padding: 8px 12px; border-radius: 8px; font-size: 0.86rem; color: var(--gray); transition: all 0.18s; }
.manual-toc ul li a:hover { background: var(--gray-light); color: var(--navy); }
.manual-toc ul li a.active { background: var(--green-pale); color: var(--green); font-weight: 600; }
.manual-content { padding: 40px 48px; max-width: 820px; }
.manual-content section { margin-bottom: 52px; scroll-margin-top: 90px; }
.manual-content h2 { font-size: 1.6rem; font-weight: 800; color: var(--navy); margin-bottom: 8px; padding-bottom: 12px; border-bottom: 2px solid var(--green-pale); }
.manual-content h3 { font-size: 1.15rem; font-weight: 700; color: var(--navy); margin: 28px 0 12px; }
.manual-content p { color: var(--text); font-size: 0.95rem; margin-bottom: 14px; }
.manual-content ul, .manual-content ol { margin: 0 0 16px 22px; }
.manual-content li { font-size: 0.95rem; margin-bottom: 8px; }
.manual-content .step-num {
  display: inline-flex; width: 26px; height: 26px; border-radius: 8px; background: var(--green);
  color: var(--white); font-weight: 700; font-size: 0.82rem; align-items: center; justify-content: center; margin-right: 8px;
}
.manual-content .callout { padding: 16px 20px; border-radius: 12px; margin: 18px 0; font-size: 0.9rem; }
.manual-content .callout.tip { background: var(--green-pale); border-left: 4px solid var(--green); }
.manual-content .callout.warn { background: var(--amber-pale); border-left: 4px solid var(--amber); }
.manual-content .callout.rule { background: var(--blue-pale); border-left: 4px solid var(--navy-light); }
.manual-content .callout strong { display: block; margin-bottom: 4px; }
.manual-content table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 0.88rem; }
.manual-content table th { background: var(--navy); color: var(--white); padding: 11px 14px; text-align: left; font-size: 0.8rem; }
.manual-content table th:first-child { border-radius: 8px 0 0 0; }
.manual-content table th:last-child { border-radius: 0 8px 0 0; }
.manual-content table td { padding: 11px 14px; border-bottom: 1px solid var(--border); }

.manual-topbar {
  position: sticky; top: 0; z-index: 100; background: var(--white); border-bottom: 1px solid var(--border);
  height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 32px;
}
.manual-topbar .logo img { height: 36px; }
.manual-hero {
  background: linear-gradient(140deg, var(--navy-dark) 0%, var(--navy) 100%); color: var(--white);
  padding: 56px 48px; text-align: center;
}
.manual-hero .tag { display: inline-block; background: rgba(46,139,63,0.2); border: 1px solid rgba(46,139,63,0.35); color: #82DDA0; padding: 5px 14px; border-radius: 100px; font-size: 0.78rem; font-weight: 600; margin-bottom: 14px; }
.manual-hero h1 { font-size: 2.2rem; font-weight: 800; margin-bottom: 10px; }
.manual-hero p { color: rgba(255,255,255,0.7); max-width: 560px; margin: 0 auto; }

/* ═══ RESPONSIVO ═══ */
@media (max-width: 980px) {
  .login-page { grid-template-columns: 1fr; }
  .login-aside { display: none; }
  .cards-4 { grid-template-columns: repeat(2, 1fr); }
  .cards-3 { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .manual-layout { grid-template-columns: 1fr; }
  .manual-toc { display: none; }
  .manual-content { padding: 28px 22px; }
}
@media (max-width: 768px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 256px; z-index: 200;
    transform: translateX(-100%); transition: transform 0.3s; height: 100vh;
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 150; }
  .sidebar-backdrop.show { display: block; }
  .mobile-toggle { display: flex; }
  .content { padding: 20px; }
  .cards-4, .cards-2 { grid-template-columns: 1fr; }
  .topbar { padding: 0 18px; }
  .table-wrap { overflow-x: auto; }
  .persona-grid { grid-template-columns: 1fr 1fr; }
}
