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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f5f5f7;
  color: #1d1d1f;
  line-height: 1.5;
}

header {
  background: #1d1d1f;
  color: #fff;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

header h1 {
  font-size: 18px;
  font-weight: 600;
}

#api-config {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

#api-config input {
  padding: 6px 10px;
  border: 1px solid #444;
  border-radius: 6px;
  background: #2d2d2f;
  color: #fff;
  font-size: 13px;
  width: 320px;
}

#api-config input::placeholder { color: #888; }

#api-config input:nth-child(2) { width: 180px; }

#connect-btn {
  padding: 6px 16px;
  background: #0071e3;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}

#connect-btn:hover { background: #0077ed; }

#connection-status {
  font-size: 13px;
  margin-left: 4px;
}

#connection-status.connected { color: #30d158; }
#connection-status.error { color: #ff453a; }

/* Tabs */
nav#tabs {
  background: #fff;
  border-bottom: 1px solid #d2d2d7;
  padding: 0 24px;
  display: flex;
  gap: 0;
}

.tab {
  padding: 12px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #6e6e73;
  transition: all 0.2s;
}

.tab:hover { color: #1d1d1f; }
.tab.active { color: #0071e3; border-bottom-color: #0071e3; }

/* Tab content */
main { padding: 24px; max-width: 1400px; margin: 0 auto; }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Stat cards */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: #1d1d1f;
}

.stat-label {
  font-size: 13px;
  color: #6e6e73;
  margin-top: 4px;
}

.stat-value.status-completed { color: #30d158; }
.stat-value.status-running { color: #ff9f0a; }
.stat-value.status-failed { color: #ff453a; }

/* Panels */
.panel {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.panel h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

.placeholder { color: #86868b; font-style: italic; }

/* Latest sync detail */
.sync-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; }
.sync-detail dt { font-weight: 500; color: #6e6e73; font-size: 13px; }
.sync-detail dd { font-size: 14px; margin-bottom: 4px; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; padding: 8px 12px; color: #6e6e73; font-weight: 500; border-bottom: 1px solid #e5e5ea; }
td { padding: 8px 12px; border-bottom: 1px solid #f2f2f7; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.badge-completed { background: #d1f5d9; color: #1a7f37; }
.badge-running { background: #fff3d4; color: #9a6700; }
.badge-failed { background: #ffd7d5; color: #cf222e; }

/* Errors */
#errors-list {
  list-style: none;
  font-size: 13px;
}

#errors-list li {
  padding: 6px 10px;
  background: #fff5f5;
  border-left: 3px solid #ff453a;
  margin-bottom: 4px;
  border-radius: 0 4px 4px 0;
}

/* Browser layout */
.browser-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 16px;
  min-height: 600px;
}

.browser-sidebar {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.browser-controls {
  padding: 16px;
  border-bottom: 1px solid #e5e5ea;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.browser-controls select {
  padding: 8px 10px;
  border: 1px solid #d2d2d7;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  width: 100%;
}

.hotel-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.hotel-item {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  transition: background 0.15s;
}

.hotel-item:hover { background: #f2f2f7; }
.hotel-item.active { background: #e8f0fe; }

.hotel-item-name {
  font-size: 13px;
  font-weight: 500;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hotel-item-stars {
  font-size: 12px;
  color: #ff9f0a;
  white-space: nowrap;
}

/* Hotel detail */
.browser-detail {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  padding: 24px;
  overflow-y: auto;
}

.hotel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.hotel-header h2 {
  font-size: 22px;
  font-weight: 600;
}

.hotel-stars {
  font-size: 18px;
  color: #ff9f0a;
}

.hotel-meta {
  font-size: 13px;
  color: #6e6e73;
  margin-bottom: 20px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  margin-bottom: 20px;
}

.photo-grid img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  background: #f2f2f7;
}

.detail-section { margin-bottom: 20px; }
.detail-section h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }

.amenity-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.amenity-tag {
  padding: 4px 10px;
  background: #f2f2f7;
  border-radius: 14px;
  font-size: 12px;
  color: #1d1d1f;
}

.description-block { font-size: 14px; color: #424245; }
.description-block h4 { font-size: 13px; font-weight: 600; color: #6e6e73; text-transform: capitalize; margin-bottom: 4px; margin-top: 12px; }
.description-block p { margin-bottom: 8px; }

/* Responsive */
@media (max-width: 768px) {
  header { flex-direction: column; align-items: flex-start; }
  #api-config input { width: 100%; }
  .browser-layout { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
}
