/* ══════════════════════════════════════════════════════════
   NHÂN KIỆT — Tra cứu địa chỉ
   Red theme ═══════════════════════════════════════════════════ */

:root {
  --nk-red: #c62828;
  --nk-red-dark: #8e0000;
  --nk-red-light: #ef5350;
  --nk-red-bg: #fff5f5;
  --nk-accent: #d32f2f;
  --nk-white: #ffffff;
  --nk-bg: #fafafa;
  --nk-border: #e8e8e8;
  --nk-text: #2d2d2d;
  --nk-muted: #6b7280;
  --nk-radius: 12px;
  --nk-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --nk-shadow-lg: 0 4px 24px rgba(0,0,0,0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--nk-bg);
  color: var(--nk-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ─────────────────────────────────────────────── */
.nk-header {
  background: linear-gradient(135deg, var(--nk-red-dark) 0%, var(--nk-red) 100%);
  color: var(--nk-white);
  padding: 20px 0;
  box-shadow: 0 2px 16px rgba(198,40,40,0.25);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nk-logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: contain;
  background: white;
  padding: 3px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.nk-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin: 0;
  line-height: 1.2;
}

.nk-subtitle {
  font-size: 0.82rem;
  opacity: 0.9;
  margin: 2px 0 0;
  font-weight: 400;
}

.nk-brand-link { text-decoration: none; }
.nk-brand {
  background: rgba(255,255,255,0.18);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  color: white;
  letter-spacing: 0.3px;
  transition: background 0.2s;
}
.nk-brand:hover { background: rgba(255,255,255,0.28); color: white; }

/* ── Main ────────────────────────────────────────────────── */
.nk-main {
  flex: 1;
  padding-top: 24px;
  padding-bottom: 40px;
  max-width: 960px;
}

/* ── Tabs ────────────────────────────────────────────────── */
.nk-tabs {
  display: flex;
  gap: 4px;
  background: white;
  padding: 5px;
  border-radius: 14px;
  box-shadow: var(--nk-shadow);
  margin-bottom: 20px;
}

.nk-tab {
  flex: 1;
  padding: 12px 20px;
  border: none;
  background: transparent;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--nk-muted);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.nk-tab:hover { color: var(--nk-red); background: var(--nk-red-bg); }
.nk-tab.active {
  background: var(--nk-red);
  color: white;
  box-shadow: 0 2px 8px rgba(198,40,40,0.3);
}

.nk-panel { display: none; }
.nk-panel.active { display: block; }

/* ── Card ────────────────────────────────────────────────── */
.nk-card {
  background: var(--nk-white);
  border-radius: var(--nk-radius);
  box-shadow: var(--nk-shadow-lg);
  overflow: hidden;
}
.nk-card-body { padding: 28px; }

/* ── Form ────────────────────────────────────────────────── */
.nk-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--nk-text);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nk-label i { color: var(--nk-red); }

.nk-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--nk-border);
  border-radius: 10px;
  font-size: 0.95rem;
  transition: all 0.2s;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
}
.nk-input:focus {
  outline: none;
  border-color: var(--nk-red-light);
  box-shadow: 0 0 0 4px rgba(239,83,80,0.1);
}
.nk-input::placeholder { color: #c0c0c0; }

/* ── Buttons ─────────────────────────────────────────────── */
.nk-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 0.93rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  line-height: 1;
}
.nk-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.nk-btn-primary {
  background: linear-gradient(135deg, var(--nk-red) 0%, var(--nk-red-dark) 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(198,40,40,0.3);
}
.nk-btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(198,40,40,0.4);
}

.nk-btn-outline {
  background: white;
  color: var(--nk-red);
  border: 2px solid var(--nk-red);
}
.nk-btn-outline:hover:not(:disabled) {
  background: var(--nk-red-bg);
}

.nk-btn-success {
  background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(46,125,50,0.3);
}
.nk-btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(46,125,50,0.4);
}

/* ── Loading ─────────────────────────────────────────────── */
.nk-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 0;
  color: var(--nk-muted);
  font-size: 0.9rem;
}

.nk-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid var(--nk-border);
  border-top-color: var(--nk-red);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Progress ────────────────────────────────────────────── */
.nk-progress { width: 100%; }
.nk-progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--nk-text);
}
.nk-progress-bar {
  height: 10px;
  background: #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}
.nk-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--nk-red) 0%, var(--nk-red-light) 100%);
  border-radius: 10px;
  transition: width 0.3s ease;
}

/* ── Alert ───────────────────────────────────────────────── */
.nk-alert {
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
}
.nk-alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* ── Result ──────────────────────────────────────────────── */
.nk-result {
  margin-top: 24px;
  border: 2px solid #e8f5e9;
  border-radius: var(--nk-radius);
  overflow: hidden;
}

.nk-result-header {
  background: #e8f5e9;
  color: #2e7d32;
  padding: 12px 18px;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Table ───────────────────────────────────────────────── */
.nk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.nk-table thead { background: #fafafa; }
.nk-table th {
  padding: 12px 14px;
  text-align: left;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--nk-muted);
  border-bottom: 2px solid var(--nk-border);
  white-space: nowrap;
}
.nk-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f3f3f3;
  vertical-align: middle;
}
.nk-table code {
  background: var(--nk-red-bg);
  color: var(--nk-red);
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 0.82rem;
  font-weight: 600;
}
.nk-table tr:last-child td { border-bottom: none; }

/* ── Batch Steps ─────────────────────────────────────────── */
.batch-steps {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.batch-step {
  display: flex;
  gap: 18px;
}

.step-number {
  width: 40px;
  height: 40px;
  min-width: 40px;
  background: linear-gradient(135deg, var(--nk-red) 0%, var(--nk-red-dark) 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: 0 2px 8px rgba(198,40,40,0.25);
}

.step-content { flex: 1; }
.step-content h5 { font-weight: 700; margin-bottom: 4px; font-size: 1rem; }
.step-content .text-muted { font-size: 0.85rem; margin-bottom: 12px; }

/* ── File Upload ─────────────────────────────────────────── */
.nk-file-upload { position: relative; }
.nk-file-upload input[type="file"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.nk-file-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border: 2px dashed #d0d0d0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
  color: var(--nk-muted);
  font-weight: 500;
}
.nk-file-label:hover {
  border-color: var(--nk-red-light);
  color: var(--nk-red);
  background: var(--nk-red-bg);
}
.nk-file-label i { font-size: 1.3rem; }

.nk-file-name {
  margin-top: 8px;
  padding: 8px 14px;
  background: #f0fdf4;
  color: #166534;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Footer ──────────────────────────────────────────────── */
.nk-footer {
  background: white;
  border-top: 1px solid var(--nk-border);
  padding: 20px 0;
  margin-top: auto;
}
.nk-footer p { font-size: 0.82rem; color: var(--nk-muted); }
.nk-footer strong { color: var(--nk-red); }
.nk-footer-info { font-size: 0.78rem !important; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .nk-header .container { flex-direction: column; text-align: center; }
  .nk-title { font-size: 1.1rem; }
  .nk-tabs { flex-direction: column; gap: 3px; }
  .nk-card-body { padding: 18px; }
  .nk-table { font-size: 0.78rem; }
  .nk-table th, .nk-table td { padding: 8px 6px; }
  .batch-step { flex-direction: column; }
}
