/* CredSolar — tema (verde + laranja da logo) */
:root {
  --cs-green: #1e8a3c;
  --cs-green-dark: #14642b;
  --cs-orange: #f5821f;
  --cs-orange-dark: #d96c0e;
  --cs-bg: #f4f6f5;
  --cs-card: #ffffff;
  --cs-text: #233027;
  --cs-muted: #7a8a7f;
}

html, body { height: 100%; }
body {
  background: var(--cs-bg);
  color: var(--cs-text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

.layout { display: flex; min-height: 100vh; }

/* -------- sidebar -------- */
.sidebar {
  width: 250px; min-width: 250px;
  background: linear-gradient(180deg, #0a2530 0%, #0f3441 100%);
  color: #fff;
  display: flex; flex-direction: column;
  padding: 18px 12px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; justify-content: center; padding: 4px 6px 18px; }
.brand-logo-full { width: 100%; max-width: 84px; display: block; background: transparent; }
.brand-logo { width: 52px; height: 52px; }
.brand-cred { color: #fff; font-family: 'Baloo 2', system-ui, sans-serif; font-weight: 700; font-size: 1.35rem; }
.brand-solar { color: var(--cs-orange); font-family: 'Baloo 2', system-ui, sans-serif; font-weight: 700; font-size: 1.35rem; }
.brand-sub { font-family: 'Baloo 2', system-ui, sans-serif; font-weight: 500; font-size: .58rem; letter-spacing: .04em; color: #cfe8d6; text-transform: uppercase; }
.sidebar .nav-link {
  color: #e3f2e8; border-radius: 8px; padding: 9px 12px; margin-bottom: 2px;
  font-size: .92rem;
}
.sidebar .nav-link:hover { background: rgba(255,255,255,.12); color: #fff; }
.sidebar .nav-link.active { background: var(--cs-orange); color: #fff; font-weight: 600; }
.sidebar-footer { margin-top: auto; padding: 10px 8px 0; }
.user-chip { background: rgba(255,255,255,.1); border-radius: 10px; padding: 8px 10px; }
.user-name { font-size: .85rem; font-weight: 600; }
.user-role { font-size: .7rem; color: #cfe8d6; }

/* -------- conteúdo -------- */
.content { flex: 1; padding: 24px 28px; max-width: 1500px; }
.page-title { font-weight: 700; margin-bottom: 4px; }
.page-sub { color: var(--cs-muted); font-size: .9rem; margin-bottom: 20px; }

.card { border: none; border-radius: 14px; box-shadow: 0 1px 4px rgba(20,40,25,.08); }
.card .card-header { background: transparent; border-bottom: 1px solid #eef1ef; font-weight: 600; }

.kpi { display: flex; align-items: center; gap: 12px; padding: 16px; }
.kpi-icon { font-size: 1.6rem; width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; background: #e9f5ed; }
.kpi-icon.orange { background: #fdeede; }
.kpi-label { font-size: .78rem; color: var(--cs-muted); }
.kpi-value { font-size: 1.25rem; font-weight: 700; line-height: 1.1; }

.badge-status { font-size: .72rem; padding: .35em .7em; border-radius: 20px; }
.st-NORMAL { background: #d8f3e0; color: #14642b; }
.st-OFFLINE { background: #ffe1cc; color: #b35408; }
.st-PARCIALMENTE_OFFLINE { background: #cfe6ff; color: #1b5e9e; }
.st-ALARME { background: #ffd6d6; color: #a31212; }
.st-SEM_COMUNICACAO { background: #f0d9e8; color: #87356a; }
.st-PENDENTE { background: #fff3cd; color: #856404; }
.st-PAGO { background: #d8f3e0; color: #14642b; }
.st-ATRASADO { background: #ffd6d6; color: #a31212; }
.st-CANCELADO { background: #e2e3e5; color: #555; }
.st-ABERTO { background: #ffe1cc; color: #b35408; }
.st-EM_ANDAMENTO { background: #cfe6ff; color: #1b5e9e; }
.st-RESOLVIDO { background: #d8f3e0; color: #14642b; }

.btn-cs { background: var(--cs-green); color: #fff; border: none; }
.btn-cs:hover { background: var(--cs-green-dark); color: #fff; }
.btn-cs-orange { background: var(--cs-orange); color: #fff; border: none; }
.btn-cs-orange:hover { background: var(--cs-orange-dark); color: #fff; }

.table > :not(caption) > * > * { padding: .65rem .75rem; }
.table thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .03em;
  color: var(--cs-muted); border-bottom: 2px solid #eef1ef; }

.perf-up { color: #14642b; font-weight: 600; }
.perf-down { color: #a31212; font-weight: 600; }

/* kanban negócios */
.kanban { display: flex; gap: 14px; overflow-x: auto; align-items: flex-start; }
.kanban-col { background: #eef2ef; border-radius: 12px; padding: 10px; min-width: 230px; flex: 1; }
.kanban-col h6 { font-size: .8rem; text-transform: uppercase; color: var(--cs-muted); padding: 4px 6px; }
.kanban-card { background: #fff; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(20,40,25,.1); font-size: .85rem; }

/* timeline */
.tl { list-style: none; padding-left: 0; }
.tl li { position: relative; padding: 0 0 18px 26px; border-left: 2px solid #d8e5dc; margin-left: 8px; }
.tl li::before { content: ""; position: absolute; left: -7px; top: 2px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--cs-orange); }
.tl .tl-time { font-size: .72rem; color: var(--cs-muted); }

/* login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #14642b 0%, #1e8a3c 55%, #f5821f 140%); }
.login-card { background: #fff; border-radius: 18px; padding: 38px 34px; width: 100%;
  max-width: 410px; box-shadow: 0 18px 50px rgba(0,0,0,.25); }
.login-logo { width: 180px; max-width: 70%; display: block; margin: 0 auto 6px; }
.login-logo-full { width: 180px; max-width: 60%; display: block; margin: 4px auto 20px; }
.cs-wordmark { font-family: 'Baloo 2', system-ui, sans-serif; font-weight: 700; font-size: 2.1rem; line-height: 1; }
.cs-tagline { font-family: 'Baloo 2', system-ui, sans-serif; font-weight: 500; font-size: .72rem;
  letter-spacing: .04em; color: #1e8a3c; }

@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; min-width: 0; height: auto; position: static; }
  .content { padding: 16px; }
}

/* -------- portal do associado (visual suave) -------- */
.portal .page-title { font-weight: 600; font-size: 1.45rem; letter-spacing: -.2px; }
.portal .page-sub { margin-bottom: 2px; }
.portal .section-label {
  display: flex; align-items: center; gap: 12px;
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em;
  color: var(--cs-muted); margin: 30px 2px 14px;
}
.portal .section-label::after { content: ""; flex: 1; height: 1px; background: #e7ece8; }
.portal .card { border: 1px solid #eef2ef; border-radius: 16px; box-shadow: 0 1px 3px rgba(20,40,25,.045); }
.portal .card-header { background: transparent; border-bottom: 1px solid #f0f3f1;
  font-weight: 600; font-size: .95rem; color: var(--cs-text); padding: 15px 18px; }
.portal .card-body { padding: 16px 18px; }
.portal .kpi { padding: 18px; gap: 14px; }
.portal .kpi-icon { background: #eef6f0; }
.portal .kpi-icon.orange { background: #fdf0e2; }
.portal .kpi-label { font-weight: 500; font-size: .75rem; }
.portal .kpi-value { font-weight: 600; font-size: 1.3rem; color: var(--cs-green-dark); }
.portal .fin-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 700px) { .portal .fin-grid { grid-template-columns: repeat(2, 1fr); } }
.portal .fin-item { background: #f8faf9; border: 1px solid #eef2ef; border-radius: 12px; padding: 14px 16px; }
.portal .fin-item .kpi-value { font-size: 1.4rem; }
.portal .table { font-size: .9rem; }
.portal .table thead th { font-weight: 600; }
.portal .table td { font-weight: 400; vertical-align: middle; }
.portal .sust-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 700px) { .portal .sust-row { grid-template-columns: 1fr; } }
.portal .sust-item { display: flex; align-items: center; gap: 12px; }
.portal .sust-emoji { font-size: 1.7rem; width: 52px; height: 52px; border-radius: 14px;
  background: #eef6f0; display: flex; align-items: center; justify-content: center; }
.portal .sust-val { font-weight: 600; font-size: 1.15rem; color: var(--cs-green-dark); line-height: 1.1; }
