* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: #f1f5f9;
  color: #0f172a;
  min-height: 100vh;
}
.hidden { display: none !important; }

#app { max-width: 1080px; margin: 0 auto; padding: 24px 16px 60px; }

.card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

h1 { font-size: 22px; }
h2 { font-size: 17px; margin-bottom: 8px; }
.subtitle { color: #64748b; font-size: 13px; margin-top: 4px; }
.hint { color: #64748b; font-size: 13px; }

header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; padding: 8px 0;
}
.status-row { display: flex; align-items: center; gap: 10px; }
.badge {
  background: #e2e8f0; color: #334155; font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px;
}
.badge.ok { background: #dcfce7; color: #166534; }
.badge.bad { background: #fee2e2; color: #991b1b; }

input[type=text], input[type=password] {
  width: 100%; padding: 11px 12px; font-size: 14px;
  border: 1px solid #cbd5e1; border-radius: 8px; margin-bottom: 12px;
}
input:focus { outline: 2px solid #2563eb; border-color: transparent; }

button {
  padding: 10px 16px; font-size: 14px; font-weight: 600;
  border: none; border-radius: 8px; cursor: pointer;
  transition: filter .15s;
}
button:hover { filter: brightness(.96); }
button.primary { background: #2563eb; color: #fff; width: 100%; }
button.ghost { background: #e2e8f0; color: #1e293b; }
button.small { padding: 6px 10px; font-size: 12px; }
button.danger { background: #fee2e2; color: #991b1b; }

.login-box { max-width: 380px; margin: 12vh auto 0; text-align: center; }

#dropzone {
  border: 2px dashed #cbd5e1; border-radius: 12px; padding: 30px 20px;
  text-align: center; cursor: pointer; transition: border .15s, background .15s;
}
#dropzone:hover, #dropzone.drag { border-color: #2563eb; background: #eff6ff; }
.dz-icon { font-size: 34px; display: block; margin-bottom: 6px; }
.dz-sub { color: #94a3b8; font-size: 12px; margin-top: 4px; }

.row-between { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.row-between .hint { margin: 0; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #f1f5f9; }
th { color: #64748b; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }

.status { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; display: inline-block; }
.status.QUEUED { background: #fef9c3; color: #854d0e; }
.status.PROCESSING { background: #dbeafe; color: #1e40af; }
.status.DONE { background: #dcfce7; color: #166534; }
.status.ERROR { background: #fee2e2; color: #991b1b; }

.empty { color: #94a3b8; text-align: center; padding: 24px 0; font-size: 14px; }
.error { color: #b91c1c; background: #fee2e2; border-radius: 8px; padding: 10px; margin-top: 10px; font-size: 13px; }

.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.progress {
  width: 120px; height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden;
}
.progress > div { height: 100%; background: #2563eb; width: 0%; }

#detail-body .counts { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.count-chip {
  background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af;
  font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 8px;
}
.count-chip.zero { background: #f1f5f9; border-color: #e2e8f0; color: #64748b; }

.preview { background: #0f172a; color: #cbd5e1; font-family: Consolas, monospace; font-size: 12px; padding: 14px; border-radius: 8px; max-height: 360px; overflow: auto; white-space: pre-wrap; }
.mask-tag { color: #fbbf24; font-weight: 700; }

@media (max-width: 640px) {
  th, td { padding: 8px 4px; font-size: 12px; }
  #app { padding: 16px 10px 40px; }
}
