:root {
  --navy: #0e2a47;
  --navy-deep: #091d33;
  --navy-soft: #eef3f8;
  --red: #a6192e;
  --red-dark: #8c1526;
  --gold: #c5a05a;
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1a2433;
  --muted: #5c6b7f;
  --line: #e3e7ed;
  --green: #1e7d47;
  --green-soft: #e6f2ea;
  --amber: #9a6b0a;
  --amber-soft: #faf1dd;
  --red-soft: #f9e9eb;
  --radius: 12px;
}

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

body {
  font-family: "Segoe UI", -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--red); text-decoration: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.brand .mark {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.brand .mark span { color: var(--red); }
.brand .sub { font-size: 12px; color: var(--muted); white-space: nowrap; }
.header-nav { display: flex; gap: 6px; }
.header-nav a {
  font-size: 13px;
  color: var(--navy);
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 600;
}
.header-nav a:hover { background: var(--navy-soft); }
.header-nav a.active { background: var(--navy); color: #fff; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy) 60%, #14375c 100%);
  color: #fff;
  padding: 36px 20px 32px;
}
.hero-inner { max-width: 1080px; margin: 0 auto; }
.hero .eyebrow {
  font-size: 12px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}
.hero h1 {
  font-family: Georgia, serif;
  font-size: 26px;
  font-weight: 700;
  margin: 8px 0 6px;
}
.hero p { font-size: 14px; color: #c9d6e4; max-width: 640px; }
.hero .stats { display: flex; gap: 24px; margin-top: 18px; flex-wrap: wrap; }
.hero .stat b { display: block; font-size: 22px; font-family: Georgia, serif; }
.hero .stat span { font-size: 12px; color: #9fb4c9; }

/* ---------- Layout ---------- */
.container { max-width: 1080px; margin: 0 auto; padding: 24px 20px 60px; }
.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  margin: 28px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::before {
  content: "";
  width: 4px;
  height: 16px;
  background: var(--red);
  border-radius: 2px;
}

/* ---------- Filters ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}
.chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ---------- Visit cards ---------- */
.visit-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.visit-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  gap: 16px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.visit-card:hover { border-color: var(--navy); transform: translateY(-1px); }
.date-block {
  flex-shrink: 0;
  width: 62px;
  height: 68px;
  border-radius: 10px;
  background: var(--navy-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid #d8e2ee;
}
.date-block .month { font-size: 11px; letter-spacing: 1.5px; color: var(--red); font-weight: 700; text-transform: uppercase; }
.date-block .day { font-size: 24px; font-weight: 700; color: var(--navy); font-family: Georgia, serif; line-height: 1.1; }
.visit-card-body { flex: 1; min-width: 0; }
.visit-card-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.visit-company { font-size: 12px; color: var(--muted); font-weight: 600; }
.visit-title { font-size: 16px; font-weight: 700; color: var(--navy); margin: 2px 0 6px; }
.visit-meta { font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.visit-card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 8px; flex-wrap: wrap; }
.industry-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--navy);
  background: var(--navy-soft);
  border-radius: 999px;
  padding: 3px 10px;
}
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge.open { background: var(--green-soft); color: var(--green); }
.badge.almost { background: var(--amber-soft); color: var(--amber); }
.badge.full { background: var(--red-soft); color: var(--red); }
.badge.completed { background: #eef0f2; color: var(--muted); }
.badge.closed { background: #eef0f2; color: var(--muted); }
.seats { font-size: 12px; color: var(--muted); }

.past-list .visit-card { padding: 12px 16px; align-items: center; }

/* ---------- Detail page ---------- */
.back-link { display: inline-block; font-size: 13px; color: var(--muted); margin-bottom: 14px; font-weight: 600; }
.back-link:hover { color: var(--navy); }

.detail-hero {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.detail-hero .band {
  background: linear-gradient(135deg, var(--navy-deep), var(--navy));
  color: #fff;
  padding: 22px 20px;
}
.detail-hero .band .company { font-size: 12px; color: var(--gold); font-weight: 700; letter-spacing: 0.5px; }
.detail-hero .band h2 { font-family: Georgia, serif; font-size: 22px; margin: 6px 0 10px; }
.detail-hero .band .tags { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-hero .band .tag {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.12);
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
}
.detail-facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
}
.detail-facts .fact { background: var(--card); padding: 12px 20px; }
.detail-facts .fact .k { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.detail-facts .fact .v { font-size: 13.5px; color: var(--text); margin-top: 2px; }

.reg-banner {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.reg-banner .info { font-size: 13px; color: var(--muted); }
.reg-banner .info b { color: var(--navy); }
.capacity-bar { width: 100%; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.capacity-bar .fill { height: 100%; background: var(--red); border-radius: 3px; }

.btn {
  display: inline-block;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  padding: 11px 22px;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-deep); }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--navy); }
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.detail-section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-top: 14px;
}
.detail-section h3 {
  font-size: 14px;
  color: var(--navy);
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.detail-section h3 svg { flex-shrink: 0; }
.detail-section p { font-size: 14px; color: var(--text); }

/* Agenda timeline */
.timeline { list-style: none; }
.timeline li {
  position: relative;
  padding: 0 0 16px 26px;
  border-left: 2px solid var(--line);
  margin-left: 6px;
}
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--red);
}
.timeline .t-time { font-size: 12px; font-weight: 700; color: var(--red); }
.timeline .t-act { font-size: 14px; color: var(--text); }

/* Transport */
.transport-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.transport-item:last-child { border-bottom: none; padding-bottom: 0; }
.transport-item .mode { font-size: 13px; font-weight: 700; color: var(--navy); min-width: 150px; flex-shrink: 0; }
.transport-item .detail { font-size: 13.5px; color: var(--muted); }

/* Contacts */
.contact-row { display: flex; flex-wrap: wrap; gap: 10px; }
.contact-card {
  flex: 1;
  min-width: 220px;
  background: var(--navy-soft);
  border-radius: 10px;
  padding: 12px 16px;
  border: 1px solid #d8e2ee;
}
.contact-card .name { font-size: 14px; font-weight: 700; color: var(--navy); }
.contact-card .role { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.contact-card .line { font-size: 12.5px; color: var(--text); }

/* Reminders */
.reminder-list { list-style: none; }
.reminder-list li {
  position: relative;
  padding: 8px 0 8px 26px;
  font-size: 13.5px;
  color: var(--text);
  border-bottom: 1px dashed var(--line);
}
.reminder-list li:last-child { border-bottom: none; }
.reminder-list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 14px;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--gold);
  transform: rotate(45deg);
}

/* Participants */
.participants-count { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.p-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.p-chip {
  font-size: 12.5px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  color: var(--text);
}
.p-chip b { color: var(--navy); font-weight: 700; }
.p-chip.attended { background: var(--green-soft); border-color: transparent; }
.p-chip.no_show { opacity: 0.55; text-decoration: line-through; }

/* ---------- Forms ---------- */
.form-card { max-width: 560px; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-group { flex: 1; min-width: 200px; margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; font-weight: 700; color: var(--navy); margin-bottom: 5px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(14, 42, 71, 0.08);
}
.form-note { font-size: 12px; color: var(--muted); margin-top: -8px; margin-bottom: 14px; }
.alert { border-radius: 10px; padding: 12px 16px; font-size: 13.5px; margin: 14px 0; }
.alert.success { background: var(--green-soft); color: var(--green); border: 1px solid #c4e0cf; }
.alert.error { background: var(--red-soft); color: var(--red-dark); border: 1px solid #eccbd1; }

.empty { text-align: center; color: var(--muted); font-size: 14px; padding: 40px 0; }

/* ---------- My registrations ---------- */
.reg-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  flex-wrap: wrap;
}
.reg-item .info .company { font-size: 12px; color: var(--muted); }
.reg-item .info .title { font-size: 14.5px; font-weight: 700; color: var(--navy); }
.reg-item .info .meta { font-size: 12.5px; color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  background: var(--card);
}

/* ---------- Admin ---------- */
.login-wrap { max-width: 380px; margin: 60px auto; }
.admin-tabs { display: flex; gap: 0; margin-bottom: 0; border-bottom: 2px solid var(--line); }
.admin-tab {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.admin-tab.active { color: var(--navy); border-bottom-color: var(--red); }
.admin-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.admin-table th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  background: var(--navy-soft);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.admin-table td { padding: 10px 14px; font-size: 13.5px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.table-scroll { overflow-x: auto; border-radius: var(--radius); }
.status-select {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
}
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 16px 0; flex-wrap: wrap; }
.admin-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.summary-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; }
.summary-card b { display: block; font-size: 24px; font-family: Georgia, serif; color: var(--navy); }
.summary-card span { font-size: 12px; color: var(--muted); }

textarea.json-editor { min-height: 90px; font-family: Consolas, monospace; font-size: 12px; }

@media (min-width: 720px) {
  .hero h1 { font-size: 32px; }
  .visit-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-facts { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 480px) {
  .brand .sub { display: none; }
  .transport-item { flex-direction: column; gap: 2px; }
  .visit-card { flex-direction: row; }
}
