/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: #f5f5f5;
  color: #333;
  padding-bottom: 70px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ===== Tab Bar ===== */
.tab-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  display: flex;
  border-top: 1px solid #eee;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.tab-item {
  flex: 1;
  text-align: center;
  padding: 8px 0;
  color: #999;
  text-decoration: none;
  font-size: 12px;
}
.tab-item.active { color: #07c160; }
.tab-icon { display: block; font-size: 22px; margin-bottom: 2px; }
.tab-label { font-size: 11px; }

/* ===== Pages ===== */
.page { display: none; padding: 0 0 20px 0; min-height: 100vh; }
.page.active { display: block; }
.page-title { font-size: 20px; font-weight: bold; padding: 16px 16px 12px; }

/* ===== Banner ===== */
.banner {
  background: linear-gradient(135deg, #07c160, #06ad56);
  padding: 40px 20px;
  text-align: center;
  color: #fff;
}
.banner-title { font-size: 28px; font-weight: bold; margin-bottom: 8px; }
.banner-subtitle { font-size: 15px; opacity: 0.85; }

/* ===== Card ===== */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin: 12px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* ===== Section Title ===== */
.section-title {
  font-size: 18px;
  font-weight: bold;
  padding: 20px 16px 12px;
}

.section-label {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 12px;
}

/* ===== Venue List ===== */
.venue-list { padding: 0 12px; }
.venue-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: transform 0.15s;
}
.venue-card:active { transform: scale(0.98); }
.venue-card .name { flex: 1; font-size: 18px; font-weight: bold; }
.venue-card .status { font-size: 13px; color: #666; margin-right: 12px; }
.venue-card .status .dot {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; margin-right: 4px;
}
.venue-card .status .dot.active { background: #07c160; }
.venue-card .status .dot.inactive { background: #ff4d4f; }
.venue-card .arrow { color: #ccc; font-size: 24px; }

/* ===== Info Card ===== */
.info-card { margin-top: 8px; }
.info-title { font-size: 16px; font-weight: bold; margin-bottom: 12px; }
.info-row {
  display: flex; justify-content: space-between;
  padding: 6px 0; font-size: 14px; color: #666;
}
.info-row .price { color: #e64340; font-weight: 500; }

/* ===== Page Header ===== */
.page-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid #f0f0f0;
}
.page-header h2 { flex: 1; text-align: center; font-size: 17px; margin-right: 40px; }
.back-btn {
  background: none; border: none; font-size: 18px;
  color: #07c160; cursor: pointer; z-index: 1;
}

/* ===== Venue Status ===== */
.venue-status-card {
  display: flex; justify-content: space-between; align-items: center;
}
.venue-name { font-size: 20px; font-weight: bold; }
.venue-tag { font-size: 13px; color: #666; }

/* ===== Date Scroll ===== */
.date-scroll {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 0;
  -webkit-overflow-scrolling: touch;
}
.date-item {
  flex-shrink: 0; padding: 10px 14px; border-radius: 10px;
  background: #f5f5f5; text-align: center; cursor: pointer;
  min-width: 70px; transition: all 0.2s;
}
.date-item.active { background: #07c160; color: #fff; }
.date-label { font-size: 13px; display: block; margin-bottom: 2px; }
.date-num { font-size: 16px; font-weight: bold; display: block; }

/* ===== Time Slot Picker ===== */
.period { margin-bottom: 16px; }
.period-header {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 10px;
}
.period-title { font-size: 15px; font-weight: bold; }
.period-price { font-size: 12px; color: #e64340; background: #fff2f0; padding: 2px 8px; border-radius: 4px; }
.slot-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.slot-item {
  padding: 10px 4px; text-align: center; border-radius: 8px;
  border: 1px solid #e8e8e8; cursor: pointer; font-size: 14px;
  transition: all 0.15s; user-select: none;
}
.slot-item.available { color: #333; }
.slot-item.selected { background: #07c160; color: #fff; border-color: #07c160; }
.slot-item.booked { background: #f5f5f5; color: #ccc; border-color: #eee; cursor: not-allowed; }
.break-time {
  text-align: center; padding: 12px; color: #999;
  font-size: 13px; border-top: 1px dashed #eee; border-bottom: 1px dashed #eee;
  margin: 12px 0;
}
.summary-bar {
  margin-top: 12px; padding: 10px 14px; background: #f0fff4;
  border-radius: 8px; display: flex; justify-content: space-between;
  font-size: 14px;
}
.summary-price { color: #e64340; font-weight: bold; }

/* ===== Footer Bar ===== */
.footer-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff; padding: 12px 16px;
  padding-bottom: calc(62px + env(safe-area-inset-bottom));
  display: flex; align-items: center;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
  z-index: 200;
}
.footer-info { flex: 1; }
.footer-slots { display: block; font-size: 13px; color: #666; }
.footer-price { display: block; font-size: 22px; font-weight: bold; color: #e64340; }
.footer-bar .btn-primary { width: 140px; margin-left: 12px; }

/* ===== Buttons ===== */
.btn-primary {
  background: #07c160; color: #fff; border: none;
  padding: 12px 24px; border-radius: 6px; font-size: 16px;
  cursor: pointer; text-align: center; width: 100%;
}
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary:active { opacity: 0.8; }
.btn-secondary {
  background: #fff; color: #07c160; border: 1px solid #07c160;
  padding: 8px 20px; border-radius: 6px; font-size: 14px; cursor: pointer;
}
.btn-danger {
  background: #e64340; color: #fff; border: none;
  padding: 8px 20px; border-radius: 6px; font-size: 14px; cursor: pointer;
}

/* ===== Booking Detail ===== */
.detail-row {
  display: flex; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid #f5f5f5; font-size: 14px;
}
.detail-row:last-child { border-bottom: none; }
.detail-label { color: #666; }
.detail-value { font-weight: 500; }
.detail-price { font-size: 28px; font-weight: bold; color: #e64340; }

/* ===== Pay Option ===== */
.pay-option {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px; border-radius: 10px;
  border: 1px solid #eee; margin-bottom: 10px; cursor: pointer;
}
.pay-option.active { border-color: #07c160; background: #f0fff4; }
.pay-left { display: flex; align-items: center; gap: 10px; }
.pay-icon { font-size: 24px; }
.pay-name { display: block; font-size: 15px; font-weight: 500; }
.pay-desc { display: block; font-size: 12px; color: #999; margin-top: 2px; }
.pay-check {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid #ddd; display: flex; align-items: center;
  justify-content: center; font-size: 14px; color: #fff;
}
.pay-check.checked { background: #07c160; border-color: #07c160; }

.agreement { text-align: center; font-size: 12px; color: #999; margin-top: 8px; }

/* ===== Tabs ===== */
.tabs {
  display: flex; background: #fff; padding: 0 12px;
  position: sticky; top: 0; z-index: 10;
}
.tab {
  flex: 1; text-align: center; padding: 14px 0;
  font-size: 15px; color: #666; background: none; border: none;
  cursor: pointer; position: relative;
}
.tab.active { color: #07c160; font-weight: bold; }
.tab.active::after {
  content: ''; position: absolute; bottom: 0; left: 50%;
  transform: translateX(-50%); width: 50px; height: 3px;
  background: #07c160; border-radius: 2px;
}

/* ===== Booking List ===== */
.booking-list { padding: 8px 12px; }
.booking-card { margin-bottom: 12px; }
.booking-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.booking-venue { font-size: 17px; font-weight: bold; }
.booking-body { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #666; }
.booking-footer {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid #f5f5f5;
}

/* ===== Tags ===== */
.tag { font-size: 12px; padding: 2px 10px; border-radius: 4px; }
.tag-pending { background: #fff7e6; color: #fa8c16; }
.tag-paid { background: #f6ffed; color: #52c41a; }
.tag-cancelled { background: #fff2f0; color: #ff4d4f; }

/* ===== Form ===== */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 14px; color: #666; margin-bottom: 6px; font-weight: 500; }
.form-input {
  width: 100%; padding: 12px 14px; border: 1px solid #e8e8e8;
  border-radius: 8px; font-size: 15px; outline: none;
  transition: border-color 0.2s; box-sizing: border-box;
  background: #fafafa;
}
.form-input:focus { border-color: #07c160; background: #fff; }
.form-tip { text-align: center; font-size: 13px; color: #999; margin-top: 12px; }

/* ===== User Card ===== */
.user-card { display: flex; align-items: center; flex-wrap: wrap; }
.user-avatar {
  width: 50px; height: 50px; border-radius: 50%; background: #f0f0f0;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; margin-right: 12px;
}
.user-info { flex: 1; }
.user-name { display: block; font-size: 18px; font-weight: bold; }
.user-phone { display: block; font-size: 13px; color: #999; margin-top: 4px; }
.login-btn {
  background: #07c160; color: #fff; border: none;
  padding: 10px 20px; border-radius: 8px; font-size: 14px;
  cursor: pointer; margin-top: 12px; width: 100%;
}

/* ===== Menu ===== */
.menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 0; cursor: pointer;
}
.menu-item:not(:last-child) { border-bottom: 1px solid #f5f5f5; }
.menu-label { flex: 1; font-size: 15px; }
.menu-arrow { color: #ccc; font-size: 20px; }

/* ===== Admin ===== */
.admin-area {
  text-align: center; margin-top: 80px; padding: 20px; cursor: pointer;
  color: #ddd; font-size: 12px; user-select: none;
}
.admin-tabs {
  display: flex; background: #fff;
  position: sticky; top: 0; z-index: 10;
}
.atab {
  flex: 1; text-align: center; padding: 14px 0;
  font-size: 14px; color: #666; background: none; border: none; cursor: pointer;
}
.atab.active { color: #07c160; font-weight: bold; border-bottom: 3px solid #07c160; }
.admin-panel { padding: 12px 16px; }

/* Order Card */
.order-card {
  background: #fff; border-radius: 10px; padding: 14px;
  margin-bottom: 10px; box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.order-header { display: flex; justify-content: space-between; margin-bottom: 8px; }
.order-venue { font-size: 16px; font-weight: bold; }
.order-body { font-size: 13px; color: #666; display: flex; flex-direction: column; gap: 4px; }

/* Stats */
.stats-grid { display: flex; gap: 12px; margin-bottom: 16px; }
.stat-card {
  flex: 1; background: #fff; border-radius: 12px;
  padding: 20px; text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.stat-number { display: block; font-size: 32px; font-weight: bold; color: #07c160; }
.stat-label { display: block; font-size: 13px; color: #999; margin-top: 4px; }

/* Venue Mgmt */
.venue-mgmt-item { margin-bottom: 12px; }
.venue-mgmt-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;
}
.venue-mgmt-name { font-size: 16px; font-weight: bold; }
.venue-mgmt-status { font-size: 12px; color: #999; }
.venue-mgmt-status.on { color: #07c160; }
.remark-input {
  width: 100%; padding: 8px 10px; border: none;
  background: #f5f5f5; border-radius: 6px; font-size: 13px;
  margin-top: 8px; outline: none;
}
/* Toggle switch */
.toggle {
  width: 44px; height: 24px; border-radius: 12px;
  background: #ddd; position: relative; cursor: pointer;
  transition: background 0.2s; border: none; padding: 0;
}
.toggle.on { background: #07c160; }
.toggle::after {
  content: ''; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; position: absolute; top: 2px; left: 2px;
  transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle.on::after { transform: translateX(20px); }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 200;
  display: flex; align-items: center; justify-content: center;
}
.modal-content {
  background: #fff; border-radius: 12px; padding: 24px;
  width: 85%; max-width: 320px;
}
.modal-content h3 { font-size: 18px; margin-bottom: 12px; }
.modal-content p { font-size: 14px; color: #666; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions .btn-secondary { flex: 1; }
.modal-actions .btn-primary { flex: 1; }

/* ===== Toast ===== */
.toast {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.8); color: #fff; padding: 12px 24px;
  border-radius: 8px; font-size: 14px; z-index: 300;
  text-align: center; max-width: 80%;
}

/* ===== Empty State ===== */
.empty { text-align: center; padding: 60px 20px; color: #999; font-size: 14px; }

/* ===== Filter Bar ===== */
.filter-bar { display: flex; gap: 8px; margin-bottom: 12px; }
.filter-btn {
  background: #f5f5f5; border: none; padding: 8px 14px;
  border-radius: 8px; font-size: 13px; cursor: pointer;
}

/* ===== View Toggle ===== */
.view-toggle {
  display: flex; gap: 8px; margin-bottom: 12px;
}
.toggle-btn {
  flex: 1; padding: 10px; border: 1px solid #07c160;
  background: #fff; color: #07c160; border-radius: 8px;
  font-size: 14px; cursor: pointer; text-align: center;
}
.toggle-btn.active { background: #07c160; color: #fff; }

/* ===== Calendar View ===== */
.cal-date-bar {
  display: flex; gap: 8px; overflow-x: auto; margin-bottom: 10px;
  padding: 4px 0; -webkit-overflow-scrolling: touch;
}
.cal-date-pill {
  flex-shrink: 0; padding: 6px 14px; border-radius: 16px;
  background: #f0f0f0; font-size: 13px; cursor: pointer;
  white-space: nowrap; transition: all 0.2s;
}
.cal-date-pill.active { background: #07c160; color: #fff; font-weight: bold; }
.cal-grid {
  border: 1px solid #e8e8e8; border-radius: 8px; overflow: hidden;
  font-size: 11px;
}
.cal-row {
  display: flex; border-bottom: 1px solid #f0f0f0;
}
.cal-row:last-child { border-bottom: none; }
.cal-header { background: #f9f9f9; font-weight: bold; }
.cal-hour { background: #fafafa; }
.cal-time {
  width: 48px; flex-shrink: 0; padding: 6px 4px;
  color: #999; font-size: 10px; text-align: center;
  border-right: 1px solid #f0f0f0;
}
.cal-venue {
  flex: 1; text-align: center; padding: 8px 2px;
  font-size: 13px; border-right: 1px solid #f0f0f0;
}
.cal-venue:last-child { border-right: none; }
.cal-cell {
  flex: 1; min-height: 22px; border-right: 1px solid #f0f0f0;
  display: flex; align-items: center; justify-content: center;
}
.cal-cell:last-child { border-right: none; }
.cal-cell.booked { background: #e8f5e9; }
.cal-cell.free { background: #fff; }
.cal-phone { font-size: 9px; color: #2e7d32; white-space: nowrap; overflow: hidden; }

/* ===== Responsive for desktop ===== */
@media (min-width: 500px) {
  body { max-width: 480px; margin: 0 auto; }
}
