:root{
  --green:#0b7a3b;
  --green2:#0a6a34;
  --bg:#f6fbf8;
  --text:#0f172a;
  --muted:#475569;
  --card:#ffffff;
  --border:#e2e8f0;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.wrap{max-width:980px;margin:0 auto;padding:18px;}
.topbar{
  background: linear-gradient(90deg, var(--green), var(--green2));
  border-radius:16px;
  padding:16px;
  color:white;
  box-shadow: 0 10px 20px rgba(2, 6, 23, 0.12);
}
.brand{display:flex;gap:14px;align-items:center}
.logo{width:56px;height:56px;border-radius:12px;background:#fff;object-fit:cover}
.title{font-weight:800;letter-spacing:.3px}
.subtitle{opacity:.92;font-size:14px}

.card{
  margin-top:16px;
  background:var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  padding:18px;
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.06);
}

h1{margin:0 0 10px 0;font-size:22px}
.muted{color:var(--muted);font-size:14px}

.form{margin-top:12px}
.grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:12px;
}
@media(max-width:800px){ .grid{grid-template-columns:1fr} }

label{display:block;font-size:13px;color:var(--muted);margin-bottom:6px}
input{
  width:100%;
  padding:12px;
  border-radius:12px;
  border:1px solid var(--border);
  outline:none;
}
input:focus{border-color: rgba(11,122,59,.6); box-shadow: 0 0 0 3px rgba(11,122,59,.14);}

.policy{
  margin-top:14px;
  border:1px dashed rgba(11,122,59,.45);
  border-radius:14px;
  padding:12px;
  background: rgba(11,122,59,.05);
}
.policy-title{font-weight:800;color:var(--green);margin-bottom:6px}
.checkbox{display:flex;gap:10px;align-items:center;margin-top:10px;color:var(--muted);font-size:14px}
.checkbox input{width:auto}

.upload{margin-top:14px}

.btn{
  margin-top:14px;
  display:inline-block;
  background:var(--green);
  color:#fff;
  border:none;
  padding:12px 16px;
  border-radius:12px;
  font-weight:700;
  cursor:pointer;
  text-decoration:none;
}
.btn:hover{filter:brightness(0.95)}
.btn.secondary{
  background:#fff;
  color:var(--green);
  border:1px solid rgba(11,122,59,.35);
}

.alert{
  margin-top:12px;
  padding:12px;
  border-radius:12px;
  border:1px solid var(--border);
}
.alert.ok{background: rgba(11,122,59,.08); border-color: rgba(11,122,59,.25)}
.alert.bad{background: rgba(220,38,38,.08); border-color: rgba(220,38,38,.25)}

.notes{margin:10px 0 0 18px;color:var(--muted)}
.footer{margin-top:16px;color:var(--muted);font-size:12px;text-align:center}


/* ---------------------------
   Client-side CSV Preview UI
---------------------------- */

.preview-panel{
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.02);
}

.preview-head{
  display:flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.preview-title{
  font-weight: 800;
  color: var(--text);
}

.preview-meta{
  font-size: 12px;
  color: var(--muted);
}

.preview-alert{
  margin: 8px 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 13px;
  color: var(--muted);
}

.preview-alert.alert-ok{
  background: rgba(11,122,59,.08);
  border-color: rgba(11,122,59,.25);
  color: var(--text);
}

.preview-alert.alert-bad{
  background: rgba(220,38,38,.08);
  border-color: rgba(220,38,38,.25);
  color: var(--text);
}

.preview-table-wrap{
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}

.preview-table{
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.preview-table th,
.preview-table td{
  padding: 10px 12px;
  border-bottom: 1px solid rgba(226,232,240,.9);
  text-align: left;
  white-space: nowrap;
}

.preview-table th{
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 1;
  font-weight: 800;
  color: var(--muted);
}

.btn-disabled{
  opacity: .55;
  cursor: not-allowed;
}
.result-head{
  display:flex;
  gap:12px;
  align-items:center;
  margin-bottom:12px;
}

.result-icon{
  width:44px;
  height:44px;
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  font-size:20px;
  border:1px solid var(--border);
}

.result-icon.ok{
  background: rgba(11,122,59,.10);
  border-color: rgba(11,122,59,.30);
  color: var(--green);
}

.result-icon.bad{
  background: rgba(220,38,38,.10);
  border-color: rgba(220,38,38,.30);
  color: #dc2626;
}

.summary-lines{display:flex;flex-direction:column;gap:6px}
.summary-line{color:var(--text);font-size:14px;line-height:1.4}

.details{
  margin-top:12px;
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 12px;
  background:#fff;
}

.details summary{
  cursor:pointer;
  font-weight:700;
  color: var(--green);
}

.actions{
  margin-top:14px;
  display:flex;
  gap:10px;
}
.tiny{font-size:12px}

.preview-card{
  margin-top:14px;
  border:1px solid var(--border);
  border-radius:16px;
  padding:14px;
  background:#fff;
}

.preview-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  margin-bottom:10px;
}

.preview-title{
  font-weight:800;
  color:var(--text);
  margin-bottom:4px;
}

.chips{display:flex;gap:8px;flex-wrap:wrap}
.chip{
  display:flex;
  gap:8px;
  align-items:center;
  border:1px solid var(--border);
  border-radius:999px;
  padding:6px 10px;
  background:var(--bg);
}
.chip-k{color:var(--muted);font-size:12px}
.chip-v{font-weight:800;font-size:12px;color:var(--text)}

.table-wrap{
  overflow:auto;
  border:1px solid var(--border);
  border-radius:12px;
}

.preview-table{
  width:100%;
  border-collapse:collapse;
  min-width:620px;
}
.preview-table th, .preview-table td{
  padding:10px 12px;
  border-bottom:1px solid var(--border);
  font-size:13px;
  text-align:left;
}
.preview-table thead th{
  position:sticky;
  top:0;
  background:#fff;
  z-index:2;
}

.mono{font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace}

.badge{
  display:inline-block;
  padding:4px 8px;
  border-radius:999px;
  border:1px solid var(--border);
  font-size:12px;
  font-weight:700;
}
.badge.ok{
  background: rgba(11,122,59,.10);
  border-color: rgba(11,122,59,.30);
  color: var(--green);
}
.badge.bad{
  background: rgba(220,38,38,.10);
  border-color: rgba(220,38,38,.30);
  color: #dc2626;
}

