/* public\styles.css */

:root{
  /* Paleta do cliente */
  --blue-dark:#1A3FCE;
  --blue-main:#42A5F5;
  --blue-100:#BBDEFB;
  --blue-200:#90CAF9;
  --gray-100:#F4F4F4;
  --gray-500:#7B7B7B;
  --gray-900:#262626;

  /* Tema claro */
  --page: #ffffff;
  --bg: #F4F4F4;
  --card: #ffffff;
  --text: #262626;
  --muted: #7B7B7B;

  --border: rgba(38,38,38,.10);
  --border2: rgba(26,63,206,.16);
  --shadow: 0 14px 30px rgba(0,0,0,.08);

  --ok:#16a34a;
  --warn:#f59e0b;
  --bad:#ef4444;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:"Poppins", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto;
  color:var(--text);
  background: var(--bg);
}

.bg{
  position:fixed; inset:0;
  background:
    radial-gradient(900px 520px at 15% 0%, rgba(26,63,206,.14), transparent 60%),
    radial-gradient(900px 520px at 85% 10%, rgba(66,165,245,.16), transparent 60%),
    radial-gradient(700px 520px at 50% 100%, rgba(144,202,249,.22), transparent 65%),
    linear-gradient(180deg, #ffffff, #f7fbff);
  z-index:-1;
}

.wrap{
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 18px 28px;
}

/* HEADER */
.top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-bottom:16px;
}

.brand{display:flex;gap:12px;align-items:center}
.logo{
  width:44px;height:44px;border-radius:14px;
  background: linear-gradient(135deg, var(--blue-dark), var(--blue-main));
  box-shadow: 0 10px 24px rgba(26,63,206,.18);
  display:grid;place-items:center;
}
.logoDot{
  width:12px;height:12px;border-radius:99px;
  background:#fff;
  box-shadow: 0 0 0 6px rgba(255,255,255,.25);
}

h1{margin:0;font-size:18px;line-height:1.2;font-weight:800}
.soft{color:rgba(38,38,38,.55);font-weight:700}
h2{margin:0;font-size:15px;font-weight:800}
p{margin:0}
.muted{color:var(--muted)}
.mini{font-size:12px;line-height:1.35}
b{font-weight:800}

/* CARDS */
.card{
  background: var(--card);
  border:1px solid var(--border);
  border-radius:18px;
  padding:16px;
  box-shadow: var(--shadow);
}

.cardHead{display:flex;flex-direction:column;gap:4px;margin-bottom:12px}

.grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
  align-items:start;
}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px}

/* Centraliza sempre e evita “puxar pra direita” quando algo estoura */
main{display:block}
.card, .tableWrap{min-width:0}

/* FORM */
.row{display:flex;flex-direction:column;gap:6px;margin-bottom:10px}
label{
  font-size:12px;
  color: rgba(38,38,38,.72);
  font-weight:700;
}
.hint{font-weight:800;color:var(--blue-dark)}

input,select{
  width:100%;
  background:#fff;
  border:1px solid rgba(38,38,38,.14);
  color:var(--text);
  padding:11px 12px;
  border-radius:12px;
  outline:none;
  font-family:inherit;
}
input::placeholder{color:rgba(123,123,123,.75)}
input:focus,select:focus{
  border-color: rgba(66,165,245,.9);
  box-shadow: 0 0 0 4px rgba(66,165,245,.18);
}

/* BUTTONS */
.btn{
  background: linear-gradient(135deg, var(--blue-dark), var(--blue-main));
  color:#fff;
  border:none;
  border-radius:12px;
  padding:11px 14px;
  cursor:pointer;
  font-weight:800;
  font-family:inherit;
  transition: transform .08s ease, filter .12s ease;
  white-space:nowrap;
}
.btn:hover{filter:brightness(1.03)}
.btn:active{transform: translateY(1px)}
.btn.ghost{
  background:#fff;
  color:var(--blue-dark);
  border:1px solid rgba(26,63,206,.26);
}
.btn.small{padding:8px 11px;border-radius:12px;font-weight:800}

/* RIGHT */
.right{display:flex;gap:10px;align-items:center}
.pill{
  padding:7px 12px;
  border:1px solid rgba(26,63,206,.18);
  border-radius:999px;
  color: var(--gray-900);
  background: rgba(187,222,251,.35);
  font-weight:700;
}

.msg{margin:10px 0 0 0;color:var(--muted);min-height:18px}
.hidden{display:none !important}

/* LINK GERADO */
.created{
  margin-top:12px;
  padding:12px;
  border:1px dashed rgba(26,63,206,.35);
  border-radius:16px;
  background: rgba(187,222,251,.25);
}
.createdTop{
  display:flex;
  gap:12px;
  align-items:flex-start;
  justify-content:space-between;
  margin-bottom:8px;
}
.createdActions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.createdTop strong{color:var(--text);font-weight:900}

/* PREVIEW TAXA */
.badgeInfo{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-weight:900;
  font-size:11px;
  padding:6px 10px;
  border-radius:999px;
  color: var(--blue-dark);
  background: rgba(187,222,251,.7);
  border:1px solid rgba(26,63,206,.20);
}

.feeCard{
  margin: 12px 0 10px 0;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(26,63,206,.18);
  background: rgba(244,244,244,.9);
  margin-right: -15px !important;
  margin-left: -15px !important;
}
.feeTop{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
.feeTitle{display:flex;align-items:center;gap:10px}
.feeRules{display:flex;flex-wrap:wrap;gap:8px}

.rulePill{
  font-size:11px;
  font-weight:900;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(38,38,38,.12);
  background:#fff;
  color: rgba(38,38,38,.85);
}
.rulePill.off{opacity:.55;text-decoration:line-through}

.feeGrid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:5px}
.kpi{
  border:1px solid rgba(38,38,38,.10);
  border-radius:16px;
  padding:5px;
  background:#fff;
}
.kpiLabel{font-size:12px;color:rgba(123,123,123,.95);font-weight:700}
.kpiValue{font-size:18px;font-weight:900;margin-top:4px}

/* LIST */
.listTop{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.filters{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin:12px 0;
  align-items:center;
}
/* ✅ (1) Em desktop pode manter o min-width, mas sem estourar */
.filters > *{
  min-width: 140px;
  max-width: 100%;
}
.filters .btn{margin-left:auto}

/* TABLE */
.tableWrap{
  overflow:auto;
  border:1px solid rgba(38,38,38,.10);
  border-radius:16px;
  background:#fff;
}

table{
  width:100%;
  border-collapse:collapse;
  min-width: 980px; /* desktop ok */
}

th,td{
  padding:12px;
  border-bottom:1px solid rgba(38,38,38,.08);
  text-align:left;
  font-size:13px;
  vertical-align:top;
}
th{color:rgba(123,123,123,.95);font-weight:900;background: rgba(244,244,244,.9)}
tbody tr:hover{background: rgba(187,222,251,.25)}

.badge{display:inline-flex;align-items:center;gap:8px;font-weight:900}
.dot{width:9px;height:9px;border-radius:99px;display:inline-block}
.dot.ok{background:var(--ok)}
.dot.warn{background:var(--warn)}
.dot.bad{background:var(--bad)}
.dot.info{background:var(--blue-main)}

.moneyBlock{display:flex;flex-direction:column;gap:3px}
.moneyMain{font-weight:900}
.moneySub{font-size:12px;color:rgba(123,123,123,.95)}

/* ✅ botões da tabela mais “arejados” */
.actions{
  display:flex;
  gap:10px;
  justify-content:flex-end;
  align-items:center;
  flex-wrap:wrap;
}

/* FOOTER */
.foot{
  margin-top:16px;
  font-size:12px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(38,38,38,.10);
  background: rgba(255,255,255,.7);
}

/* LOGIN */
.auth{max-width:520px;margin: 22px auto 0 auto}

/* ✅ MOBILE: vira 1 coluna, filtros em grid e listagem em cards (com ajuda do app.js) */
@media (max-width: 980px){
  .top{flex-direction:column;align-items:flex-start}
  .right{width:100%;justify-content:space-between}
  .grid{grid-template-columns:1fr}
  .grid2{grid-template-columns:1fr}
  .filters{
    display:grid;
    grid-template-columns: 1fr 1fr;
    gap:10px;
  }
  .filters input, .filters select{min-width:0}
  .filters .btn{width:100%}
  .filters #btnFilter{grid-column: 1 / span 1}
  .filters #btnClear{grid-column: 2 / span 1}
  table{min-width:0}
  .mini{ font-size: 14px; }
  label{ font-size: 13px; }
  input, select, textarea{ font-size: 16px; }
    .filters > *{
    min-width: 0 !important;   /* <- ESSENCIAL: mata o overflow */
    width: 100%;
  }

  /* grid mobile já existe no seu CSS, só reforço pro browser não "empurrar" */
  .filters{
    width: 100%;
    max-width: 100%;
  }

  /* inputs e select não podem impor largura mínima */
  .filters input, .filters select{
    min-width: 0 !important;
  }
  .card{ overflow: hidden; }
}

/* ✅ LISTAGEM MOBILE (cards) — o JS vai injetar .mCards no tbody */
.mCards{
  display:grid;
  gap:12px;
  padding:12px;
}
.mCard{
  border:1px solid rgba(38,38,38,.10);
  border-radius:16px;
  padding:12px;
  background:#fff;
  box-shadow: 0 10px 22px rgba(0,0,0,.05);
}
.mCardTop{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
}
.mCardTitle{font-weight:900}
.mCardMeta{font-size:12px;color:rgba(123,123,123,.95)}
.mCardRow{display:flex;justify-content:space-between;gap:10px;font-size:13px;margin-top:6px}
.mCardRow span{color:rgba(123,123,123,.95)}
.mCardActions{
  display:flex;
  gap:10px;
  margin-top:10px;
  flex-wrap:wrap;
}
.mCardActions .btn{flex:1}
.mCardActions .btn.ghost{flex:1}