/* ---------------------------------------------------------
   GLOBAL
--------------------------------------------------------- */
:root {
  --bg: #f5f7fa;
  --card-bg: #ffffff;
  --border: #e5e7eb;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --danger: #dc2626;
  --radius: 10px;
  --shadow: 0 2px 6px rgba(0,0,0,0.06);
}

body {
  margin: 0;
  padding: 20px;
  background: var(--bg);
  font-family: system-ui, Arial, sans-serif;
  color: #111;
}

h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
}

/* ---------------------------------------------------------
   HEADER
--------------------------------------------------------- */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

header span {
  font-size: 12px;
  color: var(--muted);
}

.pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #e0f2fe;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  color: #0369a1;
}

.pill-dot {
  width: 8px;
  height: 8px;
  background: #0ea5e9;
  border-radius: 50%;
}

/* ---------------------------------------------------------
   LAYOUT
--------------------------------------------------------- */
main {
  display: flex;
  gap: 20px;
}

.column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---------------------------------------------------------
   CARDS
--------------------------------------------------------- */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
}

.card-sub {
  font-size: 11px;
  color: var(--muted);
}

.badge {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  background: #eef2ff;
  color: #4338ca;
}

.badge.ok {
  background: #dcfce7;
  color: #166534;
}

.badge.err {
  background: #fee2e2;
  color: #b91c1c;
}

/* ---------------------------------------------------------
   INPUTS
--------------------------------------------------------- */
label {
  font-size: 12px;
  color: var(--muted);
}

input, select, textarea {
  width: 100%;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 13px;
  box-sizing: border-box;
}

textarea {
  height: 260px;
  font-family: monospace;
}

/* ---------------------------------------------------------
   BUTTONS
--------------------------------------------------------- */
button {
  padding: 7px 14px;
  border-radius: 6px;
  border: none;
  background: #e5e7eb;
  cursor: pointer;
  font-size: 13px;
}

button.primary {
  background: var(--primary);
  color: white;
}

button.primary:hover {
  background: var(--primary-hover);
}

button.danger {
  background: var(--danger);
  color: white;
}

/* ---------------------------------------------------------
   MAP + PREVIEW
--------------------------------------------------------- */
.map-box {
  width: 100%;
  height: 300px;
  border-radius: var(--radius);
  background: #d1d5db;
  overflow: hidden;
}

.preview-frame {
  width: 100%;
  height: 260px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.img-preview {
  width: 100%;
  margin-top: 8px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* QR box */
.qr-box {
  width: 160px;
  height: 160px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------------------------------------------------------
   SPLIT LAYOUT
--------------------------------------------------------- */
.split {
  display: flex;
  gap: 20px;
}

.split > div {
  flex: 1;
}

/* ---------------------------------------------------------
   MD LIST
--------------------------------------------------------- */
.md-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.md-row button {
  font-size: 11px;
}

/* ---------------------------------------------------------
   DETAILS / ACCORDION
--------------------------------------------------------- */
details summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
}

.summary-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.summary-dot {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
}

.summary-label {
  font-size: 13px;
  font-weight: 500;
}

.summary-chevron {
  font-size: 12px;
  color: var(--muted);
}

.details-body {
  margin-top: 10px;
}

/* ---------------------------------------------------------
   MODALS
--------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal {
  background: white;
  padding: 20px;
  border-radius: var(--radius);
  width: 360px;
  box-shadow: var(--shadow);
}

.modal-footer {
  margin-top: 15px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ---------------------------------------------------------
   AI PREVIEW BOX
--------------------------------------------------------- */
.ai-preview-box {
  margin-top: 8px;
  font-size: 12px;
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #020617;
  color: #e2e8f0;
  min-height: 40px;
}

/* ---------------------------------------------------------
   SMALL UTILITIES
--------------------------------------------------------- */
.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.field-row {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
}

.counter-row {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
}
