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

:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface2: #eef0f4;
  --border: #dde1e9;
  --nav-bg: #32373c;
  --accent: #1b7678;
  --accent-dim: #145557;
  --text: #1c2331;
  --text-dim: #6b7585;
  --green: #059669;
  --red: #dc2626;
  --yellow: #d97706;
  --radius: 8px;
  --font: "Inter", system-ui, sans-serif;
}

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
}

/* ── Nav ── */
.nav {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  height: 54px;
  background: var(--nav-bg);
  border-bottom: none;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.nav-logo {
  font-weight: 700;
  font-size: 18px;
  color: #ffffff;
  letter-spacing: -0.5px;
}
.nav-spacer { flex: 1; }
.nav-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  letter-spacing: 0.2px;
}
.nav-btn:hover { background: var(--accent-dim); }

/* ── Main layout ── */
.main { max-width: 1100px; margin: 0 auto; padding: 36px 24px; }

/* ── Building grid ── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(27,118,120,0.12);
}
.card-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: var(--surface2);
}
.card-thumb-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 36px;
}
.card-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.card-name { font-weight: 600; font-size: 15px; color: var(--text); }
.card-meta { color: var(--text-dim); font-size: 12px; }
.card-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface2);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--text-dim);
  width: fit-content;
}
.card-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: var(--surface);
}
.btn-sm {
  padding: 6px 13px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  transition: background 0.1s, color 0.1s;
}
.btn-sm:hover { background: var(--surface2); color: var(--text); }
.btn-sm.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-sm.primary:hover { background: var(--accent-dim); border-color: var(--accent-dim); }
.btn-sm.danger { color: var(--red); border-color: rgba(220,38,38,0.3); }
.btn-sm.danger:hover { background: rgba(220,38,38,0.06); }

/* ── Empty state ── */
.empty {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-dim);
}
.empty h2 { font-size: 20px; margin-bottom: 8px; color: var(--text); }

/* ── Section title ── */
.section-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}
.section-sub { color: var(--text-dim); margin-bottom: 16px; font-size: 14px; }

/* ── Modal overlay ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(28,35,49,0.45);
  z-index: 200;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 520px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  position: relative;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.1s, color 0.1s;
}
.modal-close:hover { background: var(--surface2); color: var(--text); }
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 20px; color: var(--text); }

/* ── Wizard steps ── */
.wizard-step { display: none; flex-direction: column; gap: 16px; }
.wizard-step.active { display: flex; }

.step-indicator {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.step-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s;
}
.step-dot.done { background: var(--green); }
.step-dot.active { background: var(--accent); }

/* ── Drop zone ── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: var(--surface);
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent);
  background: rgba(27,118,120,0.04);
}
.drop-zone p { color: var(--text-dim); margin-top: 8px; font-size: 13px; }
.drop-zone .icon { font-size: 40px; }

/* ── Form fields ── */
label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
input[type=text], input[type=number] {
  width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type=text]:focus, input[type=number]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(27,118,120,0.1);
}

/* ── Spinner ── */
.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 20px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ── */
#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 18px;
  font-size: 13px;
  z-index: 999;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  max-width: 320px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  color: var(--text);
}
#toast.show { opacity: 1; transform: translateY(0); }
#toast.error { border-color: var(--red); color: var(--red); }
#toast.success { border-color: var(--green); color: var(--green); }

/* ── Misc utils ── */
.flex { display: flex; }
.gap-8 { gap: 8px; }
.mt-16 { margin-top: 16px; }
.text-dim { color: var(--text-dim); }
.text-sm { font-size: 12px; }
.hidden { display: none !important; }
