* { margin:0; padding:0; box-sizing:border-box; }
body { font-family:'Inter', system-ui, sans-serif; background:linear-gradient(135deg,#1E40AF,#0F2A6B); min-height:100vh; padding:15px; }
[data-theme="dark"] body { background:var(--gt-bg); }
.container { max-width:980px; margin:10px auto; background:var(--gt-surface); border-radius:14px; box-shadow:0 20px 60px rgba(0,0,0,.35); overflow:hidden; }
.header { background:linear-gradient(135deg,#1E40AF,#0F2A6B); color:#fff; padding:15px 20px; display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:10px; }
.header h2 { font-size:18px; color:#fff; }
.header-right { display:flex; gap:8px; flex-wrap:wrap; }
.btn-back { background:rgba(255,255,255,.2); color:#fff; border:2px solid #fff; padding:7px 13px; border-radius:6px; font-weight:600; font-size:13px; text-decoration:none; }
.btn-add { background:#fff; color:#0F2A6B; border:none; padding:8px 16px; border-radius:8px; font-weight:700; font-size:13px; cursor:pointer; }
.content { padding:18px 20px; }
.tip-box { background:#ECFDF5; border-radius:8px; padding:11px 15px; margin-bottom:15px; font-size:13px; color:#0F2A6B; }
[data-theme="dark"] .tip-box { background:var(--gt-bg-subtle); color:var(--gt-text); }
.loading-msg { text-align:center; padding:40px; color:var(--gt-text-muted); grid-column:1/-1; }
.seed-box { background:#FEF3C7; border:2px solid #F59E0B; border-radius:10px; padding:14px; margin-bottom:15px; text-align:center; font-size:13px; color:#7C4A03; }
[data-theme="dark"] .seed-box { background:#2E2508; color:#FCD34D; }
.btn-seed { background:#F59E0B; color:#fff; border:none; border-radius:8px; padding:9px 18px; font-size:13px; font-weight:700; cursor:pointer; margin-top:8px; }
.btn-seed:disabled { opacity:.6; cursor:default; }

/* Busca */
.busca-input { width:100%; padding:11px 14px; border:2px solid var(--gt-border); border-radius:10px; font-size:14px; font-family:inherit; margin-bottom:15px; background:var(--gt-input-bg); color:var(--gt-text); }
.busca-input:focus { outline:none; border-color:var(--gt-primary); }
.busca-input::placeholder { color:var(--gt-text-light); }

/* Lista clientes */
.cli-list { display:grid; gap:12px; grid-template-columns:repeat(auto-fill,minmax(290px,1fr)); }
.cli-card { border:2px solid var(--gt-border); border-radius:12px; padding:14px; transition:all .2s; background:var(--gt-surface); }
.cli-card:hover { border-color:var(--gt-primary); box-shadow:var(--gt-shadow); }
.cli-nome { font-size:15px; font-weight:800; color:#0F2A6B; margin-bottom:2px; word-break:break-word; }
[data-theme="dark"] .cli-nome { color:var(--gt-primary-light); }
.cli-contato { font-size:12px; color:var(--gt-text-muted); font-weight:600; margin-bottom:8px; }
.cli-linha { font-size:12px; color:var(--gt-text); padding:3px 0; word-break:break-word; }
.cli-badges { margin-top:8px; display:flex; gap:6px; flex-wrap:wrap; }
.cli-badge { font-size:10px; font-weight:700; padding:2px 8px; border-radius:8px; background:#E0E7FF; color:#1E40AF; }
.cli-badge.loan-ativo { background:#ECFDF5; color:#047857; }
[data-theme="dark"] .cli-badge { background:#1E2B5C; color:#A5B8F5; }
[data-theme="dark"] .cli-badge.loan-ativo { background:#0A2E22; color:#6EE7B7; }
.cli-actions { margin-top:10px; display:flex; gap:6px; }
.btn-edit-cli { flex:1; background:var(--gt-primary); color:#fff; border:none; border-radius:8px; padding:8px; font-size:12px; font-weight:700; cursor:pointer; }
.btn-del-cli { background:var(--gt-danger); color:#fff; border:none; border-radius:8px; padding:8px 12px; font-size:12px; font-weight:700; cursor:pointer; }
.empty-msg { grid-column:1/-1; text-align:center; padding:40px 20px; color:var(--gt-text-muted); font-size:14px; }

/* Modal */
.modal-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.55); z-index:1000; align-items:flex-start; justify-content:center; overflow-y:auto; padding:20px 10px; }
.modal-overlay.open { display:flex; }
.modal { background:var(--gt-surface); border-radius:14px; padding:20px; max-width:640px; width:100%; margin:auto 0; }
.modal h3 { color:var(--gt-text); margin-bottom:14px; font-size:17px; }
.form-group { margin-bottom:12px; flex:1; min-width:0; }
.form-group label { display:block; font-size:12px; font-weight:700; color:var(--gt-text-muted); margin-bottom:5px; }
.form-group input, .form-group select, .form-group textarea { width:100%; padding:9px 12px; border:2px solid var(--gt-border); border-radius:8px; font-size:13px; font-family:inherit; background:var(--gt-input-bg); color:var(--gt-text); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline:none; border-color:var(--gt-primary); }
.form-group textarea { min-height:70px; resize:vertical; }
.form-row { display:flex; gap:10px; }
.modal-actions { display:flex; gap:10px; margin-top:16px; }
.btn-cancel { flex:1; background:var(--gt-surface-2); color:var(--gt-text-muted); border:none; border-radius:8px; padding:11px; font-size:13px; font-weight:700; cursor:pointer; }
.btn-save { flex:2; background:var(--gt-primary); color:#fff; border:none; border-radius:8px; padding:11px; font-size:13px; font-weight:700; cursor:pointer; }
.btn-save:disabled { opacity:.6; cursor:default; }

@media (max-width:600px) {
    .cli-list { grid-template-columns:1fr; }
    .form-row { flex-direction:column; gap:0; }
    .header { flex-direction:column; text-align:center; }
}
