:root{
  --bg:#0b0f0d;
  --text:#EBEFE3;
  --muted:rgba(235,239,227,.78);
  --olive:#6b8f3a;
  --olive2:#3b5b22;
  --shadow: 0 18px 60px rgba(0,0,0,.45);
  --radius:18px;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  --border:rgba(255,255,255,.14);
  --card1:rgba(255,255,255,.06);
  --card2:rgba(255,255,255,.03);
  --inputBg:rgba(0,0,0,.22);
  --btnBg:rgba(255,255,255,.04);
  --btnBorder:rgba(255,255,255,.14);
  --accent:#6b8f3a;
  --accent2:#2F3B1C;
}
*{box-sizing:border-box}
html,body{
  margin:0;
  font-family:var(--sans);
  color:var(--text);
  background-color: var(--bg);
  background-image: linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,.85));
  background-repeat: no-repeat;
  background-attachment: scroll;
  line-height:1.55;
  display:flex;
  flex-direction:column;
}
body{
  margin:0;
  font-family:var(--sans);
  color:var(--text);
  background-color: var(--bg);
  background-image: linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,.85));
  background-repeat: no-repeat;
  background-attachment: scroll;
  line-height:1.55;
  display:flex;
  flex-direction:column;
}
a{color:inherit;text-decoration:none}
.container{width:min(980px, 100%); margin:0 auto; padding: 0 16px}
.main{flex:1; width:100%; padding:16px}

/* HEADER */
.topbar{
  position:sticky; top:0; z-index:50;
  backdrop-filter: blur(14px);
  background: rgba(11,15,13,.62);
  border-bottom: 1px solid rgba(255,255,255,.10);
}
.topbar-row{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding: 12px 0;
}
.brand{
  display:flex; align-items:center; gap:10px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 999px;
  background: rgba(255,255,255,.03);
}
.brandLogo{
  width:42px; height:42px; border-radius:14px;
  border: 1px solid var(--btnBorder);
  background: var(--btnBg);
  object-fit: contain;
  padding: 7px;
}
.brandText strong{font-weight:900; letter-spacing:.2px}
.brandText small{display:block; font-size:12px; color:var(--muted); margin-top:1px}
.menuBtn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(107,143,58,.18), rgba(59,91,34,.08));
  font-weight: 900;
  cursor:pointer;
  color: var(--text);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.menuBtn span{letter-spacing:.12em}

/* NAV */
.mobileNav{display:none; padding: 0 0 12px}
.mobileNav.open{display:grid; gap:10px}
.mobileNav a{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  padding: 14px 14px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  background: rgba(255,255,255,.03);
  color: var(--muted);
  font-weight: 900;
  text-align:left;
}
.mobileNav a:hover{color:var(--text); border-color: rgba(255,255,255,.22)}

/* FOOTER */
.footer{margin-top:auto; padding: 18px 0 26px; color: rgba(255,255,255,.55); font-size: 12px;}
.footer-inner{
  display:flex;
  justify-content:center;
  border-top: 1px solid rgba(255,255,255,.10);
  padding-top: 14px;
  text-align:center;
}

/* CARDS */
.card{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--card1), var(--card2));
  box-shadow: var(--shadow);
  padding: 14px;
  margin: 12px 0;
  max-width:100%;
}
.row{display:flex;gap:12px;flex-wrap:wrap}
.col{flex:1;min-width:240px;max-width:100%}
.h1{font-size:22px;margin:8px 0 4px}
.muted{color:var(--muted)}
.small{font-size:13px}

/* CONTROLS 100% */
.input, textarea, select{
  width:100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--inputBg);
  color: var(--text);
  outline:none;
  font-family: var(--sans);
}
textarea{min-height:120px; resize:vertical}
.input:focus, select:focus, textarea:focus{border-color: rgba(107,143,58,.60)}

.btn{
  display:flex;
  width:100%;
  justify-content:center;
  align-items:center;
  gap:10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--btnBg);
  font-weight:900;
  cursor:pointer;
}
.btn:hover{background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.25)}
.btn-primary{
  border-color: rgba(107,143,58,.55);
  background: linear-gradient(135deg, rgba(107,143,58,.22), rgba(59,91,34,.10));
}
.btn-danger{border-color: rgba(211,75,75,.45); background: rgba(211,75,75,.10)}
.btn[aria-disabled="true"]{opacity:.45;pointer-events:none}

.actions{display:flex;gap:10px;flex-wrap:wrap}
.actions > *{flex:1}

.badge{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.03);
  color:rgba(255,255,255,.78);
  font-weight:900;
  font-size:12px;
}
.avatar{width:36px;height:36px;border-radius:10px;border:1px solid rgba(255,255,255,.14);background:rgba(255,255,255,.04);object-fit:cover}
.avatar-lg{width:52px;height:52px;border-radius:14px}
.post-meta{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.post-content{white-space:pre-wrap;line-height:1.5;font-size:15px}
.alert{padding:12px;border-radius:14px;border:1px solid rgba(255,255,255,.14);background:rgba(255,255,255,.03);margin:10px 0}
.alert.ok{border-color:rgba(75,211,138,.35);background:rgba(75,211,138,.08)}
.alert.err{border-color:rgba(211,75,75,.35);background:rgba(211,75,75,.08)}
hr{border:0;border-top:1px solid rgba(255,255,255,.10);margin:12px 0}

/* TABLES */
.table-wrap{overflow-x:auto; -webkit-overflow-scrolling:touch; max-width:100%}
.table{width:100%; border-collapse:separate; border-spacing:0 8px; min-width:520px; max-width:100%}
.table td,.table th{padding:10px 12px;text-align:left;vertical-align:top}
.table tr{background:rgba(255,255,255,.03);border:1px solid rgba(255,255,255,.10)}
.table tr td:first-child,.table tr th:first-child{border-top-left-radius:14px;border-bottom-left-radius:14px}
.table tr td:last-child,.table tr th:last-child{border-top-right-radius:14px;border-bottom-right-radius:14px}

/* KPI */
.kpi{display:flex;gap:10px;flex-wrap:wrap}
.kpi .pill{
  background:rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.14);
  border-radius:16px;
  padding:10px 12px;
  flex:1;
  min-width:140px;
}
.kpi.two .pill{flex:1 1 calc(50% - 10px)}
.kpi.two .pill.full{flex:1 1 100%}

/* FAB */
.fab{display:none}
.fab-spacer{display:none}

@media (max-width: 980px){
  .row{flex-direction:column}
  .col{min-width:0}
  .brandText{display:none}
  .brandLogo{width:50px;height:50px;padding:5px}
}

@media (max-width: 640px){
  .actions{flex-direction:column}
  .actions > *{width:100%}
  .fab{
    display:flex;
    position:fixed;
    left:16px;
    right:16px;
    bottom:14px;
    z-index:60;
    justify-content:center;
    align-items:center;
    padding:14px 16px;
    border-radius:18px;
    border:1px solid rgba(107,143,58,.65);
    background: linear-gradient(135deg, rgba(107,143,58,.30), rgba(59,91,34,.14));
    box-shadow: 0 12px 28px rgba(0,0,0,.45);
    font-weight: 900;
    letter-spacing:.02em;
    color: var(--text);
  }
  .fab-spacer{display:block;height:86px}
}


/* Theme: Dia (oliva claro) */
body.theme-day{
  --bg:#eef2e6;
  --text:#0f1411;
  --muted:rgba(15,20,17,.70);
  --border:rgba(0,0,0,.12);
  --card1:rgba(0,0,0,.04);
  --card2:rgba(0,0,0,.02);
  --inputBg:rgba(255,255,255,.78);
  --btnBg:rgba(0,0,0,.04);
  --btnBorder:rgba(0,0,0,.12);
  --accent:#5f7f2e;
  --accent2:#7d8f4b;
  background-image: linear-gradient(180deg, rgba(125,143,75,.18), rgba(255,255,255,.92));
}

body.theme-day .muted{ color: var(--muted); }

/* Header actions */
.topbarActions{ display:flex; gap:10px; align-items:center; }
.themeBtn{ letter-spacing:.06em; }

.themeBtn{min-width:44px; justify-content:center; letter-spacing:0;}
.themeBtn .themeIcon{font-size:16px; line-height:1;}


/* DAY THEME HARD OVERRIDES (garantia contra cache/duplicidade de body rules) */
html.theme-day body{
  background-color:#eef2e6 !important;
  background-image: linear-gradient(180deg, rgba(125,143,75,.18), rgba(255,255,255,.92)) !important;
  color:#0f1411 !important;
}
html.theme-day .muted{ color: rgba(15,20,17,.70) !important; }
html.theme-day .topbar{
  background: rgba(244,246,244,.78) !important;
  border-bottom-color: rgba(0,0,0,.12) !important;
}
html.theme-day .brand{
  background: rgba(255,255,255,.55) !important;
  border-color: rgba(0,0,0,.12) !important;
}
html.theme-day .menuBtn{
  border-color: rgba(0,0,0,.12) !important;
  background: linear-gradient(135deg, rgba(125,143,75,.22), rgba(0,0,0,.02)) !important;
  color:#0f1411 !important;
}
html.theme-day .card{
  background: linear-gradient(180deg, rgba(0,0,0,.04), rgba(0,0,0,.02)) !important;
  border-color: rgba(0,0,0,.12) !important;
}
html.theme-day .input,
html.theme-day textarea,
html.theme-day select{
  background: rgba(255,255,255,.78) !important;
  border-color: rgba(0,0,0,.12) !important;
  color:#0f1411 !important;
}
html.theme-day .btn{
  background: rgba(0,0,0,.04) !important;
  border-color: rgba(0,0,0,.12) !important;
  color:#0f1411 !important;
}
html.theme-day .btn-primary{
  border-color: rgba(95,127,46,.55) !important;
  background: linear-gradient(135deg, rgba(95,127,46,.18), rgba(0,0,0,.02)) !important;
}


/* FOOTER FIX */
.footer{
  margin-top:auto;
  padding: 18px 0 26px;
  font-size: 12px;
  color: rgba(255,255,255,.60);
}
.footer-inner{
  display:flex;
  justify-content:center;
  border-top: 1px solid rgba(255,255,255,.12);
  padding-top: 14px;
  text-align:center;
}
html.theme-day .footer{ color: rgba(15,20,17,.60) !important; }
html.theme-day .footer-inner{ border-top-color: rgba(0,0,0,.12) !important; }


/* MENU BUTTON POLISH */
.mobileNav a{
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.05);
  box-shadow: 0 10px 22px rgba(0,0,0,.18);
}
.mobileNav a:active{ transform: translateY(1px); }

.menuBtn{
  box-shadow: 0 10px 22px rgba(0,0,0,.22);
}
.menuBtn:active{ transform: translateY(1px); }

/* Day theme menu: not too clear + strong contrast */
html.theme-day .mobileNav a{
  background: rgba(255,255,255,.72) !important;
  border-color: rgba(0,0,0,.14) !important;
  color:#0f1411 !important;
  box-shadow: 0 12px 26px rgba(0,0,0,.12) !important;
}
html.theme-day .mobileNav a:hover{
  border-color: rgba(0,0,0,.22) !important;
  background: rgba(255,255,255,.86) !important;
}


/* BTN GRADIENT POLISH */
.btn{
  background-image: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
}
html.theme-day .btn{
  background-image: linear-gradient(180deg, rgba(255,255,255,.88), rgba(255,255,255,.70)) !important;
}



/* FEED FULL WIDTH FIX */
.feed-card select,
.feed-card input,
.feed-card textarea,
.feed-card button{
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

.feed-card .row,
.feed-card .actions{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: stretch;
}

.feed-card .row > *,
.feed-card .actions > *{
  flex: 1 1 100%;
}

@media (min-width: 721px){
  /* em telas maiores, filtros podem ficar lado a lado */
  .feed-card .row.row-2 > *{ flex: 1 1 calc(50% - 12px); }
  .feed-card .row.row-3 > *{ flex: 1 1 calc(33.333% - 12px); }
}


/* Support WhatsApp FAB */
.supportFab{
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  background: linear-gradient(135deg, rgba(107,143,58,.22), rgba(0,0,0,.20));
  border: 1px solid rgba(107,143,58,.45);
  box-shadow: 0 16px 34px rgba(0,0,0,.30);
  backdrop-filter: blur(8px);
}
.supportFab:active{ transform: translateY(1px); }
.supportFabIcon{
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
}
.supportFabText{
  font-weight: 700;
  letter-spacing: .04em;
  font-size: 12px;
  text-transform: uppercase;
}

html.theme-day .supportFab{
  color: #0f1411;
  background: linear-gradient(135deg, rgba(125,143,75,.30), rgba(255,255,255,.72));
  border-color: rgba(0,0,0,.12);
  box-shadow: 0 14px 28px rgba(0,0,0,.14);
}
html.theme-day .supportFabIcon{
  background: rgba(255,255,255,.70);
  border-color: rgba(0,0,0,.12);
}

@media (max-width: 520px){
  .supportFabText{ display:none; }
  .supportFab{ padding: 12px; }
}


/* NAV SUPPORT/LOGOUT COLORS */
.mobileNav a.navSupport{
  border-color: rgba(107,143,58,.55) !important;
  background: linear-gradient(135deg, rgba(107,143,58,.22), rgba(0,0,0,.16)) !important;
}
.mobileNav a.navLogout{
  border-color: rgba(220,60,60,.55) !important;
  background: linear-gradient(135deg, rgba(220,60,60,.22), rgba(0,0,0,.16)) !important;
}

/* Tema dia */
html.theme-day .mobileNav a.navSupport{
  border-color: rgba(95,127,46,.55) !important;
  background: linear-gradient(135deg, rgba(125,143,75,.25), rgba(255,255,255,.78)) !important;
  color:#0f1411 !important;
}
html.theme-day .mobileNav a.navLogout{
  border-color: rgba(180,30,30,.45) !important;
  background: linear-gradient(135deg, rgba(220,60,60,.20), rgba(255,255,255,.78)) !important;
  color:#0f1411 !important;
}

/* Esconde o botão flutuante no mobile (menu já tem suporte) */
@media (max-width: 720px){
  .supportFab{ display:none !important; }
}


/* LOGIN LAYOUT POLISH */
.authMain{
  min-height: 72vh; /* empurra o rodapé pra baixo */
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 18px 14px;
}
.authCard{
  width: min(520px, 100%);
  margin: 0 auto;
}
.authActions{
  display:flex;
  flex-direction:column;
  gap: 10px;
}


/* Botão de suporte */
.btn.btn-support{
  border-color: rgba(107,143,58,.55) !important;
  background: linear-gradient(135deg, rgba(107,143,58,.22), rgba(0,0,0,.16)) !important;
}
html.theme-day .btn.btn-support{
  border-color: rgba(95,127,46,.55) !important;
  background: linear-gradient(135deg, rgba(125,143,75,.25), rgba(255,255,255,.78)) !important;
  color:#0f1411 !important;
}



/* LOGIN BUTTONS POLISH */
.authActions{ gap: 14px; }

/* Destaque do botão Entrar */
.btn-login-primary{
  box-shadow: 0 10px 24px rgba(107,143,58,.18), inset 0 1px 0 rgba(255,255,255,.06);
  border-color: rgba(132,170,72,.75) !important;
  background: linear-gradient(135deg, rgba(132,170,72,.45), rgba(0,0,0,.12)) !important;
  font-weight: 800;
  letter-spacing: .2px;
}

/* Suporte menor e menos chamativo que ação principal */
.btn-support-small{
  width: min(78%, 380px);
  align-self: center;
  padding-top: 9px !important;
  padding-bottom: 9px !important;
  font-size: 13px;
  opacity: .94;
}

/* =========================
   v1.1 — Blindagem tema claro e estados vazios
   ========================= */
html.theme-day .empty-state,
html.theme-day .table,
html.theme-day .table-wrap,
html.theme-day .post-meta,
html.theme-day .post-meta-text,
html.theme-day .post-meta-line{
  color:#0f1411 !important;
}
html.theme-day .empty-state,
html.theme-day .table-wrap{
  background:#fbfbf7 !important;
  border-color:rgba(0,0,0,.12) !important;
}
html.theme-day .table th,
html.theme-day .table td{
  color:#0f1411 !important;
  border-bottom-color:rgba(0,0,0,.10) !important;
}
html.theme-day .badge{
  background:#f3f4ee !important;
  color:#0f1411 !important;
  border-color:rgba(0,0,0,.12) !important;
}
html.theme-day input,
html.theme-day select,
html.theme-day textarea{
  background:#ffffff !important;
  color:#0f1411 !important;
  border-color:rgba(0,0,0,.14) !important;
}
