:root{
  --bg:#0b1220;
  --card:#111c33;
  --card2:#0f1a30;
  --text:#e5e7eb;
  --muted:#94a3b8;
  --border:rgba(148,163,184,.18);
  --accent:#22c55e;
  --accent2:#38bdf8;
  --warn:#f59e0b;
  --danger:#ef4444;
  --pill:#0b1326;
}

*{box-sizing:border-box}

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: radial-gradient(1200px 600px at 20% -20%, rgba(34,197,94,.18), transparent 60%),
              radial-gradient(1200px 600px at 100% 0%, rgba(56,189,248,.14), transparent 55%),
              var(--bg);
  color:var(--text);
}

.topbar{
  position:sticky;
  top:0;
  z-index:10;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  padding:16px 18px;
  background:rgba(11,18,32,.7);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--border);
}

.brand{display:flex;align-items:center;gap:12px}
.logo{
  width:44px;height:44px;border-radius:14px;
  background: linear-gradient(135deg, rgba(34,197,94,.25), rgba(56,189,248,.18));
  border:1px solid var(--border);
  display:flex;align-items:center;justify-content:center;
  font-weight:800;
  letter-spacing:.5px;
}
.title{font-weight:800;font-size:16px}
.subtitle{font-size:12px;color:var(--muted)}

.top-actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end}

.container{max-width:1100px;margin:0 auto;padding:18px}

.grid{display:grid;grid-template-columns:1.2fr .8fr;gap:16px}
@media (max-width: 980px){.grid{grid-template-columns:1fr}}

.card{
  background: linear-gradient(180deg, rgba(17,28,51,.92), rgba(15,26,48,.92));
  border:1px solid var(--border);
  border-radius:18px;
  padding:16px;
  box-shadow: 0 18px 50px rgba(0,0,0,.25);
}

.card-header{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:12px}
.card-header h2{margin:0;font-size:16px}
.hint{color:var(--muted);font-size:12px}

.form .row{margin-top:10px}
label{display:block;font-size:12px;color:var(--muted);margin:0 0 6px 2px}

input, textarea, select{
  width:100%;
  padding:12px 12px;
  background: rgba(11,19,38,.9);
  color:var(--text);
  border:1px solid var(--border);
  border-radius:12px;
  outline:none;
}
textarea{resize:vertical;min-height:70px}
input:focus, textarea:focus, select:focus{border-color:rgba(56,189,248,.55)}

.row.two{display:grid;grid-template-columns:1fr 1fr;gap:10px}
@media (max-width: 560px){.row.two{grid-template-columns:1fr}}

.row.actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}

.btn{
  padding:12px 14px;
  border:none;
  border-radius:12px;
  background: linear-gradient(135deg, rgba(34,197,94,1), rgba(34,197,94,.75));
  color:#05210f;
  font-weight:800;
  cursor:pointer;
}
.btn:hover{filter:brightness(1.05)}
.btn.secondary{
  background: rgba(11,19,38,.9);
  color:var(--text);
  border:1px solid var(--border);
  font-weight:700;
}

.filebtn{position:relative;overflow:hidden}
.filebtn input{position:absolute;inset:0;opacity:0;cursor:pointer}

.stats{display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px;margin:8px 0 12px}
.stat{background:rgba(11,19,38,.65);border:1px solid var(--border);border-radius:14px;padding:12px}
.stat-label{font-size:12px;color:var(--muted)}
.stat-value{font-size:22px;font-weight:900;margin-top:4px}

.filters{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.pill{
  padding:10px 12px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(11,19,38,.75);
  color:var(--text);
  cursor:pointer;
  font-weight:700;
  font-size:12px;
}
.pill.active{border-color:rgba(34,197,94,.55);box-shadow:0 0 0 3px rgba(34,197,94,.12) inset}

.notice{
  margin-top:12px;
  padding:12px;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(11,19,38,.7);
  color:var(--text);
}

.lista{display:flex;flex-direction:column;gap:10px}

.cliente{
  background:rgba(11,19,38,.65);
  border:1px solid var(--border);
  border-radius:16px;
  padding:12px;
}

.cliente-top{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
.cliente-name{font-weight:900}
.cliente-meta{margin-top:4px;color:var(--muted);font-size:12px;line-height:1.35}

.badges{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.badge{
  font-size:11px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(15,26,48,.7);
  font-weight:800;
}
.badge.ativo{border-color:rgba(34,197,94,.35);color:#b6f3cc}
.badge.breve{border-color:rgba(245,158,11,.35);color:#fde68a}
.badge.vencido{border-color:rgba(239,68,68,.35);color:#fecaca}

.cliente-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px;align-items:center}
.mini{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:rgba(11,19,38,.9);
  color:var(--text);
  cursor:pointer;
  font-weight:800;
}
.mini.primary{background:rgba(34,197,94,.18);border-color:rgba(34,197,94,.35)}
.mini.warn{background:rgba(245,158,11,.15);border-color:rgba(245,158,11,.35)}
.mini.danger{background:rgba(239,68,68,.12);border-color:rgba(239,68,68,.3)}

.select{
  min-width:220px;
}
@media (max-width: 560px){.select{min-width:100%}}

.modal{position:fixed;inset:0;background:rgba(0,0,0,.55);display:none;align-items:center;justify-content:center;padding:18px}
.modal-content{width:min(900px, 100%);background:linear-gradient(180deg, rgba(17,28,51,.98), rgba(15,26,48,.98));border:1px solid var(--border);border-radius:18px;box-shadow:0 30px 80px rgba(0,0,0,.45)}
.modal-header{display:flex;align-items:center;justify-content:space-between;padding:14px 14px 10px;border-bottom:1px solid var(--border)}
.modal-header h3{margin:0;font-size:15px}
.iconbtn{border:1px solid var(--border);background:rgba(11,19,38,.8);color:var(--text);border-radius:12px;padding:10px 12px;cursor:pointer;font-weight:900}
.modal-body{padding:14px}
